aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2369.rs
blob: 9475aef9d71f330fd72659f81687b37c17771189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#[lang = "sized"]
trait Sized {}

fn main() {
    pub trait Foo {
        type A;
        fn boo(&self) -> <Self as Foo>::A;
    }

    struct Bar;

    impl Foo for isize {
        type A = usize;
        fn boo(&self) -> usize {
            42
        }
    }

    fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
    // { dg-error "associated type bindings are not allowed here .E0229." "" { target *-*-* } .-1 }
}