Skip to content

Commit e675941

Browse files
committed
Run tests in nll mode
1 parent c2683aa commit e675941

4 files changed

+106
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
error: at least one trait must be specified
2+
--> $DIR/generic_type_does_not_live_long_enough.rs:12:24
3+
|
4+
LL | type WrongGeneric<T> = impl 'static;
5+
| ^^^^^^^^^^^^
6+
7+
warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
8+
--> $DIR/generic_type_does_not_live_long_enough.rs:3:32
9+
|
10+
LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
11+
| ^^^^^^^^^^^^^^^^^^^^^
12+
|
13+
= note: `#[warn(incomplete_features)]` on by default
14+
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
15+
16+
error[E0308]: mismatched types
17+
--> $DIR/generic_type_does_not_live_long_enough.rs:9:18
18+
|
19+
LL | let z: i32 = x;
20+
| --- ^ expected `i32`, found opaque type
21+
| |
22+
| expected due to this
23+
...
24+
LL | type WrongGeneric<T> = impl 'static;
25+
| ------------ the found opaque type
26+
|
27+
= note: expected type `i32`
28+
found opaque type `impl Sized`
29+
30+
error[E0310]: the parameter type `T` may not live long enough
31+
--> $DIR/generic_type_does_not_live_long_enough.rs:17:30
32+
|
33+
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
34+
| ^^^^^^^^^^^^^^^
35+
|
36+
= help: consider adding an explicit lifetime bound `T: 'static`...
37+
38+
error[E0310]: the parameter type `T` may not live long enough
39+
--> $DIR/generic_type_does_not_live_long_enough.rs:12:24
40+
|
41+
LL | type WrongGeneric<T> = impl 'static;
42+
| ^^^^^^^^^^^^
43+
|
44+
= help: consider adding an explicit lifetime bound `T: 'static`...
45+
= note: ...so that the type `T` will meet its required lifetime bounds
46+
47+
error: aborting due to 4 previous errors; 1 warning emitted
48+
49+
Some errors have detailed explanations: E0308, E0310.
50+
For more information about an error, try `rustc --explain E0308`.

src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr renamed to src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: at least one trait must be specified
2-
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
2+
--> $DIR/generic_type_does_not_live_long_enough.rs:12:24
33
|
44
LL | type WrongGeneric<T> = impl 'static;
55
| ^^^^^^^^^^^^
66

77
error[E0308]: mismatched types
8-
--> $DIR/generic_type_does_not_live_long_enough.rs:6:18
8+
--> $DIR/generic_type_does_not_live_long_enough.rs:9:18
99
|
1010
LL | let z: i32 = x;
1111
| --- ^ expected `i32`, found opaque type
@@ -19,15 +19,15 @@ LL | type WrongGeneric<T> = impl 'static;
1919
found opaque type `impl Sized`
2020

2121
error[E0310]: the parameter type `T` may not live long enough
22-
--> $DIR/generic_type_does_not_live_long_enough.rs:14:30
22+
--> $DIR/generic_type_does_not_live_long_enough.rs:17:30
2323
|
2424
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
2525
| ^^^^^^^^^^^^^^^
2626
|
2727
= help: consider adding an explicit lifetime bound `T: 'static`...
2828

2929
error[E0310]: the parameter type `T` may not live long enough
30-
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
30+
--> $DIR/generic_type_does_not_live_long_enough.rs:12:24
3131
|
3232
LL | type WrongGeneric<T> = impl 'static;
3333
| ^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/issue-57611-trait-alias.rs:8:32
3+
|
4+
LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
5+
| ^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
9+
10+
error: higher-ranked subtype error
11+
--> $DIR/issue-57611-trait-alias.rs:28:9
12+
|
13+
LL | |x| x
14+
| ^^^^^
15+
16+
error: higher-ranked subtype error
17+
--> $DIR/issue-57611-trait-alias.rs:28:9
18+
|
19+
LL | |x| x
20+
| ^^^^^
21+
22+
error[E0308]: mismatched types
23+
--> $DIR/issue-57611-trait-alias.rs:20:16
24+
|
25+
LL | type Bar = impl Baz<Self, Self>;
26+
| ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
27+
|
28+
= note: expected type `for<'r> Fn<(&'r X,)>`
29+
found type `Fn<(&'static X,)>`
30+
note: this closure does not fulfill the lifetime requirements
31+
--> $DIR/issue-57611-trait-alias.rs:28:9
32+
|
33+
LL | |x| x
34+
| ^^^^^
35+
36+
error: implementation of `FnOnce` is not general enough
37+
--> $DIR/issue-57611-trait-alias.rs:20:16
38+
|
39+
LL | type Bar = impl Baz<Self, Self>;
40+
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
41+
|
42+
= note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
43+
= note: ...but it actually implements `FnOnce<(&'static X,)>`
44+
45+
error: aborting due to 4 previous errors; 1 warning emitted
46+
47+
For more information about this error, try `rustc --explain E0308`.

src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr renamed to src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: higher-ranked subtype error
2-
--> $DIR/issue-57611-trait-alias.rs:25:9
2+
--> $DIR/issue-57611-trait-alias.rs:28:9
33
|
44
LL | |x| x
55
| ^^^^^
66

77
error: higher-ranked subtype error
8-
--> $DIR/issue-57611-trait-alias.rs:25:9
8+
--> $DIR/issue-57611-trait-alias.rs:28:9
99
|
1010
LL | |x| x
1111
| ^^^^^
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/issue-57611-trait-alias.rs:17:16
14+
--> $DIR/issue-57611-trait-alias.rs:20:16
1515
|
1616
LL | type Bar = impl Baz<Self, Self>;
1717
| ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
1818
|
1919
= note: expected type `for<'r> Fn<(&'r X,)>`
2020
found type `Fn<(&'static X,)>`
2121
note: this closure does not fulfill the lifetime requirements
22-
--> $DIR/issue-57611-trait-alias.rs:25:9
22+
--> $DIR/issue-57611-trait-alias.rs:28:9
2323
|
2424
LL | |x| x
2525
| ^^^^^
2626

2727
error: implementation of `FnOnce` is not general enough
28-
--> $DIR/issue-57611-trait-alias.rs:17:16
28+
--> $DIR/issue-57611-trait-alias.rs:20:16
2929
|
3030
LL | type Bar = impl Baz<Self, Self>;
3131
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough

0 commit comments

Comments
 (0)