Skip to content

Commit a19db49

Browse files
committed
Update former compile-fail tests
1 parent 3c8eb4e commit a19db49

File tree

46 files changed

+105
-94
lines changed

Some content is hidden

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

46 files changed

+105
-94
lines changed

src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
1818
| |
1919
| lifetime `'a` defined here
2020
LL | let a = bar(foo, y);
21-
| ^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
21+
| ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
2222

2323
error: unsatisfied lifetime constraints
2424
--> $DIR/project-fn-ret-contravariant.rs:54:12
@@ -29,7 +29,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
2929
| lifetime `'a` defined here
3030
LL | let a = bar(foo, y);
3131
LL | let b = bar(foo, x);
32-
| ^^^^^^^^^^^ argument requires that `'a` must outlive `'b`
32+
| ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
3333

3434
error: aborting due to 2 previous errors
3535

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ warning: not reporting region error due to nll
44
LL | bar(foo, x) //[transmute]~ ERROR E0495
55
| ^^^
66

7-
error: borrowed data escapes outside of function
7+
error: unsatisfied lifetime constraints
88
--> $DIR/project-fn-ret-contravariant.rs:48:4
99
|
1010
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
11-
| - `x` is a reference that is only valid in the function body
11+
| -- lifetime `'a` defined here
1212
LL | bar(foo, x) //[transmute]~ ERROR E0495
13-
| ^^^^^^^^^^^ `x` escapes the function body here
13+
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
1414

1515
error: aborting due to previous error
1616

src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
1818
| |
1919
| lifetime `'a` defined here
2020
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
21-
| ^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
21+
| ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
2222

2323
error: unsatisfied lifetime constraints
2424
--> $DIR/project-fn-ret-invariant.rs:64:12
@@ -29,7 +29,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
2929
| lifetime `'a` defined here
3030
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
3131
LL | let b = bar(foo, x);
32-
| ^^^^^^^^^^^ argument requires that `'a` must outlive `'b`
32+
| ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
3333

3434
error: aborting due to 2 previous errors
3535

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ warning: not reporting region error due to nll
44
LL | bar(foo, x) //[transmute]~ ERROR E0495
55
| ^^^
66

7-
error: borrowed data escapes outside of function
7+
error: unsatisfied lifetime constraints
88
--> $DIR/project-fn-ret-invariant.rs:58:4
99
|
1010
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
11-
| - `x` is a reference that is only valid in the function body
11+
| -- lifetime `'a` defined here
1212
...
1313
LL | bar(foo, x) //[transmute]~ ERROR E0495
14-
| ^^^^^^^^^^^ `x` escapes the function body here
14+
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
1515

1616
error: aborting due to previous error
1717

src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than
3535
LL | | *y = 1;
3636
LL | | drop(y);
3737
LL | | }
38-
| |_________________^ requires that `'1` must outlive `'2`
38+
| |_________________^ returning this value requires that `'1` must outlive `'2`
3939
|
4040
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
4141

src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than
3535
LL | | *y = 1;
3636
LL | | drop(y);
3737
LL | | }
38-
| |_________________^ requires that `'1` must outlive `'2`
38+
| |_________________^ returning this value requires that `'1` must outlive `'2`
3939
|
4040
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
4141

src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ LL | S { pointer: &mut *p.pointer }
55
| ^^^^^^^^^^^^^^^
66

77
error: unsatisfied lifetime constraints
8-
--> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:18
8+
--> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:5
99
|
1010
LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
1111
| -- -- lifetime `'b` defined here
1212
| |
1313
| lifetime `'a` defined here
1414
LL | S { pointer: &mut *p.pointer }
15-
| ^^^^^^^^^^^^^^^ requires that `'a` must outlive `'b`
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1616

1717
error: aborting due to previous error
1818

src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ error: unsatisfied lifetime constraints
4040
--> $DIR/must_outlive_least_region_or_bound.rs:16:44
4141
|
4242
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
43-
| -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static`
43+
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
4444

4545
error: unsatisfied lifetime constraints
4646
--> $DIR/must_outlive_least_region_or_bound.rs:22:69
4747
|
4848
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
49-
| -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static`
49+
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
5050

5151
error: unsatisfied lifetime constraints
5252
--> $DIR/must_outlive_least_region_or_bound.rs:29:5
@@ -57,7 +57,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
5757
| lifetime `'a` defined here
5858
LL | //~^ ERROR lifetime mismatch
5959
LL | move |_| println!("{}", y)
60-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
60+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
6161

6262
error[E0310]: the parameter type `T` may not live long enough
6363
--> $DIR/must_outlive_least_region_or_bound.rs:34:5

src/test/ui/lub-if.nll.stderr

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ LL | s //~ ERROR E0312
1111
| ^
1212

1313
error: unsatisfied lifetime constraints
14-
--> $DIR/lub-if.rs:34:8
14+
--> $DIR/lub-if.rs:38:9
1515
|
1616
LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
1717
| -- lifetime `'a` defined here
18-
LL | if maybestr.is_none() {
19-
| ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
18+
...
19+
LL | s //~ ERROR E0312
20+
| ^ returning this value requires that `'a` must outlive `'static`
2021

2122
error: unsatisfied lifetime constraints
22-
--> $DIR/lub-if.rs:43:8
23+
--> $DIR/lub-if.rs:45:9
2324
|
2425
LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
2526
| -- lifetime `'a` defined here
26-
LL | if maybestr.is_some() {
27-
| ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
27+
...
28+
LL | s //~ ERROR E0312
29+
| ^ returning this value requires that `'a` must outlive `'static`
2830

2931
error: aborting due to 2 previous errors
3032

src/test/ui/lub-match.nll.stderr

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ LL | s //~ ERROR E0312
1111
| ^
1212

1313
error: unsatisfied lifetime constraints
14-
--> $DIR/lub-match.rs:36:11
14+
--> $DIR/lub-match.rs:40:13
1515
|
1616
LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
1717
| -- lifetime `'a` defined here
18-
LL | match *maybestr {
19-
| ^^^^^^^^^ requires that `'a` must outlive `'static`
18+
...
19+
LL | s //~ ERROR E0312
20+
| ^ returning this value requires that `'a` must outlive `'static`
2021

2122
error: unsatisfied lifetime constraints
22-
--> $DIR/lub-match.rs:46:11
23+
--> $DIR/lub-match.rs:49:13
2324
|
2425
LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str {
2526
| -- lifetime `'a` defined here
26-
LL | match *maybestr {
27-
| ^^^^^^^^^ requires that `'a` must outlive `'static`
27+
...
28+
LL | s //~ ERROR E0312
29+
| ^ returning this value requires that `'a` must outlive `'static`
2830

2931
error: aborting due to 2 previous errors
3032

src/test/ui/match/match-ref-mut-invariance.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
1515
| | lifetime `'a` defined here
1616
LL | | match self.0 { ref mut x => x } //~ ERROR mismatched types
1717
LL | | }
18-
| |_____^ requires that `'a` must outlive `'b`
18+
| |_____^ returning this value requires that `'a` must outlive `'b`
1919

2020
error: aborting due to previous error
2121

src/test/ui/match/match-ref-mut-let-invariance.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
1616
LL | | let ref mut x = self.0;
1717
LL | | x //~ ERROR mismatched types
1818
LL | | }
19-
| |_____^ requires that `'a` must outlive `'b`
19+
| |_____^ returning this value requires that `'a` must outlive `'b`
2020

2121
error: aborting due to previous error
2222

src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | | // for<'a,'b,'c>fn(&'a (SomeTrait+'c)) -> &'b (SomeTrait+'a)
1818
... |
1919
LL | | //~| ERROR cannot infer
2020
LL | | }
21-
| |_^ return requires that `'a` must outlive `'b`
21+
| |_^ returning this value requires that `'a` must outlive `'b`
2222

2323
error: aborting due to previous error
2424

src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LL | fn load1<'a,'b>(a: &'a MyBox<SomeTrait>,
1919
| lifetime `'a` defined here
2020
...
2121
LL | a //~ ERROR lifetime mismatch
22-
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
22+
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
2323

2424
error: borrowed data escapes outside of function
2525
--> $DIR/object-lifetime-default-mybox.rs:41:5

src/test/ui/regions/region-object-lifetime-2.nll.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ warning: not reporting region error due to nll
44
LL | x.borrowed() //~ ERROR cannot infer
55
| ^^^^^^^^
66

7-
error: borrowed data escapes outside of function
7+
error: unsatisfied lifetime constraints
88
--> $DIR/region-object-lifetime-2.rs:20:5
99
|
1010
LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () {
11-
| - `x` is a reference that is only valid in the function body
11+
| -- -- lifetime `'b` defined here
12+
| |
13+
| lifetime `'a` defined here
1214
LL | x.borrowed() //~ ERROR cannot infer
13-
| ^^^^^^^^^^^^ `x` escapes the function body here
15+
| ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
1416

1517
error: aborting due to previous error
1618

src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> {
6767
LL | | Box::new(v)
6868
LL | | //~^ ERROR cannot infer an appropriate lifetime due to conflicting
6969
LL | | }
70-
| |_^ return requires that `'a` must outlive `'b`
70+
| |_^ returning this value requires that `'a` must outlive `'b`
7171

7272
error: aborting due to 4 previous errors
7373

src/test/ui/regions/regions-bounds.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> {
1818
| |
1919
| lifetime `'a` defined here
2020
LL | return e; //~ ERROR mismatched types
21-
| ^ return requires that `'a` must outlive `'b`
21+
| ^ returning this value requires that `'a` must outlive `'b`
2222

2323
error: unsatisfied lifetime constraints
2424
--> $DIR/regions-bounds.rs:23:12
@@ -28,7 +28,7 @@ LL | fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> {
2828
| |
2929
| lifetime `'a` defined here
3030
LL | return e; //~ ERROR mismatched types
31-
| ^ return requires that `'a` must outlive `'b`
31+
| ^ returning this value requires that `'a` must outlive `'b`
3232

3333
error: aborting due to 2 previous errors
3434

src/test/ui/regions/regions-close-object-into-object-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
1313
| | lifetime `'a` defined here
1414
LL | | box B(&*v) as Box<X> //~ ERROR cannot infer
1515
LL | | }
16-
| |_^ return requires that `'a` must outlive `'static`
16+
| |_^ returning this value requires that `'a` must outlive `'static`
1717

1818
error[E0597]: `*v` does not live long enough
1919
--> $DIR/regions-close-object-into-object-2.rs:20:11

src/test/ui/regions/regions-close-object-into-object-4.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
3737
| | lifetime `'a` defined here
3838
LL | | box B(&*v) as Box<X> //~ ERROR cannot infer
3939
LL | | }
40-
| |_^ return requires that `'a` must outlive `'static`
40+
| |_^ returning this value requires that `'a` must outlive `'static`
4141

4242
error[E0310]: the parameter type `U` may not live long enough
4343
--> $DIR/regions-close-object-into-object-4.rs:20:5

src/test/ui/regions/regions-creating-enums3.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623]
55
| ^^^^^^^^
66

77
error: unsatisfied lifetime constraints
8-
--> $DIR/regions-creating-enums3.rs:17:14
8+
--> $DIR/regions-creating-enums3.rs:17:5
99
|
1010
LL | fn mk_add_bad1<'a,'b>(x: &'a ast<'a>, y: &'b ast<'b>) -> ast<'a> {
1111
| -- -- lifetime `'b` defined here
1212
| |
1313
| lifetime `'a` defined here
1414
LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623]
15-
| ^ requires that `'b` must outlive `'a`
15+
| ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
1616

1717
error: aborting due to previous error
1818

src/test/ui/regions/regions-creating-enums4.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ LL | ast::add(x, y) //~ ERROR cannot infer
55
| ^^^^^^^^
66

77
error: unsatisfied lifetime constraints
8-
--> $DIR/regions-creating-enums4.rs:17:14
8+
--> $DIR/regions-creating-enums4.rs:17:5
99
|
1010
LL | fn mk_add_bad2<'a,'b>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'b> {
1111
| -- -- lifetime `'b` defined here
1212
| |
1313
| lifetime `'a` defined here
1414
LL | ast::add(x, y) //~ ERROR cannot infer
15-
| ^ requires that `'a` must outlive `'b`
15+
| ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
1616

1717
error: aborting due to previous error
1818

src/test/ui/regions/regions-early-bound-error-method.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | impl<'a> Box<'a> {
1212
LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
1313
| -- lifetime `'b` defined here
1414
LL | g2.get()
15-
| ^^^^^^^^ argument requires that `'b` must outlive `'a`
15+
| ^^^^^^^^ returning this value requires that `'b` must outlive `'a`
1616

1717
error: aborting due to previous error
1818

src/test/ui/regions/regions-early-bound-error.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
1212
| |
1313
| lifetime `'a` defined here
1414
LL | g1.get()
15-
| ^^^^^^^^ argument requires that `'a` must outlive `'b`
15+
| ^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1616

1717
error: aborting due to previous error
1818

src/test/ui/regions/regions-escape-method.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
88
--> $DIR/regions-escape-method.rs:25:13
99
|
1010
LL | s.f(|p| p) //~ ERROR cannot infer
11-
| -- ^ return requires that `'1` must outlive `'2`
11+
| -- ^ returning this value requires that `'1` must outlive `'2`
1212
| ||
1313
| |return type of closure is &'2 i32
1414
| has type `&'1 i32`

src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error: unsatisfied lifetime constraints
88
--> $DIR/regions-escape-via-trait-or-not.rs:28:14
99
|
1010
LL | with(|o| o) //~ ERROR cannot infer
11-
| -- ^ return requires that `'1` must outlive `'2`
11+
| -- ^ returning this value requires that `'1` must outlive `'2`
1212
| ||
1313
| |return type of closure is &'2 isize
1414
| has type `&'1 isize`

src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
1919
| lifetime `'a` defined here
2020
LL | // However, it is not safe to assume that 'b <= 'a
2121
LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623]
22-
| ^^^ requires that `'a` must outlive `'b`
22+
| ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
2323

2424
error: unsatisfied lifetime constraints
2525
--> $DIR/regions-free-region-ordering-callee.rs:28:24

src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | / match self.next {
1515
LL | | Some(ref next) => next.get(),
1616
LL | | None => &self.val //~ ERROR cannot infer
1717
LL | | }
18-
| |_____^ requires that `'a` must outlive `'b`
18+
| |_____^ returning this value requires that `'a` must outlive `'b`
1919

2020
error: aborting due to previous error
2121

0 commit comments

Comments
 (0)