about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-19 06:59:32 +0000
committerbors <bors@rust-lang.org>2024-02-19 06:59:32 +0000
commit010f029c905ffeb01ad88288b2cf50efe65b23ae (patch)
treecf3e5436c033a6b38daa21eb498b7f53d417936c /compiler/rustc_data_structures/src
parent90fccaad801a929fc482dbbeca0231aa197de7c7 (diff)
parente118c3e8af2ee5c0d20d21e8bf08c1a254a317fb (diff)
downloadrust-010f029c905ffeb01ad88288b2cf50efe65b23ae.tar.gz
rust-010f029c905ffeb01ad88288b2cf50efe65b23ae.zip
Auto merge of #3306 - rust-lang:rustup-2024-02-19, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/flock/windows.rs1
-rw-r--r--compiler/rustc_data_structures/src/owned_slice.rs12
-rw-r--r--compiler/rustc_data_structures/src/profiling.rs6
3 files changed, 8 insertions, 11 deletions
diff --git a/compiler/rustc_data_structures/src/flock/windows.rs b/compiler/rustc_data_structures/src/flock/windows.rs
index da128f464a6..9be1065135a 100644
--- a/compiler/rustc_data_structures/src/flock/windows.rs
+++ b/compiler/rustc_data_structures/src/flock/windows.rs
@@ -69,7 +69,6 @@ impl Lock {
                 &mut overlapped,
             )
         }
-        .ok()
         .map_err(|e| {
             let err = io::Error::from_raw_os_error(e.code().0);
             debug!("failed acquiring file lock: {}", err);
diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs
index cbb3047d884..bb664795860 100644
--- a/compiler/rustc_data_structures/src/owned_slice.rs
+++ b/compiler/rustc_data_structures/src/owned_slice.rs
@@ -4,7 +4,7 @@ use crate::sync::Lrc;
 // Use our fake Send/Sync traits when on not parallel compiler,
 // so that `OwnedSlice` only implements/requires Send/Sync
 // for parallel compiler builds.
-use crate::sync::{Send, Sync};
+use crate::sync;
 
 /// An owned slice.
 ///
@@ -33,7 +33,7 @@ pub struct OwnedSlice {
     //       \/
     //      ⊂(´・◡・⊂ )∘˚˳° (I am the phantom remnant of #97770)
     #[expect(dead_code)]
-    owner: Lrc<dyn Send + Sync>,
+    owner: Lrc<dyn sync::Send + sync::Sync>,
 }
 
 /// Makes an [`OwnedSlice`] out of an `owner` and a `slicer` function.
@@ -60,7 +60,7 @@ pub struct OwnedSlice {
 /// ```
 pub fn slice_owned<O, F>(owner: O, slicer: F) -> OwnedSlice
 where
-    O: Send + Sync + 'static,
+    O: sync::Send + sync::Sync + 'static,
     F: FnOnce(&O) -> &[u8],
 {
     try_slice_owned(owner, |x| Ok::<_, !>(slicer(x))).into_ok()
@@ -71,7 +71,7 @@ where
 /// See [`slice_owned`] for the infallible version.
 pub fn try_slice_owned<O, F, E>(owner: O, slicer: F) -> Result<OwnedSlice, E>
 where
-    O: Send + Sync + 'static,
+    O: sync::Send + sync::Sync + 'static,
     F: FnOnce(&O) -> Result<&[u8], E>,
 {
     // We wrap the owner of the bytes in, so it doesn't move.
@@ -139,11 +139,11 @@ impl Borrow<[u8]> for OwnedSlice {
 
 // Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Send`
 #[cfg(parallel_compiler)]
-unsafe impl Send for OwnedSlice {}
+unsafe impl sync::Send for OwnedSlice {}
 
 // Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Sync`
 #[cfg(parallel_compiler)]
-unsafe impl Sync for OwnedSlice {}
+unsafe impl sync::Sync for OwnedSlice {}
 
 #[cfg(test)]
 mod tests;
diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs
index e29d4811980..2569684df3f 100644
--- a/compiler/rustc_data_structures/src/profiling.rs
+++ b/compiler/rustc_data_structures/src/profiling.rs
@@ -866,16 +866,14 @@ cfg_match! {
             use std::mem;
 
             use windows::{
-                // FIXME: change back to K32GetProcessMemoryInfo when windows crate
-                // updated to 0.49.0+ to drop dependency on psapi.dll
-                Win32::System::ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
+                Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
                 Win32::System::Threading::GetCurrentProcess,
             };
 
             let mut pmc = PROCESS_MEMORY_COUNTERS::default();
             let pmc_size = mem::size_of_val(&pmc);
             unsafe {
-                GetProcessMemoryInfo(
+                K32GetProcessMemoryInfo(
                     GetCurrentProcess(),
                     &mut pmc,
                     pmc_size as u32,