Proposal
Currently, there seems to be no dedicated tests for the compiler's lint emission. There are tests for the #[derive(Diagnostic)] macro, and the existing UI test suite tests the system generally, but there is no mechanism to test the emission of arbitrary diagnostics. This means that PRs adding new features or behaviour to the diagnostic system will not be able to test edge cases.
For example, the motivating PR (rust-lang/rust#157707) contains no tests at all, and the lint that motivated that (rust-lang/rust#158136) only tests the behaviour very briefly.
I would like to propose allowing testing lints more fully with a new aux-lint directive; this will compile a test using a custom rustc_driver that loads the provided lint library. This is implemented in rust-lang/rust#157721.
The actual change only impacts bootstrap and compiletest, but @Mark-Simulacrum suggested an MCP as this machinery would need to be kept up to date with any changes to the lint infrastructure.
Process
The main points of the Major Change Process are as follows:
You can read more about Major Change Proposals on forge.
Proposal
Currently, there seems to be no dedicated tests for the compiler's lint emission. There are tests for the
#[derive(Diagnostic)]macro, and the existing UI test suite tests the system generally, but there is no mechanism to test the emission of arbitrary diagnostics. This means that PRs adding new features or behaviour to the diagnostic system will not be able to test edge cases.For example, the motivating PR (rust-lang/rust#157707) contains no tests at all, and the lint that motivated that (rust-lang/rust#158136) only tests the behaviour very briefly.
I would like to propose allowing testing lints more fully with a new
aux-lintdirective; this will compile a test using a customrustc_driverthat loads the provided lint library. This is implemented in rust-lang/rust#157721.The actual change only impacts bootstrap and compiletest, but @Mark-Simulacrum suggested an MCP as this machinery would need to be kept up to date with any changes to the lint infrastructure.
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.