2015-04-18 05:12:20 +00:00
|
|
|
trait Trait {}
|
2014-08-12 00:12:01 +00:00
|
|
|
|
|
|
|
struct Foo<T:Trait> {
|
|
|
|
x: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Bar<T:Trait> {
|
2015-01-08 10:54:35 +00:00
|
|
|
ABar(isize),
|
2014-08-12 00:12:01 +00:00
|
|
|
BBar(T),
|
2015-01-08 11:02:42 +00:00
|
|
|
CBar(usize),
|
2014-08-12 00:12:01 +00:00
|
|
|
}
|
|
|
|
|
2014-09-12 14:45:39 +00:00
|
|
|
impl<T> Foo<T> {
|
2016-04-05 19:56:23 +00:00
|
|
|
//~^ ERROR `T: Trait` is not satisfied
|
2014-08-12 00:12:01 +00:00
|
|
|
fn uhoh() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz {
|
2016-03-29 17:12:31 +00:00
|
|
|
a: Foo<isize>, //~ ERROR E0277
|
2014-08-12 00:12:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum Boo {
|
2016-03-29 17:12:31 +00:00
|
|
|
Quux(Bar<usize>), //~ ERROR E0277
|
2014-08-12 00:12:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-26 20:37:56 +00:00
|
|
|
struct Badness<U> {
|
2016-03-29 17:12:31 +00:00
|
|
|
b: Foo<U>, //~ ERROR E0277
|
2014-08-12 00:12:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-26 20:37:56 +00:00
|
|
|
enum MoreBadness<V> {
|
2016-03-29 17:12:31 +00:00
|
|
|
EvenMoreBadness(Bar<V>), //~ ERROR E0277
|
2014-08-12 00:12:01 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 12:09:17 +00:00
|
|
|
struct TupleLike(
|
2016-03-29 17:12:31 +00:00
|
|
|
Foo<i32>, //~ ERROR E0277
|
2015-06-12 12:09:17 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
enum Enum {
|
2016-03-29 17:12:31 +00:00
|
|
|
DictionaryLike { field: Bar<u8> }, //~ ERROR E0277
|
2015-06-12 12:09:17 +00:00
|
|
|
}
|
|
|
|
|
2014-08-12 00:12:01 +00:00
|
|
|
fn main() {
|
|
|
|
}
|