mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
use CmResolver instead of &mut CmResolver
This commit is contained in:
@@ -58,7 +58,7 @@ pub(crate) fn visit_scopes<'r, T>(
|
||||
orig_ctxt: Span,
|
||||
derive_fallback_lint_id: Option<NodeId>,
|
||||
mut visitor: impl FnMut(
|
||||
&mut CmResolver<'r, 'ra, 'tcx>,
|
||||
CmResolver<'_, 'ra, 'tcx>,
|
||||
Scope<'ra>,
|
||||
UsePrelude,
|
||||
Span,
|
||||
@@ -165,7 +165,7 @@ pub(crate) fn visit_scopes<'r, T>(
|
||||
if visit {
|
||||
let use_prelude = if use_prelude { UsePrelude::Yes } else { UsePrelude::No };
|
||||
if let ControlFlow::Break(break_result) =
|
||||
visitor(&mut self, scope, use_prelude, ctxt)
|
||||
visitor(self.reborrow(), scope, use_prelude, ctxt)
|
||||
{
|
||||
return Some(break_result);
|
||||
}
|
||||
@@ -438,7 +438,7 @@ pub(crate) fn resolve_ident_in_scope_set<'r>(
|
||||
parent_scope,
|
||||
orig_ident.span,
|
||||
derive_fallback_lint_id,
|
||||
|this, scope, use_prelude, ctxt| {
|
||||
|mut this, scope, use_prelude, ctxt| {
|
||||
let ident = Ident::new(orig_ident.name, ctxt);
|
||||
// The passed `ctxt` is already normalized, so avoid expensive double normalization.
|
||||
let ident = Macros20NormalizedIdent(ident);
|
||||
|
||||
@@ -893,7 +893,7 @@ fn resolve_import<'r>(mut self: CmResolver<'r, 'ra, 'tcx>, import: Import<'ra>)
|
||||
};
|
||||
|
||||
let mut indeterminate_count = 0;
|
||||
self.per_ns_cm(|this, ns| {
|
||||
self.per_ns_cm(|mut this, ns| {
|
||||
if !type_ns_only || ns == TypeNS {
|
||||
if bindings[ns].get() != PendingDecl::Pending {
|
||||
return;
|
||||
|
||||
@@ -1831,13 +1831,13 @@ fn per_ns<F: FnMut(&mut Self, Namespace)>(&mut self, mut f: F) {
|
||||
f(self, MacroNS);
|
||||
}
|
||||
|
||||
fn per_ns_cm<'r, F: FnMut(&mut CmResolver<'r, 'ra, 'tcx>, Namespace)>(
|
||||
fn per_ns_cm<'r, F: FnMut(CmResolver<'_, 'ra, 'tcx>, Namespace)>(
|
||||
mut self: CmResolver<'r, 'ra, 'tcx>,
|
||||
mut f: F,
|
||||
) {
|
||||
f(&mut self, TypeNS);
|
||||
f(&mut self, ValueNS);
|
||||
f(&mut self, MacroNS);
|
||||
f(self.reborrow(), TypeNS);
|
||||
f(self.reborrow(), ValueNS);
|
||||
f(self, MacroNS);
|
||||
}
|
||||
|
||||
fn is_builtin_macro(&self, res: Res) -> bool {
|
||||
@@ -1902,7 +1902,7 @@ fn traits_in_scope(
|
||||
}
|
||||
|
||||
let scope_set = ScopeSet::All(TypeNS);
|
||||
self.cm().visit_scopes(scope_set, parent_scope, ctxt, None, |this, scope, _, _| {
|
||||
self.cm().visit_scopes(scope_set, parent_scope, ctxt, None, |mut this, scope, _, _| {
|
||||
match scope {
|
||||
Scope::ModuleNonGlobs(module, _) => {
|
||||
this.get_mut().traits_in_module(module, assoc_item, &mut found_traits);
|
||||
|
||||
Reference in New Issue
Block a user