Rollup merge of #93303 - compiler-errors:issue-93282, r=wesleywiser
Fix ICE when parsing bad turbofish with lifetime argument
Generalize conditions where we suggest adding the turbofish operator, so we don't ICE during code like
```rust
fn foo() {
A<'a,>
}
```
but instead suggest adding a turbofish.
Fixes #93282
This commit is contained in:
commit
086be2b6c4
4 changed files with 30 additions and 19 deletions
4
src/test/ui/parser/issues/issue-93282.rs
Normal file
4
src/test/ui/parser/issues/issue-93282.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
f<'a,>
|
||||
//~^ ERROR expected
|
||||
}
|
||||
13
src/test/ui/parser/issues/issue-93282.stderr
Normal file
13
src/test/ui/parser/issues/issue-93282.stderr
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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 previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue