]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
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. | |
4 | // | |
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. | |
10 | ||
9346a6ac | 11 | trait Trait {} |
1a4d82fc JJ |
12 | |
13 | struct Foo<T:Trait> { | |
14 | x: T, | |
15 | } | |
16 | ||
17 | enum Bar<T:Trait> { | |
18 | ABar(isize), | |
19 | BBar(T), | |
20 | CBar(usize), | |
21 | } | |
22 | ||
1a4d82fc | 23 | impl<T> Foo<T> { |
54a0048b | 24 | //~^ ERROR `T: Trait` is not satisfied |
1a4d82fc JJ |
25 | fn uhoh() {} |
26 | } | |
27 | ||
28 | struct Baz { | |
54a0048b | 29 | a: Foo<isize>, //~ ERROR E0277 |
1a4d82fc JJ |
30 | } |
31 | ||
32 | enum Boo { | |
54a0048b | 33 | Quux(Bar<usize>), //~ ERROR E0277 |
1a4d82fc JJ |
34 | } |
35 | ||
36 | struct Badness<U> { | |
54a0048b | 37 | b: Foo<U>, //~ ERROR E0277 |
1a4d82fc JJ |
38 | } |
39 | ||
40 | enum MoreBadness<V> { | |
54a0048b | 41 | EvenMoreBadness(Bar<V>), //~ ERROR E0277 |
62682a34 SL |
42 | } |
43 | ||
44 | struct TupleLike( | |
54a0048b | 45 | Foo<i32>, //~ ERROR E0277 |
62682a34 SL |
46 | ); |
47 | ||
48 | enum Enum { | |
54a0048b | 49 | DictionaryLike { field: Bar<u8> }, //~ ERROR E0277 |
1a4d82fc JJ |
50 | } |
51 | ||
1a4d82fc JJ |
52 | fn main() { |
53 | } |