2020-12-25 17:38:46 -06:00
|
|
|
// compile-flags: --document-private-items
|
|
|
|
|
2020-12-25 18:27:56 -06:00
|
|
|
#![feature(crate_visibility_modifier)]
|
|
|
|
|
2020-12-25 17:38:46 -06:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2020-12-25 18:27:56 -06:00
|
|
|
// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
|
|
|
|
pub struct FooPublic;
|
|
|
|
// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
|
|
|
|
crate struct FooJustCrate;
|
|
|
|
// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
|
|
|
|
pub(crate) struct FooPubCrate;
|
|
|
|
// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
|
|
|
|
pub(self) struct FooSelf;
|
|
|
|
// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
|
|
|
|
pub(in self) struct FooInSelf;
|
|
|
|
// @has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv'
|
|
|
|
struct FooPriv;
|
|
|
|
|
|
|
|
mod a {
|
|
|
|
// @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
|
|
|
|
pub(super) struct FooASuper;
|
|
|
|
// @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
|
|
|
|
pub(in super) struct FooAInSuper;
|
|
|
|
// @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
|
2020-12-31 14:04:13 -06:00
|
|
|
// @!has 'foo/a/struct.FooAInA.html' '//pre' 'pub'
|
2020-12-25 18:27:56 -06:00
|
|
|
pub(in a) struct FooAInA;
|
|
|
|
// @has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv'
|
2020-12-31 14:04:13 -06:00
|
|
|
// @!has 'foo/a/struct.FooAPriv.html' '//pre' 'pub'
|
2020-12-25 18:27:56 -06:00
|
|
|
struct FooAPriv;
|
2020-12-25 17:38:46 -06:00
|
|
|
|
2020-12-25 18:27:56 -06:00
|
|
|
mod b {
|
|
|
|
// @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
|
|
|
|
pub(super) struct FooBSuper;
|
|
|
|
// @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
|
|
|
|
pub(in super::super) struct FooBInSuperSuper;
|
|
|
|
// @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
|
2020-12-31 14:04:13 -06:00
|
|
|
// @!has 'foo/a/b/struct.FooBInAB.html' '//pre' 'pub'
|
2020-12-25 18:27:56 -06:00
|
|
|
pub(in a::b) struct FooBInAB;
|
|
|
|
// @has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv'
|
2020-12-31 14:04:13 -06:00
|
|
|
// @!has 'foo/a/b/struct.FooBPriv.html' '//pre' 'pub'
|
2020-12-25 18:27:56 -06:00
|
|
|
struct FooBPriv;
|
|
|
|
}
|
2020-12-25 17:38:46 -06:00
|
|
|
}
|
2021-01-22 17:02:49 -06:00
|
|
|
|
|
|
|
// @has 'foo/trait.PubTrait.html' '//pre' 'pub trait PubTrait'
|
|
|
|
//
|
|
|
|
// @has 'foo/trait.PubTrait.html' '//pre' 'type Type;'
|
|
|
|
// @!has 'foo/trait.PubTrait.html' '//pre' 'pub type Type;'
|
|
|
|
//
|
|
|
|
// @has 'foo/trait.PubTrait.html' '//pre' 'const CONST: usize;'
|
|
|
|
// @!has 'foo/trait.PubTrait.html' '//pre' 'pub const CONST: usize;'
|
|
|
|
//
|
|
|
|
// @has 'foo/trait.PubTrait.html' '//pre' 'fn function();'
|
|
|
|
// @!has 'foo/trait.PubTrait.html' '//pre' 'pub fn function();'
|
|
|
|
|
|
|
|
pub trait PubTrait {
|
|
|
|
type Type;
|
|
|
|
const CONST: usize;
|
|
|
|
fn function();
|
|
|
|
}
|
|
|
|
|
2021-07-25 16:41:57 -05:00
|
|
|
// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'type Type'
|
|
|
|
// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub type Type'
|
2021-01-22 17:02:49 -06:00
|
|
|
//
|
2021-07-25 16:41:57 -05:00
|
|
|
// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'const CONST: usize'
|
|
|
|
// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub const CONST: usize'
|
2021-01-22 17:02:49 -06:00
|
|
|
//
|
2021-07-25 16:41:57 -05:00
|
|
|
// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'fn function()'
|
|
|
|
// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub fn function()'
|
2021-01-22 17:02:49 -06:00
|
|
|
|
|
|
|
impl PubTrait for FooPublic {
|
|
|
|
type Type = usize;
|
|
|
|
const CONST: usize = 0;
|
|
|
|
fn function() {}
|
|
|
|
}
|