Skip to content

Commit 0ed0fce

Browse files
committed
fix fallout
1 parent c004f8c commit 0ed0fce

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

compiler/rustc_middle/src/ty/walk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>)
178178
| ty::FnDef(_, substs) => {
179179
stack.extend(substs.iter().rev());
180180
}
181-
ty::Tuple(ts) => stack.extend(ts.as_substs().iter().rev()),
181+
ty::Tuple(ts) => stack.extend(ts.iter().map(|ty| ty.into()).rev()),
182182
ty::GeneratorWitness(ts) => {
183183
stack.extend(ts.skip_binder().iter().rev().map(|ty| ty.into()));
184184
}

compiler/rustc_traits/src/chalk/lowering.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,13 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
329329
),
330330
ty::GeneratorWitness(_) => unimplemented!(),
331331
ty::Never => chalk_ir::TyKind::Never,
332-
ty::Tuple(types) => {
333-
chalk_ir::TyKind::Tuple(types.len(), types.as_substs().lower_into(interner))
334-
}
332+
ty::Tuple(types) => chalk_ir::TyKind::Tuple(
333+
types.len(),
334+
chalk_ir::Substitution::from_iter(
335+
interner,
336+
types.iter().map(|ty| ty::subst::GenericArg::from(ty).lower_into(interner)),
337+
),
338+
),
335339
ty::Projection(proj) => chalk_ir::TyKind::Alias(proj.lower_into(interner)),
336340
ty::Opaque(def_id, substs) => {
337341
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
@@ -403,9 +407,9 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty<RustInterner<'tcx>> {
403407
TyKind::Generator(..) => unimplemented!(),
404408
TyKind::GeneratorWitness(..) => unimplemented!(),
405409
TyKind::Never => ty::Never,
406-
TyKind::Tuple(_len, substitution) => {
407-
ty::Tuple(substitution.lower_into(interner).try_as_type_list().unwrap())
408-
}
410+
TyKind::Tuple(_len, substitution) => ty::Tuple(interner.tcx.mk_type_list(
411+
substitution.iter(interner).map(|subst| subst.lower_into(interner).expect_ty()),
412+
)),
409413
TyKind::Slice(ty) => ty::Slice(ty.lower_into(interner)),
410414
TyKind::Raw(mutbl, ty) => ty::RawPtr(ty::TypeAndMut {
411415
ty: ty.lower_into(interner),

0 commit comments

Comments
 (0)