diff options
| author | bors <bors@rust-lang.org> | 2015-11-02 23:38:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-02 23:38:49 +0000 |
| commit | e2bb53ca527b0fb86849b34f166f9835eb145203 (patch) | |
| tree | c3c1b43b196c24c69bf8330486d3d29a3efef3f8 /src/libsyntax | |
| parent | a1fd944eb83d23c3e7484850a1e7db275d38a58c (diff) | |
| parent | ab7b3456d00d13e52fa6631eb745bd1a472b5731 (diff) | |
| download | rust-e2bb53ca527b0fb86849b34f166f9835eb145203.tar.gz rust-e2bb53ca527b0fb86849b34f166f9835eb145203.zip | |
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
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index a6d90e15156..e56e49c4f49 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -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 |
