@@ -405,12 +405,12 @@ impl<'tcx> Stacks {
405
405
406
406
407
407
pub trait EvalContextExt < ' tcx > {
408
- fn tag_dereference (
408
+ fn ptr_dereference (
409
409
& self ,
410
410
place : MPlaceTy < ' tcx , Borrow > ,
411
411
size : Size ,
412
412
mutability : Option < Mutability > ,
413
- ) -> EvalResult < ' tcx , Borrow > ;
413
+ ) -> EvalResult < ' tcx > ;
414
414
415
415
fn tag_new_allocation (
416
416
& mut self ,
@@ -480,13 +480,13 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
480
480
///
481
481
/// Note that this does NOT mean that all this memory will actually get accessed/referenced!
482
482
/// We could be in the middle of `&(*var).1`.
483
- fn tag_dereference (
483
+ fn ptr_dereference (
484
484
& self ,
485
485
place : MPlaceTy < ' tcx , Borrow > ,
486
486
size : Size ,
487
487
mutability : Option < Mutability > ,
488
- ) -> EvalResult < ' tcx , Borrow > {
489
- trace ! ( "tag_dereference : Accessing {} reference for {:?} (pointee {})" ,
488
+ ) -> EvalResult < ' tcx > {
489
+ trace ! ( "ptr_dereference : Accessing {} reference for {:?} (pointee {})" ,
490
490
if let Some ( mutability) = mutability { format!( "{:?}" , mutability) } else { format!( "raw" ) } ,
491
491
place. ptr, place. layout. ty) ;
492
492
let ptr = place. ptr . to_ptr ( ) ?;
@@ -497,12 +497,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
497
497
// That can transmute a raw ptr to a (shared/mut) ref, and a mut ref to a shared one.
498
498
match ( mutability, ptr. tag ) {
499
499
( None , _) => {
500
- // Don't use the tag, this is a raw access! They should happen tagless.
501
- // This is needed for `*mut` to make any sense: Writes *do* enforce the
502
- // `Uniq` tag to be up top, but we must make sure raw writes do not do that.
503
- // This does mean, however, that `&*foo` is *not* a NOP *if* `foo` is a raw ptr.
504
- // Also don't do any further validation, this is raw after all.
505
- return Ok ( Borrow :: default ( ) ) ;
500
+ // No further validation on raw accesses.
501
+ return Ok ( ( ) ) ;
506
502
}
507
503
( Some ( MutMutable ) , Borrow :: Uniq ( _) ) |
508
504
( Some ( MutImmutable ) , Borrow :: Shr ( _) ) => {
@@ -543,8 +539,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
543
539
alloc. extra . deref ( ptr, size, kind) ?;
544
540
}
545
541
546
- // All is good, and do not change the tag
547
- Ok ( ptr . tag )
542
+ // All is good
543
+ Ok ( ( ) )
548
544
}
549
545
550
546
/// The given place may henceforth be accessed through raw pointers.
0 commit comments