Skip to content

Errors inside a macro invocation don't report the full location of the error #5794

Closed
@erickt

Description

@erickt

It seems the debug! code isn't properly pushing a span onto the macro expansion span stack. This code:

fn main() {
    let a = ~"";
    debug!("foo: %s %s", a);
}

Only reports the error inside the macro, but not where that macro is getting used:

<core-macros>:33:24: 33:42 error: not enough arguments to fmt! for the given format string
<core-macros>:33             __log(4u32, fmt!( $($arg),+ ))
                                         ^~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions