1 // Copyright 2015 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 // Example cycle where a bound on `T` uses a shorthand for `T`. This
12 // creates a cycle because we have to know the bounds on `T` to figure
13 // out what trait defines `Item`, but we can't know the bounds on `T`
14 // without knowing how to handle `T::Item`.
16 // Note that in the future cases like this could perhaps become legal,
17 // if we got more fine-grained about our cycle detection or changed
18 // how we handle `T::Item` resolution.
23 trait Trait { type Item; }
28 //~^ ERROR cycle detected
29 //~| ERROR associated type `Item` not found for `T`