Auto merge of #29291 - petrochenkov:privacy, r=alexcrichton

The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set.
This is needed for https://github.com/rust-lang/rust/pull/29083 because stability annotation pass uses the public set and all things listed above need to be annotated.
Rustdoc can now be migrated to the public set as well, I guess.

Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public.

r? @alexcrichton or maybe someone else
This commit is contained in:
bors 2015-11-02 23:38:49 +00:00
commit e2bb53ca52
7 changed files with 218 additions and 144 deletions

View file

@ -1726,6 +1726,12 @@ impl StructFieldKind {
NamedField(..) => false,
}
}
pub fn visibility(&self) -> Visibility {
match *self {
NamedField(_, vis) | UnnamedField(vis) => vis
}
}
}
/// Fields and Ids of enum variants and structs