about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-03 04:16:20 +0000
committerbors <bors@rust-lang.org>2025-07-03 04:16:20 +0000
commit6268d0aa34b46981533b09827c1454b8cf27e032 (patch)
tree9e275fd8466532f354e5e3496cc74659f15d82ca /compiler/rustc_middle/src
parent25face9808491588e59b6d7844f2185b09eef479 (diff)
parentbc0262d0f1bf9165e28c01b64fb0dd1a24534968 (diff)
downloadrust-6268d0aa34b46981533b09827c1454b8cf27e032.tar.gz
rust-6268d0aa34b46981533b09827c1454b8cf27e032.zip
Auto merge of #143350 - matthiaskrgr:rollup-zcuvkve, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143192 (Improve CSS for source code block line numbers)
 - rust-lang/rust#143251 (bootstrap: add build.tidy-extra-checks option)
 - rust-lang/rust#143273 (Make the enum check work for negative discriminants)
 - rust-lang/rust#143292 (Explicitly handle all nodes in `generics_of` when computing parent)
 - rust-lang/rust#143316 (Add bootstrap check snapshot tests)
 - rust-lang/rust#143321 (byte-addresses memory -> byte-addressed memory)
 - rust-lang/rust#143324 (interpret: move the native call preparation logic into Miri)
 - rust-lang/rust#143325 (Use non-global interner in `test_string_interning` in bootstrap)
 - rust-lang/rust#143327 (miri: improve errors for type validity assertion failures)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation.rs9
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs2
2 files changed, 2 insertions, 9 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs
index 4198b198ab1..d2cadc96b63 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -799,7 +799,7 @@ impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes>
     /// Initialize all previously uninitialized bytes in the entire allocation, and set
     /// provenance of everything to `Wildcard`. Before calling this, make sure all
     /// provenance in this allocation is exposed!
-    pub fn prepare_for_native_write(&mut self) -> AllocResult {
+    pub fn prepare_for_native_access(&mut self) {
         let full_range = AllocRange { start: Size::ZERO, size: Size::from_bytes(self.len()) };
         // Overwrite uninitialized bytes with 0, to ensure we don't leak whatever their value happens to be.
         for chunk in self.init_mask.range_as_init_chunks(full_range) {
@@ -814,13 +814,6 @@ impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes>
 
         // Set provenance of all bytes to wildcard.
         self.provenance.write_wildcards(self.len());
-
-        // Also expose the provenance of the interpreter-level allocation, so it can
-        // be written by FFI. The `black_box` is defensive programming as LLVM likes
-        // to (incorrectly) optimize away ptr2int casts whose result is unused.
-        std::hint::black_box(self.get_bytes_unchecked_raw_mut().expose_provenance());
-
-        Ok(())
     }
 
     /// Remove all provenance in the given memory range.
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs b/compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs
index c9525df1f79..63608947eb3 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs
@@ -120,7 +120,7 @@ impl<Prov: Provenance> ProvenanceMap<Prov> {
         }
     }
 
-    /// Check if here is ptr-sized provenance at the given index.
+    /// Check if there is ptr-sized provenance at the given index.
     /// Does not mean anything for bytewise provenance! But can be useful as an optimization.
     pub fn get_ptr(&self, offset: Size) -> Option<Prov> {
         self.ptrs.get(&offset).copied()