@@ -3,6 +3,7 @@ use crate::interface::{Compiler, Result};
3
3
use crate :: proc_macro_decls;
4
4
use crate :: util;
5
5
6
+ use ast:: expand:: StrippedCfgItem ;
6
7
use rustc_ast:: { self as ast, visit} ;
7
8
use rustc_borrowck as mir_borrowck;
8
9
use rustc_codegen_ssa:: traits:: CodegenBackend ;
@@ -18,6 +19,7 @@ use rustc_lint::{unerased_lint_store, BufferedEarlyLint, EarlyCheckNode, LintSto
18
19
use rustc_metadata:: creader:: CStore ;
19
20
use rustc_middle:: arena:: Arena ;
20
21
use rustc_middle:: dep_graph:: DepGraph ;
22
+ use rustc_middle:: query:: LocalCrate ;
21
23
use rustc_middle:: ty:: { self , GlobalCtxt , RegisteredTools , TyCtxt } ;
22
24
use rustc_middle:: util:: Providers ;
23
25
use rustc_mir_build as mir_build;
@@ -554,6 +556,10 @@ fn resolver_for_lowering<'tcx>(
554
556
tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) )
555
557
}
556
558
559
+ fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & ' _ [ StrippedCfgItem ] {
560
+ tcx. arena . alloc_from_iter ( tcx. resolutions ( ( ) ) . stripped_cfg_items . steal ( ) )
561
+ }
562
+
557
563
pub ( crate ) fn write_dep_info ( tcx : TyCtxt < ' _ > ) {
558
564
// Make sure name resolution and macro expansion is run for
559
565
// the side-effect of providing a complete set of all
@@ -608,6 +614,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
608
614
providers. analysis = analysis;
609
615
providers. hir_crate = rustc_ast_lowering:: lower_to_hir;
610
616
providers. resolver_for_lowering = resolver_for_lowering;
617
+ providers. stripped_cfg_items = stripped_cfg_items;
611
618
providers. early_lint_checks = early_lint_checks;
612
619
proc_macro_decls:: provide ( providers) ;
613
620
rustc_const_eval:: provide ( providers) ;
0 commit comments