@@ -162,7 +162,7 @@ struct LoweringContext<'a, 'hir: 'a> {
162
162
}
163
163
164
164
pub trait ResolverAstLowering {
165
- fn def_key ( & mut self , id : DefId ) -> DefKey ;
165
+ fn def_key ( & self , id : DefId ) -> DefKey ;
166
166
167
167
fn def_span ( & self , id : LocalDefId ) -> Span ;
168
168
@@ -174,17 +174,17 @@ pub trait ResolverAstLowering {
174
174
fn get_partial_res ( & self , id : NodeId ) -> Option < PartialRes > ;
175
175
176
176
/// Obtains per-namespace resolutions for `use` statement with the given `NodeId`.
177
- fn get_import_res ( & mut self , id : NodeId ) -> PerNS < Option < Res < NodeId > > > ;
177
+ fn get_import_res ( & self , id : NodeId ) -> PerNS < Option < Res < NodeId > > > ;
178
178
179
179
/// Obtains resolution for a label with the given `NodeId`.
180
- fn get_label_res ( & mut self , id : NodeId ) -> Option < NodeId > ;
181
-
182
- /// We must keep the set of definitions up to date as we add nodes that weren't in the AST.
183
- /// This should only return `None` during testing.
184
- fn definitions ( & mut self ) -> & mut Definitions ;
180
+ fn get_label_res ( & self , id : NodeId ) -> Option < NodeId > ;
185
181
186
182
fn create_stable_hashing_context ( & self ) -> StableHashingContext < ' _ > ;
187
183
184
+ fn definitions ( & self ) -> & Definitions ;
185
+
186
+ fn init_def_id_to_hir_id_mapping ( & mut self , mapping : IndexVec < LocalDefId , Option < hir:: HirId > > ) ;
187
+
188
188
fn lint_buffer ( & mut self ) -> & mut LintBuffer ;
189
189
190
190
fn next_node_id ( & mut self ) -> NodeId ;
@@ -412,7 +412,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
412
412
}
413
413
}
414
414
415
- self . resolver . definitions ( ) . init_def_id_to_hir_id_mapping ( def_id_to_hir_id) ;
415
+ self . resolver . init_def_id_to_hir_id_mapping ( def_id_to_hir_id) ;
416
416
417
417
let krate = hir:: Crate { owners : self . owners , hir_hash } ;
418
418
self . arena . alloc ( krate)
0 commit comments