Skip to content

Commit c88a76e

Browse files
committed
WIP bless test and compare-mode=nll
1 parent 93e2982 commit c88a76e

11 files changed

+186
-101
lines changed

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error: lifetime may not live long enough
2-
--> $DIR/project-fn-ret-invariant.rs:55:4
2+
--> $DIR/project-fn-ret-invariant.rs:56:5
33
|
4-
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5-
| -- -- lifetime `'b` defined here
4+
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5+
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
88
...
9-
LL | (a, b)
10-
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
9+
LL | (a, b)
10+
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1111
|
1212
= help: consider adding the following bound: `'a: 'b`
1313

1414
error: lifetime may not live long enough
15-
--> $DIR/project-fn-ret-invariant.rs:55:4
15+
--> $DIR/project-fn-ret-invariant.rs:56:5
1616
|
17-
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
18-
| -- -- lifetime `'b` defined here
17+
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
18+
| -- -- lifetime `'b` defined here
1919
| |
2020
| lifetime `'a` defined here
2121
...
22-
LL | (a, b)
23-
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
22+
LL | (a, b)
23+
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
2424
|
2525
= help: consider adding the following bound: `'b: 'a`
2626

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error: lifetime may not live long enough
2-
--> $DIR/project-fn-ret-invariant.rs:38:12
2+
--> $DIR/project-fn-ret-invariant.rs:39:13
33
|
4-
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5-
| -- -- lifetime `'b` defined here
4+
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5+
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8-
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
9-
LL | let a = bar(f, x);
10-
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
8+
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
9+
LL | let a = bar(f, x);
10+
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
1111
|
1212
= help: consider adding the following bound: `'a: 'b`
1313

1414
error: lifetime may not live long enough
15-
--> $DIR/project-fn-ret-invariant.rs:39:12
15+
--> $DIR/project-fn-ret-invariant.rs:40:13
1616
|
17-
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
18-
| -- -- lifetime `'b` defined here
17+
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
18+
| -- -- lifetime `'b` defined here
1919
| |
2020
| lifetime `'a` defined here
2121
...
22-
LL | let b = bar(f, y);
23-
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
22+
LL | let b = bar(f, y);
23+
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
2424
|
2525
= help: consider adding the following bound: `'b: 'a`
2626

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: lifetime may not live long enough
2-
--> $DIR/project-fn-ret-invariant.rs:48:4
2+
--> $DIR/project-fn-ret-invariant.rs:49:5
33
|
4-
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
4+
LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
55
| -- lifetime `'a` defined here
66
...
7-
LL | bar(foo, x)
8-
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
7+
LL | bar(foo, x)
8+
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
99
|
1010
= help: consider replacing `'a` with `'static`
1111

src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr

+32-31
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
1-
error[E0631]: type mismatch in closure arguments
2-
--> $DIR/expect-fn-supply-fn.rs:30:5
1+
error: lifetime may not live long enough
2+
--> $DIR/expect-fn-supply-fn.rs:16:49
33
|
4-
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F)
5-
| ------------------------------------------ required by a bound in this
6-
LL | where F: for<'a> FnOnce(fn(&'a u32), &i32)
7-
| ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region`
4+
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
5+
| -- lifetime `'x` defined here
86
...
9-
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
10-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
11-
| |
12-
| expected signature of `fn(fn(&'a u32), &i32) -> _`
7+
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
8+
| ^
9+
| |
10+
| has type `fn(&'1 u32)`
11+
| requires that `'1` must outlive `'x`
1312

14-
error[E0631]: type mismatch in closure arguments
15-
--> $DIR/expect-fn-supply-fn.rs:37:5
13+
error: lifetime may not live long enough
14+
--> $DIR/expect-fn-supply-fn.rs:16:49
1615
|
17-
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
18-
| ------------------------------------------- required by a bound in this
19-
LL | where F: FnOnce(fn(&u32), &i32)
20-
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
16+
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
17+
| -- lifetime `'x` defined here
2118
...
19+
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
20+
| ^ requires that `'x` must outlive `'static`
21+
|
22+
= help: consider replacing `'x` with `'static`
23+
24+
error: higher-ranked subtype error
25+
--> $DIR/expect-fn-supply-fn.rs:32:49
26+
|
27+
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
28+
| ^
29+
30+
error: higher-ranked subtype error
31+
--> $DIR/expect-fn-supply-fn.rs:39:50
32+
|
2233
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
24-
| |
25-
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
34+
| ^
2635

27-
error[E0631]: type mismatch in closure arguments
28-
--> $DIR/expect-fn-supply-fn.rs:46:5
36+
error: higher-ranked subtype error
37+
--> $DIR/expect-fn-supply-fn.rs:48:50
2938
|
30-
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
31-
| ------------------------------------------- required by a bound in this
32-
LL | where F: FnOnce(fn(&u32), &i32)
33-
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
34-
...
3539
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
36-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
37-
| |
38-
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
40+
| ^
3941

40-
error: aborting due to 3 previous errors
42+
error: aborting due to 5 previous errors
4143

42-
For more information about this error, try `rustc --explain E0631`.

