diff --git a/tests/mir-opt/asm_unwind_panic_abort.rs b/tests/mir-opt/asm_unwind_panic_abort.rs index d6830e12287e5..8d607bc72262e 100644 --- a/tests/mir-opt/asm_unwind_panic_abort.rs +++ b/tests/mir-opt/asm_unwind_panic_abort.rs @@ -1,7 +1,6 @@ //! Tests that unwinding from an asm block is caught and forced to abort //! when `-C panic=abort`. -//@ only-x86_64 //@ compile-flags: -C panic=abort //@ no-prefer-dynamic diff --git a/tests/mir-opt/pre-codegen/checked_ops.rs b/tests/mir-opt/pre-codegen/checked_ops.rs index d36502d354784..3ff1123d0b1e5 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.rs +++ b/tests/mir-opt/pre-codegen/checked_ops.rs @@ -1,7 +1,6 @@ // skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 //@ needs-unwind -//@ only-x86_64 #![crate_type = "lib"] #![feature(step_trait)] diff --git a/tests/mir-opt/pre-codegen/intrinsics.rs b/tests/mir-opt/pre-codegen/intrinsics.rs index ed7320cd3c4d5..e5c059cda12e5 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.rs +++ b/tests/mir-opt/pre-codegen/intrinsics.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // Checks that we do not have any branches in the MIR for the two tested functions. diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs index 2d179abc9f31b..d0b8cc8db7a90 100644 --- a/tests/mir-opt/pre-codegen/loops.rs +++ b/tests/mir-opt/pre-codegen/loops.rs @@ -1,7 +1,6 @@ // skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -g //@ needs-unwind -//@ only-64bit #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index 535c1062669a3..9cb3a83995654 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs index fe7d0e67f7a10..5aa617227ce6b 100644 --- a/tests/mir-opt/pre-codegen/range_iter.rs +++ b/tests/mir-opt/pre-codegen/range_iter.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 718dba21a95de..7265a4fc942d8 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -3,9 +3,9 @@ fn ezmap(_1: Option) -> Option { debug x => _1; let mut _0: std::option::Option; - scope 1 (inlined map::) { + scope 1 (inlined map::) { debug slf => _1; - debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:18:12: 18:15}; + debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:17:12: 17:15}; let mut _2: isize; let _3: i32; let mut _4: i32; diff --git a/tests/mir-opt/pre-codegen/simple_option_map.rs b/tests/mir-opt/pre-codegen/simple_option_map.rs index c563f6af2a539..0c432be0419bc 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.rs +++ b/tests/mir-opt/pre-codegen/simple_option_map.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit #[inline(always)] fn map(slf: Option, f: F) -> Option diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index 80bbffbd097d3..1d977ee92148f 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 0269eb39ddf06..0fbd370654485 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/try_identity.rs b/tests/mir-opt/pre-codegen/try_identity.rs index 9da02d65e1598..2e17a3ae6e7e4 100644 --- a/tests/mir-opt/pre-codegen/try_identity.rs +++ b/tests/mir-opt/pre-codegen/try_identity.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings // of that syntax. diff --git a/tests/ui/consts/control-flow/dead_branches_dont_eval.rs b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs new file mode 100644 index 0000000000000..374349732f9ef --- /dev/null +++ b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs @@ -0,0 +1,46 @@ +//@ build-pass + +// issue 122301 - currently the only way to supress +// const eval and codegen of code conditional on some other const + +struct Foo(T); + +impl Foo { + const BAR: () = if N == 0 { + panic!() + }; +} + +struct Invoke(T); + +impl Invoke { + const FUN: fn() = if N != 0 { + || Foo::::BAR + } else { + || {} + }; +} + +// without closures + +struct S(T); +impl S { + const C: () = panic!(); +} + +const fn bar() { S::::C } + +struct ConstIf(T); + +impl ConstIf { + const VAL: () = if N != 0 { + bar::() // not called for N == 0, and hence not monomorphized + } else { + () + }; +} + +fn main() { + let _val = Invoke::<(), 0>::FUN(); + let _val = ConstIf::<(), 0>::VAL; +} diff --git a/triagebot.toml b/triagebot.toml index 515600793da58..0a36eab7b8738 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -726,6 +726,30 @@ cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] [mentions."tests/ui/check-cfg"] cc = ["@Urgau"] +[mentions."compiler/rustc_middle/src/mir/coverage.rs"] +message = "Some changes occurred in coverage instrumentation." +cc = ["@Zalathar"] + +[mentions."compiler/rustc_mir_build/src/build/coverageinfo.rs"] +message = "Some changes occurred in coverage instrumentation." +cc = ["@Zalathar"] + +[mentions."compiler/rustc_mir_transform/src/coverage"] +message = "Some changes occurred in coverage instrumentation." +cc = ["@Zalathar"] + +[mentions."compiler/rustc_codegen_llvm/src/coverageinfo"] +message = "Some changes occurred in coverage instrumentation." +cc = ["@Zalathar"] + +[mentions."compiler/rustc_codegen_ssa/src/mir/coverageinfo.rs"] +message = "Some changes occurred in coverage instrumentation." +cc = ["@Zalathar"] + +[mentions."tests/coverage"] +message = "Some changes occurred in coverage tests." +cc = ["@Zalathar"] + [assign] warn_non_default_branch = true contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"