-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
compiletest: compare-mode cannot handle mixed success + failure #49855
Copy link
Copy link
Open
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-compiletest-compare-modesArea: compiletest compare-modesArea: compiletest compare-modesA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itE-needs-investigationCall for participation: This issues needs some investigation to determine current statusCall for participation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Metadata
Metadata
Assignees
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-compiletest-compare-modesArea: compiletest compare-modesArea: compiletest compare-modesA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itE-needs-investigationCall for participation: This issues needs some investigation to determine current statusCall for participation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Sub-issue of #48879
Currently, if you have a ui test
src/test/ui/foo.rsthat signals a diagnostic error under the AST borrowck, but has no error under the NLL borrowck, then there is no way to make afoo.nll.stderrorfoo.nll.stdoutsuch that runningcompiletest --compare-mode=nllwill accept it.The reason:
compiletestcomplains that the compilation itself was successful, and by default, all ui tests are assumed to signal a compilation failure.The usual way such a case (of a test that compiles without an error) is handled in
compiletestis to add a comment of the form// run-passin the test itself. But we do not want the tests to be marked as always passing; they only pass under the special mode (NLL in this case) that is still under development in the compiler itself.There are a number of reasonable ways of addressing this.
they end with a functiontheirfn mainis tagged with#[rustc_error], so that they will never successfully compile.// [nll] run-pass.compiletestinfer that a test, when running under compare-mode, must have an implicit// run-passmarker, if there exists afoo.mode.stdoutfile (even an empty one).I'm not such a big fan of options 1 or 2 because I like the fact that (so far) compare-mode does not have to impact the existing
.rsnor.stderr/.stdoutfiles; you just add your alternative.nll.stderrfile and no one else is the wiser.So currently I would like us to adopt option 3 (or some other option I haven't thought of yet) that allows the
.rs/.stderr/.stdoutto go on oblivious to the existence of compare-mode.But, in the short term, to let us get work done, I plan to follow option 1 for all existing
ui/tests. (This is intended to be a temporary hack; all such uses of this hack should point back to this issue.)