Skip to main content

Module compare_eii

Module compare_eii 

Source
Expand description

This module is very similar to compare_impl_item. Most logic is taken from there, since in a very similar way we’re comparing some declaration of a signature to an implementation. The major difference is that we don’t bother with self types, since for EIIs we’re comparing freestanding item.

Re-exports§

use std::borrow::Cow; 🔒
use std::iter; 🔒
use rustc_attr_ir::EiiImplResolution; 🔒
use rustc_attr_ir::find_attr; 🔒
use rustc_data_structures::fx::FxIndexSet; 🔒
use rustc_errors::Applicability; 🔒
use rustc_errors::E0806; 🔒
use rustc_errors::struct_span_code_err; 🔒
use rustc_hir::def::DefKind; 🔒
use rustc_hir::def_id::DefId; 🔒
use rustc_hir::def_id::LocalDefId; 🔒
use rustc_hir as hir; 🔒
use rustc_hir::FnSig; 🔒
use rustc_hir::HirId; 🔒
use rustc_hir::ItemKind; 🔒
use rustc_infer::infer; 🔒
use rustc_infer::infer::InferCtxt; 🔒
use rustc_infer::infer::TyCtxtInferExt; 🔒
use rustc_infer::traits::ObligationCause; 🔒
use rustc_infer::traits::ObligationCauseCode; 🔒
use rustc_infer::traits::TraitErrors; 🔒
use rustc_middle::ty::error::ExpectedFound; 🔒
use rustc_middle::ty::error::TypeError; 🔒
use rustc_middle::ty; 🔒
use rustc_middle::ty::ParamEnv; 🔒
use rustc_middle::ty::Ty; 🔒
use rustc_middle::ty::TyCtxt; 🔒
use rustc_middle::ty::TypeVisitableExt; 🔒
use rustc_middle::ty::TypingMode; 🔒
use rustc_middle::ty::Unnormalized; 🔒
use rustc_span::ErrorGuaranteed; 🔒
use rustc_span::Ident; 🔒
use rustc_span::Span; 🔒
use rustc_span::Symbol; 🔒
use rustc_trait_selection::error_reporting::InferCtxtErrorExt; 🔒
use rustc_trait_selection::regions::InferCtxtRegionExt; 🔒
use rustc_trait_selection::traits; 🔒
use rustc_trait_selection::traits::ObligationCtxt; 🔒
use tracing::debug; 🔒
use tracing::instrument; 🔒
use tracing::instrument; 🔒
use super::potentially_plural_count; 🔒
use crate::check::compare_impl_item::CheckNumberOfEarlyBoundRegionsError; 🔒
use crate::check::compare_impl_item::check_number_of_early_bound_regions; 🔒
use crate::diagnostics::EiiDefkindMismatch; 🔒
use crate::diagnostics::EiiDefkindMismatchStaticMutability; 🔒
use crate::diagnostics::EiiDefkindMismatchStaticSafety; 🔒
use crate::diagnostics::EiiWithGenerics; 🔒
use crate::diagnostics::LifetimesOrBoundsMismatchOnEii; 🔒

Functions§

check_early_region_bounds 🔒
check_eii_target 🔒
check_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_no_generics 🔒
externally implementable items can’t have generics
check_number_of_arguments 🔒
compare_eii_function_types 🔒
Checks whether the signature of some external_impl, matches the signature of declaration, which it is supposed to be compatible with in order to implement the item.
compare_eii_statics 🔒
extract_spans_for_error_reporting 🔒
get_declaration_sig 🔒
report_eii_mismatch 🔒
report_number_of_arguments_mismatch 🔒