@@ -5,6 +5,9 @@ use rustc_hir::{HirId, ItemLocalId, OwnerId};
55pub use rustc_query_system:: dep_graph:: DepNode ;
66use rustc_query_system:: dep_graph:: FingerprintStyle ;
77pub use rustc_query_system:: dep_graph:: dep_node:: DepKind ;
8+ use rustc_query_system:: dep_graph:: dep_node:: {
9+ DEP_KIND_ANON_ZERO_DEPS , DEP_KIND_NULL , DEP_KIND_RED , DEP_KIND_SIDE_EFFECT ,
10+ } ;
811pub ( crate ) use rustc_query_system:: dep_graph:: { DepContext , DepNodeParams } ;
912use rustc_span:: Symbol ;
1013
@@ -47,7 +50,7 @@ macro_rules! define_dep_nodes {
4750
4851 // This checks that the discriminants of the variants have been assigned consecutively
4952 // from 0 so that they can be used as a dense index.
50- pub ( crate ) const DEP_KIND_VARIANTS : u16 = {
53+ pub const DEP_KIND_VARIANTS : u16 = {
5154 let deps = & [ $( dep_kinds:: $variant, ) * ] ;
5255 let mut i = 0 ;
5356 while i < deps. len( ) {
@@ -61,7 +64,7 @@ macro_rules! define_dep_nodes {
6164
6265 /// List containing the name of each dep kind as a static string,
6366 /// indexable by `DepKind`.
64- pub ( crate ) const DEP_KIND_NAMES : & [ & str ] = & [
67+ pub const DEP_KIND_NAMES : & [ & str ] = & [
6568 $( self :: label_strs:: $variant, ) *
6669 ] ;
6770
@@ -84,18 +87,25 @@ macro_rules! define_dep_nodes {
8487// Create various data structures for each query, and also for a few things
8588// that aren't queries.
8689rustc_with_all_queries ! ( define_dep_nodes![
87- /// We use this for most things when incr. comp. is turned off .
90+ // Make sure this list matches the BuiltinDepKinds enum .
8891 [ ] fn Null ( ) -> ( ) ,
89- /// We use this to create a forever-red node.
9092 [ ] fn Red ( ) -> ( ) ,
9193 [ ] fn SideEffect ( ) -> ( ) ,
9294 [ ] fn AnonZeroDeps ( ) -> ( ) ,
95+ // End of list.
96+
9397 [ ] fn TraitSelect ( ) -> ( ) ,
9498 [ ] fn CompileCodegenUnit ( ) -> ( ) ,
9599 [ ] fn CompileMonoItem ( ) -> ( ) ,
96100 [ ] fn Metadata ( ) -> ( ) ,
97101] ) ;
98102
103+ // Test that the list matches.
104+ const _: ( ) = assert ! ( dep_kinds:: Null . as_inner( ) == DEP_KIND_NULL . as_inner( ) ) ;
105+ const _: ( ) = assert ! ( dep_kinds:: Red . as_inner( ) == DEP_KIND_RED . as_inner( ) ) ;
106+ const _: ( ) = assert ! ( dep_kinds:: SideEffect . as_inner( ) == DEP_KIND_SIDE_EFFECT . as_inner( ) ) ;
107+ const _: ( ) = assert ! ( dep_kinds:: AnonZeroDeps . as_inner( ) == DEP_KIND_ANON_ZERO_DEPS . as_inner( ) ) ;
108+
99109// WARNING: `construct` is generic and does not know that `CompileCodegenUnit` takes `Symbol`s as keys.
100110// Be very careful changing this type signature!
101111pub ( crate ) fn make_compile_codegen_unit ( tcx : TyCtxt < ' _ > , name : Symbol ) -> DepNode {
0 commit comments