]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-16922.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-16922.rs
1 use std::any::Any;
2
3 fn foo<T: Any>(value: &T) -> Box<dyn Any> {
4     Box::new(value) as Box<dyn Any>
5     //~^ ERROR lifetime may not live long enough
6 }
7
8 fn main() {
9     let _ = foo(&5);
10 }