Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect raw identifier variable name help suggestion #68962

Closed
olegnn opened this issue Feb 8, 2020 · 7 comments · Fixed by #124510
Closed

Incorrect raw identifier variable name help suggestion #68962

olegnn opened this issue Feb 8, 2020 · 7 comments · Fixed by #124510
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@olegnn
Copy link
Contributor

olegnn commented Feb 8, 2020

Incorrect hint for variable with a similar name defined using raw identifiers

fn main() {
    let r#final = 1;
    r#fina;
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
error[E0425]: cannot find value `fina` in this scope
 --> src/main.rs:3:5
  |
3 |     r#fina;
  |     ^^^^^^ help: a local variable with a similar name exists: `final`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground`.

To learn more, run the command again with --verbose.

Should be help: a local variable with a similar name exists: r#final

@olegnn olegnn changed the title Incorrect raw identifier variable name Incorrect raw identifier variable name help message Feb 8, 2020
@olegnn olegnn changed the title Incorrect raw identifier variable name help message Incorrect raw identifier variable name help suggestion Feb 8, 2020
@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 8, 2020
@estebank estebank added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. labels Jun 29, 2023
@duckymirror
Copy link
Contributor

@rustbot claim

I've fixed this issue and will try to find and fix more similarly incorrect suggestions before submitting a PR.

@nouritsu
Copy link

nouritsu commented Jan 26, 2024

@rustbot claim

I would love to take this up. It would help to know where I should begin.

@nouritsu nouritsu removed their assignment Jan 31, 2024
@nouritsu
Copy link

Sorry for dropping this, my exams are around the corner.

@kmpzr
Copy link

kmpzr commented Feb 9, 2024

@rustbot claim

@kmpzr
Copy link

kmpzr commented Mar 10, 2024

Hi @Dylan-DPC, I'm in the middle of the implementation of this issue. Would it be possible to assign it back to me?

@kmpzr
Copy link

kmpzr commented Mar 10, 2024

@rustbot claim

@kmpzr
Copy link

kmpzr commented Apr 13, 2024

Unfortunately, I'm extremely busy right now, therefore I will unassign me so that someone else can work on it.

@kmpzr kmpzr removed their assignment Apr 13, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this issue May 3, 2024
…ion, r=fmease

Add raw identifier in a typo suggestion

Fixes rust-lang#68962
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 3, 2024
…ion, r=fmease

Add raw identifier in a typo suggestion

Fixes rust-lang#68962
@bors bors closed this as completed in bd305e1 May 3, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue May 3, 2024
Rollup merge of rust-lang#124510 - linyihai:raw-ident-in-typo-suggestion, r=fmease

Add raw identifier in a typo suggestion

Fixes rust-lang#68962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
6 participants