Skip to content

Commit a6abeac

Browse files
committed
Pass rustc_ast::Crate rather than Queries to after_crate_root_parsing
1 parent 9c0cabf commit a6abeac

File tree

1 file changed

+5
-10
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+5
-10
lines changed

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use rustc_errors::registry::Registry;
4545
use rustc_errors::{ColorConfig, DiagCtxt, ErrCode, FatalError, PResult, markdown};
4646
use rustc_feature::find_gated_cfg;
4747
use rustc_interface::util::{self, get_codegen_backend};
48-
use rustc_interface::{Linker, Queries, interface, passes};
48+
use rustc_interface::{Linker, interface, passes};
4949
use rustc_lint::unerased_lint_store;
5050
use rustc_metadata::creader::MetadataLoader;
5151
use rustc_metadata::locator;
@@ -158,13 +158,10 @@ pub trait Callbacks {
158158
/// Called after parsing the crate root. Submodules are not yet parsed when
159159
/// this callback is called. Return value instructs the compiler whether to
160160
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
161-
#[deprecated = "This callback will likely be removed or stop giving access \
162-
to the TyCtxt in the future. Use either the after_expansion \
163-
or the after_analysis callback instead."]
164-
fn after_crate_root_parsing<'tcx>(
161+
fn after_crate_root_parsing(
165162
&mut self,
166163
_compiler: &interface::Compiler,
167-
_queries: &'tcx Queries<'tcx>,
164+
_queries: &ast::Crate,
168165
) -> Compilation {
169166
Compilation::Continue
170167
}
@@ -396,7 +393,7 @@ fn run_compiler(
396393

397394
// Parse the crate root source code (doesn't parse submodules yet)
398395
// Everything else is parsed during macro expansion.
399-
queries.parse();
396+
let krate = queries.parse();
400397

401398
// If pretty printing is requested: Figure out the representation, print it and exit
402399
if let Some(pp_mode) = sess.opts.pretty {
@@ -407,7 +404,6 @@ fn run_compiler(
407404
passes::write_dep_info(tcx);
408405
});
409406
} else {
410-
let krate = queries.parse();
411407
pretty::print(sess, pp_mode, pretty::PrintExtra::AfterParsing {
412408
krate: &*krate.borrow(),
413409
});
@@ -416,8 +412,7 @@ fn run_compiler(
416412
return early_exit();
417413
}
418414

419-
#[allow(deprecated)]
420-
if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop {
415+
if callbacks.after_crate_root_parsing(compiler, &*krate.borrow()) == Compilation::Stop {
421416
return early_exit();
422417
}
423418

0 commit comments

Comments
 (0)