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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 8 additions & 6 deletions
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

Lines changed: 8 additions & 6 deletions
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

0 commit comments

Comments
 (0)