Skip to content

Commit 9e3e2ed

Browse files
authored
Unrolled build for rust-lang#121531
Rollup merge of rust-lang#121531 - saethlin:ignore-less-debug, r=compiler-errors Ignore less tests in debug builds Since rust-lang#120594 and rust-lang#120863, nearly all UB-detecting debug assertions get compiled out of code that is monomorphized by a crate built with debug assertions disabled. Which means that if we default all our codegen tests to `-Cdebug-assertions=no`, most of them work just fine against a sysroot built with debug assertions. I also tried to explain a bit better why some tests need to be skipped, for those that still need to be skipped.
2 parents 6bdb8a4 + 2f3c0b9 commit 9e3e2ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+14
-62
lines changed

src/tools/compiletest/src/runtest.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2503,8 +2503,11 @@ impl<'test> TestCx<'test> {
25032503
// overridden by `compile-flags`.
25042504
rustc.arg("-Copt-level=2");
25052505
}
2506-
RunPassValgrind | Pretty | DebugInfo | Codegen | Rustdoc | RustdocJson | RunMake
2507-
| CodegenUnits | JsDocTest | Assembly => {
2506+
Assembly | Codegen => {
2507+
rustc.arg("-Cdebug-assertions=no");
2508+
}
2509+
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
2510+
| CodegenUnits | JsDocTest => {
25082511
// do not use JSON output
25092512
}
25102513
}

tests/assembly/option-nonzero-eq.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
66
//@ only-x86_64
77
//@ ignore-sgx
8-
//@ ignore-debug
98

109
use std::cmp::Ordering;
1110

tests/assembly/slice-is_ascii.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
66
//@ only-x86_64
77
//@ ignore-sgx
8-
//@ ignore-debug
98

109
#![feature(str_internals)]
1110

tests/assembly/static-relocation-model.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//@ [A64] needs-llvm-components: aarch64
77
//@ [ppc64le] compile-flags: --target powerpc64le-unknown-linux-gnu -Crelocation-model=static
88
//@ [ppc64le] needs-llvm-components: powerpc
9-
//@ ignore-debug: alignment checks insert panics that we don't have a lang item for
109

1110
#![feature(no_core, lang_items)]
1211
#![no_core]

tests/codegen/align-offset.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (debug assertions in `slice::from_raw_parts` block optimizations)
32

43
#![crate_type = "lib"]
54

tests/codegen/array-map.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -C opt-level=3 -C target-cpu=x86-64-v3
22
//@ only-x86_64
3-
//@ ignore-debug (the extra assertions get in the way)
43

54
#![crate_type = "lib"]
65

tests/codegen/ascii-char.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=1
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54
#![feature(ascii_char)]

tests/codegen/binary-search-index-no-bound-check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32
#![crate_type = "lib"]
43

54
// Make sure no bounds checks are emitted when slicing or indexing

tests/codegen/infallible-unwrap-in-opt-z.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=z --edition=2021
2-
//@ ignore-debug
32

43
#![crate_type = "lib"]
54

tests/codegen/issue-97217.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=3
2-
//@ ignore-debug: the debug assertions get in the way
32
//@ min-llvm-version: 17.0.2
43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-101082.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32

43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-101814.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32

43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-106369.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-116878.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32
#![crate_type = "lib"]
43

54
/// Make sure no bounds checks are emitted after a `get_unchecked`.

tests/codegen/issues/issue-37945.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O -Zmerge-functions=disabled
22
//@ ignore-32bit LLVM has a bug with them
3-
//@ ignore-debug
43

54
// Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
65

tests/codegen/issues/issue-45222.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32

43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-45466.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32

43
#![crate_type="rlib"]
54

tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// prevent optimizing away bounds checks
33

44
//@ compile-flags: -O
5-
//@ ignore-debug: the debug assertions get in the way
65

76
#![crate_type="rlib"]
87

tests/codegen/issues/issue-69101-bounds-check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32
#![crate_type = "lib"]
43

