]> git.lizzy.rs Git - rust.git/commitdiff
discourage use of ref_to_mplace
authorRalf Jung <post@ralfj.de>
Sun, 28 Jul 2019 10:10:29 +0000 (12:10 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 28 Jul 2019 10:10:29 +0000 (12:10 +0200)
src/librustc_mir/interpret/place.rs

index e90fc28a521b6032067f8d89ed07c7cd8b9292e8..d0670f64ed8da4faabc815e4bb66680c07284670 100644 (file)
@@ -277,6 +277,10 @@ impl<'mir, 'tcx, Tag, M> InterpCx<'mir, 'tcx, M>
 {
     /// Take a value, which represents a (thin or fat) reference, and make it a place.
     /// Alignment is just based on the type.  This is the inverse of `MemPlace::to_ref()`.
+    ///
+    /// Only call this if you are sure the place is "valid" (aligned and inbounds), or do not
+    /// want to ever use the place for memory access!
+    /// Generally prefer `deref_operand`.
     pub fn ref_to_mplace(
         &self,
         val: ImmTy<'tcx, M::PointerTag>,