diff options
| author | Andy Russell <arussell123@gmail.com> | 2023-01-15 13:43:15 -0500 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2023-03-20 13:19:35 -0400 |
| commit | bb7c373fdf6c7c3fb8e204dcc178d870644fcc4b (patch) | |
| tree | 32094fdb49a0bb37a86af2e10f3189c9070cf513 /src/tools | |
| parent | 13b7aa4d7faafbed78d195c27f6868f6bd90c2f8 (diff) | |
| download | rust-bb7c373fdf6c7c3fb8e204dcc178d870644fcc4b.tar.gz rust-bb7c373fdf6c7c3fb8e204dcc178d870644fcc4b.zip | |
migrate compiler, bootstrap, and compiletest to windows-rs
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/Cargo.toml | 8 | ||||
| -rw-r--r-- | src/tools/compiletest/src/read2.rs | 4 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 7 | ||||
| -rw-r--r-- | src/tools/tidy/src/deps.rs | 1 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 0db043a4fca..85fd6523c82 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -26,4 +26,10 @@ libc = "0.2" [target.'cfg(windows)'.dependencies] miow = "0.5" -winapi = { version = "0.3", features = ["winerror"] } + +[target.'cfg(windows)'.dependencies.windows] +version = "0.46.0" +features = [ + "Win32_Foundation", + "Win32_System_Diagnostics_Debug", +] diff --git a/src/tools/compiletest/src/read2.rs b/src/tools/compiletest/src/read2.rs index a5dc6859732..725f7a1515c 100644 --- a/src/tools/compiletest/src/read2.rs +++ b/src/tools/compiletest/src/read2.rs @@ -232,7 +232,7 @@ mod imp { use miow::iocp::{CompletionPort, CompletionStatus}; use miow::pipe::NamedPipe; use miow::Overlapped; - use winapi::shared::winerror::ERROR_BROKEN_PIPE; + use windows::Win32::Foundation::ERROR_BROKEN_PIPE; struct Pipe<'a> { dst: &'a mut Vec<u8>, @@ -295,7 +295,7 @@ mod imp { match self.pipe.read_overlapped(dst, self.overlapped.raw()) { Ok(_) => Ok(()), Err(e) => { - if e.raw_os_error() == Some(ERROR_BROKEN_PIPE as i32) { + if e.raw_os_error() == Some(ERROR_BROKEN_PIPE.0 as i32) { self.done = true; Ok(()) } else { diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 4d9010d3c4b..a4003072310 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -49,8 +49,10 @@ const FAKE_SRC_BASE: &str = "fake-test-src-base"; #[cfg(windows)] fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R { use std::sync::Mutex; - use winapi::um::errhandlingapi::SetErrorMode; - use winapi::um::winbase::SEM_NOGPFAULTERRORBOX; + + use windows::Win32::System::Diagnostics::Debug::{ + SetErrorMode, SEM_NOGPFAULTERRORBOX, THREAD_ERROR_MODE, + }; static LOCK: Mutex<()> = Mutex::new(()); @@ -62,6 +64,7 @@ fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R { // termination by design. This mode is inherited by all child processes. unsafe { let old_mode = SetErrorMode(SEM_NOGPFAULTERRORBOX); // read inherited flags + let old_mode = THREAD_ERROR_MODE(old_mode); SetErrorMode(old_mode | SEM_NOGPFAULTERRORBOX); let r = f(); SetErrorMode(old_mode); diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index d71fa5c8be5..a9eb6c8d03f 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -260,6 +260,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "valuable", "version_check", "wasi", + "windows", "winapi", "winapi-i686-pc-windows-gnu", "winapi-util", |
