diff options
| author | bors <bors@rust-lang.org> | 2024-12-13 23:09:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-13 23:09:16 +0000 |
| commit | 4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917 (patch) | |
| tree | 1086f7934aef657a18dccfbb61c907bc3ac0c92e /compiler/rustc_driver_impl/src | |
| parent | 327c7ee4367ea587a49eff1d4715f462ab6db5f0 (diff) | |
| parent | 8cce32ae2bc8a065ca2841a72ae032c5820a6436 (diff) | |
| download | rust-4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917.tar.gz rust-4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917.zip | |
Auto merge of #134269 - matthiaskrgr:rollup-fkshwux, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N]) - #133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them) - #133938 (`rustc_mir_dataflow` cleanups, including some renamings) - #134058 (interpret: reduce usage of TypingEnv::fully_monomorphized) - #134130 (Stop using driver queries in the public API) - #134140 (Add AST support for unsafe binders) - #134229 (Fix typos in docs on provenance) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 2e01c385a66..fe4e822ce0d 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -45,7 +45,7 @@ use rustc_errors::registry::Registry; use rustc_errors::{ColorConfig, DiagCtxt, ErrCode, FatalError, PResult, markdown}; use rustc_feature::find_gated_cfg; use rustc_interface::util::{self, get_codegen_backend}; -use rustc_interface::{Linker, Queries, interface, passes}; +use rustc_interface::{Linker, interface, passes}; use rustc_lint::unerased_lint_store; use rustc_metadata::creader::MetadataLoader; use rustc_metadata::locator; @@ -158,13 +158,10 @@ 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>( + fn after_crate_root_parsing( &mut self, _compiler: &interface::Compiler, - _queries: &'tcx Queries<'tcx>, + _queries: &ast::Crate, ) -> Compilation { Compilation::Continue } @@ -173,7 +170,7 @@ pub trait Callbacks { fn after_expansion<'tcx>( &mut self, _compiler: &interface::Compiler, - _queries: &'tcx Queries<'tcx>, + _tcx: TyCtxt<'tcx>, ) -> Compilation { Compilation::Continue } @@ -416,8 +413,9 @@ fn run_compiler( return early_exit(); } - #[allow(deprecated)] - if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop { + if callbacks.after_crate_root_parsing(compiler, &*queries.parse().borrow()) + == Compilation::Stop + { return early_exit(); } @@ -425,18 +423,18 @@ fn run_compiler( return early_exit(); } - // Make sure name resolution and macro expansion is run. - queries.global_ctxt().enter(|tcx| tcx.resolver_for_lowering()); + queries.global_ctxt().enter(|tcx| { + // Make sure name resolution and macro expansion is run. + let _ = tcx.resolver_for_lowering(); - if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir { - queries.global_ctxt().enter(|tcxt| dump_feature_usage_metrics(tcxt, metrics_dir)); - } + if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir { + dump_feature_usage_metrics(tcx, metrics_dir); + } - if callbacks.after_expansion(compiler, queries) == Compilation::Stop { - return early_exit(); - } + if callbacks.after_expansion(compiler, tcx) == Compilation::Stop { + return early_exit(); + } - queries.global_ctxt().enter(|tcx| { passes::write_dep_info(tcx); if sess.opts.output_types.contains_key(&OutputType::DepInfo) |