54
// Make sure no bounds checks are emitted in the loop when upfront slicing

tests/codegen/issues/issue-73258.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54

tests/codegen/issues/issue-73396-bounds-check-after-position.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32
#![crate_type = "lib"]
43

54
// Make sure no bounds checks are emitted when slicing or indexing

tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: The debug assertions get in the way
21
//@ compile-flags: -O
32

43
#![crate_type = "lib"]

tests/codegen/iter-repeat-n-trivial-drop.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65
#![feature(iter_repeat_n)]

tests/codegen/layout-size-checks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65

tests/codegen/lib-optimizations/iter-sum.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: the debug assertions get in the way
21
//@ compile-flags: -O
32
//@ only-x86_64 (vectorization varies between architectures)
43
#![crate_type = "lib"]

tests/codegen/mem-replace-big-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// known to be `1` after inlining).
55

66
//@ compile-flags: -C no-prepopulate-passes -Zinline-mir=no
7-
//@ ignore-debug: the debug assertions get in the way
7+
//@ ignore-debug: precondition checks in ptr::read make them a bad candidate for MIR inlining
88

99
#![crate_type = "lib"]
1010

tests/codegen/mem-replace-simple-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags: -O -C no-prepopulate-passes
22
//@ only-x86_64 (to not worry about usize differing)
3-
//@ ignore-debug (the debug assertions get in the way)
3+
//@ ignore-debug: precondition checks make mem::replace not a candidate for MIR inlining
44

55
#![crate_type = "lib"]
66

tests/codegen/ptr-arithmetic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O -Z merge-functions=disabled
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54

tests/codegen/ptr-read-metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O -Z merge-functions=disabled
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54

tests/codegen/simd/simd-wide-sum.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ revisions: llvm mir-opt3
22
//@ compile-flags: -C opt-level=3 -Z merge-functions=disabled --edition=2021
33
//@ only-x86_64
4-
//@ ignore-debug: the debug assertions get in the way
54
//@ [mir-opt3]compile-flags: -Zmir-opt-level=3
65
//@ [mir-opt3]build-pass
76

tests/codegen/simd/swap-simd-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O -C target-feature=+avx
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65

tests/codegen/slice-as_chunks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-64bit (because the LLVM type of i64 for usize shows up)
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65
#![feature(slice_as_chunks)]

tests/codegen/slice-indexing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-64bit (because the LLVM type of i64 for usize shows up)
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65

tests/codegen/slice-iter-fold.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: the debug assertions get in the way
21
//@ compile-flags: -O
32
#![crate_type = "lib"]
43

tests/codegen/slice-iter-len-eq-zero.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions add extra comparisons
32
#![crate_type = "lib"]
43

54
type Demo = [u8; 3];

tests/codegen/slice-iter-nonnull.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (these add extra checks that make it hard to verify)
32
#![crate_type = "lib"]
43
#![feature(exact_size_is_empty)]
54

tests/codegen/slice-ref-equality.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O -Zmerge-functions=disabled
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54

tests/codegen/slice-reverse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags: -O
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions in from_raw_parts get in the way
3+
//@ ignore-debug: debug assertions prevent generating shufflevector
44

55
#![crate_type = "lib"]
66

tests/codegen/slice_as_from_ptr_range.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-64bit (because we're using [ui]size)
3-
//@ ignore-debug (because the assertions get in the way)
43

54
#![crate_type = "lib"]
65
#![feature(slice_from_ptr_range)]

tests/codegen/swap-large-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65

tests/codegen/swap-small-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O -Z merge-functions=disabled
22
//@ only-x86_64
3-
//@ ignore-debug: the debug assertions get in the way
43

54
#![crate_type = "lib"]
65

tests/codegen/transmute-optimized.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O -Z merge-functions=disabled
2-
//@ ignore-debug
32

43
#![crate_type = "lib"]
54

tests/codegen/unchecked_shifts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (because unchecked is checked in debug)
32

43
#![crate_type = "lib"]
54
#![feature(unchecked_shifts)]

tests/codegen/unwind-landingpad-inline.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ min-llvm-version: 17.0.2
22
//@ compile-flags: -Copt-level=3
3-
//@ ignore-debug: the debug assertions get in the way
43
#![crate_type = "lib"]
54

65
// This test checks that we can inline drop_in_place in

tests/codegen/vec-calloc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -O -Z merge-functions=disabled
22
//@ only-x86_64
3-
//@ ignore-debug
43

54
#![crate_type = "lib"]
65

tests/codegen/vec-in-place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ ignore-debug: the debug assertions get in the way
1+
//@ ignore-debug: FIXME: checks for call detect scoped noalias metadata
22
//@ compile-flags: -O -Z merge-functions=disabled
33
#![crate_type = "lib"]
44

tests/codegen/vec-iter-collect-len.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: the debug assertions get in the way
21
//@ compile-flags: -O
32
#![crate_type="lib"]
43

tests/codegen/vec-iter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: the debug assertions get in the way
21
//@ compile-flags: -O
32
#![crate_type = "lib"]
43
#![feature(exact_size_is_empty)]

tests/codegen/vec-optimizes-away.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ ignore-debug: the debug assertions get in the way
21
//@ compile-flags: -O
32
#![crate_type = "lib"]
43

tests/codegen/vec-reserve-extend.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug
3-
// (with debug assertions turned on, `assert_unchecked` generates a real assertion)
42

53
#![crate_type = "lib"]
64

tests/codegen/vec-shrink-panik.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ [old]ignore-llvm-version: 17 - 99
55
//@ [new]min-llvm-version: 17
66
//@ compile-flags: -O
7-
//@ ignore-debug: the debug assertions get in the way
7+
//@ ignore-debug: plain old debug assertions
88
//@ needs-unwind
99
#![crate_type = "lib"]
1010
#![feature(shrink_to)]

tests/codegen/vec_pop_push_noop.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug
3-
// (with debug assertions turned on, `assert_unchecked` generates a real assertion)
42

53
#![crate_type = "lib"]
64

tests/codegen/vecdeque-drain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that draining at the front or back doesn't copy memory.
22

33
//@ compile-flags: -O
4-
//@ ignore-debug: the debug assertions get in the way
4+
//@ ignore-debug: FIXME: checks for call detect scoped noalias metadata
55

66
#![crate_type = "lib"]
77

tests/codegen/vecdeque-nonempty-get-no-panic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Guards against regression for optimization discussed in issue #80836
22

33
//@ compile-flags: -O
4-
//@ ignore-debug: the debug assertions get in the way
54

65
#![crate_type = "lib"]
76

tests/codegen/vecdeque_no_panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks that `VecDeque::front[_mut]()` and `VecDeque::back[_mut]()` can't panic.
22

33
//@ compile-flags: -O
4-
//@ ignore-debug: the debug assertions get in the way
4+
//@ ignore-debug: plain old debug assertions
55

66
#![crate_type = "lib"]
77

tests/codegen/virtual-function-elimination.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -Zvirtual-function-elimination -Clto -O -Csymbol-mangling-version=v0
22
//@ ignore-32bit
3-
//@ ignore-debug
43

54
// CHECK: @vtable.0 = {{.*}}, !type ![[TYPE0:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]]
65
// CHECK: @vtable.1 = {{.*}}, !type ![[TYPE1:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]]

tests/mir-opt/pre-codegen/slice_filter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// skip-filecheck
22
//@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
3-
//@ ignore-debug: standard library debug assertions add a panic that breaks this optimization
43

54
#![crate_type = "lib"]
65

tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `variant_a::{closure#0}` after PreCodegen
22

3-
fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:8:25: 8:39}, _2: &&(usize, usize, usize, usize)) -> bool {
3+
fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2: &&(usize, usize, usize, usize)) -> bool {
44
let mut _0: bool;
55
let mut _3: &(usize, usize, usize, usize);
66
let _4: &usize;

0 commit comments

Comments
 (0)