Skip to content

Commit 136a83a

Browse files
committed
fallout in tests
in some cases we give more specific messages or fewer duplicates, now that we have cache and make fewer region variables
1 parent ad97f29 commit 136a83a

7 files changed

+6
-11
lines changed

src/test/compile-fail/issue-16048.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'a> Test<'a> for Foo<'a> {
2828

2929
impl<'a> NoLifetime for Foo<'a> {
3030
fn get<'p, T : Test<'a>>(&self) -> T {
31-
//~^ ERROR lifetime parameters or bounds on method `get` do not match the trait declaration
31+
//~^ ERROR E0195
3232
return *self as T;
3333
}
3434
}

src/test/compile-fail/issue-20831-debruijn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ impl<'a> Publisher<'a> for MyStruct<'a> {
3939
// Not obvious, but there is an implicit lifetime here -------^
4040
//~^^ ERROR cannot infer
4141
//~| ERROR cannot infer
42-
//~| ERROR cannot infer
4342
//
4443
// The fact that `Publisher` is using an implicit lifetime is
4544
// what was causing the debruijn accounting to be off, so

src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::marker::PhantomData;
1414

1515
struct Bar<'x, 'y, 'z> { bar: &'y i32, baz: i32, marker: PhantomData<(&'x(),&'y(),&'z())> }
1616
fn bar1<'a>(x: &Bar) -> (&'a i32, &'a i32, &'a i32) {
17-
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar1<'a>(x: &'a Bar) -> (&'a i32, &'a i32, &'a i32)
17+
//~^ HELP consider using an explicit lifetime parameter as shown: fn bar1<'b, 'c, 'a>(x: &'a Bar<'b, 'a, 'c>) -> (&'a i32, &'a i32, &'a i32)
1818
(x.bar, &x.baz, &x.baz)
1919
//~^ ERROR E0312
2020
//~| ERROR cannot infer

src/test/compile-fail/lifetime-inference-give-expl-lifetime-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Baz<'x> {
4949

5050
impl<'a> Baz<'a> {
5151
fn baz2<'b>(&self, x: &isize) -> (&'b isize, &'b isize) {
52-
//~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'b isize) -> (&'a isize, &'a isize)
52+
//~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'a isize) -> (&'a isize, &'a isize)
5353
(self.bar, x) //~ ERROR E0312
5454
//~^ ERROR E0312
5555
}

src/test/compile-fail/regions-early-bound-error-method.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ impl<'a> GetRef<'a> for Box<'a> {
2828
impl<'a> Box<'a> {
2929
fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
3030
g2.get()
31-
//~^ ERROR mismatched types
32-
//~| expected type `&'a isize`
33-
//~| found type `&'b isize`
34-
//~| lifetime mismatch
35-
31+
//~^ ERROR E0312
3632
}
3733
}
3834

src/test/compile-fail/regions-early-bound-error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
2727

2828
fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
2929
g1.get()
30-
//~^ ERROR mismatched types
30+
//~^ ERROR E0312
3131
}
3232

3333
fn main() {

src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
struct Invariant<'a> {
13-
f: Box<for<'b> FnOnce() -> &'b mut &'a isize + 'static>,
13+
f: Box<FnOnce() -> *mut &'a isize + 'static>,
1414
}
1515

1616
fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {

0 commit comments

Comments
 (0)