Struct rustc_privacy::TypePrivacyVisitor [−][src]
struct TypePrivacyVisitor<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, tables: &'a TypeckTables<'tcx>, current_item: DefId, in_body: bool, span: Span, empty_tables: &'a TypeckTables<'tcx>, visited_anon_tys: FxHashSet<DefId>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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<'a, 'tcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
tables: &'a TypeckTables<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
current_item: DefId
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
in_body: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
span: Span
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
empty_tables: &'a TypeckTables<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
visited_anon_tys: FxHashSet<DefId>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a, 'tcx> TypePrivacyVisitor<'a, 'tcx>
[src]
impl<'a, 'tcx> TypePrivacyVisitor<'a, 'tcx>
fn def_id_visibility(&self, did: DefId) -> Visibility
[src]
fn def_id_visibility(&self, did: DefId) -> Visibility
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn item_is_accessible(&self, did: DefId) -> bool
[src]
fn item_is_accessible(&self, did: DefId) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_expr_pat_type(&mut self, id: HirId, span: Span) -> bool
[src]
fn check_expr_pat_type(&mut self, id: HirId, span: Span) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn check_trait_ref(&mut self, trait_ref: TraitRef<'tcx>) -> bool
[src]
fn check_trait_ref(&mut self, trait_ref: TraitRef<'tcx>) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx>
[src]
impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx>
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx>
[src]
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
We want to visit items in the context of their containing module and so forth, so supply a crate for doing a deep walk.
fn visit_nested_body(&mut self, body: BodyId)
[src]
fn visit_nested_body(&mut self, body: BodyId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Invoked to visit the body of a function, method or closure. Like visit_nested_item, does nothing by default unless you override nested_visit_map
to return Some(_)
, in which case it will walk the body. Read more
fn visit_ty(&mut self, hir_ty: &'tcx Ty)
[src]
fn visit_ty(&mut self, hir_ty: &'tcx Ty)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_trait_ref(&mut self, trait_ref: &'tcx TraitRef)
[src]
fn visit_trait_ref(&mut self, trait_ref: &'tcx TraitRef)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_expr(&mut self, expr: &'tcx Expr)
[src]
fn visit_expr(&mut self, expr: &'tcx Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_qpath(&mut self, qpath: &'tcx QPath, id: NodeId, span: Span)
[src]
fn visit_qpath(&mut self, qpath: &'tcx QPath, id: NodeId, span: Span)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_pat(&mut self, pattern: &'tcx Pat)
[src]
fn visit_pat(&mut self, pattern: &'tcx Pat)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_local(&mut self, local: &'tcx Local)
[src]
fn visit_local(&mut self, local: &'tcx Local)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_item(&mut self, item: &'tcx Item)
[src]
fn visit_item(&mut self, item: &'tcx Item)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Visit the top-level item and (optionally) nested items / impl items. See visit_nested_item
for details. Read more
fn visit_trait_item(&mut self, ti: &'tcx TraitItem)
[src]
fn visit_trait_item(&mut self, ti: &'tcx TraitItem)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_impl_item(&mut self, ii: &'tcx ImplItem)
[src]
fn visit_impl_item(&mut self, ii: &'tcx ImplItem)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_nested_item(&mut self, id: ItemId)
[src]
fn visit_nested_item(&mut self, id: ItemId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Invoked when a nested item is encountered. By default does nothing unless you override nested_visit_map
to return Some(_)
, in which case it will walk the item. You probably don't want to override this method -- instead, override nested_visit_map
or use the "shallow" or "deep" visit patterns described on itemlikevisit::ItemLikeVisitor
. The only reason to override this method is if you want a nested pattern but cannot supply a Map
; see nested_visit_map
for advice. Read more
fn visit_nested_trait_item(&mut self, id: TraitItemId)
[src]
fn visit_nested_trait_item(&mut self, id: TraitItemId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Like visit_nested_item()
, but for trait items. See visit_nested_item()
for advice on when to override this method. Read more
fn visit_nested_impl_item(&mut self, id: ImplItemId)
[src]
fn visit_nested_impl_item(&mut self, id: ImplItemId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Like visit_nested_item()
, but for impl items. See visit_nested_item()
for advice on when to override this method. Read more
fn visit_body(&mut self, b: &'v Body)
[src]
fn visit_body(&mut self, b: &'v Body)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn as_deep_visitor(&'s mut self) -> DeepVisitor<'s, Self>
[src]
fn as_deep_visitor(&'s mut self) -> DeepVisitor<'s, Self>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
When invoking visit_all_item_likes()
, you need to supply an item-like visitor. This method converts a "intra-visit" visitor into an item-like visitor that walks the entire tree. If you use this, you probably don't want to process the contents of nested item-like things, since the outer loop will visit them as well. Read more
fn visit_id(&mut self, _node_id: NodeId)
[src]
fn visit_id(&mut self, _node_id: NodeId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_def_mention(&mut self, _def: Def)
[src]
fn visit_def_mention(&mut self, _def: Def)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_name(&mut self, _span: Span, _name: Symbol)
[src]
fn visit_name(&mut self, _span: Span, _name: Symbol)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_ident(&mut self, ident: Ident)
[src]
fn visit_ident(&mut self, ident: Ident)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_mod(&mut self, m: &'v Mod, _s: Span, n: NodeId)
[src]
fn visit_mod(&mut self, m: &'v Mod, _s: Span, n: NodeId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_foreign_item(&mut self, i: &'v ForeignItem)
[src]
fn visit_foreign_item(&mut self, i: &'v ForeignItem)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_block(&mut self, b: &'v Block)
[src]
fn visit_block(&mut self, b: &'v Block)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_stmt(&mut self, s: &'v Spanned<Stmt_>)
[src]
fn visit_stmt(&mut self, s: &'v Spanned<Stmt_>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_arm(&mut self, a: &'v Arm)
[src]
fn visit_arm(&mut self, a: &'v Arm)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_decl(&mut self, d: &'v Spanned<Decl_>)
[src]
fn visit_decl(&mut self, d: &'v Spanned<Decl_>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_anon_const(&mut self, c: &'v AnonConst)
[src]
fn visit_anon_const(&mut self, c: &'v AnonConst)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_generic_param(&mut self, p: &'v GenericParam)
[src]
fn visit_generic_param(&mut self, p: &'v GenericParam)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_generics(&mut self, g: &'v Generics)
[src]
fn visit_generics(&mut self, g: &'v Generics)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_where_predicate(&mut self, predicate: &'v WherePredicate)
[src]
fn visit_where_predicate(&mut self, predicate: &'v WherePredicate)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_fn_decl(&mut self, fd: &'v FnDecl)
[src]
fn visit_fn_decl(&mut self, fd: &'v FnDecl)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_fn(
&mut self,
fk: FnKind<'v>,
fd: &'v FnDecl,
b: BodyId,
s: Span,
id: NodeId
)
[src]
fn visit_fn(
&mut self,
fk: FnKind<'v>,
fd: &'v FnDecl,
b: BodyId,
s: Span,
id: NodeId
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)
[src]
fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef)
[src]
fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_ty_param_bound(&mut self, bounds: &'v TyParamBound)
[src]
fn visit_ty_param_bound(&mut self, bounds: &'v TyParamBound)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef, m: TraitBoundModifier)
[src]
fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef, m: TraitBoundModifier)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_variant_data(
&mut self,
s: &'v VariantData,
Symbol,
&'v Generics,
_parent_id: NodeId,
Span
)
[src]
fn visit_variant_data(
&mut self,
s: &'v VariantData,
Symbol,
&'v Generics,
_parent_id: NodeId,
Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_struct_field(&mut self, s: &'v StructField)
[src]
fn visit_struct_field(&mut self, s: &'v StructField)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef,
generics: &'v Generics,
item_id: NodeId,
Span
)
[src]
fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef,
generics: &'v Generics,
item_id: NodeId,
Span
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_variant(
&mut self,
v: &'v Spanned<Variant_>,
g: &'v Generics,
item_id: NodeId
)
[src]
fn visit_variant(
&mut self,
v: &'v Spanned<Variant_>,
g: &'v Generics,
item_id: NodeId
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_label(&mut self, label: &'v Label)
[src]
fn visit_label(&mut self, label: &'v Label)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_lifetime(&mut self, lifetime: &'v Lifetime)
[src]
fn visit_lifetime(&mut self, lifetime: &'v Lifetime)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_path(&mut self, path: &'v Path, _id: NodeId)
[src]
fn visit_path(&mut self, path: &'v Path, _id: NodeId)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment)
[src]
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_path_parameters(
&mut self,
path_span: Span,
path_parameters: &'v PathParameters
)
[src]
fn visit_path_parameters(
&mut self,
path_span: Span,
path_parameters: &'v PathParameters
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding)
[src]
fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_attribute(&mut self, _attr: &'v Attribute)
[src]
fn visit_attribute(&mut self, _attr: &'v Attribute)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_macro_def(&mut self, macro_def: &'v MacroDef)
[src]
fn visit_macro_def(&mut self, macro_def: &'v MacroDef)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_vis(&mut self, vis: &'v Visibility)
[src]
fn visit_vis(&mut self, vis: &'v Visibility)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_associated_item_kind(&mut self, kind: &'v AssociatedItemKind)
[src]
fn visit_associated_item_kind(&mut self, kind: &'v AssociatedItemKind)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_defaultness(&mut self, defaultness: &'v Defaultness)
[src]
fn visit_defaultness(&mut self, defaultness: &'v Defaultness)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'tcx> TypeVisitor<'tcx> for TypePrivacyVisitor<'a, 'tcx>
[src]
impl<'a, 'tcx> TypeVisitor<'tcx> for TypePrivacyVisitor<'a, 'tcx>
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool
[src]
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_binder<T>(&mut self, t: &Binder<T>) -> bool where
T: TypeFoldable<'tcx>,
[src]
fn visit_binder<T>(&mut self, t: &Binder<T>) -> bool where
T: TypeFoldable<'tcx>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_region(&mut self, r: &'tcx RegionKind) -> bool
[src]
fn visit_region(&mut self, r: &'tcx RegionKind) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> bool
[src]
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'a, 'tcx> !Send for TypePrivacyVisitor<'a, 'tcx>
impl<'a, 'tcx> !Send for TypePrivacyVisitor<'a, 'tcx>
impl<'a, 'tcx> !Sync for TypePrivacyVisitor<'a, 'tcx>
impl<'a, 'tcx> !Sync for TypePrivacyVisitor<'a, 'tcx>