Skip to content

Commit 1088bcc

Browse files
committed
Misc fixes
1 parent 8290684 commit 1088bcc

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

compiler/rustc_codegen_gcc/src/mono_item.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,6 @@ impl<'gcc, 'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
7676
self.functions.borrow_mut().insert(symbol_name.to_string(), decl);
7777
self.function_instances.borrow_mut().insert(instance, decl);
7878
}
79+
80+
fn weak_alias(&self, _aliasee: Self::Function, _aliasee_name: &str, _name: &str) {}
7981
}

library/alloc/src/alloc.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ unsafe extern "Rust" {
3131
#[rustc_std_internal_symbol]
3232
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
3333

34-
#[rustc_std_internal_symbol]
35-
static __rust_no_alloc_shim_is_unstable: u8;
3634
}
3735

3836
/// The global memory allocator.
@@ -85,13 +83,7 @@ pub struct Global;
8583
#[inline]
8684
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
8785
pub unsafe fn alloc(layout: Layout) -> *mut u8 {
88-
unsafe {
89-
// Make sure we don't accidentally allow omitting the allocator shim in
90-
// stable code until it is actually stabilized.
91-
core::ptr::read_volatile(&__rust_no_alloc_shim_is_unstable);
92-
93-
__rust_alloc(layout.size(), layout.align())
94-
}
86+
unsafe { __rust_alloc(layout.size(), layout.align()) }
9587
}
9688

9789
/// Deallocates memory with the global allocator.
@@ -168,13 +160,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
168160
#[inline]
169161
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
170162
pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 {
171-
unsafe {
172-
// Make sure we don't accidentally allow omitting the allocator shim in
173-
// stable code until it is actually stabilized.
174-
core::ptr::read_volatile(&__rust_no_alloc_shim_is_unstable);
175-
176-
__rust_alloc_zeroed(layout.size(), layout.align())
177-
}
163+
unsafe { __rust_alloc_zeroed(layout.size(), layout.align()) }
178164
}
179165

180166
impl Global {

0 commit comments

Comments
 (0)