@@ -3,6 +3,7 @@ use crate::interface::{Compiler, Result};
33use crate :: proc_macro_decls;
44use crate :: util;
55
6+ use ast:: expand:: StrippedCfgItem ;
67use rustc_ast:: { self as ast, visit} ;
78use rustc_borrowck as mir_borrowck;
89use rustc_codegen_ssa:: traits:: CodegenBackend ;
@@ -18,6 +19,7 @@ use rustc_lint::{unerased_lint_store, BufferedEarlyLint, EarlyCheckNode, LintSto
1819use rustc_metadata:: creader:: CStore ;
1920use rustc_middle:: arena:: Arena ;
2021use rustc_middle:: dep_graph:: DepGraph ;
22+ use rustc_middle:: query:: LocalCrate ;
2123use rustc_middle:: ty:: { self , GlobalCtxt , RegisteredTools , TyCtxt } ;
2224use rustc_middle:: util:: Providers ;
2325use rustc_mir_build as mir_build;
@@ -554,6 +556,10 @@ fn resolver_for_lowering<'tcx>(
554556 tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) )
555557}
556558
559+ fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & ' _ [ StrippedCfgItem ] {
560+ tcx. arena . alloc_from_iter ( tcx. resolutions ( ( ) ) . stripped_cfg_items . steal ( ) )
561+ }
562+
557563pub ( crate ) fn write_dep_info ( tcx : TyCtxt < ' _ > ) {
558564 // Make sure name resolution and macro expansion is run for
559565 // the side-effect of providing a complete set of all
@@ -608,6 +614,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
608614 providers. analysis = analysis;
609615 providers. hir_crate = rustc_ast_lowering:: lower_to_hir;
610616 providers. resolver_for_lowering = resolver_for_lowering;
617+ providers. stripped_cfg_items = stripped_cfg_items;
611618 providers. early_lint_checks = early_lint_checks;
612619 proc_macro_decls:: provide ( providers) ;
613620 rustc_const_eval:: provide ( providers) ;
0 commit comments