diff options
| author | carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> | 2022-05-19 13:51:53 -0500 |
|---|---|---|
| committer | carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> | 2022-05-19 13:51:53 -0500 |
| commit | e24673502fbf4ae00b42362eed2cf915ba352325 (patch) | |
| tree | d997227511c53a11c6c56a6dda23872082608a2c /compiler/rustc_const_eval/src/interpret | |
| parent | 10d9ecda48f828e174d7a863fc43a155ad086efd (diff) | |
| download | rust-e24673502fbf4ae00b42362eed2cf915ba352325.tar.gz rust-e24673502fbf4ae00b42362eed2cf915ba352325.zip | |
Remove unneeded asserts
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/cast.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 6 |
2 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 92eeafc5df0..7cd2ba34b04 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -225,9 +225,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let addr = u64::try_from(size.truncate(v)).unwrap(); let ptr = M::ptr_from_addr_cast(&self, addr); - if addr == 0 { - assert!(ptr.provenance.is_none(), "null pointer can never have an AllocId"); - } Scalar::from_maybe_pointer(ptr, self) } diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 33162a01ed2..5dba5e2d45e 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -1144,11 +1144,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { Err(ptr) => ptr.into(), Ok(bits) => { let addr = u64::try_from(bits).unwrap(); - let ptr = M::ptr_from_addr_transmute(&self, addr); - if addr == 0 { - assert!(ptr.provenance.is_none(), "null pointer can never have an AllocId"); - } - ptr + M::ptr_from_addr_transmute(&self, addr) } }, ) |
