1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Check that we get an error when you use `<Self as Get>::Value` in
12 // the trait definition but `Self` does not, in fact, implement `Get`.
14 // See also associated-types-no-suitable-supertrait-2.rs, which checks
15 // that we see the same error if we get around to checking the default
18 // See also run-pass/associated-types-projection-to-unrelated-trait.rs,
19 // which checks that the trait interface itself is not considered an
20 // error as long as all impls satisfy the constraint.
27 fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
28 //~^ ERROR the trait bound `Self: Get` is not satisfied
31 impl<T:Get> Other for T {
32 fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
33 //~^ ERROR the trait bound `(T, U): Get` is not satisfied