]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-ptr/out_of_bounds_read.stderr
92541779213a4e33e90286785f2ac7e490358626
[rust.git] / src / test / ui / const-ptr / out_of_bounds_read.stderr
1 error[E0080]: evaluation of constant value failed
2   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
3    |
4 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
5    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |              |
7    |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
8    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
9    | 
10   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
11    |
12 LL |         copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
13    |         --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
14    | 
15   ::: $DIR/out_of_bounds_read.rs:13:33
16    |
17 LL |     const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
18    |                                 ----------------------- inside `_READ` at $DIR/out_of_bounds_read.rs:13:33
19
20 error[E0080]: evaluation of constant value failed
21   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
22    |
23 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
24    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25    |              |
26    |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
27    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
28    | 
29   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
30    |
31 LL |         copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
32    |         --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
33    | 
34   ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
35    |
36 LL |         unsafe { read(self) }
37    |                  ---------- inside `ptr::const_ptr::<impl *const u32>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
38    | 
39   ::: $DIR/out_of_bounds_read.rs:14:39
40    |
41 LL |     const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
42    |                                       ------------------- inside `_CONST_READ` at $DIR/out_of_bounds_read.rs:14:39
43
44 error[E0080]: evaluation of constant value failed
45   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
46    |
47 LL |     unsafe { copy_nonoverlapping(src, dst, count) }
48    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49    |              |
50    |              memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
51    |              inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
52    | 
53   ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
54    |
55 LL |         copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
56    |         --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
57    | 
58   ::: $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
59    |
60 LL |         unsafe { read(self) }
61    |                  ---------- inside `ptr::mut_ptr::<impl *mut u32>::read` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
62    | 
63   ::: $DIR/out_of_bounds_read.rs:15:37
64    |
65 LL |     const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() };
66    |                                     --------------------------------- inside `_MUT_READ` at $DIR/out_of_bounds_read.rs:15:37
67
68 error: aborting due to 3 previous errors
69
70 For more information about this error, try `rustc --explain E0080`.