Remove delayed bug when encountering label in bad turbofish

This commit is contained in:
Michael Goulet 2022-01-25 10:47:10 -08:00
parent e7825f2b69
commit a090bb1dea
6 changed files with 45 additions and 6 deletions

View file

@ -0,0 +1,5 @@
fn main() {
f<'a,>
//~^ ERROR expected
//~| ERROR expected
}

View file

@ -0,0 +1,19 @@
error: expected `while`, `for`, `loop` or `{` after a label
--> $DIR/issue-93282.rs:2:9
|
LL | f<'a,>
| ^ expected `while`, `for`, `loop` or `{` after a label
error: expected one of `.`, `:`, `;`, `?`, `for`, `loop`, `while`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-93282.rs:2:9
|
LL | f<'a,>
| ^ expected one of 10 possible tokens
|
help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
|
LL | f::<'a,>
| ++
error: aborting due to 2 previous errors

View file

@ -21,10 +21,12 @@ fn main() {
let _ = f<'_, i8>();
//~^ ERROR expected one of
//~| ERROR expected
//~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
f<'_>();
//~^ comparison operators cannot be chained
//~| ERROR expected
//~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
let _ = f<u8>;

View file

@ -53,6 +53,12 @@ help: use `::<...>` instead of `<...>` to specify lifetime, type, or const argum
LL | let _ = f::<u8, i8>();
| ++
error: expected `while`, `for`, `loop` or `{` after a label
--> $DIR/require-parens-for-chained-comparison.rs:22:17
|
LL | let _ = f<'_, i8>();
| ^ expected `while`, `for`, `loop` or `{` after a label
error: expected one of `.`, `:`, `;`, `?`, `else`, `for`, `loop`, `while`, `{`, or an operator, found `,`
--> $DIR/require-parens-for-chained-comparison.rs:22:17
|
@ -64,8 +70,14 @@ help: use `::<...>` instead of `<...>` to specify lifetime, type, or const argum
LL | let _ = f::<'_, i8>();
| ++
error: expected `while`, `for`, `loop` or `{` after a label
--> $DIR/require-parens-for-chained-comparison.rs:27:9
|
LL | f<'_>();
| ^ expected `while`, `for`, `loop` or `{` after a label
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:26:6
--> $DIR/require-parens-for-chained-comparison.rs:27:6
|
LL | f<'_>();
| ^ ^
@ -76,7 +88,7 @@ LL | f::<'_>();
| ++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:30:14
--> $DIR/require-parens-for-chained-comparison.rs:32:14
|
LL | let _ = f<u8>;
| ^ ^
@ -84,5 +96,5 @@ LL | let _ = f<u8>;
= help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
= help: or use `(...)` if you meant to specify fn arguments
error: aborting due to 8 previous errors
error: aborting due to 10 previous errors