Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix some irrelevant warnings in tests/incremental
This avoids having to add several unhelpful annotations when enabling
diagnostic checks for `cpass` and `rpass` revisions.
  • Loading branch information
Zalathar committed Apr 13, 2026
commit c79fcfcca872ffc8261663549cd2371da4be92f7
1 change: 1 addition & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ impl<'test> TestCx<'test> {
AllowUnused::No
}
}
TestMode::Incremental => AllowUnused::Yes,
_ => AllowUnused::No,
};

Expand Down
1 change: 0 additions & 1 deletion tests/incremental/const-generics/change-const-param-gat.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ revisions: rpass1 rpass2 rpass3
//@ compile-flags: -Zincremental-ignore-spans
//@ ignore-backends: gcc
#![feature(generic_associated_types)]

// This test unsures that with_opt_const_param returns the
// def_id of the N param in the Foo::Assoc GAT.
Expand Down
4 changes: 2 additions & 2 deletions tests/incremental/krate_reassign_34991/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
extern crate a;

#[cfg(rpass1)]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: a::X = 22;
x as u32
}

#[cfg(rpass2)]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
22
}

Expand Down
4 changes: 2 additions & 2 deletions tests/incremental/rlib_cross_crate/b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ extern crate a;

#[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")]
#[rustc_clean(cfg="rpass3")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: a::X = 22;
x as u32
}

#[rustc_clean(cfg="rpass2")]
#[rustc_clean(cfg="rpass3")]
pub fn use_Y() {
pub fn use_y() {
let x: a::Y = 'c';
}

Expand Down
1 change: 1 addition & 0 deletions tests/incremental/split_debuginfo_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// ignore-tidy-linelength
//@ only-x86_64-unknown-linux-gnu
//@ revisions:rpass1 rpass2 rpass3 rpass4
//@ ignore-backends: gcc

//@ [rpass1]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
//@ [rpass2]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
Expand Down
4 changes: 2 additions & 2 deletions tests/incremental/static_cycle/b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#![cfg_attr(rpass2, warn(dead_code))]

pub static mut BAA: *const i8 = unsafe { &BOO as *const _ as *const i8 };
pub static mut BAA: *const i8 = unsafe { &raw const BOO as *const i8 };

pub static mut BOO: *const i8 = unsafe { &BAA as *const _ as *const i8 };
pub static mut BOO: *const i8 = unsafe { &raw const BAA as *const i8 };

fn main() {}
6 changes: 3 additions & 3 deletions tests/incremental/struct_add_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ pub struct Y {
}

#[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")]
pub fn use_X(x: X) -> u32 {
pub fn use_x(x: X) -> u32 {
x.x as u32
}

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_EmbedX(embed: EmbedX) -> u32 {
pub fn use_embed_x(embed: EmbedX) -> u32 {
embed.x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
6 changes: 3 additions & 3 deletions tests/incremental/struct_change_field_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ pub struct Y {
}

#[rustc_clean(except="typeck_root", cfg="cfail2")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: X = X { x: 22 };
//[cfail2]~^ ERROR struct `X` has no field named `x`
x.x as u32
//[cfail2]~^ ERROR no field `x` on type `X`
}

#[rustc_clean(except="typeck_root", cfg="cfail2")]
pub fn use_EmbedX(embed: EmbedX) -> u32 {
pub fn use_embed_x(embed: EmbedX) -> u32 {
embed.x.x as u32
//[cfail2]~^ ERROR no field `x` on type `X`
}

#[rustc_clean(cfg="cfail2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
6 changes: 3 additions & 3 deletions tests/incremental/struct_change_field_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ pub struct Y {
}

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_EmbedX(x: EmbedX) -> u32 {
pub fn use_embed_x(x: EmbedX) -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
6 changes: 3 additions & 3 deletions tests/incremental/struct_change_field_type_cross_crate/b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ extern crate a;
use a::*;

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_EmbedX(embed: EmbedX) -> u32 {
pub fn use_embed_x(embed: EmbedX) -> u32 {
embed.x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
6 changes: 3 additions & 3 deletions tests/incremental/struct_change_nothing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ pub struct Y {
}

#[rustc_clean(cfg="rpass2")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_EmbedX(x: EmbedX) -> u32 {
pub fn use_embed_x(x: EmbedX) -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
6 changes: 3 additions & 3 deletions tests/incremental/struct_remove_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ pub struct Y {
}

#[rustc_clean(except="typeck_root,fn_sig", cfg="rpass2")]
pub fn use_X(x: X) -> u32 {
pub fn use_x(x: X) -> u32 {
x.x as u32
}

#[rustc_clean(except="typeck_root", cfg="rpass2")]
pub fn use_EmbedX(embed: EmbedX) -> u32 {
pub fn use_embed_x(embed: EmbedX) -> u32 {
embed.x.x as u32
}

#[rustc_clean(cfg="rpass2")]
pub fn use_Y() {
pub fn use_y() {
let x: Y = Y { y: 'c' };
}

Expand Down
4 changes: 2 additions & 2 deletions tests/incremental/type_alias_cross_crate/b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ extern crate a;

#[rustc_clean(except="typeck_root", cfg="rpass2")]
#[rustc_clean(cfg="rpass3")]
pub fn use_X() -> u32 {
pub fn use_x() -> u32 {
let x: a::X = 22;
x as u32
}

#[rustc_clean(cfg="rpass2")]
#[rustc_clean(cfg="rpass3")]
pub fn use_Y() {
pub fn use_y() {
let x: a::Y = 'c';
}

Expand Down