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:
commit
e2bb53ca52
7 changed files with 218 additions and 144 deletions
29
src/test/auxiliary/issue-11225-3.rs
Normal file
29
src/test/auxiliary/issue-11225-3.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
trait PrivateTrait {
|
||||
fn private_trait_method(&self);
|
||||
}
|
||||
|
||||
struct PrivateStruct;
|
||||
|
||||
impl PrivateStruct {
|
||||
fn private_inherent_method(&self) { }
|
||||
}
|
||||
|
||||
impl PrivateTrait for PrivateStruct {
|
||||
fn private_trait_method(&self) { }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn public_generic_function() {
|
||||
PrivateStruct.private_trait_method();
|
||||
PrivateStruct.private_inherent_method();
|
||||
}
|
||||
19
src/test/run-pass/issue-11225-3.rs
Normal file
19
src/test/run-pass/issue-11225-3.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:issue-11225-3.rs
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
extern crate issue_11225_3;
|
||||
|
||||
pub fn main() {
|
||||
issue_11225_3::public_generic_function();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue