Expand description
Re-exports§
use std::ops::ControlFlow;🔒use rustc_attr_ir::lang_items::LangItem;🔒use rustc_errors::FatalError;🔒use rustc_hir as hir;🔒use rustc_hir::def_id::DefId;🔒use rustc_middle::query::Providers;🔒use rustc_middle::ty;🔒use rustc_middle::ty::EarlyBinder;🔒use rustc_middle::ty::GenericArgs;🔒use rustc_middle::ty::Ty;🔒use rustc_middle::ty::TyCtxt;🔒use rustc_middle::ty::TypeFoldable;🔒use rustc_middle::ty::TypeFolder;🔒use rustc_middle::ty::TypeSuperFoldable;🔒use rustc_middle::ty::TypeSuperVisitable;🔒use rustc_middle::ty::TypeVisitable;🔒use rustc_middle::ty::TypeVisitableExt;🔒use rustc_middle::ty::TypeVisitor;🔒use rustc_middle::ty::TypingMode;🔒use rustc_middle::ty::Unnormalized;🔒use rustc_middle::ty::Upcast;🔒use rustc_middle::ty::elaborate;🔒use rustc_span::DUMMY_SP;🔒use rustc_span::Span;🔒use rustc_span::kw;🔒use rustc_span::sym;🔒use smallvec::SmallVec;🔒use tracing::debug;🔒use tracing::instrument;🔒use tracing::instrument;🔒use super::elaborate;🔒use crate::infer::TyCtxtInferExt;🔒use crate::traits::query::evaluate_obligation::InferCtxtExt;🔒use crate::traits::AssocConstViolation;🔒use crate::traits::MethodViolation;🔒use crate::traits::Obligation;🔒use crate::traits::ObligationCause;🔒use crate::traits::normalize_param_env_or_error;🔒use crate::traits::util;🔒
Structs§
Enums§
Functions§
- bounds_
reference_ 🔒self - clauses_
reference_ 🔒self - contains_
illegal_ 🔒impl_ trait_ in_ trait - contains_
illegal_ 🔒self_ type_ reference - Check if the given value contains illegal
Selfreferences. - dyn_
compatibility_ 🔒violations - dyn_
compatibility_ violations_ for_ assoc_ item - dyn_
compatibility_ 🔒violations_ for_ trait - generics_
require_ 🔒sized_ self - get_
sized_ 🔒bounds - hir_
ty_ lowering_ dyn_ compatibility_ violations - Returns the dyn-compatibility violations that affect HIR ty lowering.
- is_
dyn_ 🔒compatible - is_
vtable_ safe_ method - We say a method is vtable safe if it can be invoked on a trait
object. Note that dyn-compatible traits can have some
non-vtable-safe methods, so long as they require
Self: Sizedor otherwise ensure that they cannot be used whenSelf = Trait. - predicate_
references_ 🔒self - provide 🔒
- receiver_
for_ 🔒self_ ty - Performs a type instantiation to produce the version of
receiver_tywhenSelf = self_ty. For example, forreceiver_ty = Rc<Self>andself_ty = Foo, returnsRc<Foo>. - receiver_
is_ 🔒dispatchable - Checks the method’s receiver (the
selfargument) can be dispatched on whenSelfis a trait object. We require thatDispatchableFromDynbe implemented for the receiver type in the following way: - sized_
trait_ 🔒bound_ spans - super_
clauses_ 🔒are_ unconditionally_ const - Checks for
const Traitsupertraits. We’re okay with[const] Trait, supertraits since for a non-const instantiation of that trait, the conditionally-const supertrait is also not required to be const. - super_
clauses_ 🔒have_ non_ lifetime_ binders - trait_
has_ 🔒sized_ self - virtual_
call_ 🔒violations_ for_ method - Returns
Some(_)if this method cannot be called on a trait object; this does not necessarily imply that the enclosing trait is dyn-incompatible, because the method might have a where clauseSelf: Sized.