improve tests with migration mode, mir mode
This commit is contained in:
parent
cc581bfa0e
commit
07ee532031
src/test/ui/impl-trait/multiple-lifetimes
inverse-bounds.migrate.stderrinverse-bounds.rsinverse-bounds.stderrordinary-bounds-pick-original.migrate.stderrordinary-bounds-pick-original.rsordinary-bounds-pick-original.stderrordinary-bounds-pick-other.migrate.stderrordinary-bounds-pick-other.rsordinary-bounds-pick-other.stderrordinary-bounds-unrelated.rsordinary-bounds-unrelated.stderrordinary-bounds-unsuited.rsordinary-bounds-unsuited.stderr
@ -0,0 +1,19 @@
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/inverse-bounds.rs:18:70
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: hidden type `Invert<'_>` captures lifetime '_#8r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
warning: the feature `pin` has been stable since 1.33.0 and no longer requires an attribute to enable
|
||||
--> $DIR/inverse-bounds.rs:6:60
|
||||
|
|
||||
LL | #![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
| ^^^
|
||||
|
|
||||
= note: #[warn(stable_features)] on by default
|
||||
|
@ -1,4 +1,7 @@
|
||||
// edition:2018
|
||||
// run-pass
|
||||
// revisions: migrate mir
|
||||
//[mir]compile-flags: -Z borrowck=mir
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
|
||||
|
@ -1,25 +1,19 @@
|
||||
error: impl Trait captures unexpected lifetime
|
||||
--> $DIR/inverse-bounds.rs:15:70
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/inverse-bounds.rs:16:70
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^^^^^^^^^^^^^^^^^ only lifetimes that appear in the impl Trait bounds may be captured
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type captures the lifetime 'd as defined on the function body at 15:29
|
||||
--> $DIR/inverse-bounds.rs:15:29
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'd as defined on the function body at 15:29
|
||||
--> $DIR/inverse-bounds.rs:15:29
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'e as defined on the function body at 15:33
|
||||
--> $DIR/inverse-bounds.rs:15:33
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
= note: hidden type would be allowed to capture the static lifetime
|
||||
= note: hidden type `Invert<'_>` captures lifetime '_#8r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
error: aborting due to previous error
|
||||
warning: the feature `pin` has been stable since 1.33.0 and no longer requires an attribute to enable
|
||||
--> $DIR/inverse-bounds.rs:4:60
|
||||
|
|
||||
LL | #![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
| ^^^
|
||||
|
|
||||
= note: #[warn(stable_features)] on by default
|
||||
|
||||
|
22
src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.migrate.stderr
Normal file
22
src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original.migrate.stderr
Normal file
@ -0,0 +1,22 @@
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:12:50
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: hidden type `(&u8, &u8)` captures lifetime '_#6r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:12:50
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: hidden type `(&u8, &u8)` captures lifetime '_#7r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
@ -1,6 +1,7 @@
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
// run-pass
|
||||
// revisions: migrate mir
|
||||
//[mir]compile-flags: -Z borrowck=mir
|
||||
|
||||
trait Trait<'a, 'b> { }
|
||||
impl<T> Trait<'_, '_> for T { }
|
||||
|
@ -1,48 +1,22 @@
|
||||
error: impl Trait captures unexpected lifetime
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:50
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:10:50
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^ only lifetimes that appear in the impl Trait bounds may be captured
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type captures the lifetime 'a as defined on the function body at 11:17
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:17
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'a as defined on the function body at 11:17
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:17
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'b as defined on the function body at 11:21
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:21
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
= note: hidden type would be allowed to capture the static lifetime
|
||||
= note: hidden type `(&u8, &u8)` captures lifetime '_#6r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
error: impl Trait captures unexpected lifetime
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:50
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:10:50
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^ only lifetimes that appear in the impl Trait bounds may be captured
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type captures the lifetime 'b as defined on the function body at 11:21
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:21
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'a as defined on the function body at 11:17
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:17
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'b as defined on the function body at 11:21
|
||||
--> $DIR/ordinary-bounds-pick-original.rs:11:21
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
|
||||
| ^^
|
||||
= note: hidden type would be allowed to capture the static lifetime
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
= note: hidden type `(&u8, &u8)` captures lifetime '_#7r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:19:74
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: hidden type `Ordinary<'_>` captures lifetime '_#8r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
@ -1,6 +1,7 @@
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
// run-pass
|
||||
// revisions: migrate mir
|
||||
//[mir]compile-flags: -Z borrowck=mir
|
||||
|
||||
trait Trait<'a, 'b> {}
|
||||
impl<T> Trait<'_, '_> for T {}
|
||||
|
@ -1,25 +1,11 @@
|
||||
error: impl Trait captures unexpected lifetime
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:18:74
|
||||
warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:17:74
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^^^^^^^^^^^^^^^^^ only lifetimes that appear in the impl Trait bounds may be captured
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type captures the lifetime 'e as defined on the function body at 18:33
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:18:33
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'd as defined on the function body at 18:29
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:18:29
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
note: hidden type would be allowed to capture the lifetime 'e as defined on the function body at 18:33
|
||||
--> $DIR/ordinary-bounds-pick-other.rs:18:33
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^
|
||||
= note: hidden type would be allowed to capture the static lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
= note: hidden type `Ordinary<'_>` captures lifetime '_#8r
|
||||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
|
||||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
|
||||
= note: for more information, try `rustc --explain E0729`
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
|
||||
trait Trait<'a, 'b> {}
|
||||
impl<T> Trait<'_, '_> for T {}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-unrelated.rs:18:74
|
||||
--> $DIR/ordinary-bounds-unrelated.rs:16:74
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type `Ordinary<'_>` captures the scope of call-site for function at 23:1
|
||||
--> $DIR/ordinary-bounds-unrelated.rs:23:1
|
||||
note: hidden type `Ordinary<'_>` captures the scope of call-site for function at 21:1
|
||||
--> $DIR/ordinary-bounds-unrelated.rs:21:1
|
||||
|
|
||||
LL | / {
|
||||
LL | | // Hidden type `Ordinary<'0>` with constraints:
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
|
||||
trait Trait<'a, 'b> {}
|
||||
impl<T> Trait<'_, '_> for T {}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
||||
--> $DIR/ordinary-bounds-unsuited.rs:20:62
|
||||
--> $DIR/ordinary-bounds-unsuited.rs:18:62
|
||||
|
|
||||
LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b>
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type `Ordinary<'_>` captures the scope of call-site for function at 22:1
|
||||
--> $DIR/ordinary-bounds-unsuited.rs:22:1
|
||||
note: hidden type `Ordinary<'_>` captures the scope of call-site for function at 20:1
|
||||
--> $DIR/ordinary-bounds-unsuited.rs:20:1
|
||||
|
|
||||
LL | / {
|
||||
LL | | // We return a value:
|
||||
|
Loading…
x
Reference in New Issue
Block a user