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

Clarify suggestion for E0013 #68079

Merged
merged 1 commit into from
Jan 11, 2020
Merged

Clarify suggestion for E0013 #68079

merged 1 commit into from
Jan 11, 2020

Conversation

varkor
Copy link
Member

@varkor varkor commented Jan 10, 2020

Fixes #68038.

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 10, 2020
Copy link
Contributor

@Centril Centril left a 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.

src/librustc_mir/transform/check_consts/ops.rs Outdated Show resolved Hide resolved
src/librustc_mir/transform/check_consts/ops.rs Outdated Show resolved Hide resolved
src/librustc_mir/transform/check_consts/ops.rs Outdated Show resolved Hide resolved
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.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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("..."))

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah 👍

@Centril
Copy link
Contributor

Centril commented Jan 10, 2020

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned eddyb Jan 10, 2020
@Centril Centril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 10, 2020
@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor

Centril commented Jan 10, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jan 10, 2020

📌 Commit 8ca5564 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 10, 2020
Centril added a commit to Centril/rust that referenced this pull request Jan 11, 2020
Centril added a commit to Centril/rust that referenced this pull request Jan 11, 2020
bors added a commit that referenced this pull request Jan 11, 2020
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
@bors bors merged commit 8ca5564 into rust-lang:master Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E0013 confusing diagnostic
5 participants