Struct rustc_middle::ty::query::TyCtxtAt [−][src]
Fields
tcx: TyCtxt<'tcx>
span: Span
Implementations
pub fn trigger_delay_span_bug(
self,
key: impl IntoQueryParam<DefId>
) -> trigger_delay_span_bug<'tcx>
pub fn trigger_delay_span_bug(
self,
key: impl IntoQueryParam<DefId>
) -> trigger_delay_span_bug<'tcx>
[query description - consider adding a doc-comment!] trigger a delay span bug
[query description - consider adding a doc-comment!] get the resolver outputs
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.
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()
.
The items in a module.
This can be conveniently accessed by tcx.hir().visit_item_likes_in_module
.
Avoid calling this query directly.
Gives access to the HIR node for the HIR owner key
.
This can be conveniently accessed by methods on tcx.hir()
.
Avoid calling this query directly.
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.
Gives access to the HIR nodes and bodies inside the HIR owner key
.
This can be conveniently accessed by methods on tcx.hir()
.
Avoid calling this query directly.
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.
Computes the DefId
of the corresponding const parameter in case the key
is a
const argument and returns None
otherwise.
let a = foo::<7>();
// ^ Calling `opt_const_param_of` for this argument,
fn foo<const N: usize>()
// ^ returns this `DefId`.
fn bar() {
// ^ While calling `opt_const_param_of` for other bodies returns `None`.
}
pub fn const_param_default(
self,
key: impl IntoQueryParam<DefId>
) -> const_param_default<'tcx>
pub fn const_param_default(
self,
key: impl IntoQueryParam<DefId>
) -> const_param_default<'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
.
pub fn default_anon_const_substs(
self,
key: impl IntoQueryParam<DefId>
) -> default_anon_const_substs<'tcx>
pub fn default_anon_const_substs(
self,
key: impl IntoQueryParam<DefId>
) -> default_anon_const_substs<'tcx>
[query description - consider adding a doc-comment!] computing the default generic arguments for tcx.def_path_str(key)
Records the type of every item.
[query description - consider adding a doc-comment!] running analysis passes on this crate
Maps from the DefId
of an item (trait/struct/enum/fn) to its
associated generics.
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.
predicates_of
builds on predicates_defined_on
– in fact,
it is almost always the same as that query, except for the
case of traits. For traits, predicates_of
contains
an additional Self: Trait<...>
predicate that users don’t
actually write. This reflects the fact that to invoke the
trait (e.g., via Default::default
) you must supply types
that actually implement the trait. (However, this extra
predicate gets in the way of some checks, which are intended
to operate over only the actual where-clauses written by the
user.)
pub fn explicit_item_bounds(
self,
key: impl IntoQueryParam<DefId>
) -> explicit_item_bounds<'tcx>
pub fn explicit_item_bounds(
self,
key: impl IntoQueryParam<DefId>
) -> explicit_item_bounds<'tcx>
Returns the list of bounds that can be used for
SelectionCandidate::ProjectionCandidate(_)
and
ProjectionTyCandidate::TraitDef
.
Specifically this is the bounds written on the trait’s type
definition, or those after the impl
keyword
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.
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.
[query description - consider adding a doc-comment!] looking up the native libraries of a linked crate
[query description - consider adding a doc-comment!] computing the lint levels for items in this crate
[query description - consider adding a doc-comment!] parent module of tcx.def_path_str(key.to_def_id())
[query description - consider adding a doc-comment!] expansion that defined tcx.def_path_str(key)
[query description - consider adding a doc-comment!] checking if the crate is_panic_runtime
Fetch the THIR for a given body. If typeck for that body failed, returns an empty Thir
.
Create a THIR tree for debugging.
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.
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
.
pub fn mir_const_qualif_const_arg(
self,
key: (LocalDefId, DefId)
) -> mir_const_qualif_const_arg<'tcx>
pub fn mir_const_qualif_const_arg(
self,
key: (LocalDefId, DefId)
) -> mir_const_qualif_const_arg<'tcx>
[query description - consider adding a doc-comment!] const checking the const argument tcx.def_path_str(key.0.to_def_id())
Fetch the MIR for a given DefId
right after it’s built - this includes
unreachable code.
Fetch the MIR for a given DefId
up till the point where it is
ready for const qualification.
See the README for the mir
module for details.
pub fn thir_abstract_const(
self,
key: impl IntoQueryParam<DefId>
) -> thir_abstract_const<'tcx>
pub fn thir_abstract_const(
self,
key: impl IntoQueryParam<DefId>
) -> thir_abstract_const<'tcx>
Try to build an abstract representation of the given constant.
pub fn thir_abstract_const_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> thir_abstract_const_of_const_arg<'tcx>
pub fn thir_abstract_const_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> thir_abstract_const_of_const_arg<'tcx>
Try to build an abstract representation of the given constant.
pub fn try_unify_abstract_consts(
self,
key: (Unevaluated<'tcx, ()>, Unevaluated<'tcx, ()>)
) -> try_unify_abstract_consts<'tcx>
pub fn try_unify_abstract_consts(
self,
key: (Unevaluated<'tcx, ()>, Unevaluated<'tcx, ()>)
) -> try_unify_abstract_consts<'tcx>
[query description - consider adding a doc-comment!] trying to unify the generic constants tcx.def_path_str(key.0.def.did)
and tcx.def_path_str(key.1.def.did)
pub fn mir_drops_elaborated_and_const_checked(
self,
key: WithOptConstParam<LocalDefId>
) -> mir_drops_elaborated_and_const_checked<'tcx>
pub fn mir_drops_elaborated_and_const_checked(
self,
key: WithOptConstParam<LocalDefId>
) -> mir_drops_elaborated_and_const_checked<'tcx>
[query description - consider adding a doc-comment!] elaborating drops for tcx.def_path_str(key.did.to_def_id())
[query description - consider adding a doc-comment!] caching mir of tcx.def_path_str(key)
for CTFE
pub fn mir_for_ctfe_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> mir_for_ctfe_of_const_arg<'tcx>
pub fn mir_for_ctfe_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> mir_for_ctfe_of_const_arg<'tcx>
[query description - consider adding a doc-comment!] MIR for CTFE of the const argument tcx.def_path_str(key.0.to_def_id())
[query description - consider adding a doc-comment!] processing if key.const_param_did.is_some() { "the const argument " } else { "" }
tcx.def_path_str(key.did.to_def_id())
pub fn symbols_for_closure_captures(
self,
key: (LocalDefId, DefId)
) -> symbols_for_closure_captures<'tcx>
pub fn symbols_for_closure_captures(
self,
key: (LocalDefId, DefId)
) -> symbols_for_closure_captures<'tcx>
[query description - consider adding a doc-comment!] symbols for captures of closure tcx.def_path_str(key.1)
in tcx.def_path_str(key.0.to_def_id())
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.
Returns coverage summary info for a function, after executing the InstrumentCoverage
MIR pass (assuming the -Zinstrument-coverage option is enabled).
Returns the name of the file that contains the function body, if instrumented for coverage.
pub fn covered_code_regions(
self,
key: impl IntoQueryParam<DefId>
) -> covered_code_regions<'tcx>
pub fn covered_code_regions(
self,
key: impl IntoQueryParam<DefId>
) -> covered_code_regions<'tcx>
Returns the CodeRegions
for a function that has instrumented coverage, in case the
function was optimized out before codegen, and before being added to the Coverage Map.
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.
pub fn promoted_mir_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> promoted_mir_of_const_arg<'tcx>
pub fn promoted_mir_of_const_arg(
self,
key: (LocalDefId, DefId)
) -> promoted_mir_of_const_arg<'tcx>
[query description - consider adding a doc-comment!] optimizing promoted MIR for the const argument tcx.def_path_str(key.0.to_def_id())
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.
[query description - consider adding a doc-comment!] wasm import module map
pub fn predicates_defined_on(
self,
key: impl IntoQueryParam<DefId>
) -> predicates_defined_on<'tcx>
pub fn predicates_defined_on(
self,
key: impl IntoQueryParam<DefId>
) -> predicates_defined_on<'tcx>
Maps from the DefId
of an item (trait/struct/enum/fn) to the
predicates (where-clauses) directly defined on it. This is
equal to the explicit_predicates_of
predicates plus the
inferred_outlives_of
predicates.
pub fn trait_explicit_predicates_and_bounds(
self,
key: LocalDefId
) -> trait_explicit_predicates_and_bounds<'tcx>
pub fn trait_explicit_predicates_and_bounds(
self,
key: LocalDefId
) -> trait_explicit_predicates_and_bounds<'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.
pub fn explicit_predicates_of(
self,
key: impl IntoQueryParam<DefId>
) -> explicit_predicates_of<'tcx>
pub fn explicit_predicates_of(
self,
key: impl IntoQueryParam<DefId>
) -> explicit_predicates_of<'tcx>
Returns the predicates written explicitly by the user.
pub fn inferred_outlives_of(
self,
key: impl IntoQueryParam<DefId>
) -> inferred_outlives_of<'tcx>
pub fn inferred_outlives_of(
self,
key: impl IntoQueryParam<DefId>
) -> inferred_outlives_of<'tcx>
Returns the inferred outlives predicates (e.g., for struct Foo<'a, T> { x: &'a T }
, this would return T: 'a
).
pub fn super_predicates_of(
self,
key: impl IntoQueryParam<DefId>
) -> super_predicates_of<'tcx>
pub fn super_predicates_of(
self,
key: impl IntoQueryParam<DefId>
) -> super_predicates_of<'tcx>
Maps from the DefId
of a trait to the list of
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 supertraits have
additional acyclicity requirements).
pub fn super_predicates_that_define_assoc_type(
self,
key: (DefId, Option<Ident>)
) -> super_predicates_that_define_assoc_type<'tcx>
pub fn super_predicates_that_define_assoc_type(
self,
key: (DefId, Option<Ident>)
) -> super_predicates_that_define_assoc_type<'tcx>
The Option<Ident>
is the name of an associated type. If it is None
, then this query
returns the full set of predicates. If Some<Ident>
, then the query returns only the
subset of super-predicates that reference traits that define the given associated type.
This is used to avoid cycles in resolving types like T::Item
.
pub fn type_param_predicates(
self,
key: (DefId, LocalDefId, Ident)
) -> type_param_predicates<'tcx>
pub fn type_param_predicates(
self,
key: (DefId, LocalDefId, Ident)
) -> type_param_predicates<'tcx>
To avoid cycles within the predicates of a single item we compute
per-type-parameter predicates for resolving T::AssocTy
.
[query description - consider adding a doc-comment!] computing trait definition for tcx.def_path_str(key)
[query description - consider adding a doc-comment!] computing ADT definition for tcx.def_path_str(key)
[query description - consider adding a doc-comment!] computing Drop
impl for tcx.def_path_str(key)
pub fn adt_sized_constraint(
self,
key: impl IntoQueryParam<DefId>
) -> adt_sized_constraint<'tcx>
pub fn adt_sized_constraint(
self,
key: impl IntoQueryParam<DefId>
) -> adt_sized_constraint<'tcx>
[query description - consider adding a doc-comment!] computing Sized
constraints for tcx.def_path_str(key)
pub fn adt_dtorck_constraint(
self,
key: impl IntoQueryParam<DefId>
) -> adt_dtorck_constraint<'tcx>
pub fn adt_dtorck_constraint(
self,
key: impl IntoQueryParam<DefId>
) -> adt_dtorck_constraint<'tcx>
[query description - consider adding a doc-comment!] computing drop-check constraints for tcx.def_path_str(key)
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.
[query description - consider adding a doc-comment!] checking if the function is async: tcx.def_path_str(key)
pub fn is_promotable_const_fn(
self,
key: impl IntoQueryParam<DefId>
) -> is_promotable_const_fn<'tcx>
pub fn is_promotable_const_fn(
self,
key: impl IntoQueryParam<DefId>
) -> is_promotable_const_fn<'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).
Returns true
if this is a foreign item (i.e., linked via extern { ... }
).
Returns Some(mutability)
if the node pointed to by def_id
is a static item.
Returns Some(generator_kind)
if the node pointed to by def_id
is a generator.
Gets a map with the variance of every item; use item_variance
instead.
Maps from the DefId
of a type or region parameter to its (inferred) variance.
Maps from thee DefId
of a type to its (inferred) outlives.
pub fn associated_item_def_ids(
self,
key: impl IntoQueryParam<DefId>
) -> associated_item_def_ids<'tcx>
pub fn associated_item_def_ids(
self,
key: impl IntoQueryParam<DefId>
) -> associated_item_def_ids<'tcx>
Maps from an impl/trait DefId
to a list of the DefId
s of its items.
Maps from a trait item to the trait item “descriptor”.
Collects the associated items defined on a trait or impl.
Given an impl_id
, return the trait it implements.
Return None
if this is an inherent impl.
[query description - consider adding a doc-comment!] computing implementation polarity of tcx.def_path_str(impl_id)
[query description - consider adding a doc-comment!] computing Self type wrt issue #33140 tcx.def_path_str(key)
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.
The result of unsafety-checking this LocalDefId
.
pub fn unsafety_check_result_for_const_arg(
self,
key: (LocalDefId, DefId)
) -> unsafety_check_result_for_const_arg<'tcx>
pub fn unsafety_check_result_for_const_arg(
self,
key: (LocalDefId, DefId)
) -> unsafety_check_result_for_const_arg<'tcx>
[query description - consider adding a doc-comment!] unsafety-checking the const argument tcx.def_path_str(key.0.to_def_id())
Unsafety-check this LocalDefId
with THIR unsafeck. This should be
used with -Zthir-unsafeck
.
pub fn thir_check_unsafety_for_const_arg(
self,
key: (LocalDefId, DefId)
) -> thir_check_unsafety_for_const_arg<'tcx>
pub fn thir_check_unsafety_for_const_arg(
self,
key: (LocalDefId, DefId)
) -> thir_check_unsafety_for_const_arg<'tcx>
[query description - consider adding a doc-comment!] unsafety-checking the const argument tcx.def_path_str(key.0.to_def_id())
pub fn unsafe_derive_on_repr_packed(
self,
key: LocalDefId
) -> unsafe_derive_on_repr_packed<'tcx>
pub fn unsafe_derive_on_repr_packed(
self,
key: LocalDefId
) -> unsafe_derive_on_repr_packed<'tcx>
HACK: when evaluated, this reports an “unsafe derive on repr(packed)” error.
Unsafety checking is executed for each method separately, but we only want to emit this error once per derive. As there are some impls with multiple methods, we use a query for deduplication.
The signature of functions.
[query description - consider adding a doc-comment!] linting describe_as_module(key, tcx)
Checks the attributes in the module.
pub fn check_mod_unstable_api_usage(
self,
key: LocalDefId
) -> check_mod_unstable_api_usage<'tcx>
pub fn check_mod_unstable_api_usage(
self,
key: LocalDefId
) -> check_mod_unstable_api_usage<'tcx>
[query description - consider adding a doc-comment!] checking for unstable API usage in describe_as_module(key, tcx)
Checks the const bodies in the module for illegal operations (e.g. if
or loop
).
Checks the loops in the module.
[query description - consider adding a doc-comment!] checking naked functions in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] checking item types in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] checking privacy in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] checking intrinsics in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] checking liveness of variables in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] checking that impls are well-formed in describe_as_module(key, tcx)
[query description - consider adding a doc-comment!] collecting item types in describe_as_module(key, tcx)
pub fn coerce_unsized_info(
self,
key: impl IntoQueryParam<DefId>
) -> coerce_unsized_info<'tcx>
pub fn coerce_unsized_info(
self,
key: impl IntoQueryParam<DefId>
) -> coerce_unsized_info<'tcx>
Caches CoerceUnsized
kinds for impls on custom types.
[query description - consider adding a doc-comment!] type-checking all item bodies
[query description - consider adding a doc-comment!] type-checking tcx.def_path_str(key.to_def_id())
[query description - consider adding a doc-comment!] type-checking the const argument tcx.def_path_str(key.0.to_def_id())
[query description - consider adding a doc-comment!] type-checking tcx.def_path_str(key.to_def_id())
[query description - consider adding a doc-comment!] used_trait_imports tcx.def_path_str(key.to_def_id())
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
has a body
[query description - consider adding a doc-comment!] coherence checking all impls of trait tcx.def_path_str(def_id)
Borrow-checks the function body. If this is a closure, returns additional requirements that the closure’s creator must verify.
[query description - consider adding a doc-comment!] borrow-checking the const argument tcx.def_path_str(key.0.to_def_id())
Gets a complete map from all types to their inherent impls. Not meant to be used directly outside of coherence.
pub fn crate_inherent_impls_overlap_check(
self,
key: ()
) -> crate_inherent_impls_overlap_check<'tcx>
pub fn crate_inherent_impls_overlap_check(
self,
key: ()
) -> crate_inherent_impls_overlap_check<'tcx>
Checks all types in the crate for overlap in their inherent impls. Reports errors. Not meant to be used directly outside of coherence.
pub fn mir_callgraph_reachable(
self,
key: (Instance<'tcx>, LocalDefId)
) -> mir_callgraph_reachable<'tcx>
pub fn mir_callgraph_reachable(
self,
key: (Instance<'tcx>, LocalDefId)
) -> mir_callgraph_reachable<'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.
Obtain all the calls into other local functions
pub fn eval_to_allocation_raw(
self,
key: ParamEnvAnd<'tcx, GlobalId<'tcx>>
) -> eval_to_allocation_raw<'tcx>
pub fn eval_to_allocation_raw(
self,
key: ParamEnvAnd<'tcx, GlobalId<'tcx>>
) -> eval_to_allocation_raw<'tcx>
Evaluates a constant and returns the computed allocation.
Do not use this directly, use the tcx.eval_static_initializer
wrapper.
pub fn eval_to_const_value_raw(
self,
key: ParamEnvAnd<'tcx, GlobalId<'tcx>>
) -> eval_to_const_value_raw<'tcx>
pub fn eval_to_const_value_raw(
self,
key: ParamEnvAnd<'tcx, GlobalId<'tcx>>
) -> eval_to_const_value_raw<'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
.
pub fn const_to_valtree(
self,
key: ParamEnvAnd<'tcx, ConstAlloc<'tcx>>
) -> const_to_valtree<'tcx>
pub fn const_to_valtree(
self,
key: ParamEnvAnd<'tcx, ConstAlloc<'tcx>>
) -> const_to_valtree<'tcx>
Convert an evaluated constant to a type level constant or
return None
if that is not possible.
pub fn destructure_const(
self,
key: ParamEnvAnd<'tcx, &'tcx Const<'tcx>>
) -> destructure_const<'tcx>
pub fn destructure_const(
self,
key: ParamEnvAnd<'tcx, &'tcx Const<'tcx>>
) -> destructure_const<'tcx>
Destructure a constant ADT or array into its variant index and its field values.
Dereference a constant reference or raw pointer and turn the result into a constant again.
[query description - consider adding a doc-comment!] get a &core::panic::Location referring to a span
[query description - consider adding a doc-comment!] converting literal to const
[query description - consider adding a doc-comment!] match-checking tcx.def_path_str(key)
Performs part of the privacy check and computes “access levels”.
[query description - consider adding a doc-comment!] checking for private elements in public interfaces
[query description - consider adding a doc-comment!] reachability
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.
[query description - consider adding a doc-comment!] generating MIR shim for tcx.def_path_str(key.def_id())
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.
[query description - consider adding a doc-comment!] looking up definition kind of tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] looking up span for tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] looking up span for tcx.def_path_str(def_id)
’s identifier
[query description - consider adding a doc-comment!] looking up stability of tcx.def_path_str(def_id)
pub fn lookup_const_stability(
self,
key: impl IntoQueryParam<DefId>
) -> lookup_const_stability<'tcx>
pub fn lookup_const_stability(
self,
key: impl IntoQueryParam<DefId>
) -> lookup_const_stability<'tcx>
[query description - consider adding a doc-comment!] looking up const stability of tcx.def_path_str(def_id)
pub fn should_inherit_track_caller(
self,
key: impl IntoQueryParam<DefId>
) -> should_inherit_track_caller<'tcx>
pub fn should_inherit_track_caller(
self,
key: impl IntoQueryParam<DefId>
) -> should_inherit_track_caller<'tcx>
[query description - consider adding a doc-comment!] computing should_inherit_track_caller of tcx.def_path_str(def_id)
pub fn lookup_deprecation_entry(
self,
key: impl IntoQueryParam<DefId>
) -> lookup_deprecation_entry<'tcx>
pub fn lookup_deprecation_entry(
self,
key: impl IntoQueryParam<DefId>
) -> lookup_deprecation_entry<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
is deprecated
[query description - consider adding a doc-comment!] collecting attributes of tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] computing codegen attributes of tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] looking up function parameter names for tcx.def_path_str(def_id)
Gets the rendered value of the specified constant or associated constant. Used by rustdoc.
[query description - consider adding a doc-comment!] computing specialization parent impl of tcx.def_path_str(def_id)
Given an associated_item
, find the trait it belongs to.
Return None
if the DefId
is not an associated item.
pub fn is_ctfe_mir_available(
self,
key: impl IntoQueryParam<DefId>
) -> is_ctfe_mir_available<'tcx>
pub fn is_ctfe_mir_available(
self,
key: impl IntoQueryParam<DefId>
) -> is_ctfe_mir_available<'tcx>
[query description - consider adding a doc-comment!] checking if item has ctfe mir available: tcx.def_path_str(key)
[query description - consider adding a doc-comment!] checking if item has mir available: tcx.def_path_str(key)
pub fn own_existential_vtable_entries(
self,
key: PolyExistentialTraitRef<'tcx>
) -> own_existential_vtable_entries<'tcx>
pub fn own_existential_vtable_entries(
self,
key: PolyExistentialTraitRef<'tcx>
) -> own_existential_vtable_entries<'tcx>
[query description - consider adding a doc-comment!] finding all existential vtable entries for trait tcx.def_path_str(key.def_id())
[query description - consider adding a doc-comment!] finding all vtable entries for trait tcx.def_path_str(key.def_id())
pub fn vtable_trait_upcasting_coercion_new_vptr_slot(
self,
key: (Ty<'tcx>, Ty<'tcx>)
) -> vtable_trait_upcasting_coercion_new_vptr_slot<'tcx>
pub fn vtable_trait_upcasting_coercion_new_vptr_slot(
self,
key: (Ty<'tcx>, Ty<'tcx>)
) -> vtable_trait_upcasting_coercion_new_vptr_slot<'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
pub fn vtable_allocation(
self,
key: (Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>)
) -> vtable_allocation<'tcx>
pub fn vtable_allocation(
self,
key: (Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>)
) -> vtable_allocation<'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())
>
pub fn codegen_fulfill_obligation(
self,
key: (ParamEnv<'tcx>, PolyTraitRef<'tcx>)
) -> codegen_fulfill_obligation<'tcx>
pub fn codegen_fulfill_obligation(
self,
key: (ParamEnv<'tcx>, PolyTraitRef<'tcx>)
) -> codegen_fulfill_obligation<'tcx>
[query description - consider adding a doc-comment!] checking if tcx.def_path_str(key.1.def_id())
fulfills its obligations
Return all impl
blocks in the current crate.
To allow caching this between crates, you must pass in LOCAL_CRATE
as the crate number.
Passing in any other crate will cause an ICE.
Given a trait trait_id
, return all known impl
blocks.
pub fn specialization_graph_of(
self,
key: impl IntoQueryParam<DefId>
) -> specialization_graph_of<'tcx>
pub fn specialization_graph_of(
self,
key: impl IntoQueryParam<DefId>
) -> specialization_graph_of<'tcx>
[query description - consider adding a doc-comment!] building specialization graph of trait tcx.def_path_str(trait_id)
pub fn object_safety_violations(
self,
key: impl IntoQueryParam<DefId>
) -> object_safety_violations<'tcx>
pub fn object_safety_violations(
self,
key: impl IntoQueryParam<DefId>
) -> object_safety_violations<'tcx>
[query description - consider adding a doc-comment!] determine object safety of trait tcx.def_path_str(trait_id)
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.
pub fn param_env_reveal_all_normalized(
self,
key: impl IntoQueryParam<DefId>
) -> param_env_reveal_all_normalized<'tcx>
pub fn param_env_reveal_all_normalized(
self,
key: impl IntoQueryParam<DefId>
) -> param_env_reveal_all_normalized<'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.
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.
Query backing TyS::is_sized
.
Query backing TyS::is_freeze
.
Query backing TyS::is_unpin
.
Query backing TyS::needs_drop
.
pub fn has_significant_drop_raw(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> has_significant_drop_raw<'tcx>
pub fn has_significant_drop_raw(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> has_significant_drop_raw<'tcx>
Query backing TyS::has_significant_drop_raw
.
Query backing TyS::is_structural_eq_shallow
.
This is only correct for ADTs. Call is_structural_eq_shallow
to handle all types
correctly.
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.
pub fn adt_significant_drop_tys(
self,
key: impl IntoQueryParam<DefId>
) -> adt_significant_drop_tys<'tcx>
pub fn adt_significant_drop_tys(
self,
key: impl IntoQueryParam<DefId>
) -> adt_significant_drop_tys<'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.
Computes the layout of a type. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.
pub fn fn_abi_of_fn_ptr(
self,
key: ParamEnvAnd<'tcx, (PolyFnSig<'tcx>, &'tcx List<Ty<'tcx>>)>
) -> fn_abi_of_fn_ptr<'tcx>
pub fn fn_abi_of_fn_ptr(
self,
key: ParamEnvAnd<'tcx, (PolyFnSig<'tcx>, &'tcx List<Ty<'tcx>>)>
) -> fn_abi_of_fn_ptr<'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 InstanceDef::Virtual
.
pub fn fn_abi_of_instance(
self,
key: ParamEnvAnd<'tcx, (Instance<'tcx>, &'tcx List<Ty<'tcx>>)>
) -> fn_abi_of_instance<'tcx>
pub fn fn_abi_of_instance(
self,
key: ParamEnvAnd<'tcx, (Instance<'tcx>, &'tcx List<Ty<'tcx>>)>
) -> fn_abi_of_instance<'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 InstanceDef::Virtual
instance (of <dyn Trait as Trait>::fn
).
[query description - consider adding a doc-comment!] dylib dependency formats of crate
[query description - consider adding a doc-comment!] get the linkage format of all dependencies
[query description - consider adding a doc-comment!] checking if the crate is_compiler_builtins
[query description - consider adding a doc-comment!] checking if the crate has_global_allocator
[query description - consider adding a doc-comment!] checking if the crate has_panic_handler
[query description - consider adding a doc-comment!] query a crate is #![profiler_runtime]
[query description - consider adding a doc-comment!] query a crate’s configured panic strategy
[query description - consider adding a doc-comment!] query a crate’s configured panic-in-drop strategy
[query description - consider adding a doc-comment!] test whether a crate has #![no_builtins]
[query description - consider adding a doc-comment!] query a crate’s symbol mangling version
[query description - consider adding a doc-comment!] getting crate’s ExternCrateData
[query description - consider adding a doc-comment!] computing whether impls specialize one another
[query description - consider adding a doc-comment!] traits in scope at a block
[query description - consider adding a doc-comment!] looking up items exported by tcx.def_path_str(def_id.to_def_id())
[query description - consider adding a doc-comment!] looking up whether tcx.def_path_str(def_id)
is a default impl
[query description - consider adding a doc-comment!] looking up whether tcx.def_path_str(def_id)
is a const impl
[query description - consider adding a doc-comment!] checking that tcx.def_path_str(key.to_def_id())
is well-formed
pub fn check_trait_item_well_formed(
self,
key: LocalDefId
) -> check_trait_item_well_formed<'tcx>
pub fn check_trait_item_well_formed(
self,
key: LocalDefId
) -> check_trait_item_well_formed<'tcx>
[query description - consider adding a doc-comment!] checking that tcx.def_path_str(key.to_def_id())
is well-formed
pub fn check_impl_item_well_formed(
self,
key: LocalDefId
) -> check_impl_item_well_formed<'tcx>
pub fn check_impl_item_well_formed(
self,
key: LocalDefId
) -> check_impl_item_well_formed<'tcx>
[query description - consider adding a doc-comment!] checking that tcx.def_path_str(key.to_def_id())
is well-formed
[query description - consider adding a doc-comment!] looking up the exported symbols of a crate
pub fn is_reachable_non_generic(
self,
key: impl IntoQueryParam<DefId>
) -> is_reachable_non_generic<'tcx>
pub fn is_reachable_non_generic(
self,
key: impl IntoQueryParam<DefId>
) -> is_reachable_non_generic<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id)
is an exported symbol
pub fn is_unreachable_local_definition(
self,
key: LocalDefId
) -> is_unreachable_local_definition<'tcx>
pub fn is_unreachable_local_definition(
self,
key: LocalDefId
) -> is_unreachable_local_definition<'tcx>
[query description - consider adding a doc-comment!] checking whether tcx.def_path_str(def_id.to_def_id())
is reachable from outside the crate
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
, or, even
better, Instance::upstream_monomorphization()
.
pub fn upstream_monomorphizations_for(
self,
key: impl IntoQueryParam<DefId>
) -> upstream_monomorphizations_for<'tcx>
pub fn upstream_monomorphizations_for(
self,
key: impl IntoQueryParam<DefId>
) -> upstream_monomorphizations_for<'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.
Returns the upstream crate that exports drop-glue for the given
type (substs
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).
[query description - consider adding a doc-comment!] looking up the foreign modules of a linked crate
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).
[query description - consider adding a doc-comment!] looking up the derive registrar for a crate
[query description - consider adding a doc-comment!] looking up the hash a crate
[query description - consider adding a doc-comment!] looking up the hash of a host version of a crate
[query description - consider adding a doc-comment!] looking up the extra filename for a crate
[query description - consider adding a doc-comment!] looking up the paths for extern crates
pub fn implementations_of_trait(
self,
key: (CrateNum, DefId)
) -> implementations_of_trait<'tcx>
pub fn implementations_of_trait(
self,
key: (CrateNum, DefId)
) -> implementations_of_trait<'tcx>
Given a crate and a trait, look up all impls of that trait in the crate.
Return (impl_id, self_ty)
.
Given a crate, look up all trait impls in that crate.
Return (impl_id, self_ty)
.
pub fn is_dllimport_foreign_item(
self,
key: impl IntoQueryParam<DefId>
) -> is_dllimport_foreign_item<'tcx>
pub fn is_dllimport_foreign_item(
self,
key: impl IntoQueryParam<DefId>
) -> is_dllimport_foreign_item<'tcx>
[query description - consider adding a doc-comment!] is_dllimport_foreign_item( tcx.def_path_str(def_id)
)
pub fn is_statically_included_foreign_item(
self,
key: impl IntoQueryParam<DefId>
) -> is_statically_included_foreign_item<'tcx>
pub fn is_statically_included_foreign_item(
self,
key: impl IntoQueryParam<DefId>
) -> is_statically_included_foreign_item<'tcx>
[query description - consider adding a doc-comment!] is_statically_included_foreign_item( tcx.def_path_str(def_id)
)
pub fn native_library_kind(
self,
key: impl IntoQueryParam<DefId>
) -> native_library_kind<'tcx>
pub fn native_library_kind(
self,
key: impl IntoQueryParam<DefId>
) -> native_library_kind<'tcx>
[query description - consider adding a doc-comment!] native_library_kind( tcx.def_path_str(def_id)
)
pub fn resolve_lifetimes_trait_definition(
self,
key: LocalDefId
) -> resolve_lifetimes_trait_definition<'tcx>
pub fn resolve_lifetimes_trait_definition(
self,
key: LocalDefId
) -> resolve_lifetimes_trait_definition<'tcx>
Does lifetime resolution, but does not descend into trait items. This
should only be used for resolving lifetimes of on trait definitions,
and is used to avoid cycles. Importantly, resolve_lifetimes
still visits
the same lifetimes and is responsible for diagnostics.
See `rustc_resolve::late::lifetimes for details.
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.
[query description - consider adding a doc-comment!] looking up a named region
[query description - consider adding a doc-comment!] testing if a region is late bound
pub fn object_lifetime_defaults_map(
self,
key: LocalDefId
) -> object_lifetime_defaults_map<'tcx>
pub fn object_lifetime_defaults_map(
self,
key: LocalDefId
) -> object_lifetime_defaults_map<'tcx>
For a given item (like a struct), gets the default lifetimes to be used
for each parameter if a trait object were to be passed for that parameter.
For example, for struct Foo<'a, T, U>
, this would be ['static, 'static]
.
For struct Foo<'a, T: 'a, U>
, this would instead be ['a, 'static]
.
[query description - consider adding a doc-comment!] looking up late bound vars
[query description - consider adding a doc-comment!] finds the lifetime scope for an HirId of a PathSegment
[query description - consider adding a doc-comment!] computing visibility of tcx.def_path_str(def_id)
pub fn type_uninhabited_from(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> type_uninhabited_from<'tcx>
pub fn type_uninhabited_from(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> type_uninhabited_from<'tcx>
Computes the set of modules from which this type is visibly uninhabited. To check whether a type is uninhabited at all (not just from a given module), you could check whether the forest is empty.
[query description - consider adding a doc-comment!] fetching what a dependency looks like
[query description - consider adding a doc-comment!] fetching what a crate is named
[query description - consider adding a doc-comment!] collecting child items of tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] computing crate imported by tcx.def_path_str(def_id.to_def_id())
[query description - consider adding a doc-comment!] calculating the lib features map
[query description - consider adding a doc-comment!] calculating the lib features defined in a crate
Returns the lang items defined in another crate by loading it from metadata.
Returns all diagnostic items defined in all crates.
Returns the lang items defined in another crate by loading it from metadata.
Returns the diagnostic items defined in a crate.
[query description - consider adding a doc-comment!] calculating the missing lang items in a crate
[query description - consider adding a doc-comment!] calculating the visible parent map
[query description - consider adding a doc-comment!] calculating trimmed def paths
[query description - consider adding a doc-comment!] seeing if we’re missing an extern crate
item for this crate
[query description - consider adding a doc-comment!] looking at the source for a crate
[query description - consider adding a doc-comment!] generating a postorder list of CrateNums
Returns whether or not the crate with CrateNum ‘cnum’ is marked as a private dependency
[query description - consider adding a doc-comment!] allocator kind for the current crate
[query description - consider adding a doc-comment!] collecting upvars mentioned in tcx.def_path_str(def_id)
[query description - consider adding a doc-comment!] maybe_unused_trait_import for tcx.def_path_str(def_id.to_def_id())
[query description - consider adding a doc-comment!] looking up all possibly unused extern crates
[query description - consider adding a doc-comment!] names_imported_by_glob_use for tcx.def_path_str(def_id.to_def_id())
[query description - consider adding a doc-comment!] calculating the stability index for the local crate
[query description - consider adding a doc-comment!] fetching all foreign CrateNum instances
A vector of every trait accessible in the whole crate (i.e., including those from subcrates). This is used only for error reporting.
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.
pub fn collect_and_partition_mono_items(
self,
key: ()
) -> collect_and_partition_mono_items<'tcx>
pub fn collect_and_partition_mono_items(
self,
key: ()
) -> collect_and_partition_mono_items<'tcx>
[query description - consider adding a doc-comment!] collect_and_partition_mono_items
[query description - consider adding a doc-comment!] determining whether tcx.def_path_str(def_id)
needs codegen
All items participating in code generation together with items inlined into them.
[query description - consider adding a doc-comment!] codegen_unit
[query description - consider adding a doc-comment!] determining which generic parameters are unused by tcx.def_path_str(key.def_id())
[query description - consider adding a doc-comment!] optimization level used by backend
[query description - consider adding a doc-comment!] output_filenames
pub fn normalize_projection_ty(
self,
key: CanonicalProjectionGoal<'tcx>
) -> normalize_projection_ty<'tcx>
pub fn normalize_projection_ty(
self,
key: CanonicalProjectionGoal<'tcx>
) -> normalize_projection_ty<'tcx>
Do not call this query directly: invoke normalize
instead.
pub fn normalize_generic_arg_after_erasing_regions(
self,
key: ParamEnvAnd<'tcx, GenericArg<'tcx>>
) -> normalize_generic_arg_after_erasing_regions<'tcx>
pub fn normalize_generic_arg_after_erasing_regions(
self,
key: ParamEnvAnd<'tcx, GenericArg<'tcx>>
) -> normalize_generic_arg_after_erasing_regions<'tcx>
Do not call this query directly: invoke normalize_erasing_regions
instead.
pub fn normalize_mir_const_after_erasing_regions(
self,
key: ParamEnvAnd<'tcx, ConstantKind<'tcx>>
) -> normalize_mir_const_after_erasing_regions<'tcx>
pub fn normalize_mir_const_after_erasing_regions(
self,
key: ParamEnvAnd<'tcx, ConstantKind<'tcx>>
) -> normalize_mir_const_after_erasing_regions<'tcx>
Do not call this query directly: invoke normalize_erasing_regions
instead.
pub fn implied_outlives_bounds(
self,
key: CanonicalTyGoal<'tcx>
) -> implied_outlives_bounds<'tcx>
pub fn implied_outlives_bounds(
self,
key: CanonicalTyGoal<'tcx>
) -> implied_outlives_bounds<'tcx>
[query description - consider adding a doc-comment!] computing implied outlives bounds for {:?}
Do not call this query directly: invoke infcx.at().dropck_outlives()
instead.
pub fn evaluate_obligation(
self,
key: CanonicalPredicateGoal<'tcx>
) -> evaluate_obligation<'tcx>
pub fn evaluate_obligation(
self,
key: CanonicalPredicateGoal<'tcx>
) -> evaluate_obligation<'tcx>
Do not call this query directly: invoke infcx.predicate_may_hold()
or
infcx.predicate_must_hold()
instead.
pub fn evaluate_goal(
self,
key: CanonicalChalkEnvironmentAndGoal<'tcx>
) -> evaluate_goal<'tcx>
pub fn evaluate_goal(
self,
key: CanonicalChalkEnvironmentAndGoal<'tcx>
) -> evaluate_goal<'tcx>
[query description - consider adding a doc-comment!] evaluating trait selection obligation goal.value
pub fn type_op_ascribe_user_type(
self,
key: CanonicalTypeOpAscribeUserTypeGoal<'tcx>
) -> type_op_ascribe_user_type<'tcx>
pub fn type_op_ascribe_user_type(
self,
key: CanonicalTypeOpAscribeUserTypeGoal<'tcx>
) -> type_op_ascribe_user_type<'tcx>
Do not call this query directly: part of the Eq
type-op
Do not call this query directly: part of the Eq
type-op
Do not call this query directly: part of the Subtype
type-op
pub fn type_op_prove_predicate(
self,
key: CanonicalTypeOpProvePredicateGoal<'tcx>
) -> type_op_prove_predicate<'tcx>
pub fn type_op_prove_predicate(
self,
key: CanonicalTypeOpProvePredicateGoal<'tcx>
) -> type_op_prove_predicate<'tcx>
Do not call this query directly: part of the ProvePredicate
type-op
pub fn type_op_normalize_ty(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>
) -> type_op_normalize_ty<'tcx>
pub fn type_op_normalize_ty(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>
) -> type_op_normalize_ty<'tcx>
Do not call this query directly: part of the Normalize
type-op
pub fn type_op_normalize_predicate(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, Predicate<'tcx>>
) -> type_op_normalize_predicate<'tcx>
pub fn type_op_normalize_predicate(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, Predicate<'tcx>>
) -> type_op_normalize_predicate<'tcx>
Do not call this query directly: part of the Normalize
type-op
pub fn type_op_normalize_poly_fn_sig(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, PolyFnSig<'tcx>>
) -> type_op_normalize_poly_fn_sig<'tcx>
pub fn type_op_normalize_poly_fn_sig(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, PolyFnSig<'tcx>>
) -> type_op_normalize_poly_fn_sig<'tcx>
Do not call this query directly: part of the Normalize
type-op
pub fn type_op_normalize_fn_sig(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, FnSig<'tcx>>
) -> type_op_normalize_fn_sig<'tcx>
pub fn type_op_normalize_fn_sig(
self,
key: CanonicalTypeOpNormalizeGoal<'tcx, FnSig<'tcx>>
) -> type_op_normalize_fn_sig<'tcx>
Do not call this query directly: part of the Normalize
type-op
pub fn subst_and_check_impossible_predicates(
self,
key: (DefId, SubstsRef<'tcx>)
) -> subst_and_check_impossible_predicates<'tcx>
pub fn subst_and_check_impossible_predicates(
self,
key: (DefId, SubstsRef<'tcx>)
) -> subst_and_check_impossible_predicates<'tcx>
[query description - consider adding a doc-comment!] impossible substituted predicates: tcx.def_path_str(key.0)
pub fn method_autoderef_steps(
self,
key: CanonicalTyGoal<'tcx>
) -> method_autoderef_steps<'tcx>
pub fn method_autoderef_steps(
self,
key: CanonicalTyGoal<'tcx>
) -> method_autoderef_steps<'tcx>
[query description - consider adding a doc-comment!] computing autoderef types for {:?}
[query description - consider adding a doc-comment!] looking up supported target features
pub fn instance_def_size_estimate(
self,
key: InstanceDef<'tcx>
) -> instance_def_size_estimate<'tcx>
pub fn instance_def_size_estimate(
self,
key: InstanceDef<'tcx>
) -> instance_def_size_estimate<'tcx>
Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning.
[query description - consider adding a doc-comment!] looking up enabled feature gates
pub fn resolve_instance(
self,
key: ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>
) -> resolve_instance<'tcx>
pub fn resolve_instance(
self,
key: ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>
) -> resolve_instance<'tcx>
Attempt to resolve the given DefId
to an Instance
, for the
given generics args (SubstsRef
), returning one of:
Ok(Some(instance))
on successOk(None)
when theSubstsRef
are still too generic, and therefore don’t allow finding the finalInstance
Err(ErrorReported)
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
pub fn resolve_instance_of_const_arg(
self,
key: ParamEnvAnd<'tcx, (LocalDefId, DefId, SubstsRef<'tcx>)>
) -> resolve_instance_of_const_arg<'tcx>
pub fn resolve_instance_of_const_arg(
self,
key: ParamEnvAnd<'tcx, (LocalDefId, DefId, SubstsRef<'tcx>)>
) -> resolve_instance_of_const_arg<'tcx>
[query description - consider adding a doc-comment!] resolving instance of the const argument ty :: Instance :: new(key.value.0.to_def_id(), key.value.2)
pub fn normalize_opaque_types(
self,
key: &'tcx List<Predicate<'tcx>>
) -> normalize_opaque_types<'tcx>
pub fn normalize_opaque_types(
self,
key: &'tcx List<Predicate<'tcx>>
) -> normalize_opaque_types<'tcx>
[query description - consider adding a doc-comment!] normalizing opaque types in {:?}
pub fn conservative_is_privately_uninhabited(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> conservative_is_privately_uninhabited<'tcx>
pub fn conservative_is_privately_uninhabited(
self,
key: ParamEnvAnd<'tcx, Ty<'tcx>>
) -> conservative_is_privately_uninhabited<'tcx>
Checks whether a type is definitely uninhabited. This is
conservative: for some types that are uninhabited we return false
,
but we only return true
for types that are definitely uninhabited.
ty.conservative_is_privately_uninhabited
implies that any value of type ty
will be Abi::Uninhabited
. (Note that uninhabited types may have nonzero
size, to account for partial initialisation. See #49298 for details.)
[query description - consider adding a doc-comment!] looking up limits
pub fn diagnostic_hir_wf_check(
self,
key: (Predicate<'tcx>, WellFormedLoc)
) -> diagnostic_hir_wf_check<'tcx>
pub fn diagnostic_hir_wf_check(
self,
key: (Predicate<'tcx>, WellFormedLoc)
) -> diagnostic_hir_wf_check<'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.
Methods from Deref<Target = TyCtxt<'tcx>>
Trait Implementations
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for TyCtxtAt<'tcx>
impl<'tcx> !UnwindSafe for TyCtxtAt<'tcx>
Blanket Implementations
Mutably borrows from an owned value. Read more
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: 16 bytes