[−][src]Struct rustc_privacy::TypePrivacyVisitor

pub(crate) struct TypePrivacyVisitor<'tcx> {
    tcx: TyCtxt<'tcx>,
    maybe_typeck_results: Option<&'tcx TypeckResults<'tcx>>,
    current_item: LocalDefId,
    span: Span,
}

Type privacy visitor, checks types for privacy and reports violations. Both explicitly written types and inferred types of expressions and patters are checked. Checks are performed on "semantic" types regardless of names and their hygiene.

Fields

tcx: TyCtxt<'tcx>maybe_typeck_results: Option<&'tcx TypeckResults<'tcx>>current_item: LocalDefIdspan: Span

Implementations

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

pub(crate) fn typeck_results(&self) -> &'tcx TypeckResults<'tcx>[src]

Gets the type-checking results for the current body. As this will ICE if called outside bodies, only call when working with Expr or Pat nodes (they are guaranteed to be found only in bodies).

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

pub(crate) fn check_expr_pat_type(&mut self, id: HirId, span: Span) -> bool[src]

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

Trait Implementations

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

impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx>[src]

type Map = Map<'tcx>

pub fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map>[src]

We want to visit items in the context of their containing module and so forth, so supply a crate for doing a deep walk.

Auto Trait Implementations

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

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

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

impl<'tcx> Unpin for TypePrivacyVisitor<'tcx>

impl<'tcx> !UnwindSafe for TypePrivacyVisitor<'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.