about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-trait/bad-projection-from-opaque.rs
blob: c2c22cd1abfcc5a4677df594e7e50f19efba356d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// issue: rust-lang/rust#126725

trait Foo {
    fn foo<'a>() -> <&'a impl Sized as Bar>::Output;
    //~^ ERROR `impl Trait` is not allowed in paths
}

trait Bar {
    type Output;
}

impl<'a> Bar for &'a () {
    type Output = &'a i32;
}

impl Foo for () {
    fn foo<'a>() -> <&'a Self as Bar>::Output {
        &0
    }
}

fn main() {}