@@ -27,7 +27,7 @@ use rustc_hir::{
2727 Attribute , ImplItemKind , ItemKind as HirItem , Node as HirNode , TraitItemKind , find_attr,
2828 intravisit,
2929} ;
30- use rustc_middle:: dep_graph:: { DepNode , dep_kind_from_label , label_strs } ;
30+ use rustc_middle:: dep_graph:: { DepKind , DepNode , dep_kind_from_label } ;
3131use rustc_middle:: hir:: nested_filter;
3232use rustc_middle:: ty:: TyCtxt ;
3333use rustc_span:: { Span , Symbol } ;
@@ -38,81 +38,78 @@ use crate::diagnostics;
3838// Base and Extra labels to build up the labels
3939
4040/// For typedef, constants, and statics
41- const BASE_CONST : & [ & str ] = & [ label_strs :: type_of] ;
41+ const BASE_CONST : & [ DepKind ] = & [ DepKind :: type_of] ;
4242
4343/// DepNodes for functions + methods
44- const BASE_FN : & [ & str ] = & [
44+ const BASE_FN : & [ DepKind ] = & [
4545 // Callers will depend on the signature of these items, so we better test
46- label_strs :: fn_sig,
47- label_strs :: generics_of,
48- label_strs :: clauses_of,
49- label_strs :: type_of,
46+ DepKind :: fn_sig,
47+ DepKind :: generics_of,
48+ DepKind :: clauses_of,
49+ DepKind :: type_of,
5050 // And a big part of compilation (that we eventually want to cache) is type inference
5151 // information:
52- label_strs :: typeck_root,
52+ DepKind :: typeck_root,
5353] ;
5454
5555/// DepNodes for Hir, which is pretty much everything
56- const BASE_HIR : & [ & str ] = & [
56+ const BASE_HIR : & [ DepKind ] = & [
5757 // hir_owner should be computed for all nodes
58- label_strs :: hir_owner,
58+ DepKind :: hir_owner,
5959] ;
6060
6161/// `impl` implementation of struct/trait
62- const BASE_IMPL : & [ & str ] =
63- & [ label_strs :: associated_item_def_ids, label_strs :: generics_of, label_strs :: impl_trait_header] ;
62+ const BASE_IMPL : & [ DepKind ] =
63+ & [ DepKind :: associated_item_def_ids, DepKind :: generics_of, DepKind :: impl_trait_header] ;
6464
6565/// DepNodes for exported mir bodies, which is relevant in "executable"
6666/// code, i.e., functions+methods
67- const BASE_MIR : & [ & str ] = & [ label_strs :: optimized_mir, label_strs :: promoted_mir] ;
67+ const BASE_MIR : & [ DepKind ] = & [ DepKind :: optimized_mir, DepKind :: promoted_mir] ;
6868
6969/// Struct, Enum and Union DepNodes
7070///
7171/// Note that changing the type of a field does not change the type of the struct or enum, but
7272/// adding/removing fields or changing a fields name or visibility does.
73- const BASE_STRUCT : & [ & str ] =
74- & [ label_strs:: generics_of, label_strs:: clauses_of, label_strs:: type_of] ;
73+ const BASE_STRUCT : & [ DepKind ] = & [ DepKind :: generics_of, DepKind :: clauses_of, DepKind :: type_of] ;
7574
7675/// Trait definition `DepNode`s.
7776/// Extra `DepNode`s for functions and methods.
78- const EXTRA_ASSOCIATED : & [ & str ] = & [ label_strs :: associated_item] ;
77+ const EXTRA_ASSOCIATED : & [ DepKind ] = & [ DepKind :: associated_item] ;
7978
80- const EXTRA_TRAIT : & [ & str ] = & [ ] ;
79+ const EXTRA_TRAIT : & [ DepKind ] = & [ ] ;
8180
8281// Fully Built Labels
8382
84- const LABELS_CONST : & [ & [ & str ] ] = & [ BASE_HIR , BASE_CONST ] ;
83+ const LABELS_CONST : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_CONST ] ;
8584
8685/// Constant/Typedef in an impl
87- const LABELS_CONST_IN_IMPL : & [ & [ & str ] ] = & [ BASE_HIR , BASE_CONST , EXTRA_ASSOCIATED ] ;
86+ const LABELS_CONST_IN_IMPL : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_CONST , EXTRA_ASSOCIATED ] ;
8887
8988/// Trait-Const/Typedef DepNodes
90- const LABELS_CONST_IN_TRAIT : & [ & [ & str ] ] = & [ BASE_HIR , BASE_CONST , EXTRA_ASSOCIATED , EXTRA_TRAIT ] ;
89+ const LABELS_CONST_IN_TRAIT : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_CONST , EXTRA_ASSOCIATED , EXTRA_TRAIT ] ;
9190
9291/// Function `DepNode`s.
93- const LABELS_FN : & [ & [ & str ] ] = & [ BASE_HIR , BASE_MIR , BASE_FN ] ;
92+ const LABELS_FN : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_MIR , BASE_FN ] ;
9493
9594/// Method `DepNode`s.
96- const LABELS_FN_IN_IMPL : & [ & [ & str ] ] = & [ BASE_HIR , BASE_MIR , BASE_FN , EXTRA_ASSOCIATED ] ;
95+ const LABELS_FN_IN_IMPL : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_MIR , BASE_FN , EXTRA_ASSOCIATED ] ;
9796
9897/// Trait method `DepNode`s.
99- const LABELS_FN_IN_TRAIT : & [ & [ & str ] ] =
98+ const LABELS_FN_IN_TRAIT : & [ & [ DepKind ] ] =
10099 & [ BASE_HIR , BASE_MIR , BASE_FN , EXTRA_ASSOCIATED , EXTRA_TRAIT ] ;
101100
102101/// For generic cases like inline-assembly, modules, etc.
103- const LABELS_HIR_ONLY : & [ & [ & str ] ] = & [ BASE_HIR ] ;
102+ const LABELS_HIR_ONLY : & [ & [ DepKind ] ] = & [ BASE_HIR ] ;
104103
105104/// Impl `DepNode`s.
106- const LABELS_TRAIT : & [ & [ & str ] ] = & [
107- BASE_HIR ,
108- & [ label_strs:: associated_item_def_ids, label_strs:: clauses_of, label_strs:: generics_of] ,
109- ] ;
105+ const LABELS_TRAIT : & [ & [ DepKind ] ] =
106+ & [ BASE_HIR , & [ DepKind :: associated_item_def_ids, DepKind :: clauses_of, DepKind :: generics_of] ] ;
110107
111108/// Impl `DepNode`s.
112- const LABELS_IMPL : & [ & [ & str ] ] = & [ BASE_HIR , BASE_IMPL ] ;
109+ const LABELS_IMPL : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_IMPL ] ;
113110
114111/// Abstract data type (struct, enum, union) `DepNode`s.
115- const LABELS_ADT : & [ & [ & str ] ] = & [ BASE_HIR , BASE_STRUCT ] ;
112+ const LABELS_ADT : & [ & [ DepKind ] ] = & [ BASE_HIR , BASE_STRUCT ] ;
116113
117114// FIXME: Struct/Enum/Unions Fields (there is currently no way to attach these)
118115//
@@ -289,7 +286,7 @@ impl<'tcx> CleanVisitor<'tcx> {
289286 . emit_fatal ( diagnostics:: UndefinedCleanDirty { span, kind : format ! ( "{node:?}" ) } ) ,
290287 } ;
291288 let labels =
292- Labels :: from_iter ( labels. iter ( ) . flat_map ( |s| s. iter ( ) . map ( |l| ( * l ) . to_string ( ) ) ) ) ;
289+ Labels :: from_iter ( labels. iter ( ) . flat_map ( |s| s. iter ( ) . map ( |l| format ! ( "{l:?}" ) ) ) ) ;
293290 ( name, labels)
294291 }
295292
0 commit comments