about summary refs log tree commit diff
path: root/tests/ui/regions/explicit-static-bound-on-trait.rs
blob: 835da34d1bbf922e95ecf930f5156ec24b75e63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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() {}