Skip to content

incorrect suggestion span for no-mangle-const-items lint #45562

Description

@zackmdavis
error: const items should never be #[no_mangle]
 --> const.rs:1:14
  |
1 | #[no_mangle] pub const RAH: usize = 5;
  |              -----^^^^^^^^^^^^^^^^^^^^
  |              |
  |              help: try a static value: `pub static`
  |
  = note: #[deny(no_mangle_const_items)] on by default

should look more like

error: const items should never be #[no_mangle]
 --> const.rs:1:14
  |
1 | #[no_mangle] pub const RAH: usize = 5;
  |                  -----^^^^^^^^^^^^^^^^
  |                  |
  |                  help: try a static value: `static`
  |
  = note: #[deny(no_mangle_const_items)] on by default

due to faulty assumptions introduced in #45232

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions