Closed
Description
Code
.
Current output
error[E0500]: closure requires unique access to `*self` but it is already borrowed
--> compiler/rustc_resolve/src/macros.rs:828:25
|
824 | self.visit_scopes(
| - ------------ first borrow later used by call
| _____________________|
| |
825 | | ScopeSet::Macro(MacroKind::Derive),
826 | | &parent_scope,
827 | | ident.span.ctxt(),
828 | | |this, scope, use_prelude, ctxt| {
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ closure construction occurs here
... |
839 | | let x = self.get_macro_by_def_id(def_id);
| | ---- second borrow occurs due to use of `*self` in closure
... |
861 | | },
862 | | );
| |_____________________- borrow occurs here
Desired output
error[E0500]: closure requires unique access to `*self` but it is already borrowed
--> compiler/rustc_resolve/src/macros.rs:828:25
|
824 | self.visit_scopes(
| - ------------ first borrow later used by call
| _____________________|
| |
825 | | ScopeSet::Macro(MacroKind::Derive),
826 | | &parent_scope,
827 | | ident.span.ctxt(),
828 | | |this, scope, use_prelude, ctxt| {
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ closure construction occurs here
... |
839 | | let x = self.get_macro_by_def_id(def_id);
| | ----
| | |
| | second borrow occurs due to use of `*self` in closure
| | help: a closure argument with the same type as `self` is available, you might have meant to use that: `this`
... |
861 | | },
862 | | );
| |_____________________- borrow occurs here
Rationale and extra context
No response
Other cases
No response
Anything else?
No response