use List<Ty<'tcx>>
for tuples
This commit is contained in:
parent
a9c1ab82f5
commit
1245131a11
53 changed files with 128 additions and 170 deletions
|
@ -565,7 +565,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
|
|||
// FIXME(chalk): actually get hidden ty
|
||||
self.interner
|
||||
.tcx
|
||||
.mk_ty(ty::Tuple(self.interner.tcx.intern_substs(&[])))
|
||||
.mk_ty(ty::Tuple(self.interner.tcx.intern_type_list(&[])))
|
||||
.lower_into(self.interner)
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,9 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
|
|||
ty::Generator(_def_id, _substs, _) => unimplemented!(),
|
||||
ty::GeneratorWitness(_) => unimplemented!(),
|
||||
ty::Never => chalk_ir::TyKind::Never,
|
||||
ty::Tuple(substs) => chalk_ir::TyKind::Tuple(substs.len(), substs.lower_into(interner)),
|
||||
ty::Tuple(types) => {
|
||||
chalk_ir::TyKind::Tuple(types.len(), types.as_substs().lower_into(interner))
|
||||
}
|
||||
ty::Projection(proj) => chalk_ir::TyKind::Alias(proj.lower_into(interner)),
|
||||
ty::Opaque(def_id, substs) => {
|
||||
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
|
||||
|
@ -398,7 +400,9 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty<RustInterner<'tcx>> {
|
|||
TyKind::Generator(..) => unimplemented!(),
|
||||
TyKind::GeneratorWitness(..) => unimplemented!(),
|
||||
TyKind::Never => ty::Never,
|
||||
TyKind::Tuple(_len, substitution) => ty::Tuple(substitution.lower_into(interner)),
|
||||
TyKind::Tuple(_len, substitution) => {
|
||||
ty::Tuple(substitution.lower_into(interner).try_as_type_list().unwrap())
|
||||
}
|
||||
TyKind::Slice(ty) => ty::Slice(ty.lower_into(interner)),
|
||||
TyKind::Raw(mutbl, ty) => ty::RawPtr(ty::TypeAndMut {
|
||||
ty: ty.lower_into(interner),
|
||||
|
|
|
@ -198,14 +198,7 @@ fn dtorck_constraint_for_ty<'tcx>(
|
|||
|
||||
ty::Tuple(tys) => rustc_data_structures::stack::ensure_sufficient_stack(|| {
|
||||
for ty in tys.iter() {
|
||||
dtorck_constraint_for_ty(
|
||||
tcx,
|
||||
span,
|
||||
for_ty,
|
||||
depth + 1,
|
||||
ty.expect_ty(),
|
||||
constraints,
|
||||
)?;
|
||||
dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty, constraints)?;
|
||||
}
|
||||
Ok::<_, NoSolution>(())
|
||||
})?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue