Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fpoli opened this issue Jun 27, 2018 · 2 comments
Closed

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

fpoli opened this issue Jun 27, 2018 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@fpoli
Copy link
Contributor

fpoli commented Jun 27, 2018

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

@Mark-Simulacrum
Copy link
Member

cc @nrc @jseyfried

It might be best to open a PR with the changes if that's relatively trivial to do; I think you'd be more likely to get faster feedback then.

@Mark-Simulacrum Mark-Simulacrum added A-testsuite Area: The testsuite used to check the correctness of rustc A-diagnostics Area: Messages for errors, warnings, and lints labels Jul 7, 2018
bors added a commit that referenced this issue Jul 23, 2018
Match errors using the callsite of macro expansions

Fix for issue #51848
@fpoli
Copy link
Contributor Author

fpoli commented Jul 24, 2018

Fixed in 6a1c063

@fpoli fpoli closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc
Projects
None yet
Development

No branches or pull requests

2 participants