[−][src]Struct rustc_privacy::SearchInterfaceForPrivateItemsVisitor

pub(crate) struct SearchInterfaceForPrivateItemsVisitor<'tcx> {
    tcx: TyCtxt<'tcx>,
    item_id: HirId,
    item_def_id: DefId,
    span: Span,
    required_visibility: Visibility,
    has_pub_restricted: bool,
    has_old_errors: bool,
    in_assoc_ty: bool,
}

SearchInterfaceForPrivateItemsVisitor traverses an item's interface and finds any private components in it. PrivateItemsInPublicInterfacesVisitor ensures there are no private types and traits in public interfaces.

Fields

tcx: TyCtxt<'tcx>item_id: HirIditem_def_id: DefIdspan: Spanrequired_visibility: Visibility

The visitor checks that each component type is at least this visible.

has_pub_restricted: boolhas_old_errors: boolin_assoc_ty: bool

Implementations

impl<'tcx> SearchInterfaceForPrivateItemsVisitor<'tcx>[src]

pub(crate) fn generics(&mut self) -> &mut Self[src]

pub(crate) fn predicates(&mut self) -> &mut Self[src]

pub(crate) fn bounds(&mut self) -> &mut Self[src]

pub(crate) fn ty(&mut self) -> &mut Self[src]

pub(crate) fn check_def_id(
    &mut self,
    def_id: DefId,
    kind: &str,
    descr: &dyn Display
) -> bool
[src]

pub(crate) fn leaks_private_dep(&self, item_id: DefId) -> bool[src]

An item is 'leaked' from a private dependency if all of the following are true:

  1. It's contained within a public type
  2. It comes from a private crate

Trait Implementations

impl<'tcx> DefIdVisitor<'tcx> for SearchInterfaceForPrivateItemsVisitor<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for SearchInterfaceForPrivateItemsVisitor<'tcx>

impl<'tcx> !Send for SearchInterfaceForPrivateItemsVisitor<'tcx>

impl<'tcx> !Sync for SearchInterfaceForPrivateItemsVisitor<'tcx>

impl<'tcx> Unpin for SearchInterfaceForPrivateItemsVisitor<'tcx>

impl<'tcx> !UnwindSafe for SearchInterfaceForPrivateItemsVisitor<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.