Skip to content

Use the callsite span of a macro expansion in compiletest #51848

Closed
@fpoli

Description

@fpoli

The following test fails, because compiletest does not look for the callsite span of a macro expansion:

macro_rules! macro_with_error {
    ( ) => {
        let x: u64 = true;
    };
}

fn main() {
    macro_with_error!();  //~ ERROR mismatched types
}

This causes some problems when the macro definition is not in the file that is tested, see issue Manishearth/compiletest-rs#48, because there is no way to expect the error with an //~ ERROR comment.

Does the current implementation ignore the callsite of macro expansions on purpose?
If not, I have a fix for this: Manishearth/compiletest-rs#116

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-testsuiteArea: The testsuite used to check the correctness of rustc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions