Skip to content

Commit b88f867

Browse files
committed
Update error messages in compile-fail tests
1 parent a8d478d commit b88f867

File tree

87 files changed

+381
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+381
-256
lines changed

src/test/compile-fail/bad-method-typaram-kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
fn foo<T:'static>() {
12-
1u.bar::<T>(); //~ ERROR: does not fulfill `Send`
12+
1u.bar::<T>(); //~ ERROR `core::kinds::Send` is not implemented
1313
}
1414

1515
trait bar {

src/test/compile-fail/bad-sized.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ trait Trait {}
1616

1717
pub fn main() {
1818
let x: Vec<Trait + Sized> = Vec::new();
19-
//~^ ERROR instantiating a type parameter with an incompatible type `Trait+Sized`, which does not fulfill `Sized`
20-
//~^^ ERROR instantiating a type parameter with an incompatible type `Trait+Sized`, which does not fulfill `Sized`
21-
//~^^^ ERROR instantiating a type parameter with an incompatible type `Trait+Sized`, which does not fulfill `Sized`
19+
//~^ ERROR the trait `core::kinds::Sized` is not implemented
20+
//~^^ ERROR the trait `core::kinds::Sized` is not implemented
2221
let x: Vec<Box<RefCell<Trait + Sized>>> = Vec::new();
23-
//~^ ERROR instantiating a type parameter with an incompatible type `Trait+Sized`, which does not fulfill `Sized`
24-
//~^^ ERROR instantiating a type parameter with an incompatible type `Trait+Sized`, which does not fulfill `Sized`
22+
//~^ ERROR the trait `core::kinds::Sized` is not implemented
2523
}

src/test/compile-fail/builtin-superkinds-double-superkind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
trait Foo : Send+Sync { }
1515

16-
impl <T: Sync> Foo for (T,) { } //~ ERROR cannot implement this trait
16+
impl <T: Sync+'static> Foo for (T,) { } //~ ERROR the trait `core::kinds::Send` is not implemented
1717

18-
impl <T: Send> Foo for (T,T) { } //~ ERROR cannot implement this trait
18+
impl <T: Send> Foo for (T,T) { } //~ ERROR the trait `core::kinds::Sync` is not implemented
1919

2020
impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
2121

src/test/compile-fail/builtin-superkinds-in-metadata.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct X<T>(T);
2121

2222
impl <T:Sync> RequiresShare for X<T> { }
2323

24-
impl <T:Sync> RequiresRequiresShareAndSend for X<T> { } //~ ERROR cannot implement this trait
24+
impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
25+
//~^ ERROR the trait `core::kinds::Send` is not implemented
2526

2627
fn main() { }

src/test/compile-fail/builtin-superkinds-self-type.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// to use capabilities granted by builtin kinds as supertraits.
1313

1414
trait Foo : Sync+'static {
15-
fn foo(self, mut chan: Sender<Self>) {
16-
chan.send(self); //~ ERROR does not fulfill `Send`
17-
}
15+
fn foo(self, mut chan: Sender<Self>) { }
1816
}
1917

2018
impl <T: Sync> Foo for T { }
19+
//~^ ERROR the parameter type `T` may not live long enough
20+
//~^^ ERROR the parameter type `T` may not live long enough
2121

2222
fn main() {
2323
let (tx, rx) = channel();

src/test/compile-fail/builtin-superkinds-simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
trait Foo : Send { }
1515

1616
impl <'a> Foo for &'a mut () { }
17-
//~^ ERROR which does not fulfill `Send`, cannot implement this trait
17+
//~^ ERROR does not fulfill the required lifetime
1818

1919
fn main() { }

src/test/compile-fail/builtin-superkinds-typaram-not-send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
trait Foo : Send { }
1414

15-
impl <T: Sync> Foo for T { } //~ ERROR cannot implement this trait
15+
impl <T: Sync+'static> Foo for T { } //~ ERROR the trait `core::kinds::Send` is not implemented
1616

1717
fn main() { }

src/test/compile-fail/comm-not-freeze.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fn test<T: Sync>() {}
1212

1313
fn main() {
14-
test::<Sender<int>>(); //~ ERROR: does not fulfill `Sync`
15-
test::<Receiver<int>>(); //~ ERROR: does not fulfill `Sync`
16-
test::<Sender<int>>(); //~ ERROR: does not fulfill `Sync`
14+
test::<Sender<int>>(); //~ ERROR: `core::kinds::Sync` is not implemented
15+
test::<Receiver<int>>(); //~ ERROR: `core::kinds::Sync` is not implemented
16+
test::<Sender<int>>(); //~ ERROR: `core::kinds::Sync` is not implemented
1717
}

src/test/compile-fail/conflicting-implementations-aux.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
extern crate trait_impl_conflict;
1616
use trait_impl_conflict::Foo;
1717

18-
impl<A> Foo for A {
19-
//~^ ERROR conflicting implementations for trait `trait_impl_conflict::Foo`
20-
//~^^ ERROR cannot provide an extension implementation where both trait and type
21-
// are not defined in this crate
18+
impl<A> Foo for A { //~ ERROR E0117
2219
}
2320

2421
fn main() {

src/test/compile-fail/conflicting-implementations.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: conflicting implementations for trait `Foo`
1211
trait Foo {
1312
}
1413

15-
impl Foo for int {
14+
impl Foo for int { //~ ERROR conflicting implementations
1615

1716
}
1817

19-
impl<A> Foo for A {
18+
impl<A> Foo for A { //~ NOTE conflicting implementation here
2019

2120
}
2221

0 commit comments

Comments
 (0)