Skip to content

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

Closed
@zackmdavis

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

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