Skip to content

Commit 1dbc2dc

Browse files
authored
Rollup merge of rust-lang#84903 - hyd-dev:dead-check-in-alloc-msg, r=RalfJung
Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest` Removing it per rust-lang#84842 (comment): it's a dead enum variant. Note that `PointerArithmeticTest` also seems dead: ``` $ rg -F PointerArithmeticTest -C5 compiler/rustc_middle/src/mir/interpret/error.rs 169- 170-/// Details of why a pointer had to be in-bounds. 171-#[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)] 172-pub enum CheckInAllocMsg { 173- MemoryAccessTest, 174: PointerArithmeticTest, 175- InboundsTest, 176-} 177- 178-impl fmt::Display for CheckInAllocMsg { 179- /// When this is printed as an error the context looks like this -- 182- write!( 183- f, 184- "{}", 185- match *self { 186- CheckInAllocMsg::MemoryAccessTest => "memory access", 187: CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic", 188- CheckInAllocMsg::InboundsTest => "inbounds test", 189- } 190- ) 191- } 192-} ``` Not sure if that is also desirable to be removed, however.
2 parents 20ae5ce + ee7a6c6 commit 1dbc2dc

File tree

1 file changed

+0
-5
lines changed
  • compiler/rustc_middle/src/mir/interpret

1 file changed

+0
-5
lines changed

compiler/rustc_middle/src/mir/interpret/error.rs

-5
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ impl fmt::Display for InvalidProgramInfo<'_> {
171171
#[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)]
172172
pub enum CheckInAllocMsg {
173173
MemoryAccessTest,
174-
NullPointerTest,
175174
PointerArithmeticTest,
176175
InboundsTest,
177176
}
@@ -185,7 +184,6 @@ impl fmt::Display for CheckInAllocMsg {
185184
"{}",
186185
match *self {
187186
CheckInAllocMsg::MemoryAccessTest => "memory access",
188-
CheckInAllocMsg::NullPointerTest => "null pointer test",
189187
CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic",
190188
CheckInAllocMsg::InboundsTest => "inbounds test",
191189
}
@@ -308,9 +306,6 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> {
308306
ptr.alloc_id,
309307
allocation_size.bytes()
310308
),
311-
DanglingIntPointer(_, CheckInAllocMsg::NullPointerTest) => {
312-
write!(f, "null pointer is not allowed for this operation")
313-
}
314309
DanglingIntPointer(i, msg) => {
315310
write!(f, "{} failed: 0x{:x} is not a valid pointer", msg, i)
316311
}

0 commit comments

Comments
 (0)