diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index d8c879fd7cb..9f9d41c3f3d 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -345,7 +345,6 @@ fn lower_item_kind( ty, ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut FxHashSet::default(), - origin: hir::OpaqueTyOrigin::TyAlias, }, ); let generics = self.lower_generics(gen, ImplTraitContext::disallowed()); @@ -918,7 +917,6 @@ fn lower_impl_item(&mut self, i: &AssocItem) -> hir::ImplItem<'hir> { ty, ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut FxHashSet::default(), - origin: hir::OpaqueTyOrigin::TyAlias, }, ); hir::ImplItemKind::TyAlias(ty) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 37809c377ca..f6f47b11ce2 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -280,8 +280,6 @@ enum ImplTraitContext<'b, 'a> { // FIXME(impl_trait): but `required_region_bounds` will ICE later // anyway. capturable_lifetimes: &'b mut FxHashSet, - /// Origin: OpaqueTyOrigin::TyAlias - origin: hir::OpaqueTyOrigin, }, /// `impl Trait` is not accepted in this position. Disallowed(ImplTraitPosition), @@ -310,8 +308,8 @@ fn reborrow<'this>(&'this mut self) -> ImplTraitContext<'this, 'a> { ReturnPositionOpaqueTy { fn_def_id, origin } => { ReturnPositionOpaqueTy { fn_def_id: *fn_def_id, origin: *origin } } - TypeAliasesOpaqueTy { capturable_lifetimes, origin } => { - TypeAliasesOpaqueTy { capturable_lifetimes, origin: *origin } + TypeAliasesOpaqueTy { capturable_lifetimes } => { + TypeAliasesOpaqueTy { capturable_lifetimes } } Disallowed(pos) => Disallowed(*pos), } @@ -1152,7 +1150,6 @@ fn lower_assoc_ty_constraint( true, ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut capturable_lifetimes, - origin: hir::OpaqueTyOrigin::TyAlias, }, ) } @@ -1416,18 +1413,17 @@ fn lower_ty_direct(&mut self, t: &Ty, mut itctx: ImplTraitContext<'_, 'hir>) -> None, |this| this.lower_param_bounds(bounds, itctx), ), - ImplTraitContext::TypeAliasesOpaqueTy { ref capturable_lifetimes, origin } => { + ImplTraitContext::TypeAliasesOpaqueTy { ref capturable_lifetimes } => { // Reset capturable lifetimes, any nested impl trait // types will inherit lifetimes from this opaque type, // so don't need to capture them again. let nested_itctx = ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut FxHashSet::default(), - origin, }; self.lower_opaque_impl_trait( span, None, - origin, + hir::OpaqueTyOrigin::TyAlias, def_node_id, Some(capturable_lifetimes), |this| this.lower_param_bounds(bounds, nested_itctx),