1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use dep_graph
::{DepConstructor, DepNode}
;
12 use hir
::def_id
::{CrateNum, DefId, DefIndex}
;
13 use hir
::def
::{Def, Export}
;
14 use hir
::{self, TraitCandidate, ItemLocalId, TransFnAttrs}
;
16 use infer
::canonical
::{self, Canonical}
;
18 use middle
::borrowck
::BorrowCheckResult
;
19 use middle
::cstore
::{ExternCrate, LinkagePreference, NativeLibrary, ForeignModule}
;
20 use middle
::cstore
::{NativeLibraryKind, DepKind, CrateSource}
;
21 use middle
::privacy
::AccessLevels
;
22 use middle
::reachable
::ReachableSet
;
24 use middle
::resolve_lifetime
::{ResolveLifetimes, Region, ObjectLifetimeDefault}
;
25 use middle
::stability
::{self, DeprecationEntry}
;
26 use middle
::lang_items
::{LanguageItems, LangItem}
;
27 use middle
::exported_symbols
::{SymbolExportLevel, ExportedSymbol}
;
28 use middle
::const_val
::EvalResult
;
29 use mir
::mono
::{CodegenUnit, Stats}
;
31 use mir
::interpret
::{GlobalId}
;
32 use session
::{CompileResult, CrateDisambiguator}
;
33 use session
::config
::OutputFilenames
;
34 use traits
::{self, Vtable}
;
35 use traits
::query
::{CanonicalPredicateGoal
, CanonicalProjectionGoal
,
36 CanonicalTyGoal
, NoSolution
};
37 use traits
::query
::dropck_outlives
::{DtorckConstraint, DropckOutlivesResult}
;
38 use traits
::query
::normalize
::NormalizationResult
;
39 use traits
::specialization_graph
;
41 use ty
::{self, CrateInherentImpls, ParamEnvAnd, Ty, TyCtxt}
;
43 use ty
::subst
::Substs
;
44 use util
::nodemap
::{DefIdSet, DefIdMap, ItemLocalSet}
;
45 use util
::common
::{ErrorReported}
;
47 use rustc_data_structures
::indexed_set
::IdxSetBuf
;
48 use rustc_target
::spec
::PanicStrategy
;
49 use rustc_data_structures
::indexed_vec
::IndexVec
;
50 use rustc_data_structures
::fx
::{FxHashMap, FxHashSet}
;
51 use rustc_data_structures
::stable_hasher
::StableVec
;
54 use rustc_data_structures
::sync
::Lrc
;
56 use syntax_pos
::{Span, DUMMY_SP}
;
57 use syntax_pos
::symbol
::InternedString
;
60 use syntax
::feature_gate
;
61 use syntax
::symbol
::Symbol
;
65 use self::plumbing
::*;
66 pub use self::plumbing
::force_from_dep_node
;
69 pub use self::job
::{QueryJob, QueryInfo}
;
72 pub use self::keys
::Key
;
75 use self::values
::Value
;
78 pub use self::config
::QueryConfig
;
79 use self::config
::QueryDescription
;
82 pub use self::on_disk_cache
::OnDiskCache
;
84 // Each of these maps also corresponds to a method on a
85 // `Provider` trait for requesting a value of that type,
86 // and a method on `Maps` itself for doing that in a
87 // a way that memoizes and does dep-graph tracking,
88 // wrapping around the actual chain of providers that
89 // the driver creates (using several `rustc_*` crates).
91 // The result of query must implement Clone. They must also implement ty::maps::values::Value
92 // which produces an appropriate error value if the query resulted in a query cycle.
93 // Queries marked with `fatal_cycle` do not need that implementation
94 // as they will raise an fatal error on query cycles instead.
96 /// Records the type of every item.
97 [] fn type_of
: TypeOfItem(DefId
) -> Ty
<'tcx
>,
99 /// Maps from the def-id of an item (trait/struct/enum/fn) to its
100 /// associated generics and predicates.
101 [] fn generics_of
: GenericsOfItem(DefId
) -> &'tcx ty
::Generics
,
102 [] fn predicates_of
: PredicatesOfItem(DefId
) -> ty
::GenericPredicates
<'tcx
>,
103 [] fn explicit_predicates_of
: PredicatesOfItem(DefId
) -> ty
::GenericPredicates
<'tcx
>,
105 /// Maps from the def-id of a trait to the list of
106 /// super-predicates. This is a subset of the full list of
107 /// predicates. We store these in a separate map because we must
108 /// evaluate them even during type conversion, often before the
109 /// full predicates are available (note that supertraits have
110 /// additional acyclicity requirements).
111 [] fn super_predicates_of
: SuperPredicatesOfItem(DefId
) -> ty
::GenericPredicates
<'tcx
>,
113 /// To avoid cycles within the predicates of a single item we compute
114 /// per-type-parameter predicates for resolving `T::AssocTy`.
115 [] fn type_param_predicates
: type_param_predicates((DefId
, DefId
))
116 -> ty
::GenericPredicates
<'tcx
>,
118 [] fn trait_def
: TraitDefOfItem(DefId
) -> &'tcx ty
::TraitDef
,
119 [] fn adt_def
: AdtDefOfItem(DefId
) -> &'tcx ty
::AdtDef
,
120 [] fn adt_destructor
: AdtDestructor(DefId
) -> Option
<ty
::Destructor
>,
121 [] fn adt_sized_constraint
: SizedConstraint(DefId
) -> &'tcx
[Ty
<'tcx
>],
122 [] fn adt_dtorck_constraint
: DtorckConstraint(
124 ) -> Result
<DtorckConstraint
<'tcx
>, NoSolution
>,
126 /// True if this is a const fn
127 [] fn is_const_fn
: IsConstFn(DefId
) -> bool
,
129 /// True if this is a foreign item (i.e., linked via `extern { ... }`).
130 [] fn is_foreign_item
: IsForeignItem(DefId
) -> bool
,
132 /// Get a map with the variance of every item; use `item_variance`
134 [] fn crate_variances
: crate_variances(CrateNum
) -> Lrc
<ty
::CrateVariancesMap
>,
136 /// Maps from def-id of a type or region parameter to its
137 /// (inferred) variance.
138 [] fn variances_of
: ItemVariances(DefId
) -> Lrc
<Vec
<ty
::Variance
>>,
140 /// Maps from def-id of a type to its (inferred) outlives.
141 [] fn inferred_outlives_of
: InferredOutlivesOf(DefId
) -> Lrc
<Vec
<ty
::Predicate
<'tcx
>>>,
143 /// Maps from def-id of a type to its (inferred) outlives.
144 [] fn inferred_outlives_crate
: InferredOutlivesCrate(CrateNum
)
145 -> Lrc
<ty
::CratePredicatesMap
<'tcx
>>,
147 /// Maps from an impl/trait def-id to a list of the def-ids of its items
148 [] fn associated_item_def_ids
: AssociatedItemDefIds(DefId
) -> Lrc
<Vec
<DefId
>>,
150 /// Maps from a trait item to the trait item "descriptor"
151 [] fn associated_item
: AssociatedItems(DefId
) -> ty
::AssociatedItem
,
153 [] fn impl_trait_ref
: ImplTraitRef(DefId
) -> Option
<ty
::TraitRef
<'tcx
>>,
154 [] fn impl_polarity
: ImplPolarity(DefId
) -> hir
::ImplPolarity
,
156 /// Maps a DefId of a type to a list of its inherent impls.
157 /// Contains implementations of methods that are inherent to a type.
158 /// Methods in these implementations don't need to be exported.
159 [] fn inherent_impls
: InherentImpls(DefId
) -> Lrc
<Vec
<DefId
>>,
161 /// Set of all the def-ids in this crate that have MIR associated with
162 /// them. This includes all the body owners, but also things like struct
164 [] fn mir_keys
: mir_keys(CrateNum
) -> Lrc
<DefIdSet
>,
166 /// Maps DefId's that have an associated Mir to the result
167 /// of the MIR qualify_consts pass. The actual meaning of
168 /// the value isn't known except to the pass itself.
169 [] fn mir_const_qualif
: MirConstQualif(DefId
) -> (u8, Lrc
<IdxSetBuf
<mir
::Local
>>),
171 /// Fetch the MIR for a given def-id right after it's built - this includes
172 /// unreachable code.
173 [] fn mir_built
: MirBuilt(DefId
) -> &'tcx Steal
<mir
::Mir
<'tcx
>>,
175 /// Fetch the MIR for a given def-id up till the point where it is
176 /// ready for const evaluation.
178 /// See the README for the `mir` module for details.
179 [] fn mir_const
: MirConst(DefId
) -> &'tcx Steal
<mir
::Mir
<'tcx
>>,
181 [] fn mir_validated
: MirValidated(DefId
) -> &'tcx Steal
<mir
::Mir
<'tcx
>>,
183 /// MIR after our optimization passes have run. This is MIR that is ready
184 /// for trans. This is also the only query that can fetch non-local MIR, at present.
185 [] fn optimized_mir
: MirOptimized(DefId
) -> &'tcx mir
::Mir
<'tcx
>,
187 /// The result of unsafety-checking this def-id.
188 [] fn unsafety_check_result
: UnsafetyCheckResult(DefId
) -> mir
::UnsafetyCheckResult
,
190 /// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error
191 [] fn unsafe_derive_on_repr_packed
: UnsafeDeriveOnReprPacked(DefId
) -> (),
193 /// The signature of functions and closures.
194 [] fn fn_sig
: FnSignature(DefId
) -> ty
::PolyFnSig
<'tcx
>,
196 /// Caches CoerceUnsized kinds for impls on custom types.
197 [] fn coerce_unsized_info
: CoerceUnsizedInfo(DefId
)
198 -> ty
::adjustment
::CoerceUnsizedInfo
,
200 [] fn typeck_item_bodies
: typeck_item_bodies_dep_node(CrateNum
) -> CompileResult
,
202 [] fn typeck_tables_of
: TypeckTables(DefId
) -> &'tcx ty
::TypeckTables
<'tcx
>,
204 [] fn used_trait_imports
: UsedTraitImports(DefId
) -> Lrc
<DefIdSet
>,
206 [] fn has_typeck_tables
: HasTypeckTables(DefId
) -> bool
,
208 [] fn coherent_trait
: CoherenceCheckTrait(DefId
) -> (),
210 [] fn borrowck
: BorrowCheck(DefId
) -> Lrc
<BorrowCheckResult
>,
212 /// Borrow checks the function body. If this is a closure, returns
213 /// additional requirements that the closure's creator must verify.
214 [] fn mir_borrowck
: MirBorrowCheck(DefId
) -> mir
::BorrowCheckResult
<'tcx
>,
216 /// Gets a complete map from all types to their inherent impls.
217 /// Not meant to be used directly outside of coherence.
218 /// (Defined only for LOCAL_CRATE)
219 [] fn crate_inherent_impls
: crate_inherent_impls_dep_node(CrateNum
) -> CrateInherentImpls
,
221 /// Checks all types in the krate for overlap in their inherent impls. Reports errors.
222 /// Not meant to be used directly outside of coherence.
223 /// (Defined only for LOCAL_CRATE)
224 [] fn crate_inherent_impls_overlap_check
: inherent_impls_overlap_check_dep_node(CrateNum
) -> (),
226 /// Results of evaluating const items or constants embedded in
227 /// other items (such as enum variant explicit discriminants).
228 [] fn const_eval
: const_eval_dep_node(ty
::ParamEnvAnd
<'tcx
, GlobalId
<'tcx
>>)
231 [] fn check_match
: CheckMatch(DefId
)
232 -> Result
<(), ErrorReported
>,
234 /// Performs the privacy check and computes "access levels".
235 [] fn privacy_access_levels
: PrivacyAccessLevels(CrateNum
) -> Lrc
<AccessLevels
>,
237 [] fn reachable_set
: reachability_dep_node(CrateNum
) -> ReachableSet
,
239 /// Per-body `region::ScopeTree`. The `DefId` should be the owner-def-id for the body;
240 /// in the case of closures, this will be redirected to the enclosing function.
241 [] fn region_scope_tree
: RegionScopeTree(DefId
) -> Lrc
<region
::ScopeTree
>,
243 [] fn mir_shims
: mir_shim_dep_node(ty
::InstanceDef
<'tcx
>) -> &'tcx mir
::Mir
<'tcx
>,
245 [] fn def_symbol_name
: SymbolName(DefId
) -> ty
::SymbolName
,
246 [] fn symbol_name
: symbol_name_dep_node(ty
::Instance
<'tcx
>) -> ty
::SymbolName
,
248 [] fn describe_def
: DescribeDef(DefId
) -> Option
<Def
>,
249 [] fn def_span
: DefSpan(DefId
) -> Span
,
250 [] fn lookup_stability
: LookupStability(DefId
) -> Option
<&'tcx attr
::Stability
>,
251 [] fn lookup_deprecation_entry
: LookupDeprecationEntry(DefId
) -> Option
<DeprecationEntry
>,
252 [] fn item_attrs
: ItemAttrs(DefId
) -> Lrc
<[ast
::Attribute
]>,
253 [] fn trans_fn_attrs
: trans_fn_attrs(DefId
) -> TransFnAttrs
,
254 [] fn fn_arg_names
: FnArgNames(DefId
) -> Vec
<ast
::Name
>,
255 /// Gets the rendered value of the specified constant or associated constant.
257 [] fn rendered_const
: RenderedConst(DefId
) -> String
,
258 [] fn impl_parent
: ImplParent(DefId
) -> Option
<DefId
>,
259 [] fn trait_of_item
: TraitOfItem(DefId
) -> Option
<DefId
>,
260 [] fn const_is_rvalue_promotable_to_static
: ConstIsRvaluePromotableToStatic(DefId
) -> bool
,
261 [] fn rvalue_promotable_map
: RvaluePromotableMap(DefId
) -> Lrc
<ItemLocalSet
>,
262 [] fn is_mir_available
: IsMirAvailable(DefId
) -> bool
,
263 [] fn vtable_methods
: vtable_methods_node(ty
::PolyTraitRef
<'tcx
>)
264 -> Lrc
<Vec
<Option
<(DefId
, &'tcx Substs
<'tcx
>)>>>,
266 [] fn trans_fulfill_obligation
: fulfill_obligation_dep_node(
267 (ty
::ParamEnv
<'tcx
>, ty
::PolyTraitRef
<'tcx
>)) -> Vtable
<'tcx
, ()>,
268 [] fn trait_impls_of
: TraitImpls(DefId
) -> Lrc
<ty
::trait_def
::TraitImpls
>,
269 [] fn specialization_graph_of
: SpecializationGraph(DefId
) -> Lrc
<specialization_graph
::Graph
>,
270 [] fn is_object_safe
: ObjectSafety(DefId
) -> bool
,
272 // Get the ParameterEnvironment for a given item; this environment
273 // will be in "user-facing" mode, meaning that it is suitabe for
274 // type-checking etc, and it does not normalize specializable
275 // associated types. This is almost always what you want,
276 // unless you are doing MIR optimizations, in which case you
277 // might want to use `reveal_all()` method to change modes.
278 [] fn param_env
: ParamEnv(DefId
) -> ty
::ParamEnv
<'tcx
>,
280 // Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
281 // `ty.is_copy()`, etc, since that will prune the environment where possible.
282 [] fn is_copy_raw
: is_copy_dep_node(ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> bool
,
283 [] fn is_sized_raw
: is_sized_dep_node(ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> bool
,
284 [] fn is_freeze_raw
: is_freeze_dep_node(ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> bool
,
285 [] fn needs_drop_raw
: needs_drop_dep_node(ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> bool
,
286 [] fn layout_raw
: layout_dep_node(ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>)
287 -> Result
<&'tcx ty
::layout
::LayoutDetails
,
288 ty
::layout
::LayoutError
<'tcx
>>,
290 [] fn dylib_dependency_formats
: DylibDepFormats(CrateNum
)
291 -> Lrc
<Vec
<(CrateNum
, LinkagePreference
)>>,
293 [fatal_cycle
] fn is_panic_runtime
: IsPanicRuntime(CrateNum
) -> bool
,
294 [fatal_cycle
] fn is_compiler_builtins
: IsCompilerBuiltins(CrateNum
) -> bool
,
295 [fatal_cycle
] fn has_global_allocator
: HasGlobalAllocator(CrateNum
) -> bool
,
296 [fatal_cycle
] fn is_sanitizer_runtime
: IsSanitizerRuntime(CrateNum
) -> bool
,
297 [fatal_cycle
] fn is_profiler_runtime
: IsProfilerRuntime(CrateNum
) -> bool
,
298 [fatal_cycle
] fn panic_strategy
: GetPanicStrategy(CrateNum
) -> PanicStrategy
,
299 [fatal_cycle
] fn is_no_builtins
: IsNoBuiltins(CrateNum
) -> bool
,
301 [] fn extern_crate
: ExternCrate(DefId
) -> Lrc
<Option
<ExternCrate
>>,
303 [] fn specializes
: specializes_node((DefId
, DefId
)) -> bool
,
304 [] fn in_scope_traits_map
: InScopeTraits(DefIndex
)
305 -> Option
<Lrc
<FxHashMap
<ItemLocalId
, Lrc
<StableVec
<TraitCandidate
>>>>>,
306 [] fn module_exports
: ModuleExports(DefId
) -> Option
<Lrc
<Vec
<Export
>>>,
307 [] fn lint_levels
: lint_levels_node(CrateNum
) -> Lrc
<lint
::LintLevelMap
>,
309 [] fn impl_defaultness
: ImplDefaultness(DefId
) -> hir
::Defaultness
,
311 [] fn check_item_well_formed
: CheckItemWellFormed(DefId
) -> (),
312 [] fn check_trait_item_well_formed
: CheckTraitItemWellFormed(DefId
) -> (),
313 [] fn check_impl_item_well_formed
: CheckImplItemWellFormed(DefId
) -> (),
315 // The DefIds of all non-generic functions and statics in the given crate
316 // that can be reached from outside the crate.
318 // We expect this items to be available for being linked to.
320 // This query can also be called for LOCAL_CRATE. In this case it will
321 // compute which items will be reachable to other crates, taking into account
322 // the kind of crate that is currently compiled. Crates with only a
323 // C interface have fewer reachable things.
325 // Does not include external symbols that don't have a corresponding DefId,
326 // like the compiler-generated `main` function and so on.
327 [] fn reachable_non_generics
: ReachableNonGenerics(CrateNum
)
328 -> Lrc
<DefIdMap
<SymbolExportLevel
>>,
329 [] fn is_reachable_non_generic
: IsReachableNonGeneric(DefId
) -> bool
,
330 [] fn is_unreachable_local_definition
: IsUnreachableLocalDefinition(DefId
) -> bool
,
332 [] fn upstream_monomorphizations
: UpstreamMonomorphizations(CrateNum
)
333 -> Lrc
<DefIdMap
<Lrc
<FxHashMap
<&'tcx Substs
<'tcx
>, CrateNum
>>>>,
334 [] fn upstream_monomorphizations_for
: UpstreamMonomorphizationsFor(DefId
)
335 -> Option
<Lrc
<FxHashMap
<&'tcx Substs
<'tcx
>, CrateNum
>>>,
337 [] fn native_libraries
: NativeLibraries(CrateNum
) -> Lrc
<Vec
<NativeLibrary
>>,
339 [] fn foreign_modules
: ForeignModules(CrateNum
) -> Lrc
<Vec
<ForeignModule
>>,
341 [] fn plugin_registrar_fn
: PluginRegistrarFn(CrateNum
) -> Option
<DefId
>,
342 [] fn derive_registrar_fn
: DeriveRegistrarFn(CrateNum
) -> Option
<DefId
>,
343 [] fn crate_disambiguator
: CrateDisambiguator(CrateNum
) -> CrateDisambiguator
,
344 [] fn crate_hash
: CrateHash(CrateNum
) -> Svh
,
345 [] fn original_crate_name
: OriginalCrateName(CrateNum
) -> Symbol
,
346 [] fn extra_filename
: ExtraFileName(CrateNum
) -> String
,
348 [] fn implementations_of_trait
: implementations_of_trait_node((CrateNum
, DefId
))
350 [] fn all_trait_implementations
: AllTraitImplementations(CrateNum
)
353 [] fn dllimport_foreign_items
: DllimportForeignItems(CrateNum
)
354 -> Lrc
<FxHashSet
<DefId
>>,
355 [] fn is_dllimport_foreign_item
: IsDllimportForeignItem(DefId
) -> bool
,
356 [] fn is_statically_included_foreign_item
: IsStaticallyIncludedForeignItem(DefId
) -> bool
,
357 [] fn native_library_kind
: NativeLibraryKind(DefId
)
358 -> Option
<NativeLibraryKind
>,
359 [] fn link_args
: link_args_node(CrateNum
) -> Lrc
<Vec
<String
>>,
361 // Lifetime resolution. See `middle::resolve_lifetimes`.
362 [] fn resolve_lifetimes
: ResolveLifetimes(CrateNum
) -> Lrc
<ResolveLifetimes
>,
363 [] fn named_region_map
: NamedRegion(DefIndex
) ->
364 Option
<Lrc
<FxHashMap
<ItemLocalId
, Region
>>>,
365 [] fn is_late_bound_map
: IsLateBound(DefIndex
) ->
366 Option
<Lrc
<FxHashSet
<ItemLocalId
>>>,
367 [] fn object_lifetime_defaults_map
: ObjectLifetimeDefaults(DefIndex
)
368 -> Option
<Lrc
<FxHashMap
<ItemLocalId
, Lrc
<Vec
<ObjectLifetimeDefault
>>>>>,
370 [] fn visibility
: Visibility(DefId
) -> ty
::Visibility
,
371 [] fn dep_kind
: DepKind(CrateNum
) -> DepKind
,
372 [] fn crate_name
: CrateName(CrateNum
) -> Symbol
,
373 [] fn item_children
: ItemChildren(DefId
) -> Lrc
<Vec
<Export
>>,
374 [] fn extern_mod_stmt_cnum
: ExternModStmtCnum(DefId
) -> Option
<CrateNum
>,
376 [] fn get_lang_items
: get_lang_items_node(CrateNum
) -> Lrc
<LanguageItems
>,
377 [] fn defined_lang_items
: DefinedLangItems(CrateNum
) -> Lrc
<Vec
<(DefId
, usize)>>,
378 [] fn missing_lang_items
: MissingLangItems(CrateNum
) -> Lrc
<Vec
<LangItem
>>,
379 [] fn visible_parent_map
: visible_parent_map_node(CrateNum
)
380 -> Lrc
<DefIdMap
<DefId
>>,
381 [] fn missing_extern_crate_item
: MissingExternCrateItem(CrateNum
) -> bool
,
382 [] fn used_crate_source
: UsedCrateSource(CrateNum
) -> Lrc
<CrateSource
>,
383 [] fn postorder_cnums
: postorder_cnums_node(CrateNum
) -> Lrc
<Vec
<CrateNum
>>,
385 [] fn freevars
: Freevars(DefId
) -> Option
<Lrc
<Vec
<hir
::Freevar
>>>,
386 [] fn maybe_unused_trait_import
: MaybeUnusedTraitImport(DefId
) -> bool
,
387 [] fn maybe_unused_extern_crates
: maybe_unused_extern_crates_node(CrateNum
)
388 -> Lrc
<Vec
<(DefId
, Span
)>>,
390 [] fn stability_index
: stability_index_node(CrateNum
) -> Lrc
<stability
::Index
<'tcx
>>,
391 [] fn all_crate_nums
: all_crate_nums_node(CrateNum
) -> Lrc
<Vec
<CrateNum
>>,
393 /// A vector of every trait accessible in the whole crate
394 /// (i.e. including those from subcrates). This is used only for
396 [] fn all_traits
: all_traits_node(CrateNum
) -> Lrc
<Vec
<DefId
>>,
398 [] fn exported_symbols
: ExportedSymbols(CrateNum
)
399 -> Arc
<Vec
<(ExportedSymbol
<'tcx
>, SymbolExportLevel
)>>,
400 [] fn collect_and_partition_translation_items
:
401 collect_and_partition_translation_items_node(CrateNum
)
402 -> (Arc
<DefIdSet
>, Arc
<Vec
<Arc
<CodegenUnit
<'tcx
>>>>),
403 [] fn is_translated_item
: IsTranslatedItem(DefId
) -> bool
,
404 [] fn codegen_unit
: CodegenUnit(InternedString
) -> Arc
<CodegenUnit
<'tcx
>>,
405 [] fn compile_codegen_unit
: CompileCodegenUnit(InternedString
) -> Stats
,
406 [] fn output_filenames
: output_filenames_node(CrateNum
)
407 -> Arc
<OutputFilenames
>,
409 // Erases regions from `ty` to yield a new type.
410 // Normally you would just use `tcx.erase_regions(&value)`,
411 // however, which uses this query as a kind of cache.
412 [] fn erase_regions_ty
: erase_regions_ty(Ty
<'tcx
>) -> Ty
<'tcx
>,
414 /// Do not call this query directly: invoke `normalize` instead.
415 [] fn normalize_projection_ty
: NormalizeProjectionTy(
416 CanonicalProjectionGoal
<'tcx
>
418 Lrc
<Canonical
<'tcx
, canonical
::QueryResult
<'tcx
, NormalizationResult
<'tcx
>>>>,
422 /// Do not call this query directly: invoke `normalize_erasing_regions` instead.
423 [] fn normalize_ty_after_erasing_regions
: NormalizeTyAfterErasingRegions(
424 ParamEnvAnd
<'tcx
, Ty
<'tcx
>>
427 /// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead.
428 [] fn dropck_outlives
: DropckOutlives(
429 CanonicalTyGoal
<'tcx
>
431 Lrc
<Canonical
<'tcx
, canonical
::QueryResult
<'tcx
, DropckOutlivesResult
<'tcx
>>>>,
435 /// Do not call this query directly: invoke `infcx.predicate_may_hold()` or
436 /// `infcx.predicate_must_hold()` instead.
437 [] fn evaluate_obligation
: EvaluateObligation(
438 CanonicalPredicateGoal
<'tcx
>
439 ) -> Result
<traits
::EvaluationResult
, traits
::OverflowError
>,
441 [] fn substitute_normalize_and_test_predicates
:
442 substitute_normalize_and_test_predicates_node((DefId
, &'tcx Substs
<'tcx
>)) -> bool
,
444 [] fn target_features_whitelist
:
445 target_features_whitelist_node(CrateNum
) -> Lrc
<FxHashMap
<String
, Option
<String
>>>,
447 // Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning.
448 [] fn instance_def_size_estimate
: instance_def_size_estimate_dep_node(ty
::InstanceDef
<'tcx
>)
451 [] fn features_query
: features_node(CrateNum
) -> Lrc
<feature_gate
::Features
>,
453 [] fn program_clauses_for
: ProgramClausesFor(DefId
) -> Clauses
<'tcx
>,
455 [] fn program_clauses_for_env
: ProgramClausesForEnv(
459 [] fn wasm_custom_sections
: WasmCustomSections(CrateNum
) -> Lrc
<Vec
<DefId
>>,
460 [] fn wasm_import_module_map
: WasmImportModuleMap(CrateNum
)
461 -> Lrc
<FxHashMap
<DefId
, String
>>,
464 //////////////////////////////////////////////////////////////////////
465 // These functions are little shims used to find the dep-node for a
466 // given query when there is not a *direct* mapping:
469 fn features_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
470 DepConstructor
::Features
473 fn trans_fn_attrs
<'tcx
>(id
: DefId
) -> DepConstructor
<'tcx
> {
474 DepConstructor
::TransFnAttrs { 0: id }
477 fn erase_regions_ty
<'tcx
>(ty
: Ty
<'tcx
>) -> DepConstructor
<'tcx
> {
478 DepConstructor
::EraseRegionsTy { ty }
481 fn type_param_predicates
<'tcx
>((item_id
, param_id
): (DefId
, DefId
)) -> DepConstructor
<'tcx
> {
482 DepConstructor
::TypeParamPredicates
{
488 fn fulfill_obligation_dep_node
<'tcx
>((param_env
, trait_ref
):
489 (ty
::ParamEnv
<'tcx
>, ty
::PolyTraitRef
<'tcx
>)) -> DepConstructor
<'tcx
> {
490 DepConstructor
::FulfillObligation
{
496 fn crate_inherent_impls_dep_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
497 DepConstructor
::Coherence
500 fn inherent_impls_overlap_check_dep_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
501 DepConstructor
::CoherenceInherentImplOverlapCheck
504 fn reachability_dep_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
505 DepConstructor
::Reachability
508 fn mir_shim_dep_node
<'tcx
>(instance_def
: ty
::InstanceDef
<'tcx
>) -> DepConstructor
<'tcx
> {
509 DepConstructor
::MirShim
{
514 fn symbol_name_dep_node
<'tcx
>(instance
: ty
::Instance
<'tcx
>) -> DepConstructor
<'tcx
> {
515 DepConstructor
::InstanceSymbolName { instance }
518 fn typeck_item_bodies_dep_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
519 DepConstructor
::TypeckBodiesKrate
522 fn const_eval_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, GlobalId
<'tcx
>>)
523 -> DepConstructor
<'tcx
> {
524 DepConstructor
::ConstEval { param_env }
527 fn mir_keys
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
528 DepConstructor
::MirKeys
531 fn crate_variances
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
532 DepConstructor
::CrateVariances
535 fn is_copy_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> DepConstructor
<'tcx
> {
536 DepConstructor
::IsCopy { param_env }
539 fn is_sized_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> DepConstructor
<'tcx
> {
540 DepConstructor
::IsSized { param_env }
543 fn is_freeze_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> DepConstructor
<'tcx
> {
544 DepConstructor
::IsFreeze { param_env }
547 fn needs_drop_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> DepConstructor
<'tcx
> {
548 DepConstructor
::NeedsDrop { param_env }
551 fn layout_dep_node
<'tcx
>(param_env
: ty
::ParamEnvAnd
<'tcx
, Ty
<'tcx
>>) -> DepConstructor
<'tcx
> {
552 DepConstructor
::Layout { param_env }
555 fn lint_levels_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
556 DepConstructor
::LintLevels
559 fn specializes_node
<'tcx
>((a
, b
): (DefId
, DefId
)) -> DepConstructor
<'tcx
> {
560 DepConstructor
::Specializes { impl1: a, impl2: b }
563 fn implementations_of_trait_node
<'tcx
>((krate
, trait_id
): (CrateNum
, DefId
))
564 -> DepConstructor
<'tcx
>
566 DepConstructor
::ImplementationsOfTrait { krate, trait_id }
569 fn link_args_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
570 DepConstructor
::LinkArgs
573 fn get_lang_items_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
574 DepConstructor
::GetLangItems
577 fn visible_parent_map_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
578 DepConstructor
::VisibleParentMap
581 fn postorder_cnums_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
582 DepConstructor
::PostorderCnums
585 fn maybe_unused_extern_crates_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
586 DepConstructor
::MaybeUnusedExternCrates
589 fn stability_index_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
590 DepConstructor
::StabilityIndex
593 fn all_crate_nums_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
594 DepConstructor
::AllCrateNums
597 fn all_traits_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
598 DepConstructor
::AllTraits
601 fn collect_and_partition_translation_items_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
602 DepConstructor
::CollectAndPartitionTranslationItems
605 fn output_filenames_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
606 DepConstructor
::OutputFilenames
609 fn vtable_methods_node
<'tcx
>(trait_ref
: ty
::PolyTraitRef
<'tcx
>) -> DepConstructor
<'tcx
> {
610 DepConstructor
::VtableMethods{ trait_ref }
613 fn substitute_normalize_and_test_predicates_node
<'tcx
>(key
: (DefId
, &'tcx Substs
<'tcx
>))
614 -> DepConstructor
<'tcx
> {
615 DepConstructor
::SubstituteNormalizeAndTestPredicates { key }
618 fn target_features_whitelist_node
<'tcx
>(_
: CrateNum
) -> DepConstructor
<'tcx
> {
619 DepConstructor
::TargetFeaturesWhitelist
622 fn instance_def_size_estimate_dep_node
<'tcx
>(instance_def
: ty
::InstanceDef
<'tcx
>)
623 -> DepConstructor
<'tcx
> {
624 DepConstructor
::InstanceDefSizeEstimate
{