1 // Check that we get an error when you use `<Self as Get>::Value` in 2 // the trait definition but `Self` does not, in fact, implement `Get`. 3 // 4 // See also associated-types-no-suitable-supertrait.rs, which checks 5 // that we see the same error when making this mistake on an impl 6 // rather than the default method impl. 7 // 8 // See also run-pass/associated-types-projection-to-unrelated-trait.rs, 9 // which checks that the trait interface itself is not considered an 10 // error as long as all impls satisfy the constraint. 11 12 trait Get { 13 type Value; 14 } 15 16 trait Other { uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value)17 fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} 18 //~^ ERROR the trait bound `Self: Get` is not satisfied 19 } 20 main()21fn main() { } 22