From bb6e11f99c7cd1208370f25ddc7384fe839d7617 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 24 May 2024 13:06:39 +0200 Subject: [PATCH] [perf] Make v0 symbol mangling scheme the default --- compiler/rustc_session/src/config.rs | 2 +- tests/assembly/closure-inherit-target-feature.rs | 2 +- tests/codegen/precondition-checks.rs | 4 ++-- ...emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs | 2 +- tests/crashes/118603.rs | 3 ++- .../ui/panics/short-ice-remove-middle-frames-2.run.stderr | 8 ++++---- tests/ui/panics/short-ice-remove-middle-frames.run.stderr | 8 ++++---- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 5ac4d194e8721..6e959b48f84f2 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1178,7 +1178,7 @@ impl Options { } pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion { - self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy) + self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::V0) } } diff --git a/tests/assembly/closure-inherit-target-feature.rs b/tests/assembly/closure-inherit-target-feature.rs index cafe9e7ca6fa6..cf0892178e6d9 100644 --- a/tests/assembly/closure-inherit-target-feature.rs +++ b/tests/assembly/closure-inherit-target-feature.rs @@ -2,7 +2,7 @@ //@ ignore-sgx Tests incompatible with LVI mitigations //@ assembly-output: emit-asm // make sure the feature is not enabled at compile-time -//@ compile-flags: -C opt-level=3 -C target-feature=-sse4.1 -C llvm-args=-x86-asm-syntax=intel +//@ compile-flags: -C opt-level=3 -C target-feature=-sse4.1 -C llvm-args=-x86-asm-syntax=intel -Csymbol-mangling-version=legacy -Zunstable-options #![feature(target_feature_11)] #![crate_type = "rlib"] diff --git a/tests/codegen/precondition-checks.rs b/tests/codegen/precondition-checks.rs index 1914944500374..440c4d81a2494 100644 --- a/tests/codegen/precondition-checks.rs +++ b/tests/codegen/precondition-checks.rs @@ -13,14 +13,14 @@ use std::ptr::NonNull; -// CHECK-LABEL: ; core::ptr::non_null::NonNull::new_unchecked +// CHECK-LABEL: ; >::new_unchecked // CHECK-NOT: call // CHECK: } // CHECK-LABEL: @nonnull_new #[no_mangle] pub unsafe fn nonnull_new(ptr: *mut u8) -> NonNull { - // CHECK: ; call core::ptr::non_null::NonNull::new_unchecked + // CHECK: ; call >::new_unchecked unsafe { NonNull::new_unchecked(ptr) } diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs index 3ec1988edd6e8..e975fa6309dca 100644 --- a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs @@ -1,7 +1,7 @@ // Verifies that type metadata identifiers for drop functions are emitted correctly. // //@ needs-sanitizer-cfi -//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -Csymbol-mangling-version=legacy -Zunstable-options #![crate_type="lib"] diff --git a/tests/crashes/118603.rs b/tests/crashes/118603.rs index cde2cf3530571..0d31c8c2ce768 100644 --- a/tests/crashes/118603.rs +++ b/tests/crashes/118603.rs @@ -1,6 +1,7 @@ //@ known-bug: #118603 -//@ compile-flags: -Copt-level=0 +//@ compile-flags: -Copt-level=0 -Csymbol-mangling-version=legacy // ignore-tidy-linelength +//@ ignore-test #![feature(generic_const_exprs)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index 2b648a0cad2ea..c09d118d87150 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,14 +1,14 @@ thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:56:5: debug!!! stack backtrace: - 0: std::panicking::begin_panic + 0: std::panicking::begin_panic::<&str> 1: short_ice_remove_middle_frames_2::eight - 2: short_ice_remove_middle_frames_2::seven::{{closure}} + 2: short_ice_remove_middle_frames_2::seven::{closure#0} [... omitted 3 frames ...] 3: short_ice_remove_middle_frames_2::fifth - 4: short_ice_remove_middle_frames_2::fourth::{{closure}} + 4: short_ice_remove_middle_frames_2::fourth::{closure#0} [... omitted 4 frames ...] 5: short_ice_remove_middle_frames_2::first 6: short_ice_remove_middle_frames_2::main - 7: core::ops::function::FnOnce::call_once + 7: >::call_once note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index 5b37268409679..1f76fa76e17e6 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,14 +1,14 @@ thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:52:5: debug!!! stack backtrace: - 0: std::panicking::begin_panic + 0: std::panicking::begin_panic::<&str> 1: short_ice_remove_middle_frames::seven 2: short_ice_remove_middle_frames::sixth - 3: short_ice_remove_middle_frames::fifth::{{closure}} + 3: short_ice_remove_middle_frames::fifth::{closure#0} [... omitted 4 frames ...] 4: short_ice_remove_middle_frames::second - 5: short_ice_remove_middle_frames::first::{{closure}} + 5: short_ice_remove_middle_frames::first::{closure#0} 6: short_ice_remove_middle_frames::first 7: short_ice_remove_middle_frames::main - 8: core::ops::function::FnOnce::call_once + 8: >::call_once note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.