-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #103020 - lyming2007:issue-102598-fix, r=jackh726
error parsing lifetime following by Sized and message + between them Fixes #102598
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn foo<'a>(_: impl 'a Sized) {} | ||
//~^ ERROR: expected `+` between lifetime and Sized | ||
//~| ERROR: expected one of `:`, `@`, or `|`, found `)` | ||
//~| ERROR: expected one of `)`, `+`, or `,`, found `Sized` | ||
//~| ERROR: at least one trait must be specified | ||
|
||
fn main(){ | ||
} |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error: expected `+` between lifetime and Sized | ||
--> $DIR/issue-102598.rs:1:20 | ||
| | ||
LL | fn foo<'a>(_: impl 'a Sized) {} | ||
| ^^ | ||
| | ||
help: add `+` | ||
| | ||
LL | fn foo<'a>(_: impl 'a + Sized) {} | ||
| + | ||
|
||
error: expected one of `:`, `@`, or `|`, found `)` | ||
--> $DIR/issue-102598.rs:1:28 | ||
| | ||
LL | fn foo<'a>(_: impl 'a Sized) {} | ||
| ^ expected one of `:`, `@`, or `|` | ||
| | ||
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685) | ||
help: if this is a parameter name, give it a type | ||
| | ||
LL | fn foo<'a>(_: impl 'a Sized: TypeName) {} | ||
| ++++++++++ | ||
help: if this is a type, explicitly ignore the parameter name | ||
| | ||
LL | fn foo<'a>(_: impl 'a _: Sized) {} | ||
| ++ | ||
|
||
error: expected one of `)`, `+`, or `,`, found `Sized` | ||
--> $DIR/issue-102598.rs:1:23 | ||
| | ||
LL | fn foo<'a>(_: impl 'a Sized) {} | ||
| -^^^^^ expected one of `)`, `+`, or `,` | ||
| | | ||
| help: missing `,` | ||
|
||
error: at least one trait must be specified | ||
--> $DIR/issue-102598.rs:1:15 | ||
| | ||
LL | fn foo<'a>(_: impl 'a Sized) {} | ||
| ^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|