-
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
Accurately portray raw identifiers in error messages #67010
Conversation
When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @Centril r=me rollup with ^-- fixed. |
This comment has been minimized.
This comment has been minimized.
@bors r=Centril rollup |
📌 Commit 0103308 has been approved by |
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
Rollup of 13 pull requests Successful merges: - #66405 (Tweak `ObligationForest` `NodeState`s) - #66730 (remove dependency from libhermit) - #66764 (Tweak wording of `collect()` on bad target type) - #66899 (Standard library support for riscv64gc-unknown-linux-gnu) - #66900 (Clean up error codes) - #66974 ([CI] fix the `! isCI` check in src/ci/run.sh) - #66979 (Add long error for E0631 and update ui tests.) - #67005 (capitalize Rust) - #67010 (Accurately portray raw identifiers in error messages) - #67011 (Include a span in more `expected...found` notes) - #67017 (cleanup long error explanations) - #67021 (Fix docs for formatting delegations) - #67041 (add ExitStatusExt into prelude) Failed merges: r? @ghost
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
Rollup of 9 pull requests Successful merges: - #66710 (weak-into-raw: Clarify some details in Safety) - #66863 (Check break target availability when checking breaks with values) - #67002 (Fix documentation of pattern for str::matches()) - #67005 (capitalize Rust) - #67010 (Accurately portray raw identifiers in error messages) - #67011 (Include a span in more `expected...found` notes) - #67044 (E0023: handle expected != tuple pattern type) - #67045 (rustc_parser: cleanup imports) - #67055 (Make const-qualification look at more `const fn`s) Failed merges: r? @ghost
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.
Some hints with raw identifiers are still incorrect.
| | ||
LL | fn r#struct(&self) { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
= help: to disambiguate the method call, write `async::r#struct(r#fn {})` instead |
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.
I think this should be r#async::r#struct(r#fn {})
instead of async::r#struct(r#fn {})
LL | r#fn {}.r#struct(); | ||
| ^^^^^^^^ multiple `r#struct` found | ||
| | ||
note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn` |
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.
r#async
| | ||
LL | fn r#struct(&self) { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
= help: to disambiguate the method call, write `await::r#struct(r#fn {})` instead |
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.
r#await::r#struct(r#fn {})
@olegnn it isn't clear from the test (but tested locally, just forgot to add the test file) that this is because the test is running as edition 2015, where |
Sorry, I didn't notice that it's edition 2015. But anyway, if item is declared with |
We don't keep track of whether an identifier was raw or not, we currently infer it from the fact that they couldn't be written any other way (if we have a struct called |
…crum Deduplicate identifier printing a bit rust-lang#67010 introduced a couple more subtly different ways to print an identifier. This PR attempts to restore the order. The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required. r? @Mark-Simulacrum
…crum Deduplicate identifier printing a bit rust-lang#67010 introduced a couple more subtly different ways to print an identifier. This PR attempts to restore the order. The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required. r? @Mark-Simulacrum
When refering to or suggesting raw identifiers, refer to them with
r#
.Fix #65634.