fn check_protector(
        item: &Item,
        provoking_access: Option<(SbTag, AccessKind)>,
        global: &GlobalState,
    ) -> InterpResult<'tcx> {
        if let SbTag::Tagged(id) = item.tag {
            if Some(id) == global.tracked_pointer_tag {
                register_diagnostic(NonHaltingDiagnostic::PoppedPointerTag(
                    item.clone(),
                    provoking_access,
                ));
            }
        }
        if let Some(call) = item.protector {
            if global.is_active(call) {
                if let Some((tag, _)) = provoking_access {
                    Err(err_sb_ub(
                        format!(
                            "not granting access to tag {:?} because incompatible item is protected: {:?}",
                            tag, item
                        ),
                        None,
                    ))?
                } else {
                    Err(err_sb_ub(
                        format!("deallocating while item is protected: {:?}", item),
                        None,
                    ))?
                }
            }
        }
        Ok(())
    }
/// Check if the given item is protected.
///
/// The `provoking_access` argument is only used to produce diagnostics.
/// It is `Some` when we are granting the contained access for said tag, and it is
/// `None` during a deallocation.
Check if the given item is protected.
The `provoking_access` argument is only used to produce diagnostics.
It is `Some` when we are granting the contained access for said tag, and it is
`None` during a deallocation.
Check if the given item is protected . The ` provoking_access ` argument is only used to produce diagnostics . It is ` Some ` when we are granting the contained access for said tag and it is ` None ` during a deallocation .
fn check_protector(
        item: &Item,
        provoking_access: Option<(SbTag, AccessKind)>,
        global: &GlobalState,
    ) -> InterpResult<'tcx> {
        if let SbTag::Tagged(id) = item.tag {
            if Some(id) == global.tracked_pointer_tag {
                register_diagnostic(NonHaltingDiagnostic::PoppedPointerTag(
                    item.clone(),
                    provoking_access,
                ));
            }
        }
        if let Some(call) = item.protector {
            if global.is_active(call) {
                if let Some((tag, _)) = provoking_access {
                    Err(err_sb_ub(
                        format!(
                            "not granting access to tag {:?} because incompatible item is protected: {:?}",
                            tag, item
                        ),
                        None,
                    ))?
                } else {
                    Err(err_sb_ub(
                        format!("deallocating while item is protected: {:?}", item),
                        None,
                    ))?
                }
            }
        }
        Ok(())
    }
fn check_protector ( item : & Item , provoking_access : Option < ( SbTag , AccessKind ) > , global : & GlobalState , ) -> InterpResult < ' tcx > { if let SbTag :: Tagged ( id ) = item . tag { if Some ( id ) == global . tracked_pointer_tag { register_diagnostic ( NonHaltingDiagnostic :: PoppedPointerTag ( item . clone ( ) , provoking_access , ) ) ; } } if let Some ( call ) = item . protector { if global . is_active ( call ) { if let Some ( ( tag , _ ) ) = provoking_access { Err ( err_sb_ub ( format ! ( " " tag item ) , None , ) ) ? } else { Err ( err_sb_ub ( format ! ( " " item ) , None , ) ) ? } } } Ok ( ( ) ) }
Check if the given item is protected.
Check if the given item is protected .
item
&Item
provoking_access
Option<(SbTag, AccessKind)>
global
&GlobalState