Skip to content

Commit 1d07d68

Browse files
committed
Make def_collector a MutVisitor.
1 parent da965d3 commit 1d07d68

File tree

6 files changed

+196
-109
lines changed

6 files changed

+196
-109
lines changed

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ macro_rules! common_visitor_and_walkers {
10701070
pub fn walk_contract(FnContract);
10711071
pub fn walk_coroutine_kind(CoroutineKind);
10721072
pub fn walk_crate(Crate);
1073+
pub fn walk_defaultness(Defaultness);
10731074
pub fn walk_expr(Expr);
10741075
pub fn walk_expr_field(ExprField);
10751076
pub fn walk_field_def(FieldDef);

compiler/rustc_expand/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ pub trait ResolverExpand {
10631063
fn visit_ast_fragment_with_placeholders(
10641064
&mut self,
10651065
expn_id: LocalExpnId,
1066-
fragment: &AstFragment,
1066+
fragment: &mut AstFragment,
10671067
);
10681068
fn register_builtin_macro(&mut self, name: Symbol, ext: SyntaxExtensionKind);
10691069

compiler/rustc_expand/src/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ macro_rules! ast_fragments {
137137
T::fragment_to_output(self)
138138
}
139139

140-
pub(crate) fn mut_visit_with(&mut self, vis: &mut impl MutVisitor) {
140+
pub fn mut_visit_with(&mut self, vis: &mut impl MutVisitor) {
141141
match self {
142142
AstFragment::OptExpr(opt_expr) => {
143143
if let Some(expr) = opt_expr.take() {
@@ -664,7 +664,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
664664
if self.monotonic {
665665
self.cx
666666
.resolver
667-
.visit_ast_fragment_with_placeholders(self.cx.current_expansion.id, &fragment);
667+
.visit_ast_fragment_with_placeholders(self.cx.current_expansion.id, &mut fragment);
668668

669669
if self.cx.sess.opts.incremental.is_some() {
670670
for (invoc, _) in invocations.iter_mut() {

compiler/rustc_resolve/src/build_reduced_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
183183

184184
pub(crate) fn build_reduced_graph(
185185
&mut self,
186-
fragment: &AstFragment,
186+
fragment: &mut AstFragment,
187187
parent_scope: ParentScope<'ra>,
188188
) -> MacroRulesScopeRef<'ra> {
189189
collect_definitions(self, fragment, parent_scope.expansion);

0 commit comments

Comments
 (0)