Skip to content
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

Make rustc output parsing more robust #113

Open
Boddlnagg opened this issue May 2, 2015 · 2 comments
Open

Make rustc output parsing more robust #113

Boddlnagg opened this issue May 2, 2015 · 2 comments
Labels

Comments

@Boddlnagg
Copy link
Contributor

While testing #112 I found at least one case, where the current RegEx for error messages does not work correctly. Given this rustc output

main.rs:118:22: 118:26 error: mismatched types:
 expected `&mut [u8]`,
    found `&[u8; 2]`
(values differ in mutability) [E0308]
main.rs:118     match stdin.read(&buf) {
                                 ^~~~

the RegEx will only extract the first line and discard the additional information, resulting in the error message mismatched types:

I'm not sure how this should be fixed.

@vosen
Copy link
Member

vosen commented May 2, 2015

I suspect a rule along the lines "If the first error line ends with :, everything up to error code is part of the message" would cover it.
But it's just for this case, there are probably other multiline messages thatw e fail on. We really should comb libsyntax sources for all the [EXXX] messages, convert them to tests and start reworking output parsing from there.

@Boddlnagg
Copy link
Contributor Author

We should probably be using the JSON error format, which has recently landed: rust-lang/rust#30711 (requires invoking a recent rustc with -Z unstable-options --error-format=json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants