]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/const-ptr/out_of_bounds_read.stderr
tweak pointer out-of-bounds error message
[rust.git] / src / test / ui / const-ptr / out_of_bounds_read.stderr
index e6e9f483c2b3cedd0300ccebddccf003d79f06de..92541779213a4e33e90286785f2ac7e490358626 100644 (file)
@@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
-   |              memory access failed: pointer must be in-bounds for 4 bytes at offset 4, but alloc7 has size 4
+   |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
    | 
   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -23,7 +23,7 @@ error[E0080]: evaluation of constant value failed
 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
-   |              memory access failed: pointer must be in-bounds for 4 bytes at offset 4, but alloc7 has size 4
+   |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
    | 
   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -47,7 +47,7 @@ error[E0080]: evaluation of constant value failed
 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
-   |              memory access failed: pointer must be in-bounds for 4 bytes at offset 4, but alloc7 has size 4
+   |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
    | 
   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL