Skip to content

sess: default to v0 symbol mangling #89917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/codegen-llvm/array-from_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#[no_mangle]
pub fn iota() -> [u8; 16] {
// OPT-NOT: core..array..Guard
// NORMAL: core..array..Guard
// OPT-NOT: core::array::Guard
// NORMAL: core::array::Guard
std::array::from_fn(|i| i as _)
}
6 changes: 3 additions & 3 deletions tests/codegen-llvm/no-alloca-inside-if-false.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#[inline(never)]
fn test<const SIZE: usize>() {
// CHECK-LABEL: no_alloca_inside_if_false::test
// CHECK-LABEL: no_alloca_inside_if_false::test::<8192>
// CHECK: start:
// CHECK-NEXT: alloca [{{12|24}} x i8]
// CHECK-NOT: alloca
// CHECK-NEXT: = alloca [{{12|24}} x i8]
// CHECK-NOT: = alloca
if const { SIZE < 4096 } {
let arr = [0u8; SIZE];
std::hint::black_box(&arr);
Expand Down
4 changes: 2 additions & 2 deletions tests/codegen-llvm/precondition-checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

use std::ptr::NonNull;

// CHECK-LABEL: ; core::ptr::non_null::NonNull<T>::new_unchecked
// CHECK-LABEL: ; <core::ptr::non_null::NonNull<u8>>::new_unchecked
// CHECK-NOT: call
// CHECK: }

// CHECK-LABEL: @nonnull_new
#[no_mangle]
pub unsafe fn nonnull_new(ptr: *mut u8) -> NonNull<u8> {
// CHECK: ; call core::ptr::non_null::NonNull<T>::new_unchecked
// CHECK: ; call <core::ptr::non_null::NonNull<u8>>::new_unchecked
unsafe { NonNull::new_unchecked(ptr) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#![crate_type = "lib"]

// CHECK-LABEL: define{{.*}}4core3ptr47drop_in_place$LT$dyn$u20$core..marker..Send$GT$
// CHECK-LABEL: define{{.*}}4core3ptr13drop_in_placeDNtNtB4_6marker4Send
// CHECK-SAME: {{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
// CHECK: call i1 @llvm.type.test(ptr {{%.+}}, metadata !"_ZTSFvPu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops4drop4Dropu6regionEE")

Expand All @@ -20,7 +20,7 @@ struct PresentDrop;

impl Drop for PresentDrop {
fn drop(&mut self) {}
// CHECK: define{{.*}}4core3ptr{{[0-9]+}}drop_in_place$LT${{.*}}PresentDrop$GT${{.*}}!type ![[TYPE1]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
// CHECK: define{{.*}}4core3ptr{{[0-9]+}}drop_in_place{{.*}}PresentDrop{{.*}}!type ![[TYPE1]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
}

pub fn foo() {
Expand Down
4 changes: 2 additions & 2 deletions tests/codegen-llvm/sanitizer/kcfi/naked-function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl MyTrait for Thing {}
// the shim calls the real function
// CHECK-LABEL: define
// CHECK-SAME: my_naked_function
// CHECK-SAME: reify.shim.fnptr
// CHECK-SAME: reify_fnptr

// CHECK-LABEL: main
#[unsafe(no_mangle)]
Expand All @@ -39,7 +39,7 @@ pub fn main() {
// main calls the shim function
// CHECK: call void
// CHECK-SAME: my_naked_function
// CHECK-SAME: reify.shim.fnptr
// CHECK-SAME: reify_fnptr
(F)();
}

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ debug!!!
stack backtrace:
0: std::panicking::begin_panic
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: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
6 changes: 3 additions & 3 deletions tests/ui/panics/short-ice-remove-middle-frames.run.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ stack backtrace:
0: std::panicking::begin_panic
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: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Loading