]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.rs
Auto merge of #103659 - clubby789:improve-partialord-derive, r=nagisa
[rust.git] / tests / ui / associated-types / associated-types-invalid-trait-ref-issue-18865.rs
1 // Test that we report an error if the trait ref in a qualified type
2 // uses invalid type arguments.
3
4 trait Foo<T> {
5     type Bar;
6     fn get_bar(&self) -> Self::Bar;
7 }
8
9 fn f<T:Foo<isize>>(t: &T) {
10     let u: <T as Foo<usize>>::Bar = t.get_bar();
11     //~^ ERROR the trait bound `T: Foo<usize>` is not satisfied
12 }
13
14 fn main() { }