rust/tests/ui/regions/explicit-static-bound-on-tr...

14 lines
294 B
Rust

struct Hello<'a> {
value: Box<dyn std::any::Any + 'a>,
//~^ ERROR lifetime bound not satisfied
}
impl<'a> Hello<'a> {
fn new<T: 'a>(value: T) -> Self {
Self { value: Box::new(value) }
//~^ ERROR the parameter type `T` may not live long enough
}
}
fn main() {}