2015-09-10 11:26:19 -04:00
|
|
|
use std::any::Any;
|
|
|
|
|
|
|
|
fn main()
|
|
|
|
{
|
|
|
|
fn h(x:i32) -> i32 {3*x}
|
2019-05-28 14:46:13 -04:00
|
|
|
let mut vfnfer:Vec<Box<dyn Any>> = vec![];
|
2022-07-07 04:36:10 +02:00
|
|
|
vfnfer.push(Box::new(h));
|
2019-05-28 14:46:13 -04:00
|
|
|
println!("{:?}",(vfnfer[0] as dyn Fn)(3));
|
2015-09-10 11:26:19 -04:00
|
|
|
//~^ ERROR the precise format of `Fn`-family traits'
|
2021-01-02 19:45:11 +01:00
|
|
|
//~| ERROR missing generics for trait `Fn`
|
2020-09-02 10:40:56 +03:00
|
|
|
//~| ERROR the value of the associated type `Output` (from trait `FnOnce`)
|
2015-09-10 11:26:19 -04:00
|
|
|
}
|