Skip to content

Commit 58d7e1b

Browse files
committed
Remove redundant check_for_macros AST pass.
1 parent c2cab1f commit 58d7e1b

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

src/librustc_driver/driver.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
747747
"prelude injection",
748748
|| syntax::std_inject::maybe_inject_prelude(&sess.parse_sess, krate));
749749

750-
time(time_passes,
751-
"checking that all macro invocations are gone",
752-
|| syntax::ext::expand::check_for_macros(&sess.parse_sess, &krate));
753-
754750
time(time_passes,
755751
"checking for inline asm in case the target doesn't support it",
756752
|| no_asm::check_crate(sess, &krate));

src/libsyntax/ext/expand.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use feature_gate::{self, Features};
2525
use fold;
2626
use fold::*;
2727
use util::move_map::MoveMap;
28-
use parse;
2928
use parse::token::{fresh_mark, fresh_name, intern, keywords};
3029
use ptr::P;
3130
use util::small_vector::SmallVector;
@@ -1212,24 +1211,6 @@ fn mark_tts(tts: &[TokenTree], m: Mrk) -> Vec<TokenTree> {
12121211
noop_fold_tts(tts, &mut Marker{mark:m, expn_id: None})
12131212
}
12141213

1215-
/// Check that there are no macro invocations left in the AST:
1216-
pub fn check_for_macros(sess: &parse::ParseSess, krate: &ast::Crate) {
1217-
visit::walk_crate(&mut MacroExterminator{sess:sess}, krate);
1218-
}
1219-
1220-
/// A visitor that ensures that no macro invocations remain in an AST.
1221-
struct MacroExterminator<'a>{
1222-
sess: &'a parse::ParseSess
1223-
}
1224-
1225-
impl<'a, 'v> Visitor<'v> for MacroExterminator<'a> {
1226-
fn visit_mac(&mut self, mac: &ast::Mac) {
1227-
self.sess.span_diagnostic.span_bug(mac.span,
1228-
"macro exterminator: expected AST \
1229-
with no macro invocations");
1230-
}
1231-
}
1232-
12331214

12341215
#[cfg(test)]
12351216
mod tests {

0 commit comments

Comments
 (0)