2015-09-10 10:26:19 -05:00
|
|
|
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![];
|
2022-07-06 21:36:10 -05:00
|
|
|
vfnfer.push(Box::new(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'
|
2021-01-02 12:45:11 -06:00
|
|
|
//~| ERROR missing generics for trait `Fn`
|
2020-09-02 02:40:56 -05:00
|
|
|
//~| ERROR the value of the associated type `Output` (from trait `FnOnce`)
|
2015-09-10 10:26:19 -05:00
|
|
|
}
|