1#![allow(unused_parens)]
8
9use std::mem;
10use std::path::PathBuf;
11use std::sync::Arc;
12
13use rustc_arena::TypedArena;
14use rustc_ast::expand::StrippedCfgItem;
15use rustc_ast::expand::allocator::AllocatorKind;
16use rustc_data_structures::fingerprint::Fingerprint;
17use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
18use rustc_data_structures::sorted_map::SortedMap;
19use rustc_data_structures::steal::Steal;
20use rustc_data_structures::svh::Svh;
21use rustc_data_structures::unord::{UnordMap, UnordSet};
22use rustc_errors::ErrorGuaranteed;
23use rustc_hir::def::{DefKind, DocLinkResMap};
24use rustc_hir::def_id::{
25 CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap, LocalDefIdSet, LocalModDefId,
26};
27use rustc_hir::lang_items::{LangItem, LanguageItems};
28use rustc_hir::{Crate, ItemLocalId, ItemLocalMap, PreciseCapturingArgKind, TraitCandidate};
29use rustc_index::IndexVec;
30use rustc_lint_defs::LintId;
31use rustc_macros::rustc_queries;
32use rustc_query_system::ich::StableHashingContext;
33use rustc_query_system::query::{QueryCache, QueryMode, QueryState, try_get_cached};
34use rustc_session::Limits;
35use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
36use rustc_session::cstore::{
37 CrateDepKind, CrateSource, ExternCrate, ForeignModule, LinkagePreference, NativeLib,
38};
39use rustc_session::lint::LintExpectationId;
40use rustc_span::def_id::LOCAL_CRATE;
41use rustc_span::source_map::Spanned;
42use rustc_span::{DUMMY_SP, Span, Symbol};
43use rustc_target::spec::PanicStrategy;
44use {rustc_abi as abi, rustc_ast as ast, rustc_attr_data_structures as attr, rustc_hir as hir};
45
46use crate::infer::canonical::{self, Canonical};
47use crate::lint::LintExpectation;
48use crate::metadata::ModChild;
49use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
50use crate::middle::debugger_visualizer::DebuggerVisualizerFile;
51use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
52use crate::middle::lib_features::LibFeatures;
53use crate::middle::privacy::EffectiveVisibilities;
54use crate::middle::resolve_bound_vars::{ObjectLifetimeDefault, ResolveBoundVars, ResolvedArg};
55use crate::middle::stability::{self, DeprecationEntry};
56use crate::mir::interpret::{
57 EvalStaticInitializerRawResult, EvalToAllocationRawResult, EvalToConstValueResult,
58 EvalToValTreeResult, GlobalId, LitToConstInput,
59};
60use crate::mir::mono::{CodegenUnit, CollectionMode, MonoItem, MonoItemPartitions};
61use crate::query::erase::{Erase, erase, restore};
62use crate::query::plumbing::{
63 CyclePlaceholder, DynamicQuery, query_ensure, query_ensure_error_guaranteed, query_get_at,
64};
65use crate::traits::query::{
66 CanonicalAliasGoal, CanonicalDropckOutlivesGoal, CanonicalImpliedOutlivesBoundsGoal,
67 CanonicalPredicateGoal, CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal,
68 CanonicalTypeOpNormalizeGoal, CanonicalTypeOpProvePredicateGoal, DropckConstraint,
69 DropckOutlivesResult, MethodAutoderefStepsResult, NoSolution, NormalizationResult,
70 OutlivesBound,
71};
72use crate::traits::{
73 CodegenObligationError, DynCompatibilityViolation, EvaluationResult, ImplSource,
74 ObligationCause, OverflowError, WellFormedLoc, specialization_graph,
75};
76use crate::ty::fast_reject::SimplifiedType;
77use crate::ty::layout::ValidityRequirement;
78use crate::ty::print::{PrintTraitRefExt, describe_as_module};
79use crate::ty::util::AlwaysRequiresDrop;
80use crate::ty::{
81 self, CrateInherentImpls, GenericArg, GenericArgsRef, PseudoCanonicalInput, Ty, TyCtxt,
82 TyCtxtFeed,
83};
84use crate::{dep_graph, mir, thir};
85
86mod arena_cached;
87pub mod erase;
88mod keys;
89pub use keys::{AsLocalKey, Key, LocalCrate};
90pub mod on_disk_cache;
91#[macro_use]
92pub mod plumbing;
93pub use plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk};
94
95rustc_queries! {
107 query trigger_delayed_bug(key: DefId) {
109 desc { "triggering a delayed bug for testing incremental" }
110 }
111
112 query registered_tools(_: ()) -> &'tcx ty::RegisteredTools {
114 arena_cache
115 desc { "compute registered tools for crate" }
116 }
117
118 query early_lint_checks(_: ()) {
119 desc { "perform lints prior to AST lowering" }
120 }
121
122 query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
123 no_hash
124 desc { "getting the resolver outputs" }
125 }
126
127 query resolver_for_lowering_raw(_: ()) -> (&'tcx Steal<(ty::ResolverAstLowering, Arc<ast::Crate>)>, &'tcx ty::ResolverGlobalCtxt) {
128 eval_always
129 no_hash
130 desc { "getting the resolver for lowering" }
131 }
132
133 query source_span(key: LocalDefId) -> Span {
139 eval_always
141 desc { "getting the source span" }
142 }
143
144 query hir_crate(key: ()) -> &'tcx Crate<'tcx> {
152 arena_cache
153 eval_always
154 desc { "getting the crate HIR" }
155 }
156
157 query hir_crate_items(_: ()) -> &'tcx rustc_middle::hir::ModuleItems {
159 arena_cache
160 eval_always
161 desc { "getting HIR crate items" }
162 }
163
164 query hir_module_items(key: LocalModDefId) -> &'tcx rustc_middle::hir::ModuleItems {
169 arena_cache
170 desc { |tcx| "getting HIR module items in `{}`", tcx.def_path_str(key) }
171 cache_on_disk_if { true }
172 }
173
174 query local_def_id_to_hir_id(key: LocalDefId) -> hir::HirId {
176 desc { |tcx| "getting HIR ID of `{}`", tcx.def_path_str(key) }
177 feedable
178 }
179
180 query hir_owner_parent(key: hir::OwnerId) -> hir::HirId {
185 desc { |tcx| "getting HIR parent of `{}`", tcx.def_path_str(key) }
186 }
187
188 query opt_hir_owner_nodes(key: LocalDefId) -> Option<&'tcx hir::OwnerNodes<'tcx>> {
193 desc { |tcx| "getting HIR owner items in `{}`", tcx.def_path_str(key) }
194 feedable
195 }
196
197 query hir_attr_map(key: hir::OwnerId) -> &'tcx hir::AttributeMap<'tcx> {
202 desc { |tcx| "getting HIR owner attributes in `{}`", tcx.def_path_str(key) }
203 feedable
204 }
205
206 query const_param_default(param: DefId) -> ty::EarlyBinder<'tcx, ty::Const<'tcx>> {
210 desc { |tcx| "computing the default for const parameter `{}`", tcx.def_path_str(param) }
211 cache_on_disk_if { param.is_local() }
212 separate_provide_extern
213 }
214
215 query type_of(key: DefId) -> ty::EarlyBinder<'tcx, Ty<'tcx>> {
234 desc { |tcx|
235 "{action} `{path}`",
236 action = match tcx.def_kind(key) {
237 DefKind::TyAlias => "expanding type alias",
238 DefKind::TraitAlias => "expanding trait alias",
239 _ => "computing type of",
240 },
241 path = tcx.def_path_str(key),
242 }
243 cache_on_disk_if { key.is_local() }
244 separate_provide_extern
245 feedable
246 }
247
248 query type_of_opaque(key: DefId) -> Result<ty::EarlyBinder<'tcx, Ty<'tcx>>, CyclePlaceholder> {
257 desc { |tcx|
258 "computing type of opaque `{path}`",
259 path = tcx.def_path_str(key),
260 }
261 cycle_stash
262 }
263
264 query type_alias_is_lazy(key: DefId) -> bool {
278 desc { |tcx|
279 "computing whether the type alias `{path}` is lazy",
280 path = tcx.def_path_str(key),
281 }
282 separate_provide_extern
283 }
284
285 query collect_return_position_impl_trait_in_trait_tys(key: DefId)
286 -> Result<&'tcx DefIdMap<ty::EarlyBinder<'tcx, Ty<'tcx>>>, ErrorGuaranteed>
287 {
288 desc { "comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process" }
289 cache_on_disk_if { key.is_local() }
290 separate_provide_extern
291 }
292
293 query opaque_ty_origin(key: DefId) -> hir::OpaqueTyOrigin<DefId>
294 {
295 desc { "determine where the opaque originates from" }
296 separate_provide_extern
297 }
298
299 query unsizing_params_for_adt(key: DefId) -> &'tcx rustc_index::bit_set::DenseBitSet<u32>
300 {
301 arena_cache
302 desc { |tcx|
303 "determining what parameters of `{}` can participate in unsizing",
304 tcx.def_path_str(key),
305 }
306 }
307
308 query analysis(key: ()) {
310 eval_always
311 desc { "running analysis passes on this crate" }
312 }
313
314 query check_expectations(key: Option<Symbol>) {
329 eval_always
330 desc { "checking lint expectations (RFC 2383)" }
331 }
332
333 query generics_of(key: DefId) -> &'tcx ty::Generics {
335 desc { |tcx| "computing generics of `{}`", tcx.def_path_str(key) }
336 arena_cache
337 cache_on_disk_if { key.is_local() }
338 separate_provide_extern
339 feedable
340 }
341
342 query predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
350 desc { |tcx| "computing predicates of `{}`", tcx.def_path_str(key) }
351 cache_on_disk_if { key.is_local() }
352 feedable
353 }
354
355 query opaque_types_defined_by(
356 key: LocalDefId
357 ) -> &'tcx ty::List<LocalDefId> {
358 desc {
359 |tcx| "computing the opaque types defined by `{}`",
360 tcx.def_path_str(key.to_def_id())
361 }
362 }
363
364 query explicit_item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
383 desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
384 cache_on_disk_if { key.is_local() }
385 separate_provide_extern
386 feedable
387 }
388
389 query explicit_item_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
396 desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
397 cache_on_disk_if { key.is_local() }
398 separate_provide_extern
399 feedable
400 }
401
402 query item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
426 desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
427 }
428
429 query item_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
430 desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
431 }
432
433 query item_non_self_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
434 desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
435 }
436
437 query impl_super_outlives(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
438 desc { |tcx| "elaborating supertrait outlives for trait of `{}`", tcx.def_path_str(key) }
439 }
440
441 query native_libraries(_: CrateNum) -> &'tcx Vec<NativeLib> {
446 arena_cache
447 desc { "looking up the native libraries of a linked crate" }
448 separate_provide_extern
449 }
450
451 query shallow_lint_levels_on(key: hir::OwnerId) -> &'tcx rustc_middle::lint::ShallowLintLevelMap {
452 arena_cache
453 desc { |tcx| "looking up lint levels for `{}`", tcx.def_path_str(key) }
454 }
455
456 query lint_expectations(_: ()) -> &'tcx Vec<(LintExpectationId, LintExpectation)> {
457 arena_cache
458 desc { "computing `#[expect]`ed lints in this crate" }
459 }
460
461 query lints_that_dont_need_to_run(_: ()) -> &'tcx FxIndexSet<LintId> {
462 arena_cache
463 desc { "Computing all lints that are explicitly enabled or with a default level greater than Allow" }
464 }
465
466 query expn_that_defined(key: DefId) -> rustc_span::ExpnId {
467 desc { |tcx| "getting the expansion that defined `{}`", tcx.def_path_str(key) }
468 separate_provide_extern
469 }
470
471 query is_panic_runtime(_: CrateNum) -> bool {
472 fatal_cycle
473 desc { "checking if the crate is_panic_runtime" }
474 separate_provide_extern
475 }
476
477 query representability(_: LocalDefId) -> rustc_middle::ty::Representability {
479 desc { "checking if `{}` is representable", tcx.def_path_str(key) }
480 cycle_delay_bug
482 anon
486 }
487
488 query representability_adt_ty(_: Ty<'tcx>) -> rustc_middle::ty::Representability {
490 desc { "checking if `{}` is representable", key }
491 cycle_delay_bug
492 anon
493 }
494
495 query params_in_repr(key: DefId) -> &'tcx rustc_index::bit_set::DenseBitSet<u32> {
497 desc { "finding type parameters in the representation" }
498 arena_cache
499 no_hash
500 separate_provide_extern
501 }
502
503 query thir_body(key: LocalDefId) -> Result<(&'tcx Steal<thir::Thir<'tcx>>, thir::ExprId), ErrorGuaranteed> {
505 no_hash
507 desc { |tcx| "building THIR for `{}`", tcx.def_path_str(key) }
508 }
509
510 query mir_keys(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexSet<LocalDefId> {
514 arena_cache
515 desc { "getting a list of all mir_keys" }
516 }
517
518 query mir_const_qualif(key: DefId) -> mir::ConstQualifs {
522 desc { |tcx| "const checking `{}`", tcx.def_path_str(key) }
523 cache_on_disk_if { key.is_local() }
524 separate_provide_extern
525 }
526
527 query mir_built(key: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
533 desc { |tcx| "building MIR for `{}`", tcx.def_path_str(key) }
534 feedable
535 }
536
537 query thir_abstract_const(
539 key: DefId
540 ) -> Result<Option<ty::EarlyBinder<'tcx, ty::Const<'tcx>>>, ErrorGuaranteed> {
541 desc {
542 |tcx| "building an abstract representation for `{}`", tcx.def_path_str(key),
543 }
544 separate_provide_extern
545 }
546
547 query mir_drops_elaborated_and_const_checked(key: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
548 no_hash
549 desc { |tcx| "elaborating drops for `{}`", tcx.def_path_str(key) }
550 }
551
552 query mir_for_ctfe(
553 key: DefId
554 ) -> &'tcx mir::Body<'tcx> {
555 desc { |tcx| "caching mir of `{}` for CTFE", tcx.def_path_str(key) }
556 cache_on_disk_if { key.is_local() }
557 separate_provide_extern
558 }
559
560 query mir_promoted(key: LocalDefId) -> (
561 &'tcx Steal<mir::Body<'tcx>>,
562 &'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
563 ) {
564 no_hash
565 desc { |tcx| "promoting constants in MIR for `{}`", tcx.def_path_str(key) }
566 }
567
568 query closure_typeinfo(key: LocalDefId) -> ty::ClosureTypeInfo<'tcx> {
569 desc {
570 |tcx| "finding symbols for captures of closure `{}`",
571 tcx.def_path_str(key)
572 }
573 }
574
575 query closure_saved_names_of_captured_variables(def_id: DefId) -> &'tcx IndexVec<abi::FieldIdx, Symbol> {
583 arena_cache
584 desc { |tcx| "computing debuginfo for closure `{}`", tcx.def_path_str(def_id) }
585 separate_provide_extern
586 }
587
588 query mir_coroutine_witnesses(key: DefId) -> Option<&'tcx mir::CoroutineLayout<'tcx>> {
589 arena_cache
590 desc { |tcx| "coroutine witness types for `{}`", tcx.def_path_str(key) }
591 cache_on_disk_if { key.is_local() }
592 separate_provide_extern
593 }
594
595 query check_coroutine_obligations(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
596 desc { |tcx| "verify auto trait bounds for coroutine interior type `{}`", tcx.def_path_str(key) }
597 }
598
599 query optimized_mir(key: DefId) -> &'tcx mir::Body<'tcx> {
602 desc { |tcx| "optimizing MIR for `{}`", tcx.def_path_str(key) }
603 cache_on_disk_if { key.is_local() }
604 separate_provide_extern
605 }
606
607 query coverage_attr_on(key: LocalDefId) -> bool {
613 desc { |tcx| "checking for `#[coverage(..)]` on `{}`", tcx.def_path_str(key) }
614 feedable
615 }
616
617 query coverage_ids_info(key: ty::InstanceKind<'tcx>) -> Option<&'tcx mir::coverage::CoverageIdsInfo> {
630 desc { |tcx| "retrieving coverage IDs info from MIR for `{}`", tcx.def_path_str(key.def_id()) }
631 arena_cache
632 }
633
634 query promoted_mir(key: DefId) -> &'tcx IndexVec<mir::Promoted, mir::Body<'tcx>> {
640 desc { |tcx| "optimizing promoted MIR for `{}`", tcx.def_path_str(key) }
641 cache_on_disk_if { key.is_local() }
642 separate_provide_extern
643 }
644
645 query erase_regions_ty(ty: Ty<'tcx>) -> Ty<'tcx> {
649 anon
656 desc { "erasing regions from `{}`", ty }
657 }
658
659 query wasm_import_module_map(_: CrateNum) -> &'tcx DefIdMap<String> {
660 arena_cache
661 desc { "getting wasm import module map" }
662 }
663
664 query trait_explicit_predicates_and_bounds(key: LocalDefId) -> ty::GenericPredicates<'tcx> {
686 desc { |tcx| "computing explicit predicates of trait `{}`", tcx.def_path_str(key) }
687 }
688
689 query explicit_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
695 desc { |tcx| "computing explicit predicates of `{}`", tcx.def_path_str(key) }
696 cache_on_disk_if { key.is_local() }
697 separate_provide_extern
698 feedable
699 }
700
701 query inferred_outlives_of(key: DefId) -> &'tcx [(ty::Clause<'tcx>, Span)] {
708 desc { |tcx| "computing inferred outlives-predicates of `{}`", tcx.def_path_str(key) }
709 cache_on_disk_if { key.is_local() }
710 separate_provide_extern
711 feedable
712 }
713
714 query explicit_super_predicates_of(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
722 desc { |tcx| "computing the super predicates of `{}`", tcx.def_path_str(key) }
723 cache_on_disk_if { key.is_local() }
724 separate_provide_extern
725 }
726
727 query explicit_implied_predicates_of(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
734 desc { |tcx| "computing the implied predicates of `{}`", tcx.def_path_str(key) }
735 cache_on_disk_if { key.is_local() }
736 separate_provide_extern
737 }
738
739 query explicit_supertraits_containing_assoc_item(
743 key: (DefId, rustc_span::Ident)
744 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
745 desc { |tcx| "computing the super traits of `{}` with associated type name `{}`",
746 tcx.def_path_str(key.0),
747 key.1
748 }
749 }
750
751 query const_conditions(
761 key: DefId
762 ) -> ty::ConstConditions<'tcx> {
763 desc { |tcx| "computing the conditions for `{}` to be considered const",
764 tcx.def_path_str(key)
765 }
766 separate_provide_extern
767 }
768
769 query explicit_implied_const_bounds(
775 key: DefId
776 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::PolyTraitRef<'tcx>, Span)]> {
777 desc { |tcx| "computing the implied `~const` bounds for `{}`",
778 tcx.def_path_str(key)
779 }
780 separate_provide_extern
781 }
782
783 query type_param_predicates(
786 key: (LocalDefId, LocalDefId, rustc_span::Ident)
787 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
788 desc { |tcx| "computing the bounds for type parameter `{}`", tcx.hir_ty_param_name(key.1) }
789 }
790
791 query trait_def(key: DefId) -> &'tcx ty::TraitDef {
792 desc { |tcx| "computing trait definition for `{}`", tcx.def_path_str(key) }
793 arena_cache
794 cache_on_disk_if { key.is_local() }
795 separate_provide_extern
796 }
797 query adt_def(key: DefId) -> ty::AdtDef<'tcx> {
798 desc { |tcx| "computing ADT definition for `{}`", tcx.def_path_str(key) }
799 cache_on_disk_if { key.is_local() }
800 separate_provide_extern
801 }
802 query adt_destructor(key: DefId) -> Option<ty::Destructor> {
803 desc { |tcx| "computing `Drop` impl for `{}`", tcx.def_path_str(key) }
804 cache_on_disk_if { key.is_local() }
805 separate_provide_extern
806 }
807 query adt_async_destructor(key: DefId) -> Option<ty::AsyncDestructor> {
808 desc { |tcx| "computing `AsyncDrop` impl for `{}`", tcx.def_path_str(key) }
809 cache_on_disk_if { key.is_local() }
810 separate_provide_extern
811 }
812
813 query adt_sized_constraint(key: DefId) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> {
814 desc { |tcx| "computing the `Sized` constraint for `{}`", tcx.def_path_str(key) }
815 }
816
817 query adt_dtorck_constraint(
818 key: DefId
819 ) -> &'tcx DropckConstraint<'tcx> {
820 desc { |tcx| "computing drop-check constraints for `{}`", tcx.def_path_str(key) }
821 }
822
823 query constness(key: DefId) -> hir::Constness {
845 desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) }
846 separate_provide_extern
847 feedable
848 }
849
850 query asyncness(key: DefId) -> ty::Asyncness {
851 desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) }
852 separate_provide_extern
853 }
854
855 query is_promotable_const_fn(key: DefId) -> bool {
863 desc { |tcx| "checking if item is promotable: `{}`", tcx.def_path_str(key) }
864 }
865
866 query coroutine_by_move_body_def_id(def_id: DefId) -> DefId {
873 desc { |tcx| "looking up the coroutine by-move body for `{}`", tcx.def_path_str(def_id) }
874 separate_provide_extern
875 }
876
877 query coroutine_kind(def_id: DefId) -> Option<hir::CoroutineKind> {
879 desc { |tcx| "looking up coroutine kind of `{}`", tcx.def_path_str(def_id) }
880 separate_provide_extern
881 feedable
882 }
883
884 query coroutine_for_closure(def_id: DefId) -> DefId {
885 desc { |_tcx| "Given a coroutine-closure def id, return the def id of the coroutine returned by it" }
886 separate_provide_extern
887 }
888
889 query crate_variances(_: ()) -> &'tcx ty::CrateVariancesMap<'tcx> {
897 arena_cache
898 desc { "computing the variances for items in this crate" }
899 }
900
901 query variances_of(def_id: DefId) -> &'tcx [ty::Variance] {
909 desc { |tcx| "computing the variances of `{}`", tcx.def_path_str(def_id) }
910 cache_on_disk_if { def_id.is_local() }
911 separate_provide_extern
912 cycle_delay_bug
913 }
914
915 query inferred_outlives_crate(_: ()) -> &'tcx ty::CratePredicatesMap<'tcx> {
923 arena_cache
924 desc { "computing the inferred outlives-predicates for items in this crate" }
925 }
926
927 query associated_item_def_ids(key: DefId) -> &'tcx [DefId] {
930 desc { |tcx| "collecting associated items or fields of `{}`", tcx.def_path_str(key) }
931 cache_on_disk_if { key.is_local() }
932 separate_provide_extern
933 }
934
935 query associated_item(key: DefId) -> ty::AssocItem {
937 desc { |tcx| "computing associated item data for `{}`", tcx.def_path_str(key) }
938 cache_on_disk_if { key.is_local() }
939 separate_provide_extern
940 feedable
941 }
942
943 query associated_items(key: DefId) -> &'tcx ty::AssocItems {
945 arena_cache
946 desc { |tcx| "collecting associated items of `{}`", tcx.def_path_str(key) }
947 }
948
949 query impl_item_implementor_ids(impl_id: DefId) -> &'tcx DefIdMap<DefId> {
971 arena_cache
972 desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
973 }
974
975 query associated_types_for_impl_traits_in_associated_fn(fn_def_id: DefId) -> &'tcx [DefId] {
982 desc { |tcx| "creating associated items for opaque types returned by `{}`", tcx.def_path_str(fn_def_id) }
983 cache_on_disk_if { fn_def_id.is_local() }
984 separate_provide_extern
985 }
986
987 query associated_type_for_impl_trait_in_trait(opaque_ty_def_id: LocalDefId) -> LocalDefId {
990 desc { |tcx| "creating the associated item corresponding to the opaque type `{}`", tcx.def_path_str(opaque_ty_def_id.to_def_id()) }
991 cache_on_disk_if { true }
992 }
993
994 query impl_trait_header(impl_id: DefId) -> Option<ty::ImplTraitHeader<'tcx>> {
997 desc { |tcx| "computing trait implemented by `{}`", tcx.def_path_str(impl_id) }
998 cache_on_disk_if { impl_id.is_local() }
999 separate_provide_extern
1000 }
1001
1002 query inherent_impls(key: DefId) -> &'tcx [DefId] {
1006 desc { |tcx| "collecting inherent impls for `{}`", tcx.def_path_str(key) }
1007 cache_on_disk_if { key.is_local() }
1008 separate_provide_extern
1009 }
1010
1011 query incoherent_impls(key: SimplifiedType) -> &'tcx [DefId] {
1012 desc { |tcx| "collecting all inherent impls for `{:?}`", key }
1013 }
1014
1015 query check_unsafety(key: LocalDefId) {
1017 desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
1018 cache_on_disk_if { true }
1019 }
1020
1021 query check_tail_calls(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1023 desc { |tcx| "tail-call-checking `{}`", tcx.def_path_str(key) }
1024 cache_on_disk_if { true }
1025 }
1026
1027 query assumed_wf_types(key: LocalDefId) -> &'tcx [(Ty<'tcx>, Span)] {
1032 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1033 }
1034
1035 query assumed_wf_types_for_rpitit(key: DefId) -> &'tcx [(Ty<'tcx>, Span)] {
1038 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1039 separate_provide_extern
1040 }
1041
1042 query fn_sig(key: DefId) -> ty::EarlyBinder<'tcx, ty::PolyFnSig<'tcx>> {
1044 desc { |tcx| "computing function signature of `{}`", tcx.def_path_str(key) }
1045 cache_on_disk_if { key.is_local() }
1046 separate_provide_extern
1047 cycle_delay_bug
1048 }
1049
1050 query lint_mod(key: LocalModDefId) {
1052 desc { |tcx| "linting {}", describe_as_module(key, tcx) }
1053 }
1054
1055 query check_unused_traits(_: ()) {
1056 desc { "checking unused trait imports in crate" }
1057 }
1058
1059 query check_mod_attrs(key: LocalModDefId) {
1061 desc { |tcx| "checking attributes in {}", describe_as_module(key, tcx) }
1062 }
1063
1064 query check_mod_unstable_api_usage(key: LocalModDefId) {
1066 desc { |tcx| "checking for unstable API usage in {}", describe_as_module(key, tcx) }
1067 }
1068
1069 query check_mod_loops(key: LocalModDefId) {
1071 desc { |tcx| "checking loops in {}", describe_as_module(key, tcx) }
1072 }
1073
1074 query check_mod_naked_functions(key: LocalModDefId) {
1075 desc { |tcx| "checking naked functions in {}", describe_as_module(key, tcx) }
1076 }
1077
1078 query check_mod_privacy(key: LocalModDefId) {
1079 desc { |tcx| "checking privacy in {}", describe_as_module(key.to_local_def_id(), tcx) }
1080 }
1081
1082 query check_liveness(key: LocalDefId) {
1083 desc { |tcx| "checking liveness of variables in `{}`", tcx.def_path_str(key) }
1084 }
1085
1086 query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx (
1091 LocalDefIdSet,
1092 LocalDefIdMap<Vec<(DefId, DefId)>>
1093 ) {
1094 arena_cache
1095 desc { "finding live symbols in crate" }
1096 }
1097
1098 query check_mod_deathness(key: LocalModDefId) {
1099 desc { |tcx| "checking deathness of variables in {}", describe_as_module(key, tcx) }
1100 }
1101
1102 query check_mod_type_wf(key: LocalModDefId) -> Result<(), ErrorGuaranteed> {
1103 desc { |tcx| "checking that types are well-formed in {}", describe_as_module(key, tcx) }
1104 return_result_from_ensure_ok
1105 }
1106
1107 query coerce_unsized_info(key: DefId) -> Result<ty::adjustment::CoerceUnsizedInfo, ErrorGuaranteed> {
1109 desc { |tcx| "computing CoerceUnsized info for `{}`", tcx.def_path_str(key) }
1110 cache_on_disk_if { key.is_local() }
1111 separate_provide_extern
1112 return_result_from_ensure_ok
1113 }
1114
1115 query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
1116 desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
1117 cache_on_disk_if(tcx) { !tcx.is_typeck_child(key.to_def_id()) }
1118 }
1119
1120 query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
1121 desc { |tcx| "finding used_trait_imports `{}`", tcx.def_path_str(key) }
1122 cache_on_disk_if { true }
1123 }
1124
1125 query coherent_trait(def_id: DefId) -> Result<(), ErrorGuaranteed> {
1126 desc { |tcx| "coherence checking all impls of trait `{}`", tcx.def_path_str(def_id) }
1127 return_result_from_ensure_ok
1128 }
1129
1130 query mir_borrowck(key: LocalDefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
1133 desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key) }
1134 cache_on_disk_if(tcx) { tcx.is_typeck_child(key.to_def_id()) }
1135 }
1136
1137 query crate_inherent_impls(k: ()) -> (&'tcx CrateInherentImpls, Result<(), ErrorGuaranteed>) {
1145 desc { "finding all inherent impls defined in crate" }
1146 }
1147
1148 query crate_inherent_impls_validity_check(_: ()) -> Result<(), ErrorGuaranteed> {
1156 desc { "check for inherent impls that should not be defined in crate" }
1157 return_result_from_ensure_ok
1158 }
1159
1160 query crate_inherent_impls_overlap_check(_: ()) -> Result<(), ErrorGuaranteed> {
1168 desc { "check for overlap between inherent impls defined in this crate" }
1169 return_result_from_ensure_ok
1170 }
1171
1172 query orphan_check_impl(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1175 desc { |tcx|
1176 "checking whether impl `{}` follows the orphan rules",
1177 tcx.def_path_str(key),
1178 }
1179 return_result_from_ensure_ok
1180 }
1181
1182 query mir_callgraph_reachable(key: (ty::Instance<'tcx>, LocalDefId)) -> bool {
1185 fatal_cycle
1186 desc { |tcx|
1187 "computing if `{}` (transitively) calls `{}`",
1188 key.0,
1189 tcx.def_path_str(key.1),
1190 }
1191 }
1192
1193 query mir_inliner_callees(key: ty::InstanceKind<'tcx>) -> &'tcx [(DefId, GenericArgsRef<'tcx>)] {
1195 fatal_cycle
1196 desc { |tcx|
1197 "computing all local function calls in `{}`",
1198 tcx.def_path_str(key.def_id()),
1199 }
1200 }
1201
1202 query tag_for_variant(
1210 key: (Ty<'tcx>, abi::VariantIdx)
1211 ) -> Option<ty::ScalarInt> {
1212 desc { "computing variant tag for enum" }
1213 }
1214
1215 query eval_to_allocation_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1224 -> EvalToAllocationRawResult<'tcx> {
1225 desc { |tcx|
1226 "const-evaluating + checking `{}`",
1227 key.value.display(tcx)
1228 }
1229 cache_on_disk_if { true }
1230 }
1231
1232 query eval_static_initializer(key: DefId) -> EvalStaticInitializerRawResult<'tcx> {
1234 desc { |tcx|
1235 "evaluating initializer of static `{}`",
1236 tcx.def_path_str(key)
1237 }
1238 cache_on_disk_if { key.is_local() }
1239 separate_provide_extern
1240 feedable
1241 }
1242
1243 query eval_to_const_value_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1256 -> EvalToConstValueResult<'tcx> {
1257 desc { |tcx|
1258 "simplifying constant for the type system `{}`",
1259 key.value.display(tcx)
1260 }
1261 depth_limit
1262 cache_on_disk_if { true }
1263 }
1264
1265 query eval_to_valtree(
1268 key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>
1269 ) -> EvalToValTreeResult<'tcx> {
1270 desc { "evaluating type-level constant" }
1271 }
1272
1273 query valtree_to_const_val(key: ty::Value<'tcx>) -> mir::ConstValue<'tcx> {
1275 desc { "converting type-level constant value to MIR constant value"}
1276 }
1277
1278 query destructure_const(key: ty::Const<'tcx>) -> ty::DestructuredConst<'tcx> {
1281 desc { "destructuring type level constant"}
1282 }
1283
1284 query lit_to_const(
1286 key: LitToConstInput<'tcx>
1287 ) -> ty::Const<'tcx> {
1288 desc { "converting literal to const" }
1289 }
1290
1291 query check_match(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1292 desc { |tcx| "match-checking `{}`", tcx.def_path_str(key) }
1293 cache_on_disk_if { true }
1294 }
1295
1296 query effective_visibilities(_: ()) -> &'tcx EffectiveVisibilities {
1298 eval_always
1299 desc { "checking effective visibilities" }
1300 }
1301 query check_private_in_public(_: ()) {
1302 eval_always
1303 desc { "checking for private elements in public interfaces" }
1304 }
1305
1306 query reachable_set(_: ()) -> &'tcx LocalDefIdSet {
1307 arena_cache
1308 desc { "reachability" }
1309 cache_on_disk_if { true }
1310 }
1311
1312 query region_scope_tree(def_id: DefId) -> &'tcx crate::middle::region::ScopeTree {
1315 desc { |tcx| "computing drop scopes for `{}`", tcx.def_path_str(def_id) }
1316 }
1317
1318 query mir_shims(key: ty::InstanceKind<'tcx>) -> &'tcx mir::Body<'tcx> {
1320 arena_cache
1321 desc { |tcx| "generating MIR shim for `{}`", tcx.def_path_str(key.def_id()) }
1322 }
1323
1324 query symbol_name(key: ty::Instance<'tcx>) -> ty::SymbolName<'tcx> {
1328 desc { "computing the symbol for `{}`", key }
1329 cache_on_disk_if { true }
1330 }
1331
1332 query def_kind(def_id: DefId) -> DefKind {
1333 desc { |tcx| "looking up definition kind of `{}`", tcx.def_path_str(def_id) }
1334 cache_on_disk_if { def_id.is_local() }
1335 separate_provide_extern
1336 feedable
1337 }
1338
1339 query def_span(def_id: DefId) -> Span {
1341 desc { |tcx| "looking up span for `{}`", tcx.def_path_str(def_id) }
1342 cache_on_disk_if { def_id.is_local() }
1343 separate_provide_extern
1344 feedable
1345 }
1346
1347 query def_ident_span(def_id: DefId) -> Option<Span> {
1349 desc { |tcx| "looking up span for `{}`'s identifier", tcx.def_path_str(def_id) }
1350 cache_on_disk_if { def_id.is_local() }
1351 separate_provide_extern
1352 feedable
1353 }
1354
1355 query lookup_stability(def_id: DefId) -> Option<attr::Stability> {
1356 desc { |tcx| "looking up stability of `{}`", tcx.def_path_str(def_id) }
1357 cache_on_disk_if { def_id.is_local() }
1358 separate_provide_extern
1359 }
1360
1361 query lookup_const_stability(def_id: DefId) -> Option<attr::ConstStability> {
1362 desc { |tcx| "looking up const stability of `{}`", tcx.def_path_str(def_id) }
1363 cache_on_disk_if { def_id.is_local() }
1364 separate_provide_extern
1365 }
1366
1367 query lookup_default_body_stability(def_id: DefId) -> Option<attr::DefaultBodyStability> {
1368 desc { |tcx| "looking up default body stability of `{}`", tcx.def_path_str(def_id) }
1369 separate_provide_extern
1370 }
1371
1372 query should_inherit_track_caller(def_id: DefId) -> bool {
1373 desc { |tcx| "computing should_inherit_track_caller of `{}`", tcx.def_path_str(def_id) }
1374 }
1375
1376 query lookup_deprecation_entry(def_id: DefId) -> Option<DeprecationEntry> {
1377 desc { |tcx| "checking whether `{}` is deprecated", tcx.def_path_str(def_id) }
1378 cache_on_disk_if { def_id.is_local() }
1379 separate_provide_extern
1380 }
1381
1382 query is_doc_hidden(def_id: DefId) -> bool {
1384 desc { |tcx| "checking whether `{}` is `doc(hidden)`", tcx.def_path_str(def_id) }
1385 separate_provide_extern
1386 }
1387
1388 query is_doc_notable_trait(def_id: DefId) -> bool {
1390 desc { |tcx| "checking whether `{}` is `doc(notable_trait)`", tcx.def_path_str(def_id) }
1391 }
1392
1393 query attrs_for_def(def_id: DefId) -> &'tcx [hir::Attribute] {
1397 desc { |tcx| "collecting attributes of `{}`", tcx.def_path_str(def_id) }
1398 separate_provide_extern
1399 }
1400
1401 query codegen_fn_attrs(def_id: DefId) -> &'tcx CodegenFnAttrs {
1402 desc { |tcx| "computing codegen attributes of `{}`", tcx.def_path_str(def_id) }
1403 arena_cache
1404 cache_on_disk_if { def_id.is_local() }
1405 separate_provide_extern
1406 feedable
1407 }
1408
1409 query asm_target_features(def_id: DefId) -> &'tcx FxIndexSet<Symbol> {
1410 desc { |tcx| "computing target features for inline asm of `{}`", tcx.def_path_str(def_id) }
1411 }
1412
1413 query fn_arg_names(def_id: DefId) -> &'tcx [Option<rustc_span::Ident>] {
1414 desc { |tcx| "looking up function parameter names for `{}`", tcx.def_path_str(def_id) }
1415 separate_provide_extern
1416 }
1417
1418 query rendered_const(def_id: DefId) -> &'tcx String {
1421 arena_cache
1422 desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
1423 separate_provide_extern
1424 }
1425
1426 query rendered_precise_capturing_args(def_id: DefId) -> Option<&'tcx [PreciseCapturingArgKind<Symbol, Symbol>]> {
1428 desc { |tcx| "rendering precise capturing args for `{}`", tcx.def_path_str(def_id) }
1429 separate_provide_extern
1430 }
1431
1432 query impl_parent(def_id: DefId) -> Option<DefId> {
1433 desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) }
1434 separate_provide_extern
1435 }
1436
1437 query is_ctfe_mir_available(key: DefId) -> bool {
1438 desc { |tcx| "checking if item has CTFE MIR available: `{}`", tcx.def_path_str(key) }
1439 cache_on_disk_if { key.is_local() }
1440 separate_provide_extern
1441 }
1442 query is_mir_available(key: DefId) -> bool {
1443 desc { |tcx| "checking if item has MIR available: `{}`", tcx.def_path_str(key) }
1444 cache_on_disk_if { key.is_local() }
1445 separate_provide_extern
1446 }
1447
1448 query own_existential_vtable_entries(
1449 key: DefId
1450 ) -> &'tcx [DefId] {
1451 desc { |tcx| "finding all existential vtable entries for trait `{}`", tcx.def_path_str(key) }
1452 }
1453
1454 query vtable_entries(key: ty::TraitRef<'tcx>)
1455 -> &'tcx [ty::VtblEntry<'tcx>] {
1456 desc { |tcx| "finding all vtable entries for trait `{}`", tcx.def_path_str(key.def_id) }
1457 }
1458
1459 query first_method_vtable_slot(key: ty::TraitRef<'tcx>) -> usize {
1460 desc { |tcx| "finding the slot within the vtable of `{}` for the implementation of `{}`", key.self_ty(), key.print_only_trait_name() }
1461 }
1462
1463 query supertrait_vtable_slot(key: (Ty<'tcx>, Ty<'tcx>)) -> Option<usize> {
1464 desc { |tcx| "finding the slot within vtable for trait object `{}` vtable ptr during trait upcasting coercion from `{}` vtable",
1465 key.1, key.0 }
1466 }
1467
1468 query vtable_allocation(key: (Ty<'tcx>, Option<ty::ExistentialTraitRef<'tcx>>)) -> mir::interpret::AllocId {
1469 desc { |tcx| "vtable const allocation for <{} as {}>",
1470 key.0,
1471 key.1.map(|trait_ref| format!("{trait_ref}")).unwrap_or("_".to_owned())
1472 }
1473 }
1474
1475 query codegen_select_candidate(
1476 key: PseudoCanonicalInput<'tcx, ty::TraitRef<'tcx>>
1477 ) -> Result<&'tcx ImplSource<'tcx, ()>, CodegenObligationError> {
1478 cache_on_disk_if { true }
1479 desc { |tcx| "computing candidate for `{}`", key.value }
1480 }
1481
1482 query all_local_trait_impls(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexMap<DefId, Vec<LocalDefId>> {
1484 desc { "finding local trait impls" }
1485 }
1486
1487 query trait_impls_of(trait_id: DefId) -> &'tcx ty::trait_def::TraitImpls {
1489 arena_cache
1490 desc { |tcx| "finding trait impls of `{}`", tcx.def_path_str(trait_id) }
1491 }
1492
1493 query specialization_graph_of(trait_id: DefId) -> Result<&'tcx specialization_graph::Graph, ErrorGuaranteed> {
1494 desc { |tcx| "building specialization graph of trait `{}`", tcx.def_path_str(trait_id) }
1495 cache_on_disk_if { true }
1496 return_result_from_ensure_ok
1497 }
1498 query dyn_compatibility_violations(trait_id: DefId) -> &'tcx [DynCompatibilityViolation] {
1499 desc { |tcx| "determining dyn-compatibility of trait `{}`", tcx.def_path_str(trait_id) }
1500 }
1501 query is_dyn_compatible(trait_id: DefId) -> bool {
1502 desc { |tcx| "checking if trait `{}` is dyn-compatible", tcx.def_path_str(trait_id) }
1503 }
1504
1505 query param_env(def_id: DefId) -> ty::ParamEnv<'tcx> {
1514 desc { |tcx| "computing normalized predicates of `{}`", tcx.def_path_str(def_id) }
1515 feedable
1516 }
1517
1518 query param_env_normalized_for_post_analysis(def_id: DefId) -> ty::ParamEnv<'tcx> {
1522 desc { |tcx| "computing revealed normalized predicates of `{}`", tcx.def_path_str(def_id) }
1523 }
1524
1525 query is_copy_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1528 desc { "computing whether `{}` is `Copy`", env.value }
1529 }
1530 query is_use_cloned_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1533 desc { "computing whether `{}` is `UseCloned`", env.value }
1534 }
1535 query is_sized_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1537 desc { "computing whether `{}` is `Sized`", env.value }
1538 }
1539 query is_freeze_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1541 desc { "computing whether `{}` is freeze", env.value }
1542 }
1543 query is_unpin_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1545 desc { "computing whether `{}` is `Unpin`", env.value }
1546 }
1547 query needs_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1549 desc { "computing whether `{}` needs drop", env.value }
1550 }
1551 query needs_async_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1553 desc { "computing whether `{}` needs async drop", env.value }
1554 }
1555 query has_significant_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1557 desc { "computing whether `{}` has a significant drop", env.value }
1558 }
1559
1560 query has_structural_eq_impl(ty: Ty<'tcx>) -> bool {
1565 desc {
1566 "computing whether `{}` implements `StructuralPartialEq`",
1567 ty
1568 }
1569 }
1570
1571 query adt_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1575 desc { |tcx| "computing when `{}` needs drop", tcx.def_path_str(def_id) }
1576 cache_on_disk_if { true }
1577 }
1578
1579 query adt_significant_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1586 desc { |tcx| "computing when `{}` has a significant destructor", tcx.def_path_str(def_id) }
1587 cache_on_disk_if { false }
1588 }
1589
1590 query list_significant_drop_tys(ty: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> &'tcx ty::List<Ty<'tcx>> {
1608 desc { |tcx| "computing when `{}` has a significant destructor", ty.value }
1609 cache_on_disk_if { false }
1610 }
1611
1612 query layout_of(
1615 key: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>
1616 ) -> Result<ty::layout::TyAndLayout<'tcx>, &'tcx ty::layout::LayoutError<'tcx>> {
1617 depth_limit
1618 desc { "computing layout of `{}`", key.value }
1619 cycle_delay_bug
1621 }
1622
1623 query fn_abi_of_fn_ptr(
1628 key: ty::PseudoCanonicalInput<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1629 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1630 desc { "computing call ABI of `{}` function pointers", key.value.0 }
1631 }
1632
1633 query fn_abi_of_instance(
1639 key: ty::PseudoCanonicalInput<'tcx, (ty::Instance<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1640 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1641 desc { "computing call ABI of `{}`", key.value.0 }
1642 }
1643
1644 query dylib_dependency_formats(_: CrateNum)
1645 -> &'tcx [(CrateNum, LinkagePreference)] {
1646 desc { "getting dylib dependency formats of crate" }
1647 separate_provide_extern
1648 }
1649
1650 query dependency_formats(_: ()) -> &'tcx Arc<crate::middle::dependency_format::Dependencies> {
1651 arena_cache
1652 desc { "getting the linkage format of all dependencies" }
1653 }
1654
1655 query is_compiler_builtins(_: CrateNum) -> bool {
1656 fatal_cycle
1657 desc { "checking if the crate is_compiler_builtins" }
1658 separate_provide_extern
1659 }
1660 query has_global_allocator(_: CrateNum) -> bool {
1661 eval_always
1663 fatal_cycle
1664 desc { "checking if the crate has_global_allocator" }
1665 separate_provide_extern
1666 }
1667 query has_alloc_error_handler(_: CrateNum) -> bool {
1668 eval_always
1670 fatal_cycle
1671 desc { "checking if the crate has_alloc_error_handler" }
1672 separate_provide_extern
1673 }
1674 query has_panic_handler(_: CrateNum) -> bool {
1675 fatal_cycle
1676 desc { "checking if the crate has_panic_handler" }
1677 separate_provide_extern
1678 }
1679 query is_profiler_runtime(_: CrateNum) -> bool {
1680 fatal_cycle
1681 desc { "checking if a crate is `#![profiler_runtime]`" }
1682 separate_provide_extern
1683 }
1684 query has_ffi_unwind_calls(key: LocalDefId) -> bool {
1685 desc { |tcx| "checking if `{}` contains FFI-unwind calls", tcx.def_path_str(key) }
1686 cache_on_disk_if { true }
1687 }
1688 query required_panic_strategy(_: CrateNum) -> Option<PanicStrategy> {
1689 fatal_cycle
1690 desc { "getting a crate's required panic strategy" }
1691 separate_provide_extern
1692 }
1693 query panic_in_drop_strategy(_: CrateNum) -> PanicStrategy {
1694 fatal_cycle
1695 desc { "getting a crate's configured panic-in-drop strategy" }
1696 separate_provide_extern
1697 }
1698 query is_no_builtins(_: CrateNum) -> bool {
1699 fatal_cycle
1700 desc { "getting whether a crate has `#![no_builtins]`" }
1701 separate_provide_extern
1702 }
1703 query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion {
1704 fatal_cycle
1705 desc { "getting a crate's symbol mangling version" }
1706 separate_provide_extern
1707 }
1708
1709 query extern_crate(def_id: CrateNum) -> Option<&'tcx ExternCrate> {
1710 eval_always
1711 desc { "getting crate's ExternCrateData" }
1712 separate_provide_extern
1713 }
1714
1715 query specialization_enabled_in(cnum: CrateNum) -> bool {
1716 desc { "checking whether the crate enabled `specialization`/`min_specialization`" }
1717 separate_provide_extern
1718 }
1719
1720 query specializes(_: (DefId, DefId)) -> bool {
1721 desc { "computing whether impls specialize one another" }
1722 }
1723 query in_scope_traits_map(_: hir::OwnerId)
1724 -> Option<&'tcx ItemLocalMap<Box<[TraitCandidate]>>> {
1725 desc { "getting traits in scope at a block" }
1726 }
1727
1728 query defaultness(def_id: DefId) -> hir::Defaultness {
1730 desc { |tcx| "looking up whether `{}` has `default`", tcx.def_path_str(def_id) }
1731 separate_provide_extern
1732 feedable
1733 }
1734
1735 query check_well_formed(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1736 desc { |tcx| "checking that `{}` is well-formed", tcx.def_path_str(key) }
1737 return_result_from_ensure_ok
1738 }
1739
1740 query enforce_impl_non_lifetime_params_are_constrained(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1741 desc { |tcx| "checking that `{}`'s generics are constrained by the impl header", tcx.def_path_str(key) }
1742 return_result_from_ensure_ok
1743 }
1744
1745 query reachable_non_generics(_: CrateNum)
1758 -> &'tcx DefIdMap<SymbolExportInfo> {
1759 arena_cache
1760 desc { "looking up the exported symbols of a crate" }
1761 separate_provide_extern
1762 }
1763 query is_reachable_non_generic(def_id: DefId) -> bool {
1764 desc { |tcx| "checking whether `{}` is an exported symbol", tcx.def_path_str(def_id) }
1765 cache_on_disk_if { def_id.is_local() }
1766 separate_provide_extern
1767 }
1768 query is_unreachable_local_definition(def_id: LocalDefId) -> bool {
1769 desc { |tcx|
1770 "checking whether `{}` is reachable from outside the crate",
1771 tcx.def_path_str(def_id),
1772 }
1773 }
1774
1775 query upstream_monomorphizations(_: ()) -> &'tcx DefIdMap<UnordMap<GenericArgsRef<'tcx>, CrateNum>> {
1783 arena_cache
1784 desc { "collecting available upstream monomorphizations" }
1785 }
1786
1787 query upstream_monomorphizations_for(def_id: DefId)
1795 -> Option<&'tcx UnordMap<GenericArgsRef<'tcx>, CrateNum>>
1796 {
1797 desc { |tcx|
1798 "collecting available upstream monomorphizations for `{}`",
1799 tcx.def_path_str(def_id),
1800 }
1801 separate_provide_extern
1802 }
1803
1804 query upstream_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1820 desc { "available upstream drop-glue for `{:?}`", args }
1821 }
1822
1823 query upstream_async_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1840 desc { "available upstream async-drop-glue for `{:?}`", args }
1841 }
1842
1843 query foreign_modules(_: CrateNum) -> &'tcx FxIndexMap<DefId, ForeignModule> {
1845 arena_cache
1846 desc { "looking up the foreign modules of a linked crate" }
1847 separate_provide_extern
1848 }
1849
1850 query clashing_extern_declarations(_: ()) {
1852 desc { "checking `extern fn` declarations are compatible" }
1853 }
1854
1855 query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {
1858 desc { "looking up the entry function of a crate" }
1859 }
1860
1861 query proc_macro_decls_static(_: ()) -> Option<LocalDefId> {
1863 desc { "looking up the proc macro declarations for a crate" }
1864 }
1865
1866 query crate_hash(_: CrateNum) -> Svh {
1869 eval_always
1870 desc { "looking up the hash a crate" }
1871 separate_provide_extern
1872 }
1873
1874 query crate_host_hash(_: CrateNum) -> Option<Svh> {
1876 eval_always
1877 desc { "looking up the hash of a host version of a crate" }
1878 separate_provide_extern
1879 }
1880
1881 query extra_filename(_: CrateNum) -> &'tcx String {
1884 arena_cache
1885 eval_always
1886 desc { "looking up the extra filename for a crate" }
1887 separate_provide_extern
1888 }
1889
1890 query crate_extern_paths(_: CrateNum) -> &'tcx Vec<PathBuf> {
1892 arena_cache
1893 eval_always
1894 desc { "looking up the paths for extern crates" }
1895 separate_provide_extern
1896 }
1897
1898 query implementations_of_trait(_: (CrateNum, DefId)) -> &'tcx [(DefId, Option<SimplifiedType>)] {
1901 desc { "looking up implementations of a trait in a crate" }
1902 separate_provide_extern
1903 }
1904
1905 query crate_incoherent_impls(key: (CrateNum, SimplifiedType)) -> &'tcx [DefId] {
1910 desc { |tcx| "collecting all impls for a type in a crate" }
1911 separate_provide_extern
1912 }
1913
1914 query native_library(def_id: DefId) -> Option<&'tcx NativeLib> {
1916 desc { |tcx| "getting the native library for `{}`", tcx.def_path_str(def_id) }
1917 }
1918
1919 query inherit_sig_for_delegation_item(def_id: LocalDefId) -> &'tcx [Ty<'tcx>] {
1920 desc { "inheriting delegation signature" }
1921 }
1922
1923 query resolve_bound_vars(owner_id: hir::OwnerId) -> &'tcx ResolveBoundVars {
1927 arena_cache
1928 desc { |tcx| "resolving lifetimes for `{}`", tcx.def_path_str(owner_id) }
1929 }
1930 query named_variable_map(owner_id: hir::OwnerId) -> &'tcx SortedMap<ItemLocalId, ResolvedArg> {
1931 desc { |tcx| "looking up a named region inside `{}`", tcx.def_path_str(owner_id) }
1932 }
1933 query is_late_bound_map(owner_id: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
1934 desc { |tcx| "testing if a region is late bound inside `{}`", tcx.def_path_str(owner_id) }
1935 }
1936 query object_lifetime_default(def_id: DefId) -> ObjectLifetimeDefault {
1951 desc { "looking up lifetime defaults for type parameter `{}`", tcx.def_path_str(def_id) }
1952 separate_provide_extern
1953 }
1954 query late_bound_vars_map(owner_id: hir::OwnerId)
1955 -> &'tcx SortedMap<ItemLocalId, Vec<ty::BoundVariableKind>> {
1956 desc { |tcx| "looking up late bound vars inside `{}`", tcx.def_path_str(owner_id) }
1957 }
1958 query opaque_captured_lifetimes(def_id: LocalDefId) -> &'tcx [(ResolvedArg, LocalDefId)] {
1973 desc { |tcx| "listing captured lifetimes for opaque `{}`", tcx.def_path_str(def_id) }
1974 }
1975
1976 query visibility(def_id: DefId) -> ty::Visibility<DefId> {
1989 desc { |tcx| "computing visibility of `{}`", tcx.def_path_str(def_id) }
1990 separate_provide_extern
1991 feedable
1992 }
1993
1994 query inhabited_predicate_adt(key: DefId) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
1995 desc { "computing the uninhabited predicate of `{:?}`", key }
1996 }
1997
1998 query inhabited_predicate_type(key: Ty<'tcx>) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
2000 desc { "computing the uninhabited predicate of `{}`", key }
2001 }
2002
2003 query dep_kind(_: CrateNum) -> CrateDepKind {
2004 eval_always
2005 desc { "fetching what a dependency looks like" }
2006 separate_provide_extern
2007 }
2008
2009 query crate_name(_: CrateNum) -> Symbol {
2011 feedable
2012 desc { "fetching what a crate is named" }
2013 separate_provide_extern
2014 }
2015 query module_children(def_id: DefId) -> &'tcx [ModChild] {
2016 desc { |tcx| "collecting child items of module `{}`", tcx.def_path_str(def_id) }
2017 separate_provide_extern
2018 }
2019 query extern_mod_stmt_cnum(def_id: LocalDefId) -> Option<CrateNum> {
2020 desc { |tcx| "computing crate imported by `{}`", tcx.def_path_str(def_id) }
2021 }
2022
2023 query num_extern_def_ids(_: CrateNum) -> usize {
2029 desc { "fetching the number of definitions in a crate" }
2030 separate_provide_extern
2031 }
2032
2033 query lib_features(_: CrateNum) -> &'tcx LibFeatures {
2034 desc { "calculating the lib features defined in a crate" }
2035 separate_provide_extern
2036 arena_cache
2037 }
2038 query stability_implications(_: CrateNum) -> &'tcx UnordMap<Symbol, Symbol> {
2039 arena_cache
2040 desc { "calculating the implications between `#[unstable]` features defined in a crate" }
2041 separate_provide_extern
2042 }
2043 query intrinsic_raw(def_id: DefId) -> Option<rustc_middle::ty::IntrinsicDef> {
2045 desc { |tcx| "fetch intrinsic name if `{}` is an intrinsic", tcx.def_path_str(def_id) }
2046 separate_provide_extern
2047 }
2048 query get_lang_items(_: ()) -> &'tcx LanguageItems {
2050 arena_cache
2051 eval_always
2052 desc { "calculating the lang items map" }
2053 }
2054
2055 query all_diagnostic_items(_: ()) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2057 arena_cache
2058 eval_always
2059 desc { "calculating the diagnostic items map" }
2060 }
2061
2062 query defined_lang_items(_: CrateNum) -> &'tcx [(DefId, LangItem)] {
2064 desc { "calculating the lang items defined in a crate" }
2065 separate_provide_extern
2066 }
2067
2068 query diagnostic_items(_: CrateNum) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2070 arena_cache
2071 desc { "calculating the diagnostic items map in a crate" }
2072 separate_provide_extern
2073 }
2074
2075 query missing_lang_items(_: CrateNum) -> &'tcx [LangItem] {
2076 desc { "calculating the missing lang items in a crate" }
2077 separate_provide_extern
2078 }
2079
2080 query visible_parent_map(_: ()) -> &'tcx DefIdMap<DefId> {
2085 arena_cache
2086 desc { "calculating the visible parent map" }
2087 }
2088 query trimmed_def_paths(_: ()) -> &'tcx DefIdMap<Symbol> {
2091 arena_cache
2092 desc { "calculating trimmed def paths" }
2093 }
2094 query missing_extern_crate_item(_: CrateNum) -> bool {
2095 eval_always
2096 desc { "seeing if we're missing an `extern crate` item for this crate" }
2097 separate_provide_extern
2098 }
2099 query used_crate_source(_: CrateNum) -> &'tcx Arc<CrateSource> {
2100 arena_cache
2101 eval_always
2102 desc { "looking at the source for a crate" }
2103 separate_provide_extern
2104 }
2105
2106 query debugger_visualizers(_: CrateNum) -> &'tcx Vec<DebuggerVisualizerFile> {
2111 arena_cache
2112 desc { "looking up the debugger visualizers for this crate" }
2113 separate_provide_extern
2114 eval_always
2115 }
2116
2117 query postorder_cnums(_: ()) -> &'tcx [CrateNum] {
2118 eval_always
2119 desc { "generating a postorder list of CrateNums" }
2120 }
2121 query is_private_dep(c: CrateNum) -> bool {
2124 eval_always
2125 desc { "checking whether crate `{}` is a private dependency", c }
2126 separate_provide_extern
2127 }
2128 query allocator_kind(_: ()) -> Option<AllocatorKind> {
2129 eval_always
2130 desc { "getting the allocator kind for the current crate" }
2131 }
2132 query alloc_error_handler_kind(_: ()) -> Option<AllocatorKind> {
2133 eval_always
2134 desc { "alloc error handler kind for the current crate" }
2135 }
2136
2137 query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
2138 desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
2139 }
2140 query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
2141 desc { "fetching potentially unused trait imports" }
2142 }
2143 query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx UnordSet<Symbol> {
2144 desc { |tcx| "finding names imported by glob use for `{}`", tcx.def_path_str(def_id) }
2145 }
2146
2147 query stability_index(_: ()) -> &'tcx stability::Index {
2148 arena_cache
2149 eval_always
2150 desc { "calculating the stability index for the local crate" }
2151 }
2152 query crates(_: ()) -> &'tcx [CrateNum] {
2155 eval_always
2156 desc { "fetching all foreign CrateNum instances" }
2157 }
2158 query used_crates(_: ()) -> &'tcx [CrateNum] {
2162 eval_always
2163 desc { "fetching `CrateNum`s for all crates loaded non-speculatively" }
2164 }
2165
2166 query traits(_: CrateNum) -> &'tcx [DefId] {
2168 desc { "fetching all traits in a crate" }
2169 separate_provide_extern
2170 }
2171
2172 query trait_impls_in_crate(_: CrateNum) -> &'tcx [DefId] {
2173 desc { "fetching all trait impls in a crate" }
2174 separate_provide_extern
2175 }
2176
2177 query exported_symbols(cnum: CrateNum) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)] {
2183 desc { "collecting exported symbols for crate `{}`", cnum}
2184 cache_on_disk_if { *cnum == LOCAL_CRATE }
2185 separate_provide_extern
2186 }
2187
2188 query collect_and_partition_mono_items(_: ()) -> MonoItemPartitions<'tcx> {
2189 eval_always
2190 desc { "collect_and_partition_mono_items" }
2191 }
2192
2193 query is_codegened_item(def_id: DefId) -> bool {
2194 desc { |tcx| "determining whether `{}` needs codegen", tcx.def_path_str(def_id) }
2195 }
2196
2197 query codegen_unit(sym: Symbol) -> &'tcx CodegenUnit<'tcx> {
2198 desc { "getting codegen unit `{sym}`" }
2199 }
2200
2201 query backend_optimization_level(_: ()) -> OptLevel {
2202 desc { "optimization level used by backend" }
2203 }
2204
2205 query output_filenames(_: ()) -> &'tcx Arc<OutputFilenames> {
2210 feedable
2211 desc { "getting output filenames" }
2212 arena_cache
2213 }
2214
2215 query normalize_canonicalized_projection_ty(
2221 goal: CanonicalAliasGoal<'tcx>
2222 ) -> Result<
2223 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2224 NoSolution,
2225 > {
2226 desc { "normalizing `{}`", goal.canonical.value.value }
2227 }
2228
2229 query normalize_canonicalized_weak_ty(
2235 goal: CanonicalAliasGoal<'tcx>
2236 ) -> Result<
2237 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2238 NoSolution,
2239 > {
2240 desc { "normalizing `{}`", goal.canonical.value.value }
2241 }
2242
2243 query normalize_canonicalized_inherent_projection_ty(
2249 goal: CanonicalAliasGoal<'tcx>
2250 ) -> Result<
2251 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2252 NoSolution,
2253 > {
2254 desc { "normalizing `{}`", goal.canonical.value.value }
2255 }
2256
2257 query try_normalize_generic_arg_after_erasing_regions(
2259 goal: PseudoCanonicalInput<'tcx, GenericArg<'tcx>>
2260 ) -> Result<GenericArg<'tcx>, NoSolution> {
2261 desc { "normalizing `{}`", goal.value }
2262 }
2263
2264 query implied_outlives_bounds(
2265 key: (CanonicalImpliedOutlivesBoundsGoal<'tcx>, bool)
2266 ) -> Result<
2267 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>,
2268 NoSolution,
2269 > {
2270 desc { "computing implied outlives bounds for `{}` (hack disabled = {:?})", key.0.canonical.value.value.ty, key.1 }
2271 }
2272
2273 query dropck_outlives(
2276 goal: CanonicalDropckOutlivesGoal<'tcx>
2277 ) -> Result<
2278 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>,
2279 NoSolution,
2280 > {
2281 desc { "computing dropck types for `{}`", goal.canonical.value.value.dropped_ty }
2282 }
2283
2284 query evaluate_obligation(
2287 goal: CanonicalPredicateGoal<'tcx>
2288 ) -> Result<EvaluationResult, OverflowError> {
2289 desc { "evaluating trait selection obligation `{}`", goal.canonical.value.value }
2290 }
2291
2292 query type_op_ascribe_user_type(
2294 goal: CanonicalTypeOpAscribeUserTypeGoal<'tcx>
2295 ) -> Result<
2296 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2297 NoSolution,
2298 > {
2299 desc { "evaluating `type_op_ascribe_user_type` `{:?}`", goal.canonical.value.value }
2300 }
2301
2302 query type_op_prove_predicate(
2304 goal: CanonicalTypeOpProvePredicateGoal<'tcx>
2305 ) -> Result<
2306 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2307 NoSolution,
2308 > {
2309 desc { "evaluating `type_op_prove_predicate` `{:?}`", goal.canonical.value.value }
2310 }
2311
2312 query type_op_normalize_ty(
2314 goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>
2315 ) -> Result<
2316 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>,
2317 NoSolution,
2318 > {
2319 desc { "normalizing `{}`", goal.canonical.value.value.value }
2320 }
2321
2322 query type_op_normalize_clause(
2324 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Clause<'tcx>>
2325 ) -> Result<
2326 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Clause<'tcx>>>,
2327 NoSolution,
2328 > {
2329 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2330 }
2331
2332 query type_op_normalize_poly_fn_sig(
2334 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>
2335 ) -> Result<
2336 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>,
2337 NoSolution,
2338 > {
2339 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2340 }
2341
2342 query type_op_normalize_fn_sig(
2344 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>
2345 ) -> Result<
2346 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>,
2347 NoSolution,
2348 > {
2349 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2350 }
2351
2352 query instantiate_and_check_impossible_predicates(key: (DefId, GenericArgsRef<'tcx>)) -> bool {
2353 desc { |tcx|
2354 "checking impossible instantiated predicates: `{}`",
2355 tcx.def_path_str(key.0)
2356 }
2357 }
2358
2359 query is_impossible_associated_item(key: (DefId, DefId)) -> bool {
2360 desc { |tcx|
2361 "checking if `{}` is impossible to reference within `{}`",
2362 tcx.def_path_str(key.1),
2363 tcx.def_path_str(key.0),
2364 }
2365 }
2366
2367 query method_autoderef_steps(
2368 goal: CanonicalTyGoal<'tcx>
2369 ) -> MethodAutoderefStepsResult<'tcx> {
2370 desc { "computing autoderef types for `{}`", goal.canonical.value.value }
2371 }
2372
2373 query rust_target_features(_: CrateNum) -> &'tcx UnordMap<String, rustc_target::target_features::Stability> {
2375 arena_cache
2376 eval_always
2377 desc { "looking up Rust target features" }
2378 }
2379
2380 query implied_target_features(feature: Symbol) -> &'tcx Vec<Symbol> {
2381 arena_cache
2382 eval_always
2383 desc { "looking up implied target features" }
2384 }
2385
2386 query features_query(_: ()) -> &'tcx rustc_feature::Features {
2387 feedable
2388 desc { "looking up enabled feature gates" }
2389 }
2390
2391 query crate_for_resolver((): ()) -> &'tcx Steal<(rustc_ast::Crate, rustc_ast::AttrVec)> {
2392 feedable
2393 no_hash
2394 desc { "the ast before macro expansion and name resolution" }
2395 }
2396
2397 query resolve_instance_raw(
2407 key: ty::PseudoCanonicalInput<'tcx, (DefId, GenericArgsRef<'tcx>)>
2408 ) -> Result<Option<ty::Instance<'tcx>>, ErrorGuaranteed> {
2409 desc { "resolving instance `{}`", ty::Instance::new(key.value.0, key.value.1) }
2410 }
2411
2412 query reveal_opaque_types_in_bounds(key: ty::Clauses<'tcx>) -> ty::Clauses<'tcx> {
2413 desc { "revealing opaque types in `{:?}`", key }
2414 }
2415
2416 query limits(key: ()) -> Limits {
2417 desc { "looking up limits" }
2418 }
2419
2420 query diagnostic_hir_wf_check(
2429 key: (ty::Predicate<'tcx>, WellFormedLoc)
2430 ) -> Option<&'tcx ObligationCause<'tcx>> {
2431 arena_cache
2432 eval_always
2433 no_hash
2434 desc { "performing HIR wf-checking for predicate `{:?}` at item `{:?}`", key.0, key.1 }
2435 }
2436
2437 query global_backend_features(_: ()) -> &'tcx Vec<String> {
2440 arena_cache
2441 eval_always
2442 desc { "computing the backend features for CLI flags" }
2443 }
2444
2445 query check_validity_requirement(key: (ValidityRequirement, ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>)) -> Result<bool, &'tcx ty::layout::LayoutError<'tcx>> {
2446 desc { "checking validity requirement for `{}`: {}", key.1.value, key.0 }
2447 }
2448
2449 query compare_impl_item(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
2454 desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key) }
2455 return_result_from_ensure_ok
2456 }
2457
2458 query deduced_param_attrs(def_id: DefId) -> &'tcx [ty::DeducedParamAttrs] {
2459 desc { |tcx| "deducing parameter attributes for {}", tcx.def_path_str(def_id) }
2460 separate_provide_extern
2461 }
2462
2463 query doc_link_resolutions(def_id: DefId) -> &'tcx DocLinkResMap {
2464 eval_always
2465 desc { "resolutions for documentation links for a module" }
2466 separate_provide_extern
2467 }
2468
2469 query doc_link_traits_in_scope(def_id: DefId) -> &'tcx [DefId] {
2470 eval_always
2471 desc { "traits in scope for documentation links for a module" }
2472 separate_provide_extern
2473 }
2474
2475 query stripped_cfg_items(cnum: CrateNum) -> &'tcx [StrippedCfgItem] {
2479 desc { "getting cfg-ed out item names" }
2480 separate_provide_extern
2481 }
2482
2483 query generics_require_sized_self(def_id: DefId) -> bool {
2484 desc { "check whether the item has a `where Self: Sized` bound" }
2485 }
2486
2487 query cross_crate_inlinable(def_id: DefId) -> bool {
2488 desc { "whether the item should be made inlinable across crates" }
2489 separate_provide_extern
2490 }
2491
2492 query check_mono_item(key: ty::Instance<'tcx>) {
2496 desc { "monomorphization-time checking" }
2497 cache_on_disk_if { true }
2498 }
2499
2500 query skip_move_check_fns(_: ()) -> &'tcx FxIndexSet<DefId> {
2502 arena_cache
2503 desc { "functions to skip for move-size check" }
2504 }
2505
2506 query items_of_instance(key: (ty::Instance<'tcx>, CollectionMode)) -> (&'tcx [Spanned<MonoItem<'tcx>>], &'tcx [Spanned<MonoItem<'tcx>>]) {
2507 desc { "collecting items used by `{}`", key.0 }
2508 cache_on_disk_if { true }
2509 }
2510
2511 query size_estimate(key: ty::Instance<'tcx>) -> usize {
2512 desc { "estimating codegen size of `{}`", key }
2513 cache_on_disk_if { true }
2514 }
2515}
2516
2517rustc_query_append! { define_callbacks! }
2518rustc_feedable_queries! { define_feedable! }