#![feature(dyn_star)] //~ WARNING the feature `dyn_star` is incomplete use std::future::Future; pub fn dyn_func( executor: impl FnOnce(T) -> dyn Future, ) -> Box dyn Future> { Box::new(executor) //~ ERROR may not live long enough } pub fn dyn_star_func( executor: impl FnOnce(T) -> dyn* Future, ) -> Box dyn* Future> { Box::new(executor) //~ ERROR may not live long enough } trait Trait { fn method(&self) {} } impl Trait for fn() {} pub fn in_ty_param dyn std::fmt::Debug> (t: T) { t.method(); //~^ ERROR no method named `method` found for type parameter `T` } fn with_sized &'static (dyn std::fmt::Debug) + ?Sized>() { without_sized::(); //~^ ERROR the size for values of type `T` cannot be known at compilation time } fn without_sized &'static dyn std::fmt::Debug>() {} fn main() {}