Fix AST pretty.
This commit is contained in:
parent
2f28737ebe
commit
aa1bc5874e
3 changed files with 8 additions and 8 deletions
|
@ -315,12 +315,12 @@ fn run_compiler(
|
||||||
|
|
||||||
if let Some(ppm) = &sess.opts.pretty {
|
if let Some(ppm) = &sess.opts.pretty {
|
||||||
if ppm.needs_ast_map() {
|
if ppm.needs_ast_map() {
|
||||||
let expanded_crate = { &queries.expansion()?.peek().0 };
|
let expanded_crate = queries.expansion()?.peek().0.clone();
|
||||||
queries.global_ctxt()?.peek_mut().enter(|tcx| {
|
queries.global_ctxt()?.peek_mut().enter(|tcx| {
|
||||||
pretty::print_after_hir_lowering(
|
pretty::print_after_hir_lowering(
|
||||||
tcx,
|
tcx,
|
||||||
compiler.input(),
|
compiler.input(),
|
||||||
expanded_crate,
|
&*expanded_crate,
|
||||||
*ppm,
|
*ppm,
|
||||||
compiler.output_file().as_ref().map(|p| &**p),
|
compiler.output_file().as_ref().map(|p| &**p),
|
||||||
);
|
);
|
||||||
|
|
|
@ -457,13 +457,13 @@ pub fn lower_to_hir<'res, 'tcx>(
|
||||||
sess: &'tcx Session,
|
sess: &'tcx Session,
|
||||||
lint_store: &LintStore,
|
lint_store: &LintStore,
|
||||||
resolver: &'res mut Resolver<'_>,
|
resolver: &'res mut Resolver<'_>,
|
||||||
krate: ast::Crate,
|
krate: Rc<ast::Crate>,
|
||||||
arena: &'tcx rustc_ast_lowering::Arena<'tcx>,
|
arena: &'tcx rustc_ast_lowering::Arena<'tcx>,
|
||||||
) -> &'tcx Crate<'tcx> {
|
) -> &'tcx Crate<'tcx> {
|
||||||
// Lower AST to HIR.
|
// Lower AST to HIR.
|
||||||
let hir_crate = rustc_ast_lowering::lower_crate(
|
let hir_crate = rustc_ast_lowering::lower_crate(
|
||||||
sess,
|
sess,
|
||||||
&krate,
|
&*krate,
|
||||||
resolver,
|
resolver,
|
||||||
rustc_parse::nt_to_tokenstream,
|
rustc_parse::nt_to_tokenstream,
|
||||||
arena,
|
arena,
|
||||||
|
@ -779,7 +779,7 @@ impl<'tcx> QueryContext<'tcx> {
|
||||||
pub fn create_global_ctxt<'tcx>(
|
pub fn create_global_ctxt<'tcx>(
|
||||||
compiler: &'tcx Compiler,
|
compiler: &'tcx Compiler,
|
||||||
lint_store: Lrc<LintStore>,
|
lint_store: Lrc<LintStore>,
|
||||||
krate: ast::Crate,
|
krate: Rc<ast::Crate>,
|
||||||
dep_graph: DepGraph,
|
dep_graph: DepGraph,
|
||||||
resolver: Rc<RefCell<BoxedResolver>>,
|
resolver: Rc<RefCell<BoxedResolver>>,
|
||||||
outputs: OutputFilenames,
|
outputs: OutputFilenames,
|
||||||
|
|
|
@ -79,7 +79,7 @@ pub struct Queries<'tcx> {
|
||||||
parse: Query<ast::Crate>,
|
parse: Query<ast::Crate>,
|
||||||
crate_name: Query<String>,
|
crate_name: Query<String>,
|
||||||
register_plugins: Query<(ast::Crate, Lrc<LintStore>)>,
|
register_plugins: Query<(ast::Crate, Lrc<LintStore>)>,
|
||||||
expansion: Query<(ast::Crate, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>,
|
expansion: Query<(Rc<ast::Crate>, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>,
|
||||||
dep_graph: Query<DepGraph>,
|
dep_graph: Query<DepGraph>,
|
||||||
prepare_outputs: Query<OutputFilenames>,
|
prepare_outputs: Query<OutputFilenames>,
|
||||||
global_ctxt: Query<QueryContext<'tcx>>,
|
global_ctxt: Query<QueryContext<'tcx>>,
|
||||||
|
@ -167,7 +167,7 @@ impl<'tcx> Queries<'tcx> {
|
||||||
|
|
||||||
pub fn expansion(
|
pub fn expansion(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<&Query<(ast::Crate, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>> {
|
) -> Result<&Query<(Rc<ast::Crate>, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>> {
|
||||||
tracing::trace!("expansion");
|
tracing::trace!("expansion");
|
||||||
self.expansion.compute(|| {
|
self.expansion.compute(|| {
|
||||||
let crate_name = self.crate_name()?.peek().clone();
|
let crate_name = self.crate_name()?.peek().clone();
|
||||||
|
@ -183,7 +183,7 @@ impl<'tcx> Queries<'tcx> {
|
||||||
let krate = resolver.access(|resolver| {
|
let krate = resolver.access(|resolver| {
|
||||||
passes::configure_and_expand(&sess, &lint_store, krate, &crate_name, resolver)
|
passes::configure_and_expand(&sess, &lint_store, krate, &crate_name, resolver)
|
||||||
})?;
|
})?;
|
||||||
Ok((krate, Rc::new(RefCell::new(resolver)), lint_store))
|
Ok((Rc::new(krate), Rc::new(RefCell::new(resolver)), lint_store))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue