-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Teach compiletest about multispans #31380
Comments
I don't think switching to JSON helps - you still have the same problem with multiple spans. |
I guess you're right. That was more of a general suggestion/question to use machine-readable output for machine related stuff, instead of ad-hoc parsing. edit: (should I open another issue for that?) |
I don't know enough about multispans to know what the new requirements are. @nikomatsakis probably did most of the error parsing in compiletest. I would be reluctant to switch to machine readable output unless we're super confident that the console output is formatted correctly and consistently whenever the machine output is correct. Probably worth a different issue, yes. |
Sorry, what is a multispan? :) |
@nikomatsakis a MultiSpan is like a Span, but covers multiple disjoint spans. |
On Wed, Feb 10, 2016 at 12:29:07PM -0800, Nick Cameron wrote:
I kind of guessed that :) but can someone give an example of an error that |
The only concrete planned use case is the unused import lint. For example, // Should get errors for both 'Some' and 'None'
use std::option::Option::{Some, None}; //~ ERROR unused import
//~^ ERROR unused import This should be reported, using foo.rs:20:27: 20:31 error: unused import(s)
foo.rs:20 use std::option::Option::{Some, None}; //~ ERROR unused import
^~~~ ^~~~ AIUI compiletest counts each emitted error message and parses the line number following the filename. I think this would require to track emitted spans somewhat - but the count of the emitted spans isn't necessarily equal to the expected error count (e.g. this suggestion). edit: // Should get errors for both 'Some' and 'None'
use std::option::Option::{Some, None}; //~ ERROR^2 unused import |
I feel like this has been done since this issue was opened; if we need this still though feel free to comment here and we can reopen! |
Compiletest needs to understand multispans before they can actually be used in compiler output.
This makes expected-error-checking more complicated because multiple errors can be folded into a single one, breaking a core assumption of the current code.
Because of this I suggest to switch to the new JSON error output format. (though how should stderr, raw json, be shown to the user in case of test failure?)
cc @nrc, @brson
The text was updated successfully, but these errors were encountered: