rustc_const_eval: adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:47:43 +01:00
parent b8c56fa8c3
commit 5cc292eb1d
13 changed files with 86 additions and 123 deletions

View file

@ -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 {