-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forbid lifetime elision in let position impl Trait
This is consistent with types.
- Loading branch information
1 parent
4201fd2
commit f97070d
Showing
9 changed files
with
95 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
--> $DIR/issue-60473.rs:15:12 | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/issue-60473.rs:13:23 | ||
| | ||
LL | let x: impl Trait<A> = (); // FIXME: The error doesn't seem correct. | ||
| ^^^^^^^^^^^^^ expands to a recursive type | ||
LL | let x: impl Trait<A> = (); | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | fn main<'a>() { | ||
LL | let x: impl Trait<A<'a>> = (); | ||
| | ||
= note: type resolves to itself | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0720`. | ||
For more information about this error, try `rustc --explain E0106`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
--> $DIR/issue-67166.rs:7:19 | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/issue-67166.rs:7:31 | ||
| | ||
LL | let _foo: Box<impl Copy + '_> = Box::new(()); // FIXME: The error doesn't much make sense. | ||
| ^^^^^^^^^^^^^^ expands to a recursive type | ||
LL | let _foo: Box<impl Copy + '_> = Box::new(()); | ||
| ^^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | pub fn run<'a>() { | ||
LL | let _foo: Box<impl Copy + 'a> = Box::new(()); | ||
| | ||
= note: type resolves to itself | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0720`. | ||
For more information about this error, try `rustc --explain E0106`. |