Skip to content

Error spans into imported macros render poorly #20923

Closed
@sfackler

Description

@sfackler
fn main() {
    write!(&mut 2, "");
}
<std macros>:2:20: 2:66 error: type `&mut _` does not implement any method in scope named `write_fmt`
<std macros>:2 ( & mut * $ dst ) . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Exported macros are currently serialized as token trees and pretty printed for display, and the pretty printer is not very good. Macros were previously serialized as a string of their source definition for this exact reason.

Reexported macro definitions in rustdoc have the same problem: http://doc.rust-lang.org/std/macro.write!.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions