Skip to content

Commit 9e9e361

Browse files
use CmResolver instead of &mut CmResolver
1 parent 4b3ba58 commit 9e9e361

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

compiler/rustc_resolve/src/ident.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
5050
ctxt: SyntaxContext,
5151
derive_fallback_lint_id: Option<NodeId>,
5252
mut visitor: impl FnMut(
53-
&mut CmResolver<'r, 'ra, 'tcx>,
53+
CmResolver<'_, 'ra, 'tcx>,
5454
Scope<'ra>,
5555
UsePrelude,
5656
SyntaxContext,
@@ -154,7 +154,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
154154

155155
if visit {
156156
let use_prelude = if use_prelude { UsePrelude::Yes } else { UsePrelude::No };
157-
if let break_result @ Some(..) = visitor(&mut self, scope, use_prelude, ctxt) {
157+
if let break_result @ Some(..) = visitor(self.reborrow(), scope, use_prelude, ctxt)
158+
{
158159
return break_result;
159160
}
160161
}
@@ -438,7 +439,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
438439
parent_scope,
439440
orig_ident.span.ctxt(),
440441
derive_fallback_lint_id,
441-
|this, scope, use_prelude, ctxt| {
442+
|mut this, scope, use_prelude, ctxt| {
442443
let ident = Ident::new(orig_ident.name, orig_ident.span.with_ctxt(ctxt));
443444
let result = match scope {
444445
Scope::DeriveHelpers(expn_id) => {

compiler/rustc_resolve/src/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
873873
};
874874

875875
let mut indeterminate_count = 0;
876-
self.per_ns_cm(|this, ns| {
876+
self.per_ns_cm(|mut this, ns| {
877877
if !type_ns_only || ns == TypeNS {
878878
if bindings[ns].get() != PendingBinding::Pending {
879879
return;

compiler/rustc_resolve/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,13 +1835,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
18351835
f(self, MacroNS);
18361836
}
18371837

1838-
fn per_ns_cm<'r, F: FnMut(&mut CmResolver<'r, 'ra, 'tcx>, Namespace)>(
1838+
fn per_ns_cm<'r, F: FnMut(CmResolver<'_, 'ra, 'tcx>, Namespace)>(
18391839
mut self: CmResolver<'r, 'ra, 'tcx>,
18401840
mut f: F,
18411841
) {
1842-
f(&mut self, TypeNS);
1843-
f(&mut self, ValueNS);
1844-
f(&mut self, MacroNS);
1842+
f(self.reborrow(), TypeNS);
1843+
f(self.reborrow(), ValueNS);
1844+
f(self, MacroNS);
18451845
}
18461846

18471847
fn is_builtin_macro(&self, res: Res) -> bool {
@@ -1898,7 +1898,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
18981898
}
18991899

19001900
let scope_set = ScopeSet::All(TypeNS);
1901-
self.cm().visit_scopes(scope_set, parent_scope, ctxt, None, |this, scope, _, _| {
1901+
self.cm().visit_scopes(scope_set, parent_scope, ctxt, None, |mut this, scope, _, _| {
19021902
match scope {
19031903
Scope::Module(module, _) => {
19041904
this.get_mut().traits_in_module(module, assoc_item, &mut found_traits);

0 commit comments

Comments
 (0)