]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/offset_ub.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / consts / offset_ub.stderr
CommitLineData
f9f354fc 1error: any use of this value will cause an error
3dfed10e 2 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 3 |
f035d41b
XL
4LL | unsafe { intrinsics::offset(self, count) }
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | |
7 | overflowing in-bounds pointer arithmetic
1b1a35ee 8 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 9 | inside `BEFORE_START` at $DIR/offset_ub.rs:7:46
f9f354fc
XL
10 |
11 ::: $DIR/offset_ub.rs:7:1
12 |
13LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
14 | ------------------------------------------------------------------------------
15 |
16 = note: `#[deny(const_err)]` on by default
17
18error: any use of this value will cause an error
3dfed10e 19 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 20 |
f035d41b
XL
21LL | unsafe { intrinsics::offset(self, count) }
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 | |
24 | inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
1b1a35ee 25 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 26 | inside `AFTER_END` at $DIR/offset_ub.rs:8:43
f9f354fc
XL
27 |
28 ::: $DIR/offset_ub.rs:8:1
29 |
30LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
31 | --------------------------------------------------------------------------
32
33error: any use of this value will cause an error
3dfed10e 34 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 35 |
f035d41b
XL
36LL | unsafe { intrinsics::offset(self, count) }
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 | |
39 | inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
1b1a35ee 40 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 41 | inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45
f9f354fc
XL
42 |
43 ::: $DIR/offset_ub.rs:9:1
44 |
45LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
46 | ------------------------------------------------------------------------------
47
48error: any use of this value will cause an error
3dfed10e 49 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 50 |
f035d41b
XL
51LL | unsafe { intrinsics::offset(self, count) }
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 | |
54 | overflowing in-bounds pointer arithmetic
1b1a35ee 55 | inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 56 | inside `OVERFLOW` at $DIR/offset_ub.rs:11:43
f9f354fc
XL
57 |
58 ::: $DIR/offset_ub.rs:11:1
59 |
60LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
61 | ----------------------------------------------------------------------------------
62
63error: any use of this value will cause an error
3dfed10e 64 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 65 |
f035d41b
XL
66LL | unsafe { intrinsics::offset(self, count) }
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68 | |
69 | overflowing in-bounds pointer arithmetic
1b1a35ee 70 | inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 71 | inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44
f9f354fc
XL
72 |
73 ::: $DIR/offset_ub.rs:12:1
74 |
75LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
76 | -----------------------------------------------------------------------------------
77
78error: any use of this value will cause an error
3dfed10e 79 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 80 |
f035d41b
XL
81LL | unsafe { intrinsics::offset(self, count) }
82 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 | |
84 | overflowing in-bounds pointer arithmetic
1b1a35ee 85 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 86 | inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56
f9f354fc
XL
87 |
88 ::: $DIR/offset_ub.rs:13:1
89 |
90LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
91 | ---------------------------------------------------------------------------------------------
92
93error: any use of this value will cause an error
3dfed10e 94 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 95 |
f035d41b
XL
96LL | unsafe { intrinsics::offset(self, count) }
97 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98 | |
99 | overflowing in-bounds pointer arithmetic
1b1a35ee 100 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 101 | inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57
f9f354fc
XL
102 |
103 ::: $DIR/offset_ub.rs:14:1
104 |
105LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
106 | --------------------------------------------------------------------------------------
107
108error: any use of this value will cause an error
3dfed10e 109 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 110 |
f035d41b
XL
111LL | unsafe { intrinsics::offset(self, count) }
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 | |
114 | inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
1b1a35ee 115 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 116 | inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50
f9f354fc
XL
117 |
118 ::: $DIR/offset_ub.rs:16:1
119 |
120LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
121 | -------------------------------------------------------------------------------
122
123error: any use of this value will cause an error
3dfed10e 124 --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
f9f354fc 125 |
f035d41b
XL
126LL | unsafe { intrinsics::offset(self, count) as *mut T }
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128 | |
129 | unable to turn bytes into a pointer
1b1a35ee 130 | inside `ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
f035d41b 131 | inside `DANGLING` at $DIR/offset_ub.rs:17:42
f9f354fc
XL
132 |
133 ::: $DIR/offset_ub.rs:17:1
134 |
135LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
136 | ---------------------------------------------------------------------------------------------
137
138error: any use of this value will cause an error
3dfed10e 139 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 140 |
f035d41b
XL
141LL | unsafe { intrinsics::offset(self, count) }
142 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143 | |
144 | inbounds test failed: 0x0 is not a valid pointer
1b1a35ee 145 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 146 | inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50
f9f354fc
XL
147 |
148 ::: $DIR/offset_ub.rs:20:1
149 |
150LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) };
151 | -------------------------------------------------------------------------------
152
153error: any use of this value will cause an error
3dfed10e 154 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f9f354fc 155 |
f035d41b
XL
156LL | unsafe { intrinsics::offset(self, count) }
157 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158 | |
159 | unable to turn bytes into a pointer
1b1a35ee 160 | inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
f035d41b 161 | inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
f9f354fc
XL
162 |
163 ::: $DIR/offset_ub.rs:23:1
164 |
165LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
166 | ---------------------------------------------------------------------------------------------
167
168error: aborting due to 11 previous errors
169