Closed
Description
From: src/test/compile-fail/E0463.rs
E0463 needs a span_label, updating it from:
error[E0463]: can't find crate for `cookie_monster`
--> src/test/compile-fail/E0463.rs:12:11
|
12 | #![plugin(cookie_monster)] //~ ERROR E0463
| ^^^^^^^^^^^^^^
To:
error[E0463]: can't find crate for `cookie_monster`
--> src/test/compile-fail/E0463.rs:12:11
|
12 | #![plugin(cookie_monster)] //~ ERROR E0463
| ^^^^^^^^^^^^^^ can't find crate
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
paulfanelli commentedon Aug 25, 2016
I'll take this one.
paulfanelli commentedon Aug 27, 2016
I've fixed this, but when I ran the unit tests after making my changes, all the tests passed. I was expecting the unit tests related to E0463 to fail. What this suggests to me is that there are no unit tests for E0463? How should I proceed?
sophiajt commentedon Aug 27, 2016
@paulfanelli - yeah, there's a quirk in the unit test system where it will only start testing the labels if you add at least one NOTE to the test. You can read up on it in the Extra Credit section of the blog post
paulfanelli commentedon Aug 27, 2016
Ok, I added a NOTE with bogus data and got the unit test for E0463 to fail. Then I put the correct NOTE in and it passed the test. But...I coded it 2 different ways and they both worked. Not sure what the best practice is?
the 1st way I coded it is (adding the NOTE separately; leaving the original ERROR alone):
#![feature(plugin)]
#![plugin(cookie_monster)] //~ ERROR E0463
//~^ NOTE can't find crate
extern crate cake_is_a_lie;
fn main() {
}
the 2nd way is (putting the ERROR and NOTE together with the ^ and |:
#![feature(plugin)]
#![plugin(cookie_monster)]
//
^ ERROR E0463| NOTE can't find crate//
extern crate cake_is_a_lie;
fn main() {
}
sophiajt commentedon Aug 27, 2016
Those are both correct. The testing system has been around a little while so, inevitably, there are a couple ways to do things.
My preference is the second of the two as, imho, it looks a little better.
GuillaumeGomez commentedon Aug 27, 2016
'|' comes in when '^' has already be called on a same span IIRC.