Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2606815

Browse files
committedMar 23, 2024
Auto merge of rust-lang#122953 - matthiaskrgr:rollup-rioxw1r, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#122379 (transmute: caution against int2ptr transmutation) - rust-lang#122895 (add some ice tests 5xxxx to 9xxxx) - rust-lang#122907 (Uniquify `ReError` on input mode in canonicalizer) - rust-lang#122942 (Add test in higher ranked subtype) - rust-lang#122943 (add a couple more ice tests) - rust-lang#122952 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 020bbe4 + 70b2185 commit 2606815

File tree

65 files changed

+1296
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1296
-130
lines changed
 

‎src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use crate::borrow_tracker::{
1818
stacked_borrows::diagnostics::{AllocHistory, DiagnosticCx, DiagnosticCxBuilder},
1919
GlobalStateInner, ProtectorKind,
2020
};
21+
use crate::concurrency::data_race::{NaReadType, NaWriteType};
2122
use crate::*;
2223

2324
use diagnostics::{RetagCause, RetagInfo};
@@ -751,7 +752,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
751752
assert_eq!(access, AccessKind::Write);
752753
// Make sure the data race model also knows about this.
753754
if let Some(data_race) = alloc_extra.data_race.as_mut() {
754-
data_race.write(alloc_id, range, machine)?;
755+
data_race.write(
756+
alloc_id,
757+
range,
758+
NaWriteType::Retag,
759+
Some(place.layout.ty),
760+
machine,
761+
)?;
755762
}
756763
}
757764
}
@@ -794,7 +801,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
794801
assert_eq!(access, AccessKind::Read);
795802
// Make sure the data race model also knows about this.
796803
if let Some(data_race) = alloc_extra.data_race.as_ref() {
797-
data_race.read(alloc_id, range, &this.machine)?;
804+
data_race.read(
805+
alloc_id,
806+
range,
807+
NaReadType::Retag,
808+
Some(place.layout.ty),
809+
&this.machine,
810+
)?;
798811
}
799812
}
800813
Ok(())

‎src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ use rustc_middle::{
99
use rustc_span::def_id::DefId;
1010
use rustc_target::abi::{Abi, Size};
1111

12-
use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
1312
use crate::*;
13+
use crate::{
14+
borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind},
15+
concurrency::data_race::NaReadType,
16+
};
1417

1518
pub mod diagnostics;
1619
mod perms;
@@ -312,7 +315,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
312315
// Also inform the data race model (but only if any bytes are actually affected).
313316
if range.size.bytes() > 0 {
314317
if let Some(data_race) = alloc_extra.data_race.as_ref() {
315-
data_race.read(alloc_id, range, &this.machine)?;
318+
data_race.read(
319+
alloc_id,
320+
range,
321+
NaReadType::Retag,
322+
Some(place.layout.ty),
323+
&this.machine,
324+
)?;
316325
}
317326
}
318327

There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.