@@ -77,9 +77,7 @@ use std::{
7777 collections:: VecDeque ,
7878} ;
7979
80- use rustc_const_eval:: interpret:: {
81- alloc_range, AllocRange , InterpResult , MPlaceTy , ScalarMaybeUninit ,
82- } ;
80+ use rustc_const_eval:: interpret:: { alloc_range, AllocRange , InterpResult , MPlaceTy , Scalar } ;
8381use rustc_data_structures:: fx:: FxHashMap ;
8482
8583use crate :: * ;
@@ -130,10 +128,10 @@ struct StoreElement {
130128 /// The timestamp of the storing thread when it performed the store
131129 timestamp : VTimestamp ,
132130 /// The value of this store
133- // FIXME: this means the store is either fully initialized or fully uninitialized ;
131+ // FIXME: this means the store must be fully initialized;
134132 // we will have to change this if we want to support atomics on
135- // partially initialized data.
136- val : ScalarMaybeUninit < Provenance > ,
133+ // ( partially) uninitialized data.
134+ val : Scalar < Provenance > ,
137135
138136 /// Timestamp of first loads from this store element by each thread
139137 /// Behind a RefCell to keep load op take &self
@@ -180,7 +178,7 @@ impl StoreBufferAlloc {
180178 fn get_or_create_store_buffer < ' tcx > (
181179 & self ,
182180 range : AllocRange ,
183- init : ScalarMaybeUninit < Provenance > ,
181+ init : Scalar < Provenance > ,
184182 ) -> InterpResult < ' tcx , Ref < ' _ , StoreBuffer > > {
185183 let access_type = self . store_buffers . borrow ( ) . access_type ( range) ;
186184 let pos = match access_type {
@@ -205,7 +203,7 @@ impl StoreBufferAlloc {
205203 fn get_or_create_store_buffer_mut < ' tcx > (
206204 & mut self ,
207205 range : AllocRange ,
208- init : ScalarMaybeUninit < Provenance > ,
206+ init : Scalar < Provenance > ,
209207 ) -> InterpResult < ' tcx , & mut StoreBuffer > {
210208 let buffers = self . store_buffers . get_mut ( ) ;
211209 let access_type = buffers. access_type ( range) ;
@@ -226,7 +224,7 @@ impl StoreBufferAlloc {
226224}
227225
228226impl < ' mir , ' tcx : ' mir > StoreBuffer {
229- fn new ( init : ScalarMaybeUninit < Provenance > ) -> Self {
227+ fn new ( init : Scalar < Provenance > ) -> Self {
230228 let mut buffer = VecDeque :: new ( ) ;
231229 buffer. reserve ( STORE_BUFFER_LIMIT ) ;
232230 let mut ret = Self { buffer } ;
@@ -259,7 +257,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
259257 is_seqcst : bool ,
260258 rng : & mut ( impl rand:: Rng + ?Sized ) ,
261259 validate : impl FnOnce ( ) -> InterpResult < ' tcx > ,
262- ) -> InterpResult < ' tcx , ( ScalarMaybeUninit < Provenance > , LoadRecency ) > {
260+ ) -> InterpResult < ' tcx , ( Scalar < Provenance > , LoadRecency ) > {
263261 // Having a live borrow to store_buffer while calling validate_atomic_load is fine
264262 // because the race detector doesn't touch store_buffer
265263
@@ -284,7 +282,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
284282
285283 fn buffered_write (
286284 & mut self ,
287- val : ScalarMaybeUninit < Provenance > ,
285+ val : Scalar < Provenance > ,
288286 global : & DataRaceState ,
289287 thread_mgr : & ThreadManager < ' _ , ' _ > ,
290288 is_seqcst : bool ,
@@ -375,7 +373,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
375373 /// ATOMIC STORE IMPL in the paper (except we don't need the location's vector clock)
376374 fn store_impl (
377375 & mut self ,
378- val : ScalarMaybeUninit < Provenance > ,
376+ val : Scalar < Provenance > ,
379377 index : VectorIdx ,
380378 thread_clock : & VClock ,
381379 is_seqcst : bool ,
@@ -417,11 +415,7 @@ impl StoreElement {
417415 /// buffer regardless of subsequent loads by the same thread; if the earliest load of another
418416 /// thread doesn't happen before the current one, then no subsequent load by the other thread
419417 /// can happen before the current one.
420- fn load_impl (
421- & self ,
422- index : VectorIdx ,
423- clocks : & ThreadClockSet ,
424- ) -> ScalarMaybeUninit < Provenance > {
418+ fn load_impl ( & self , index : VectorIdx , clocks : & ThreadClockSet ) -> Scalar < Provenance > {
425419 let _ = self . loads . borrow_mut ( ) . try_insert ( index, clocks. clock [ index] ) ;
426420 self . val
427421 }
@@ -464,10 +458,10 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
464458
465459 fn buffered_atomic_rmw (
466460 & mut self ,
467- new_val : ScalarMaybeUninit < Provenance > ,
461+ new_val : Scalar < Provenance > ,
468462 place : & MPlaceTy < ' tcx , Provenance > ,
469463 atomic : AtomicRwOrd ,
470- init : ScalarMaybeUninit < Provenance > ,
464+ init : Scalar < Provenance > ,
471465 ) -> InterpResult < ' tcx > {
472466 let this = self . eval_context_mut ( ) ;
473467 let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
@@ -492,9 +486,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
492486 & self ,
493487 place : & MPlaceTy < ' tcx , Provenance > ,
494488 atomic : AtomicReadOrd ,
495- latest_in_mo : ScalarMaybeUninit < Provenance > ,
489+ latest_in_mo : Scalar < Provenance > ,
496490 validate : impl FnOnce ( ) -> InterpResult < ' tcx > ,
497- ) -> InterpResult < ' tcx , ScalarMaybeUninit < Provenance > > {
491+ ) -> InterpResult < ' tcx , Scalar < Provenance > > {
498492 let this = self . eval_context_ref ( ) ;
499493 if let Some ( global) = & this. machine . data_race {
500494 let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
@@ -529,10 +523,10 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
529523
530524 fn buffered_atomic_write (
531525 & mut self ,
532- val : ScalarMaybeUninit < Provenance > ,
526+ val : Scalar < Provenance > ,
533527 dest : & MPlaceTy < ' tcx , Provenance > ,
534528 atomic : AtomicWriteOrd ,
535- init : ScalarMaybeUninit < Provenance > ,
529+ init : Scalar < Provenance > ,
536530 ) -> InterpResult < ' tcx > {
537531 let this = self . eval_context_mut ( ) ;
538532 let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( dest. ptr ) ?;
@@ -576,7 +570,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
576570 & self ,
577571 place : & MPlaceTy < ' tcx , Provenance > ,
578572 atomic : AtomicReadOrd ,
579- init : ScalarMaybeUninit < Provenance > ,
573+ init : Scalar < Provenance > ,
580574 ) -> InterpResult < ' tcx > {
581575 let this = self . eval_context_ref ( ) ;
582576
0 commit comments