pub struct QueryCaches<'tcx> {Show 293 fields
pub trigger_delayed_bug: Storage<'tcx>,
pub registered_tools: Storage<'tcx>,
pub early_lint_checks: Storage<'tcx>,
pub resolutions: Storage<'tcx>,
pub resolver_for_lowering_raw: Storage<'tcx>,
pub source_span: Storage<'tcx>,
pub hir_crate: Storage<'tcx>,
pub hir_crate_items: Storage<'tcx>,
pub hir_module_items: Storage<'tcx>,
pub local_def_id_to_hir_id: Storage<'tcx>,
pub hir_owner_parent: Storage<'tcx>,
pub opt_hir_owner_nodes: Storage<'tcx>,
pub hir_attrs: Storage<'tcx>,
pub const_param_default: Storage<'tcx>,
pub type_of: Storage<'tcx>,
pub type_of_opaque: Storage<'tcx>,
pub type_alias_is_lazy: Storage<'tcx>,
pub collect_return_position_impl_trait_in_trait_tys: Storage<'tcx>,
pub is_type_alias_impl_trait: Storage<'tcx>,
pub unsizing_params_for_adt: Storage<'tcx>,
pub analysis: Storage<'tcx>,
pub check_expectations: Storage<'tcx>,
pub generics_of: Storage<'tcx>,
pub predicates_of: Storage<'tcx>,
pub opaque_types_defined_by: Storage<'tcx>,
pub explicit_item_bounds: Storage<'tcx>,
pub explicit_item_super_predicates: Storage<'tcx>,
pub item_bounds: Storage<'tcx>,
pub item_super_predicates: Storage<'tcx>,
pub item_non_self_assumptions: Storage<'tcx>,
pub impl_super_outlives: Storage<'tcx>,
pub native_libraries: Storage<'tcx>,
pub shallow_lint_levels_on: Storage<'tcx>,
pub lint_expectations: Storage<'tcx>,
pub expn_that_defined: Storage<'tcx>,
pub is_panic_runtime: Storage<'tcx>,
pub representability: Storage<'tcx>,
pub representability_adt_ty: Storage<'tcx>,
pub params_in_repr: Storage<'tcx>,
pub thir_body: Storage<'tcx>,
pub mir_keys: Storage<'tcx>,
pub mir_const_qualif: Storage<'tcx>,
pub mir_built: Storage<'tcx>,
pub thir_abstract_const: Storage<'tcx>,
pub mir_drops_elaborated_and_const_checked: Storage<'tcx>,
pub mir_for_ctfe: Storage<'tcx>,
pub mir_promoted: Storage<'tcx>,
pub closure_typeinfo: Storage<'tcx>,
pub closure_saved_names_of_captured_variables: Storage<'tcx>,
pub mir_coroutine_witnesses: Storage<'tcx>,
pub check_coroutine_obligations: Storage<'tcx>,
pub optimized_mir: Storage<'tcx>,
pub coverage_attr_on: Storage<'tcx>,
pub coverage_ids_info: Storage<'tcx>,
pub promoted_mir: Storage<'tcx>,
pub erase_regions_ty: Storage<'tcx>,
pub wasm_import_module_map: Storage<'tcx>,
pub trait_explicit_predicates_and_bounds: Storage<'tcx>,
pub explicit_predicates_of: Storage<'tcx>,
pub inferred_outlives_of: Storage<'tcx>,
pub explicit_super_predicates_of: Storage<'tcx>,
pub explicit_implied_predicates_of: Storage<'tcx>,
pub explicit_supertraits_containing_assoc_item: Storage<'tcx>,
pub type_param_predicates: Storage<'tcx>,
pub trait_def: Storage<'tcx>,
pub adt_def: Storage<'tcx>,
pub adt_destructor: Storage<'tcx>,
pub adt_async_destructor: Storage<'tcx>,
pub adt_sized_constraint: Storage<'tcx>,
pub adt_dtorck_constraint: Storage<'tcx>,
pub constness: Storage<'tcx>,
pub asyncness: Storage<'tcx>,
pub is_promotable_const_fn: Storage<'tcx>,
pub coroutine_by_move_body_def_id: Storage<'tcx>,
pub coroutine_kind: Storage<'tcx>,
pub coroutine_for_closure: Storage<'tcx>,
pub crate_variances: Storage<'tcx>,
pub variances_of: Storage<'tcx>,
pub inferred_outlives_crate: Storage<'tcx>,
pub associated_item_def_ids: Storage<'tcx>,
pub associated_item: Storage<'tcx>,
pub associated_items: Storage<'tcx>,
pub impl_item_implementor_ids: Storage<'tcx>,
pub associated_types_for_impl_traits_in_associated_fn: Storage<'tcx>,
pub associated_type_for_effects: Storage<'tcx>,
pub associated_type_for_impl_trait_in_trait: Storage<'tcx>,
pub impl_trait_header: Storage<'tcx>,
pub self_ty_of_trait_impl_enabling_order_dep_trait_object_hack: Storage<'tcx>,
pub inherent_impls: Storage<'tcx>,
pub incoherent_impls: Storage<'tcx>,
pub check_unsafety: Storage<'tcx>,
pub assumed_wf_types: Storage<'tcx>,
pub assumed_wf_types_for_rpitit: Storage<'tcx>,
pub fn_sig: Storage<'tcx>,
pub lint_mod: Storage<'tcx>,
pub check_unused_traits: Storage<'tcx>,
pub check_mod_attrs: Storage<'tcx>,
pub check_mod_unstable_api_usage: Storage<'tcx>,
pub check_mod_const_bodies: Storage<'tcx>,
pub check_mod_loops: Storage<'tcx>,
pub check_mod_naked_functions: Storage<'tcx>,
pub check_mod_privacy: Storage<'tcx>,
pub check_liveness: Storage<'tcx>,
pub live_symbols_and_ignored_derived_traits: Storage<'tcx>,
pub check_mod_deathness: Storage<'tcx>,
pub check_mod_type_wf: Storage<'tcx>,
pub coerce_unsized_info: Storage<'tcx>,
pub typeck: Storage<'tcx>,
pub diagnostic_only_typeck: Storage<'tcx>,
pub used_trait_imports: Storage<'tcx>,
pub coherent_trait: Storage<'tcx>,
pub mir_borrowck: Storage<'tcx>,
pub crate_inherent_impls: Storage<'tcx>,
pub crate_inherent_impls_validity_check: Storage<'tcx>,
pub crate_inherent_impls_overlap_check: Storage<'tcx>,
pub orphan_check_impl: Storage<'tcx>,
pub mir_callgraph_reachable: Storage<'tcx>,
pub mir_inliner_callees: Storage<'tcx>,
pub tag_for_variant: Storage<'tcx>,
pub eval_to_allocation_raw: Storage<'tcx>,
pub eval_static_initializer: Storage<'tcx>,
pub eval_to_const_value_raw: Storage<'tcx>,
pub eval_to_valtree: Storage<'tcx>,
pub valtree_to_const_val: Storage<'tcx>,
pub destructure_const: Storage<'tcx>,
pub lit_to_const: Storage<'tcx>,
pub check_match: Storage<'tcx>,
pub effective_visibilities: Storage<'tcx>,
pub check_private_in_public: Storage<'tcx>,
pub reachable_set: Storage<'tcx>,
pub region_scope_tree: Storage<'tcx>,
pub mir_shims: Storage<'tcx>,
pub symbol_name: Storage<'tcx>,
pub def_kind: Storage<'tcx>,
pub def_span: Storage<'tcx>,
pub def_ident_span: Storage<'tcx>,
pub lookup_stability: Storage<'tcx>,
pub lookup_const_stability: Storage<'tcx>,
pub lookup_default_body_stability: Storage<'tcx>,
pub should_inherit_track_caller: Storage<'tcx>,
pub lookup_deprecation_entry: Storage<'tcx>,
pub is_doc_hidden: Storage<'tcx>,
pub is_doc_notable_trait: Storage<'tcx>,
pub item_attrs: Storage<'tcx>,
pub codegen_fn_attrs: Storage<'tcx>,
pub asm_target_features: Storage<'tcx>,
pub fn_arg_names: Storage<'tcx>,
pub rendered_const: Storage<'tcx>,
pub rendered_precise_capturing_args: Storage<'tcx>,
pub impl_parent: Storage<'tcx>,
pub is_ctfe_mir_available: Storage<'tcx>,
pub is_mir_available: Storage<'tcx>,
pub own_existential_vtable_entries: Storage<'tcx>,
pub vtable_entries: Storage<'tcx>,
pub first_method_vtable_slot: Storage<'tcx>,
pub supertrait_vtable_slot: Storage<'tcx>,
pub vtable_allocation: Storage<'tcx>,
pub codegen_select_candidate: Storage<'tcx>,
pub all_local_trait_impls: Storage<'tcx>,
pub trait_impls_of: Storage<'tcx>,
pub specialization_graph_of: Storage<'tcx>,
pub dyn_compatibility_violations: Storage<'tcx>,
pub is_dyn_compatible: Storage<'tcx>,
pub param_env: Storage<'tcx>,
pub param_env_reveal_all_normalized: Storage<'tcx>,
pub is_copy_raw: Storage<'tcx>,
pub is_sized_raw: Storage<'tcx>,
pub is_freeze_raw: Storage<'tcx>,
pub is_unpin_raw: Storage<'tcx>,
pub needs_drop_raw: Storage<'tcx>,
pub needs_async_drop_raw: Storage<'tcx>,
pub has_significant_drop_raw: Storage<'tcx>,
pub has_structural_eq_impl: Storage<'tcx>,
pub adt_drop_tys: Storage<'tcx>,
pub adt_significant_drop_tys: Storage<'tcx>,
pub layout_of: Storage<'tcx>,
pub fn_abi_of_fn_ptr: Storage<'tcx>,
pub fn_abi_of_instance: Storage<'tcx>,
pub dylib_dependency_formats: Storage<'tcx>,
pub dependency_formats: Storage<'tcx>,
pub is_compiler_builtins: Storage<'tcx>,
pub has_global_allocator: Storage<'tcx>,
pub has_alloc_error_handler: Storage<'tcx>,
pub has_panic_handler: Storage<'tcx>,
pub is_profiler_runtime: Storage<'tcx>,
pub has_ffi_unwind_calls: Storage<'tcx>,
pub required_panic_strategy: Storage<'tcx>,
pub panic_in_drop_strategy: Storage<'tcx>,
pub is_no_builtins: Storage<'tcx>,
pub symbol_mangling_version: Storage<'tcx>,
pub extern_crate: Storage<'tcx>,
pub specialization_enabled_in: Storage<'tcx>,
pub specializes: Storage<'tcx>,
pub in_scope_traits_map: Storage<'tcx>,
pub defaultness: Storage<'tcx>,
pub check_well_formed: Storage<'tcx>,
pub reachable_non_generics: Storage<'tcx>,
pub is_reachable_non_generic: Storage<'tcx>,
pub is_unreachable_local_definition: Storage<'tcx>,
pub upstream_monomorphizations: Storage<'tcx>,
pub upstream_monomorphizations_for: Storage<'tcx>,
pub upstream_drop_glue_for: Storage<'tcx>,
pub upstream_async_drop_glue_for: Storage<'tcx>,
pub foreign_modules: Storage<'tcx>,
pub clashing_extern_declarations: Storage<'tcx>,
pub entry_fn: Storage<'tcx>,
pub proc_macro_decls_static: Storage<'tcx>,
pub crate_hash: Storage<'tcx>,
pub crate_host_hash: Storage<'tcx>,
pub extra_filename: Storage<'tcx>,
pub crate_extern_paths: Storage<'tcx>,
pub implementations_of_trait: Storage<'tcx>,
pub crate_incoherent_impls: Storage<'tcx>,
pub native_library: Storage<'tcx>,
pub inherit_sig_for_delegation_item: Storage<'tcx>,
pub resolve_bound_vars: Storage<'tcx>,
pub named_variable_map: Storage<'tcx>,
pub is_late_bound_map: Storage<'tcx>,
pub object_lifetime_default: Storage<'tcx>,
pub late_bound_vars_map: Storage<'tcx>,
pub visibility: Storage<'tcx>,
pub inhabited_predicate_adt: Storage<'tcx>,
pub inhabited_predicate_type: Storage<'tcx>,
pub dep_kind: Storage<'tcx>,
pub crate_name: Storage<'tcx>,
pub module_children: Storage<'tcx>,
pub extern_mod_stmt_cnum: Storage<'tcx>,
pub lib_features: Storage<'tcx>,
pub stability_implications: Storage<'tcx>,
pub intrinsic_raw: Storage<'tcx>,
pub get_lang_items: Storage<'tcx>,
pub all_diagnostic_items: Storage<'tcx>,
pub defined_lang_items: Storage<'tcx>,
pub diagnostic_items: Storage<'tcx>,
pub missing_lang_items: Storage<'tcx>,
pub visible_parent_map: Storage<'tcx>,
pub trimmed_def_paths: Storage<'tcx>,
pub missing_extern_crate_item: Storage<'tcx>,
pub used_crate_source: Storage<'tcx>,
pub debugger_visualizers: Storage<'tcx>,
pub postorder_cnums: Storage<'tcx>,
pub is_private_dep: Storage<'tcx>,
pub allocator_kind: Storage<'tcx>,
pub alloc_error_handler_kind: Storage<'tcx>,
pub upvars_mentioned: Storage<'tcx>,
pub maybe_unused_trait_imports: Storage<'tcx>,
pub names_imported_by_glob_use: Storage<'tcx>,
pub stability_index: Storage<'tcx>,
pub crates: Storage<'tcx>,
pub used_crates: Storage<'tcx>,
pub traits: Storage<'tcx>,
pub trait_impls_in_crate: Storage<'tcx>,
pub exported_symbols: Storage<'tcx>,
pub collect_and_partition_mono_items: Storage<'tcx>,
pub is_codegened_item: Storage<'tcx>,
pub codegen_unit: Storage<'tcx>,
pub unused_generic_params: Storage<'tcx>,
pub backend_optimization_level: Storage<'tcx>,
pub output_filenames: Storage<'tcx>,
pub normalize_canonicalized_projection_ty: Storage<'tcx>,
pub normalize_canonicalized_weak_ty: Storage<'tcx>,
pub normalize_canonicalized_inherent_projection_ty: Storage<'tcx>,
pub try_normalize_generic_arg_after_erasing_regions: Storage<'tcx>,
pub implied_outlives_bounds_compat: Storage<'tcx>,
pub implied_outlives_bounds: Storage<'tcx>,
pub dropck_outlives: Storage<'tcx>,
pub evaluate_obligation: Storage<'tcx>,
pub type_op_ascribe_user_type: Storage<'tcx>,
pub type_op_prove_predicate: Storage<'tcx>,
pub type_op_normalize_ty: Storage<'tcx>,
pub type_op_normalize_clause: Storage<'tcx>,
pub type_op_normalize_poly_fn_sig: Storage<'tcx>,
pub type_op_normalize_fn_sig: Storage<'tcx>,
pub instantiate_and_check_impossible_predicates: Storage<'tcx>,
pub is_impossible_associated_item: Storage<'tcx>,
pub method_autoderef_steps: Storage<'tcx>,
pub supported_target_features: Storage<'tcx>,
pub implied_target_features: Storage<'tcx>,
pub features_query: Storage<'tcx>,
pub crate_for_resolver: Storage<'tcx>,
pub resolve_instance_raw: Storage<'tcx>,
pub reveal_opaque_types_in_bounds: Storage<'tcx>,
pub limits: Storage<'tcx>,
pub diagnostic_hir_wf_check: Storage<'tcx>,
pub global_backend_features: Storage<'tcx>,
pub check_validity_requirement: Storage<'tcx>,
pub compare_impl_const: Storage<'tcx>,
pub deduced_param_attrs: Storage<'tcx>,
pub doc_link_resolutions: Storage<'tcx>,
pub doc_link_traits_in_scope: Storage<'tcx>,
pub stripped_cfg_items: Storage<'tcx>,
pub generics_require_sized_self: Storage<'tcx>,
pub cross_crate_inlinable: Storage<'tcx>,
}
Fields§
§trigger_delayed_bug: Storage<'tcx>
This exists purely for testing the interactions between delayed bugs and incremental.
registered_tools: Storage<'tcx>
Collects the list of all tools registered using #![register_tool]
.
early_lint_checks: Storage<'tcx>
[query description - consider adding a doc-comment!] perform lints prior to macro expansion
resolutions: Storage<'tcx>
[query description - consider adding a doc-comment!] getting the resolver outputs
resolver_for_lowering_raw: Storage<'tcx>
[query description - consider adding a doc-comment!] getting the resolver for lowering
source_span: Storage<'tcx>
Return the span for a definition.
Contrary to def_span
below, this query returns the full absolute span of the definition.
This span is meant for dep-tracking rather than diagnostics. It should not be used outside
of rustc_middle::hir::source_map.
hir_crate: Storage<'tcx>
Represents crate as a whole (as distinct from the top-level crate module).
If you call hir_crate
(e.g., indirectly by calling tcx.hir().krate()
),
we will have to assume that any change means that you need to be recompiled.
This is because the hir_crate
query gives you access to all other items.
To avoid this fate, do not call tcx.hir().krate()
; instead,
prefer wrappers like tcx.visit_all_items_in_krate()
.
hir_crate_items: Storage<'tcx>
All items in the crate.
hir_module_items: Storage<'tcx>
The items in a module.
This can be conveniently accessed by tcx.hir().visit_item_likes_in_module
.
Avoid calling this query directly.
local_def_id_to_hir_id: Storage<'tcx>
Returns HIR ID for the given LocalDefId
.
hir_owner_parent: Storage<'tcx>
Gives access to the HIR node’s parent for the HIR owner key
.
This can be conveniently accessed by methods on tcx.hir()
.
Avoid calling this query directly.
opt_hir_owner_nodes: Storage<'tcx>
Gives access to the HIR nodes and bodies inside key
if it’s a HIR owner.
This can be conveniently accessed by methods on tcx.hir()
.
Avoid calling this query directly.
hir_attrs: Storage<'tcx>
Gives access to the HIR attributes inside the HIR owner key
.
This can be conveniently accessed by methods on tcx.hir()
.
Avoid calling this query directly.
const_param_default: Storage<'tcx>
Given the def_id of a const-generic parameter, computes the associated default const
parameter. e.g. fn example<const N: usize=3>
called on N
would return 3
.
type_of: Storage<'tcx>
Returns the Ty
of the given DefId
. If the DefId
points
to an alias, it will “skip” this alias to return the aliased type.
type_of_opaque: Storage<'tcx>
Specialized instance of type_of
that detects cycles that are due to
revealing opaque because of an auto trait bound. Unless CyclePlaceholder
needs
to be handled separately, call type_of
instead.
type_alias_is_lazy: Storage<'tcx>
[query description - consider adding a doc-comment!] computing whether {path}
is a lazy type alias
collect_return_position_impl_trait_in_trait_tys: Storage<'tcx>
[query description - consider adding a doc-comment!] comparing an impl and trait method signature, inferring any hidden impl Trait
types in the process
is_type_alias_impl_trait: Storage<'tcx>
[query description - consider adding a doc-comment!] determine whether the opaque is a type-alias impl trait
unsizing_params_for_adt: Storage<'tcx>
[query description - consider adding a doc-comment!] determining what parameters of tcx.def_path_str(key)
can participate in unsizing
analysis: Storage<'tcx>
The root query triggering all analysis passes like typeck or borrowck.
check_expectations: Storage<'tcx>
This query checks the fulfillment of collected lint expectations. All lint emitting queries have to be done before this is executed to ensure that all expectations can be fulfilled.
This is an extra query to enable other drivers (like rustdoc) to
only execute a small subset of the analysis
query, while allowing
lints to be expected. In rustc, this query will be executed as part of
the analysis
query and doesn’t have to be called a second time.
Tools can additionally pass in a tool filter. That will restrict the
expectations to only trigger for lints starting with the listed tool
name. This is useful for cases were not all linting code from rustc
was called. With the default None
all registered lints will also
be checked for expectation fulfillment.
generics_of: Storage<'tcx>
Maps from the DefId
of an item (trait/struct/enum/fn) to its
associated generics.
predicates_of: Storage<'tcx>
Maps from the DefId
of an item (trait/struct/enum/fn) to the
predicates (where-clauses) that must be proven true in order
to reference it. This is almost always the “predicates query”
that you want.
opaque_types_defined_by: Storage<'tcx>
[query description - consider adding a doc-comment!] computing the opaque types defined by tcx.def_path_str(key.to_def_id())
explicit_item_bounds: Storage<'tcx>
Returns the list of bounds that are required to be satisfied by a implementation or definition. For associated types, these must be satisfied for an implementation to be well-formed, and for opaque types, these are required to be satisfied by the hidden-type of the opaque.
Syntactially, these are the bounds written on the trait’s type
definition, or those after the impl
keyword for an opaque:
type X: Bound + 'lt
// ^^^^^^^^^^^
impl Debug + Display
// ^^^^^^^^^^^^^^^
key
is the DefId
of the associated type or opaque type.
Bounds from the parent (e.g. with nested impl trait) are not included.
explicit_item_super_predicates: Storage<'tcx>
The set of item bounds (see TyCtxt::explicit_item_bounds
) that
share the Self
type of the item. These are a subset of the bounds
that may explicitly be used for things like closure signature
deduction.
item_bounds: Storage<'tcx>
Elaborated version of the predicates from explicit_item_bounds
.
For example:
trait MyTrait {
type MyAType: Eq + ?Sized;
}
explicit_item_bounds
returns [<Self as MyTrait>::MyAType: Eq]
,
and item_bounds
returns
[
<Self as Trait>::MyAType: Eq,
<Self as Trait>::MyAType: PartialEq<<Self as Trait>::MyAType>
]
Bounds from the parent (e.g. with nested impl trait) are not included.
item_super_predicates: Storage<'tcx>
[query description - consider adding a doc-comment!] elaborating item assumptions for tcx.def_path_str(key)
item_non_self_assumptions: Storage<'tcx>
[query description - consider adding a doc-comment!] elaborating item assumptions for tcx.def_path_str(key)
impl_super_outlives: Storage<'tcx>
[query description - consider adding a doc-comment!] elaborating supertrait outlives for trait of tcx.def_path_str(key)
native_libraries: Storage<'tcx>
Look up all native libraries this crate depends on. These are assembled from the following places:
extern
blocks (depending on theirlink
attributes)- the
libs
(-l
) option
shallow_lint_levels_on: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up lint levels for tcx.def_path_str(key)
lint_expectations: Storage<'tcx>
[query description - consider adding a doc-comment!] computing #[expect]
ed lints in this crate
expn_that_defined: Storage<'tcx>
[query description - consider adding a doc-comment!] getting the expansion that defined tcx.def_path_str(key)
is_panic_runtime: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the crate is_panic_runtime
representability: Storage<'tcx>
Checks whether a type is representable or infinitely sized
representability_adt_ty: Storage<'tcx>
An implementation detail for the representability
query
params_in_repr: Storage<'tcx>
Set of param indexes for type params that are in the type’s representation
thir_body: Storage<'tcx>
Fetch the THIR for a given body. If typeck for that body failed, returns an empty Thir
.
mir_keys: Storage<'tcx>
Set of all the DefId
s in this crate that have MIR associated with
them. This includes all the body owners, but also things like struct
constructors.
mir_const_qualif: Storage<'tcx>
Maps DefId’s that have an associated mir::Body
to the result
of the MIR const-checking pass. This is the set of qualifs in
the final value of a const
.
mir_built: Storage<'tcx>
Build the MIR for a given DefId
and prepare it for const qualification.
See the rustc dev guide for more info.
thir_abstract_const: Storage<'tcx>
Try to build an abstract representation of the given constant.
mir_drops_elaborated_and_const_checked: Storage<'tcx>
[query description - consider adding a doc-comment!] elaborating drops for tcx.def_path_str(key)
mir_for_ctfe: Storage<'tcx>
[query description - consider adding a doc-comment!] caching mir of tcx.def_path_str(key)
for CTFE
mir_promoted: Storage<'tcx>
[query description - consider adding a doc-comment!] promoting constants in MIR for tcx.def_path_str(key)
closure_typeinfo: Storage<'tcx>
[query description - consider adding a doc-comment!] finding symbols for captures of closure tcx.def_path_str(key)
closure_saved_names_of_captured_variables: Storage<'tcx>
Returns names of captured upvars for closures and coroutines.
Here are some examples:
name__field1__field2
when the upvar is captured by value._ref__name__field
when the upvar is captured by reference.
For coroutines this only contains upvars that are shared by all states.
mir_coroutine_witnesses: Storage<'tcx>
[query description - consider adding a doc-comment!] coroutine witness types for tcx.def_path_str(key)
check_coroutine_obligations: Storage<'tcx>
[query description - consider adding a doc-comment!] verify auto trait bounds for coroutine interior type tcx.def_path_str(key)
optimized_mir: Storage<'tcx>
MIR after our optimization passes have run. This is MIR that is ready for codegen. This is also the only query that can fetch non-local MIR, at present.
coverage_attr_on: Storage<'tcx>
Checks for the nearest #[coverage(off)]
or #[coverage(on)]
on
this def and any enclosing defs, up to the crate root.
Returns false
if #[coverage(off)]
was found, or true
if
either #[coverage(on)]
or no coverage attribute was found.
coverage_ids_info: Storage<'tcx>
Summarizes coverage IDs inserted by the InstrumentCoverage
MIR pass
(for compiler option -Cinstrument-coverage
), after MIR optimizations
have had a chance to potentially remove some of them.
promoted_mir: Storage<'tcx>
The DefId
is the DefId
of the containing MIR body. Promoteds do not have their own
DefId
. This function returns all promoteds in the specified body. The body references
promoteds by the DefId
and the mir::Promoted
index. This is necessary, because
after inlining a body may refer to promoteds from other bodies. In that case you still
need to use the DefId
of the original body.
erase_regions_ty: Storage<'tcx>
Erases regions from ty
to yield a new type.
Normally you would just use tcx.erase_regions(value)
,
however, which uses this query as a kind of cache.
wasm_import_module_map: Storage<'tcx>
[query description - consider adding a doc-comment!] getting wasm import module map
trait_explicit_predicates_and_bounds: Storage<'tcx>
Returns everything that looks like a predicate written explicitly by the user on a trait item.
Traits are unusual, because predicates on associated types are converted into bounds on that type for backwards compatibility:
trait X where Self::U: Copy { type U; }
becomes
trait X { type U: Copy; }
explicit_predicates_of
and explicit_item_bounds
will then take
the appropriate subsets of the predicates here.
explicit_predicates_of: Storage<'tcx>
Returns the predicates written explicitly by the user.
You should probably use predicates_of
unless you’re looking for
predicates with explicit spans for diagnostics purposes.
inferred_outlives_of: Storage<'tcx>
Returns the inferred outlives predicates (e.g., for struct Foo<'a, T> { x: &'a T }
, this would return T: 'a
).
explicit_super_predicates_of: Storage<'tcx>
Maps from the DefId
of a trait to the list of super-predicates of the trait,
before elaboration (so it doesn’t contain transitive super-predicates). This
is a subset of the full list of predicates. We store these in a separate map
because we must evaluate them even during type conversion, often before the full
predicates are available (note that super-predicates must not be cyclic).
explicit_implied_predicates_of: Storage<'tcx>
The predicates of the trait that are implied during elaboration. This is a superset of the super-predicates of the trait, but a subset of the predicates of the trait. For regular traits, this includes all super-predicates and their associated type bounds. For trait aliases, currently, this includes all of the predicates of the trait alias.
explicit_supertraits_containing_assoc_item: Storage<'tcx>
The Ident is the name of an associated type.The query returns only the subset
of supertraits that define the given associated type. This is used to avoid
cycles in resolving type-dependent associated item paths like T::Item
.
type_param_predicates: Storage<'tcx>
To avoid cycles within the predicates of a single item we compute
per-type-parameter predicates for resolving T::AssocTy
.
trait_def: Storage<'tcx>
[query description - consider adding a doc-comment!] computing trait definition for tcx.def_path_str(key)
adt_def: Storage<'tcx>
[query description - consider adding a doc-comment!] computing ADT definition for tcx.def_path_str(key)
adt_destructor: Storage<'tcx>
[query description - consider adding a doc-comment!] computing Drop
impl for tcx.def_path_str(key)
adt_async_destructor: Storage<'tcx>
[query description - consider adding a doc-comment!] computing AsyncDrop
impl for tcx.def_path_str(key)
adt_sized_constraint: Storage<'tcx>
[query description - consider adding a doc-comment!] computing the Sized
constraint for tcx.def_path_str(key)
adt_dtorck_constraint: Storage<'tcx>
[query description - consider adding a doc-comment!] computing drop-check constraints for tcx.def_path_str(key)
constness: Storage<'tcx>
Returns true
if this is a const fn, use the is_const_fn
to know whether your crate
actually sees it as const fn (e.g., the const-fn-ness might be unstable and you might
not have the feature gate active).
Do not call this function manually. It is only meant to cache the base data for the
is_const_fn
function. Consider using is_const_fn
or is_const_fn_raw
instead.
asyncness: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the function is async: tcx.def_path_str(key)
is_promotable_const_fn: Storage<'tcx>
Returns true
if calls to the function may be promoted.
This is either because the function is e.g., a tuple-struct or tuple-variant
constructor, or because it has the #[rustc_promotable]
attribute. The attribute should
be removed in the future in favour of some form of check which figures out whether the
function does not inspect the bits of any of its arguments (so is essentially just a
constructor function).
coroutine_by_move_body_def_id: Storage<'tcx>
The body of the coroutine, modified to take its upvars by move rather than by ref.
This is used by coroutine-closures, which must return a different flavor of coroutine
when called using AsyncFnOnce::call_once
. It is produced by the ByMoveBody
pass which
is run right after building the initial MIR, and will only be populated for coroutines
which come out of the async closure desugaring.
coroutine_kind: Storage<'tcx>
Returns Some(coroutine_kind)
if the node pointed to by def_id
is a coroutine.
coroutine_for_closure: Storage<'tcx>
[query description - consider adding a doc-comment!] Given a coroutine-closure def id, return the def id of the coroutine returned by it
crate_variances: Storage<'tcx>
Gets a map with the variance of every item; use variances_of
instead.
variances_of: Storage<'tcx>
Maps from the DefId
of a type or region parameter to its (inferred) variance.
inferred_outlives_crate: Storage<'tcx>
Maps from thee DefId
of a type to its (inferred) outlives.
associated_item_def_ids: Storage<'tcx>
Maps from an impl/trait or struct/variant DefId
to a list of the DefId
s of its associated items or fields.
associated_item: Storage<'tcx>
Maps from a trait/impl item to the trait/impl item “descriptor”.
associated_items: Storage<'tcx>
Collects the associated items defined on a trait or impl.
impl_item_implementor_ids: Storage<'tcx>
Maps from associated items on a trait to the corresponding associated
item on the impl specified by impl_id
.
For example, with the following code
struct Type {}
// DefId
trait Trait { // trait_id
fn f(); // trait_f
fn g() {} // trait_g
}
impl Trait for Type { // impl_id
fn f() {} // impl_f
fn g() {} // impl_g
}
The map returned for tcx.impl_item_implementor_ids(impl_id)
would be
{ trait_f: impl_f, trait_g: impl_g }
associated_types_for_impl_traits_in_associated_fn: Storage<'tcx>
Given fn_def_id
of a trait or of an impl that implements a given trait:
if fn_def_id
is the def id of a function defined inside a trait, then it creates and returns
the associated items that correspond to each impl trait in return position for that trait.
if fn_def_id
is the def id of a function defined inside an impl that implements a trait, then it
creates and returns the associated items that correspond to each impl trait in return position
of the implemented trait.
associated_type_for_effects: Storage<'tcx>
[query description - consider adding a doc-comment!] creating associated items for effects in tcx.def_path_str(def_id)
associated_type_for_impl_trait_in_trait: Storage<'tcx>
Given an impl trait in trait opaque_ty_def_id
, create and return the corresponding
associated item.
impl_trait_header: Storage<'tcx>
Given an impl_id
, return the trait it implements along with some header information.
Return None
if this is an inherent impl.
self_ty_of_trait_impl_enabling_order_dep_trait_object_hack: Storage<'tcx>
[query description - consider adding a doc-comment!] computing self type wrt issue #33140 tcx.def_path_str(key)
inherent_impls: Storage<'tcx>
Maps a DefId
of a type to a list of its inherent impls.
Contains implementations of methods that are inherent to a type.
Methods in these implementations don’t need to be exported.
incoherent_impls: Storage<'tcx>
[query description - consider adding a doc-comment!] collecting all inherent impls for {:?}
check_unsafety: Storage<'tcx>
Unsafety-check this LocalDefId
.
assumed_wf_types: Storage<'tcx>
Returns the types assumed to be well formed while “inside” of the given item.
Note that we’ve liberated the late bound regions of function signatures, so this can not be used to check whether these types are well formed.
assumed_wf_types_for_rpitit: Storage<'tcx>
We need to store the assumed_wf_types for an RPITIT so that impls of foreign traits with return-position impl trait in traits can inherit the right wf types.
fn_sig: Storage<'tcx>
Computes the signature of the function.
lint_mod: Storage<'tcx>
Performs lint checking for the module.
check_unused_traits: Storage<'tcx>
[query description - consider adding a doc-comment!] checking unused trait imports in crate
check_mod_attrs: Storage<'tcx>
Checks the attributes in the module.
check_mod_unstable_api_usage: Storage<'tcx>
Checks for uses of unstable APIs in the module.
check_mod_const_bodies: Storage<'tcx>
Checks the const bodies in the module for illegal operations (e.g. if
or loop
).
check_mod_loops: Storage<'tcx>
Checks the loops in the module.
check_mod_naked_functions: Storage<'tcx>
[query description - consider adding a doc-comment!] checking naked functions in describe_as_module(key, tcx)
check_mod_privacy: Storage<'tcx>
[query description - consider adding a doc-comment!] checking privacy in describe_as_module(key.to_local_def_id(), tcx)
check_liveness: Storage<'tcx>
[query description - consider adding a doc-comment!] checking liveness of variables in tcx.def_path_str(key)
live_symbols_and_ignored_derived_traits: Storage<'tcx>
Return the live symbols in the crate for dead code check.
The second return value maps from ADTs to ignored derived traits (e.g. Debug and Clone) and their respective impl (i.e., part of the derive macro)
check_mod_deathness: Storage<'tcx>
[query description - consider adding a doc-comment!] checking deathness of variables in describe_as_module(key, tcx)
check_mod_type_wf: Storage<'tcx>
[query description - consider adding a doc-comment!] checking that types are well-formed in describe_as_module(key, tcx)
coerce_unsized_info: Storage<'tcx>
Caches CoerceUnsized
kinds for impls on custom types.
typeck: Storage<'tcx>
[query description - consider adding a doc-comment!] type-checking tcx.def_path_str(key)
diagnostic_only_typeck: Storage<'tcx>
[query description - consider adding a doc-comment!] type-checking tcx.def_path_str(key)
used_trait_imports: Storage<'tcx>
[query description - consider adding a doc-comment!] finding used_trait_imports tcx.def_path_str(key)
coherent_trait: Storage<'tcx>
[query description - consider adding a doc-comment!] coherence checking all impls of trait tcx.def_path_str(def_id)
mir_borrowck: Storage<'tcx>
Borrow-checks the function body. If this is a closure, returns additional requirements that the closure’s creator must verify.
crate_inherent_impls: Storage<'tcx>
Gets a complete map from all types to their inherent impls. Not meant to be used directly outside of coherence.
crate_inherent_impls_validity_check: Storage<'tcx>
Checks all types in the crate for overlap in their inherent impls. Reports errors. Not meant to be used directly outside of coherence.
crate_inherent_impls_overlap_check: Storage<'tcx>
Checks all types in the crate for overlap in their inherent impls. Reports errors. Not meant to be used directly outside of coherence.
orphan_check_impl: Storage<'tcx>
Checks whether all impls in the crate pass the overlap check, returning which impls fail it. If all impls are correct, the returned slice is empty.
mir_callgraph_reachable: Storage<'tcx>
Check whether the function has any recursion that could cause the inliner to trigger a cycle. Returns the call stack causing the cycle. The call stack does not contain the current function, just all intermediate functions.
mir_inliner_callees: Storage<'tcx>
Obtain all the calls into other local functions
tag_for_variant: Storage<'tcx>
Computes the tag (if any) for a given type and variant.
eval_to_allocation_raw: Storage<'tcx>
Evaluates a constant and returns the computed allocation.
Do not use this directly, use the eval_to_const_value
or eval_to_valtree
instead.
eval_static_initializer: Storage<'tcx>
Evaluate a static’s initializer, returning the allocation of the initializer’s memory.
eval_to_const_value_raw: Storage<'tcx>
Evaluates const items or anonymous constants (such as enum variant explicit discriminants or array lengths) into a representation suitable for the type system and const generics.
Do not use this directly, use one of the following wrappers: tcx.const_eval_poly
,
tcx.const_eval_resolve
, tcx.const_eval_instance
, or tcx.const_eval_global_id
.
eval_to_valtree: Storage<'tcx>
Evaluate a constant and convert it to a type level constant or
return None
if that is not possible.
valtree_to_const_val: Storage<'tcx>
Converts a type level constant value into ConstValue
destructure_const: Storage<'tcx>
Destructures array, ADT or tuple constants into the constants of their fields.
lit_to_const: Storage<'tcx>
[query description - consider adding a doc-comment!] converting literal to const
check_match: Storage<'tcx>
[query description - consider adding a doc-comment!] match-checking tcx.def_path_str(key)
effective_visibilities: Storage<'tcx>
Performs part of the privacy check and computes effective visibilities.
check_private_in_public: Storage<'tcx>
[query description - consider adding a doc-comment!] checking for private elements in public interfaces
reachable_set: Storage<'tcx>
[query description - consider adding a doc-comment!] reachability
region_scope_tree: Storage<'tcx>
Per-body region::ScopeTree
. The DefId
should be the owner DefId
for the body;
in the case of closures, this will be redirected to the enclosing function.
mir_shims: Storage<'tcx>
Generates a MIR body for the shim.
symbol_name: Storage<'tcx>
The symbol_name
query provides the symbol name for calling a
given instance from the local crate. In particular, it will also
look up the correct symbol name of instances from upstream crates.
def_kind: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up definition kind of tcx.def_path_str(def_id)
def_span: Storage<'tcx>
Gets the span for the definition.
def_ident_span: Storage<'tcx>
Gets the span for the identifier of the definition.
lookup_stability: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up stability of tcx.def_path_str(def_id)
lookup_const_stability: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up const stability of tcx.def_path_str(def_id)
lookup_default_body_stability: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up default body stability of tcx.def_path_str(def_id)
should_inherit_track_caller: Storage<'tcx>
[query description - consider adding a doc-comment!] computing should_inherit_track_caller of tcx.def_path_str(def_id)
lookup_deprecation_entry: Storage<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
is deprecated
Determines whether an item is annotated with doc(hidden)
.
is_doc_notable_trait: Storage<'tcx>
Determines whether an item is annotated with doc(notable_trait)
.
item_attrs: Storage<'tcx>
Returns the attributes on the item at def_id
.
Do not use this directly, use tcx.get_attrs
instead.
codegen_fn_attrs: Storage<'tcx>
[query description - consider adding a doc-comment!] computing codegen attributes of tcx.def_path_str(def_id)
asm_target_features: Storage<'tcx>
[query description - consider adding a doc-comment!] computing target features for inline asm of tcx.def_path_str(def_id)
fn_arg_names: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up function parameter names for tcx.def_path_str(def_id)
rendered_const: Storage<'tcx>
Gets the rendered value of the specified constant or associated constant. Used by rustdoc.
rendered_precise_capturing_args: Storage<'tcx>
Gets the rendered precise capturing args for an opaque for use in rustdoc.
impl_parent: Storage<'tcx>
[query description - consider adding a doc-comment!] computing specialization parent impl of tcx.def_path_str(def_id)
is_ctfe_mir_available: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if item has CTFE MIR available: tcx.def_path_str(key)
is_mir_available: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if item has MIR available: tcx.def_path_str(key)
own_existential_vtable_entries: Storage<'tcx>
[query description - consider adding a doc-comment!] finding all existential vtable entries for trait tcx.def_path_str(key)
vtable_entries: Storage<'tcx>
[query description - consider adding a doc-comment!] finding all vtable entries for trait tcx.def_path_str(key.def_id())
first_method_vtable_slot: Storage<'tcx>
[query description - consider adding a doc-comment!] finding the slot within the vtable of key.self_ty()
for the implementation of key.print_only_trait_name()
supertrait_vtable_slot: Storage<'tcx>
[query description - consider adding a doc-comment!] finding the slot within vtable for trait object key.1
vtable ptr during trait upcasting coercion from key.0
vtable
vtable_allocation: Storage<'tcx>
[query description - consider adding a doc-comment!] vtable const allocation for < key.0
as key.1.map(| trait_ref | format! ("{trait_ref}")).unwrap_or("_".to_owned())
>
codegen_select_candidate: Storage<'tcx>
[query description - consider adding a doc-comment!] computing candidate for key.1
all_local_trait_impls: Storage<'tcx>
Return all impl
blocks in the current crate.
trait_impls_of: Storage<'tcx>
Given a trait trait_id
, return all known impl
blocks.
specialization_graph_of: Storage<'tcx>
[query description - consider adding a doc-comment!] building specialization graph of trait tcx.def_path_str(trait_id)
dyn_compatibility_violations: Storage<'tcx>
[query description - consider adding a doc-comment!] determining dyn-compatibility of trait tcx.def_path_str(trait_id)
is_dyn_compatible: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if trait tcx.def_path_str(trait_id)
is dyn-compatible
param_env: Storage<'tcx>
Gets the ParameterEnvironment for a given item; this environment
will be in “user-facing” mode, meaning that it is suitable for
type-checking etc, and it does not normalize specializable
associated types. This is almost always what you want,
unless you are doing MIR optimizations, in which case you
might want to use reveal_all()
method to change modes.
param_env_reveal_all_normalized: Storage<'tcx>
Like param_env
, but returns the ParamEnv
in Reveal::All
mode.
Prefer this over tcx.param_env(def_id).with_reveal_all_normalized(tcx)
,
as this method is more efficient.
is_copy_raw: Storage<'tcx>
Trait selection queries. These are best used by invoking ty.is_copy_modulo_regions()
,
ty.is_copy()
, etc, since that will prune the environment where possible.
is_sized_raw: Storage<'tcx>
Query backing Ty::is_sized
.
is_freeze_raw: Storage<'tcx>
Query backing Ty::is_freeze
.
is_unpin_raw: Storage<'tcx>
Query backing Ty::is_unpin
.
needs_drop_raw: Storage<'tcx>
Query backing Ty::needs_drop
.
needs_async_drop_raw: Storage<'tcx>
Query backing Ty::needs_async_drop
.
has_significant_drop_raw: Storage<'tcx>
Query backing Ty::has_significant_drop_raw
.
has_structural_eq_impl: Storage<'tcx>
Query backing Ty::is_structural_eq_shallow
.
This is only correct for ADTs. Call is_structural_eq_shallow
to handle all types
correctly.
adt_drop_tys: Storage<'tcx>
A list of types where the ADT requires drop if and only if any of
those types require drop. If the ADT is known to always need drop
then Err(AlwaysRequiresDrop)
is returned.
adt_significant_drop_tys: Storage<'tcx>
A list of types where the ADT requires drop if and only if any of those types
has significant drop. A type marked with the attribute rustc_insignificant_dtor
is considered to not be significant. A drop is significant if it is implemented
by the user or does anything that will have any observable behavior (other than
freeing up memory). If the ADT is known to have a significant destructor then
Err(AlwaysRequiresDrop)
is returned.
layout_of: Storage<'tcx>
Computes the layout of a type. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.
fn_abi_of_fn_ptr: Storage<'tcx>
Compute a FnAbi
suitable for indirect calls, i.e. to fn
pointers.
NB: this doesn’t handle virtual calls - those should use fn_abi_of_instance
instead, where the instance is an InstanceKind::Virtual
.
fn_abi_of_instance: Storage<'tcx>
Compute a FnAbi
suitable for declaring/defining an fn
instance, and for
direct calls to an fn
.
NB: that includes virtual calls, which are represented by “direct calls”
to an InstanceKind::Virtual
instance (of <dyn Trait as Trait>::fn
).
dylib_dependency_formats: Storage<'tcx>
[query description - consider adding a doc-comment!] getting dylib dependency formats of crate
dependency_formats: Storage<'tcx>
[query description - consider adding a doc-comment!] getting the linkage format of all dependencies
is_compiler_builtins: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the crate is_compiler_builtins
has_global_allocator: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the crate has_global_allocator
has_alloc_error_handler: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the crate has_alloc_error_handler
has_panic_handler: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if the crate has_panic_handler
is_profiler_runtime: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if a crate is #![profiler_runtime]
has_ffi_unwind_calls: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if tcx.def_path_str(key)
contains FFI-unwind calls
required_panic_strategy: Storage<'tcx>
[query description - consider adding a doc-comment!] getting a crate’s required panic strategy
panic_in_drop_strategy: Storage<'tcx>
[query description - consider adding a doc-comment!] getting a crate’s configured panic-in-drop strategy
is_no_builtins: Storage<'tcx>
[query description - consider adding a doc-comment!] getting whether a crate has #![no_builtins]
symbol_mangling_version: Storage<'tcx>
[query description - consider adding a doc-comment!] getting a crate’s symbol mangling version
extern_crate: Storage<'tcx>
[query description - consider adding a doc-comment!] getting crate’s ExternCrateData
specialization_enabled_in: Storage<'tcx>
[query description - consider adding a doc-comment!] checking whether the crate enabled specialization
/min_specialization
specializes: Storage<'tcx>
[query description - consider adding a doc-comment!] computing whether impls specialize one another
in_scope_traits_map: Storage<'tcx>
[query description - consider adding a doc-comment!] getting traits in scope at a block
defaultness: Storage<'tcx>
Returns whether the impl or associated function has the default
keyword.
check_well_formed: Storage<'tcx>
[query description - consider adding a doc-comment!] checking that tcx.def_path_str(key)
is well-formed
reachable_non_generics: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up the exported symbols of a crate
is_reachable_non_generic: Storage<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
is an exported symbol
is_unreachable_local_definition: Storage<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
is reachable from outside the crate
upstream_monomorphizations: Storage<'tcx>
The entire set of monomorphizations the local crate can safely
link to because they are exported from upstream crates. Do
not depend on this directly, as its value changes anytime
a monomorphization gets added or removed in any upstream
crate. Instead use the narrower upstream_monomorphizations_for
,
upstream_drop_glue_for
, upstream_async_drop_glue_for
, or,
even better, Instance::upstream_monomorphization()
.
upstream_monomorphizations_for: Storage<'tcx>
Returns the set of upstream monomorphizations available for the
generic function identified by the given def_id
. The query makes
sure to make a stable selection if the same monomorphization is
available in multiple upstream crates.
You likely want to call Instance::upstream_monomorphization()
instead of invoking this query directly.
upstream_drop_glue_for: Storage<'tcx>
Returns the upstream crate that exports drop-glue for the given
type (args
is expected to be a single-item list containing the
type one wants drop-glue for).
This is a subset of upstream_monomorphizations_for
in order to
increase dep-tracking granularity. Otherwise adding or removing any
type with drop-glue in any upstream crate would invalidate all
functions calling drop-glue of an upstream type.
You likely want to call Instance::upstream_monomorphization()
instead of invoking this query directly.
NOTE: This query could easily be extended to also support other
common functions that have are large set of monomorphizations
(like Clone::clone
for example).
upstream_async_drop_glue_for: Storage<'tcx>
Returns the upstream crate that exports async-drop-glue for
the given type (args
is expected to be a single-item list
containing the type one wants async-drop-glue for).
This is a subset of upstream_monomorphizations_for
in order
to increase dep-tracking granularity. Otherwise adding or
removing any type with async-drop-glue in any upstream crate
would invalidate all functions calling async-drop-glue of an
upstream type.
You likely want to call Instance::upstream_monomorphization()
instead of invoking this query directly.
NOTE: This query could easily be extended to also support other
common functions that have are large set of monomorphizations
(like Clone::clone
for example).
foreign_modules: Storage<'tcx>
Returns a list of all extern
blocks of a crate.
clashing_extern_declarations: Storage<'tcx>
Lint against extern fn
declarations having incompatible types.
entry_fn: Storage<'tcx>
Identifies the entry-point (e.g., the main
function) for a given
crate, returning None
if there is no entry point (such as for library crates).
proc_macro_decls_static: Storage<'tcx>
Finds the rustc_proc_macro_decls
item of a crate.
crate_hash: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up the hash a crate
crate_host_hash: Storage<'tcx>
Gets the hash for the host proc macro. Used to support -Z dual-proc-macro.
extra_filename: Storage<'tcx>
Gets the extra data to put in each output filename for a crate.
For example, compiling the foo
crate with extra-filename=-a
creates a libfoo-b.rlib
file.
crate_extern_paths: Storage<'tcx>
Gets the paths where the crate came from in the file system.
implementations_of_trait: Storage<'tcx>
Given a crate and a trait, look up all impls of that trait in the crate.
Return (impl_id, self_ty)
.
crate_incoherent_impls: Storage<'tcx>
Collects all incoherent impls for the given crate and type.
Do not call this directly, but instead use the incoherent_impls
query.
This query is only used to get the data necessary for that query.
native_library: Storage<'tcx>
Get the corresponding native library from the native_libraries
query
inherit_sig_for_delegation_item: Storage<'tcx>
[query description - consider adding a doc-comment!] inheriting delegation signature
resolve_bound_vars: Storage<'tcx>
Does lifetime resolution on items. Importantly, we can’t resolve
lifetimes directly on things like trait methods, because of trait params.
See rustc_resolve::late::lifetimes
for details.
named_variable_map: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up a named region inside tcx.def_path_str(owner_id)
is_late_bound_map: Storage<'tcx>
[query description - consider adding a doc-comment!] testing if a region is late bound inside tcx.def_path_str(owner_id)
object_lifetime_default: Storage<'tcx>
For a given item’s generic parameter, gets the default lifetimes to be used
for each parameter if a trait object were to be passed for that parameter.
For example, for T
in struct Foo<'a, T>
, this would be 'static
.
For T
in struct Foo<'a, T: 'a>
, this would instead be 'a
.
This query will panic if passed something that is not a type parameter.
late_bound_vars_map: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up late bound vars inside tcx.def_path_str(owner_id)
visibility: Storage<'tcx>
Computes the visibility of the provided def_id
.
If the item from the def_id
doesn’t have a visibility, it will panic. For example
a generic type parameter will panic if you call this method on it:
use std::fmt::Debug;
pub trait Foo<T: Debug> {}
In here, if you call visibility
on T
, it’ll panic.
inhabited_predicate_adt: Storage<'tcx>
[query description - consider adding a doc-comment!] computing the uninhabited predicate of {:?}
inhabited_predicate_type: Storage<'tcx>
Do not call this query directly: invoke Ty::inhabited_predicate
instead.
dep_kind: Storage<'tcx>
[query description - consider adding a doc-comment!] fetching what a dependency looks like
crate_name: Storage<'tcx>
Gets the name of the crate.
module_children: Storage<'tcx>
[query description - consider adding a doc-comment!] collecting child items of module tcx.def_path_str(def_id)
extern_mod_stmt_cnum: Storage<'tcx>
[query description - consider adding a doc-comment!] computing crate imported by tcx.def_path_str(def_id)
lib_features: Storage<'tcx>
[query description - consider adding a doc-comment!] calculating the lib features defined in a crate
stability_implications: Storage<'tcx>
[query description - consider adding a doc-comment!] calculating the implications between #[unstable]
features defined in a crate
intrinsic_raw: Storage<'tcx>
Whether the function is an intrinsic
get_lang_items: Storage<'tcx>
Returns the lang items defined in another crate by loading it from metadata.
all_diagnostic_items: Storage<'tcx>
Returns all diagnostic items defined in all crates.
defined_lang_items: Storage<'tcx>
Returns the lang items defined in another crate by loading it from metadata.
diagnostic_items: Storage<'tcx>
Returns the diagnostic items defined in a crate.
missing_lang_items: Storage<'tcx>
[query description - consider adding a doc-comment!] calculating the missing lang items in a crate
visible_parent_map: Storage<'tcx>
The visible parent map is a map from every item to a visible parent. It prefers the shortest visible path to an item. Used for diagnostics, for example path trimming. The parents are modules, enums or traits.
trimmed_def_paths: Storage<'tcx>
Collects the “trimmed”, shortest accessible paths to all items for diagnostics. See the provider docs for more info.
missing_extern_crate_item: Storage<'tcx>
[query description - consider adding a doc-comment!] seeing if we’re missing an extern crate
item for this crate
used_crate_source: Storage<'tcx>
[query description - consider adding a doc-comment!] looking at the source for a crate
debugger_visualizers: Storage<'tcx>
Returns the debugger visualizers defined for this crate.
NOTE: This query has to be marked eval_always
because it reads data
directly from disk that is not tracked anywhere else. I.e. it
represents a genuine input to the query system.
postorder_cnums: Storage<'tcx>
[query description - consider adding a doc-comment!] generating a postorder list of CrateNums
is_private_dep: Storage<'tcx>
Returns whether or not the crate with CrateNum ‘cnum’ is marked as a private dependency
allocator_kind: Storage<'tcx>
[query description - consider adding a doc-comment!] getting the allocator kind for the current crate
alloc_error_handler_kind: Storage<'tcx>
[query description - consider adding a doc-comment!] alloc error handler kind for the current crate
upvars_mentioned: Storage<'tcx>
[query description - consider adding a doc-comment!] collecting upvars mentioned in tcx.def_path_str(def_id)
maybe_unused_trait_imports: Storage<'tcx>
[query description - consider adding a doc-comment!] fetching potentially unused trait imports
names_imported_by_glob_use: Storage<'tcx>
[query description - consider adding a doc-comment!] finding names imported by glob use for tcx.def_path_str(def_id)
stability_index: Storage<'tcx>
[query description - consider adding a doc-comment!] calculating the stability index for the local crate
crates: Storage<'tcx>
[query description - consider adding a doc-comment!] fetching all foreign CrateNum instances
used_crates: Storage<'tcx>
[query description - consider adding a doc-comment!] fetching CrateNum
s for all crates loaded non-speculatively
traits: Storage<'tcx>
A list of all traits in a crate, used by rustdoc and error reporting.
trait_impls_in_crate: Storage<'tcx>
[query description - consider adding a doc-comment!] fetching all trait impls in a crate
exported_symbols: Storage<'tcx>
The list of symbols exported from the given crate.
- All names contained in
exported_symbols(cnum)
are guaranteed to correspond to a publicly visible symbol incnum
machine code. - The
exported_symbols
sets of different crates do not intersect.
collect_and_partition_mono_items: Storage<'tcx>
[query description - consider adding a doc-comment!] collect_and_partition_mono_items
is_codegened_item: Storage<'tcx>
[query description - consider adding a doc-comment!] determining whether tcx.def_path_str(def_id)
needs codegen
codegen_unit: Storage<'tcx>
[query description - consider adding a doc-comment!] getting codegen unit {sym}
unused_generic_params: Storage<'tcx>
[query description - consider adding a doc-comment!] determining which generic parameters are unused by tcx.def_path_str(key.def_id())
backend_optimization_level: Storage<'tcx>
[query description - consider adding a doc-comment!] optimization level used by backend
output_filenames: Storage<'tcx>
Return the filenames where output artefacts shall be stored.
This query returns an &Arc
because codegen backends need the value even after the TyCtxt
has been destroyed.
normalize_canonicalized_projection_ty: Storage<'tcx>
Do not call this query directly: Invoke normalize
instead.
normalize_canonicalized_weak_ty: Storage<'tcx>
Do not call this query directly: Invoke normalize
instead.
normalize_canonicalized_inherent_projection_ty: Storage<'tcx>
Do not call this query directly: Invoke normalize
instead.
try_normalize_generic_arg_after_erasing_regions: Storage<'tcx>
Do not call this query directly: invoke try_normalize_erasing_regions
instead.
implied_outlives_bounds_compat: Storage<'tcx>
[query description - consider adding a doc-comment!] computing implied outlives bounds for goal.value.value
implied_outlives_bounds: Storage<'tcx>
[query description - consider adding a doc-comment!] computing implied outlives bounds v2 for goal.value.value
dropck_outlives: Storage<'tcx>
Do not call this query directly:
invoke DropckOutlives::new(dropped_ty)).fully_perform(typeck.infcx)
instead.
evaluate_obligation: Storage<'tcx>
Do not call this query directly: invoke infcx.predicate_may_hold()
or
infcx.predicate_must_hold()
instead.
type_op_ascribe_user_type: Storage<'tcx>
Do not call this query directly: part of the Eq
type-op
type_op_prove_predicate: Storage<'tcx>
Do not call this query directly: part of the ProvePredicate
type-op
type_op_normalize_ty: Storage<'tcx>
Do not call this query directly: part of the Normalize
type-op
type_op_normalize_clause: Storage<'tcx>
Do not call this query directly: part of the Normalize
type-op
type_op_normalize_poly_fn_sig: Storage<'tcx>
Do not call this query directly: part of the Normalize
type-op
type_op_normalize_fn_sig: Storage<'tcx>
Do not call this query directly: part of the Normalize
type-op
instantiate_and_check_impossible_predicates: Storage<'tcx>
[query description - consider adding a doc-comment!] checking impossible instantiated predicates: tcx.def_path_str(key.0)
is_impossible_associated_item: Storage<'tcx>
[query description - consider adding a doc-comment!] checking if tcx.def_path_str(key.1)
is impossible to reference within tcx.def_path_str(key.0)
method_autoderef_steps: Storage<'tcx>
[query description - consider adding a doc-comment!] computing autoderef types for goal.value.value
supported_target_features: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up supported target features
implied_target_features: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up implied target features
features_query: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up enabled feature gates
crate_for_resolver: Storage<'tcx>
[query description - consider adding a doc-comment!] the ast before macro expansion and name resolution
resolve_instance_raw: Storage<'tcx>
Attempt to resolve the given DefId
to an Instance
, for the
given generics args (GenericArgsRef
), returning one of:
Ok(Some(instance))
on successOk(None)
when theGenericArgsRef
are still too generic, and therefore don’t allow finding the finalInstance
Err(ErrorGuaranteed)
when theInstance
resolution process couldn’t complete due to errors elsewhere - this is distinct fromOk(None)
to avoid misleading diagnostics when an error has already been/will be emitted, for the original cause.
reveal_opaque_types_in_bounds: Storage<'tcx>
[query description - consider adding a doc-comment!] revealing opaque types in {:?}
limits: Storage<'tcx>
[query description - consider adding a doc-comment!] looking up limits
diagnostic_hir_wf_check: Storage<'tcx>
Performs an HIR-based well-formed check on the item with the given HirId
. If
we get an Unimplemented
error that matches the provided Predicate
, return
the cause of the newly created obligation.
This is only used by error-reporting code to get a better cause (in particular, a better
span) for an existing error. Therefore, it is best-effort, and may never handle
all of the cases that the normal ty::Ty
-based wfcheck does. This is fine,
because the ty::Ty
-based wfcheck is always run.
global_backend_features: Storage<'tcx>
The list of backend features computed from CLI flags (-Ctarget-cpu
, -Ctarget-feature
,
--target
and similar).
check_validity_requirement: Storage<'tcx>
[query description - consider adding a doc-comment!] checking validity requirement for key.1.value
: key.0
compare_impl_const: Storage<'tcx>
[query description - consider adding a doc-comment!] checking assoc const tcx.def_path_str(key.0)
has the same type as trait item
deduced_param_attrs: Storage<'tcx>
[query description - consider adding a doc-comment!] deducing parameter attributes for tcx.def_path_str(def_id)
doc_link_resolutions: Storage<'tcx>
[query description - consider adding a doc-comment!] resolutions for documentation links for a module
doc_link_traits_in_scope: Storage<'tcx>
[query description - consider adding a doc-comment!] traits in scope for documentation links for a module
stripped_cfg_items: Storage<'tcx>
Get all item paths that were stripped by a #[cfg]
in a particular crate.
Should not be called for the local crate before the resolver outputs are created, as it
is only fed there.
generics_require_sized_self: Storage<'tcx>
[query description - consider adding a doc-comment!] check whether the item has a where Self: Sized
bound
cross_crate_inlinable: Storage<'tcx>
[query description - consider adding a doc-comment!] whether the item should be made inlinable across crates
Trait Implementations§
source§impl<'tcx> Default for QueryCaches<'tcx>
impl<'tcx> Default for QueryCaches<'tcx>
source§fn default() -> QueryCaches<'tcx>
fn default() -> QueryCaches<'tcx>
Auto Trait Implementations§
impl<'tcx> !Freeze for QueryCaches<'tcx>
impl<'tcx> !RefUnwindSafe for QueryCaches<'tcx>
impl<'tcx> !Send for QueryCaches<'tcx>
impl<'tcx> !Sync for QueryCaches<'tcx>
impl<'tcx> Unpin for QueryCaches<'tcx>
impl<'tcx> !UnwindSafe for QueryCaches<'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 15600 bytes