2015-09-10 10:26:19 -05:00
|
|
|
#![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![];
|
2015-09-10 10:26:19 -05:00
|
|
|
vfnfer.push(box h);
|
2019-05-28 13:46:13 -05:00
|
|
|
println!("{:?}",(vfnfer[0] as dyn Fn)(3));
|
2015-09-10 10:26:19 -05:00
|
|
|
//~^ 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]
|
2019-12-12 16:48:46 -06:00
|
|
|
//~| ERROR the value of the associated type `Output` (from trait `std::ops::FnOnce`)
|
2015-09-10 10:26:19 -05:00
|
|
|
}
|