@@ -78,7 +78,7 @@ use std::{
78
78
} ;
79
79
80
80
use rustc_const_eval:: interpret:: {
81
- alloc_range, AllocRange , InterpResult , MPlaceTy , ScalarMaybeUninit ,
81
+ alloc_range, AllocRange , InterpResult , MPlaceTy , Scalar ,
82
82
} ;
83
83
use rustc_data_structures:: fx:: FxHashMap ;
84
84
@@ -130,10 +130,10 @@ struct StoreElement {
130
130
/// The timestamp of the storing thread when it performed the store
131
131
timestamp : VTimestamp ,
132
132
/// The value of this store
133
- // FIXME: this means the store is either fully initialized or fully uninitialized ;
133
+ // FIXME: this means the store must be fully initialized;
134
134
// we will have to change this if we want to support atomics on
135
- // partially initialized data.
136
- val : ScalarMaybeUninit < Provenance > ,
135
+ // ( partially) uninitialized data.
136
+ val : Scalar < Provenance > ,
137
137
138
138
/// Timestamp of first loads from this store element by each thread
139
139
/// Behind a RefCell to keep load op take &self
@@ -180,7 +180,7 @@ impl StoreBufferAlloc {
180
180
fn get_or_create_store_buffer < ' tcx > (
181
181
& self ,
182
182
range : AllocRange ,
183
- init : ScalarMaybeUninit < Provenance > ,
183
+ init : Scalar < Provenance > ,
184
184
) -> InterpResult < ' tcx , Ref < ' _ , StoreBuffer > > {
185
185
let access_type = self . store_buffers . borrow ( ) . access_type ( range) ;
186
186
let pos = match access_type {
@@ -205,7 +205,7 @@ impl StoreBufferAlloc {
205
205
fn get_or_create_store_buffer_mut < ' tcx > (
206
206
& mut self ,
207
207
range : AllocRange ,
208
- init : ScalarMaybeUninit < Provenance > ,
208
+ init : Scalar < Provenance > ,
209
209
) -> InterpResult < ' tcx , & mut StoreBuffer > {
210
210
let buffers = self . store_buffers . get_mut ( ) ;
211
211
let access_type = buffers. access_type ( range) ;
@@ -226,7 +226,7 @@ impl StoreBufferAlloc {
226
226
}
227
227
228
228
impl < ' mir , ' tcx : ' mir > StoreBuffer {
229
- fn new ( init : ScalarMaybeUninit < Provenance > ) -> Self {
229
+ fn new ( init : Scalar < Provenance > ) -> Self {
230
230
let mut buffer = VecDeque :: new ( ) ;
231
231
buffer. reserve ( STORE_BUFFER_LIMIT ) ;
232
232
let mut ret = Self { buffer } ;
@@ -259,7 +259,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
259
259
is_seqcst : bool ,
260
260
rng : & mut ( impl rand:: Rng + ?Sized ) ,
261
261
validate : impl FnOnce ( ) -> InterpResult < ' tcx > ,
262
- ) -> InterpResult < ' tcx , ( ScalarMaybeUninit < Provenance > , LoadRecency ) > {
262
+ ) -> InterpResult < ' tcx , ( Scalar < Provenance > , LoadRecency ) > {
263
263
// Having a live borrow to store_buffer while calling validate_atomic_load is fine
264
264
// because the race detector doesn't touch store_buffer
265
265
@@ -284,7 +284,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
284
284
285
285
fn buffered_write (
286
286
& mut self ,
287
- val : ScalarMaybeUninit < Provenance > ,
287
+ val : Scalar < Provenance > ,
288
288
global : & DataRaceState ,
289
289
thread_mgr : & ThreadManager < ' _ , ' _ > ,
290
290
is_seqcst : bool ,
@@ -375,7 +375,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
375
375
/// ATOMIC STORE IMPL in the paper (except we don't need the location's vector clock)
376
376
fn store_impl (
377
377
& mut self ,
378
- val : ScalarMaybeUninit < Provenance > ,
378
+ val : Scalar < Provenance > ,
379
379
index : VectorIdx ,
380
380
thread_clock : & VClock ,
381
381
is_seqcst : bool ,
@@ -421,7 +421,7 @@ impl StoreElement {
421
421
& self ,
422
422
index : VectorIdx ,
423
423
clocks : & ThreadClockSet ,
424
- ) -> ScalarMaybeUninit < Provenance > {
424
+ ) -> Scalar < Provenance > {
425
425
let _ = self . loads . borrow_mut ( ) . try_insert ( index, clocks. clock [ index] ) ;
426
426
self . val
427
427
}
@@ -464,10 +464,10 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
464
464
465
465
fn buffered_atomic_rmw (
466
466
& mut self ,
467
- new_val : ScalarMaybeUninit < Provenance > ,
467
+ new_val : Scalar < Provenance > ,
468
468
place : & MPlaceTy < ' tcx , Provenance > ,
469
469
atomic : AtomicRwOrd ,
470
- init : ScalarMaybeUninit < Provenance > ,
470
+ init : Scalar < Provenance > ,
471
471
) -> InterpResult < ' tcx > {
472
472
let this = self . eval_context_mut ( ) ;
473
473
let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
@@ -492,9 +492,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
492
492
& self ,
493
493
place : & MPlaceTy < ' tcx , Provenance > ,
494
494
atomic : AtomicReadOrd ,
495
- latest_in_mo : ScalarMaybeUninit < Provenance > ,
495
+ latest_in_mo : Scalar < Provenance > ,
496
496
validate : impl FnOnce ( ) -> InterpResult < ' tcx > ,
497
- ) -> InterpResult < ' tcx , ScalarMaybeUninit < Provenance > > {
497
+ ) -> InterpResult < ' tcx , Scalar < Provenance > > {
498
498
let this = self . eval_context_ref ( ) ;
499
499
if let Some ( global) = & this. machine . data_race {
500
500
let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
@@ -529,10 +529,10 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
529
529
530
530
fn buffered_atomic_write (
531
531
& mut self ,
532
- val : ScalarMaybeUninit < Provenance > ,
532
+ val : Scalar < Provenance > ,
533
533
dest : & MPlaceTy < ' tcx , Provenance > ,
534
534
atomic : AtomicWriteOrd ,
535
- init : ScalarMaybeUninit < Provenance > ,
535
+ init : Scalar < Provenance > ,
536
536
) -> InterpResult < ' tcx > {
537
537
let this = self . eval_context_mut ( ) ;
538
538
let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( dest. ptr ) ?;
@@ -576,7 +576,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
576
576
& self ,
577
577
place : & MPlaceTy < ' tcx , Provenance > ,
578
578
atomic : AtomicReadOrd ,
579
- init : ScalarMaybeUninit < Provenance > ,
579
+ init : Scalar < Provenance > ,
580
580
) -> InterpResult < ' tcx > {
581
581
let this = self . eval_context_ref ( ) ;
582
582
0 commit comments