Remove origin field from TypeAliasesOpaqueTy
This commit is contained in:
parent
5cefdbdab5
commit
c34fb5167e
@ -345,7 +345,6 @@ fn lower_item_kind(
|
|||||||
ty,
|
ty,
|
||||||
ImplTraitContext::TypeAliasesOpaqueTy {
|
ImplTraitContext::TypeAliasesOpaqueTy {
|
||||||
capturable_lifetimes: &mut FxHashSet::default(),
|
capturable_lifetimes: &mut FxHashSet::default(),
|
||||||
origin: hir::OpaqueTyOrigin::TyAlias,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
let generics = self.lower_generics(gen, ImplTraitContext::disallowed());
|
let generics = self.lower_generics(gen, ImplTraitContext::disallowed());
|
||||||
@ -918,7 +917,6 @@ fn lower_impl_item(&mut self, i: &AssocItem) -> hir::ImplItem<'hir> {
|
|||||||
ty,
|
ty,
|
||||||
ImplTraitContext::TypeAliasesOpaqueTy {
|
ImplTraitContext::TypeAliasesOpaqueTy {
|
||||||
capturable_lifetimes: &mut FxHashSet::default(),
|
capturable_lifetimes: &mut FxHashSet::default(),
|
||||||
origin: hir::OpaqueTyOrigin::TyAlias,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
hir::ImplItemKind::TyAlias(ty)
|
hir::ImplItemKind::TyAlias(ty)
|
||||||
|
@ -280,8 +280,6 @@ enum ImplTraitContext<'b, 'a> {
|
|||||||
// FIXME(impl_trait): but `required_region_bounds` will ICE later
|
// FIXME(impl_trait): but `required_region_bounds` will ICE later
|
||||||
// anyway.
|
// anyway.
|
||||||
capturable_lifetimes: &'b mut FxHashSet<hir::LifetimeName>,
|
capturable_lifetimes: &'b mut FxHashSet<hir::LifetimeName>,
|
||||||
/// Origin: OpaqueTyOrigin::TyAlias
|
|
||||||
origin: hir::OpaqueTyOrigin,
|
|
||||||
},
|
},
|
||||||
/// `impl Trait` is not accepted in this position.
|
/// `impl Trait` is not accepted in this position.
|
||||||
Disallowed(ImplTraitPosition),
|
Disallowed(ImplTraitPosition),
|
||||||
@ -310,8 +308,8 @@ fn reborrow<'this>(&'this mut self) -> ImplTraitContext<'this, 'a> {
|
|||||||
ReturnPositionOpaqueTy { fn_def_id, origin } => {
|
ReturnPositionOpaqueTy { fn_def_id, origin } => {
|
||||||
ReturnPositionOpaqueTy { fn_def_id: *fn_def_id, origin: *origin }
|
ReturnPositionOpaqueTy { fn_def_id: *fn_def_id, origin: *origin }
|
||||||
}
|
}
|
||||||
TypeAliasesOpaqueTy { capturable_lifetimes, origin } => {
|
TypeAliasesOpaqueTy { capturable_lifetimes } => {
|
||||||
TypeAliasesOpaqueTy { capturable_lifetimes, origin: *origin }
|
TypeAliasesOpaqueTy { capturable_lifetimes }
|
||||||
}
|
}
|
||||||
Disallowed(pos) => Disallowed(*pos),
|
Disallowed(pos) => Disallowed(*pos),
|
||||||
}
|
}
|
||||||
@ -1152,7 +1150,6 @@ fn lower_assoc_ty_constraint(
|
|||||||
true,
|
true,
|
||||||
ImplTraitContext::TypeAliasesOpaqueTy {
|
ImplTraitContext::TypeAliasesOpaqueTy {
|
||||||
capturable_lifetimes: &mut capturable_lifetimes,
|
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,
|
None,
|
||||||
|this| this.lower_param_bounds(bounds, itctx),
|
|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
|
// Reset capturable lifetimes, any nested impl trait
|
||||||
// types will inherit lifetimes from this opaque type,
|
// types will inherit lifetimes from this opaque type,
|
||||||
// so don't need to capture them again.
|
// so don't need to capture them again.
|
||||||
let nested_itctx = ImplTraitContext::TypeAliasesOpaqueTy {
|
let nested_itctx = ImplTraitContext::TypeAliasesOpaqueTy {
|
||||||
capturable_lifetimes: &mut FxHashSet::default(),
|
capturable_lifetimes: &mut FxHashSet::default(),
|
||||||
origin,
|
|
||||||
};
|
};
|
||||||
self.lower_opaque_impl_trait(
|
self.lower_opaque_impl_trait(
|
||||||
span,
|
span,
|
||||||
None,
|
None,
|
||||||
origin,
|
hir::OpaqueTyOrigin::TyAlias,
|
||||||
def_node_id,
|
def_node_id,
|
||||||
Some(capturable_lifetimes),
|
Some(capturable_lifetimes),
|
||||||
|this| this.lower_param_bounds(bounds, nested_itctx),
|
|this| this.lower_param_bounds(bounds, nested_itctx),
|
||||||
|
Loading…
Reference in New Issue
Block a user