Skip to content

Commit 5800bec

Browse files
committed
discourage use of ref_to_mplace
1 parent 3b229f1 commit 5800bec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/place.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ where
277277
{
278278
/// Take a value, which represents a (thin or fat) reference, and make it a place.
279279
/// Alignment is just based on the type. This is the inverse of `MemPlace::to_ref()`.
280+
///
281+
/// Only call this if you are sure the place is "valid" (aligned and inbounds), or do not
282+
/// want to ever use the place for memory access!
283+
/// Generally prefer `deref_operand`.
280284
pub fn ref_to_mplace(
281285
&self,
282286
val: ImmTy<'tcx, M::PointerTag>,

0 commit comments

Comments
 (0)