about summary refs log tree commit diff
path: root/compiler/rustc_llvm/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-08-26 19:40:43 -0400
committerMichael Goulet <michael@errs.io>2024-08-26 19:51:05 -0400
commit38e62b98418c22d3a00f5af689ae538e4216fb5f (patch)
tree5a4847b102fd5334889d9faa4cb464aa4f3681dc /compiler/rustc_llvm/src
parent515395af0efdbdd657ff08a1f6d28e553856654f (diff)
downloadrust-38e62b98418c22d3a00f5af689ae538e4216fb5f.tar.gz
rust-38e62b98418c22d3a00f5af689ae538e4216fb5f.zip
Use unsafe extern blocks throughout the compiler
Diffstat (limited to 'compiler/rustc_llvm/src')
-rw-r--r--compiler/rustc_llvm/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs
index 939e5e4dbd4..96e370c5b26 100644
--- a/compiler/rustc_llvm/src/lib.rs
+++ b/compiler/rustc_llvm/src/lib.rs
@@ -1,5 +1,6 @@
 // tidy-alphabetical-start
 #![allow(internal_features)]
+#![cfg_attr(bootstrap, feature(unsafe_attributes, unsafe_extern_blocks))]
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![doc(rust_logo)]
 #![feature(rustdoc_internals)]
@@ -28,7 +29,7 @@ impl RustString {
 }
 
 /// Appending to a Rust string -- used by RawRustStringOstream.
-#[no_mangle]
+#[unsafe(no_mangle)]
 pub unsafe extern "C" fn LLVMRustStringWriteImpl(
     sr: &RustString,
     ptr: *const c_char,
@@ -46,7 +47,7 @@ pub fn initialize_available_targets() {
         ($cfg:meta, $($method:ident),*) => { {
             #[cfg($cfg)]
             fn init() {
-                extern "C" {
+                unsafe extern "C" {
                     $(fn $method();)*
                 }
                 unsafe {