From e67594166ecb808024a0694cd4c3ff9946d0837c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 15 Mar 2021 18:35:47 +0000 Subject: Run tests in nll mode --- ..._does_not_live_long_enough.full_tait.nll.stderr | 50 ++++++++++++++++++++++ ...e_does_not_live_long_enough.min_tait.nll.stderr | 41 ++++++++++++++++++ ...neric_type_does_not_live_long_enough.nll.stderr | 41 ------------------ .../issue-57611-trait-alias.full_tait.nll.stderr | 47 ++++++++++++++++++++ .../issue-57611-trait-alias.min_tait.nll.stderr | 38 ++++++++++++++++ .../issue-57611-trait-alias.nll.stderr | 38 ---------------- 6 files changed, 176 insertions(+), 79 deletions(-) create mode 100644 src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr create mode 100644 src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr create mode 100644 src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr create mode 100644 src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr (limited to 'src') diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr new file mode 100644 index 00000000000..d0f3be336dc --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr @@ -0,0 +1,50 @@ +error: at least one trait must be specified + --> $DIR/generic_type_does_not_live_long_enough.rs:12:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + +warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/generic_type_does_not_live_long_enough.rs:3:32 + | +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #63063 for more information + +error[E0308]: mismatched types + --> $DIR/generic_type_does_not_live_long_enough.rs:9:18 + | +LL | let z: i32 = x; + | --- ^ expected `i32`, found opaque type + | | + | expected due to this +... +LL | type WrongGeneric = impl 'static; + | ------------ the found opaque type + | + = note: expected type `i32` + found opaque type `impl Sized` + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/generic_type_does_not_live_long_enough.rs:17:30 + | +LL | fn wrong_generic(t: T) -> WrongGeneric { + | ^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/generic_type_does_not_live_long_enough.rs:12:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + = note: ...so that the type `T` will meet its required lifetime bounds + +error: aborting due to 4 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0308, E0310. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr new file mode 100644 index 00000000000..7496d96fa21 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr @@ -0,0 +1,41 @@ +error: at least one trait must be specified + --> $DIR/generic_type_does_not_live_long_enough.rs:12:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/generic_type_does_not_live_long_enough.rs:9:18 + | +LL | let z: i32 = x; + | --- ^ expected `i32`, found opaque type + | | + | expected due to this +... +LL | type WrongGeneric = impl 'static; + | ------------ the found opaque type + | + = note: expected type `i32` + found opaque type `impl Sized` + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/generic_type_does_not_live_long_enough.rs:17:30 + | +LL | fn wrong_generic(t: T) -> WrongGeneric { + | ^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/generic_type_does_not_live_long_enough.rs:12:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + = note: ...so that the type `T` will meet its required lifetime bounds + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0308, E0310. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr deleted file mode 100644 index ffd6f34c4b0..00000000000 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error: at least one trait must be specified - --> $DIR/generic_type_does_not_live_long_enough.rs:9:24 - | -LL | type WrongGeneric = impl 'static; - | ^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 - | -LL | let z: i32 = x; - | --- ^ expected `i32`, found opaque type - | | - | expected due to this -... -LL | type WrongGeneric = impl 'static; - | ------------ the found opaque type - | - = note: expected type `i32` - found opaque type `impl Sized` - -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/generic_type_does_not_live_long_enough.rs:14:30 - | -LL | fn wrong_generic(t: T) -> WrongGeneric { - | ^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'static`... - -error[E0310]: the parameter type `T` may not live long enough - --> $DIR/generic_type_does_not_live_long_enough.rs:9:24 - | -LL | type WrongGeneric = impl 'static; - | ^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'static`... - = note: ...so that the type `T` will meet its required lifetime bounds - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0308, E0310. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr new file mode 100644 index 00000000000..481d66dd811 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr @@ -0,0 +1,47 @@ +warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-57611-trait-alias.rs:8:32 + | +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #63063 for more information + +error: higher-ranked subtype error + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error: higher-ranked subtype error + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error[E0308]: mismatched types + --> $DIR/issue-57611-trait-alias.rs:20:16 + | +LL | type Bar = impl Baz; + | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other + | + = note: expected type `for<'r> Fn<(&'r X,)>` + found type `Fn<(&'static X,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error: implementation of `FnOnce` is not general enough + --> $DIR/issue-57611-trait-alias.rs:20:16 + | +LL | type Bar = impl Baz; + | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough + | + = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`... + = note: ...but it actually implements `FnOnce<(&'static X,)>` + +error: aborting due to 4 previous errors; 1 warning emitted + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr new file mode 100644 index 00000000000..0343a769564 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr @@ -0,0 +1,38 @@ +error: higher-ranked subtype error + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error: higher-ranked subtype error + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error[E0308]: mismatched types + --> $DIR/issue-57611-trait-alias.rs:20:16 + | +LL | type Bar = impl Baz; + | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other + | + = note: expected type `for<'r> Fn<(&'r X,)>` + found type `Fn<(&'static X,)>` +note: this closure does not fulfill the lifetime requirements + --> $DIR/issue-57611-trait-alias.rs:28:9 + | +LL | |x| x + | ^^^^^ + +error: implementation of `FnOnce` is not general enough + --> $DIR/issue-57611-trait-alias.rs:20:16 + | +LL | type Bar = impl Baz; + | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough + | + = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`... + = note: ...but it actually implements `FnOnce<(&'static X,)>` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr deleted file mode 100644 index 998e178966a..00000000000 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error: higher-ranked subtype error - --> $DIR/issue-57611-trait-alias.rs:25:9 - | -LL | |x| x - | ^^^^^ - -error: higher-ranked subtype error - --> $DIR/issue-57611-trait-alias.rs:25:9 - | -LL | |x| x - | ^^^^^ - -error[E0308]: mismatched types - --> $DIR/issue-57611-trait-alias.rs:17:16 - | -LL | type Bar = impl Baz; - | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other - | - = note: expected type `for<'r> Fn<(&'r X,)>` - found type `Fn<(&'static X,)>` -note: this closure does not fulfill the lifetime requirements - --> $DIR/issue-57611-trait-alias.rs:25:9 - | -LL | |x| x - | ^^^^^ - -error: implementation of `FnOnce` is not general enough - --> $DIR/issue-57611-trait-alias.rs:17:16 - | -LL | type Bar = impl Baz; - | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough - | - = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`... - = note: ...but it actually implements `FnOnce<(&'static X,)>` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0308`. -- cgit 1.4.1-3-g733a5