diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-03 20:33:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-03 20:33:45 +0200 |
| commit | bd305e10c2b4b16048f152ee63ff546cd764d358 (patch) | |
| tree | 1bbec9d23d26fa0b8d238ad7f1ae86dfca5ea4b8 /tests/ui/span | |
| parent | 8e3f61b9f955c3393786be62e9d3a9ae989e49b8 (diff) | |
| parent | 589c2fe24d1f9e7bde8a50b07bb53eb4fbee6d8e (diff) | |
| download | rust-bd305e10c2b4b16048f152ee63ff546cd764d358.tar.gz rust-bd305e10c2b4b16048f152ee63ff546cd764d358.zip | |
Rollup merge of #124510 - linyihai:raw-ident-in-typo-suggestion, r=fmease
Add raw identifier in a typo suggestion Fixes #68962
Diffstat (limited to 'tests/ui/span')
| -rw-r--r-- | tests/ui/span/suggestion-raw-68962.rs | 11 | ||||
| -rw-r--r-- | tests/ui/span/suggestion-raw-68962.stderr | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/span/suggestion-raw-68962.rs b/tests/ui/span/suggestion-raw-68962.rs new file mode 100644 index 00000000000..0b581308f66 --- /dev/null +++ b/tests/ui/span/suggestion-raw-68962.rs @@ -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 +} diff --git a/tests/ui/span/suggestion-raw-68962.stderr b/tests/ui/span/suggestion-raw-68962.stderr new file mode 100644 index 00000000000..2e25f5cbdf5 --- /dev/null +++ b/tests/ui/span/suggestion-raw-68962.stderr @@ -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`. |
