pub fn add_implied_bounds(
        &mut self,
        infcx: &InferCtxt<'a, 'gcx, 'tcx>,
        fn_sig_tys: &[Ty<'tcx>],
        body_id: ast::NodeId,
        span: Span,
    ) {
        debug!("add_implied_bounds()");

        for &ty in fn_sig_tys {
            let ty = infcx.resolve_type_vars_if_possible(&ty);
            debug!("add_implied_bounds: ty = {}", ty);
            let implied_bounds = infcx.implied_outlives_bounds(self.param_env, body_id, ty, span);
            self.add_outlives_bounds(Some(infcx), implied_bounds)
        }
    }
/// This method adds "implied bounds" into the outlives environment.
/// Implied bounds are outlives relationships that we can deduce
/// on the basis that certain types must be well-formed -- these are
/// either the types that appear in the function signature or else
/// the input types to an impl. For example, if you have a function
/// like
///
/// ```
/// fn foo<'a, 'b, T>(x: &'a &'b [T]) { }
/// ```
///
/// we can assume in the caller's body that `'b: 'a` and that `T:
/// 'b` (and hence, transitively, that `T: 'a`). This method would
/// add those assumptions into the outlives-environment.
///
/// Tests: `src/test/compile-fail/regions-free-region-ordering-*.rs`
This method adds "implied bounds" into the outlives environment.
Implied bounds are outlives relationships that we can deduce
on the basis that certain types must be well-formed -- these are
either the types that appear in the function signature or else
the input types to an impl. For example, if you have a function
like






This method adds " implied bounds " into the outlives environment . Implied bounds are outlives relationships that we can deduce on the basis that certain types must be well - formed -- these are either the types that appear in the function signature or else the input types to an impl . For example if you have a function like
pub fn add_implied_bounds(
        &mut self,
        infcx: &InferCtxt<'a, 'gcx, 'tcx>,
        fn_sig_tys: &[Ty<'tcx>],
        body_id: ast::NodeId,
        span: Span,
    ) {
        debug!("add_implied_bounds()");
        for &ty in fn_sig_tys {
            let ty = infcx.resolve_type_vars_if_possible(&ty);
            debug!("add_implied_bounds: ty = {}", ty);
            let implied_bounds = infcx.implied_outlives_bounds(self.param_env, body_id, ty, span);
            self.add_outlives_bounds(Some(infcx), implied_bounds)
        }
    }
pub fn add_implied_bounds ( & mut self , infcx : & InferCtxt < ' a , ' gcx , ' tcx > , fn_sig_tys : & [ Ty < ' tcx > ] , body_id : ast :: NodeId , span : Span , ) { debug ! ( " " ) ; for & ty in fn_sig_tys { let ty = infcx . resolve_type_vars_if_possible ( & ty ) ; debug ! ( " " ty ) ; let implied_bounds = infcx . implied_outlives_bounds ( self . param_env , body_id , ty , span ) ; self . add_outlives_bounds ( Some ( infcx ) , implied_bounds ) } }
This method adds "implied bounds" into the outlives environment.
This method adds " implied bounds " into the outlives environment .
&mut self
infcx
&InferCtxt<'a, 'gcx, 'tcx>
fn_sig_tys
&[Ty<'tcx>]
body_id
ast::NodeId
span
Span
&mut self
infcx
&InferCtxt<'a, 'gcx, 'tcx>
fn_sig_tys
&[Ty<'tcx>]
body_id
ast::NodeId
span
Span