summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-16922.rs
blob: bbbbf72dbd5d368ef56464102c635a6db4936d91 (plain)
1
2
3
4
5
6
7
8
9
10
use std::any::Any;

fn foo<T: Any>(value: &T) -> Box<dyn Any> {
    Box::new(value) as Box<dyn Any>
    //~^ ERROR lifetime may not live long enough
}

fn main() {
    let _ = foo(&5);
}