Remove incremental test, disable incremental for cargo tests (#14910)

Fixes https://github.com/rust-lang/rust-clippy/issues/11126

It avoids the ICE when the number of lints changes, this is only a
problem for clippy in development but cleaning the clippy dir requires a
lot of rebuilding

changelog: none
This commit is contained in:
dswij 2025-06-05 15:45:47 +00:00 committed by GitHub
commit cf75dd4700
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 37 deletions

View file

@ -273,10 +273,10 @@ fn run_ui_cargo(cx: &TestContext) {
config.program.input_file_flag = CommandBuilder::cargo().input_file_flag;
config.program.out_dir_flag = CommandBuilder::cargo().out_dir_flag;
config.program.args = vec!["clippy".into(), "--color".into(), "never".into(), "--quiet".into()];
config
.program
.envs
.push(("RUSTFLAGS".into(), Some("-Dwarnings".into())));
config.program.envs.extend([
("RUSTFLAGS".into(), Some("-Dwarnings".into())),
("CARGO_INCREMENTAL".into(), Some("0".into())),
]);
// We need to do this while we still have a rustc in the `program` field.
config.fill_host_and_target().unwrap();
config.program.program.set_file_name(if cfg!(windows) {

View file

@ -1,11 +0,0 @@
//@compile-flags: -C incremental=target/debug/test/incr
#![allow(clippy::uninlined_format_args)]
// see https://github.com/rust-lang/rust-clippy/issues/10969
fn main() {
let s = "Hello, world!";
println!("{}", s);
//~^ to_string_in_format_args
}

View file

@ -1,11 +0,0 @@
//@compile-flags: -C incremental=target/debug/test/incr
#![allow(clippy::uninlined_format_args)]
// see https://github.com/rust-lang/rust-clippy/issues/10969
fn main() {
let s = "Hello, world!";
println!("{}", s.to_string());
//~^ to_string_in_format_args
}

View file

@ -1,11 +0,0 @@
error: `to_string` applied to a type that implements `Display` in `println!` args
--> tests/ui/to_string_in_format_args_incremental.rs:9:21
|
LL | println!("{}", s.to_string());
| ^^^^^^^^^^^^ help: remove this
|
= note: `-D clippy::to-string-in-format-args` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::to_string_in_format_args)]`
error: aborting due to 1 previous error