Skip to content

E0463 needs to be updated to new format #35934

Closed
@sophiajt

Description

@sophiajt
Contributor

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

Activity

paulfanelli

paulfanelli commented on Aug 25, 2016

@paulfanelli
Contributor

I'll take this one.

added
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Aug 26, 2016
paulfanelli

paulfanelli commented on Aug 27, 2016

@paulfanelli
Contributor

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

sophiajt commented on Aug 27, 2016

@sophiajt
ContributorAuthor

@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

paulfanelli commented on Aug 27, 2016

@paulfanelli
Contributor

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

sophiajt commented on Aug 27, 2016

@sophiajt
ContributorAuthor

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

GuillaumeGomez commented on Aug 27, 2016

@GuillaumeGomez
Member

'|' comes in when '^' has already be called on a same span IIRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brson@sophiajt@bstrie@GuillaumeGomez@paulfanelli

        Issue actions

          E0463 needs to be updated to new format · Issue #35934 · rust-lang/rust