Skip to content

ICE: unprintable span #33185

Closed
Closed
@Manishearth

Description

@Manishearth
#[macro_export]
macro_rules! state {
    ( $( $name:ident : $field:ty )* ) => (
        #[derive(Default)]
        struct State {
            $($name : $field),*
        }
    )
}

state! { x: i64 }

pub fn main() {
}

gives:

<anon>:11:11: 6:20 warning: struct field is never used: `x`, #[warn(dead_code)] on by default
(internal compiler error: unprintable span)
<anon>:11:1: 11:18 note: in this expansion of state! (defined in <anon>)

(no backtrace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions