about summary refs log tree commit diff
path: root/compiler/rustc_llvm/build.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-20 18:28:42 +0000
committerMichael Goulet <michael@errs.io>2025-02-22 00:01:48 +0000
commite1819a889a2606b79dc9cc790205da1497d617b7 (patch)
tree9593f04e792f244d00ee52e493ba14208627ca50 /compiler/rustc_llvm/build.rs
parent7f6873f64c17cfa53a10a7751c7213f6ed0215c1 (diff)
downloadrust-e1819a889a2606b79dc9cc790205da1497d617b7.tar.gz
rust-e1819a889a2606b79dc9cc790205da1497d617b7.zip
Fix overcapturing, unsafe extern blocks, and new unsafe ops
Diffstat (limited to 'compiler/rustc_llvm/build.rs')
-rw-r--r--compiler/rustc_llvm/build.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index 48806888b43..3d1f3b2cd4d 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -51,9 +51,13 @@ fn detect_llvm_link() -> (&'static str, &'static str) {
 fn restore_library_path() {
     let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
     if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
-        env::set_var(&key, env);
+        unsafe {
+            env::set_var(&key, env);
+        }
     } else {
-        env::remove_var(&key);
+        unsafe {
+            env::remove_var(&key);
+        }
     }
 }