Add the known-bug
test directive, use it, and do some cleanup by jackh726 · Pull Request #93953 · rust-lang/rust (original) (raw)
@petrochenkov there was some discussion on zulip about this, but let me try to summarize what I can recall:
In regular tests, //~ ERROR
can help by providing redundancy (I'm not fully convinced that they do). Importantly though, this redundancy is that the error message you expect matches the error message you get. In known-bug tests, we don't expect any error message. It doesn't make sense (at least to me) to add error annotations to a test that you expect to be different (compile, or fail with different error). Another reasonable argument, for example, would be that the error annotations are for the errors you expect; so if you expect the test to compile, you shouldn't see any error annotations.
On the contrary, keeping the stderr
around does help, because it provides a "history" of why the test did not compile. If a test starts to pass, it helps you understand why and what changed.