@@ -12,7 +12,7 @@ use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal};
1212use rustc_errors:: { ErrorGuaranteed , PResult } ;
1313use rustc_expand:: base:: { ExtCtxt , LintStoreExpand , ResolverExpand } ;
1414use rustc_hir:: def_id:: { StableCrateId , LOCAL_CRATE } ;
15- use rustc_lint:: { BufferedEarlyLint , EarlyCheckNode , LintStore } ;
15+ use rustc_lint:: { unerased_lint_store , BufferedEarlyLint , EarlyCheckNode , LintStore } ;
1616use rustc_metadata:: creader:: CStore ;
1717use rustc_middle:: arena:: Arena ;
1818use rustc_middle:: dep_graph:: DepGraph ;
@@ -171,14 +171,15 @@ impl LintStoreExpand for LintStoreExpandImpl<'_> {
171171/// syntax expansion, secondary `cfg` expansion, synthesis of a test
172172/// harness if one is to be provided, injection of a dependency on the
173173/// standard library and prelude, and name resolution.
174+ #[ instrument( level = "trace" , skip( tcx, krate, resolver) ) ]
174175pub fn configure_and_expand (
175- sess : & Session ,
176- lint_store : & LintStore ,
176+ tcx : TyCtxt < ' _ > ,
177177 mut krate : ast:: Crate ,
178- crate_name : Symbol ,
179178 resolver : & mut Resolver < ' _ , ' _ > ,
180179) -> 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 ) ;
182183 pre_expansion_lint ( sess, lint_store, resolver. registered_tools ( ) , & krate, crate_name) ;
183184 rustc_builtin_macros:: register_builtin_macros ( resolver) ;
184185
0 commit comments