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

Updated E0054, E0423 & E0432 to new error format #35820

Merged
merged 3 commits into from
Aug 23, 2016

Conversation

knight42
Copy link
Contributor

Fixes #35791, #35796 and #35344, as part of #35233

r? @jonathandturner

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonathandturner (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -59,10 +59,12 @@ fn main()
//~^ ERROR casting
//~^^ HELP through a usize first
let _ = 3_i32 as bool;
//~^ ERROR cannot cast as `bool`
//~^ ERROR cannot cast as `bool` [E0054]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that putting the [E0054] at the end passes the tests. For example, when I run this test by hand I get this as output:

error[E0054]: cannot cast as `bool`
  --> src/test/compile-fail/cast-rfc0401.rs:61:13
   |
61 |     let _ = 3_i32 as bool;
   |             ^^^^^^^^^^^^^
   |
   = help: compare with zero instead

Notice the [E0054] part is on the left and not the right. You may need to update your compiler source.

Copy link
Contributor Author

@knight42 knight42 Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathandturner
In fact, if I changed

//~^ ERROR cannot cast as `bool` [E0054]

to

//~^ ERROR E0054 cannot cast as `bool`

I got the error message like this:

unexpected errors (from JSON output): [
    Error {
        line_num: 61,
        kind: Some(
            Error
        ),
        msg: "61:13: 61:26: cannot cast as `bool` [E0054]"
    }
]

not found errors (from test file): [
    Error {
        line_num: 61,
        kind: Some(
            Error
        ),
        msg: "E0054 cannot cast as `bool`"
    }
]

I believe it makes sense to leave [E0054] on the right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. Sure, if you want to match them that way is fine. You can also leave the [0054] off, and it will also succeed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget when the JSON uses old format :)

@sophiajt
Copy link
Contributor

Thanks for the PR!

I left a comment on the unit tests. I think you may be using an older compiler and may need to update your compiler source.

@knight42
Copy link
Contributor Author

@jonathandturner

./build/x86_64-unknown-linux-gnu/stage1/bin/rustc -V
rustc 1.13.0-dev (499484f56 2016-08-18)

Anyway, I' ll fix that.

@sophiajt
Copy link
Contributor

Looks like you'll also want to run a tidy pass:

python src/bootstrap/bootstrap.py --stage 1 --step check-tidy
/build/src/test/compile-fail/issue-19452.rs:17: line longer than 100 chars
/build/src/test/compile-fail/issue-18252.rs:17: line longer than 100 chars

@knight42
Copy link
Contributor Author

should be fixed this time...

@sophiajt
Copy link
Contributor

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 19, 2016

📌 Commit 9f75aee has been approved by jonathandturner

@bors
Copy link
Contributor

bors commented Aug 21, 2016

☔ The latest upstream changes (presumably #35776) made this pull request unmergeable. Please resolve the merge conflicts.

@knight42
Copy link
Contributor Author

knight42 commented Aug 22, 2016

@jonathandturner resolved.

@sophiajt
Copy link
Contributor

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 22, 2016

📌 Commit 8fdc531 has been approved by jonathandturner

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 22, 2016
…andturner

Updated E0054, E0423 & E0432 to new error format

Fixes rust-lang#35791, rust-lang#35796 and rust-lang#35344, as part of rust-lang#35233

r? @jonathandturner
bors added a commit that referenced this pull request Aug 22, 2016
@bors bors merged commit 8fdc531 into rust-lang:master Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants