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.
13 pub trait DeclaredTrait {
17 impl DeclaredTrait for i32 {
21 pub trait WhereTrait {
25 impl WhereTrait for i32 {
29 // Make sure we don't add a bound that just shares a name with an associated
35 #[derive(PartialEq, Debug)]
36 struct PrivateStruct<T>(T);
38 #[derive(PartialEq, Debug)]
39 struct TupleStruct<A, B: DeclaredTrait, C>(
47 <B as DeclaredTrait>::Type,
48 Option<<B as DeclaredTrait>::Type>,
52 <C as WhereTrait>::Type,
53 Option<<C as WhereTrait>::Type>,
54 <i32 as DeclaredTrait>::Type,
55 ) where C: WhereTrait;
57 #[derive(PartialEq, Debug)]
58 pub struct Struct<A, B: DeclaredTrait, C> where C: WhereTrait {
60 m2: Option<module::Type>,
66 b3: <B as DeclaredTrait>::Type,
67 b4: Option<<B as DeclaredTrait>::Type>,
71 c3: <C as WhereTrait>::Type,
72 c4: Option<<C as WhereTrait>::Type>,
73 d: <i32 as DeclaredTrait>::Type,
76 #[derive(PartialEq, Debug)]
77 enum Enum<A, B: DeclaredTrait, C> where C: WhereTrait {
87 <B as DeclaredTrait>::Type,
88 Option<<B as DeclaredTrait>::Type>,
92 <C as WhereTrait>::Type,
93 Option<<C as WhereTrait>::Type>,
94 <i32 as DeclaredTrait>::Type,
98 m2: Option<module::Type>,
100 a2: PrivateStruct<A>,
104 b3: <B as DeclaredTrait>::Type,
105 b4: Option<<B as DeclaredTrait>::Type>,
109 c3: <C as WhereTrait>::Type,
110 c4: Option<<C as WhereTrait>::Type>,
111 d: <i32 as DeclaredTrait>::Type,
147 a2: PrivateStruct(0),
162 let e = Enum::Unit::<i32, i32, i32>;
196 a2: PrivateStruct(0),