@@ -593,7 +593,7 @@ macro_rules! profq_key {
593
593
macro_rules! define_maps {
594
594
( <$tcx: tt>
595
595
$( $( #[ $attr: meta] ) *
596
- [ $( $modifiers: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
596
+ [ $( $modifiers: tt) * ] fn $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
597
597
define_map_struct! {
598
598
tcx: $tcx,
599
599
input: ( $( ( [ $( $modifiers) * ] [ $( $attr) * ] [ $name] ) ) * )
@@ -954,191 +954,192 @@ macro_rules! define_provider_struct {
954
954
// the driver creates (using several `rustc_*` crates).
955
955
define_maps ! { <' tcx>
956
956
/// Records the type of every item.
957
- [ ] type_of: TypeOfItem ( DefId ) -> Ty <' tcx>,
957
+ [ ] fn type_of: TypeOfItem ( DefId ) -> Ty <' tcx>,
958
958
959
959
/// Maps from the def-id of an item (trait/struct/enum/fn) to its
960
960
/// associated generics and predicates.
961
- [ ] generics_of: GenericsOfItem ( DefId ) -> & ' tcx ty:: Generics ,
962
- [ ] predicates_of: PredicatesOfItem ( DefId ) -> ty:: GenericPredicates <' tcx>,
961
+ [ ] fn generics_of: GenericsOfItem ( DefId ) -> & ' tcx ty:: Generics ,
962
+ [ ] fn predicates_of: PredicatesOfItem ( DefId ) -> ty:: GenericPredicates <' tcx>,
963
963
964
964
/// Maps from the def-id of a trait to the list of
965
965
/// super-predicates. This is a subset of the full list of
966
966
/// predicates. We store these in a separate map because we must
967
967
/// evaluate them even during type conversion, often before the
968
968
/// full predicates are available (note that supertraits have
969
969
/// additional acyclicity requirements).
970
- [ ] super_predicates_of: SuperPredicatesOfItem ( DefId ) -> ty:: GenericPredicates <' tcx>,
970
+ [ ] fn super_predicates_of: SuperPredicatesOfItem ( DefId ) -> ty:: GenericPredicates <' tcx>,
971
971
972
972
/// To avoid cycles within the predicates of a single item we compute
973
973
/// per-type-parameter predicates for resolving `T::AssocTy`.
974
- [ ] type_param_predicates: type_param_predicates( ( DefId , DefId ) )
974
+ [ ] fn type_param_predicates: type_param_predicates( ( DefId , DefId ) )
975
975
-> ty:: GenericPredicates <' tcx>,
976
976
977
- [ ] trait_def: TraitDefOfItem ( DefId ) -> & ' tcx ty:: TraitDef ,
978
- [ ] adt_def: AdtDefOfItem ( DefId ) -> & ' tcx ty:: AdtDef ,
979
- [ ] adt_destructor: AdtDestructor ( DefId ) -> Option <ty:: Destructor >,
980
- [ ] adt_sized_constraint: SizedConstraint ( DefId ) -> & ' tcx [ Ty <' tcx>] ,
981
- [ ] adt_dtorck_constraint: DtorckConstraint ( DefId ) -> ty:: DtorckConstraint <' tcx>,
977
+ [ ] fn trait_def: TraitDefOfItem ( DefId ) -> & ' tcx ty:: TraitDef ,
978
+ [ ] fn adt_def: AdtDefOfItem ( DefId ) -> & ' tcx ty:: AdtDef ,
979
+ [ ] fn adt_destructor: AdtDestructor ( DefId ) -> Option <ty:: Destructor >,
980
+ [ ] fn adt_sized_constraint: SizedConstraint ( DefId ) -> & ' tcx [ Ty <' tcx>] ,
981
+ [ ] fn adt_dtorck_constraint: DtorckConstraint ( DefId ) -> ty:: DtorckConstraint <' tcx>,
982
982
983
983
/// True if this is a const fn
984
- [ ] is_const_fn: IsConstFn ( DefId ) -> bool ,
984
+ [ ] fn is_const_fn: IsConstFn ( DefId ) -> bool ,
985
985
986
986
/// True if this is a foreign item (i.e., linked via `extern { ... }`).
987
- [ ] is_foreign_item: IsForeignItem ( DefId ) -> bool ,
987
+ [ ] fn is_foreign_item: IsForeignItem ( DefId ) -> bool ,
988
988
989
989
/// True if this is a default impl (aka impl Foo for ..)
990
- [ ] is_default_impl: IsDefaultImpl ( DefId ) -> bool ,
990
+ [ ] fn is_default_impl: IsDefaultImpl ( DefId ) -> bool ,
991
991
992
992
/// Get a map with the variance of every item; use `item_variance`
993
993
/// instead.
994
- [ ] crate_variances: crate_variances( CrateNum ) -> Rc <ty:: CrateVariancesMap >,
994
+ [ ] fn crate_variances: crate_variances( CrateNum ) -> Rc <ty:: CrateVariancesMap >,
995
995
996
996
/// Maps from def-id of a type or region parameter to its
997
997
/// (inferred) variance.
998
- [ ] variances_of: ItemVariances ( DefId ) -> Rc <Vec <ty:: Variance >>,
998
+ [ ] fn variances_of: ItemVariances ( DefId ) -> Rc <Vec <ty:: Variance >>,
999
999
1000
1000
/// Maps from an impl/trait def-id to a list of the def-ids of its items
1001
- [ ] associated_item_def_ids: AssociatedItemDefIds ( DefId ) -> Rc <Vec <DefId >>,
1001
+ [ ] fn associated_item_def_ids: AssociatedItemDefIds ( DefId ) -> Rc <Vec <DefId >>,
1002
1002
1003
1003
/// Maps from a trait item to the trait item "descriptor"
1004
- [ ] associated_item: AssociatedItems ( DefId ) -> ty:: AssociatedItem ,
1004
+ [ ] fn associated_item: AssociatedItems ( DefId ) -> ty:: AssociatedItem ,
1005
1005
1006
- [ ] impl_trait_ref: ImplTraitRef ( DefId ) -> Option <ty:: TraitRef <' tcx>>,
1007
- [ ] impl_polarity: ImplPolarity ( DefId ) -> hir:: ImplPolarity ,
1006
+ [ ] fn impl_trait_ref: ImplTraitRef ( DefId ) -> Option <ty:: TraitRef <' tcx>>,
1007
+ [ ] fn impl_polarity: ImplPolarity ( DefId ) -> hir:: ImplPolarity ,
1008
1008
1009
1009
/// Maps a DefId of a type to a list of its inherent impls.
1010
1010
/// Contains implementations of methods that are inherent to a type.
1011
1011
/// Methods in these implementations don't need to be exported.
1012
- [ ] inherent_impls: InherentImpls ( DefId ) -> Rc <Vec <DefId >>,
1012
+ [ ] fn inherent_impls: InherentImpls ( DefId ) -> Rc <Vec <DefId >>,
1013
1013
1014
1014
/// Set of all the def-ids in this crate that have MIR associated with
1015
1015
/// them. This includes all the body owners, but also things like struct
1016
1016
/// constructors.
1017
- [ ] mir_keys: mir_keys( CrateNum ) -> Rc <DefIdSet >,
1017
+ [ ] fn mir_keys: mir_keys( CrateNum ) -> Rc <DefIdSet >,
1018
1018
1019
1019
/// Maps DefId's that have an associated Mir to the result
1020
1020
/// of the MIR qualify_consts pass. The actual meaning of
1021
1021
/// the value isn't known except to the pass itself.
1022
- [ ] mir_const_qualif: MirConstQualif ( DefId ) -> u8 ,
1022
+ [ ] fn mir_const_qualif: MirConstQualif ( DefId ) -> u8 ,
1023
1023
1024
1024
/// Fetch the MIR for a given def-id up till the point where it is
1025
1025
/// ready for const evaluation.
1026
1026
///
1027
1027
/// See the README for the `mir` module for details.
1028
- [ ] mir_const: MirConst ( DefId ) -> & ' tcx Steal <mir:: Mir <' tcx>>,
1028
+ [ ] fn mir_const: MirConst ( DefId ) -> & ' tcx Steal <mir:: Mir <' tcx>>,
1029
1029
1030
- [ ] mir_validated: MirValidated ( DefId ) -> & ' tcx Steal <mir:: Mir <' tcx>>,
1030
+ [ ] fn mir_validated: MirValidated ( DefId ) -> & ' tcx Steal <mir:: Mir <' tcx>>,
1031
1031
1032
1032
/// MIR after our optimization passes have run. This is MIR that is ready
1033
1033
/// for trans. This is also the only query that can fetch non-local MIR, at present.
1034
- [ ] optimized_mir: MirOptimized ( DefId ) -> & ' tcx mir:: Mir <' tcx>,
1034
+ [ ] fn optimized_mir: MirOptimized ( DefId ) -> & ' tcx mir:: Mir <' tcx>,
1035
1035
1036
1036
/// Type of each closure. The def ID is the ID of the
1037
1037
/// expression defining the closure.
1038
- [ ] closure_kind: ClosureKind ( DefId ) -> ty:: ClosureKind ,
1038
+ [ ] fn closure_kind: ClosureKind ( DefId ) -> ty:: ClosureKind ,
1039
1039
1040
1040
/// The signature of functions and closures.
1041
- [ ] fn_sig: FnSignature ( DefId ) -> ty:: PolyFnSig <' tcx>,
1041
+ [ ] fn fn_sig: FnSignature ( DefId ) -> ty:: PolyFnSig <' tcx>,
1042
1042
1043
1043
/// Records the signature of each generator. The def ID is the ID of the
1044
1044
/// expression defining the closure.
1045
- [ ] generator_sig: GenSignature ( DefId ) -> Option <ty:: PolyGenSig <' tcx>>,
1045
+ [ ] fn generator_sig: GenSignature ( DefId ) -> Option <ty:: PolyGenSig <' tcx>>,
1046
1046
1047
1047
/// Caches CoerceUnsized kinds for impls on custom types.
1048
- [ ] coerce_unsized_info: CoerceUnsizedInfo ( DefId )
1048
+ [ ] fn coerce_unsized_info: CoerceUnsizedInfo ( DefId )
1049
1049
-> ty:: adjustment:: CoerceUnsizedInfo ,
1050
1050
1051
- [ ] typeck_item_bodies: typeck_item_bodies_dep_node( CrateNum ) -> CompileResult ,
1051
+ [ ] fn typeck_item_bodies: typeck_item_bodies_dep_node( CrateNum ) -> CompileResult ,
1052
1052
1053
- [ ] typeck_tables_of: TypeckTables ( DefId ) -> & ' tcx ty:: TypeckTables <' tcx>,
1053
+ [ ] fn typeck_tables_of: TypeckTables ( DefId ) -> & ' tcx ty:: TypeckTables <' tcx>,
1054
1054
1055
- [ ] has_typeck_tables: HasTypeckTables ( DefId ) -> bool ,
1055
+ [ ] fn has_typeck_tables: HasTypeckTables ( DefId ) -> bool ,
1056
1056
1057
- [ ] coherent_trait: coherent_trait_dep_node( ( CrateNum , DefId ) ) -> ( ) ,
1057
+ [ ] fn coherent_trait: coherent_trait_dep_node( ( CrateNum , DefId ) ) -> ( ) ,
1058
1058
1059
- [ ] borrowck: BorrowCheck ( DefId ) -> ( ) ,
1059
+ [ ] fn borrowck: BorrowCheck ( DefId ) -> ( ) ,
1060
1060
// FIXME: shouldn't this return a `Result<(), BorrowckErrors>` instead?
1061
- [ ] mir_borrowck: MirBorrowCheck ( DefId ) -> ( ) ,
1061
+ [ ] fn mir_borrowck: MirBorrowCheck ( DefId ) -> ( ) ,
1062
1062
1063
1063
/// Gets a complete map from all types to their inherent impls.
1064
1064
/// Not meant to be used directly outside of coherence.
1065
1065
/// (Defined only for LOCAL_CRATE)
1066
- [ ] crate_inherent_impls: crate_inherent_impls_dep_node( CrateNum ) -> CrateInherentImpls ,
1066
+ [ ] fn crate_inherent_impls: crate_inherent_impls_dep_node( CrateNum ) -> CrateInherentImpls ,
1067
1067
1068
1068
/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
1069
1069
/// Not meant to be used directly outside of coherence.
1070
1070
/// (Defined only for LOCAL_CRATE)
1071
- [ ] crate_inherent_impls_overlap_check: inherent_impls_overlap_check_dep_node( CrateNum ) -> ( ) ,
1071
+ [ ] fn crate_inherent_impls_overlap_check: inherent_impls_overlap_check_dep_node( CrateNum ) -> ( ) ,
1072
1072
1073
1073
/// Results of evaluating const items or constants embedded in
1074
1074
/// other items (such as enum variant explicit discriminants).
1075
- [ ] const_eval: const_eval_dep_node( ty:: ParamEnvAnd <' tcx, ( DefId , & ' tcx Substs <' tcx>) >)
1075
+ [ ] fn const_eval: const_eval_dep_node( ty:: ParamEnvAnd <' tcx, ( DefId , & ' tcx Substs <' tcx>) >)
1076
1076
-> const_val:: EvalResult <' tcx>,
1077
1077
1078
1078
/// Performs the privacy check and computes "access levels".
1079
- [ ] privacy_access_levels: PrivacyAccessLevels ( CrateNum ) -> Rc <AccessLevels >,
1079
+ [ ] fn privacy_access_levels: PrivacyAccessLevels ( CrateNum ) -> Rc <AccessLevels >,
1080
1080
1081
- [ ] reachable_set: reachability_dep_node( CrateNum ) -> Rc <NodeSet >,
1081
+ [ ] fn reachable_set: reachability_dep_node( CrateNum ) -> Rc <NodeSet >,
1082
1082
1083
1083
/// Per-function `RegionMaps`. The `DefId` should be the owner-def-id for the fn body;
1084
1084
/// in the case of closures or "inline" expressions, this will be redirected to the enclosing
1085
1085
/// fn item.
1086
- [ ] region_maps: RegionMaps ( DefId ) -> Rc <RegionMaps >,
1087
-
1088
- [ ] mir_shims: mir_shim_dep_node( ty:: InstanceDef <' tcx>) -> & ' tcx mir:: Mir <' tcx>,
1089
-
1090
- [ ] def_symbol_name: SymbolName ( DefId ) -> ty:: SymbolName ,
1091
- [ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
1092
-
1093
- [ ] describe_def: DescribeDef ( DefId ) -> Option <Def >,
1094
- [ ] def_span: DefSpan ( DefId ) -> Span ,
1095
- [ ] stability: Stability ( DefId ) -> Option <attr:: Stability >,
1096
- [ ] deprecation: Deprecation ( DefId ) -> Option <attr:: Deprecation >,
1097
- [ ] item_attrs: ItemAttrs ( DefId ) -> Rc <[ ast:: Attribute ] >,
1098
- [ ] fn_arg_names: FnArgNames ( DefId ) -> Vec <ast:: Name >,
1099
- [ ] impl_parent: ImplParent ( DefId ) -> Option <DefId >,
1100
- [ ] trait_of_item: TraitOfItem ( DefId ) -> Option <DefId >,
1101
- [ ] is_exported_symbol: IsExportedSymbol ( DefId ) -> bool ,
1102
- [ ] item_body_nested_bodies: ItemBodyNestedBodies ( DefId ) -> Rc <BTreeMap <hir:: BodyId , hir:: Body >>,
1103
- [ ] const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic ( DefId ) -> bool ,
1104
- [ ] is_mir_available: IsMirAvailable ( DefId ) -> bool ,
1105
-
1106
- [ ] trait_impls_of: TraitImpls ( DefId ) -> Rc <ty:: trait_def:: TraitImpls >,
1107
- [ ] specialization_graph_of: SpecializationGraph ( DefId ) -> Rc <specialization_graph:: Graph >,
1108
- [ ] is_object_safe: ObjectSafety ( DefId ) -> bool ,
1086
+ [ ] fn region_maps: RegionMaps ( DefId ) -> Rc <RegionMaps >,
1087
+
1088
+ [ ] fn mir_shims: mir_shim_dep_node( ty:: InstanceDef <' tcx>) -> & ' tcx mir:: Mir <' tcx>,
1089
+
1090
+ [ ] fn def_symbol_name: SymbolName ( DefId ) -> ty:: SymbolName ,
1091
+ [ ] fn symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
1092
+
1093
+ [ ] fn describe_def: DescribeDef ( DefId ) -> Option <Def >,
1094
+ [ ] fn def_span: DefSpan ( DefId ) -> Span ,
1095
+ [ ] fn stability: Stability ( DefId ) -> Option <attr:: Stability >,
1096
+ [ ] fn deprecation: Deprecation ( DefId ) -> Option <attr:: Deprecation >,
1097
+ [ ] fn item_attrs: ItemAttrs ( DefId ) -> Rc <[ ast:: Attribute ] >,
1098
+ [ ] fn fn_arg_names: FnArgNames ( DefId ) -> Vec <ast:: Name >,
1099
+ [ ] fn impl_parent: ImplParent ( DefId ) -> Option <DefId >,
1100
+ [ ] fn trait_of_item: TraitOfItem ( DefId ) -> Option <DefId >,
1101
+ [ ] fn is_exported_symbol: IsExportedSymbol ( DefId ) -> bool ,
1102
+ [ ] fn item_body_nested_bodies: ItemBodyNestedBodies ( DefId )
1103
+ -> Rc <BTreeMap <hir:: BodyId , hir:: Body >>,
1104
+ [ ] fn const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic ( DefId ) -> bool ,
1105
+ [ ] fn is_mir_available: IsMirAvailable ( DefId ) -> bool ,
1106
+
1107
+ [ ] fn trait_impls_of: TraitImpls ( DefId ) -> Rc <ty:: trait_def:: TraitImpls >,
1108
+ [ ] fn specialization_graph_of: SpecializationGraph ( DefId ) -> Rc <specialization_graph:: Graph >,
1109
+ [ ] fn is_object_safe: ObjectSafety ( DefId ) -> bool ,
1109
1110
1110
1111
// Get the ParameterEnvironment for a given item; this environment
1111
1112
// will be in "user-facing" mode, meaning that it is suitabe for
1112
1113
// type-checking etc, and it does not normalize specializable
1113
1114
// associated types. This is almost always what you want,
1114
1115
// unless you are doing MIR optimizations, in which case you
1115
1116
// might want to use `reveal_all()` method to change modes.
1116
- [ ] param_env: ParamEnv ( DefId ) -> ty:: ParamEnv <' tcx>,
1117
+ [ ] fn param_env: ParamEnv ( DefId ) -> ty:: ParamEnv <' tcx>,
1117
1118
1118
1119
// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
1119
1120
// `ty.is_copy()`, etc, since that will prune the environment where possible.
1120
- [ ] is_copy_raw: is_copy_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1121
- [ ] is_sized_raw: is_sized_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1122
- [ ] is_freeze_raw: is_freeze_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1123
- [ ] needs_drop_raw: needs_drop_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1124
- [ ] layout_raw: layout_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>)
1121
+ [ ] fn is_copy_raw: is_copy_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1122
+ [ ] fn is_sized_raw: is_sized_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1123
+ [ ] fn is_freeze_raw: is_freeze_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1124
+ [ ] fn needs_drop_raw: needs_drop_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>) -> bool ,
1125
+ [ ] fn layout_raw: layout_dep_node( ty:: ParamEnvAnd <' tcx, Ty <' tcx>>)
1125
1126
-> Result <& ' tcx Layout , LayoutError <' tcx>>,
1126
1127
1127
- [ ] dylib_dependency_formats: DylibDepFormats ( DefId )
1128
+ [ ] fn dylib_dependency_formats: DylibDepFormats ( DefId )
1128
1129
-> Rc <Vec <( CrateNum , LinkagePreference ) >>,
1129
1130
1130
- [ ] is_allocator: IsAllocator ( DefId ) -> bool ,
1131
- [ ] is_panic_runtime: IsPanicRuntime ( DefId ) -> bool ,
1132
- [ ] is_compiler_builtins: IsCompilerBuiltins ( DefId ) -> bool ,
1133
- [ ] has_global_allocator: HasGlobalAllocator ( DefId ) -> bool ,
1131
+ [ ] fn is_allocator: IsAllocator ( DefId ) -> bool ,
1132
+ [ ] fn is_panic_runtime: IsPanicRuntime ( DefId ) -> bool ,
1133
+ [ ] fn is_compiler_builtins: IsCompilerBuiltins ( DefId ) -> bool ,
1134
+ [ ] fn has_global_allocator: HasGlobalAllocator ( DefId ) -> bool ,
1134
1135
1135
- [ ] extern_crate: ExternCrate ( DefId ) -> Rc <Option <ExternCrate >>,
1136
+ [ ] fn extern_crate: ExternCrate ( DefId ) -> Rc <Option <ExternCrate >>,
1136
1137
1137
- [ ] lint_levels: lint_levels( CrateNum ) -> Rc <lint:: LintLevelMap >,
1138
+ [ ] fn lint_levels: lint_levels( CrateNum ) -> Rc <lint:: LintLevelMap >,
1138
1139
1139
- [ ] specializes: specializes_node( ( DefId , DefId ) ) -> bool ,
1140
- [ ] in_scope_traits: InScopeTraits ( HirId ) -> Option <Rc <Vec <TraitCandidate >>>,
1141
- [ ] module_exports: ModuleExports ( HirId ) -> Option <Rc <Vec <Export >>>,
1140
+ [ ] fn specializes: specializes_node( ( DefId , DefId ) ) -> bool ,
1141
+ [ ] fn in_scope_traits: InScopeTraits ( HirId ) -> Option <Rc <Vec <TraitCandidate >>>,
1142
+ [ ] fn module_exports: ModuleExports ( HirId ) -> Option <Rc <Vec <Export >>>,
1142
1143
}
1143
1144
1144
1145
fn type_param_predicates < ' tcx > ( ( item_id, param_id) : ( DefId , DefId ) ) -> DepConstructor < ' tcx > {
0 commit comments