@@ -84,7 +84,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
84
84
/// Reachable macros with block module parents exist due to `#[macro_export] macro_rules!`,
85
85
/// but they cannot use def-site hygiene, so the assumption holds
86
86
/// (<https://github.com/rust-lang/rust/pull/77984#issuecomment-712445508>).
87
- pub ( crate ) fn get_nearest_non_block_module ( & mut self , mut def_id : DefId ) -> Module < ' ra > {
87
+ pub ( crate ) fn get_nearest_non_block_module ( & self , mut def_id : DefId ) -> Module < ' ra > {
88
88
loop {
89
89
match self . get_module ( def_id) {
90
90
Some ( module) => return module,
@@ -93,14 +93,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
93
93
}
94
94
}
95
95
96
- pub ( crate ) fn expect_module ( & mut self , def_id : DefId ) -> Module < ' ra > {
96
+ pub ( crate ) fn expect_module ( & self , def_id : DefId ) -> Module < ' ra > {
97
97
self . get_module ( def_id) . expect ( "argument `DefId` is not a module" )
98
98
}
99
99
100
100
/// If `def_id` refers to a module (in resolver's sense, i.e. a module item, crate root, enum,
101
101
/// or trait), then this function returns that module's resolver representation, otherwise it
102
102
/// returns `None`.
103
- pub ( crate ) fn get_module ( & mut self , def_id : DefId ) -> Option < Module < ' ra > > {
103
+ pub ( crate ) fn get_module ( & self , def_id : DefId ) -> Option < Module < ' ra > > {
104
104
match def_id. as_local ( ) {
105
105
Some ( local_def_id) => self . local_module_map . get ( & local_def_id) . copied ( ) ,
106
106
None => {
@@ -133,7 +133,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
133
133
}
134
134
}
135
135
136
- pub ( crate ) fn expn_def_scope ( & mut self , expn_id : ExpnId ) -> Module < ' ra > {
136
+ pub ( crate ) fn expn_def_scope ( & self , expn_id : ExpnId ) -> Module < ' ra > {
137
137
match expn_id. expn_data ( ) . macro_def_id {
138
138
Some ( def_id) => self . macro_def_scope ( def_id) ,
139
139
None => expn_id
@@ -143,7 +143,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
143
143
}
144
144
}
145
145
146
- pub ( crate ) fn macro_def_scope ( & mut self , def_id : DefId ) -> Module < ' ra > {
146
+ pub ( crate ) fn macro_def_scope ( & self , def_id : DefId ) -> Module < ' ra > {
147
147
if let Some ( id) = def_id. as_local ( ) {
148
148
self . local_macro_def_scopes [ & id]
149
149
} else {
0 commit comments