Skip to content

Commit 21634cb

Browse files
committed
Pass rustc_ast::Crate rather than Queries to after_crate_root_parsing
1 parent b795264 commit 21634cb

File tree

1 file changed

+6
-8
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+6
-8
lines changed

Diff for: compiler/rustc_driver_impl/src/lib.rs

+6-8
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
}
@@ -416,8 +413,9 @@ fn run_compiler(
416413
return early_exit();
417414
}
418415

419-
#[allow(deprecated)]
420-
if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop {
416+
if callbacks.after_crate_root_parsing(compiler, &*queries.parse().borrow())
417+
== Compilation::Stop
418+
{
421419
return early_exit();
422420
}
423421

0 commit comments

Comments
 (0)