@@ -12,7 +12,7 @@ use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal};
12
12
use rustc_errors:: { ErrorGuaranteed , PResult } ;
13
13
use rustc_expand:: base:: { ExtCtxt , LintStoreExpand , ResolverExpand } ;
14
14
use rustc_hir:: def_id:: { StableCrateId , LOCAL_CRATE } ;
15
- use rustc_lint:: { BufferedEarlyLint , EarlyCheckNode , LintStore } ;
15
+ use rustc_lint:: { unerased_lint_store , BufferedEarlyLint , EarlyCheckNode , LintStore } ;
16
16
use rustc_metadata:: creader:: CStore ;
17
17
use rustc_middle:: arena:: Arena ;
18
18
use rustc_middle:: dep_graph:: DepGraph ;
@@ -171,14 +171,15 @@ impl LintStoreExpand for LintStoreExpandImpl<'_> {
171
171
/// syntax expansion, secondary `cfg` expansion, synthesis of a test
172
172
/// harness if one is to be provided, injection of a dependency on the
173
173
/// standard library and prelude, and name resolution.
174
+ #[ instrument( level = "trace" , skip( tcx, krate, resolver) ) ]
174
175
pub fn configure_and_expand (
175
- sess : & Session ,
176
- lint_store : & LintStore ,
176
+ tcx : TyCtxt < ' _ > ,
177
177
mut krate : ast:: Crate ,
178
- crate_name : Symbol ,
179
178
resolver : & mut Resolver < ' _ , ' _ > ,
180
179
) -> Result < ast:: Crate > {
181
- trace ! ( "configure_and_expand" ) ;
180
+ let sess = tcx. sess ;
181
+ let lint_store = unerased_lint_store ( tcx) ;
182
+ let crate_name = tcx. crate_name ( LOCAL_CRATE ) ;
182
183
pre_expansion_lint ( sess, lint_store, resolver. registered_tools ( ) , & krate, crate_name) ;
183
184
rustc_builtin_macros:: register_builtin_macros ( resolver) ;
184
185
0 commit comments