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

9 lines
194 B
Rust
Raw Normal View History

trait Trait {}
2019-05-28 13:46:13 -05:00
fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait { panic!("") }
fn main() {
2019-05-28 13:46:13 -05:00
let t : &dyn Trait = &get_function()();
//~^ ERROR cannot move a value of type dyn Trait
}