Skip to content

odd span with unused import generated by macro #36091

@durka

Description

@durka

I noticed this in a much more complex macro (it was recursive), but I minimized it:

macro_rules! m { ($($i:ident)*) => { use $($i)::*; } }

m!(std cmp);
warning: unused import, #[warn(unused_imports)] on by default
 --> /Users/alex/.multirust/toolchains/beta/cargo/.cargo/script-cache/expr-8aedeaeb93034069/expr.rs:5:64
  |
5 | {macro_rules! m { ($($i:ident)*) => { use $($i)::*; } } m!(std cmp);}
  |                                                                ^^^

I can't say the span is wrong... but it also doesn't seem right. cc @jonathandturner

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions