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

9 lines
182 B
Rust
Raw Normal View History

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