Skip to content

Commit c13bd83

Browse files
squash OpaqueTy and ProjectionTy into AliasTy
1 parent 5c6afb8 commit c13bd83

File tree

66 files changed

+182
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+182
-197
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
697697
.map_bound(|p| p.predicates),
698698
None,
699699
),
700-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
700+
ty::Opaque(ty::AliasTy { def_id, substs }) => {
701701
find_fn_kind_from_did(tcx.bound_explicit_item_bounds(*def_id), Some(*substs))
702702
}
703703
ty::Closure(_, substs) => match substs.as_closure().kind() {

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
504504
let ErrorConstraintInfo { outlived_fr, span, .. } = errci;
505505

506506
let mut output_ty = self.regioncx.universal_regions().unnormalized_output_ty;
507-
if let ty::Opaque(ty::OpaqueTy { def_id, substs: _ }) = *output_ty.kind() {
507+
if let ty::Opaque(ty::AliasTy { def_id, substs: _ }) = *output_ty.kind() {
508508
output_ty = self.infcx.tcx.type_of(def_id)
509509
};
510510

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
8383
ConstValue::from_machine_usize(adt.variants().len() as u64, &tcx)
8484
}
8585
ty::Projection(_)
86-
| ty::Opaque(ty::OpaqueTy { def_id: _, substs: _ })
86+
| ty::Opaque(ty::AliasTy { def_id: _, substs: _ })
8787
| ty::Param(_)
8888
| ty::Placeholder(_)
8989
| ty::Infer(_) => throw_inval!(TooGeneric),

compiler/rustc_const_eval/src/transform/validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
241241
};
242242

243243
let kind = match parent_ty.ty.kind() {
244-
&ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
244+
&ty::Opaque(ty::AliasTy { def_id, substs }) => {
245245
self.tcx.bound_type_of(def_id).subst(self.tcx, substs).kind()
246246
}
247247
kind => kind,

compiler/rustc_const_eval/src/util/type_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
5858
// Types with identity (print the module path).
5959
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
6060
| ty::FnDef(def_id, substs)
61-
| ty::Opaque(ty::OpaqueTy { def_id, substs })
62-
| ty::Projection(ty::ProjectionTy { def_id, substs })
61+
| ty::Opaque(ty::AliasTy { def_id, substs })
62+
| ty::Projection(ty::AliasTy { def_id, substs })
6363
| ty::Closure(def_id, substs)
6464
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
6565
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),

compiler/rustc_hir_analysis/src/astconv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
11461146

11471147
debug!(?substs_trait_ref_and_assoc_item);
11481148

1149-
ty::ProjectionTy { def_id: assoc_item.def_id, substs: substs_trait_ref_and_assoc_item }
1149+
ty::AliasTy { def_id: assoc_item.def_id, substs: substs_trait_ref_and_assoc_item }
11501150
});
11511151

