-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
"help" messages in compiler output is ignored #21195
Comments
Perhaps compiletest should yell loudly if there are any unparsed |
kmcallister: this already happens, it's the other direction that is not checked |
I think this is intentional. It’d be painful to have to annotate every single |
almost. |
(pointed here from #30778); it seems like a fine idea to me |
I also think it makes sense to have a way to make tests fail if there are unexpected note/help messages (e.g. making sure a new note/help messages does not show up in unexpected places). I guess we currently do not fail on unexpected help/note messages for historical reasons (as far as I remember, earlier versions of Rust did not have help/note messages). However failing on unexpected help/note messages as default now would require adding a lot of additional annotations. So providing a way to opt in seems reasonable to me. |
@fhahn opt-in seems good, for the reasons you cite. I've also rarely actually wanted a failure in those cases in the tests I write, at least. |
I personally like the idea that if any help/note are specified then they must be exhaustively specified, and otherwise they're entirely optional. Seems like a good way to ensure that the diagnostics are kept in check and they don't accidentally blow up to 1k help messages by accident. |
In discussion in the compiler meeting we agreed that "match all help/note if we match any help/note" is a reasonable heuristic and we should just do that. If we ever want to test that there are NO note/help, we can always add something like |
…tains help/note annotations, closes rust-lang#21195
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.
The opt-in functionality was proposed and discussed in rust-lang#21195
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.
…ote, r=nikomatsakis Add comment about opt-in nature of compiletest note/help messages. The opt-in functionality was proposed and discussed in rust-lang#21195
Removing these will still pass make check.
The text was updated successfully, but these errors were encountered: