]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/mir/interpret/error.rs
more precise message for the ptr access check on deref
[rust.git] / compiler / rustc_middle / src / mir / interpret / error.rs
index 29caf01af1f5b14bf421501d09b9ded64c81a76a..02a32b9fc6ad3b2f3a16b4453bcf1f0ad6c21701 100644 (file)
@@ -170,6 +170,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 /// Details of why a pointer had to be in-bounds.
 #[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)]
 pub enum CheckInAllocMsg {
+    /// We are dereferencing a pointer (i.e., creating a place).
+    DerefTest,
     /// We are access memory.
     MemoryAccessTest,
     /// We are doing pointer arithmetic.
@@ -186,6 +188,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             f,
             "{}",
             match *self {
+                CheckInAllocMsg::DerefTest => "dereferencing pointer failed: ",
                 CheckInAllocMsg::MemoryAccessTest => "memory access failed: ",
                 CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic failed: ",
                 CheckInAllocMsg::InboundsTest => "",