Struct rustc_privacy::SearchInterfaceForPrivateItemsVisitor [−][src]
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,
}Expand description
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: VisibilityExpand description
The visitor checks that each component type is at least this visible.
has_pub_restricted: boolhas_old_errors: boolin_assoc_ty: boolImplementations
impl<'tcx> SearchInterfaceForPrivateItemsVisitor<'tcx>[src]
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]
&mut self,
def_id: DefId,
kind: &str,
descr: &dyn Display
) -> bool
pub(crate) fn leaks_private_dep(&self, item_id: DefId) -> 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:
- It’s contained within a public type
- It comes from a private crate
Trait Implementations
impl<'tcx> DefIdVisitor<'tcx> for SearchInterfaceForPrivateItemsVisitor<'tcx>[src]
impl<'tcx> DefIdVisitor<'tcx> for SearchInterfaceForPrivateItemsVisitor<'tcx>[src]fn tcx(&self) -> TyCtxt<'tcx>[src]
fn visit_def_id(
&mut self,
def_id: DefId,
kind: &str,
descr: &dyn Display
) -> ControlFlow<Self::BreakTy>[src]
&mut self,
def_id: DefId,
kind: &str,
descr: &dyn Display
) -> ControlFlow<Self::BreakTy>
type BreakTy = ()
fn shallow(&self) -> bool[src]
fn skip_assoc_tys(&self) -> bool[src]
fn skeleton(&mut self) -> DefIdVisitorSkeleton<'_, 'tcx, Self>[src]
fn skeleton(&mut self) -> DefIdVisitorSkeleton<'_, 'tcx, Self>[src]Not overridden, but used to actually visit types and traits.
fn visit(
&mut self,
ty_fragment: impl TypeFoldable<'tcx>
) -> ControlFlow<Self::BreakTy>[src]
&mut self,
ty_fragment: impl TypeFoldable<'tcx>
) -> ControlFlow<Self::BreakTy>
fn visit_trait(
&mut self,
trait_ref: TraitRef<'tcx>
) -> ControlFlow<Self::BreakTy>[src]
&mut self,
trait_ref: TraitRef<'tcx>
) -> ControlFlow<Self::BreakTy>
fn visit_projection_ty(
&mut self,
projection: ProjectionTy<'tcx>
) -> ControlFlow<Self::BreakTy>[src]
&mut self,
projection: ProjectionTy<'tcx>
) -> ControlFlow<Self::BreakTy>
fn visit_predicates(
&mut self,
predicates: GenericPredicates<'tcx>
) -> ControlFlow<Self::BreakTy>[src]
&mut self,
predicates: GenericPredicates<'tcx>
) -> ControlFlow<Self::BreakTy>