-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Expect all help/note messages are specified in a cfail test #30778
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Nominated for discussion at the next @rust-lang/compiler meeting. But feel free to throw in your 2 cents now. :) |
Actually, let's converse at #21195, not on the PR itself. |
d866942
to
08c590f
Compare
Great to hear. I've updated the tests. |
expected_errors.iter() | ||
.fold((false, false), | ||
|(acc_help, acc_note), ee| | ||
(acc_help || ee.kind == "help:", acc_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.
so, the logic here is that "if there is a help, then all help must be present", plus "if there is a note, then all notes must be present."
In hindsight I had thought that what we were discussing was "if there is either a help or a note, then all help and notes must be present."
I suspect that the logic you have chosen is actually more convenient in practice than what I was expecting, but I still figured I should point it out explicitly, in case someone else was as confused as I was about the proposal.
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.
Yep, thanks for making that clear. I probably should have been more specific in the description. By the way, is there a place to document this?
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.
In hindsight I had thought that what we were discussing was "if there is either a help or a note, then all help and notes must be present."
I actually wondered later which version we meant, and figured I'd probably be ok with either one...
By the way, is there a place to document this?
We've gone back and forth on this. I know that @brson has been working on making some kind of "wiki-like" page for compiler internal docs and the like, I'm not sure what's the current status on that? I'm not sure what happened to the existing docs on the compiletest infrastruture, but it seems like it should go in there.
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.
Ok. Should we delay merging this PR until there's a place for the documentation?
Nah. Let's land it. |
It's not like the rest of this system is documented :) |
(Well, it used to be?) |
@bors r+ |
📌 Commit 08c590f has been approved by |
⌛ Testing commit 08c590f with merge 2fe164d... |
💔 Test failed - auto-win-msvc-64-opt |
This looks like it could be a legitimate failure? In particular, while I do see that this PR touched
but in the output linked via homu, I see a few more notes being emitted, including one that has a @fhahn is there a way for a test to opt out of the stronger checking being performed here, e.g. via some test option embedded in a comment near the top of the file? |
…tains help/note annotations, closes rust-lang#21195
Yeah it seems like it could be a legitimate failure. It seems like for the Windows build, two additional notes are emitted, e.g. for
@pnkfelix as you already mentioned, the last two notes seem fishy and probably shouldn't be there. The first of those seem to point to the one already suggested, except that the first part is missing and slashes instead of backslashes are used. The last note suggests At the moment there's no option to opt out of the new behavior, but I could add one, if we want to merge this PR before resolving the Windows issue. |
It'd probably be fine to tag these with |
08c590f
to
526965a
Compare
@alexcrichton thanks for pointing me to |
This is a PR for #21195. It changes the way unspecified `help` and `ǹote` messages are handled in compile-fail tests as suggested by @oli-obk in the issue: if there are some `note` or `help` annotations, there must be annotations for all `help` or `note` messages of this test. Maybe it makes also sense to add an option to specify that the this test should fail if there are unspecified `help` or `note` messages. With this change, the following tests fail: [compile-fail] compile-fail/changing-crates.rs [compile-fail] compile-fail/default_ty_param_conflict_cross_crate.rs [compile-fail] compile-fail/lifetime-inference-give-expl-lifetime-param.rs [compile-fail] compile-fail/privacy1.rs [compile-fail] compile-fail/svh-change-lit.rs [compile-fail] compile-fail/svh-change-significant-cfg.rs [compile-fail] compile-fail/svh-change-trait-bound.rs [compile-fail] compile-fail/svh-change-type-arg.rs [compile-fail] compile-fail/svh-change-type-ret.rs [compile-fail] compile-fail/svh-change-type-static.rs [compile-fail] compile-fail/svh-use-trait.rs I'll add the missing annotations if we decide to accept this change.
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.
…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.
…nkov Enable svh tests on msvc These tests were ignored for msvc in rust-lang#30778 because of additional notes that were being added for some reason. I'm fairly confident this has been fixed in the intervening years so lets try re-enabling these tests. Fixes rust-lang#31306
This is a PR for #21195. It changes the way unspecified
help
andǹote
messages are handled in compile-fail tests as suggested by @oli-obk in the issue: if there are somenote
orhelp
annotations, there must be annotations for allhelp
ornote
messages of this test. Maybe it makes also sense to add an option to specify that the this test should fail if there are unspecifiedhelp
ornote
messages.With this change, the following tests fail:
I'll add the missing annotations if we decide to accept this change.