diff options
| author | Ralf Jung <post@ralfj.de> | 2021-05-05 17:52:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-05 17:52:28 +0200 |
| commit | 2c7bf41b97e1b2a4ad475dd8fb197ce7f0c5c805 (patch) | |
| tree | 356e48f6a839ca7a70fddcf94cd08a82625bfc35 | |
| parent | 2cb9c6c2b453a1affbe56a7caaa7a00f8169d8a9 (diff) | |
| parent | ee7a6c6acc01560895796f2d5206f38955e3768c (diff) | |
| download | rust-2c7bf41b97e1b2a4ad475dd8fb197ce7f0c5c805.tar.gz rust-2c7bf41b97e1b2a4ad475dd8fb197ce7f0c5c805.zip | |
Rollup merge of #84903 - hyd-dev:dead-check-in-alloc-msg, r=RalfJung
Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`
Removing it per https://github.com/rust-lang/rust/pull/84842#discussion_r625589674: 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.
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index d4970a4f532..e452463fbf5 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -171,7 +171,6 @@ impl fmt::Display for InvalidProgramInfo<'_> { #[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)] pub enum CheckInAllocMsg { MemoryAccessTest, - NullPointerTest, PointerArithmeticTest, InboundsTest, } @@ -185,7 +184,6 @@ impl fmt::Display for CheckInAllocMsg { "{}", match *self { CheckInAllocMsg::MemoryAccessTest => "memory access", - CheckInAllocMsg::NullPointerTest => "null pointer test", CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic", CheckInAllocMsg::InboundsTest => "inbounds test", } @@ -308,9 +306,6 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> { ptr.alloc_id, allocation_size.bytes() ), - DanglingIntPointer(_, CheckInAllocMsg::NullPointerTest) => { - write!(f, "null pointer is not allowed for this operation") - } DanglingIntPointer(i, msg) => { write!(f, "{} failed: 0x{:x} is not a valid pointer", msg, i) } |
