about summary refs log tree commit diff
path: root/library/std/tests/switch-stdout.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-07 19:42:33 +0000
committerMichael Goulet <michael@errs.io>2025-02-09 17:11:13 +0000
commita4e7f8f9bf10588cb5519ae09a15be155499901f (patch)
tree49525f3454d966963544c40b78793dc74f0702cc /library/std/tests/switch-stdout.rs
parent04bbc8340a0e0031aef7f406c087a0ba64c1b491 (diff)
downloadrust-a4e7f8f9bf10588cb5519ae09a15be155499901f.tar.gz
rust-a4e7f8f9bf10588cb5519ae09a15be155499901f.zip
Mark extern blocks as unsafe
Diffstat (limited to 'library/std/tests/switch-stdout.rs')
-rw-r--r--library/std/tests/switch-stdout.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/tests/switch-stdout.rs b/library/std/tests/switch-stdout.rs
index 42011a9b3da..91fe0200f6c 100644
--- a/library/std/tests/switch-stdout.rs
+++ b/library/std/tests/switch-stdout.rs
@@ -14,7 +14,7 @@ use std::os::windows::io::OwnedHandle;
 fn switch_stdout_to(file: OwnedFd) -> OwnedFd {
     use std::os::unix::prelude::*;
 
-    extern "C" {
+    unsafe extern "C" {
         fn dup(old: i32) -> i32;
         fn dup2(old: i32, new: i32) -> i32;
     }
@@ -32,7 +32,7 @@ fn switch_stdout_to(file: OwnedFd) -> OwnedFd {
 fn switch_stdout_to(file: OwnedHandle) -> OwnedHandle {
     use std::os::windows::prelude::*;
 
-    extern "system" {
+    unsafe extern "system" {
         fn GetStdHandle(nStdHandle: u32) -> *mut u8;
         fn SetStdHandle(nStdHandle: u32, handle: *mut u8) -> i32;
     }