Refactor away ext::expand::{expand_crate, expand_crate_with_expander}.

This commit is contained in:
Jeffrey Seyfried
2016-09-29 00:22:46 +00:00
parent 09e41b6784
commit 21b4369322
3 changed files with 18 additions and 33 deletions

View File

@@ -22,7 +22,6 @@ use parse::{self, parser};
use parse::token;
use parse::token::{InternedString, str_to_ident};
use ptr::P;
use std_inject;
use util::small_vector::SmallVector;
use std::path::PathBuf;
@@ -737,17 +736,6 @@ impl<'a> ExtCtxt<'a> {
pub fn name_of(&self, st: &str) -> ast::Name {
token::intern(st)
}
pub fn initialize(&mut self, krate: &ast::Crate) {
self.crate_root = std_inject::injected_crate_name(krate);
let mut module = ModuleData {
mod_path: vec![token::str_to_ident(&self.ecfg.crate_name)],
directory: PathBuf::from(self.parse_sess.codemap().span_to_filename(krate.span)),
};
module.directory.pop();
self.current_expansion.module = Rc::new(module);
}
}
/// Extract a string literal from the macro expanded version of `expr`,