rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.11k stars 12.69k forks source link

compiletest: warn/error on redundant `check-fail` directives #130742

Open jieyouxu opened 1 month ago

jieyouxu commented 1 month ago

check-fail here is redundant

_Originally posted by @compiler-errors in https://github.com/rust-lang/rust/pull/130718#discussion_r1770625658_

Some test suites have a default test behavior, like //@ check-fail, in which case specifying that explicitly in the test is redundant and useless noise. When compiletest directive handling is worked, we should warn or error on redundant directives like these and also explain why it's redundant, e.g. "ui test mode is check-fail by default".

Remark: this check should not be added before reworking how compiletest directives are handled as it's not just one test suite or directive.

jieyouxu commented 1 week ago

This is E-easy but just randomly adding checks here an there isn't a maintainable solution.