|
31 | 31 | //! in the HIR, especially for multiple identifiers. |
32 | 32 |
|
33 | 33 | // tidy-alphabetical-start |
34 | | -#![cfg_attr(bootstrap, feature(if_let_guard))] |
35 | 34 | #![feature(box_patterns)] |
36 | 35 | #![recursion_limit = "256"] |
37 | 36 | // tidy-alphabetical-end |
@@ -99,7 +98,7 @@ struct LoweringContext<'a, 'hir> { |
99 | 98 | // will be in AST index. |
100 | 99 | ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>, |
101 | 100 |
|
102 | | - resolver: &'a mut ResolverAstLowering, |
| 101 | + resolver: &'a mut ResolverAstLowering<'hir>, |
103 | 102 | disambiguator: DisambiguatorState, |
104 | 103 |
|
105 | 104 | /// Used to allocate HIR nodes. |
@@ -133,7 +132,7 @@ struct LoweringContext<'a, 'hir> { |
133 | 132 |
|
134 | 133 | current_hir_id_owner: hir::OwnerId, |
135 | 134 | item_local_id_counter: hir::ItemLocalId, |
136 | | - trait_map: ItemLocalMap<Box<[TraitCandidate]>>, |
| 135 | + trait_map: ItemLocalMap<&'hir [TraitCandidate<'hir>]>, |
137 | 136 |
|
138 | 137 | impl_trait_defs: Vec<hir::GenericParam<'hir>>, |
139 | 138 | impl_trait_bounds: Vec<hir::WherePredicate<'hir>>, |
@@ -162,7 +161,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { |
162 | 161 | fn new( |
163 | 162 | tcx: TyCtxt<'hir>, |
164 | 163 | ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>, |
165 | | - resolver: &'a mut ResolverAstLowering, |
| 164 | + resolver: &'a mut ResolverAstLowering<'hir>, |
166 | 165 | ) -> Self { |
167 | 166 | let registered_tools = tcx.registered_tools(()).iter().map(|x| x.name).collect(); |
168 | 167 | Self { |
@@ -248,7 +247,7 @@ impl SpanLowerer { |
248 | 247 | } |
249 | 248 |
|
250 | 249 | #[extension(trait ResolverAstLoweringExt)] |
251 | | -impl ResolverAstLowering { |
| 250 | +impl ResolverAstLowering<'_> { |
252 | 251 | fn legacy_const_generic_args(&self, expr: &Expr, tcx: TyCtxt<'_>) -> Option<Vec<usize>> { |
253 | 252 | let ExprKind::Path(None, path) = &expr.kind else { |
254 | 253 | return None; |
@@ -748,8 +747,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { |
748 | 747 | self.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id))); |
749 | 748 | } |
750 | 749 |
|
751 | | - if let Some(traits) = self.resolver.trait_map.remove(&ast_node_id) { |
752 | | - self.trait_map.insert(hir_id.local_id, traits.into_boxed_slice()); |
| 750 | + if let Some(&traits) = self.resolver.trait_map.get(&ast_node_id) { |
| 751 | + self.trait_map.insert(hir_id.local_id, traits); |
753 | 752 | } |
754 | 753 |
|
755 | 754 | // Check whether the same `NodeId` is lowered more than once. |
|
0 commit comments