11521152
if !speculative {

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> E
14401440
impl<'tcx> ty::visit::TypeVisitor<'tcx> for OpaqueTypeCollector {
14411441
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
14421442
match *t.kind() {
1443-
ty::Opaque(ty::OpaqueTy { def_id: def, substs: _ }) => {
1443+
ty::Opaque(ty::AliasTy { def_id: def, substs: _ }) => {
14441444
self.0.push(def);
14451445
ControlFlow::CONTINUE
14461446
}

compiler/rustc_hir_analysis/src/check/compare_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ pub fn check_type_bounds<'tcx>(
17461746
_ => predicates.push(
17471747
ty::Binder::bind_with_vars(
17481748
ty::ProjectionPredicate {
1749-
projection_ty: ty::ProjectionTy {
1749+
projection_ty: ty::AliasTy {
17501750
def_id: trait_ty.def_id,
17511751
substs: rebased_substs,
17521752
},

compiler/rustc_hir_analysis/src/variance/constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
253253
self.add_constraints_from_invariant_substs(current, data.substs, variance);
254254
}
255255

256-
ty::Opaque(ty::OpaqueTy { def_id: _, substs }) => {
256+
ty::Opaque(ty::AliasTy { def_id: _, substs }) => {
257257
self.add_constraints_from_invariant_substs(current, substs, variance);
258258
}
259259

compiler/rustc_hir_analysis/src/variance/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
110110

111111
#[instrument(level = "trace", skip(self), ret)]
112112
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
113-
// FIXME(alias): merge these
114-
match t.kind() {
115-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
113+
// FIXME(alias): merge these
114+
match t.kind() {
115+
ty::Opaque(ty::AliasTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
116116
ty::Projection(proj)
117117
if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder =>
118118
{
@@ -168,7 +168,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
168168
}
169169
}
170170
ty::PredicateKind::Clause(ty::Clause::Projection(ty::ProjectionPredicate {
171-
projection_ty: ty::ProjectionTy { substs, def_id: _ },
171+
projection_ty: ty::AliasTy { substs, def_id: _ },
172172
term,
173173
})) => {
174174
for subst in &substs[1..] {

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
518518

519519
let substs = sig.output().walk().find_map(|arg| {
520520
if let ty::GenericArgKind::Type(ty) = arg.unpack()
521-
&& let ty::Opaque(ty::OpaqueTy { def_id, substs }) = *ty.kind()
521+
&& let ty::Opaque(ty::AliasTy { def_id, substs }) = *ty.kind()
522522
&& def_id == rpit_def_id
523523
{
524524
Some(substs)

compiler/rustc_hir_typeck/src/cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ enum PointerKind<'tcx> {
7676
/// Slice
7777
Length,
7878
/// The unsize info of this projection
79-
OfProjection(ty::ProjectionTy<'tcx>),
79+
OfProjection(ty::AliasTy<'tcx>),
8080
/// The unsize info of this opaque ty
8181
OfOpaque(DefId, SubstsRef<'tcx>),
8282
/// The unsize info of this parameter
@@ -119,7 +119,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
119119
ty::Foreign(..) => Some(PointerKind::Thin),
120120
// We should really try to normalize here.
121121
ty::Projection(pi) => Some(PointerKind::OfProjection(pi)),
122-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
122+
ty::Opaque(ty::AliasTy { def_id, substs }) => {
123123
Some(PointerKind::OfOpaque(def_id, substs))
124124
}
125125
ty::Param(p) => Some(PointerKind::OfParam(p)),

compiler/rustc_hir_typeck/src/closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
167167
expected_ty: Ty<'tcx>,
168168
) -> (Option<ExpectedSig<'tcx>>, Option<ty::ClosureKind>) {
169169
match *expected_ty.kind() {
170-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => self.deduce_signature_from_predicates(
170+
ty::Opaque(ty::AliasTy { def_id, substs }) => self.deduce_signature_from_predicates(
171171
self.tcx.bound_explicit_item_bounds(def_id).subst_iter_copied(self.tcx, substs),
172172
),
173173
ty::Dynamic(ref object_type, ..) => {
@@ -677,7 +677,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
677677
get_future_output(obligation.predicate, obligation.cause.span)
678678
})?
679679
}
680-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => self
680+
ty::Opaque(ty::AliasTy { def_id, substs }) => self
681681
.tcx
682682
.bound_explicit_item_bounds(def_id)
683683
.subst_iter_copied(self.tcx, substs)

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
18051805
{
18061806
let ty = <dyn AstConv<'_>>::ast_ty_to_ty(fcx, ty);
18071807
// Get the `impl Trait`'s `DefId`.
1808-
if let ty::Opaque(ty::OpaqueTy { def_id, substs: _ }) = ty.kind()
1808+
if let ty::Opaque(ty::AliasTy { def_id, substs: _ }) = ty.kind()
18091809
// Get the `impl Trait`'s `Item` so that we can get its trait bounds and
18101810
// get the `Trait`'s `DefId`.
18111811
&& let hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, .. }) =

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23912391
ty::Param(param_ty) => {
23922392
self.point_at_param_definition(&mut err, param_ty);
23932393
}
2394-
ty::Opaque(ty::OpaqueTy { def_id: _, substs: _ }) => {
2394+
ty::Opaque(ty::AliasTy { def_id: _, substs: _ }) => {
23952395
self.suggest_await_on_field_access(&mut err, ident, base, base_ty.peel_refs());
23962396
}
23972397
_ => {}

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
716716
if formal_ret.has_infer_types() {
717717
for ty in ret_ty.walk() {
718718
if let ty::subst::GenericArgKind::Type(ty) = ty.unpack()
719-
&& let ty::Opaque(ty::OpaqueTy { def_id, substs: _ }) = *ty.kind()
719+
&& let ty::Opaque(ty::AliasTy { def_id, substs: _ }) = *ty.kind()
720720
&& let Some(def_id) = def_id.as_local()
721721
&& self.opaque_type_origin(def_id, DUMMY_SP).is_some() {
722722
return None;

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21242124
}
21252125
}
21262126
}
2127-
ty::Opaque(ty::OpaqueTy { def_id: new_def_id, substs: _ })
2127+
ty::Opaque(ty::AliasTy { def_id: new_def_id, substs: _ })
21282128
| ty::Closure(new_def_id, _)
21292129
| ty::FnDef(new_def_id, _) => {
21302130
def_id = new_def_id;

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
174174
let fn_sig = substs.as_closure().sig();
175175
Some((DefIdOrName::DefId(def_id), fn_sig.output(), fn_sig.inputs().map_bound(|inputs| &inputs[1..])))
176176
}
177-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
177+
ty::Opaque(ty::AliasTy { def_id, substs }) => {
178178
self.tcx.bound_item_bounds(def_id).subst(self.tcx, substs).iter().find_map(|pred| {
179179
if let ty::PredicateKind::Clause(ty::Clause::Projection(proj)) = pred.kind().skip_binder()
180180
&& Some(proj.projection_ty.def_id) == self.tcx.lang_items().fn_once_output()

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ fn check_must_not_suspend_ty<'tcx>(
563563
}
564564
ty::Adt(def, _) => check_must_not_suspend_def(fcx.tcx, def.did(), hir_id, data),
565565
// FIXME: support adding the attribute to TAITs
566-
ty::Opaque(ty::OpaqueTy { def_id: def, substs: _ }) => {
566+
ty::Opaque(ty::AliasTy { def_id: def, substs: _ }) => {
567567
let mut has_emitted = false;
568568
for &(predicate, _) in fcx.tcx.explicit_item_bounds(def) {
569569
// We only look at the `DefId`, so it is safe to skip the binder here.

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
557557
.chain(projection_ty.substs.iter().skip(1)),
558558
);
559559

560-
let quiet_projection_ty = ty::ProjectionTy {
560+
let quiet_projection_ty = ty::AliasTy {
561561
substs: substs_with_infer_self,
562562
def_id: projection_ty.def_id,
563563
};

compiler/rustc_hir_typeck/src/writeback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
546546
impl<'tcx> ty::TypeVisitor<'tcx> for RecursionChecker {
547547
type BreakTy = ();
548548
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
549-
if let ty::Opaque(ty::OpaqueTy { def_id, substs: _ }) = *t.kind() {
549+
if let ty::Opaque(ty::AliasTy { def_id, substs: _ }) = *t.kind() {
550550
if def_id == self.def_id.to_def_id() {
551551
return ControlFlow::Break(());
552552
}

compiler/rustc_infer/src/infer/at.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl<'tcx> ToTrace<'tcx> for ty::PolyTraitRef<'tcx> {
411411
}
412412
}
413413

414-
impl<'tcx> ToTrace<'tcx> for ty::ProjectionTy<'tcx> {
414+
impl<'tcx> ToTrace<'tcx> for ty::AliasTy<'tcx> {
415415
fn to_trace(
416416
tcx: TyCtxt<'tcx>,
417417
cause: &ObligationCause<'tcx>,

compiler/rustc_infer/src/infer/combine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
675675
// relatable.
676676
Ok(t)
677677
}
678-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
678+
ty::Opaque(ty::AliasTy { def_id, substs }) => {
679679
let s = self.relate(substs, substs)?;
680680
Ok(if s == substs { t } else { self.infcx.tcx.mk_opaque(def_id, s) })
681681
}

compiler/rustc_infer/src/infer/equate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> {
101101
}
102102

103103
(
104-
&ty::Opaque(ty::OpaqueTy { def_id: a_def_id, substs: _ }),
105-
&ty::Opaque(ty::OpaqueTy { def_id: b_def_id, substs: _ }),
104+
&ty::Opaque(ty::AliasTy { def_id: a_def_id, substs: _ }),
105+
&ty::Opaque(ty::AliasTy { def_id: b_def_id, substs: _ }),
106106
) if a_def_id == b_def_id => {
107107
self.fields.infcx.super_combine_tys(self, a, b)?;
108108
}
109-
(&ty::Opaque(ty::OpaqueTy { def_id, substs: _ }), _)
110-
| (_, &ty::Opaque(ty::OpaqueTy { def_id, substs: _ }))
109+
(&ty::Opaque(ty::AliasTy { def_id, substs: _ }), _)
110+
| (_, &ty::Opaque(ty::AliasTy { def_id, substs: _ }))
111111
if self.fields.define_opaque_types && def_id.is_local() =>
112112
{
113113
self.fields.obligations.extend(

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'tcx> InferCtxt<'tcx> {
340340
pub fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
341341
// FIXME(alias): Merge these
342342
let (def_id, substs) = match *ty.kind() {
343-
ty::Opaque(ty::OpaqueTy { def_id, substs }) => (def_id, substs),
343+
ty::Opaque(ty::AliasTy { def_id, substs }) => (def_id, substs),
344344
ty::Projection(data)
345345
if self.tcx.def_kind(data.def_id) == DefKind::ImplTraitPlaceholder =>
346346
{
@@ -1732,7 +1732,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
17321732
let sort_string = |ty: Ty<'tcx>, path: Option<PathBuf>| {
17331733
// FIXME(alias): Merge these
17341734
let mut s = match (extra, ty.kind()) {
1735-
(true, ty::Opaque(ty::OpaqueTy { def_id, .. })) => {
1735+
(true, ty::Opaque(ty::AliasTy { def_id, .. })) => {
17361736
let sm = self.tcx.sess.source_map();
17371737
let pos = sm.lookup_char_pos(self.tcx.def_span(*def_id).lo());
17381738
format!(
@@ -2386,7 +2386,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
23862386
// suggest:
23872387
// fn get_later<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
23882388
ty::Closure(_, _substs)
2389-
| ty::Opaque(ty::OpaqueTy { def_id: _, substs: _substs })
2389+
| ty::Opaque(ty::AliasTy { def_id: _, substs: _substs })
23902390
if return_impl_trait =>
23912391
{
23922392
new_binding_suggestion(&mut err, type_param_span);
@@ -2770,7 +2770,7 @@ impl TyCategory {
27702770
pub fn from_ty(tcx: TyCtxt<'_>, ty: Ty<'_>) -> Option<(Self, DefId)> {
27712771
match *ty.kind() {
27722772
ty::Closure(def_id, _) => Some((Self::Closure, def_id)),
2773-
ty::Opaque(ty::OpaqueTy { def_id, substs: _ }) => Some((Self::Opaque, def_id)),
2773+
ty::Opaque(ty::AliasTy { def_id, substs: _ }) => Some((Self::Opaque, def_id)),
27742774
ty::Generator(def_id, ..) => {
27752775
Some((Self::Generator(tcx.generator_kind(def_id).unwrap()), def_id))
27762776
}

compiler/rustc_infer/src/infer/error_reporting/suggest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,12 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
487487
StatementAsExpression::CorrectType
488488
}
489489
(
490-
ty::Opaque(ty::OpaqueTy { def_id: last_def_id, substs: _ }),
491-
ty::Opaque(ty::OpaqueTy { def_id: exp_def_id, substs: _ }),
490+
ty::Opaque(ty::AliasTy { def_id: last_def_id, substs: _ }),
491+
ty::Opaque(ty::AliasTy { def_id: exp_def_id, substs: _ }),
492492
) if last_def_id == exp_def_id => StatementAsExpression::CorrectType,
493493
(
494-
ty::Opaque(ty::OpaqueTy { def_id: last_def_id, substs: last_bounds }),
495-
ty::Opaque(ty::OpaqueTy { def_id: exp_def_id, substs: exp_bounds }),
494+
ty::Opaque(ty::AliasTy { def_id: last_def_id, substs: last_bounds }),
495+
ty::Opaque(ty::AliasTy { def_id: exp_def_id, substs: exp_bounds }),
496496
) => {
497497
debug!(
498498
"both opaque, likely future {:?} {:?} {:?} {:?}",

compiler/rustc_infer/src/infer/lattice.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ where
106106
}
107107

108108
(
109-
&ty::Opaque(ty::OpaqueTy { def_id: a_def_id, substs: _ }),
110-
&ty::Opaque(ty::OpaqueTy { def_id: b_def_id, substs: _ }),
109+
&ty::Opaque(ty::AliasTy { def_id: a_def_id, substs: _ }),
110+
&ty::Opaque(ty::AliasTy { def_id: b_def_id, substs: _ }),
111111
) if a_def_id == b_def_id => infcx.super_combine_tys(this, a, b),
112-
(&ty::Opaque(ty::OpaqueTy { def_id, substs: _ }), _)
113-
| (_, &ty::Opaque(ty::OpaqueTy { def_id, substs: _ }))
112+
(&ty::Opaque(ty::AliasTy { def_id, substs: _ }), _)
113+
| (_, &ty::Opaque(ty::AliasTy { def_id, substs: _ }))
114114
if this.define_opaque_types() && def_id.is_local() =>
115115
{
116116
this.add_obligations(

compiler/rustc_infer/src/infer/nll_relate/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ where
275275
/// `ProjectionEq(projection = ?U)`, `ProjectionEq(other_projection = ?U)`.
276276
fn relate_projection_ty(
277277
&mut self,
278-
projection_ty: ty::ProjectionTy<'tcx>,
278+
projection_ty: ty::AliasTy<'tcx>,
279279
value_ty: Ty<'tcx>,
280280
) -> Ty<'tcx> {
281281
use rustc_span::DUMMY_SP;
@@ -609,17 +609,17 @@ where
609609
(&ty::Infer(ty::TyVar(vid)), _) => self.relate_ty_var((vid, b)),
610610

611611
(
612-
&ty::Opaque(ty::OpaqueTy { def_id: a_def_id, substs: _ }),
613-
&ty::Opaque(ty::OpaqueTy { def_id: b_def_id, substs: _ }),
612+
&ty::Opaque(ty::AliasTy { def_id: a_def_id, substs: _ }),
613+
&ty::Opaque(ty::AliasTy { def_id: b_def_id, substs: _ }),
614614
) if a_def_id == b_def_id => infcx.super_combine_tys(self, a, b).or_else(|err| {
615615
self.tcx().sess.delay_span_bug(
616616
self.delegate.span(),
617617
"failure to relate an opaque to itself should result in an error later on",
618618
);
619619
if a_def_id.is_local() { self.relate_opaques(a, b) } else { Err(err) }
620620
}),
621-
(&ty::Opaque(ty::OpaqueTy { def_id, substs: _ }), _)
622-
| (_, &ty::Opaque(ty::OpaqueTy { def_id, substs: _ }))
621+
(&ty::Opaque(ty::AliasTy { def_id, substs: _ }), _)
622+
| (_, &ty::Opaque(ty::AliasTy { def_id, substs: _ }))
623623
if def_id.is_local() =>
624624
{
625625
self.relate_opaques(a, b)

0 commit comments

Comments
 (0)