2014-08-11 19:12:01 -05:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2015-04-18 00:12:20 -05:00
|
|
|
trait Trait {}
|
2014-08-11 19:12:01 -05:00
|
|
|
|
|
|
|
struct Foo<T:Trait> {
|
|
|
|
x: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Bar<T:Trait> {
|
2015-01-08 04:54:35 -06:00
|
|
|
ABar(isize),
|
2014-08-11 19:12:01 -05:00
|
|
|
BBar(T),
|
2015-01-08 05:02:42 -06:00
|
|
|
CBar(usize),
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
2014-09-12 09:45:39 -05:00
|
|
|
fn explode(x: Foo<u32>) {}
|
|
|
|
//~^ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
|
|
|
|
fn kaboom(y: Bar<f32>) {}
|
2014-09-12 09:45:39 -05:00
|
|
|
//~^ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
|
2014-09-12 09:45:39 -05:00
|
|
|
impl<T> Foo<T> {
|
|
|
|
//~^ ERROR the trait `Trait` is not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
fn uhoh() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz {
|
2015-06-11 11:44:42 -05:00
|
|
|
a: Foo<isize>, //~ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
enum Boo {
|
2015-06-11 11:44:42 -05:00
|
|
|
Quux(Bar<usize>), //~ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
2014-12-26 14:37:56 -06:00
|
|
|
struct Badness<U> {
|
2015-06-11 11:44:42 -05:00
|
|
|
b: Foo<U>, //~ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
2014-12-26 14:37:56 -06:00
|
|
|
enum MoreBadness<V> {
|
2015-06-11 11:44:42 -05:00
|
|
|
EvenMoreBadness(Bar<V>), //~ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
trait PolyTrait<T>
|
|
|
|
{
|
|
|
|
fn whatever(&self, t: T) {}
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Struct;
|
|
|
|
|
2015-01-08 05:02:42 -06:00
|
|
|
impl PolyTrait<Foo<usize>> for Struct {
|
2014-09-12 09:45:39 -05:00
|
|
|
//~^ ERROR not implemented
|
2014-08-11 19:12:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|