Skip to main content

Module implied_bounds

Module implied_bounds 

Source

Re-exportsΒ§

use rustc_hir::def::DefKind; πŸ”’
use rustc_hir::def_id::LocalDefId; πŸ”’
use rustc_infer::infer::TyCtxtInferExt; πŸ”’
use rustc_infer::traits::ObligationCause; πŸ”’
use rustc_infer::traits::query::MirBorrowckImpliedOutlivesBounds; πŸ”’
use rustc_middle::infer::canonical::Canonical; πŸ”’
use rustc_middle::infer::canonical::QueryResponse; πŸ”’
use rustc_middle::ty; πŸ”’
use rustc_middle::ty::CanonicalVarValues; πŸ”’
use rustc_middle::ty::GenericArg; πŸ”’
use rustc_middle::ty::Ty; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_middle::ty::TypeVisitableExt; πŸ”’
use rustc_middle::ty::TypingEnv; πŸ”’
use rustc_middle::ty::fold_regions; πŸ”’
use rustc_span::DUMMY_SP; πŸ”’
use rustc_trait_selection::solve::NoSolution; πŸ”’
use rustc_trait_selection::traits::ObligationCtxt; πŸ”’
use rustc_trait_selection::traits::implied_outlives_bounds::compute_implied_outlives_bounds_inner; πŸ”’
use rustc_trait_selection::traits::implied_outlives_bounds::consider_implied_bounds_hack_for_ty; πŸ”’
use smallvec::SmallVec; πŸ”’
use tracing::instrument; πŸ”’
use tracing::instrument; πŸ”’
use crate::universal_regions::DefiningTy; πŸ”’

FunctionsΒ§

implied_bounds_query_var_values πŸ”’
This computes the var_values used by the mir_borrowck_implied_outlives_bounds query. The old solver canonicalization does not replace early and late bound parameters, so the only var_values we need are external regions from the signature of the nested body as we don’t have a shared representation between this query and MIR borrowck.
mir_borrowck_implied_outlives_bounds πŸ”’
Computes the implied bounds for body_def_id. This is a separate query as it must not reveal the hidden type of opaques defined by body_def_id for typeck roots.
replace_erased_regions_with_placeholders πŸ”’
This replaces all external regions in the signature of the current item with a unique placeholder to collect its implied bounds. This mirrors the way MIR borrowck replaces all of them with unique NLL vars.