forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#124510 - linyihai:raw-ident-in-typo-suggest…
…ion, r=fmease Add raw identifier in a typo suggestion Fixes rust-lang#68962
- Loading branch information
Showing
3 changed files
with
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
fn r#fn() {} | ||
|
||
fn main() { | ||
let r#final = 1; | ||
|
||
// Should correctly suggest variable defined using raw identifier. | ||
fina; //~ ERROR cannot find value | ||
|
||
// Should correctly suggest function defined using raw identifier. | ||
f(); //~ ERROR cannot find function | ||
} |
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,18 @@ | ||
error[E0425]: cannot find value `fina` in this scope | ||
--> $DIR/suggestion-raw-68962.rs:7:5 | ||
| | ||
LL | fina; | ||
| ^^^^ help: a local variable with a similar name exists: `r#final` | ||
|
||
error[E0425]: cannot find function `f` in this scope | ||
--> $DIR/suggestion-raw-68962.rs:10:5 | ||
| | ||
LL | fn r#fn() {} | ||
| --------- similarly named function `r#fn` defined here | ||
... | ||
LL | f(); | ||
| ^ help: a function with a similar name exists: `r#fn` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0425`. |