diff options
| author | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
| commit | 522d09dfecbeca1595f25ac58c6d0178bbd21d7d (patch) | |
| tree | cc0252dd3413e5f890d0ebcfdaa096e5b002be0b /src/test/compile-fail/trait-bounds-impl-comparison-1.rs | |
| parent | 0b664bb8436f2cfda7f13a6f302ab486f332816f (diff) | |
| parent | 49771bafa5fca16486bfd06741dac3de2c587adf (diff) | |
| download | rust-1.0.0-alpha.2.tar.gz rust-1.0.0-alpha.2.zip | |
Auto merge of #22541 - Manishearth:rollup, r=Gankro 1.0.0-alpha.2
Continued from #22520
Diffstat (limited to 'src/test/compile-fail/trait-bounds-impl-comparison-1.rs')
| -rw-r--r-- | src/test/compile-fail/trait-bounds-impl-comparison-1.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/test/compile-fail/trait-bounds-impl-comparison-1.rs b/src/test/compile-fail/trait-bounds-impl-comparison-1.rs index 477bd4f5be9..34e06cc9365 100644 --- a/src/test/compile-fail/trait-bounds-impl-comparison-1.rs +++ b/src/test/compile-fail/trait-bounds-impl-comparison-1.rs @@ -11,7 +11,10 @@ // Make sure rustc checks the type parameter bounds in implementations of traits, // see #2687 -trait A {} +use std::marker; + +trait A : marker::PhantomFn<Self> { +} trait B: A {} @@ -62,15 +65,16 @@ impl Foo for isize { //~^ ERROR the requirement `T : C` appears on the impl } - -trait Getter<T> { } +trait Getter<T> { + fn get(&self) -> T { loop { } } +} trait Trait { - fn method<G:Getter<isize>>(); + fn method<G:Getter<isize>>(&self); } impl Trait for usize { - fn method<G: Getter<usize>>() {} + fn method<G: Getter<usize>>(&self) {} //~^ G : Getter<usize>` appears on the impl method but not on the corresponding trait method } |
