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, 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_parsing 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_attrs(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(
752 key: DefId
753 ) -> ty::ConstConditions<'tcx> {
754 desc { |tcx| "computing the conditions for `{}` to be considered const",
755 tcx.def_path_str(key)
756 }
757 separate_provide_extern
758 }
759
760 query explicit_implied_const_bounds(
761 key: DefId
762 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::PolyTraitRef<'tcx>, Span)]> {
763 desc { |tcx| "computing the implied `~const` bounds for `{}`",
764 tcx.def_path_str(key)
765 }
766 separate_provide_extern
767 }
768
769 query type_param_predicates(
772 key: (LocalDefId, LocalDefId, rustc_span::Ident)
773 ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
774 desc { |tcx| "computing the bounds for type parameter `{}`", tcx.hir().ty_param_name(key.1) }
775 }
776
777 query trait_def(key: DefId) -> &'tcx ty::TraitDef {
778 desc { |tcx| "computing trait definition for `{}`", tcx.def_path_str(key) }
779 arena_cache
780 cache_on_disk_if { key.is_local() }
781 separate_provide_extern
782 }
783 query adt_def(key: DefId) -> ty::AdtDef<'tcx> {
784 desc { |tcx| "computing ADT definition for `{}`", tcx.def_path_str(key) }
785 cache_on_disk_if { key.is_local() }
786 separate_provide_extern
787 }
788 query adt_destructor(key: DefId) -> Option<ty::Destructor> {
789 desc { |tcx| "computing `Drop` impl for `{}`", tcx.def_path_str(key) }
790 cache_on_disk_if { key.is_local() }
791 separate_provide_extern
792 }
793 query adt_async_destructor(key: DefId) -> Option<ty::AsyncDestructor> {
794 desc { |tcx| "computing `AsyncDrop` impl for `{}`", tcx.def_path_str(key) }
795 cache_on_disk_if { key.is_local() }
796 separate_provide_extern
797 }
798
799 query adt_sized_constraint(key: DefId) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> {
800 desc { |tcx| "computing the `Sized` constraint for `{}`", tcx.def_path_str(key) }
801 }
802
803 query adt_dtorck_constraint(
804 key: DefId
805 ) -> Result<&'tcx DropckConstraint<'tcx>, NoSolution> {
806 desc { |tcx| "computing drop-check constraints for `{}`", tcx.def_path_str(key) }
807 }
808
809 query constness(key: DefId) -> hir::Constness {
831 desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) }
832 separate_provide_extern
833 feedable
834 }
835
836 query asyncness(key: DefId) -> ty::Asyncness {
837 desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) }
838 separate_provide_extern
839 }
840
841 query is_promotable_const_fn(key: DefId) -> bool {
849 desc { |tcx| "checking if item is promotable: `{}`", tcx.def_path_str(key) }
850 }
851
852 query coroutine_by_move_body_def_id(def_id: DefId) -> DefId {
859 desc { |tcx| "looking up the coroutine by-move body for `{}`", tcx.def_path_str(def_id) }
860 separate_provide_extern
861 }
862
863 query coroutine_kind(def_id: DefId) -> Option<hir::CoroutineKind> {
865 desc { |tcx| "looking up coroutine kind of `{}`", tcx.def_path_str(def_id) }
866 separate_provide_extern
867 feedable
868 }
869
870 query coroutine_for_closure(def_id: DefId) -> DefId {
871 desc { |_tcx| "Given a coroutine-closure def id, return the def id of the coroutine returned by it" }
872 separate_provide_extern
873 }
874
875 query crate_variances(_: ()) -> &'tcx ty::CrateVariancesMap<'tcx> {
883 arena_cache
884 desc { "computing the variances for items in this crate" }
885 }
886
887 query variances_of(def_id: DefId) -> &'tcx [ty::Variance] {
895 desc { |tcx| "computing the variances of `{}`", tcx.def_path_str(def_id) }
896 cache_on_disk_if { def_id.is_local() }
897 separate_provide_extern
898 cycle_delay_bug
899 }
900
901 query inferred_outlives_crate(_: ()) -> &'tcx ty::CratePredicatesMap<'tcx> {
909 arena_cache
910 desc { "computing the inferred outlives-predicates for items in this crate" }
911 }
912
913 query associated_item_def_ids(key: DefId) -> &'tcx [DefId] {
916 desc { |tcx| "collecting associated items or fields of `{}`", tcx.def_path_str(key) }
917 cache_on_disk_if { key.is_local() }
918 separate_provide_extern
919 }
920
921 query associated_item(key: DefId) -> ty::AssocItem {
923 desc { |tcx| "computing associated item data for `{}`", tcx.def_path_str(key) }
924 cache_on_disk_if { key.is_local() }
925 separate_provide_extern
926 feedable
927 }
928
929 query associated_items(key: DefId) -> &'tcx ty::AssocItems {
931 arena_cache
932 desc { |tcx| "collecting associated items of `{}`", tcx.def_path_str(key) }
933 }
934
935 query impl_item_implementor_ids(impl_id: DefId) -> &'tcx DefIdMap<DefId> {
957 arena_cache
958 desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
959 }
960
961 query associated_types_for_impl_traits_in_associated_fn(fn_def_id: DefId) -> &'tcx [DefId] {
968 desc { |tcx| "creating associated items for opaque types returned by `{}`", tcx.def_path_str(fn_def_id) }
969 cache_on_disk_if { fn_def_id.is_local() }
970 separate_provide_extern
971 }
972
973 query associated_type_for_impl_trait_in_trait(opaque_ty_def_id: LocalDefId) -> LocalDefId {
976 desc { |tcx| "creating the associated item corresponding to the opaque type `{}`", tcx.def_path_str(opaque_ty_def_id.to_def_id()) }
977 cache_on_disk_if { true }
978 }
979
980 query impl_trait_header(impl_id: DefId) -> Option<ty::ImplTraitHeader<'tcx>> {
983 desc { |tcx| "computing trait implemented by `{}`", tcx.def_path_str(impl_id) }
984 cache_on_disk_if { impl_id.is_local() }
985 separate_provide_extern
986 }
987
988 query self_ty_of_trait_impl_enabling_order_dep_trait_object_hack(
989 key: DefId
990 ) -> Option<ty::EarlyBinder<'tcx, ty::Ty<'tcx>>> {
991 desc { |tcx| "computing self type wrt issue #33140 `{}`", tcx.def_path_str(key) }
992 }
993
994 query inherent_impls(key: DefId) -> &'tcx [DefId] {
998 desc { |tcx| "collecting inherent impls for `{}`", tcx.def_path_str(key) }
999 cache_on_disk_if { key.is_local() }
1000 separate_provide_extern
1001 }
1002
1003 query incoherent_impls(key: SimplifiedType) -> &'tcx [DefId] {
1004 desc { |tcx| "collecting all inherent impls for `{:?}`", key }
1005 }
1006
1007 query check_unsafety(key: LocalDefId) {
1009 desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
1010 cache_on_disk_if { true }
1011 }
1012
1013 query check_tail_calls(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1015 desc { |tcx| "tail-call-checking `{}`", tcx.def_path_str(key) }
1016 cache_on_disk_if { true }
1017 }
1018
1019 query assumed_wf_types(key: LocalDefId) -> &'tcx [(Ty<'tcx>, Span)] {
1024 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1025 }
1026
1027 query assumed_wf_types_for_rpitit(key: DefId) -> &'tcx [(Ty<'tcx>, Span)] {
1030 desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
1031 separate_provide_extern
1032 }
1033
1034 query fn_sig(key: DefId) -> ty::EarlyBinder<'tcx, ty::PolyFnSig<'tcx>> {
1036 desc { |tcx| "computing function signature of `{}`", tcx.def_path_str(key) }
1037 cache_on_disk_if { key.is_local() }
1038 separate_provide_extern
1039 cycle_delay_bug
1040 }
1041
1042 query lint_mod(key: LocalModDefId) {
1044 desc { |tcx| "linting {}", describe_as_module(key, tcx) }
1045 }
1046
1047 query check_unused_traits(_: ()) {
1048 desc { "checking unused trait imports in crate" }
1049 }
1050
1051 query check_mod_attrs(key: LocalModDefId) {
1053 desc { |tcx| "checking attributes in {}", describe_as_module(key, tcx) }
1054 }
1055
1056 query check_mod_unstable_api_usage(key: LocalModDefId) {
1058 desc { |tcx| "checking for unstable API usage in {}", describe_as_module(key, tcx) }
1059 }
1060
1061 query check_mod_loops(key: LocalModDefId) {
1063 desc { |tcx| "checking loops in {}", describe_as_module(key, tcx) }
1064 }
1065
1066 query check_mod_naked_functions(key: LocalModDefId) {
1067 desc { |tcx| "checking naked functions in {}", describe_as_module(key, tcx) }
1068 }
1069
1070 query check_mod_privacy(key: LocalModDefId) {
1071 desc { |tcx| "checking privacy in {}", describe_as_module(key.to_local_def_id(), tcx) }
1072 }
1073
1074 query check_liveness(key: LocalDefId) {
1075 desc { |tcx| "checking liveness of variables in `{}`", tcx.def_path_str(key) }
1076 }
1077
1078 query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx (
1083 LocalDefIdSet,
1084 LocalDefIdMap<Vec<(DefId, DefId)>>
1085 ) {
1086 arena_cache
1087 desc { "finding live symbols in crate" }
1088 }
1089
1090 query check_mod_deathness(key: LocalModDefId) {
1091 desc { |tcx| "checking deathness of variables in {}", describe_as_module(key, tcx) }
1092 }
1093
1094 query check_mod_type_wf(key: LocalModDefId) -> Result<(), ErrorGuaranteed> {
1095 desc { |tcx| "checking that types are well-formed in {}", describe_as_module(key, tcx) }
1096 return_result_from_ensure_ok
1097 }
1098
1099 query coerce_unsized_info(key: DefId) -> Result<ty::adjustment::CoerceUnsizedInfo, ErrorGuaranteed> {
1101 desc { |tcx| "computing CoerceUnsized info for `{}`", tcx.def_path_str(key) }
1102 cache_on_disk_if { key.is_local() }
1103 separate_provide_extern
1104 return_result_from_ensure_ok
1105 }
1106
1107 query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
1108 desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
1109 cache_on_disk_if(tcx) { !tcx.is_typeck_child(key.to_def_id()) }
1110 }
1111
1112 query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
1113 desc { |tcx| "finding used_trait_imports `{}`", tcx.def_path_str(key) }
1114 cache_on_disk_if { true }
1115 }
1116
1117 query coherent_trait(def_id: DefId) -> Result<(), ErrorGuaranteed> {
1118 desc { |tcx| "coherence checking all impls of trait `{}`", tcx.def_path_str(def_id) }
1119 return_result_from_ensure_ok
1120 }
1121
1122 query mir_borrowck(key: LocalDefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
1125 desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key) }
1126 cache_on_disk_if(tcx) { tcx.is_typeck_child(key.to_def_id()) }
1127 }
1128
1129 query crate_inherent_impls(k: ()) -> (&'tcx CrateInherentImpls, Result<(), ErrorGuaranteed>) {
1137 desc { "finding all inherent impls defined in crate" }
1138 }
1139
1140 query crate_inherent_impls_validity_check(_: ()) -> Result<(), ErrorGuaranteed> {
1148 desc { "check for inherent impls that should not be defined in crate" }
1149 return_result_from_ensure_ok
1150 }
1151
1152 query crate_inherent_impls_overlap_check(_: ()) -> Result<(), ErrorGuaranteed> {
1160 desc { "check for overlap between inherent impls defined in this crate" }
1161 return_result_from_ensure_ok
1162 }
1163
1164 query orphan_check_impl(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1167 desc { |tcx|
1168 "checking whether impl `{}` follows the orphan rules",
1169 tcx.def_path_str(key),
1170 }
1171 return_result_from_ensure_ok
1172 }
1173
1174 query mir_callgraph_reachable(key: (ty::Instance<'tcx>, LocalDefId)) -> bool {
1177 fatal_cycle
1178 desc { |tcx|
1179 "computing if `{}` (transitively) calls `{}`",
1180 key.0,
1181 tcx.def_path_str(key.1),
1182 }
1183 }
1184
1185 query mir_inliner_callees(key: ty::InstanceKind<'tcx>) -> &'tcx [(DefId, GenericArgsRef<'tcx>)] {
1187 fatal_cycle
1188 desc { |tcx|
1189 "computing all local function calls in `{}`",
1190 tcx.def_path_str(key.def_id()),
1191 }
1192 }
1193
1194 query tag_for_variant(
1202 key: (Ty<'tcx>, abi::VariantIdx)
1203 ) -> Option<ty::ScalarInt> {
1204 desc { "computing variant tag for enum" }
1205 }
1206
1207 query eval_to_allocation_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1216 -> EvalToAllocationRawResult<'tcx> {
1217 desc { |tcx|
1218 "const-evaluating + checking `{}`",
1219 key.value.display(tcx)
1220 }
1221 cache_on_disk_if { true }
1222 }
1223
1224 query eval_static_initializer(key: DefId) -> EvalStaticInitializerRawResult<'tcx> {
1226 desc { |tcx|
1227 "evaluating initializer of static `{}`",
1228 tcx.def_path_str(key)
1229 }
1230 cache_on_disk_if { key.is_local() }
1231 separate_provide_extern
1232 feedable
1233 }
1234
1235 query eval_to_const_value_raw(key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>)
1248 -> EvalToConstValueResult<'tcx> {
1249 desc { |tcx|
1250 "simplifying constant for the type system `{}`",
1251 key.value.display(tcx)
1252 }
1253 depth_limit
1254 cache_on_disk_if { true }
1255 }
1256
1257 query eval_to_valtree(
1260 key: ty::PseudoCanonicalInput<'tcx, GlobalId<'tcx>>
1261 ) -> EvalToValTreeResult<'tcx> {
1262 desc { "evaluating type-level constant" }
1263 }
1264
1265 query valtree_to_const_val(key: ty::Value<'tcx>) -> mir::ConstValue<'tcx> {
1267 desc { "converting type-level constant value to MIR constant value"}
1268 }
1269
1270 query destructure_const(key: ty::Const<'tcx>) -> ty::DestructuredConst<'tcx> {
1273 desc { "destructuring type level constant"}
1274 }
1275
1276 query lit_to_const(
1278 key: LitToConstInput<'tcx>
1279 ) -> ty::Const<'tcx> {
1280 desc { "converting literal to const" }
1281 }
1282
1283 query check_match(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
1284 desc { |tcx| "match-checking `{}`", tcx.def_path_str(key) }
1285 cache_on_disk_if { true }
1286 }
1287
1288 query effective_visibilities(_: ()) -> &'tcx EffectiveVisibilities {
1290 eval_always
1291 desc { "checking effective visibilities" }
1292 }
1293 query check_private_in_public(_: ()) {
1294 eval_always
1295 desc { "checking for private elements in public interfaces" }
1296 }
1297
1298 query reachable_set(_: ()) -> &'tcx LocalDefIdSet {
1299 arena_cache
1300 desc { "reachability" }
1301 cache_on_disk_if { true }
1302 }
1303
1304 query region_scope_tree(def_id: DefId) -> &'tcx crate::middle::region::ScopeTree {
1307 desc { |tcx| "computing drop scopes for `{}`", tcx.def_path_str(def_id) }
1308 }
1309
1310 query mir_shims(key: ty::InstanceKind<'tcx>) -> &'tcx mir::Body<'tcx> {
1312 arena_cache
1313 desc { |tcx| "generating MIR shim for `{}`", tcx.def_path_str(key.def_id()) }
1314 }
1315
1316 query symbol_name(key: ty::Instance<'tcx>) -> ty::SymbolName<'tcx> {
1320 desc { "computing the symbol for `{}`", key }
1321 cache_on_disk_if { true }
1322 }
1323
1324 query def_kind(def_id: DefId) -> DefKind {
1325 desc { |tcx| "looking up definition kind of `{}`", tcx.def_path_str(def_id) }
1326 cache_on_disk_if { def_id.is_local() }
1327 separate_provide_extern
1328 feedable
1329 }
1330
1331 query def_span(def_id: DefId) -> Span {
1333 desc { |tcx| "looking up span for `{}`", 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_ident_span(def_id: DefId) -> Option<Span> {
1341 desc { |tcx| "looking up span for `{}`'s identifier", 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 lookup_stability(def_id: DefId) -> Option<attr::Stability> {
1348 desc { |tcx| "looking up stability of `{}`", tcx.def_path_str(def_id) }
1349 cache_on_disk_if { def_id.is_local() }
1350 separate_provide_extern
1351 }
1352
1353 query lookup_const_stability(def_id: DefId) -> Option<attr::ConstStability> {
1354 desc { |tcx| "looking up const stability of `{}`", tcx.def_path_str(def_id) }
1355 cache_on_disk_if { def_id.is_local() }
1356 separate_provide_extern
1357 }
1358
1359 query lookup_default_body_stability(def_id: DefId) -> Option<attr::DefaultBodyStability> {
1360 desc { |tcx| "looking up default body stability of `{}`", tcx.def_path_str(def_id) }
1361 separate_provide_extern
1362 }
1363
1364 query should_inherit_track_caller(def_id: DefId) -> bool {
1365 desc { |tcx| "computing should_inherit_track_caller of `{}`", tcx.def_path_str(def_id) }
1366 }
1367
1368 query lookup_deprecation_entry(def_id: DefId) -> Option<DeprecationEntry> {
1369 desc { |tcx| "checking whether `{}` is deprecated", tcx.def_path_str(def_id) }
1370 cache_on_disk_if { def_id.is_local() }
1371 separate_provide_extern
1372 }
1373
1374 query is_doc_hidden(def_id: DefId) -> bool {
1376 desc { |tcx| "checking whether `{}` is `doc(hidden)`", tcx.def_path_str(def_id) }
1377 separate_provide_extern
1378 }
1379
1380 query is_doc_notable_trait(def_id: DefId) -> bool {
1382 desc { |tcx| "checking whether `{}` is `doc(notable_trait)`", tcx.def_path_str(def_id) }
1383 }
1384
1385 query attrs_for_def(def_id: DefId) -> &'tcx [hir::Attribute] {
1389 desc { |tcx| "collecting attributes of `{}`", tcx.def_path_str(def_id) }
1390 separate_provide_extern
1391 }
1392
1393 query codegen_fn_attrs(def_id: DefId) -> &'tcx CodegenFnAttrs {
1394 desc { |tcx| "computing codegen attributes of `{}`", tcx.def_path_str(def_id) }
1395 arena_cache
1396 cache_on_disk_if { def_id.is_local() }
1397 separate_provide_extern
1398 feedable
1399 }
1400
1401 query asm_target_features(def_id: DefId) -> &'tcx FxIndexSet<Symbol> {
1402 desc { |tcx| "computing target features for inline asm of `{}`", tcx.def_path_str(def_id) }
1403 }
1404
1405 query fn_arg_names(def_id: DefId) -> &'tcx [rustc_span::Ident] {
1406 desc { |tcx| "looking up function parameter names for `{}`", tcx.def_path_str(def_id) }
1407 separate_provide_extern
1408 }
1409
1410 query rendered_const(def_id: DefId) -> &'tcx String {
1413 arena_cache
1414 desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
1415 separate_provide_extern
1416 }
1417
1418 query rendered_precise_capturing_args(def_id: DefId) -> Option<&'tcx [Symbol]> {
1420 desc { |tcx| "rendering precise capturing args for `{}`", tcx.def_path_str(def_id) }
1421 separate_provide_extern
1422 }
1423
1424 query impl_parent(def_id: DefId) -> Option<DefId> {
1425 desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) }
1426 separate_provide_extern
1427 }
1428
1429 query is_ctfe_mir_available(key: DefId) -> bool {
1430 desc { |tcx| "checking if item has CTFE MIR available: `{}`", tcx.def_path_str(key) }
1431 cache_on_disk_if { key.is_local() }
1432 separate_provide_extern
1433 }
1434 query is_mir_available(key: DefId) -> bool {
1435 desc { |tcx| "checking if item has MIR available: `{}`", tcx.def_path_str(key) }
1436 cache_on_disk_if { key.is_local() }
1437 separate_provide_extern
1438 }
1439
1440 query own_existential_vtable_entries(
1441 key: DefId
1442 ) -> &'tcx [DefId] {
1443 desc { |tcx| "finding all existential vtable entries for trait `{}`", tcx.def_path_str(key) }
1444 }
1445
1446 query vtable_entries(key: ty::TraitRef<'tcx>)
1447 -> &'tcx [ty::VtblEntry<'tcx>] {
1448 desc { |tcx| "finding all vtable entries for trait `{}`", tcx.def_path_str(key.def_id) }
1449 }
1450
1451 query first_method_vtable_slot(key: ty::TraitRef<'tcx>) -> usize {
1452 desc { |tcx| "finding the slot within the vtable of `{}` for the implementation of `{}`", key.self_ty(), key.print_only_trait_name() }
1453 }
1454
1455 query supertrait_vtable_slot(key: (Ty<'tcx>, Ty<'tcx>)) -> Option<usize> {
1456 desc { |tcx| "finding the slot within vtable for trait object `{}` vtable ptr during trait upcasting coercion from `{}` vtable",
1457 key.1, key.0 }
1458 }
1459
1460 query vtable_allocation(key: (Ty<'tcx>, Option<ty::ExistentialTraitRef<'tcx>>)) -> mir::interpret::AllocId {
1461 desc { |tcx| "vtable const allocation for <{} as {}>",
1462 key.0,
1463 key.1.map(|trait_ref| format!("{trait_ref}")).unwrap_or("_".to_owned())
1464 }
1465 }
1466
1467 query codegen_select_candidate(
1468 key: PseudoCanonicalInput<'tcx, ty::TraitRef<'tcx>>
1469 ) -> Result<&'tcx ImplSource<'tcx, ()>, CodegenObligationError> {
1470 cache_on_disk_if { true }
1471 desc { |tcx| "computing candidate for `{}`", key.value }
1472 }
1473
1474 query all_local_trait_impls(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexMap<DefId, Vec<LocalDefId>> {
1476 desc { "finding local trait impls" }
1477 }
1478
1479 query trait_impls_of(trait_id: DefId) -> &'tcx ty::trait_def::TraitImpls {
1481 arena_cache
1482 desc { |tcx| "finding trait impls of `{}`", tcx.def_path_str(trait_id) }
1483 }
1484
1485 query specialization_graph_of(trait_id: DefId) -> Result<&'tcx specialization_graph::Graph, ErrorGuaranteed> {
1486 desc { |tcx| "building specialization graph of trait `{}`", tcx.def_path_str(trait_id) }
1487 cache_on_disk_if { true }
1488 return_result_from_ensure_ok
1489 }
1490 query dyn_compatibility_violations(trait_id: DefId) -> &'tcx [DynCompatibilityViolation] {
1491 desc { |tcx| "determining dyn-compatibility of trait `{}`", tcx.def_path_str(trait_id) }
1492 }
1493 query is_dyn_compatible(trait_id: DefId) -> bool {
1494 desc { |tcx| "checking if trait `{}` is dyn-compatible", tcx.def_path_str(trait_id) }
1495 }
1496
1497 query param_env(def_id: DefId) -> ty::ParamEnv<'tcx> {
1506 desc { |tcx| "computing normalized predicates of `{}`", tcx.def_path_str(def_id) }
1507 feedable
1508 }
1509
1510 query param_env_normalized_for_post_analysis(def_id: DefId) -> ty::ParamEnv<'tcx> {
1514 desc { |tcx| "computing revealed normalized predicates of `{}`", tcx.def_path_str(def_id) }
1515 }
1516
1517 query is_copy_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1520 desc { "computing whether `{}` is `Copy`", env.value }
1521 }
1522 query is_sized_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1524 desc { "computing whether `{}` is `Sized`", env.value }
1525 }
1526 query is_freeze_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1528 desc { "computing whether `{}` is freeze", env.value }
1529 }
1530 query is_unpin_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1532 desc { "computing whether `{}` is `Unpin`", env.value }
1533 }
1534 query needs_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1536 desc { "computing whether `{}` needs drop", env.value }
1537 }
1538 query needs_async_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1540 desc { "computing whether `{}` needs async drop", env.value }
1541 }
1542 query has_significant_drop_raw(env: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> bool {
1544 desc { "computing whether `{}` has a significant drop", env.value }
1545 }
1546
1547 query has_structural_eq_impl(ty: Ty<'tcx>) -> bool {
1552 desc {
1553 "computing whether `{}` implements `StructuralPartialEq`",
1554 ty
1555 }
1556 }
1557
1558 query adt_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1562 desc { |tcx| "computing when `{}` needs drop", tcx.def_path_str(def_id) }
1563 cache_on_disk_if { true }
1564 }
1565
1566 query adt_significant_drop_tys(def_id: DefId) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
1573 desc { |tcx| "computing when `{}` has a significant destructor", tcx.def_path_str(def_id) }
1574 cache_on_disk_if { false }
1575 }
1576
1577 query list_significant_drop_tys(ty: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>) -> &'tcx ty::List<Ty<'tcx>> {
1595 desc { |tcx| "computing when `{}` has a significant destructor", ty.value }
1596 cache_on_disk_if { false }
1597 }
1598
1599 query layout_of(
1602 key: ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>
1603 ) -> Result<ty::layout::TyAndLayout<'tcx>, &'tcx ty::layout::LayoutError<'tcx>> {
1604 depth_limit
1605 desc { "computing layout of `{}`", key.value }
1606 cycle_delay_bug
1608 }
1609
1610 query fn_abi_of_fn_ptr(
1615 key: ty::PseudoCanonicalInput<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1616 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1617 desc { "computing call ABI of `{}` function pointers", key.value.0 }
1618 }
1619
1620 query fn_abi_of_instance(
1626 key: ty::PseudoCanonicalInput<'tcx, (ty::Instance<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1627 ) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1628 desc { "computing call ABI of `{}`", key.value.0 }
1629 }
1630
1631 query dylib_dependency_formats(_: CrateNum)
1632 -> &'tcx [(CrateNum, LinkagePreference)] {
1633 desc { "getting dylib dependency formats of crate" }
1634 separate_provide_extern
1635 }
1636
1637 query dependency_formats(_: ()) -> &'tcx Arc<crate::middle::dependency_format::Dependencies> {
1638 arena_cache
1639 desc { "getting the linkage format of all dependencies" }
1640 }
1641
1642 query is_compiler_builtins(_: CrateNum) -> bool {
1643 fatal_cycle
1644 desc { "checking if the crate is_compiler_builtins" }
1645 separate_provide_extern
1646 }
1647 query has_global_allocator(_: CrateNum) -> bool {
1648 eval_always
1650 fatal_cycle
1651 desc { "checking if the crate has_global_allocator" }
1652 separate_provide_extern
1653 }
1654 query has_alloc_error_handler(_: CrateNum) -> bool {
1655 eval_always
1657 fatal_cycle
1658 desc { "checking if the crate has_alloc_error_handler" }
1659 separate_provide_extern
1660 }
1661 query has_panic_handler(_: CrateNum) -> bool {
1662 fatal_cycle
1663 desc { "checking if the crate has_panic_handler" }
1664 separate_provide_extern
1665 }
1666 query is_profiler_runtime(_: CrateNum) -> bool {
1667 fatal_cycle
1668 desc { "checking if a crate is `#![profiler_runtime]`" }
1669 separate_provide_extern
1670 }
1671 query has_ffi_unwind_calls(key: LocalDefId) -> bool {
1672 desc { |tcx| "checking if `{}` contains FFI-unwind calls", tcx.def_path_str(key) }
1673 cache_on_disk_if { true }
1674 }
1675 query required_panic_strategy(_: CrateNum) -> Option<PanicStrategy> {
1676 fatal_cycle
1677 desc { "getting a crate's required panic strategy" }
1678 separate_provide_extern
1679 }
1680 query panic_in_drop_strategy(_: CrateNum) -> PanicStrategy {
1681 fatal_cycle
1682 desc { "getting a crate's configured panic-in-drop strategy" }
1683 separate_provide_extern
1684 }
1685 query is_no_builtins(_: CrateNum) -> bool {
1686 fatal_cycle
1687 desc { "getting whether a crate has `#![no_builtins]`" }
1688 separate_provide_extern
1689 }
1690 query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion {
1691 fatal_cycle
1692 desc { "getting a crate's symbol mangling version" }
1693 separate_provide_extern
1694 }
1695
1696 query extern_crate(def_id: CrateNum) -> Option<&'tcx ExternCrate> {
1697 eval_always
1698 desc { "getting crate's ExternCrateData" }
1699 separate_provide_extern
1700 }
1701
1702 query specialization_enabled_in(cnum: CrateNum) -> bool {
1703 desc { "checking whether the crate enabled `specialization`/`min_specialization`" }
1704 separate_provide_extern
1705 }
1706
1707 query specializes(_: (DefId, DefId)) -> bool {
1708 desc { "computing whether impls specialize one another" }
1709 }
1710 query in_scope_traits_map(_: hir::OwnerId)
1711 -> Option<&'tcx ItemLocalMap<Box<[TraitCandidate]>>> {
1712 desc { "getting traits in scope at a block" }
1713 }
1714
1715 query defaultness(def_id: DefId) -> hir::Defaultness {
1717 desc { |tcx| "looking up whether `{}` has `default`", tcx.def_path_str(def_id) }
1718 separate_provide_extern
1719 feedable
1720 }
1721
1722 query check_well_formed(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1723 desc { |tcx| "checking that `{}` is well-formed", tcx.def_path_str(key) }
1724 return_result_from_ensure_ok
1725 }
1726
1727 query enforce_impl_non_lifetime_params_are_constrained(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
1728 desc { |tcx| "checking that `{}`'s generics are constrained by the impl header", tcx.def_path_str(key) }
1729 return_result_from_ensure_ok
1730 }
1731
1732 query reachable_non_generics(_: CrateNum)
1745 -> &'tcx DefIdMap<SymbolExportInfo> {
1746 arena_cache
1747 desc { "looking up the exported symbols of a crate" }
1748 separate_provide_extern
1749 }
1750 query is_reachable_non_generic(def_id: DefId) -> bool {
1751 desc { |tcx| "checking whether `{}` is an exported symbol", tcx.def_path_str(def_id) }
1752 cache_on_disk_if { def_id.is_local() }
1753 separate_provide_extern
1754 }
1755 query is_unreachable_local_definition(def_id: LocalDefId) -> bool {
1756 desc { |tcx|
1757 "checking whether `{}` is reachable from outside the crate",
1758 tcx.def_path_str(def_id),
1759 }
1760 }
1761
1762 query upstream_monomorphizations(_: ()) -> &'tcx DefIdMap<UnordMap<GenericArgsRef<'tcx>, CrateNum>> {
1770 arena_cache
1771 desc { "collecting available upstream monomorphizations" }
1772 }
1773
1774 query upstream_monomorphizations_for(def_id: DefId)
1782 -> Option<&'tcx UnordMap<GenericArgsRef<'tcx>, CrateNum>>
1783 {
1784 desc { |tcx|
1785 "collecting available upstream monomorphizations for `{}`",
1786 tcx.def_path_str(def_id),
1787 }
1788 separate_provide_extern
1789 }
1790
1791 query upstream_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1807 desc { "available upstream drop-glue for `{:?}`", args }
1808 }
1809
1810 query upstream_async_drop_glue_for(args: GenericArgsRef<'tcx>) -> Option<CrateNum> {
1827 desc { "available upstream async-drop-glue for `{:?}`", args }
1828 }
1829
1830 query foreign_modules(_: CrateNum) -> &'tcx FxIndexMap<DefId, ForeignModule> {
1832 arena_cache
1833 desc { "looking up the foreign modules of a linked crate" }
1834 separate_provide_extern
1835 }
1836
1837 query clashing_extern_declarations(_: ()) {
1839 desc { "checking `extern fn` declarations are compatible" }
1840 }
1841
1842 query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {
1845 desc { "looking up the entry function of a crate" }
1846 }
1847
1848 query proc_macro_decls_static(_: ()) -> Option<LocalDefId> {
1850 desc { "looking up the proc macro declarations for a crate" }
1851 }
1852
1853 query crate_hash(_: CrateNum) -> Svh {
1856 eval_always
1857 desc { "looking up the hash a crate" }
1858 separate_provide_extern
1859 }
1860
1861 query crate_host_hash(_: CrateNum) -> Option<Svh> {
1863 eval_always
1864 desc { "looking up the hash of a host version of a crate" }
1865 separate_provide_extern
1866 }
1867
1868 query extra_filename(_: CrateNum) -> &'tcx String {
1871 arena_cache
1872 eval_always
1873 desc { "looking up the extra filename for a crate" }
1874 separate_provide_extern
1875 }
1876
1877 query crate_extern_paths(_: CrateNum) -> &'tcx Vec<PathBuf> {
1879 arena_cache
1880 eval_always
1881 desc { "looking up the paths for extern crates" }
1882 separate_provide_extern
1883 }
1884
1885 query implementations_of_trait(_: (CrateNum, DefId)) -> &'tcx [(DefId, Option<SimplifiedType>)] {
1888 desc { "looking up implementations of a trait in a crate" }
1889 separate_provide_extern
1890 }
1891
1892 query crate_incoherent_impls(key: (CrateNum, SimplifiedType)) -> &'tcx [DefId] {
1897 desc { |tcx| "collecting all impls for a type in a crate" }
1898 separate_provide_extern
1899 }
1900
1901 query native_library(def_id: DefId) -> Option<&'tcx NativeLib> {
1903 desc { |tcx| "getting the native library for `{}`", tcx.def_path_str(def_id) }
1904 }
1905
1906 query inherit_sig_for_delegation_item(def_id: LocalDefId) -> &'tcx [Ty<'tcx>] {
1907 desc { "inheriting delegation signature" }
1908 }
1909
1910 query resolve_bound_vars(owner_id: hir::OwnerId) -> &'tcx ResolveBoundVars {
1914 arena_cache
1915 desc { |tcx| "resolving lifetimes for `{}`", tcx.def_path_str(owner_id) }
1916 }
1917 query named_variable_map(owner_id: hir::OwnerId) -> &'tcx SortedMap<ItemLocalId, ResolvedArg> {
1918 desc { |tcx| "looking up a named region inside `{}`", tcx.def_path_str(owner_id) }
1919 }
1920 query is_late_bound_map(owner_id: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
1921 desc { |tcx| "testing if a region is late bound inside `{}`", tcx.def_path_str(owner_id) }
1922 }
1923 query object_lifetime_default(def_id: DefId) -> ObjectLifetimeDefault {
1938 desc { "looking up lifetime defaults for type parameter `{}`", tcx.def_path_str(def_id) }
1939 separate_provide_extern
1940 }
1941 query late_bound_vars_map(owner_id: hir::OwnerId)
1942 -> &'tcx SortedMap<ItemLocalId, Vec<ty::BoundVariableKind>> {
1943 desc { |tcx| "looking up late bound vars inside `{}`", tcx.def_path_str(owner_id) }
1944 }
1945 query opaque_captured_lifetimes(def_id: LocalDefId) -> &'tcx [(ResolvedArg, LocalDefId)] {
1960 desc { |tcx| "listing captured lifetimes for opaque `{}`", tcx.def_path_str(def_id) }
1961 }
1962
1963 query visibility(def_id: DefId) -> ty::Visibility<DefId> {
1976 desc { |tcx| "computing visibility of `{}`", tcx.def_path_str(def_id) }
1977 separate_provide_extern
1978 feedable
1979 }
1980
1981 query inhabited_predicate_adt(key: DefId) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
1982 desc { "computing the uninhabited predicate of `{:?}`", key }
1983 }
1984
1985 query inhabited_predicate_type(key: Ty<'tcx>) -> ty::inhabitedness::InhabitedPredicate<'tcx> {
1987 desc { "computing the uninhabited predicate of `{}`", key }
1988 }
1989
1990 query dep_kind(_: CrateNum) -> CrateDepKind {
1991 eval_always
1992 desc { "fetching what a dependency looks like" }
1993 separate_provide_extern
1994 }
1995
1996 query crate_name(_: CrateNum) -> Symbol {
1998 feedable
1999 desc { "fetching what a crate is named" }
2000 separate_provide_extern
2001 }
2002 query module_children(def_id: DefId) -> &'tcx [ModChild] {
2003 desc { |tcx| "collecting child items of module `{}`", tcx.def_path_str(def_id) }
2004 separate_provide_extern
2005 }
2006 query extern_mod_stmt_cnum(def_id: LocalDefId) -> Option<CrateNum> {
2007 desc { |tcx| "computing crate imported by `{}`", tcx.def_path_str(def_id) }
2008 }
2009
2010 query num_extern_def_ids(_: CrateNum) -> usize {
2016 desc { "fetching the number of definitions in a crate" }
2017 separate_provide_extern
2018 }
2019
2020 query lib_features(_: CrateNum) -> &'tcx LibFeatures {
2021 desc { "calculating the lib features defined in a crate" }
2022 separate_provide_extern
2023 arena_cache
2024 }
2025 query stability_implications(_: CrateNum) -> &'tcx UnordMap<Symbol, Symbol> {
2026 arena_cache
2027 desc { "calculating the implications between `#[unstable]` features defined in a crate" }
2028 separate_provide_extern
2029 }
2030 query intrinsic_raw(def_id: DefId) -> Option<rustc_middle::ty::IntrinsicDef> {
2032 desc { |tcx| "fetch intrinsic name if `{}` is an intrinsic", tcx.def_path_str(def_id) }
2033 separate_provide_extern
2034 }
2035 query get_lang_items(_: ()) -> &'tcx LanguageItems {
2037 arena_cache
2038 eval_always
2039 desc { "calculating the lang items map" }
2040 }
2041
2042 query all_diagnostic_items(_: ()) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2044 arena_cache
2045 eval_always
2046 desc { "calculating the diagnostic items map" }
2047 }
2048
2049 query defined_lang_items(_: CrateNum) -> &'tcx [(DefId, LangItem)] {
2051 desc { "calculating the lang items defined in a crate" }
2052 separate_provide_extern
2053 }
2054
2055 query diagnostic_items(_: CrateNum) -> &'tcx rustc_hir::diagnostic_items::DiagnosticItems {
2057 arena_cache
2058 desc { "calculating the diagnostic items map in a crate" }
2059 separate_provide_extern
2060 }
2061
2062 query missing_lang_items(_: CrateNum) -> &'tcx [LangItem] {
2063 desc { "calculating the missing lang items in a crate" }
2064 separate_provide_extern
2065 }
2066
2067 query visible_parent_map(_: ()) -> &'tcx DefIdMap<DefId> {
2072 arena_cache
2073 desc { "calculating the visible parent map" }
2074 }
2075 query trimmed_def_paths(_: ()) -> &'tcx DefIdMap<Symbol> {
2078 arena_cache
2079 desc { "calculating trimmed def paths" }
2080 }
2081 query missing_extern_crate_item(_: CrateNum) -> bool {
2082 eval_always
2083 desc { "seeing if we're missing an `extern crate` item for this crate" }
2084 separate_provide_extern
2085 }
2086 query used_crate_source(_: CrateNum) -> &'tcx Arc<CrateSource> {
2087 arena_cache
2088 eval_always
2089 desc { "looking at the source for a crate" }
2090 separate_provide_extern
2091 }
2092
2093 query debugger_visualizers(_: CrateNum) -> &'tcx Vec<DebuggerVisualizerFile> {
2098 arena_cache
2099 desc { "looking up the debugger visualizers for this crate" }
2100 separate_provide_extern
2101 eval_always
2102 }
2103
2104 query postorder_cnums(_: ()) -> &'tcx [CrateNum] {
2105 eval_always
2106 desc { "generating a postorder list of CrateNums" }
2107 }
2108 query is_private_dep(c: CrateNum) -> bool {
2111 eval_always
2112 desc { "checking whether crate `{}` is a private dependency", c }
2113 separate_provide_extern
2114 }
2115 query allocator_kind(_: ()) -> Option<AllocatorKind> {
2116 eval_always
2117 desc { "getting the allocator kind for the current crate" }
2118 }
2119 query alloc_error_handler_kind(_: ()) -> Option<AllocatorKind> {
2120 eval_always
2121 desc { "alloc error handler kind for the current crate" }
2122 }
2123
2124 query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
2125 desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
2126 }
2127 query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
2128 desc { "fetching potentially unused trait imports" }
2129 }
2130 query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx UnordSet<Symbol> {
2131 desc { |tcx| "finding names imported by glob use for `{}`", tcx.def_path_str(def_id) }
2132 }
2133
2134 query stability_index(_: ()) -> &'tcx stability::Index {
2135 arena_cache
2136 eval_always
2137 desc { "calculating the stability index for the local crate" }
2138 }
2139 query crates(_: ()) -> &'tcx [CrateNum] {
2142 eval_always
2143 desc { "fetching all foreign CrateNum instances" }
2144 }
2145 query used_crates(_: ()) -> &'tcx [CrateNum] {
2149 eval_always
2150 desc { "fetching `CrateNum`s for all crates loaded non-speculatively" }
2151 }
2152
2153 query traits(_: CrateNum) -> &'tcx [DefId] {
2155 desc { "fetching all traits in a crate" }
2156 separate_provide_extern
2157 }
2158
2159 query trait_impls_in_crate(_: CrateNum) -> &'tcx [DefId] {
2160 desc { "fetching all trait impls in a crate" }
2161 separate_provide_extern
2162 }
2163
2164 query exported_symbols(cnum: CrateNum) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)] {
2170 desc { "collecting exported symbols for crate `{}`", cnum}
2171 cache_on_disk_if { *cnum == LOCAL_CRATE }
2172 separate_provide_extern
2173 }
2174
2175 query collect_and_partition_mono_items(_: ()) -> MonoItemPartitions<'tcx> {
2176 eval_always
2177 desc { "collect_and_partition_mono_items" }
2178 }
2179
2180 query is_codegened_item(def_id: DefId) -> bool {
2181 desc { |tcx| "determining whether `{}` needs codegen", tcx.def_path_str(def_id) }
2182 }
2183
2184 query codegen_unit(sym: Symbol) -> &'tcx CodegenUnit<'tcx> {
2185 desc { "getting codegen unit `{sym}`" }
2186 }
2187
2188 query backend_optimization_level(_: ()) -> OptLevel {
2189 desc { "optimization level used by backend" }
2190 }
2191
2192 query output_filenames(_: ()) -> &'tcx Arc<OutputFilenames> {
2197 feedable
2198 desc { "getting output filenames" }
2199 arena_cache
2200 }
2201
2202 query normalize_canonicalized_projection_ty(
2208 goal: CanonicalAliasGoal<'tcx>
2209 ) -> Result<
2210 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2211 NoSolution,
2212 > {
2213 desc { "normalizing `{}`", goal.canonical.value.value }
2214 }
2215
2216 query normalize_canonicalized_weak_ty(
2222 goal: CanonicalAliasGoal<'tcx>
2223 ) -> Result<
2224 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2225 NoSolution,
2226 > {
2227 desc { "normalizing `{}`", goal.canonical.value.value }
2228 }
2229
2230 query normalize_canonicalized_inherent_projection_ty(
2236 goal: CanonicalAliasGoal<'tcx>
2237 ) -> Result<
2238 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
2239 NoSolution,
2240 > {
2241 desc { "normalizing `{}`", goal.canonical.value.value }
2242 }
2243
2244 query try_normalize_generic_arg_after_erasing_regions(
2246 goal: PseudoCanonicalInput<'tcx, GenericArg<'tcx>>
2247 ) -> Result<GenericArg<'tcx>, NoSolution> {
2248 desc { "normalizing `{}`", goal.value }
2249 }
2250
2251 query implied_outlives_bounds_compat(
2252 goal: CanonicalImpliedOutlivesBoundsGoal<'tcx>
2253 ) -> Result<
2254 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>,
2255 NoSolution,
2256 > {
2257 desc { "computing implied outlives bounds for `{}`", goal.canonical.value.value.ty }
2258 }
2259
2260 query implied_outlives_bounds(
2261 goal: CanonicalImpliedOutlivesBoundsGoal<'tcx>
2262 ) -> Result<
2263 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>,
2264 NoSolution,
2265 > {
2266 desc { "computing implied outlives bounds v2 for `{}`", goal.canonical.value.value.ty }
2267 }
2268
2269 query dropck_outlives(
2272 goal: CanonicalDropckOutlivesGoal<'tcx>
2273 ) -> Result<
2274 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>,
2275 NoSolution,
2276 > {
2277 desc { "computing dropck types for `{}`", goal.canonical.value.value.dropped_ty }
2278 }
2279
2280 query evaluate_obligation(
2283 goal: CanonicalPredicateGoal<'tcx>
2284 ) -> Result<EvaluationResult, OverflowError> {
2285 desc { "evaluating trait selection obligation `{}`", goal.canonical.value.value }
2286 }
2287
2288 query type_op_ascribe_user_type(
2290 goal: CanonicalTypeOpAscribeUserTypeGoal<'tcx>
2291 ) -> Result<
2292 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2293 NoSolution,
2294 > {
2295 desc { "evaluating `type_op_ascribe_user_type` `{:?}`", goal.canonical.value.value }
2296 }
2297
2298 query type_op_prove_predicate(
2300 goal: CanonicalTypeOpProvePredicateGoal<'tcx>
2301 ) -> Result<
2302 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
2303 NoSolution,
2304 > {
2305 desc { "evaluating `type_op_prove_predicate` `{:?}`", goal.canonical.value.value }
2306 }
2307
2308 query type_op_normalize_ty(
2310 goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>
2311 ) -> Result<
2312 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>,
2313 NoSolution,
2314 > {
2315 desc { "normalizing `{}`", goal.canonical.value.value.value }
2316 }
2317
2318 query type_op_normalize_clause(
2320 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Clause<'tcx>>
2321 ) -> Result<
2322 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Clause<'tcx>>>,
2323 NoSolution,
2324 > {
2325 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2326 }
2327
2328 query type_op_normalize_poly_fn_sig(
2330 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>
2331 ) -> Result<
2332 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>,
2333 NoSolution,
2334 > {
2335 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2336 }
2337
2338 query type_op_normalize_fn_sig(
2340 goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>
2341 ) -> Result<
2342 &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>,
2343 NoSolution,
2344 > {
2345 desc { "normalizing `{:?}`", goal.canonical.value.value.value }
2346 }
2347
2348 query instantiate_and_check_impossible_predicates(key: (DefId, GenericArgsRef<'tcx>)) -> bool {
2349 desc { |tcx|
2350 "checking impossible instantiated predicates: `{}`",
2351 tcx.def_path_str(key.0)
2352 }
2353 }
2354
2355 query is_impossible_associated_item(key: (DefId, DefId)) -> bool {
2356 desc { |tcx|
2357 "checking if `{}` is impossible to reference within `{}`",
2358 tcx.def_path_str(key.1),
2359 tcx.def_path_str(key.0),
2360 }
2361 }
2362
2363 query method_autoderef_steps(
2364 goal: CanonicalTyGoal<'tcx>
2365 ) -> MethodAutoderefStepsResult<'tcx> {
2366 desc { "computing autoderef types for `{}`", goal.canonical.value.value }
2367 }
2368
2369 query rust_target_features(_: CrateNum) -> &'tcx UnordMap<String, rustc_target::target_features::Stability> {
2371 arena_cache
2372 eval_always
2373 desc { "looking up Rust target features" }
2374 }
2375
2376 query implied_target_features(feature: Symbol) -> &'tcx Vec<Symbol> {
2377 arena_cache
2378 eval_always
2379 desc { "looking up implied target features" }
2380 }
2381
2382 query features_query(_: ()) -> &'tcx rustc_feature::Features {
2383 feedable
2384 desc { "looking up enabled feature gates" }
2385 }
2386
2387 query crate_for_resolver((): ()) -> &'tcx Steal<(rustc_ast::Crate, rustc_ast::AttrVec)> {
2388 feedable
2389 no_hash
2390 desc { "the ast before macro expansion and name resolution" }
2391 }
2392
2393 query resolve_instance_raw(
2403 key: ty::PseudoCanonicalInput<'tcx, (DefId, GenericArgsRef<'tcx>)>
2404 ) -> Result<Option<ty::Instance<'tcx>>, ErrorGuaranteed> {
2405 desc { "resolving instance `{}`", ty::Instance::new(key.value.0, key.value.1) }
2406 }
2407
2408 query reveal_opaque_types_in_bounds(key: ty::Clauses<'tcx>) -> ty::Clauses<'tcx> {
2409 desc { "revealing opaque types in `{:?}`", key }
2410 }
2411
2412 query limits(key: ()) -> Limits {
2413 desc { "looking up limits" }
2414 }
2415
2416 query diagnostic_hir_wf_check(
2425 key: (ty::Predicate<'tcx>, WellFormedLoc)
2426 ) -> Option<&'tcx ObligationCause<'tcx>> {
2427 arena_cache
2428 eval_always
2429 no_hash
2430 desc { "performing HIR wf-checking for predicate `{:?}` at item `{:?}`", key.0, key.1 }
2431 }
2432
2433 query global_backend_features(_: ()) -> &'tcx Vec<String> {
2436 arena_cache
2437 eval_always
2438 desc { "computing the backend features for CLI flags" }
2439 }
2440
2441 query check_validity_requirement(key: (ValidityRequirement, ty::PseudoCanonicalInput<'tcx, Ty<'tcx>>)) -> Result<bool, &'tcx ty::layout::LayoutError<'tcx>> {
2442 desc { "checking validity requirement for `{}`: {}", key.1.value, key.0 }
2443 }
2444
2445 query compare_impl_item(key: LocalDefId) -> Result<(), ErrorGuaranteed> {
2450 desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key) }
2451 return_result_from_ensure_ok
2452 }
2453
2454 query deduced_param_attrs(def_id: DefId) -> &'tcx [ty::DeducedParamAttrs] {
2455 desc { |tcx| "deducing parameter attributes for {}", tcx.def_path_str(def_id) }
2456 separate_provide_extern
2457 }
2458
2459 query doc_link_resolutions(def_id: DefId) -> &'tcx DocLinkResMap {
2460 eval_always
2461 desc { "resolutions for documentation links for a module" }
2462 separate_provide_extern
2463 }
2464
2465 query doc_link_traits_in_scope(def_id: DefId) -> &'tcx [DefId] {
2466 eval_always
2467 desc { "traits in scope for documentation links for a module" }
2468 separate_provide_extern
2469 }
2470
2471 query stripped_cfg_items(cnum: CrateNum) -> &'tcx [StrippedCfgItem] {
2475 desc { "getting cfg-ed out item names" }
2476 separate_provide_extern
2477 }
2478
2479 query generics_require_sized_self(def_id: DefId) -> bool {
2480 desc { "check whether the item has a `where Self: Sized` bound" }
2481 }
2482
2483 query cross_crate_inlinable(def_id: DefId) -> bool {
2484 desc { "whether the item should be made inlinable across crates" }
2485 separate_provide_extern
2486 }
2487
2488 query check_mono_item(key: ty::Instance<'tcx>) {
2492 desc { "monomorphization-time checking" }
2493 cache_on_disk_if { true }
2494 }
2495
2496 query skip_move_check_fns(_: ()) -> &'tcx FxIndexSet<DefId> {
2498 arena_cache
2499 desc { "functions to skip for move-size check" }
2500 }
2501
2502 query items_of_instance(key: (ty::Instance<'tcx>, CollectionMode)) -> (&'tcx [Spanned<MonoItem<'tcx>>], &'tcx [Spanned<MonoItem<'tcx>>]) {
2503 desc { "collecting items used by `{}`", key.0 }
2504 cache_on_disk_if { true }
2505 }
2506
2507 query size_estimate(key: ty::Instance<'tcx>) -> usize {
2508 desc { "estimating codegen size of `{}`", key }
2509 cache_on_disk_if { true }
2510 }
2511}
2512
2513rustc_query_append! { define_callbacks! }
2514rustc_feedable_queries! { define_feedable! }