Skip to content

E0013 confusing diagnostic #68038

Closed
@RustyYato

Description

@RustyYato
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions