summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-41139.rs
blob: 94c53216f50ac0f77560a4877b5c6223c824101d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
trait Trait {}

fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait {
    panic!("")
}

fn main() {
    // This isn't great. The issue here is that `dyn Trait` is not sized, so
    // `dyn Fn() -> dyn Trait` is not well-formed.
    let t: &dyn Trait = &get_function()();
    //~^ ERROR expected function, found `&dyn Fn() -> (dyn Trait + 'static)`
}