Rollup merge of #94143 - est31:let_else_const_eval, r=lcnr
rustc_const_eval: adopt let else in more places Continuation of #89933, #91018, #91481, #93046, #93590, #94011. I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This PR handles rustc_const_eval.
This commit is contained in:
@@ -851,12 +851,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
|
||||
// to reject those pointers, we just do not have the machinery to
|
||||
// talk about parts of a pointer.
|
||||
// We also accept uninit, for consistency with the slow path.
|
||||
let alloc = match self.ecx.memory.get(mplace.ptr, size, mplace.align)? {
|
||||
Some(a) => a,
|
||||
None => {
|
||||
// Size 0, nothing more to check.
|
||||
return Ok(());
|
||||
}
|
||||
let Some(alloc) = self.ecx.memory.get(mplace.ptr, size, mplace.align)? else {
|
||||
// Size 0, nothing more to check.
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let allow_uninit_and_ptr = !M::enforce_number_validity(self.ecx);
|
||||
|
||||
Reference in New Issue
Block a user