-
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
Stop ignoring expected note/help messages in compiletest suite. #32263
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
/cc @fhahn |
(acc_help || ee.kind == "help:", acc_note || | ||
ee.kind == "note:")); | ||
(acc_help || ee.kind == "help:" || ee.kind == "help", | ||
acc_note || ee.kind == "note:" || ee.kind == "note")); |
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 have a separate branch that cleans up this "kind" logic by using enums. I plan to open it up as a follow-up PR if this merges.
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.
This should make the opt-in work for note
and help
as well, but it is still opt-in and notes and help messages are only checked in files with help
and note
annotations.
When making this changes, it seems like I overlooked note
and help
(and assumed there is more normalization going on). I think using enums there would make it clearer 👍
2991d5b
to
fb96cc8
Compare
@@ -8,6 +8,10 @@ | |||
// option. This file may not be copied, modified, or distributed | |||
// except according to those terms. | |||
|
|||
// error-pattern: in this expansion of format_args! | |||
// error-pattern: in this expansion of print! (defined in <std macros>) | |||
// field `c_object` of struct `stuff::Item` is private |
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 pretty sure I did this incorrectly. A couple errors in this testcase have errors that report on <std macros>
and I'm not sure the best way to handle it.
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.
there really isn't a good way, actually. In this case though I'd just remove the NOTEs. the issue in question (#25386) was an ICE, not a test of diagnostics (I'd not include NOTEs unless the purpose is to test that they are emitted, personally)
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.
Cool, that's what I figured, I'll remove them now.
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.
Removed in the latest force push.
A little background on this PR: I did a bit of refactoring on compiletest and realized that some help/note messages were being ignored. I noticed this conditional and assumed it was a mistake to not also check |
On second thought, I think it is still opt-in, but my changes make the opt-in work for both |
@@ -1013,8 +1013,8 @@ fn check_expected_errors(revision: Option<&str>, | |||
expected_errors.iter() | |||
.fold((false, false), |
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.
Pre-existing, but can't we use any
here instead of fold
? Seems like it more clearly expresses the intent.
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.
Given this code block:
fn main() {
let i = 1; //~ NOTE: some note
let j = 2; //~ HELP: some help
}
The current implementation checks for note
and help
in one pass through. I'm not sure how it'd be possible using any
unless we were expecting both help
and note
on the same line. I agree it's not clean, and I'm willing to clean it up, but would rather do that in a different PR.
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.
Do it in two passes?
On Wed, Mar 16, 2016 at 12:25:23PM -0700, Corey Farwell wrote:
@@ -1013,8 +1013,8 @@ fn check_expected_errors(revision: Option<&str>,
expected_errors.iter()
.fold((false, false),Given this code block:
fn main() { let i = 1; //~ NOTE: some note let j = 2; //~ HELP: some help }The current implementation checks for
note
andhelp
in one pass through. I'm not sure how it'd be possible usingany
unless we were expecting bothhelp
andnote
on the same line. I agree it's not clean, and I'm willing to clean it up, but would rather do that in a different PR.
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
https://github.com/rust-lang/rust/pull/32263/files/fb96cc8b5d83da8c32cdaf51a5f53edb74152024#r56398787
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.
Spoke with you on IRC. Going to do it in a follow-up PR.
left some nits, but seems good |
let me know when they're fixed :) |
fb96cc8
to
0f8fdba
Compare
Assuming your only nit was this one, then it's fixed |
Original issue: rust-lang#21195 Relevant PR: rust-lang#30778 Prior to this commit, if a compiletest testcase included the text "HELP:" or "NOTE:" (note the colons), then it would indicate to the compiletest suite that we should verify "help" and "note" expected messages. This commit updates this check to also check "HELP" and "NOTE" (not the absense of colons) so that we always verify "help" and "note" expected messages.
0f8fdba
to
abd1cea
Compare
Merge conflicts addressed. |
@bors r+ |
📌 Commit abd1cea has been approved by |
…atsakis Stop ignoring expected note/help messages in compiletest suite. Original issue: #21195 Relevant PR: #30778 Prior to this commit, if a compiletest testcase included the text "HELP:" or "NOTE:" (note the colons), then it would indicate to the compiletest suite that we should verify "help" and "note" expected messages. This commit updates this check to also check "HELP" and "NOTE" (not the absense of colons) so that we always verify "help" and "note" expected messages.
Original issue: #21195
Relevant PR: #30778
Prior to this commit, if a compiletest testcase included the text
"HELP:" or "NOTE:" (note the colons), then it would indicate to the
compiletest suite that we should verify "help" and "note" expected
messages.
This commit updates this check to also check "HELP" and "NOTE" (not the
absense of colons) so that we always verify "help" and "note" expected
messages.