WIP bless test and compare-mode=nll

This commit is contained in:
Niko Matsakis
2020-06-06 10:31:51 +00:00
parent 93e29823a9
commit c88a76e37b
11 changed files with 186 additions and 101 deletions

View File

@@ -1,7 +1,7 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:55:4 --> $DIR/project-fn-ret-invariant.rs:56:5
| |
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here | -- -- lifetime `'b` defined here
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here
@@ -12,9 +12,9 @@ LL | (a, b)
= help: consider adding the following bound: `'a: 'b` = help: consider adding the following bound: `'a: 'b`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:55:4 --> $DIR/project-fn-ret-invariant.rs:56:5
| |
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here | -- -- lifetime `'b` defined here
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here

View File

@@ -1,7 +1,7 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:38:12 --> $DIR/project-fn-ret-invariant.rs:39:13
| |
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here | -- -- lifetime `'b` defined here
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here
@@ -12,9 +12,9 @@ LL | let a = bar(f, x);
= help: consider adding the following bound: `'a: 'b` = help: consider adding the following bound: `'a: 'b`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:39:12 --> $DIR/project-fn-ret-invariant.rs:40:13
| |
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here | -- -- lifetime `'b` defined here
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here

View File

@@ -1,7 +1,7 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:48:4 --> $DIR/project-fn-ret-invariant.rs:49:5
| |
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
| -- lifetime `'a` defined here | -- lifetime `'a` defined here
... ...
LL | bar(foo, x) LL | bar(foo, x)

View File

@@ -1,42 +1,43 @@
error[E0631]: type mismatch in closure arguments error: lifetime may not live long enough
--> $DIR/expect-fn-supply-fn.rs:30:5 --> $DIR/expect-fn-supply-fn.rs:16:49
| |
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F) LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| ------------------------------------------ required by a bound in this | -- lifetime `'x` defined here
LL | where F: for<'a> FnOnce(fn(&'a u32), &i32)
| ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region`
... ...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^
| |
| has type `fn(&'1 u32)`
| requires that `'1` must outlive `'x`
error: lifetime may not live long enough
--> $DIR/expect-fn-supply-fn.rs:16:49
|
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| -- lifetime `'x` defined here
...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^ requires that `'x` must outlive `'static`
|
= help: consider replacing `'x` with `'static`
error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:32:49
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` | ^
| |
| expected signature of `fn(fn(&'a u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:37:5 --> $DIR/expect-fn-supply-fn.rs:39:50
| |
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| ------------------------------------------- required by a bound in this
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` | ^
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:46:5 --> $DIR/expect-fn-supply-fn.rs:48:50
| |
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| ------------------------------------------- required by a bound in this
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` | ^
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error: aborting due to 3 previous errors error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0631`.

View File

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

View File

@@ -1,5 +1,5 @@
error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`: error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`:
--> $DIR/coherence-fn-implied-bounds.rs:9:1 --> $DIR/coherence-fn-implied-bounds.rs:21:1
| |
LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {} LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
| ------------------------------------------------------------------ first implementation here | ------------------------------------------------------------------ first implementation here
@@ -8,7 +8,7 @@ LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
| |
note: the lint level is defined here note: the lint level is defined here
--> $DIR/coherence-fn-implied-bounds.rs:3:9 --> $DIR/coherence-fn-implied-bounds.rs:15:9
| |
LL | #![deny(coherence_leak_check)] LL | #![deny(coherence_leak_check)]
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^

View File

@@ -1,7 +1,7 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:33:13 --> $DIR/hr-subtype.rs:39:13
| |
LL | fn subtype<'x,'y:'x,'z:'y>() { LL | fn subtype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here | -- -- lifetime `'y` defined here
| | | |
| lifetime `'x` defined here | lifetime `'x` defined here
@@ -10,15 +10,15 @@ LL | gimme::<$t2>(None::<$t1>);
... ...
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) } LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation | |______________- in this macro invocation
| |
= help: consider adding the following bound: `'x: 'y` = help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:39:13 --> $DIR/hr-subtype.rs:45:13
| |
LL | fn supertype<'x,'y:'x,'z:'y>() { LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here | -- -- lifetime `'y` defined here
| | | |
| lifetime `'x` defined here | lifetime `'x` defined here
@@ -27,7 +27,7 @@ LL | gimme::<$t1>(None::<$t2>);
... ...
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) } LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation | |______________- in this macro invocation
| |
= help: consider adding the following bound: `'x: 'y` = help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -1,7 +1,7 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:39:13 --> $DIR/hr-subtype.rs:45:13
| |
LL | fn supertype<'x,'y:'x,'z:'y>() { LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here | -- -- lifetime `'y` defined here
| | | |
| lifetime `'x` defined here | lifetime `'x` defined here
@@ -10,7 +10,7 @@ LL | gimme::<$t1>(None::<$t2>);
... ...
LL | / check! { free_x_vs_free_y: (fn(&'x u32), LL | / check! { free_x_vs_free_y: (fn(&'x u32),
LL | | fn(&'y u32)) } LL | | fn(&'y u32)) }
| |__________________________________________- in this macro invocation | |______________- in this macro invocation
| |
= help: consider adding the following bound: `'x: 'y` = help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -1,14 +1,40 @@
error[E0308]: mismatched types error: lifetime may not live long enough
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43 --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:8:5
|
LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Illegal now because there is no `'b:'a` declaration.
LL | *x = *y;
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: lifetime may not live long enough
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:14:5
|
LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | a(x, y);
| ^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: higher-ranked subtype error
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
| |
LL | let _: fn(&mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize) = a;
| ---------------------------- ^ expected concrete lifetime, found bound lifetime parameter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected due to this error: higher-ranked subtype error
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
| |
= note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` LL | let _: fn(&mut &isize, &mut &isize) = a;
found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@@ -1,14 +1,46 @@
error[E0308]: mismatched types error: lifetime may not live long enough
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56 --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:9:5
|
LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Illegal now because there is no `'b:'a` declaration.
LL | *x = *y;
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: lifetime may not live long enough
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:16:5
|
LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | a(x, y, z);
| ^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
| |
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ----------------------------------------- ^ expected concrete lifetime, found bound lifetime parameter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected due to this error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
| |
= note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@@ -1,14 +1,40 @@
error[E0308]: mismatched types error: lifetime may not live long enough
--> $DIR/regions-lifetime-bounds-on-fns.rs:20:43 --> $DIR/regions-lifetime-bounds-on-fns.rs:8:5
|
LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Illegal now because there is no `'b:'a` declaration.
LL | *x = *y;
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: lifetime may not live long enough
--> $DIR/regions-lifetime-bounds-on-fns.rs:14:5
|
LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | a(x, y);
| ^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
error: higher-ranked subtype error
--> $DIR/regions-lifetime-bounds-on-fns.rs:20:12
| |
LL | let _: fn(&mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize) = a;
| ---------------------------- ^ expected concrete lifetime, found bound lifetime parameter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected due to this error: higher-ranked subtype error
--> $DIR/regions-lifetime-bounds-on-fns.rs:20:12
| |
= note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` LL | let _: fn(&mut &isize, &mut &isize) = a;
found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.