-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Clarify suggestion for E0013 #68079
Clarify suggestion for E0013 #68079
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
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=me with comments addressed.
item.const_kind() | ||
); | ||
err.help("consider extracting the value of the static to a const, and referring to that"); | ||
if item.tcx.sess.teach(&err.get_code().unwrap()) { | ||
err.note( | ||
"Static and const variables can refer to other const variables. \ | ||
But a const variable cannot refer to a static variable.", |
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.
But a const variable cannot refer to a static variable.", | |
a `const` variable cannot however refer to a static variable.", |
(+ split this sentence into a second .note("...")
)
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.
There seems to be a different style for --teach
diagnostics, in which multi-line notes are acceptable.
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.
ah 👍
r? @Centril |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit 8ca5564 has been approved by |
Clarify suggestion for E0013 Fixes rust-lang#68038.
Clarify suggestion for E0013 Fixes rust-lang#68038.
Rollup of 8 pull requests Successful merges: - #67666 (make use of pointer::is_null) - #67806 (Extract `rustc_ast_passes`, move gating, & refactor linting) - #68043 (Add some missing timers) - #68074 (Add `llvm-skip-rebuild` flag to `x.py`) - #68079 (Clarify suggestion for E0013) - #68084 (Do not ICE on unicode next point) - #68102 (Inline some conversion methods around OsStr) - #68106 (Fix issue with using `self` module via indirection) Failed merges: r? @ghost
Fixes #68038.