From c34fb5167ed315fc7f4ae3a3311b9b4de9d060ec Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 15 Jul 2021 12:43:54 -0300 Subject: [PATCH] Remove origin field from TypeAliasesOpaqueTy --- compiler/rustc_ast_lowering/src/item.rs | 2 -- compiler/rustc_ast_lowering/src/lib.rs | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) 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 @@ impl<'hir> LoweringContext<'_, 'hir> { ty, ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut FxHashSet::default(), - origin: hir::OpaqueTyOrigin::TyAlias, }, ); let generics = self.lower_generics(gen, ImplTraitContext::disallowed()); @@ -918,7 +917,6 @@ impl<'hir> LoweringContext<'_, '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 @@ impl<'a> ImplTraitContext<'_, '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 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { true, ImplTraitContext::TypeAliasesOpaqueTy { capturable_lifetimes: &mut capturable_lifetimes, - origin: hir::OpaqueTyOrigin::TyAlias, }, ) } @@ -1416,18 +1413,17 @@ impl<'a, 'hir> LoweringContext<'a, '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),