2020-06-28 14:34:56 -05:00
|
|
|
error[E0618]: expected function, found `&dyn std::ops::Fn() -> (dyn Trait + 'static)`
|
|
|
|
--> $DIR/issue-41139.rs:8:27
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
2020-06-28 14:34:56 -05:00
|
|
|
LL | fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait { panic!("") }
|
|
|
|
| ----------------------------------------------------------------- `get_function` defined here returns `&dyn std::ops::Fn() -> (dyn Trait + 'static)`
|
|
|
|
...
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let t : &dyn Trait = &get_function()();
|
2020-06-28 14:34:56 -05:00
|
|
|
| ^^^^^^^^^^^^^^--
|
|
|
|
| |
|
|
|
|
| call expression requires function
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2020-06-28 14:34:56 -05:00
|
|
|
For more information about this error, try `rustc --explain E0618`.
|