diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/cycle-projection-based-on-where-clause.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/cycle-trait-default-type-trait.rs (renamed from src/test/compile-fail/duplicate-trait-bounds.rs) | 11 | ||||
| -rw-r--r-- | src/test/compile-fail/cycle-trait-supertrait-indirect.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/infinite-vec-type-recursion.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-18389.rs | 9 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-3953.rs | 5 |
6 files changed, 19 insertions, 17 deletions
diff --git a/src/test/compile-fail/cycle-projection-based-on-where-clause.rs b/src/test/compile-fail/cycle-projection-based-on-where-clause.rs index abcbf567d44..5ca0700ce6e 100644 --- a/src/test/compile-fail/cycle-projection-based-on-where-clause.rs +++ b/src/test/compile-fail/cycle-projection-based-on-where-clause.rs @@ -25,7 +25,7 @@ trait Trait { type Item; } struct A<T> where T : Trait, T : Add<T::Item> - //~^ ERROR illegal recursive type + //~^ ERROR unsupported cyclic reference between types/traits detected { data: T } diff --git a/src/test/compile-fail/duplicate-trait-bounds.rs b/src/test/compile-fail/cycle-trait-default-type-trait.rs index d9aa9d9dfcc..e6caeb34a8c 100644 --- a/src/test/compile-fail/duplicate-trait-bounds.rs +++ b/src/test/compile-fail/cycle-trait-default-type-trait.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -trait Foo {} +// Test a cycle where a type parameter on a trait has a default that +// again references the trait. -fn foo<T: Foo + Foo>() {} //~ ERROR `Foo` already appears in the list of bounds +trait Foo<X = Box<Foo>> { + //~^ ERROR unsupported cyclic reference +} -fn main() {} +fn main() { } diff --git a/src/test/compile-fail/cycle-trait-supertrait-indirect.rs b/src/test/compile-fail/cycle-trait-supertrait-indirect.rs index 6ebd9a1bcb6..c9bfde3f4ed 100644 --- a/src/test/compile-fail/cycle-trait-supertrait-indirect.rs +++ b/src/test/compile-fail/cycle-trait-supertrait-indirect.rs @@ -12,9 +12,12 @@ // a direct participant in the cycle. trait A: B { + //~^ ERROR unsupported cyclic reference } -trait B: C { } +trait B: C { + //~^ ERROR unsupported cyclic reference +} trait C: B { } //~^ ERROR unsupported cyclic reference diff --git a/src/test/compile-fail/infinite-vec-type-recursion.rs b/src/test/compile-fail/infinite-vec-type-recursion.rs index 5bcba350b2e..e5120840f76 100644 --- a/src/test/compile-fail/infinite-vec-type-recursion.rs +++ b/src/test/compile-fail/infinite-vec-type-recursion.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: illegal recursive type - - type x = Vec<x>; +//~^ ERROR unsupported cyclic reference fn main() { let b: x = Vec::new(); } diff --git a/src/test/compile-fail/issue-18389.rs b/src/test/compile-fail/issue-18389.rs index 9065a5b9605..271c31bd375 100644 --- a/src/test/compile-fail/issue-18389.rs +++ b/src/test/compile-fail/issue-18389.rs @@ -12,18 +12,17 @@ use std::any::Any; use std::any::TypeId; +use std::marker::MarkerTrait; -pub trait Pt {} -pub trait Rt {} +pub trait Pt : MarkerTrait {} +pub trait Rt : MarkerTrait {} trait Private<P: Pt, R: Rt> { fn call(&self, p: P, r: R); } -pub trait Public: Private< +pub trait Public: Private< //~ ERROR private trait in exported type parameter bound <Self as Public>::P, -//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired <Self as Public>::R -//~^ ERROR unsupported cyclic reference between types/traits detected > { type P; type R; diff --git a/src/test/compile-fail/issue-3953.rs b/src/test/compile-fail/issue-3953.rs index 0f1dd2d7fd6..678a7806e7a 100644 --- a/src/test/compile-fail/issue-3953.rs +++ b/src/test/compile-fail/issue-3953.rs @@ -13,7 +13,6 @@ use std::cmp::PartialEq; trait Hahaha: PartialEq + PartialEq { - //~^ ERROR trait `PartialEq` already appears in the list of bounds } struct Lol(isize); @@ -21,8 +20,8 @@ struct Lol(isize); impl Hahaha for Lol { } impl PartialEq for Lol { - fn eq(&self, other: &Lol) -> bool { **self != **other } - fn ne(&self, other: &Lol) -> bool { **self == **other } + fn eq(&self, other: &Lol) -> bool { loop { } } + fn ne(&self, other: &Lol) -> bool { loop { } } } fn main() { |
