Skip to content

Commit a22139f

Browse files
committed
Remove implicit #[no_mangle] for #[rustc_std_internal_symbol]
1 parent fa6de17 commit a22139f

File tree

17 files changed

+93
-47
lines changed

17 files changed

+93
-47
lines changed

compiler/rustc_codegen_cranelift/src/allocator.rs

+23-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ use rustc_ast::expand::allocator::{
77
};
88
use rustc_codegen_ssa::base::allocator_kind_for_codegen;
99
use rustc_session::config::OomStrategy;
10+
use rustc_symbol_mangling::mangle_internal_symbol;
1011

1112
use crate::prelude::*;
1213

1314
/// Returns whether an allocator shim was created
1415
pub(crate) fn codegen(tcx: TyCtxt<'_>, module: &mut dyn Module) -> bool {
1516
let Some(kind) = allocator_kind_for_codegen(tcx) else { return false };
1617
codegen_inner(
18+
tcx,
1719
module,
1820
kind,
1921
tcx.alloc_error_handler_kind(()).unwrap(),
@@ -23,6 +25,7 @@ pub(crate) fn codegen(tcx: TyCtxt<'_>, module: &mut dyn Module) -> bool {
2325
}
2426

2527
fn codegen_inner(
28+
tcx: TyCtxt<'_>,
2629
module: &mut dyn Module,
2730
kind: AllocatorKind,
2831
alloc_error_handler_kind: AllocatorKind,
@@ -62,8 +65,8 @@ fn codegen_inner(
6265
crate::common::create_wrapper_function(
6366
module,
6467
sig,
65-
&global_fn_name(method.name),
66-
&default_fn_name(method.name),
68+
&mangle_internal_symbol(tcx, &global_fn_name(method.name)),
69+
&mangle_internal_symbol(tcx, &default_fn_name(method.name)),
6770
);
6871
}
6972
}
@@ -76,19 +79,32 @@ fn codegen_inner(
7679
crate::common::create_wrapper_function(
7780
module,
7881
sig,
79-
"__rust_alloc_error_handler",
80-
&alloc_error_handler_name(alloc_error_handler_kind),
82+
&mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
83+
&mangle_internal_symbol(tcx, alloc_error_handler_name(alloc_error_handler_kind)),
8184
);
8285

83-
let data_id = module.declare_data(OomStrategy::SYMBOL, Linkage::Export, false, false).unwrap();
86+
let data_id = module
87+
.declare_data(
88+
&mangle_internal_symbol(tcx, OomStrategy::SYMBOL),
89+
Linkage::Export,
90+
false,
91+
false,
92+
)
93+
.unwrap();
8494
let mut data = DataDescription::new();
8595
data.set_align(1);
8696
let val = oom_strategy.should_panic();
8797
data.define(Box::new([val]));
8898
module.define_data(data_id, &data).unwrap();
8999

90-
let data_id =
91-
module.declare_data(NO_ALLOC_SHIM_IS_UNSTABLE, Linkage::Export, false, false).unwrap();
100+
let data_id = module
101+
.declare_data(
102+
&mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
103+
Linkage::Export,
104+
false,
105+
false,
106+
)
107+
.unwrap();
92108
let mut data = DataDescription::new();
93109
data.set_align(1);
94110
data.define(Box::new([0]));

compiler/rustc_codegen_cranelift/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern crate rustc_index;
2626
extern crate rustc_metadata;
2727
extern crate rustc_session;
2828
extern crate rustc_span;
29+
extern crate rustc_symbol_mangling;
2930
extern crate rustc_target;
3031
#[macro_use]
3132
extern crate tracing;

compiler/rustc_codegen_gcc/src/allocator.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_ast::expand::allocator::{
88
use rustc_middle::bug;
99
use rustc_middle::ty::TyCtxt;
1010
use rustc_session::config::OomStrategy;
11+
use rustc_symbol_mangling::mangle_internal_symbol;
1112

1213
use crate::GccContext;
1314
#[cfg(feature = "master")]
@@ -53,8 +54,8 @@ pub(crate) unsafe fn codegen(
5354
panic!("invalid allocator output")
5455
}
5556
};
56-
let from_name = global_fn_name(method.name);
57-
let to_name = default_fn_name(method.name);
57+
let from_name = mangle_internal_symbol(tcx, &global_fn_name(method.name));
58+
let to_name = mangle_internal_symbol(tcx, &default_fn_name(method.name));
5859

5960
create_wrapper_function(tcx, context, &from_name, &to_name, &types, output);
6061
}
@@ -64,13 +65,13 @@ pub(crate) unsafe fn codegen(
6465
create_wrapper_function(
6566
tcx,
6667
context,
67-
"__rust_alloc_error_handler",
68-
alloc_error_handler_name(alloc_error_handler_kind),
68+
&mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
69+
&mangle_internal_symbol(tcx, alloc_error_handler_name(alloc_error_handler_kind)),
6970
&[usize, usize],
7071
None,
7172
);
7273

73-
let name = OomStrategy::SYMBOL.to_string();
74+
let name = mangle_internal_symbol(tcx, OomStrategy::SYMBOL);
7475
let global = context.new_global(None, GlobalKind::Exported, i8, name);
7576
#[cfg(feature = "master")]
7677
global.add_attribute(VarAttribute::Visibility(symbol_visibility_to_gcc(
@@ -80,7 +81,7 @@ pub(crate) unsafe fn codegen(
8081
let value = context.new_rvalue_from_int(i8, value as i32);
8182
global.global_set_initializer_rvalue(value);
8283

83-
let name = NO_ALLOC_SHIM_IS_UNSTABLE.to_string();
84+
let name = mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE);
8485
let global = context.new_global(None, GlobalKind::Exported, i8, name);
8586
#[cfg(feature = "master")]
8687
global.add_attribute(VarAttribute::Visibility(symbol_visibility_to_gcc(

compiler/rustc_codegen_gcc/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ extern crate rustc_metadata;
5252
extern crate rustc_middle;
5353
extern crate rustc_session;
5454
extern crate rustc_span;
55+
extern crate rustc_symbol_mangling;
5556
extern crate rustc_target;
5657

5758
// This prevents duplicating functions and statics that are already part of the host rustc process.

compiler/rustc_codegen_llvm/src/allocator.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use rustc_ast::expand::allocator::{
66
use rustc_middle::bug;
77
use rustc_middle::ty::TyCtxt;
88
use rustc_session::config::{DebugInfo, OomStrategy};
9+
use rustc_symbol_mangling::mangle_internal_symbol;
910

1011
use crate::common::AsCCharPtr;
1112
use crate::llvm::{self, Context, False, Module, True, Type};
@@ -55,8 +56,8 @@ pub(crate) unsafe fn codegen(
5556
}
5657
};
5758

58-
let from_name = global_fn_name(method.name);
59-
let to_name = default_fn_name(method.name);
59+
let from_name = mangle_internal_symbol(tcx, &global_fn_name(method.name));
60+
let to_name = mangle_internal_symbol(tcx, &default_fn_name(method.name));
6061

6162
create_wrapper_function(tcx, llcx, llmod, &from_name, &to_name, &args, output, false);
6263
}
@@ -67,23 +68,23 @@ pub(crate) unsafe fn codegen(
6768
tcx,
6869
llcx,
6970
llmod,
70-
"__rust_alloc_error_handler",
71-
alloc_error_handler_name(alloc_error_handler_kind),
71+
&mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
72+
&mangle_internal_symbol(tcx, alloc_error_handler_name(alloc_error_handler_kind)),
7273
&[usize, usize], // size, align
7374
None,
7475
true,
7576
);
7677

7778
unsafe {
7879
// __rust_alloc_error_handler_should_panic
79-
let name = OomStrategy::SYMBOL;
80+
let name = mangle_internal_symbol(tcx, OomStrategy::SYMBOL);
8081
let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_c_char_ptr(), name.len(), i8);
8182
llvm::set_visibility(ll_g, llvm::Visibility::from_generic(tcx.sess.default_visibility()));
8283
let val = tcx.sess.opts.unstable_opts.oom.should_panic();
8384
let llval = llvm::LLVMConstInt(i8, val as u64, False);
8485
llvm::set_initializer(ll_g, llval);
8586

86-
let name = NO_ALLOC_SHIM_IS_UNSTABLE;
87+
let name = mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE);
8788
let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_c_char_ptr(), name.len(), i8);
8889
llvm::set_visibility(ll_g, llvm::Visibility::from_generic(tcx.sess.default_visibility()));
8990
let llval = llvm::LLVMConstInt(i8, 0, False);

compiler/rustc_codegen_llvm/src/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use rustc_session::config::{
2727
};
2828
use rustc_span::source_map::Spanned;
2929
use rustc_span::{DUMMY_SP, Span};
30+
use rustc_symbol_mangling::mangle_internal_symbol;
3031
use rustc_target::spec::{HasTargetSpec, RelocModel, SmallDataThresholdSupport, Target, TlsModel};
3132
use smallvec::SmallVec;
3233

@@ -1181,7 +1182,7 @@ impl<'ll> CodegenCx<'ll, '_> {
11811182
Some(def_id) => self.get_static(def_id),
11821183
_ => {
11831184
let ty = self.type_struct(&[self.type_ptr(), self.type_ptr()], false);
1184-
self.declare_global("rust_eh_catch_typeinfo", ty)
1185+
self.declare_global(&mangle_internal_symbol(self.tcx, "rust_eh_catch_typeinfo"), ty)
11851186
}
11861187
};
11871188
self.eh_catch_typeinfo.set(Some(eh_catch_typeinfo));

compiler/rustc_codegen_llvm/src/intrinsic.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
1414
use rustc_middle::ty::{self, GenericArgsRef, Ty};
1515
use rustc_middle::{bug, span_bug};
1616
use rustc_span::{Span, Symbol, sym};
17+
use rustc_symbol_mangling::mangle_internal_symbol;
1718
use rustc_target::callconv::{FnAbi, PassMode};
1819
use rustc_target::spec::{HasTargetSpec, PanicStrategy};
1920
use tracing::debug;
@@ -818,7 +819,10 @@ fn codegen_msvc_try<'ll>(
818819
let type_name = bx.const_bytes(b"rust_panic\0");
819820
let type_info =
820821
bx.const_struct(&[type_info_vtable, bx.const_null(bx.type_ptr()), type_name], false);
821-
let tydesc = bx.declare_global("__rust_panic_type_info", bx.val_ty(type_info));
822+
let tydesc = bx.declare_global(
823+
&mangle_internal_symbol(bx.tcx, "__rust_panic_type_info"),
824+
bx.val_ty(type_info),
825+
);
822826

823827
llvm::set_linkage(tydesc, llvm::Linkage::LinkOnceODRLinkage);
824828
if bx.cx.tcx.sess.target.supports_comdat() {

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::hash_map::Entry::*;
22

3-
use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE};
3+
use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE, global_fn_name};
44
use rustc_data_structures::unord::UnordMap;
55
use rustc_hir::def::DefKind;
66
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE, LocalDefId};
@@ -13,6 +13,7 @@ use rustc_middle::query::LocalCrate;
1313
use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, Instance, SymbolName, Ty, TyCtxt};
1414
use rustc_middle::util::Providers;
1515
use rustc_session::config::{CrateType, OomStrategy};
16+
use rustc_symbol_mangling::mangle_internal_symbol;
1617
use rustc_target::callconv::Conv;
1718
use rustc_target::spec::{SanitizerSet, TlsModel};
1819
use tracing::debug;
@@ -219,8 +220,11 @@ fn exported_symbols_provider_local(
219220
if allocator_kind_for_codegen(tcx).is_some() {
220221
for symbol_name in ALLOCATOR_METHODS
221222
.iter()
222-
.map(|method| format!("__rust_{}", method.name))
223-
.chain(["__rust_alloc_error_handler".to_string(), OomStrategy::SYMBOL.to_string()])
223+
.map(|method| mangle_internal_symbol(tcx, global_fn_name(method.name).as_str()))
224+
.chain([
225+
mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
226+
mangle_internal_symbol(tcx, OomStrategy::SYMBOL),
227+
])
224228
{
225229
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name));
226230

@@ -234,8 +238,10 @@ fn exported_symbols_provider_local(
234238
));
235239
}
236240

237-
let exported_symbol =
238-
ExportedSymbol::NoDefId(SymbolName::new(tcx, NO_ALLOC_SHIM_IS_UNSTABLE));
241+
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(
242+
tcx,
243+
&mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
244+
));
239245
symbols.push((
240246
exported_symbol,
241247
SymbolExportInfo {

compiler/rustc_codegen_ssa/src/base.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
2626
use rustc_session::Session;
2727
use rustc_session::config::{self, CrateType, EntryFnType, OptLevel, OutputType};
2828
use rustc_span::{DUMMY_SP, Symbol, sym};
29+
use rustc_symbol_mangling::mangle_internal_symbol;
2930
use rustc_trait_selection::infer::{BoundRegionConversionTime, TyCtxtInferExt};
3031
use rustc_trait_selection::traits::{ObligationCause, ObligationCtxt};
3132
use tracing::{debug, info};
@@ -993,7 +994,12 @@ impl CrateInfo {
993994
.for_each(|(_, linked_symbols)| {
994995
let mut symbols = missing_weak_lang_items
995996
.iter()
996-
.map(|item| (format!("{prefix}{item}"), SymbolExportKind::Text))
997+
.map(|item| {
998+
(
999+
format!("{prefix}{}", mangle_internal_symbol(tcx, item.as_str())),
1000+
SymbolExportKind::Text,
1001+
)
1002+
})
9971003
.collect::<Vec<_>>();
9981004
symbols.sort_unstable_by(|a, b| a.0.cmp(&b.0));
9991005
linked_symbols.extend(symbols);
@@ -1006,7 +1012,13 @@ impl CrateInfo {
10061012
// errors.
10071013
linked_symbols.extend(ALLOCATOR_METHODS.iter().map(|method| {
10081014
(
1009-
format!("{prefix}{}", global_fn_name(method.name).as_str()),
1015+
format!(
1016+
"{prefix}{}",
1017+
mangle_internal_symbol(
1018+
tcx,
1019+
global_fn_name(method.name).as_str()
1020+
)
1021+
),
10101022
SymbolExportKind::Text,
10111023
)
10121024
}));

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -670,25 +670,19 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
670670
// strippable by the linker.
671671
//
672672
// Additionally weak lang items have predetermined symbol names.
673-
if WEAK_LANG_ITEMS.iter().any(|&l| tcx.lang_items().get(l) == Some(did.to_def_id())) {
674-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL;
675-
}
676673
if let Some((name, _)) = lang_items::extract(attrs)
677674
&& let Some(lang_item) = LangItem::from_name(name)
678-
&& let Some(link_name) = lang_item.link_name()
679675
{
680-
codegen_fn_attrs.export_name = Some(link_name);
681-
codegen_fn_attrs.link_name = Some(link_name);
676+
if WEAK_LANG_ITEMS.iter().any(|&l| l == lang_item) {
677+
codegen_fn_attrs.flags |= CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL;
678+
}
679+
if let Some(link_name) = lang_item.link_name() {
680+
codegen_fn_attrs.export_name = Some(link_name);
681+
codegen_fn_attrs.link_name = Some(link_name);
682+
}
682683
}
683684
check_link_name_xor_ordinal(tcx, &codegen_fn_attrs, link_ordinal_span);
684685

685-
// Internal symbols to the standard library all have no_mangle semantics in
686-
// that they have defined symbol names present in the function name. This
687-
// also applies to weak symbols where they all have known symbol names.
688-
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) {
689-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE;
690-
}
691-
692686
// Any linkage to LLVM intrinsics for now forcibly marks them all as never
693687
// unwinds since LLVM sometimes can't handle codegen which `invoke`s
694688
// intrinsic functions.

compiler/rustc_symbol_mangling/src/v0.rs

+9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ pub(super) fn mangle<'tcx>(
7474
}
7575

7676
pub fn mangle_internal_symbol<'tcx>(tcx: TyCtxt<'tcx>, item_name: &str) -> String {
77+
if item_name == "rust_eh_personality" {
78+
// rust_eh_personality must not be renamed as LLVM hard-codes the name
79+
return "rust_eh_personality".to_owned();
80+
} else if item_name == "__rust_no_alloc_shim_is_unstable" {
81+
// Temporary back compat hack to give people the chance to migrate to
82+
// include #[rustc_std_internal_symbol].
83+
return "__rust_no_alloc_shim_is_unstable".to_owned();
84+
}
85+
7786
let prefix = "_R";
7887
let mut cx: SymbolMangler<'_> = SymbolMangler {
7988
tcx,

tests/codegen/alloc-optimisation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pub fn alloc_test(data: u32) {
66
// CHECK-LABEL: @alloc_test
77
// CHECK-NEXT: start:
8-
// CHECK-NEXT: {{.*}} load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1
8+
// CHECK-NEXT: {{.*}} load volatile i8, ptr @{{.*}}__rust_no_alloc_shim_is_unstable, align 1
99
// CHECK-NEXT: ret void
1010
let x = Box::new(data);
1111
drop(x);

tests/codegen/box-uninit-bytes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ pub fn box_lotsa_padding() -> Box<LotsaPadding> {
4141

4242
// Hide the `allocalign` attribute in the declaration of __rust_alloc
4343
// from the CHECK-NOT above, and also verify the attributes got set reasonably.
44-
// CHECK: declare {{(dso_local )?}}noalias noundef ptr @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
44+
// CHECK: declare {{(dso_local )?}}noalias noundef ptr @{{.*}}__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
4545

4646
// CHECK-DAG: attributes [[RUST_ALLOC_ATTRS]] = { {{.*}} allockind("alloc,uninitialized,aligned") allocsize(0) {{(uwtable )?}}"alloc-family"="__rust_alloc" {{.*}} }

tests/codegen/dealloc-no-unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Drop for A {
1818
#[no_mangle]
1919
pub fn a(a: Box<i32>) {
2020
// CHECK-LABEL: define{{.*}}void @a
21-
// CHECK: call void @__rust_dealloc
21+
// CHECK: call void @{{.*}}__rust_dealloc
2222
// CHECK-NEXT: call void @foo
2323
let _a = A;
2424
drop(a);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn iter_repeat_n_next(it: &mut std::iter::RepeatN<NotCopy>) -> Option<NotCop
4747
#[no_mangle]
4848
// CHECK-LABEL: @vec_extend_via_iter_repeat_n
4949
pub fn vec_extend_via_iter_repeat_n() -> Vec<u8> {
50-
// CHECK: %[[ADDR:.+]] = tail call {{(noalias )?}}noundef dereferenceable_or_null(1234) ptr @__rust_alloc(i64 noundef {{(range\(i64 1, 0\) )?}}1234, i64 noundef {{(range\(i64 1, -9223372036854775807\) )?}}1)
50+
// CHECK: %[[ADDR:.+]] = tail call {{(noalias )?}}noundef dereferenceable_or_null(1234) ptr @{{.*}}__rust_alloc(i64 noundef {{(range\(i64 1, 0\) )?}}1234, i64 noundef {{(range\(i64 1, -9223372036854775807\) )?}}1)
5151
// CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR]], i8 42, i64 1234,
5252

5353
let n = 1234_usize;

tests/codegen/vec-calloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,6 @@ pub fn vec_option_i32(n: usize) -> Vec<Option<i32>> {
177177
}
178178

179179
// Ensure that __rust_alloc_zeroed gets the right attributes for LLVM to optimize it away.
180-
// CHECK: declare noalias noundef ptr @__rust_alloc_zeroed(i64 noundef, i64 allocalign noundef) unnamed_addr [[RUST_ALLOC_ZEROED_ATTRS:#[0-9]+]]
180+
// CHECK: declare noalias noundef ptr @{{.*}}__rust_alloc_zeroed(i64 noundef, i64 allocalign noundef) unnamed_addr [[RUST_ALLOC_ZEROED_ATTRS:#[0-9]+]]
181181

182182
// CHECK-DAG: attributes [[RUST_ALLOC_ZEROED_ATTRS]] = { {{.*}} allockind("alloc,zeroed,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" {{.*}} }

tests/codegen/vec-optimizes-away.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pub fn sum_me() -> i32 {
66
// CHECK-LABEL: @sum_me
77
// CHECK-NEXT: {{^.*:$}}
8-
// CHECK-NEXT: {{.*}} load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1
8+
// CHECK-NEXT: {{.*}} load volatile i8, ptr @{{.*}}__rust_no_alloc_shim_is_unstable, align 1
99
// CHECK-NEXT: ret i32 6
1010
vec![1, 2, 3].iter().sum::<i32>()
1111
}

0 commit comments

Comments
 (0)