Skip to content

Commit 18c94b3

Browse files
committed
expand: Remove obsolete ExpansionConfig::keep_macs
Maybe it was used before the introduction of placeholders, but now it has no effect.
1 parent 0038eae commit 18c94b3

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

compiler/rustc_expand/src/expand.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1614,9 +1614,8 @@ pub struct ExpansionConfig<'feat> {
16141614
pub features: Option<&'feat Features>,
16151615
pub recursion_limit: Limit,
16161616
pub trace_mac: bool,
1617-
pub should_test: bool, // If false, strip `#[test]` nodes
1618-
pub keep_macs: bool,
1619-
pub span_debug: bool, // If true, use verbose debugging for `proc_macro::Span`
1617+
pub should_test: bool, // If false, strip `#[test]` nodes
1618+
pub span_debug: bool, // If true, use verbose debugging for `proc_macro::Span`
16201619
pub proc_macro_backtrace: bool, // If true, show backtraces for proc-macro panics
16211620
}
16221621

@@ -1628,7 +1627,6 @@ impl<'feat> ExpansionConfig<'feat> {
16281627
recursion_limit: Limit::new(1024),
16291628
trace_mac: false,
16301629
should_test: false,
1631-
keep_macs: false,
16321630
span_debug: false,
16331631
proc_macro_backtrace: false,
16341632
}

compiler/rustc_expand/src/placeholders.rs

-8
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,4 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> {
371371
}
372372
}
373373
}
374-
375-
fn visit_mod(&mut self, module: &mut ast::Mod) {
376-
noop_visit_mod(module, self);
377-
// remove macro definitions
378-
module.items.retain(
379-
|item| !matches!(item.kind, ast::ItemKind::MacCall(_) if !self.cx.ecfg.keep_macs),
380-
);
381-
}
382374
}

0 commit comments

Comments
 (0)