-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add raw identifier in a typo suggestion #124510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. I have a couple of suggestions.
@@ -1617,7 +1617,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { | |||
let post = format!(", consider renaming `{}` into `{snippet}`", suggestion.candidate); | |||
(span, snippet, post) | |||
} else { | |||
(span, suggestion.candidate.to_string(), String::new()) | |||
(span, suggestion.candidate.to_ident_string(), String::new()) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, nvm. I don't know what I wrote there 🤦 It was early.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! However, could you check if the other occurrences of suggestion.candidate
in this crate should be updated to use to_ident_string()
, too? And add regression tests if applicable?
I can't find anything that needs to be fixed, and the other two places that show error messages don't seem to need fixing. https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/diagnostics.rs#L1597-L1606
(btw, I didn't find the way they called https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/diagnostics.rs#L1609-L1618 |
@bors r+ rollup |
I had to look myself because I didn't know this either until a moment ago: The reason why the |
…ion, r=fmease Add raw identifier in a typo suggestion Fixes rust-lang#68962
…ion, r=fmease Add raw identifier in a typo suggestion Fixes rust-lang#68962
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#122492 (Implement ptr_as_ref_unchecked) - rust-lang#123815 (Fix cannot usage in time.rs) - rust-lang#124059 (default_alloc_error_hook: explain difference to default __rdl_oom in alloc) - rust-lang#124510 (Add raw identifier in a typo suggestion) - rust-lang#124555 (coverage: Clean up creation of MC/DC condition bitmaps) - rust-lang#124593 (Describe and use CStr literals in CStr and CString docs) - rust-lang#124630 (CI: remove `env-x86_64-apple-tests` YAML anchor) r? `@ghost` `@rustbot` modify labels: rollup
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
Fixes #68962