Skip to content
New issue

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

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

Already on GitHub? # to your account

E0013 confusing diagnostic #68038

Closed
RustyYato opened this issue Jan 9, 2020 · 0 comments · Fixed by #68079
Closed

E0013 confusing diagnostic #68038

RustyYato opened this issue Jan 9, 2020 · 0 comments · Fixed by #68079
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RustyYato
Copy link
Contributor

static FOO: u8 = 0;
const FOO_REF: &u8 = &FOO;

gives

error[E0013]: constants cannot refer to statics, use a constant instead
 --> src/lib.rs:3:22
  |
3 | const FOO_REF: &u8 = &FOO;
  |                      ^^^^

error: aborting due to previous error

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

The wording constants cannot refer to statics, use a constant instead is confusing

@Centril Centril added D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Jan 9, 2020
Centril added a commit to Centril/rust that referenced this issue Jan 11, 2020
@bors bors closed this as completed in ba14f94 Jan 11, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants