[−][src]Struct rustc_privacy::NamePrivacyVisitor

pub(crate) struct NamePrivacyVisitor<'tcx> {
    tcx: TyCtxt<'tcx>,
    maybe_typeck_results: Option<&'tcx TypeckResults<'tcx>>,
    current_item: Option<HirId>,
}

Name privacy visitor, checks privacy and reports violations. Most of name privacy checks are performed during the main resolution phase, or later in type checking when field accesses and associated items are resolved. This pass performs remaining checks for fields in struct expressions and patterns.

Fields

tcx: TyCtxt<'tcx>maybe_typeck_results: Option<&'tcx TypeckResults<'tcx>>current_item: Option<HirId>

Implementations

impl<'tcx> NamePrivacyVisitor<'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 check_field(
    &mut self,
    use_ctxt: Span,
    span: Span,
    def: &'tcx AdtDef,
    field: &'tcx FieldDef,
    in_update_syntax: bool
)
[src]

Trait Implementations

impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'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 NamePrivacyVisitor<'tcx>

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

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

impl<'tcx> Unpin for NamePrivacyVisitor<'tcx>

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