Crate rustc_privacy[][src]

🔬 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?

Re-exports

extern crate std;
extern crate rustc;
extern crate syntax;
extern crate rustc_typeck;
extern crate syntax_pos;
extern crate rustc_data_structures;
use std::prelude::v1::*;
use rustc::hir;
use rustc::hir::PatKind;
use rustc::hir::def::Def;
use rustc::hir::def_id::CRATE_DEF_INDEX;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc::hir::def_id::CrateNum;
use rustc::hir::def_id::DefId;
use rustc::hir::intravisit;
use rustc::hir::intravisit::Visitor;
use rustc::hir::intravisit::NestedVisitorMap;
use rustc::hir::itemlikevisit::DeepVisitor;
use rustc::lint;
use rustc::middle::privacy::AccessLevel;
use rustc::middle::privacy::AccessLevels;
use rustc::ty;
use rustc::ty::TyCtxt;
use rustc::ty::Ty;
use rustc::ty::TypeFoldable;
use rustc::ty::fold::TypeVisitor;
use rustc::ty::maps::Providers;
use rustc::ty::subst::UnpackedKind;
use rustc::util::nodemap::NodeSet;
use syntax::ast;
use syntax::ast::CRATE_NODE_ID;
use syntax::ast::Ident;
use syntax::symbol::keywords;
use syntax_pos::Span;
use std::cmp;
use std::mem::replace;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;

Modules

diagnostics [
Experimental
]

Structs

EmbargoVisitor [
Experimental
]

The embargo visitor, used to determine the exports of the ast

NamePrivacyVisitor [
Experimental
]

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.

ObsoleteCheckTypeForPrivatenessVisitor [
Experimental
]
ObsoleteVisiblePrivateTypesVisitor [
Experimental
]

Obsolete visitors for checking for private items in public interfaces. These visitors are supposed to be kept in frozen state and produce an "old error node set". For backward compatibility the new visitor reports warnings instead of hard errors when the erroneous node is not in this old set.

PrivateItemsInPublicInterfacesVisitor [
Experimental
]
PubRestrictedVisitor [
Experimental
]

Visitor used to determine if pub(restricted) is used anywhere in the crate.

ReachEverythingInTheInterfaceVisitor [
Experimental
]
SearchInterfaceForPrivateItemsVisitor [
Experimental
]

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.

TypePrivacyVisitor [
Experimental
]

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.

Constants

DIAGNOSTICS [
Experimental
]

Functions

check_crate [
Experimental
]
privacy_access_levels [
Experimental
]
provide [
Experimental
]
update_tables [
Experimental
]