Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubilee

Add Option::is_none_or

ACP: https://github.com/rust-lang/libs-team/issues/212
This commit is contained in:
Jubilee
2024-06-12 20:03:20 -07:00
committed by GitHub
14 changed files with 41 additions and 11 deletions

View File

@@ -1057,7 +1057,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
ty::Str | ty::Slice(_) | ty::Dynamic(_, _, ty::Dyn) | ty::Foreign(..) => false,
ty::Tuple(tys) => tys.last().iter().all(|ty| is_very_trivially_sized(**ty)),
ty::Tuple(tys) => tys.last().is_none_or(|ty| is_very_trivially_sized(*ty)),
ty::Pat(ty, ..) => is_very_trivially_sized(*ty),