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

14 lines
426 B
Rust
Raw Normal View History

#![feature(box_syntax)]
use std::any::Any;
fn main()
{
fn h(x:i32) -> i32 {3*x}
2019-05-28 13:46:13 -05:00
let mut vfnfer:Vec<Box<dyn Any>> = vec![];
vfnfer.push(box h);
2019-05-28 13:46:13 -05:00
println!("{:?}",(vfnfer[0] as dyn Fn)(3));
//~^ ERROR the precise format of `Fn`-family traits'
2018-08-21 20:12:23 -05:00
//~| ERROR wrong number of type arguments: expected 1, found 0 [E0107]
//~| ERROR the value of the associated type `Output` (from trait `std::ops::FnOnce`)
}