Rollup merge of #119971 - compiler-errors:zip-eq, r=nnethercote
Use `zip_eq` to enforce that things being zipped have equal sizes Some `zip`s are best enforced to be equal, since size mismatches suggest deeper bugs in the compiler.
This commit is contained in:
commit
b6f68a7fca
11 changed files with 35 additions and 11 deletions
|
@ -1052,6 +1052,8 @@ fn variant_info_for_coroutine<'tcx>(
|
|||
def_id: DefId,
|
||||
args: ty::GenericArgsRef<'tcx>,
|
||||
) -> (Vec<VariantInfo>, Option<Size>) {
|
||||
use itertools::Itertools;
|
||||
|
||||
let Variants::Multiple { tag, ref tag_encoding, tag_field, .. } = layout.variants else {
|
||||
return (vec![], None);
|
||||
};
|
||||
|
@ -1064,7 +1066,7 @@ fn variant_info_for_coroutine<'tcx>(
|
|||
.as_coroutine()
|
||||
.upvar_tys()
|
||||
.iter()
|
||||
.zip(upvar_names)
|
||||
.zip_eq(upvar_names)
|
||||
.enumerate()
|
||||
.map(|(field_idx, (_, name))| {
|
||||
let field_layout = layout.field(cx, field_idx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue