1#![allow(unused_parens)]
64
65use std::ffi::OsStr;
66use std::mem;
67use std::path::PathBuf;
68use std::sync::Arc;
69
70use rustc_abi::Align;
71use rustc_arena::TypedArena;
72use rustc_ast::expand::allocator::AllocatorKind;
73use rustc_data_structures::fingerprint::Fingerprint;
74use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
75use rustc_data_structures::sorted_map::SortedMap;
76use rustc_data_structures::steal::Steal;
77use rustc_data_structures::svh::Svh;
78use rustc_data_structures::unord::{UnordMap, UnordSet};
79use rustc_errors::ErrorGuaranteed;
80use rustc_hir::attrs::StrippedCfgItem;
81use rustc_hir::def::{DefKind, DocLinkResMap};
82use rustc_hir::def_id::{
83 CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap, LocalDefIdSet, LocalModDefId,
84};
85use rustc_hir::lang_items::{LangItem, LanguageItems};
86use rustc_hir::{Crate, ItemLocalId, ItemLocalMap, PreciseCapturingArgKind, TraitCandidate};
87use rustc_index::IndexVec;
88use rustc_lint_defs::LintId;
89use rustc_macros::rustc_queries;
90use rustc_query_system::ich::StableHashingContext;
91use rustc_query_system::query::{
92 QueryCache, QueryMode, QueryStackDeferred, QueryState, try_get_cached,
93};
94use rustc_session::Limits;
95use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
96use rustc_session::cstore::{
97 CrateDepKind, CrateSource, ExternCrate, ForeignModule, LinkagePreference, NativeLib,
98};
99use rustc_session::lint::LintExpectationId;
100use rustc_span::def_id::LOCAL_CRATE;
101use rustc_span::source_map::Spanned;
102use rustc_span::{DUMMY_SP, Span, Symbol};
103use rustc_target::spec::{PanicStrategy, SanitizerSet};
104use {rustc_abi as abi, rustc_ast as ast, rustc_hir as hir};
105
106use crate::infer::canonical::{self, Canonical};
107use crate::lint::LintExpectation;
108use crate::metadata::ModChild;
109use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
110use crate::middle::debugger_visualizer::DebuggerVisualizerFile;
111use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
112use crate::middle::lib_features::LibFeatures;
113use crate::middle::privacy::EffectiveVisibilities;
114use crate::middle::resolve_bound_vars::{ObjectLifetimeDefault, ResolveBoundVars, ResolvedArg};
115use crate::middle::stability::DeprecationEntry;
116use crate::mir::interpret::{
117 EvalStaticInitializerRawResult, EvalToAllocationRawResult, EvalToConstValueResult,
118 EvalToValTreeResult, GlobalId, LitToConstInput,
119};
120use crate::mir::mono::{CodegenUnit, CollectionMode, MonoItem, MonoItemPartitions};
121use crate::query::erase::{Erase, erase, restore};
122use crate::query::plumbing::{
123 CyclePlaceholder, DynamicQuery, query_ensure, query_ensure_error_guaranteed, query_get_at,
124};
125use crate::traits::query::{
126 CanonicalAliasGoal, CanonicalDropckOutlivesGoal, CanonicalImpliedOutlivesBoundsGoal,
127 CanonicalPredicateGoal, CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal,
128 CanonicalTypeOpNormalizeGoal, CanonicalTypeOpProvePredicateGoal, DropckConstraint,
129 DropckOutlivesResult, MethodAutoderefStepsResult, NoSolution, NormalizationResult,
130 OutlivesBound,
131};
132use crate::traits::{
133 CodegenObligationError, DynCompatibilityViolation, EvaluationResult, ImplSource,
134 ObligationCause, OverflowError, WellFormedLoc, specialization_graph,
135};
136use crate::ty::fast_reject::SimplifiedType;
137use crate::ty::layout::ValidityRequirement;
138use crate::ty::print::{PrintTraitRefExt, describe_as_module};
139use crate::ty::util::AlwaysRequiresDrop;
140use crate::ty::{
141 self, CrateInherentImpls, GenericArg, GenericArgsRef, PseudoCanonicalInput, SizedTraitKind, Ty,
142 TyCtxt, TyCtxtFeed,
143};
144use crate::{dep_graph, mir, thir};
145
146mod arena_cached;
147pub mod erase;
148mod keys;
149pub use keys::{AsLocalKey, Key, LocalCrate};
150pub mod on_disk_cache;
151#[macro_use]
152pub mod plumbing;
153pub use plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk};
154
155rustc_queries! {
167 query trigger_delayed_bug(key: DefId) {
169 desc { "triggering a delayed bug for testing incremental" }
170 }
171
172 query registered_tools(_: ()) -> &'tcx ty::RegisteredTools {
174 arena_cache
175 desc { "compute registered tools for crate" }
176 }
177
178 query early_lint_checks(_: ()) {
179 desc { "perform lints prior to AST lowering" }
180 }
181
182 query env_var_os(key: &'tcx OsStr) -> Option<&'tcx OsStr> {
192 eval_always
194 desc { "get the value of an environment variable" }
195 }
196
197 query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
198 desc { "getting the resolver outputs" }
199 }
200
201 query resolver_for_lowering_raw(_: ()) -> (&'tcx Steal<(ty::ResolverAstLowering, Arc<ast::Crate>)>, &'tcx ty::ResolverGlobalCtxt) {
202 eval_always
203 no_hash
204 desc { "getting the resolver for lowering" }
205 }
206
207 query source_span(key: LocalDefId) -> Span {
213 eval_always
215 desc { "getting the source span" }
216 }
217
218 query hir_crate(key: ()) -> &'tcx Crate<'tcx> {
226 arena_cache
227 eval_always
228 desc { "getting the crate HIR" }
229 }
230
231 query hir_crate_items(_: ()) -> &'tcx rustc_middle::hir::ModuleItems {
233 arena_cache
234 eval_always
235 desc { "getting HIR crate items" }
236 }
237
238 query hir_module_items(key: LocalModDefId) -> &'tcx rustc_middle::hir::ModuleItems {
243 arena_cache
244 desc { |tcx| "getting HIR module items in `{}`", tcx.def_path_str(key) }
245 cache_on_disk_if { true }
246 }
247
248 query local_def_id_to_hir_id(key: LocalDefId) -> hir::HirId {
250 desc { |tcx| "getting HIR ID of `{}`", tcx.def_path_str(key) }
251 feedable
252 }
253
254 query hir_owner_parent(key: hir::OwnerId) -> hir::HirId {
259 desc { |tcx| "getting HIR parent of `{}`", tcx.def_path_str(key) }
260 }
261
262 query opt_hir_owner_nodes(key: LocalDefId) -> Option<&'tcx hir::OwnerNodes<'tcx>> {
267 desc { |tcx| "getting HIR owner items in `{}`", tcx.def_path_str(key) }
268 feedable
269 }
270
271 query hir_attr_map(key: hir::OwnerId) -> &'tcx hir::AttributeMap<'tcx> {
276 desc { |tcx| "getting HIR owner attributes in `{}`", tcx.def_path_str(key) }
277 feedable
278 }
279
280 query opt_ast_lowering_delayed_lints(key: hir::OwnerId) -> Option<&'tcx hir::lints::DelayedLints> {
285 desc { |tcx| "getting AST lowering delayed lints in `{}`", tcx.def_path_str(key) }
286 }
287
288 query const_param_default(param: DefId) -> ty::EarlyBinder<'tcx, ty::Const<'tcx>> {
292 desc { |tcx| "computing the default for const parameter `{}`", tcx.def_path_str(param) }
293 cache_on_disk_if { param.is_local() }
294 separate_provide_extern
295 }
296
297 query type_of(key: DefId) -> ty::EarlyBinder<'tcx, Ty<'tcx>> {
316 desc { |tcx|
317 "{action} `{path}`",
318 action = match tcx.def_kind(key) {
319 DefKind::TyAlias => "expanding type alias",
320 DefKind::TraitAlias => "expanding trait alias",
321 _ => "computing type of",
322 },
323 path = tcx.def_path_str(key),
324 }
325 cache_on_disk_if { key.is_local() }
326 separate_provide_extern
327 feedable
328 }
329
330 query type_of_opaque(key: DefId) -> Result<ty::EarlyBinder<'tcx, Ty<'tcx>>, CyclePlaceholder> {
341 desc { |tcx|
342 "computing type of opaque `{path}`",
343 path = tcx.def_path_str(key),
344 }
345 cycle_stash
346 }
347 query type_of_opaque_hir_typeck(key: LocalDefId) -> ty::EarlyBinder<'tcx, Ty<'tcx>> {
348 desc { |tcx|
349 "computing type of opaque `{path}` via HIR typeck",
350 path = tcx.def_path_str(key),
351 }
352 }
353
354 query type_alias_is_lazy(key: DefId) -> bool {
368 desc { |tcx|
369 "computing whether the type alias `{path}` is lazy",
370 path = tcx.def_path_str(key),
371 }
372 separate_provide_extern
373 }
374
375 query collect_return_position_impl_trait_in_trait_tys(key: DefId)
376 -> Result<&'tcx DefIdMap<ty::EarlyBinder<'tcx, Ty<'tcx>>>, ErrorGuaranteed>
377 {
378 desc { "comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process" }
379 cache_on_disk_if { key.is_local() }
380 separate_provide_extern
381 }
382
383 query opaque_ty_origin(key: DefId) -> hir::OpaqueTyOrigin<DefId>
384 {
385 desc { "determine where the opaque originates from" }
386 separate_provide_extern
387 }
388
389 query unsizing_params_for_adt(key: DefId) -> &'tcx rustc_index::bit_set::DenseBitSet<u32>
390 {
391 arena_cache
392 desc { |tcx|
393 "determining what parameters of `{}` can participate in unsizing",
394 tcx.def_path_str(key),
395 }
396 }
397
398 query analysis(key: ()) {
400 eval_always
401 desc { "running analysis passes on this crate" }
402 }
403
404 query check_expectations(key: Option<Symbol>) {
419 eval_always
420 desc { "checking lint expectations (RFC 2383)" }
421 }
422
423 query generics_of(key: DefId) -> &'tcx ty::Generics {
425 desc { |tcx| "computing generics of `{}`", tcx.def_path_str(key) }
426 arena_cache
427 cache_on_disk_if { key.is_local() }
428 separate_provide_extern
429 feedable
430 }
431
432 query predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
440 desc { |tcx| "computing predicates of `{}`", tcx.def_path_str(key) }
441 cache_on_disk_if { key.is_local() }
442 }
443
444 query opaque_types_defined_by(
445 key: LocalDefId
446 ) -> &'tcx ty::List<LocalDefId> {
447 desc {
448 |tcx| "computing the opaque types defined by `{}`",
449 tcx.def_path_str(key.to_def_id())
450 }
451 }
452
453 query nested_bodies_within(
454 key: LocalDefId
455 ) -> &'tcx ty::List<LocalDefId> {
456 desc {
457 |tcx| "computing the coroutines defined within `{}`",
458 tcx.def_path_str(key.to_def_id())
459 }
460 }
461
462 query explicit_item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
481 desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
482 cache_on_disk_if { key.is_local() }
483 separate_provide_extern
484 feedable
485 }
486
487 query explicit_item_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
494 desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
495 cache_on_disk_if { key.is_local() }
496 separate_provide_extern
497 feedable
498 }
499
500 query item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
524 desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
525 }
526
527 query item_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
528 desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
529 }
530
531 query item_non_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
532 desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
533 }
534
535 query impl_super_outlives(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
536 desc { |tcx| "elaborating supertrait outlives for trait of `{}`", tcx.def_path_str(key) }
537 }
538
539 query native_libraries(_: CrateNum) -> &'tcx Vec<NativeLib> {
544 arena_cache
545 desc { "looking up the native libraries of a linked crate" }
546 separate_provide_extern
547 }
548
549 query shallow_lint_levels_on(key: hir::OwnerId) -> &'tcx rustc_middle::lint::ShallowLintLevelMap {
550 arena_cache
551 desc { |tcx| "looking up lint levels for `{}`", tcx.def_path_str(key) }
552 }
553
554 query lint_expectations(_: ()) -> &'tcx Vec<(LintExpectationId, LintExpectation)> {
555 arena_cache
556 desc { "computing `#[expect]`ed lints in this crate" }
557 }
558
559 query lints_that_dont_need_to_run(_: ()) -> &'tcx UnordSet<LintId> {
560 arena_cache
561 desc { "Computing all lints that are explicitly enabled or with a default level greater than Allow" }
562 }
563
564 query expn_that_defined(key: DefId) -> rustc_span::ExpnId {
565 desc { |tcx| "getting the expansion that defined `{}`", tcx.def_path_str(key) }
566 separate_provide_extern
567 }
568
569 query is_panic_runtime(_: CrateNum) -> bool {
570 fatal_cycle
571 desc { "checking if the crate is_panic_runtime" }
572 separate_provide_extern
573 }
574
575 query representability(_: LocalDefId) -> rustc_middle::ty::Representability {
577 desc { "checking if `{}` is representable", tcx.def_path_str(key) }
578 cycle_delay_bug
580 anon
584 }
585
586 query representability_adt_ty(_: Ty<'tcx>) -> rustc_middle::ty::Representability {
588 desc { "checking if `{}` is representable", key }
589 cycle_delay_bug
590 anon
591 }
592
593 query params_in_repr(key: DefId) -> &'tcx rustc_index::bit_set::DenseBitSet<u32> {
595 desc { "finding type parameters in the representation" }
596 arena_cache
597 no_hash
598 separate_provide_extern
599 }
600
601 query thir_body(key: LocalDefId) -> Result<(&'tcx Steal<thir::Thir<'tcx>>, thir::ExprId), ErrorGuaranteed> {
604 no_hash
606 desc { |tcx| "building THIR for `{}`", tcx.def_path_str(key) }
607 }
608
609 query mir_keys(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexSet<LocalDefId> {
613 arena_cache
614 desc { "getting a list of all mir_keys" }
615 }
616
617 query mir_const_qualif(key: DefId) -> mir::ConstQualifs {
621 desc { |tcx| "const checking `{}`", tcx.def_path_str(key) }
622 cache_on_disk_if { key.is_local() }
623 separate_provide_extern
624 }
625
626 query mir_built(key: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
632 desc { |tcx| "building MIR for `{}`", tcx.def_path_str(key) }
633 feedable
634 }
635
636 query thir_abstract_const(
638 key: DefId
639 ) -> Result<Option<ty::EarlyBinder<'tcx, ty::Const<'tcx>>>, ErrorGuaranteed> {
640 desc {
641 |tcx| "building an abstract representation for `{}`", tcx.def_path_str(key),
642 }
643 separate_provide_extern
644 }
645
646 query mir_drops_elaborated_and_const_checked(key: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
647 no_hash
648 desc { |tcx| "elaborating drops for `{}`", tcx.def_path_str(key) }
649 }
650
651 query mir_for_ctfe(
652 key: DefId
653 ) -> &'tcx mir::Body<'tcx> {
654 desc { |tcx| "caching mir of `{}` for CTFE", tcx.def_path_str(key) }
655 cache_on_disk_if { key.is_local() }
656 separate_provide_extern
657 }
658
659 query mir_promoted(key: LocalDefId) -> (
660 &'tcx Steal<mir::Body<'tcx>>,
661 &'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
662 ) {
663 no_hash
664 desc { |tcx| "promoting constants in MIR for `{}`", tcx.def_path_str(key) }
665 }
666
667 query closure_typeinfo(key: LocalDefId) -> ty::ClosureTypeInfo<'tcx> {
668 desc {
669 |tcx| "finding symbols for captures of closure `{}`",
670 tcx.def_path_str(key)
671 }
672 }
673
674 query closure_saved_names_of_captured_variables(def_id: DefId) -> &'tcx IndexVec<abi::FieldIdx, Symbol> {
682 arena_cache
683 desc { |tcx| "computing debuginfo for closure `{}`", tcx.def_path_str(def_id) }
684 separate_provide_extern
685 }
686
687 query mir_coroutine_witnesses(key: DefId) -> Option<&'tcx mir::CoroutineLayout<'tcx>> {
688 arena_cache
689 desc { |tcx| "coroutine witness types for `{}`", tcx.def_path_str(key) }
690 cache_on_disk_if { key.is_local() }
691 separate_provide_extern
692 }
693
694 query check_coroutine_obligations(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
695 desc { |tcx| "verify auto trait bounds for coroutine interior type `{}`", tcx.def_path_str(key) }
696 return_result_from_ensure_ok
697 }
698
699 query check_potentially_region_dependent_goals(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
709 desc {
710 |tcx| "reproving potentially region dependent HIR typeck goals for `{}",
711 tcx.def_path_str(key)
712 }
713 }
714
715 query optimized_mir(key: DefId) -> &'tcx mir::Body<'tcx> {
718 desc { |tcx| "optimizing MIR for `{}`", tcx.def_path_str(key) }
719 cache_on_disk_if { key.is_local() }
720 separate_provide_extern
721 }
722
723 query coverage_attr_on(key: LocalDefId) -> bool {
729 desc { |tcx| "checking for `#[coverage(..)]` on `{}`", tcx.def_path_str(key) }
730 feedable
731 }
732
733 query coverage_ids_info(key: ty::InstanceKind<'tcx>) -> Option<&'tcx mir::coverage::CoverageIdsInfo> {
746 desc { |tcx| "retrieving coverage IDs info from MIR for `{}`", tcx.def_path_str(key.def_id()) }
747 arena_cache
748 }
749
750 query promoted_mir(key: DefId) -> &'tcx IndexVec<mir::Promoted, mir::Body<'tcx>> {
756 desc { |tcx| "optimizing promoted MIR for `{}`", tcx.def_path_str(key) }
757 cache_on_disk_if { key.is_local() }
758 separate_provide_extern
759 }
760
761 query erase_regions_ty(ty: Ty<'tcx>) -> Ty<'tcx> {
765 anon
772 desc { "erasing regions from `{}`", ty }
773 }
774
775 query wasm_import_module_map(_: CrateNum) -> &'tcx DefIdMap<String> {
776 arena_cache
777 desc { "getting wasm import module map" }
778 }
779
780 query trait_explicit_predicates_and_bounds(key: LocalDefId) -> ty::GenericPredicates<'tcx> {
802 desc { |tcx| "computing explicit predicates of trait `{}`", tcx.def_path_str(key) }
803 }
804
805 query explicit_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
811 desc { |tcx| "computing explicit predicates of `{}`", tcx.def_path_str(key) }
812 cache_on_disk_if { key.is_local() }
813 separate_provide_extern
814 feedable
815 }
816
817 query inferred_outlives_of(key: DefId) -> &'tcx [(ty::Clause<'tcx>, Span)] {
824 desc { |tcx| "computing inferred outlives-predicates of `{}`", tcx.def_path_str(key) }
825 cache_on_disk_if { key.is_local() }
826 separate_provide_extern
827 feedable
828 }
829
830 query explicit_super_predicates_of(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
838 desc { |tcx| "computing the super predicates of `{}`", tcx.def_path_str(key) }
839 cache_on_disk_if { key.is_local() }
840 separate_provide_extern
841 }
842
843 query explicit_implied_predicates_of(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
850 desc { |tcx| "computing the implied predicates of `{}`", tcx.def_path_str(key) }
851 cache_on_disk_if { key.is_local() }
852 separate_provide_extern
853 }
854
855 query explicit_supertraits_containing_assoc_item(
859 key: (DefId, rustc_span::Ident)
860 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
861 desc { |tcx| "computing the super traits of `{}` with associated type name `{}`",
862 tcx.def_path_str(key.0),
863 key.1
864 }
865 }
866
867 query const_conditions(
877 key: DefId
878 ) -> ty::ConstConditions<'tcx> {
879 desc { |tcx| "computing the conditions for `{}` to be considered const",
880 tcx.def_path_str(key)
881 }
882 separate_provide_extern
883 }
884
885 query explicit_implied_const_bounds(
891 key: DefId
892 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::PolyTraitRef<'tcx>, Span)]> {
893 desc { |tcx| "computing the implied `[const]` bounds for `{}`",
894 tcx.def_path_str(key)
895 }
896 separate_provide_extern
897 }
898
899 query type_param_predicates(
902 key: (LocalDefId, LocalDefId, rustc_span::Ident)
903 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
904 desc { |tcx| "computing the bounds for type parameter `{}`", tcx.hir_ty_param_name(key.1) }
905 }
906
907 query trait_def(key: DefId) -> &'tcx ty::TraitDef {
908 desc { |tcx| "computing trait definition for `{}`", tcx.def_path_str(key) }
909 arena_cache
910 cache_on_disk_if { key.is_local() }
911 separate_provide_extern
912 }
913 query adt_def(key: DefId) -> ty::AdtDef<'tcx> {
914 desc { |tcx| "computing ADT definition for `{}`", tcx.def_path_str(key) }
915 cache_on_disk_if { key.is_local() }
916 separate_provide_extern
917 }
918 query adt_destructor(key: DefId) -> Option<ty::Destructor> {
919 desc { |tcx| "computing `Drop` impl for `{}`", tcx.def_path_str(key) }
920 cache_on_disk_if { key.is_local() }
921 separate_provide_extern
922 }
923 query adt_async_destructor(key: DefId) -> Option<ty::AsyncDestructor> {
924 desc { |tcx| "computing `AsyncDrop` impl for `{}`", tcx.def_path_str(key) }
925 cache_on_disk_if { key.is_local() }
926 separate_provide_extern
927 }
928 query adt_sizedness_constraint(
929 key: (DefId, SizedTraitKind)
930 ) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> {
931 desc { |tcx| "computing the sizedness constraint for `{}`", tcx.def_path_str(key.0) }
932 }
933
934 query adt_dtorck_constraint(
935 key: DefId
936 ) -> &'tcx DropckConstraint<'tcx> {
937 desc { |tcx| "computing drop-check constraints for `{}`", tcx.def_path_str(key) }
938 }
939
940 query constness(key: DefId) -> hir::Constness {
962 desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) }
963 separate_provide_extern
964 feedable
965 }
966
967 query asyncness(key: DefId) -> ty::Asyncness {
968 desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) }
969 separate_provide_extern
970 }
971
972 query is_promotable_const_fn(key: DefId) -> bool {
980 desc { |tcx| "checking if item is promotable: `{}`", tcx.def_path_str(key) }
981 }
982
983 query coroutine_by_move_body_def_id(def_id: DefId) -> DefId {
990 desc { |tcx| "looking up the coroutine by-move body for `{}`", tcx.def_path_str(def_id) }
991 separate_provide_extern
992 }
993
994 query coroutine_kind(def_id: DefId) -> Option<hir::CoroutineKind> {
996 desc { |tcx| "looking up coroutine kind of `{}`", tcx.def_path_str(def_id) }
997 separate_provide_extern
998 feedable
999 }
1000
1001 query coroutine_for_closure(def_id: DefId) -> DefId {
1002 desc { |_tcx| "Given a coroutine-closure def id, return the def id of the coroutine returned by it" }
1003 separate_provide_extern
1004 }
1005
1006 query coroutine_hidden_types(
1007 def_id: DefId,
1008 ) -> ty::EarlyBinder<'tcx, ty::Binder<'tcx, ty::CoroutineWitnessTypes<TyCtxt<'tcx>>>> {
1009 desc { "looking up the hidden types stored across await points in a coroutine" }
1010 }
1011
1012 query crate_variances(_: ()) -> &'tcx ty::CrateVariancesMap<'tcx> {
1020 arena_cache
1021 desc { "computing the variances for items in this crate" }
1022 }
1023
1024 query variances_of(def_id: DefId) -> &'tcx [ty::Variance] {
1032 desc { |tcx| "computing the variances of `{}`", tcx.def_path_str(def_id) }
1033 cache_on_disk_if { def_id.is_local() }
1034 separate_provide_extern
1035 cycle_delay_bug
1036 }
1037
1038 query inferred_outlives_crate(_: ()) -> &'tcx ty::CratePredicatesMap<'tcx> {
1046 arena_cache
1047 desc { "computing the inferred outlives-predicates for items in this crate" }
1048 }
1049
1050 query associated_item_def_ids(key: DefId) -> &'tcx [DefId] {
1053 desc { |tcx| "collecting associated items or fields of `{}`", tcx.def_path_str(key) }
1054 cache_on_disk_if { key.is_local() }
1055 separate_provide_extern
1056 }
1057
1058 query associated_item(key: DefId) -> ty::AssocItem {
1060 desc { |tcx| "computing associated item data for `{}`", tcx.def_path_str(key) }
1061 cache_on_disk_if { key.is_local() }
1062 separate_provide_extern
1063 feedable
1064 }
1065
1066 query associated_items(key: DefId) -> &'tcx ty::AssocItems {
1068 arena_cache
1069 desc { |tcx| "collecting associated items of `{}`", tcx.def_path_str(key) }
1070 }
1071
1072 query impl_item_implementor_ids(impl_id: DefId) -> &'tcx DefIdMap<DefId> {
1094 arena_cache
1095 desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
1096 }
1097
1098 query associated_types_for_impl_traits_in_trait_or_impl(item_def_id: DefId) -> &'tcx DefIdMap<Vec<DefId>> {
1101 arena_cache
1102 desc { |tcx| "synthesizing RPITIT items for the opaque types for methods in `{}`", tcx.def_path_str(item_def_id) }
1103 separate_provide_extern
1104 }
1105
1106 query impl_trait_header(impl_id: DefId) -> Option<ty::ImplTraitHeader<'tcx>> {
1109 desc { |tcx| "computing trait implemented by `{}`", tcx.def_path_str(impl_id) }
1110 cache_on_disk_if { impl_id.is_local() }
1111 separate_provide_extern
1112 }
1113
1114 query impl_self_is_guaranteed_unsized(impl_def_id: DefId) -> bool {
1118 desc { |tcx| "computing whether `{}` has a guaranteed unsized self type", tcx.def_path_str(impl_def_id) }
1119 }
1120
1121 query inherent_impls(key: DefId) -> &'tcx [DefId] {
1125 desc { |tcx| "collecting inherent impls for `{}`", tcx.def_path_str(key) }
1126 cache_on_disk_if { key.is_local() }
1127 separate_provide_extern
1128 }
1129
1130 query incoherent_impls(key: SimplifiedType) -> &'tcx [DefId] {
1131 desc { |tcx| "collecting all inherent impls for `{:?}`", key }
1132 }
1133
1134 query check_transmutes(key: LocalDefId) {
1136 desc { |tcx| "check transmute calls inside `{}`", tcx.def_path_str(key) }
1137 }
1138
1139 query check_unsafety(key: LocalDefId) {
1141 desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
1142 }
1143
1144 query check_tail_calls(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1146 desc { |tcx| "tail-call-checking `{}`", tcx.def_path_str(key) }
1147 return_result_from_ensure_ok
1148 }
1149
1150 query assumed_wf_types(key: LocalDefId) -> &'tcx [(Ty<'tcx>, Span)] {
1155 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1156 }
1157
1158 query assumed_wf_types_for_rpitit(key: DefId) -> &'tcx [(Ty<'tcx>, Span)] {
1161 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1162 separate_provide_extern
1163 }
1164
1165 query fn_sig(key: DefId) -> ty::EarlyBinder<'tcx, ty::PolyFnSig<'tcx>> {
1167 desc { |tcx| "computing function signature of `{}`", tcx.def_path_str(key) }
1168 cache_on_disk_if { key.is_local() }
1169 separate_provide_extern
1170 cycle_delay_bug
1171 }
1172
1173 query lint_mod(key: LocalModDefId) {
1175 desc { |tcx| "linting {}", describe_as_module(key, tcx) }
1176 }
1177
1178 query check_unused_traits(_: ()) {
1179 desc { "checking unused trait imports in crate" }
1180 }
1181
1182 query check_mod_attrs(key: LocalModDefId) {
1184 desc { |tcx| "checking attributes in {}", describe_as_module(key, tcx) }
1185 }
1186
1187 query check_mod_unstable_api_usage(key: LocalModDefId) {
1189 desc { |tcx| "checking for unstable API usage in {}", describe_as_module(key, tcx) }
1190 }
1191
1192 query check_mod_privacy(key: LocalModDefId) {
1193 desc { |tcx| "checking privacy in {}", describe_as_module(key.to_local_def_id(), tcx) }
1194 }
1195
1196 query check_liveness(key: LocalDefId) {
1197 desc { |tcx| "checking liveness of variables in `{}`", tcx.def_path_str(key) }
1198 }
1199
1200 query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx (
1204 LocalDefIdSet,
1205 LocalDefIdMap<FxIndexSet<DefId>>,
1206 ) {
1207 arena_cache
1208 desc { "finding live symbols in crate" }
1209 }
1210
1211 query check_mod_deathness(key: LocalModDefId) {
1212 desc { |tcx| "checking deathness of variables in {}", describe_as_module(key, tcx) }
1213 }
1214
1215 query check_type_wf(key: ()) -> Result<(), ErrorGuaranteed> {
1216 desc { "checking that types are well-formed" }
1217 return_result_from_ensure_ok
1218 }
1219
1220 query coerce_unsized_info(key: DefId) -> Result<ty::adjustment::CoerceUnsizedInfo, ErrorGuaranteed> {
1222 desc { |tcx| "computing CoerceUnsized info for `{}`", tcx.def_path_str(key) }
1223 cache_on_disk_if { key.is_local() }
1224 separate_provide_extern
1225 return_result_from_ensure_ok
1226 }
1227
1228 query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
1229 desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
1230 cache_on_disk_if(tcx) { !tcx.is_typeck_child(key.to_def_id()) }
1231 }
1232
1233 query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
1234 desc { |tcx| "finding used_trait_imports `{}`", tcx.def_path_str(key) }
1235 cache_on_disk_if { true }
1236 }
1237
1238 query coherent_trait(def_id: DefId) -> Result<(), ErrorGuaranteed> {
1239 desc { |tcx| "coherence checking all impls of trait `{}`", tcx.def_path_str(def_id) }
1240 return_result_from_ensure_ok
1241 }
1242
1243 query mir_borrowck(key: LocalDefId) -> Result<&'tcx mir::ConcreteOpaqueTypes<'tcx>, ErrorGuaranteed> {
1246 desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key) }
1247 }
1248
1249 query crate_inherent_impls(k: ()) -> (&'tcx CrateInherentImpls, Result<(), ErrorGuaranteed>) {
1257 desc { "finding all inherent impls defined in crate" }
1258 }
1259
1260 query crate_inherent_impls_validity_check(_: ()) -> Result<(), ErrorGuaranteed> {
1268 desc { "check for inherent impls that should not be defined in crate" }
1269 return_result_from_ensure_ok
1270 }
1271
1272 query crate_inherent_impls_overlap_check(_: ()) -> Result<(), ErrorGuaranteed> {
1280 desc { "check for overlap between inherent impls defined in this crate" }
1281 return_result_from_ensure_ok
1282 }
1283
1284 query orphan_check_impl(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1287 desc { |tcx|
1288 "checking whether impl `{}` follows the orphan rules",
1289 tcx.def_path_str(key),
1290 }
1291 return_result_from_ensure_ok
1292 }
1293
1294 query mir_callgraph_cyclic(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
1296 fatal_cycle
1297 arena_cache
1298 desc { |tcx|
1299 "computing (transitive) callees of `{}` that may recurse",
1300 tcx.def_path_str(key),
1301 }
1302 cache_on_disk_if { true }
1303 }
1304
1305 query mir_inliner_callees(key: ty::InstanceKind<'tcx>) -> &'tcx [(DefId, GenericArgsRef<'tcx>)] {
1307 fatal_cycle
1308 desc { |tcx|
1309 "computing all local function calls in `{}`",
1310 tcx.def_path_str(key.def_id()),
1311 }
1312 }
1313
1314 query tag_for_variant(
1322 key: PseudoCanonicalInput<'tcx, (Ty<'tcx>, abi::VariantIdx)>,
1323 ) -> Option<ty::ScalarInt> {
1324 desc { "computing variant tag for enum" }
1325 }
1326
1327 query eval_to_allocation_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1336 -> EvalToAllocationRawResult<'tcx> {
1337 desc { |tcx|
1338 "const-evaluating + checking `{}`",
1339 key.value.display(tcx)
1340 }
1341 cache_on_disk_if { true }
1342 }
1343
1344 query eval_static_initializer(key: DefId) -> EvalStaticInitializerRawResult<'tcx> {
1346 desc { |tcx|
1347 "evaluating initializer of static `{}`",
1348 tcx.def_path_str(key)
1349 }
1350 cache_on_disk_if { key.is_local() }
1351 separate_provide_extern
1352 feedable
1353 }
1354
1355 query eval_to_const_value_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1368 -> EvalToConstValueResult<'tcx> {
1369 desc { |tcx|
1370 "simplifying constant for the type system `{}`",
1371 key.value.display(tcx)
1372 }
1373 depth_limit
1374 cache_on_disk_if { true }
1375 }
1376
1377 query eval_to_valtree(
1380 key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>
1381 ) -> EvalToValTreeResult<'tcx> {
1382 desc { "evaluating type-level constant" }
1383 }
1384
1385 query valtree_to_const_val(key: ty::Value<'tcx>) -> mir::ConstValue {
1387 desc { "converting type-level constant value to MIR constant value"}
1388 }
1389
1390 query destructure_const(key: ty::Const<'tcx>) -> ty::DestructuredConst<'tcx> {
1393 desc { "destructuring type level constant"}
1394 }
1395
1396 query lit_to_const(
1398 key: LitToConstInput<'tcx>
1399 ) -> ty::Const<'tcx> {
1400 desc { "converting literal to const" }
1401 }
1402
1403 query check_match(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1404 desc { |tcx| "match-checking `{}`", tcx.def_path_str(key) }
1405 return_result_from_ensure_ok
1406 }
1407
1408 query effective_visibilities(_: ()) -> &'tcx EffectiveVisibilities {
1410 eval_always
1411 desc { "checking effective visibilities" }
1412 }
1413 query check_private_in_public(module_def_id: LocalModDefId) {
1414 desc { |tcx|
1415 "checking for private elements in public interfaces for {}",
1416 describe_as_module(module_def_id, tcx)
1417 }
1418 }
1419
1420 query reachable_set(_: ()) -> &'tcx LocalDefIdSet {
1421 arena_cache
1422 desc { "reachability" }
1423 cache_on_disk_if { true }
1424 }
1425
1426 query region_scope_tree(def_id: DefId) -> &'tcx crate::middle::region::ScopeTree {
1429 desc { |tcx| "computing drop scopes for `{}`", tcx.def_path_str(def_id) }
1430 }
1431
1432 query mir_shims(key: ty::InstanceKind<'tcx>) -> &'tcx mir::Body<'tcx> {
1434 arena_cache
1435 desc {
1436 |tcx| "generating MIR shim for `{}`, instance={:?}",
1437 tcx.def_path_str(key.def_id()),
1438 key
1439 }
1440 }
1441
1442 query symbol_name(key: ty::Instance<'tcx>) -> ty::SymbolName<'tcx> {
1446 desc { "computing the symbol for `{}`", key }
1447 cache_on_disk_if { true }
1448 }
1449
1450 query def_kind(def_id: DefId) -> DefKind {
1451 desc { |tcx| "looking up definition kind of `{}`", tcx.def_path_str(def_id) }
1452 cache_on_disk_if { def_id.is_local() }
1453 separate_provide_extern
1454 feedable
1455 }
1456
1457 query def_span(def_id: DefId) -> Span {
1459 desc { |tcx| "looking up span for `{}`", tcx.def_path_str(def_id) }
1460 cache_on_disk_if { def_id.is_local() }
1461 separate_provide_extern
1462 feedable
1463 }
1464
1465 query def_ident_span(def_id: DefId) -> Option<Span> {
1467 desc { |tcx| "looking up span for `{}`'s identifier", tcx.def_path_str(def_id) }
1468 cache_on_disk_if { def_id.is_local() }
1469 separate_provide_extern
1470 feedable
1471 }
1472
1473 query ty_span(def_id: LocalDefId) -> Span {
1476 desc { |tcx| "looking up span for `{}`'s type", tcx.def_path_str(def_id) }
1477 cache_on_disk_if { true }
1478 }
1479
1480 query lookup_stability(def_id: DefId) -> Option<hir::Stability> {
1481 desc { |tcx| "looking up stability of `{}`", tcx.def_path_str(def_id) }
1482 cache_on_disk_if { def_id.is_local() }
1483 separate_provide_extern
1484 }
1485
1486 query lookup_const_stability(def_id: DefId) -> Option<hir::ConstStability> {
1487 desc { |tcx| "looking up const stability of `{}`", tcx.def_path_str(def_id) }
1488 cache_on_disk_if { def_id.is_local() }
1489 separate_provide_extern
1490 }
1491
1492 query lookup_default_body_stability(def_id: DefId) -> Option<hir::DefaultBodyStability> {
1493 desc { |tcx| "looking up default body stability of `{}`", tcx.def_path_str(def_id) }
1494 separate_provide_extern
1495 }
1496
1497 query should_inherit_track_caller(def_id: DefId) -> bool {
1498 desc { |tcx| "computing should_inherit_track_caller of `{}`", tcx.def_path_str(def_id) }
1499 }
1500
1501 query inherited_align(def_id: DefId) -> Option<Align> {
1502 desc { |tcx| "computing inherited_align of `{}`", tcx.def_path_str(def_id) }
1503 }
1504
1505 query lookup_deprecation_entry(def_id: DefId) -> Option<DeprecationEntry> {
1506 desc { |tcx| "checking whether `{}` is deprecated", tcx.def_path_str(def_id) }
1507 cache_on_disk_if { def_id.is_local() }
1508 separate_provide_extern
1509 }
1510
1511 query is_doc_hidden(def_id: DefId) -> bool {
1513 desc { |tcx| "checking whether `{}` is `doc(hidden)`", tcx.def_path_str(def_id) }
1514 separate_provide_extern
1515 }
1516
1517 query is_doc_notable_trait(def_id: DefId) -> bool {
1519 desc { |tcx| "checking whether `{}` is `doc(notable_trait)`", tcx.def_path_str(def_id) }
1520 }
1521
1522 query attrs_for_def(def_id: DefId) -> &'tcx [hir::Attribute] {
1526 desc { |tcx| "collecting attributes of `{}`", tcx.def_path_str(def_id) }
1527 separate_provide_extern
1528 }
1529
1530 query codegen_fn_attrs(def_id: DefId) -> &'tcx CodegenFnAttrs {
1540 desc { |tcx| "computing codegen attributes of `{}`", tcx.def_path_str(def_id) }
1541 arena_cache
1542 cache_on_disk_if { def_id.is_local() }
1543 separate_provide_extern
1544 feedable
1545 }
1546
1547 query asm_target_features(def_id: DefId) -> &'tcx FxIndexSet<Symbol> {
1548 desc { |tcx| "computing target features for inline asm of `{}`", tcx.def_path_str(def_id) }
1549 }
1550
1551 query fn_arg_idents(def_id: DefId) -> &'tcx [Option<rustc_span::Ident>] {
1552 desc { |tcx| "looking up function parameter identifiers for `{}`", tcx.def_path_str(def_id) }
1553 separate_provide_extern
1554 }
1555
1556 query rendered_const(def_id: DefId) -> &'tcx String {
1559 arena_cache
1560 desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
1561 separate_provide_extern
1562 }
1563
1564 query rendered_precise_capturing_args(def_id: DefId) -> Option<&'tcx [PreciseCapturingArgKind<Symbol, Symbol>]> {
1566 desc { |tcx| "rendering precise capturing args for `{}`", tcx.def_path_str(def_id) }
1567 separate_provide_extern
1568 }
1569
1570 query impl_parent(def_id: DefId) -> Option<DefId> {
1571 desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) }
1572 separate_provide_extern
1573 }
1574
1575 query is_ctfe_mir_available(key: DefId) -> bool {
1576 desc { |tcx| "checking if item has CTFE MIR available: `{}`", tcx.def_path_str(key) }
1577 cache_on_disk_if { key.is_local() }
1578 separate_provide_extern
1579 }
1580 query is_mir_available(key: DefId) -> bool {
1581 desc { |tcx| "checking if item has MIR available: `{}`", tcx.def_path_str(key) }
1582 cache_on_disk_if { key.is_local() }
1583 separate_provide_extern
1584 }
1585
1586 query own_existential_vtable_entries(
1587 key: DefId
1588 ) -> &'tcx [DefId] {
1589 desc { |tcx| "finding all existential vtable entries for trait `{}`", tcx.def_path_str(key) }
1590 }
1591
1592 query vtable_entries(key: ty::TraitRef<'tcx>)
1593 -> &'tcx [ty::VtblEntry<'tcx>] {
1594 desc { |tcx| "finding all vtable entries for trait `{}`", tcx.def_path_str(key.def_id) }
1595 }
1596
1597 query first_method_vtable_slot(key: ty::TraitRef<'tcx>) -> usize {
1598 desc { |tcx| "finding the slot within the vtable of `{}` for the implementation of `{}`", key.self_ty(), key.print_only_trait_name() }
1599 }
1600
1601 query supertrait_vtable_slot(key: (Ty<'tcx>, Ty<'tcx>)) -> Option<usize> {
1602 desc { |tcx| "finding the slot within vtable for trait object `{}` vtable ptr during trait upcasting coercion from `{}` vtable",
1603 key.1, key.0 }
1604 }
1605
1606 query vtable_allocation(key: (Ty<'tcx>, Option<ty::ExistentialTraitRef<'tcx>>)) -> mir::interpret::AllocId {
1607 desc { |tcx| "vtable const allocation for <{} as {}>",
1608 key.0,
1609 key.1.map(|trait_ref| format!("{trait_ref}")).unwrap_or_else(|| "_".to_owned())
1610 }
1611 }
1612
1613 query codegen_select_candidate(
1614 key: PseudoCanonicalInput<'tcx, ty::TraitRef<'tcx>>
1615 ) -> Result<&'tcx ImplSource<'tcx, ()>, CodegenObligationError> {
1616 cache_on_disk_if { true }
1617 desc { |tcx| "computing candidate for `{}`", key.value }
1618 }
1619
1620 query all_local_trait_impls(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexMap<DefId, Vec<LocalDefId>> {
1622 desc { "finding local trait impls" }
1623 }
1624
1625 query local_trait_impls(trait_id: DefId) -> &'tcx [LocalDefId] {
1627 desc { "finding local trait impls of `{}`", tcx.def_path_str(trait_id) }
1628 }
1629
1630 query trait_impls_of(trait_id: DefId) -> &'tcx ty::trait_def::TraitImpls {
1632 arena_cache
1633 desc { |tcx| "finding trait impls of `{}`", tcx.def_path_str(trait_id) }
1634 }
1635
1636 query specialization_graph_of(trait_id: DefId) -> Result<&'tcx specialization_graph::Graph, ErrorGuaranteed> {
1637 desc { |tcx| "building specialization graph of trait `{}`", tcx.def_path_str(trait_id) }
1638 cache_on_disk_if { true }
1639 return_result_from_ensure_ok
1640 }
1641 query dyn_compatibility_violations(trait_id: DefId) -> &'tcx [DynCompatibilityViolation] {
1642 desc { |tcx| "determining dyn-compatibility of trait `{}`", tcx.def_path_str(trait_id) }
1643 }
1644 query is_dyn_compatible(trait_id: DefId) -> bool {
1645 desc { |tcx| "checking if trait `{}` is dyn-compatible", tcx.def_path_str(trait_id) }
1646 }
1647
1648 query param_env(def_id: DefId) -> ty::ParamEnv<'tcx> {
1657 desc { |tcx| "computing normalized predicates of `{}`", tcx.def_path_str(def_id) }
1658 feedable
1659 }
1660
1661 query typing_env_normalized_for_post_analysis(def_id: DefId) -> ty::TypingEnv<'tcx> {
1665 desc { |tcx| "computing revealed normalized predicates of `{}`", tcx.def_path_str(def_id) }
1666 }
1667
1668 query is_copy_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1671 desc { "computing whether `{}` is `Copy`", env.value }
1672 }
1673 query is_use_cloned_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1676 desc { "computing whether `{}` is `UseCloned`", env.value }
1677 }
1678 query is_sized_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1680 desc { "computing whether `{}` is `Sized`", env.value }
1681 }
1682 query is_freeze_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1684 desc { "computing whether `{}` is freeze", env.value }
1685 }
1686 query is_unpin_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1688 desc { "computing whether `{}` is `Unpin`", env.value }
1689 }
1690 query is_async_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1692 desc { "computing whether `{}` is `AsyncDrop`", env.value }
1693 }
1694 query needs_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1696 desc { "computing whether `{}` needs drop", env.value }
1697 }
1698 query needs_async_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1700 desc { "computing whether `{}` needs async drop", env.value }
1701 }
1702 query has_significant_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1704 desc { "computing whether `{}` has a significant drop", env.value }
1705 }
1706
1707 query has_structural_eq_impl(ty: Ty<'tcx>) -> bool {
1712 desc {
1713 "computing whether `{}` implements `StructuralPartialEq`",
1714 ty
1715 }
1716 }
1717
1718 query adt_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1722 desc { |tcx| "computing when `{}` needs drop", tcx.def_path_str(def_id) }
1723 cache_on_disk_if { true }
1724 }
1725
1726 query adt_async_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1730 desc { |tcx| "computing when `{}` needs async drop", tcx.def_path_str(def_id) }
1731 cache_on_disk_if { true }
1732 }
1733
1734 query adt_significant_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1741 desc { |tcx| "computing when `{}` has a significant destructor", tcx.def_path_str(def_id) }
1742 }
1743
1744 query list_significant_drop_tys(ty: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> &'tcx ty::List<Ty<'tcx>> {
1762 desc { |tcx| "computing when `{}` has a significant destructor", ty.value }
1763 }
1764
1765 query layout_of(
1768 key: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>
1769 ) -> Result<ty::layout::TyAndLayout<'tcx>, &'tcx ty::layout::LayoutError<'tcx>> {
1770 depth_limit
1771 desc { "computing layout of `{}`", key.value }
1772 cycle_delay_bug
1774 }
1775
1776 query fn_abi_of_fn_ptr(
1781 key: ty::PseudoCanonicalInput<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1782 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1783 desc { "computing call ABI of `{}` function pointers", key.value.0 }
1784 }
1785
1786 query fn_abi_of_instance(
1792 key: ty::PseudoCanonicalInput<'tcx, (ty::Instance<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1793 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1794 desc { "computing call ABI of `{}`", key.value.0 }
1795 }
1796
1797 query dylib_dependency_formats(_: CrateNum)
1798 -> &'tcx [(CrateNum, LinkagePreference)] {
1799 desc { "getting dylib dependency formats of crate" }
1800 separate_provide_extern
1801 }
1802
1803 query dependency_formats(_: ()) -> &'tcx Arc<crate::middle::dependency_format::Dependencies> {
1804 arena_cache
1805 desc { "getting the linkage format of all dependencies" }
1806 }
1807
1808 query is_compiler_builtins(_: CrateNum) -> bool {
1809 fatal_cycle
1810 desc { "checking if the crate is_compiler_builtins" }
1811 separate_provide_extern
1812 }
1813 query has_global_allocator(_: CrateNum) -> bool {
1814 eval_always
1816 fatal_cycle
1817 desc { "checking if the crate has_global_allocator" }
1818 separate_provide_extern
1819 }
1820 query has_alloc_error_handler(_: CrateNum) -> bool {
1821 eval_always
1823 fatal_cycle
1824 desc { "checking if the crate has_alloc_error_handler" }
1825 separate_provide_extern
1826 }
1827 query has_panic_handler(_: CrateNum) -> bool {
1828 fatal_cycle
1829 desc { "checking if the crate has_panic_handler" }
1830 separate_provide_extern
1831 }
1832 query is_profiler_runtime(_: CrateNum) -> bool {
1833 fatal_cycle
1834 desc { "checking if a crate is `#![profiler_runtime]`" }
1835 separate_provide_extern
1836 }
1837 query has_ffi_unwind_calls(key: LocalDefId) -> bool {
1838 desc { |tcx| "checking if `{}` contains FFI-unwind calls", tcx.def_path_str(key) }
1839 cache_on_disk_if { true }
1840 }
1841 query required_panic_strategy(_: CrateNum) -> Option<PanicStrategy> {
1842 fatal_cycle
1843 desc { "getting a crate's required panic strategy" }
1844 separate_provide_extern
1845 }
1846 query panic_in_drop_strategy(_: CrateNum) -> PanicStrategy {
1847 fatal_cycle
1848 desc { "getting a crate's configured panic-in-drop strategy" }
1849 separate_provide_extern
1850 }
1851 query is_no_builtins(_: CrateNum) -> bool {
1852 fatal_cycle
1853 desc { "getting whether a crate has `#![no_builtins]`" }
1854 separate_provide_extern
1855 }
1856 query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion {
1857 fatal_cycle
1858 desc { "getting a crate's symbol mangling version" }
1859 separate_provide_extern
1860 }
1861
1862 query extern_crate(def_id: CrateNum) -> Option<&'tcx ExternCrate> {
1863 eval_always
1864 desc { "getting crate's ExternCrateData" }
1865 separate_provide_extern
1866 }
1867
1868 query specialization_enabled_in(cnum: CrateNum) -> bool {
1869 desc { "checking whether the crate enabled `specialization`/`min_specialization`" }
1870 separate_provide_extern
1871 }
1872
1873 query specializes(_: (DefId, DefId)) -> bool {
1874 desc { "computing whether impls specialize one another" }
1875 }
1876 query in_scope_traits_map(_: hir::OwnerId)
1877 -> Option<&'tcx ItemLocalMap<Box<[TraitCandidate]>>> {
1878 desc { "getting traits in scope at a block" }
1879 }
1880
1881 query defaultness(def_id: DefId) -> hir::Defaultness {
1883 desc { |tcx| "looking up whether `{}` has `default`", tcx.def_path_str(def_id) }
1884 separate_provide_extern
1885 feedable
1886 }
1887
1888 query default_field(def_id: DefId) -> Option<DefId> {
1890 desc { |tcx| "looking up the `const` corresponding to the default for `{}`", tcx.def_path_str(def_id) }
1891 separate_provide_extern
1892 }
1893
1894 query check_well_formed(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1895 desc { |tcx| "checking that `{}` is well-formed", tcx.def_path_str(key) }
1896 return_result_from_ensure_ok
1897 }
1898
1899 query enforce_impl_non_lifetime_params_are_constrained(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1900 desc { |tcx| "checking that `{}`'s generics are constrained by the impl header", tcx.def_path_str(key) }
1901 return_result_from_ensure_ok
1902 }
1903
1904 query reachable_non_generics(_: CrateNum)
1917 -> &'tcx DefIdMap<SymbolExportInfo> {
1918 arena_cache
1919 desc { "looking up the exported symbols of a crate" }
1920 separate_provide_extern
1921 }
1922 query is_reachable_non_generic(def_id: DefId) -> bool {
1923 desc { |tcx| "checking whether `{}` is an exported symbol", tcx.def_path_str(def_id) }
1924 cache_on_disk_if { def_id.is_local() }
1925 separate_provide_extern
1926 }
1927 query is_unreachable_local_definition(def_id: LocalDefId) -> bool {
1928 desc { |tcx|
1929 "checking whether `{}` is reachable from outside the crate",
1930 tcx.def_path_str(def_id),
1931 }
1932 }
1933
1934 query upstream_monomorphizations(_: ()) -> &'tcx DefIdMap<UnordMap<GenericArgsRef<'tcx>, CrateNum>> {
1942 arena_cache
1943 desc { "collecting available upstream monomorphizations" }
1944 }
1945
1946 query upstream_monomorphizations_for(def_id: DefId)
1954 -> Option<&'tcx UnordMap<GenericArgsRef<'tcx>, CrateNum>>
1955 {
1956 desc { |tcx|
1957 "collecting available upstream monomorphizations for `{}`",
1958 tcx.def_path_str(def_id),
1959 }
1960 separate_provide_extern
1961 }
1962
1963 query upstream_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1979 desc { "available upstream drop-glue for `{:?}`", args }
1980 }
1981
1982 query upstream_async_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1999 desc { "available upstream async-drop-glue for `{:?}`", args }
2000 }
2001
2002 query foreign_modules(_: CrateNum) -> &'tcx FxIndexMap<DefId, ForeignModule> {
2004 arena_cache
2005 desc { "looking up the foreign modules of a linked crate" }
2006 separate_provide_extern
2007 }
2008
2009 query clashing_extern_declarations(_: ()) {
2011 desc { "checking `extern fn` declarations are compatible" }
2012 }
2013
2014 query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {
2017 desc { "looking up the entry function of a crate" }
2018 }
2019
2020 query proc_macro_decls_static(_: ()) -> Option<LocalDefId> {
2022 desc { "looking up the proc macro declarations for a crate" }
2023 }
2024
2025 query crate_hash(_: CrateNum) -> Svh {
2033 eval_always
2034 desc { "looking up the hash a crate" }
2035 separate_provide_extern
2036 }
2037
2038 query crate_host_hash(_: CrateNum) -> Option<Svh> {
2040 eval_always
2041 desc { "looking up the hash of a host version of a crate" }
2042 separate_provide_extern
2043 }
2044
2045 query extra_filename(_: CrateNum) -> &'tcx String {
2048 arena_cache
2049 eval_always
2050 desc { "looking up the extra filename for a crate" }
2051 separate_provide_extern
2052 }
2053
2054 query crate_extern_paths(_: CrateNum) -> &'tcx Vec<PathBuf> {
2056 arena_cache
2057 eval_always
2058 desc { "looking up the paths for extern crates" }
2059 separate_provide_extern
2060 }
2061
2062 query implementations_of_trait(_: (CrateNum, DefId)) -> &'tcx [(DefId, Option<SimplifiedType>)] {
2065 desc { "looking up implementations of a trait in a crate" }
2066 separate_provide_extern
2067 }
2068
2069 query crate_incoherent_impls(key: (CrateNum, SimplifiedType)) -> &'tcx [DefId] {
2074 desc { |tcx| "collecting all impls for a type in a crate" }
2075 separate_provide_extern
2076 }
2077
2078 query native_library(def_id: DefId) -> Option<&'tcx NativeLib> {
2080 desc { |tcx| "getting the native library for `{}`", tcx.def_path_str(def_id) }
2081 }
2082
2083 query inherit_sig_for_delegation_item(def_id: LocalDefId) -> &'tcx [Ty<'tcx>] {
2084 desc { "inheriting delegation signature" }
2085 }
2086
2087 query resolve_bound_vars(owner_id: hir::OwnerId) -> &'tcx ResolveBoundVars {
2091 arena_cache
2092 desc { |tcx| "resolving lifetimes for `{}`", tcx.def_path_str(owner_id) }
2093 }
2094 query named_variable_map(owner_id: hir::OwnerId) -> &'tcx SortedMap<ItemLocalId, ResolvedArg> {
2095 desc { |tcx| "looking up a named region inside `{}`", tcx.def_path_str(owner_id) }
2096 }
2097 query is_late_bound_map(owner_id: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
2098 desc { |tcx| "testing if a region is late bound inside `{}`", tcx.def_path_str(owner_id) }
2099 }
2100 query object_lifetime_default(def_id: DefId) -> ObjectLifetimeDefault {
2115 desc { "looking up lifetime defaults for type parameter `{}`", tcx.def_path_str(def_id) }
2116 separate_provide_extern
2117 }
2118 query late_bound_vars_map(owner_id: hir::OwnerId)
2119 -> &'tcx SortedMap<ItemLocalId, Vec<ty::BoundVariableKind>> {
2120 desc { |tcx| "looking up late bound vars inside `{}`", tcx.def_path_str(owner_id) }
2121 }
2122 query opaque_captured_lifetimes(def_id: LocalDefId) -> &'tcx [(ResolvedArg, LocalDefId)] {
2137 desc { |tcx| "listing captured lifetimes for opaque `{}`", tcx.def_path_str(def_id) }
2138 }
2139
2140 query visibility(def_id: DefId) -> ty::Visibility<DefId> {
2153 desc { |tcx| "computing visibility of `{}`", tcx.def_path_str(def_id) }
2154 separate_provide_extern
2155 feedable
2156 }
2157
2158 query inhabited_predicate_adt(key: DefId) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
2159 desc { "computing the uninhabited predicate of `{:?}`", key }
2160 }
2161
2162 query inhabited_predicate_type(key: Ty<'tcx>) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
2164 desc { "computing the uninhabited predicate of `{}`", key }
2165 }
2166
2167 query dep_kind(_: CrateNum) -> CrateDepKind {
2168 eval_always
2169 desc { "fetching what a dependency looks like" }
2170 separate_provide_extern
2171 }
2172
2173 query crate_name(_: CrateNum) -> Symbol {
2175 feedable
2176 desc { "fetching what a crate is named" }
2177 separate_provide_extern
2178 }
2179 query module_children(def_id: DefId) -> &'tcx [ModChild] {
2180 desc { |tcx| "collecting child items of module `{}`", tcx.def_path_str(def_id) }
2181 separate_provide_extern
2182 }
2183
2184 query num_extern_def_ids(_: CrateNum) -> usize {
2190 desc { "fetching the number of definitions in a crate" }
2191 separate_provide_extern
2192 }
2193
2194 query lib_features(_: CrateNum) -> &'tcx LibFeatures {
2195 desc { "calculating the lib features defined in a crate" }
2196 separate_provide_extern
2197 arena_cache
2198 }
2199 query stability_implications(_: CrateNum) -> &'tcx UnordMap<Symbol, Symbol> {
2212 arena_cache
2213 desc { "calculating the implications between `#[unstable]` features defined in a crate" }
2214 separate_provide_extern
2215 }
2216 query intrinsic_raw(def_id: DefId) -> Option<rustc_middle::ty::IntrinsicDef> {
2218 desc { |tcx| "fetch intrinsic name if `{}` is an intrinsic", tcx.def_path_str(def_id) }
2219 separate_provide_extern
2220 }
2221 query get_lang_items(_: ()) -> &'tcx LanguageItems {
2223 arena_cache
2224 eval_always
2225 desc { "calculating the lang items map" }
2226 }
2227
2228 query all_diagnostic_items(_: ()) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2230 arena_cache
2231 eval_always
2232 desc { "calculating the diagnostic items map" }
2233 }
2234
2235 query defined_lang_items(_: CrateNum) -> &'tcx [(DefId, LangItem)] {
2237 desc { "calculating the lang items defined in a crate" }
2238 separate_provide_extern
2239 }
2240
2241 query diagnostic_items(_: CrateNum) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2243 arena_cache
2244 desc { "calculating the diagnostic items map in a crate" }
2245 separate_provide_extern
2246 }
2247
2248 query missing_lang_items(_: CrateNum) -> &'tcx [LangItem] {
2249 desc { "calculating the missing lang items in a crate" }
2250 separate_provide_extern
2251 }
2252
2253 query visible_parent_map(_: ()) -> &'tcx DefIdMap<DefId> {
2258 arena_cache
2259 desc { "calculating the visible parent map" }
2260 }
2261 query trimmed_def_paths(_: ()) -> &'tcx DefIdMap<Symbol> {
2264 arena_cache
2265 desc { "calculating trimmed def paths" }
2266 }
2267 query missing_extern_crate_item(_: CrateNum) -> bool {
2268 eval_always
2269 desc { "seeing if we're missing an `extern crate` item for this crate" }
2270 separate_provide_extern
2271 }
2272 query used_crate_source(_: CrateNum) -> &'tcx Arc<CrateSource> {
2273 arena_cache
2274 eval_always
2275 desc { "looking at the source for a crate" }
2276 separate_provide_extern
2277 }
2278
2279 query debugger_visualizers(_: CrateNum) -> &'tcx Vec<DebuggerVisualizerFile> {
2284 arena_cache
2285 desc { "looking up the debugger visualizers for this crate" }
2286 separate_provide_extern
2287 eval_always
2288 }
2289
2290 query postorder_cnums(_: ()) -> &'tcx [CrateNum] {
2291 eval_always
2292 desc { "generating a postorder list of CrateNums" }
2293 }
2294 query is_private_dep(c: CrateNum) -> bool {
2297 eval_always
2298 desc { "checking whether crate `{}` is a private dependency", c }
2299 separate_provide_extern
2300 }
2301 query allocator_kind(_: ()) -> Option<AllocatorKind> {
2302 eval_always
2303 desc { "getting the allocator kind for the current crate" }
2304 }
2305 query alloc_error_handler_kind(_: ()) -> Option<AllocatorKind> {
2306 eval_always
2307 desc { "alloc error handler kind for the current crate" }
2308 }
2309
2310 query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
2311 desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
2312 }
2313
2314 query crates(_: ()) -> &'tcx [CrateNum] {
2317 eval_always
2318 desc { "fetching all foreign CrateNum instances" }
2319 }
2320 query used_crates(_: ()) -> &'tcx [CrateNum] {
2324 eval_always
2325 desc { "fetching `CrateNum`s for all crates loaded non-speculatively" }
2326 }
2327
2328 query traits(_: CrateNum) -> &'tcx [DefId] {
2330 desc { "fetching all traits in a crate" }
2331 separate_provide_extern
2332 }
2333
2334 query trait_impls_in_crate(_: CrateNum) -> &'tcx [DefId] {
2335 desc { "fetching all trait impls in a crate" }
2336 separate_provide_extern
2337 }
2338
2339 query stable_order_of_exportable_impls(_: CrateNum) -> &'tcx FxIndexMap<DefId, usize> {
2340 desc { "fetching the stable impl's order" }
2341 separate_provide_extern
2342 }
2343
2344 query exportable_items(_: CrateNum) -> &'tcx [DefId] {
2345 desc { "fetching all exportable items in a crate" }
2346 separate_provide_extern
2347 }
2348
2349 query exported_non_generic_symbols(cnum: CrateNum) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)] {
2361 desc { "collecting exported non-generic symbols for crate `{}`", cnum}
2362 cache_on_disk_if { *cnum == LOCAL_CRATE }
2363 separate_provide_extern
2364 }
2365
2366 query exported_generic_symbols(cnum: CrateNum) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)] {
2374 desc { "collecting exported generic symbols for crate `{}`", cnum}
2375 cache_on_disk_if { *cnum == LOCAL_CRATE }
2376 separate_provide_extern
2377 }
2378
2379 query collect_and_partition_mono_items(_: ()) -> MonoItemPartitions<'tcx> {
2380 eval_always
2381 desc { "collect_and_partition_mono_items" }
2382 }
2383
2384 query is_codegened_item(def_id: DefId) -> bool {
2385 desc { |tcx| "determining whether `{}` needs codegen", tcx.def_path_str(def_id) }
2386 }
2387
2388 query codegen_unit(sym: Symbol) -> &'tcx CodegenUnit<'tcx> {
2389 desc { "getting codegen unit `{sym}`" }
2390 }
2391
2392 query backend_optimization_level(_: ()) -> OptLevel {
2393 desc { "optimization level used by backend" }
2394 }
2395
2396 query output_filenames(_: ()) -> &'tcx Arc<OutputFilenames> {
2401 feedable
2402 desc { "getting output filenames" }
2403 arena_cache
2404 }
2405
2406 query normalize_canonicalized_projection_ty(
2412 goal: CanonicalAliasGoal<'tcx>
2413 ) -> Result<
2414 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2415 NoSolution,
2416 > {
2417 desc { "normalizing `{}`", goal.canonical.value.value }
2418 }
2419
2420 query normalize_canonicalized_free_alias(
2426 goal: CanonicalAliasGoal<'tcx>
2427 ) -> Result<
2428 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2429 NoSolution,
2430 > {
2431 desc { "normalizing `{}`", goal.canonical.value.value }
2432 }
2433
2434 query normalize_canonicalized_inherent_projection_ty(
2440 goal: CanonicalAliasGoal<'tcx>
2441 ) -> Result<
2442 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2443 NoSolution,
2444 > {
2445 desc { "normalizing `{}`", goal.canonical.value.value }
2446 }
2447
2448 query try_normalize_generic_arg_after_erasing_regions(
2450 goal: PseudoCanonicalInput<'tcx, GenericArg<'tcx>>
2451 ) -> Result<GenericArg<'tcx>, NoSolution> {
2452 desc { "normalizing `{}`", goal.value }
2453 }
2454
2455 query implied_outlives_bounds(
2456 key: (CanonicalImpliedOutlivesBoundsGoal<'tcx>, bool)
2457 ) -> Result<
2458 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>,
2459 NoSolution,
2460 > {
2461 desc { "computing implied outlives bounds for `{}` (hack disabled = {:?})", key.0.canonical.value.value.ty, key.1 }
2462 }
2463
2464 query dropck_outlives(
2467 goal: CanonicalDropckOutlivesGoal<'tcx>
2468 ) -> Result<
2469 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>,
2470 NoSolution,
2471 > {
2472 desc { "computing dropck types for `{}`", goal.canonical.value.value.dropped_ty }
2473 }
2474
2475 query evaluate_obligation(
2478 goal: CanonicalPredicateGoal<'tcx>
2479 ) -> Result<EvaluationResult, OverflowError> {
2480 desc { "evaluating trait selection obligation `{}`", goal.canonical.value.value }
2481 }
2482
2483 query type_op_ascribe_user_type(
2485 goal: CanonicalTypeOpAscribeUserTypeGoal<'tcx>
2486 ) -> Result<
2487 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2488 NoSolution,
2489 > {
2490 desc { "evaluating `type_op_ascribe_user_type` `{:?}`", goal.canonical.value.value }
2491 }
2492
2493 query type_op_prove_predicate(
2495 goal: CanonicalTypeOpProvePredicateGoal<'tcx>
2496 ) -> Result<
2497 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2498 NoSolution,
2499 > {
2500 desc { "evaluating `type_op_prove_predicate` `{:?}`", goal.canonical.value.value }
2501 }
2502
2503 query type_op_normalize_ty(
2505 goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>
2506 ) -> Result<
2507 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>,
2508 NoSolution,
2509 > {
2510 desc { "normalizing `{}`", goal.canonical.value.value.value }
2511 }
2512
2513 query type_op_normalize_clause(
2515 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Clause<'tcx>>
2516 ) -> Result<
2517 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Clause<'tcx>>>,
2518 NoSolution,
2519 > {
2520 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2521 }
2522
2523 query type_op_normalize_poly_fn_sig(
2525 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>
2526 ) -> Result<
2527 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>,
2528 NoSolution,
2529 > {
2530 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2531 }
2532
2533 query type_op_normalize_fn_sig(
2535 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>
2536 ) -> Result<
2537 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>,
2538 NoSolution,
2539 > {
2540 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2541 }
2542
2543 query instantiate_and_check_impossible_predicates(key: (DefId, GenericArgsRef<'tcx>)) -> bool {
2544 desc { |tcx|
2545 "checking impossible instantiated predicates: `{}`",
2546 tcx.def_path_str(key.0)
2547 }
2548 }
2549
2550 query is_impossible_associated_item(key: (DefId, DefId)) -> bool {
2551 desc { |tcx|
2552 "checking if `{}` is impossible to reference within `{}`",
2553 tcx.def_path_str(key.1),
2554 tcx.def_path_str(key.0),
2555 }
2556 }
2557
2558 query method_autoderef_steps(
2559 goal: CanonicalTyGoal<'tcx>
2560 ) -> MethodAutoderefStepsResult<'tcx> {
2561 desc { "computing autoderef types for `{}`", goal.canonical.value.value }
2562 }
2563
2564 query rust_target_features(_: CrateNum) -> &'tcx UnordMap<String, rustc_target::target_features::Stability> {
2566 arena_cache
2567 eval_always
2568 desc { "looking up Rust target features" }
2569 }
2570
2571 query implied_target_features(feature: Symbol) -> &'tcx Vec<Symbol> {
2572 arena_cache
2573 eval_always
2574 desc { "looking up implied target features" }
2575 }
2576
2577 query features_query(_: ()) -> &'tcx rustc_feature::Features {
2578 feedable
2579 desc { "looking up enabled feature gates" }
2580 }
2581
2582 query crate_for_resolver((): ()) -> &'tcx Steal<(rustc_ast::Crate, rustc_ast::AttrVec)> {
2583 feedable
2584 no_hash
2585 desc { "the ast before macro expansion and name resolution" }
2586 }
2587
2588 query resolve_instance_raw(
2598 key: ty::PseudoCanonicalInput<'tcx, (DefId, GenericArgsRef<'tcx>)>
2599 ) -> Result<Option<ty::Instance<'tcx>>, ErrorGuaranteed> {
2600 desc { "resolving instance `{}`", ty::Instance::new_raw(key.value.0, key.value.1) }
2601 }
2602
2603 query reveal_opaque_types_in_bounds(key: ty::Clauses<'tcx>) -> ty::Clauses<'tcx> {
2604 desc { "revealing opaque types in `{:?}`", key }
2605 }
2606
2607 query limits(key: ()) -> Limits {
2608 desc { "looking up limits" }
2609 }
2610
2611 query diagnostic_hir_wf_check(
2620 key: (ty::Predicate<'tcx>, WellFormedLoc)
2621 ) -> Option<&'tcx ObligationCause<'tcx>> {
2622 arena_cache
2623 eval_always
2624 no_hash
2625 desc { "performing HIR wf-checking for predicate `{:?}` at item `{:?}`", key.0, key.1 }
2626 }
2627
2628 query global_backend_features(_: ()) -> &'tcx Vec<String> {
2631 arena_cache
2632 eval_always
2633 desc { "computing the backend features for CLI flags" }
2634 }
2635
2636 query check_validity_requirement(key: (ValidityRequirement, ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>)) -> Result<bool, &'tcx ty::layout::LayoutError<'tcx>> {
2637 desc { "checking validity requirement for `{}`: {}", key.1.value, key.0 }
2638 }
2639
2640 query compare_impl_item(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
2645 desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key) }
2646 return_result_from_ensure_ok
2647 }
2648
2649 query deduced_param_attrs(def_id: DefId) -> &'tcx [ty::DeducedParamAttrs] {
2650 desc { |tcx| "deducing parameter attributes for {}", tcx.def_path_str(def_id) }
2651 separate_provide_extern
2652 }
2653
2654 query doc_link_resolutions(def_id: DefId) -> &'tcx DocLinkResMap {
2655 eval_always
2656 desc { "resolutions for documentation links for a module" }
2657 separate_provide_extern
2658 }
2659
2660 query doc_link_traits_in_scope(def_id: DefId) -> &'tcx [DefId] {
2661 eval_always
2662 desc { "traits in scope for documentation links for a module" }
2663 separate_provide_extern
2664 }
2665
2666 query stripped_cfg_items(cnum: CrateNum) -> &'tcx [StrippedCfgItem] {
2670 desc { "getting cfg-ed out item names" }
2671 separate_provide_extern
2672 }
2673
2674 query generics_require_sized_self(def_id: DefId) -> bool {
2675 desc { "check whether the item has a `where Self: Sized` bound" }
2676 }
2677
2678 query cross_crate_inlinable(def_id: DefId) -> bool {
2679 desc { "whether the item should be made inlinable across crates" }
2680 separate_provide_extern
2681 }
2682
2683 query check_mono_item(key: ty::Instance<'tcx>) {
2687 desc { "monomorphization-time checking" }
2688 }
2689
2690 query skip_move_check_fns(_: ()) -> &'tcx FxIndexSet<DefId> {
2692 arena_cache
2693 desc { "functions to skip for move-size check" }
2694 }
2695
2696 query items_of_instance(key: (ty::Instance<'tcx>, CollectionMode)) -> (&'tcx [Spanned<MonoItem<'tcx>>], &'tcx [Spanned<MonoItem<'tcx>>]) {
2697 desc { "collecting items used by `{}`", key.0 }
2698 cache_on_disk_if { true }
2699 }
2700
2701 query size_estimate(key: ty::Instance<'tcx>) -> usize {
2702 desc { "estimating codegen size of `{}`", key }
2703 cache_on_disk_if { true }
2704 }
2705
2706 query anon_const_kind(def_id: DefId) -> ty::AnonConstKind {
2707 desc { |tcx| "looking up anon const kind of `{}`", tcx.def_path_str(def_id) }
2708 separate_provide_extern
2709 }
2710
2711 query disabled_sanitizers_for(key: LocalDefId) -> SanitizerSet {
2717 desc { |tcx| "checking what set of sanitizers are enabled on `{}`", tcx.def_path_str(key) }
2718 feedable
2719 }
2720}
2721
2722rustc_with_all_queries! { define_callbacks! }
2723rustc_feedable_queries! { define_feedable! }