summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.rs
blob: 3bd3f3a757c53fbf5c55a885e4d8e594ba57d9cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Test that we report an error if the trait ref in a qualified type
// uses invalid type arguments.

trait Foo<T> {
    type Bar;
    fn get_bar(&self) -> Self::Bar;
}

fn f<T:Foo<isize>>(t: &T) {
    let u: <T as Foo<usize>>::Bar = t.get_bar();
    //~^ ERROR the trait bound `T: Foo<usize>` is not satisfied
}

fn main() { }