squash OpaqueTy and ProjectionTy into AliasTy
This commit is contained in:
parent
5c6afb850c
commit
c13bd83528
66 changed files with 182 additions and 197 deletions
|
@ -1146,7 +1146,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
|
||||
debug!(?substs_trait_ref_and_assoc_item);
|
||||
|
||||
ty::ProjectionTy { def_id: assoc_item.def_id, substs: substs_trait_ref_and_assoc_item }
|
||||
ty::AliasTy { def_id: assoc_item.def_id, substs: substs_trait_ref_and_assoc_item }
|
||||
});
|
||||
|
||||
if !speculative {
|
||||
|
|
|
@ -1440,7 +1440,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> E
|
|||
impl<'tcx> ty::visit::TypeVisitor<'tcx> for OpaqueTypeCollector {
|
||||
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
match *t.kind() {
|
||||
ty::Opaque(ty::OpaqueTy { def_id: def, substs: _ }) => {
|
||||
ty::Opaque(ty::AliasTy { def_id: def, substs: _ }) => {
|
||||
self.0.push(def);
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
|
|
|
@ -1746,7 +1746,7 @@ pub fn check_type_bounds<'tcx>(
|
|||
_ => predicates.push(
|
||||
ty::Binder::bind_with_vars(
|
||||
ty::ProjectionPredicate {
|
||||
projection_ty: ty::ProjectionTy {
|
||||
projection_ty: ty::AliasTy {
|
||||
def_id: trait_ty.def_id,
|
||||
substs: rebased_substs,
|
||||
},
|
||||
|
|
|
@ -253,7 +253,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
|
|||
self.add_constraints_from_invariant_substs(current, data.substs, variance);
|
||||
}
|
||||
|
||||
ty::Opaque(ty::OpaqueTy { def_id: _, substs }) => {
|
||||
ty::Opaque(ty::AliasTy { def_id: _, substs }) => {
|
||||
self.add_constraints_from_invariant_substs(current, substs, variance);
|
||||
}
|
||||
|
||||
|
|
|
@ -110,9 +110,9 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
|
|||
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
// FIXME(alias): merge these
|
||||
match t.kind() {
|
||||
ty::Opaque(ty::OpaqueTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
|
||||
// FIXME(alias): merge these
|
||||
match t.kind() {
|
||||
ty::Opaque(ty::AliasTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
|
||||
ty::Projection(proj)
|
||||
if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder =>
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
|
|||
}
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::Clause::Projection(ty::ProjectionPredicate {
|
||||
projection_ty: ty::ProjectionTy { substs, def_id: _ },
|
||||
projection_ty: ty::AliasTy { substs, def_id: _ },
|
||||
term,
|
||||
})) => {
|
||||
for subst in &substs[1..] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue