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

Closed
xFrednet opened this issue Sep 13, 2021 · 2 comments
Closed

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

xFrednet opened this issue Sep 13, 2021 · 2 comments
Labels
A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, 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
@jieyouxu jieyouxu moved this from Needs Triage / Backlog to Ready in compiletest maintenance and improvements Jun 9, 2024
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Oct 9, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Oct 9, 2024

@xFrednet ping from uhh I guess triage (well actually I was looking at compiletest stuff), since AFAIK clippy uses ui_test since a good while back, is this still relevant?

@xFrednet
Copy link
Member Author

Thank you for the ping. I think it would still be a good feature to have, but it's not a priority rn. If the topic comes up again, I'll create an issue in the ui_test crate. :D

@xFrednet xFrednet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
@jieyouxu jieyouxu added C-discussion Category: Discussion or questions that doesn't represent real issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-compiletest Area: The compiletest test runner and removed 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-compiletest Area: The compiletest test runner labels Oct 13, 2024
@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed C-discussion Category: Discussion or questions that doesn't represent real issues. labels Oct 13, 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 C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: Abandoned / Won't Fix
Development

No branches or pull requests

3 participants