Skip to content
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

Allow some lints in .fixed files when compiling with Compiletest #88918

Open
xFrednet opened this issue Sep 13, 2021 · 0 comments
Open

Allow some lints in .fixed files when compiling with Compiletest #88918

xFrednet opened this issue Sep 13, 2021 · 0 comments
Labels
A-compiletest Area: the compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@xFrednet
Copy link
Member

See also Manishearth/compiletest-rs#243

Compiletest currently automatically allows all unused lints in the CompileFail and Ui modes. However, this doesn't extend to .fixed files, which are used inside Clippy. For this reason, we still have a bunch of #[allow()] attributes in Clippy's tests. It would be nice to have an option to allow lints inside .fixed compilation tests.

In a related discussion (See rust-lang/rust-clippy#7611), we agreed that it would also be cool, if we could be more specific than just allowing all lint's inside the unused group. I would suggest adding a new configuration with an enum like this:

pub enum LintConfiguration {
    /// No lints are automatically allowed
    None,
    /// All lints inside the `unused` lint group are allowed
    UnusedLints,
    /// List of lints that should be allowed. The names should be
    /// provided in the console format using dashes
    SpecificLints(&[&str])
}

Clippy uses compiletest-rs which is the downstream crate currently managed by @Manishearth. It would be great if this implementation could be done here and then transferred into compiletest-rs to keep them kind of in sync.


I'm currently quite busy with RL stuff, but would be happy to work on this in about a month, if it would be accepted in rustc's compiletest version. Any feedback regarding the idea is welcome!


cc: @rust-lang/devtools @Manishearth

@rustbot label +A-testsuite +C-enhancement +T-dev-tools

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Sep 13, 2021
@jieyouxu jieyouxu added the A-compiletest Area: the compiletest test runner label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: the compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
Status: Needs Triage / Backlog
Development

No branches or pull requests

3 participants