rust/src/test/ui/issues/issue-16922.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
154 B
Rust
Raw Normal View History

use std::any::Any;
2019-05-28 18:46:13 +00:00
fn foo<T: Any>(value: &T) -> Box<dyn Any> {
Box::new(value) as Box<dyn Any> //~ ERROR E0759
}
fn main() {
let _ = foo(&5);
}