diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-02-16 11:36:44 +0000 | 
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-02-20 15:28:59 +0000 | 
| commit | 63c8d000904fcb09cae22fba1768b955e354ebb8 (patch) | |
| tree | 1127480ddd0dde6d73188c861e0a240a7d36377a /compiler/rustc_interface/src/passes.rs | |
| parent | 1202fce40ea91ac26cbfefe2532aa5c5c3755991 (diff) | |
| download | rust-63c8d000904fcb09cae22fba1768b955e354ebb8.tar.gz rust-63c8d000904fcb09cae22fba1768b955e354ebb8.zip | |
Use tcx queries instead of passing the values to `configure_and_expand`.
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 43882e10303..85f39e2aaac 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -12,7 +12,7 @@ use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal}; use rustc_errors::{ErrorGuaranteed, PResult}; use rustc_expand::base::{ExtCtxt, LintStoreExpand, ResolverExpand}; use rustc_hir::def_id::{StableCrateId, LOCAL_CRATE}; -use rustc_lint::{BufferedEarlyLint, EarlyCheckNode, LintStore}; +use rustc_lint::{unerased_lint_store, BufferedEarlyLint, EarlyCheckNode, LintStore}; use rustc_metadata::creader::CStore; use rustc_middle::arena::Arena; use rustc_middle::dep_graph::DepGraph; @@ -171,14 +171,15 @@ impl LintStoreExpand for LintStoreExpandImpl<'_> { /// syntax expansion, secondary `cfg` expansion, synthesis of a test /// harness if one is to be provided, injection of a dependency on the /// standard library and prelude, and name resolution. +#[instrument(level = "trace", skip(tcx, krate, resolver))] pub fn configure_and_expand( - sess: &Session, - lint_store: &LintStore, + tcx: TyCtxt<'_>, mut krate: ast::Crate, - crate_name: Symbol, resolver: &mut Resolver<'_, '_>, ) -> Result<ast::Crate> { - trace!("configure_and_expand"); + let sess = tcx.sess; + let lint_store = unerased_lint_store(tcx); + let crate_name = tcx.crate_name(LOCAL_CRATE); pre_expansion_lint(sess, lint_store, resolver.registered_tools(), &krate, crate_name); rustc_builtin_macros::register_builtin_macros(resolver); | 
