Skip to content

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

Closed as not planned
@xFrednet

Description

@xFrednet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions