rust/tests/ui/issues/issue-23024.rs

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

13 lines
360 B
Rust
Raw Normal View History

use std::any::Any;
fn main()
{
fn h(x:i32) -> i32 {3*x}
2019-05-28 18:46:13 +00:00
let mut vfnfer:Vec<Box<dyn Any>> = vec![];
vfnfer.push(Box::new(h));
2019-05-28 18:46:13 +00:00
println!("{:?}",(vfnfer[0] as dyn Fn)(3));
//~^ ERROR the precise format of `Fn`-family traits'
//~| ERROR missing generics for trait `Fn`
//~| ERROR the value of the associated type `Output` in `FnOnce`
}