Skip to content

Commit d395fe8

Browse files
committed
Bless nll tests
1 parent 9629d79 commit d395fe8

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
error: at least one trait must be specified
2+
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
3+
|
4+
LL | type WrongGeneric<T> = impl 'static;
5+
| ^^^^^^^^^^^^
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/generic_type_does_not_live_long_enough.rs:6:18
9+
|
10+
LL | let z: i32 = x;
11+
| --- ^ expected `i32`, found opaque type
12+
| |
13+
| expected due to this
14+
...
15+
LL | type WrongGeneric<T> = impl 'static;
16+
| ------------ the found opaque type
17+
|
18+
= note: expected type `i32`
19+
found opaque type `impl Sized`
20+
21+
error[E0310]: the parameter type `T` may not live long enough
22+
--> $DIR/generic_type_does_not_live_long_enough.rs:13:30
23+
|
24+
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
25+
| ^^^^^^^^^^^^^^^
26+
|
27+
= help: consider adding an explicit lifetime bound `T: 'static`...
28+
29+
error[E0310]: the parameter type `T` may not live long enough
30+
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
31+
|
32+
LL | type WrongGeneric<T> = impl 'static;
33+
| ^^^^^^^^^^^^
34+
|
35+
= help: consider adding an explicit lifetime bound `T: 'static`...
36+
= note: ...so that the type `T` will meet its required lifetime bounds
37+
38+
error: aborting due to 4 previous errors
39+
40+
Some errors have detailed explanations: E0308, E0310.
41+
For more information about an error, try `rustc --explain E0308`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
error: higher-ranked subtype error
2+
--> $DIR/issue-57611-trait-alias.rs:21:9
3+
|
4+
LL | |x| x
5+
| ^^^^^
6+
7+
error: higher-ranked subtype error
8+
--> $DIR/issue-57611-trait-alias.rs:21:9
9+
|
10+
LL | |x| x
11+
| ^^^^^
12+
13+
error[E0308]: mismatched types
14+
--> $DIR/issue-57611-trait-alias.rs:17:16
15+
|
16+
LL | type Bar = impl Baz<Self, Self>;
17+
| ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
18+
|
19+
= note: expected type `for<'r> Fn<(&'r X,)>`
20+
found type `Fn<(&'static X,)>`
21+
note: this closure does not fulfill the lifetime requirements
22+
--> $DIR/issue-57611-trait-alias.rs:21:9
23+
|
24+
LL | |x| x
25+
| ^^^^^
26+
27+
error: implementation of `FnOnce` is not general enough
28+
--> $DIR/issue-57611-trait-alias.rs:17:16
29+
|
30+
LL | type Bar = impl Baz<Self, Self>;
31+
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
32+
|
33+
= note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
34+
= note: ...but it actually implements `FnOnce<(&'static X,)>`
35+
36+
error: aborting due to 4 previous errors
37+
38+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)