rustc_const_eval: adopt let else in more places
This commit is contained in:
parent
b8c56fa8c3
commit
5cc292eb1d
13 changed files with 86 additions and 123 deletions
|
@ -258,15 +258,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
let alloc = match self.get_alloc(mplace)? {
|
||||
Some(ptr) => ptr,
|
||||
None => {
|
||||
return Ok(Some(ImmTy {
|
||||
// zero-sized type
|
||||
imm: Scalar::ZST.into(),
|
||||
layout: mplace.layout,
|
||||
}));
|
||||
}
|
||||
let Some(alloc) = self.get_alloc(mplace)? else {
|
||||
return Ok(Some(ImmTy {
|
||||
// zero-sized type
|
||||
imm: Scalar::ZST.into(),
|
||||
layout: mplace.layout,
|
||||
}));
|
||||
};
|
||||
|
||||
match mplace.layout.abi {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue