Combine projection and opaque into alias
This commit is contained in:
parent
c13bd83528
commit
61adaf8187
104 changed files with 387 additions and 381 deletions
|
@ -249,11 +249,11 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
|
|||
self.add_constraints_from_substs(current, def.did(), substs, variance);
|
||||
}
|
||||
|
||||
ty::Projection(ref data) => {
|
||||
ty::Alias(ty::Projection, ref data) => {
|
||||
self.add_constraints_from_invariant_substs(current, data.substs, variance);
|
||||
}
|
||||
|
||||
ty::Opaque(ty::AliasTy { def_id: _, substs }) => {
|
||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id: _, substs }) => {
|
||||
self.add_constraints_from_invariant_substs(current, substs, variance);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,8 +112,8 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
|
|||
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
// FIXME(alias): merge these
|
||||
match t.kind() {
|
||||
ty::Opaque(ty::AliasTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
|
||||
ty::Projection(proj)
|
||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
|
||||
ty::Alias(ty::Projection, proj)
|
||||
if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder =>
|
||||
{
|
||||
self.visit_opaque(proj.def_id, proj.substs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue