pub(in borrow_check) fn find_why_borrow_contains_point(
        &self,
        context: Context,
        borrow: &BorrowData<'tcx>
    ) -> BorrowContainsPointReason<'tcx> {
        use self::BorrowContainsPointReason::*;

        debug!(
            "find_why_borrow_contains_point(context={:?}, borrow={:?})",
            context, borrow,
        );

        let regioncx = &self.nonlexical_regioncx;
        let mir = self.mir;
        let tcx = self.tcx;

        let borrow_region_vid = regioncx.to_region_vid(borrow.region);

        debug!(
            "explain_why_borrow_contains_point: borrow_region_vid={:?}",
            borrow_region_vid
        );

        let region_sub = regioncx.find_sub_region_live_at(borrow_region_vid, context.loc);

        debug!(
            "explain_why_borrow_contains_point: region_sub={:?}",
            region_sub
        );

        match find_use::find(mir, regioncx, tcx, region_sub, context.loc) {
            Some(Cause::LiveVar(local, location)) => Liveness {
                local,
                location,
                in_loop: self.is_borrow_location_in_loop(context.loc),
            },
            Some(Cause::DropVar(local, location)) => DropLiveness {
                local,
                location,
            },
            None => OutlivesFreeRegion {
                outlived_region: regioncx.to_error_region(region_sub),
            },
        }
    }
/// Finds the reason that [explain_why_borrow_contains_point] will report
/// but doesn't add it to any message. This is a separate function in case
/// the caller wants to change the error they report based on the reason
/// that will be reported.
Finds the reason that [explain_why_borrow_contains_point] will report
but doesn't add it to any message. This is a separate function in case
the caller wants to change the error they report based on the reason
that will be reported.
Finds the reason that [ explain_why_borrow_contains_point ] will report but doesn ' t add it to any message . This is a separate function in case the caller wants to change the error they report based on the reason that will be reported .
pub(in borrow_check) fn find_why_borrow_contains_point(
        &self,
        context: Context,
        borrow: &BorrowData<'tcx>
    ) -> BorrowContainsPointReason<'tcx> {
        use self::BorrowContainsPointReason::*;
        debug!(
            "find_why_borrow_contains_point(context={:?}, borrow={:?})",
            context, borrow,
        );
        let regioncx = &self.nonlexical_regioncx;
        let mir = self.mir;
        let tcx = self.tcx;
        let borrow_region_vid = regioncx.to_region_vid(borrow.region);
        debug!(
            "explain_why_borrow_contains_point: borrow_region_vid={:?}",
            borrow_region_vid
        );
        let region_sub = regioncx.find_sub_region_live_at(borrow_region_vid, context.loc);
        debug!(
            "explain_why_borrow_contains_point: region_sub={:?}",
            region_sub
        );
        match find_use::find(mir, regioncx, tcx, region_sub, context.loc) {
            Some(Cause::LiveVar(local, location)) => Liveness {
                local,
                location,
                in_loop: self.is_borrow_location_in_loop(context.loc),
            },
            Some(Cause::DropVar(local, location)) => DropLiveness {
                local,
                location,
            },
            None => OutlivesFreeRegion {
                outlived_region: regioncx.to_error_region(region_sub),
            },
        }
    }
pub ( in borrow_check ) fn find_why_borrow_contains_point ( & self , context : Context , borrow : & BorrowData < ' tcx > ) -> BorrowContainsPointReason < ' tcx > { use self :: BorrowContainsPointReason :: * ; debug ! ( " " context borrow ) ; let regioncx = & self . nonlexical_regioncx ; let mir = self . mir ; let tcx = self . tcx ; let borrow_region_vid = regioncx . to_region_vid ( borrow . region ) ; debug ! ( " " borrow_region_vid ) ; let region_sub = regioncx . find_sub_region_live_at ( borrow_region_vid , context . loc ) ; debug ! ( " " region_sub ) ; match find_use :: find ( mir , regioncx , tcx , region_sub , context . loc ) { Some ( Cause :: LiveVar ( local , location ) ) => Liveness { local , location , in_loop : self . is_borrow_location_in_loop ( context . loc ) , } , Some ( Cause :: DropVar ( local , location ) ) => DropLiveness { local , location , } , None => OutlivesFreeRegion { outlived_region : regioncx . to_error_region ( region_sub ) , } , } }
Finds the reason that [explain_why_borrow_contains_point] will report
but doesn't add it to any message.
Finds the reason that [ explain_why_borrow_contains_point ] will report but doesn ' t add it to any message .
&self
context
Context
borrow
&BorrowData<'tcx>
&self
context
Context
borrow
&BorrowData<'tcx>