src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`:
2-
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:14:1
2+
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1
33
|
44
LL | impl Trait for for<'r> fn(fn(&'r ())) {}
55
| ------------------------------------- first implementation here

src/test/ui/coherence/coherence-fn-implied-bounds.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`:
2-
--> $DIR/coherence-fn-implied-bounds.rs:9:1
2+
--> $DIR/coherence-fn-implied-bounds.rs:21:1
33
|
44
LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
55
| ------------------------------------------------------------------ first implementation here
@@ -8,7 +8,7 @@ LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
99
|
1010
note: the lint level is defined here
11-
--> $DIR/coherence-fn-implied-bounds.rs:3:9
11+
--> $DIR/coherence-fn-implied-bounds.rs:15:9
1212
|
1313
LL | #![deny(coherence_leak_check)]
1414
| ^^^^^^^^^^^^^^^^^^^^

src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
error: lifetime may not live long enough
2-
--> $DIR/hr-subtype.rs:33:13
2+
--> $DIR/hr-subtype.rs:39:13
33
|
4-
LL | fn subtype<'x,'y:'x,'z:'y>() {
5-
| -- -- lifetime `'y` defined here
4+
LL | fn subtype<'x, 'y: 'x, 'z: 'y>() {
5+
| -- -- lifetime `'y` defined here
66
| |
77
| lifetime `'x` defined here
88
LL | gimme::<$t2>(None::<$t1>);
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
1010
...
1111
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
12-
LL | | fn(Inv<'y>)) }
13-
| |__________________________________________________- in this macro invocation
12+
LL | | fn(Inv<'y>)) }
13+
| |______________- in this macro invocation
1414
|
1515
= help: consider adding the following bound: `'x: 'y`
1616
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1717

1818
error: lifetime may not live long enough
19-
--> $DIR/hr-subtype.rs:39:13
19+
--> $DIR/hr-subtype.rs:45:13
2020
|
21-
LL | fn supertype<'x,'y:'x,'z:'y>() {
22-
| -- -- lifetime `'y` defined here
21+
LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
22+
| -- -- lifetime `'y` defined here
2323
| |
2424
| lifetime `'x` defined here
2525
LL | gimme::<$t1>(None::<$t2>);
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
2727
...
2828
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
29-
LL | | fn(Inv<'y>)) }
30-
| |__________________________________________________- in this macro invocation
29+
LL | | fn(Inv<'y>)) }
30+
| |______________- in this macro invocation
3131
|
3232
= help: consider adding the following bound: `'x: 'y`
3333
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error: lifetime may not live long enough
2-
--> $DIR/hr-subtype.rs:39:13
2+
--> $DIR/hr-subtype.rs:45:13
33
|
4-
LL | fn supertype<'x,'y:'x,'z:'y>() {
5-
| -- -- lifetime `'y` defined here
4+
LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
5+
| -- -- lifetime `'y` defined here
66
| |
77
| lifetime `'x` defined here
88
LL | gimme::<$t1>(None::<$t2>);
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
1010
...
1111
LL | / check! { free_x_vs_free_y: (fn(&'x u32),
12-
LL | | fn(&'y u32)) }
13-
| |__________________________________________- in this macro invocation
12+
LL | | fn(&'y u32)) }
13+
| |______________- in this macro invocation
1414
|
1515
= help: consider adding the following bound: `'x: 'y`
1616
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr

+35-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
1+
error: lifetime may not live long enough
2+
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:8:5
3+
|
4+
LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
LL | // Illegal now because there is no `'b:'a` declaration.
9+
LL | *x = *y;
10+
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
11+
|
12+
= help: consider adding the following bound: `'b: 'a`
13+
14+
error: lifetime may not live long enough
15+
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:14:5
16+
|
17+
LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
18+
| -- -- lifetime `'b` defined here
19+
| |
20+
| lifetime `'a` defined here
21+
...
22+
LL | a(x, y);
23+
| ^^^^^^^ argument requires that `'b` must outlive `'a`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
error: higher-ranked subtype error
28+
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
329
|
430
LL | let _: fn(&mut &isize, &mut &isize) = a;
5-
| ---------------------------- ^ expected concrete lifetime, found bound lifetime parameter
6-
| |
7-
| expected due to this
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
error: higher-ranked subtype error
34+
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
835
|
9-
= note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
10-
found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
36+
LL | let _: fn(&mut &isize, &mut &isize) = a;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1138

12-
error: aborting due to previous error
39+
error: aborting due to 4 previous errors
1340

14-
For more information about this error, try `rustc --explain E0308`.

src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr

+41-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
1+
error: lifetime may not live long enough
2+
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:9:5
3+
|
4+
LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
LL | // Illegal now because there is no `'b:'a` declaration.
9+
LL | *x = *y;
10+
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
11+
|
12+
= help: consider adding the following bound: `'b: 'a`
13+
14+
error: lifetime may not live long enough
15+
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:16:5
16+
|
17+
LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
18+
| -- -- lifetime `'b` defined here
19+
| |
20+
| lifetime `'a` defined here
21+
...
22+
LL | a(x, y, z);
23+
| ^^^^^^^^^^ argument requires that `'b` must outlive `'a`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
error: higher-ranked subtype error
28+
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
329
|
430
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
5-
| ----------------------------------------- ^ expected concrete lifetime, found bound lifetime parameter
6-
| |
7-
| expected due to this
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
error: higher-ranked subtype error
34+
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
835
|
9-
= note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
10-
found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
36+
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+
39+
error: higher-ranked subtype error
40+
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
41+
|
42+
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
43+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1144

12-
error: aborting due to previous error
45+
error: aborting due to 5 previous errors
1346

14-
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)