Skip to main content Module compare_impl_item Copy item path Source use core::ops::ControlFlow ; π use std::borrow::Cow ; π use std::cmp::Ordering ; π use std::iter ; π use hir::def_id::DefId ; π use hir::def_id::DefIdMap ; π use hir::def_id::LocalDefId ; π use rustc_data_structures::fx::FxIndexMap ; π use rustc_data_structures::fx::FxIndexSet ; π use rustc_errors::Applicability ; π use rustc_errors::ErrorGuaranteed ; π use rustc_errors::MultiSpan ; π use rustc_errors::pluralize ; π use rustc_errors::struct_span_code_err ; π use rustc_hir::def::DefKind ; π use rustc_hir::def::Res ; π use rustc_hir::intravisit::Visitor ; π use rustc_hir as hir; π use rustc_hir::AmbigArg ; π use rustc_hir::GenericParamKind ; π use rustc_hir::ImplItemKind ; π use rustc_hir::intravisit ; π use rustc_infer::infer ; π use rustc_infer::infer::BoundRegionConversionTime ; π use rustc_infer::infer::InferCtxt ; π use rustc_infer::infer::TyCtxtInferExt ; π use rustc_infer::traits::TraitErrors ; π use rustc_infer::traits::util ; π use rustc_middle::ty::error::ExpectedFound ; π use rustc_middle::ty::error::TypeError ; π use rustc_middle::ty ; π use rustc_middle::ty::BottomUpFolder ; π use rustc_middle::ty::GenericArgs ; π use rustc_middle::ty::GenericParamDefKind ; π use rustc_middle::ty::Generics ; π 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::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_span::BytePos ; π use rustc_span::DUMMY_SP ; π use rustc_span::Span ; π use rustc_span::bug ; π use rustc_span::kw ; π use rustc_span::span_bug ; π use rustc_trait_selection::error_reporting::InferCtxtErrorExt ; π use rustc_trait_selection::infer::InferCtxtExt ; π use rustc_trait_selection::regions::InferCtxtRegionExt ; π use rustc_trait_selection::solve::NextSolverError ; π use rustc_trait_selection::traits ; π use rustc_trait_selection::traits::FromSolverError ; π use rustc_trait_selection::traits::FulfillmentError ; π use rustc_trait_selection::traits::ObligationCause ; π use rustc_trait_selection::traits::ObligationCauseCode ; π use rustc_trait_selection::traits::ObligationCtxt ; π use tracing::debug ; π use tracing::instrument ; π use tracing::instrument ; π use super::potentially_plural_count ; π use crate::diagnostics::LifetimesOrBoundsMismatchOnTrait ; π use crate::diagnostics::MethodShouldReturnFuture ; π use rustc_errors::codes ::*; π refine π CheckNumberOfEarlyBoundRegionsError π ImplTraitInTraitCollector π RemapHiddenTyRegions π RemapLateParam π LateEarlyMismatch π check_method_is_structurally_compatible π Checks a bunch of different properties of the impl/trait methods for
compatibility, such as asyncness, number of argument, self receiver kind,
and number of early- and late-bound generics. check_number_of_early_bound_regions π check_region_bounds_on_impl_item π check_region_late_boundedness π check_type_bounds π Validate that ProjectionCandidates created for this associated type will
be valid. collect_return_position_impl_trait_in_trait_tys π Given a method def-id in an impl, compare the method signature of the impl
against the trait that itβs implementing. In doing so, infer the hidden types
that this methodβs signature provides to satisfy each return-position impl Trait
in the trait signature. compare_const_clause_entailment π The equivalent of compare_method_clause_entailment , but for associated constants
instead of associated functions. compare_const_directness π compare_const_generic_param_types π Checks that corresponding const generic parameters in a trait item and its
impl have compatible types. compare_generic_param_kinds π Checks that corresponding generic parameters in a trait item and its impl
are both type parameters or both const parameters. compare_impl_const π compare_impl_item π Call the query tcx.compare_impl_item() directly instead. compare_impl_method π Checks that a method from an impl conforms to the signature of
the same method as declared in the trait. compare_impl_ty π compare_method_clause_entailment π This function is best explained by example. Consider a trait with its implementation: compare_number_of_generics π Checks that the number of generics on a given assoc item in a trait impl is the same
as the number of generics on the respective assoc item in the trait definition. compare_number_of_method_arguments π compare_self_type π compare_synthetic_generics π compare_type_clause_entailment π The equivalent of compare_method_clause_entailment , but for associated types
instead of associated functions. extract_spans_for_error_reporting π find_region_in_clauses π get_self_string π Gets the string for an explicit self declaration, e.g. βselfβ, β&selfβ,
etc. param_env_with_gat_bounds π Install projection predicates that allow GATs to project to their own
definition types. This is not allowed in general in cases of default
associated types in trait definitions, or when specialization is involved,
but is needed when checking these definition types actually satisfy the
trait bounds of the GAT. report_trait_method_mismatch π try_report_async_mismatch π Manually check here that async fn foo() wasnβt matched against fn foo(),
and extract a better error if so.