/// Checks an access to the given place to see if it is allowed. Examines the set of borrows
/// that are in scope, as well as which paths have been initialized, to ensure that (a) the
/// place is initialized and (b) it is not borrowed in some way that would prevent this
/// access.
///
/// Returns true if an error is reported, false otherwise.
Checks an access to the given place to see if it is allowed. Examines the set of borrows
that are in scope, as well as which paths have been initialized, to ensure that (a) the
place is initialized and (b) it is not borrowed in some way that would prevent this
access.

Returns true if an error is reported, false otherwise.
Checks an access to the given place to see if it is allowed . Examines the set of borrows that are in scope as well as which paths have been initialized to ensure that ( a ) the place is initialized and ( b ) it is not borrowed in some way that would prevent this access . Returns true if an error is reported false otherwise .
fn access_place(
        &mut self,
        context: Context,
        place_span: (&Place<'tcx>, Span),
        kind: (ShallowOrDeep, ReadOrWrite),
        is_local_mutation_allowed: LocalMutationIsAllowed,
        flow_state: &Flows<'cx, 'gcx, 'tcx>,
    ) {
        let (sd, rw) = kind;
        if let Activation(_, borrow_index) = rw {
            if self.reservation_error_reported.contains(&place_span.0) {
                debug!(
                    "skipping access_place for activation of invalid reservation \
                     place: {:?} borrow_index: {:?}",
                    place_span.0, borrow_index
                );
                return;
            }
        }
        if self
            .access_place_error_reported
            .contains(&(place_span.0.clone(), place_span.1))
        {
            debug!(
                "access_place: suppressing error place_span=`{:?}` kind=`{:?}`",
                place_span, kind
            );
            return;
        }
        let mutability_error =
            self.check_access_permissions(
                place_span,
                rw,
                is_local_mutation_allowed,
                flow_state,
                context.loc,
            );
        let conflict_error =
            self.check_access_for_conflict(context, place_span, sd, rw, flow_state);
        if conflict_error || mutability_error {
            debug!(
                "access_place: logging error place_span=`{:?}` kind=`{:?}`",
                place_span, kind
            );
            self.access_place_error_reported
                .insert((place_span.0.clone(), place_span.1));
        }
    }
fn access_place ( & mut self , context : Context , place_span : ( & Place < ' tcx > , Span ) , kind : ( ShallowOrDeep , ReadOrWrite ) , is_local_mutation_allowed : LocalMutationIsAllowed , flow_state : & Flows < ' cx , ' gcx , ' tcx > , ) { let ( sd , rw ) = kind ; if let Activation ( _ , borrow_index ) = rw { if self . reservation_error_reported . contains ( & place_span . 0 ) { debug ! ( " \
 " place_span 0 borrow_index ) ; return ; } } if self . access_place_error_reported . contains ( & ( place_span . 0 . clone ( ) , place_span . 1 ) ) { debug ! ( " " place_span kind ) ; return ; } let mutability_error = self . check_access_permissions ( place_span , rw , is_local_mutation_allowed , flow_state , context . loc , ) ; let conflict_error = self . check_access_for_conflict ( context , place_span , sd , rw , flow_state ) ; if conflict_error || mutability_error { debug ! ( " " place_span kind ) ; self . access_place_error_reported . insert ( ( place_span . 0 . clone ( ) , place_span . 1 ) ) ; } }
Checks an access to the given place to see if it is allowed.
Checks an access to the given place to see if it is allowed .
&mut self
context
Context
place_span
(&Place<'tcx>, Span)
kind
(ShallowOrDeep, ReadOrWrite)
is_local_mutation_allowed
LocalMutationIsAllowed
flow_state
&Flows<'cx, 'gcx, 'tcx>