-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
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. |
./build/x86_64-unknown-linux-gnu/stage1/bin/rustc -V
rustc 1.13.0-dev (499484f56 2016-08-18) Anyway, I' ll fix that. |
Looks like you'll also want to run a
|
8437554
to
9f75aee
Compare
should be fixed this time... |
Thanks! @bors r+ |
📌 Commit 9f75aee has been approved by |
☔ The latest upstream changes (presumably #35776) made this pull request unmergeable. Please resolve the merge conflicts. |
9f75aee
to
8fdc531
Compare
@jonathandturner resolved. |
Thanks! @bors r+ rollup |
📌 Commit 8fdc531 has been approved by |
…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
Fixes #35791, #35796 and #35344, as part of #35233
r? @jonathandturner