diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 570da36a3860..99352b651645 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -157,6 +157,9 @@ pub trait Callbacks { /// Called after parsing the crate root. Submodules are not yet parsed when /// this callback is called. Return value instructs the compiler whether to /// continue the compilation afterwards (defaults to `Compilation::Continue`) + #[deprecated = "This callback will likely be removed or stop giving access \ + to the TyCtxt in the future. Use either the after_expansion \ + or the after_analysis callback instead."] fn after_crate_root_parsing<'tcx>( &mut self, _compiler: &interface::Compiler, @@ -407,6 +410,7 @@ fn run_compiler( return early_exit(); } + #[allow(deprecated)] if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop { return early_exit(); }