@@ -417,31 +417,31 @@ where
417417 self . ptr_with_meta_to_mplace ( ptr, MemPlaceMeta :: None , layout, /*unaligned*/ true )
418418 }
419419
420- /// Take a value, which represents a (thin or wide) reference , and make it a place.
421- /// Alignment is just based on the type. This is the inverse of `mplace_to_ref ()`.
420+ /// Take a value, which represents a (thin or wide) pointer , and make it a place.
421+ /// Alignment is just based on the type. This is the inverse of `mplace_to_imm_ptr ()`.
422422 ///
423423 /// Only call this if you are sure the place is "valid" (aligned and inbounds), or do not
424424 /// want to ever use the place for memory access!
425425 /// Generally prefer `deref_pointer`.
426- pub fn ref_to_mplace (
426+ pub fn imm_ptr_to_mplace (
427427 & self ,
428428 val : & ImmTy < ' tcx , M :: Provenance > ,
429429 ) -> InterpResult < ' tcx , MPlaceTy < ' tcx , M :: Provenance > > {
430430 let pointee_type =
431- val. layout . ty . builtin_deref ( true ) . expect ( "`ref_to_mplace ` called on non-ptr type" ) ;
431+ val. layout . ty . builtin_deref ( true ) . expect ( "`imm_ptr_to_mplace ` called on non-ptr type" ) ;
432432 let layout = self . layout_of ( pointee_type) ?;
433433 let ( ptr, meta) = val. to_scalar_and_meta ( ) ;
434434
435- // `ref_to_mplace ` is called on raw pointers even if they don't actually get dereferenced;
435+ // `imm_ptr_to_mplace ` is called on raw pointers even if they don't actually get dereferenced;
436436 // we hence can't call `size_and_align_of` since that asserts more validity than we want.
437437 let ptr = ptr. to_pointer ( self ) ?;
438438 interp_ok ( self . ptr_with_meta_to_mplace ( ptr, meta, layout, /*unaligned*/ false ) )
439439 }
440440
441441 /// Turn a mplace into a (thin or wide) mutable raw pointer, pointing to the same space.
442442 /// `align` information is lost!
443- /// This is the inverse of `ref_to_mplace `.
444- pub fn mplace_to_ref (
443+ /// This is the inverse of `imm_ptr_to_mplace `.
444+ pub fn mplace_to_imm_ptr (
445445 & self ,
446446 mplace : & MPlaceTy < ' tcx , M :: Provenance > ,
447447 ) -> InterpResult < ' tcx , ImmTy < ' tcx , M :: Provenance > > {
@@ -467,7 +467,7 @@ where
467467 let val = self . read_immediate ( src) ?;
468468 trace ! ( "deref to {} on {:?}" , val. layout. ty, * val) ;
469469
470- let mplace = self . ref_to_mplace ( & val) ?;
470+ let mplace = self . imm_ptr_to_mplace ( & val) ?;
471471 interp_ok ( mplace)
472472 }
473473
0 commit comments