1 // build-pass (FIXME(62277): could be check-pass?)
3 #![feature(crate_visibility_modifier)]
6 #![warn(unreachable_pub)]
9 // non-leaked `pub` items in private module should be linted
11 pub use std
::env
::{Args}
; // braced-use has different item spans than unbraced
14 // `pub` struct fields, too
16 // (... but not more-restricted fields)
17 crate electrons
: usize
21 pub fn count_neutrons(&self) -> usize { self.neutrons }
22 crate fn count_electrons(&self) -> usize { self.electrons }
26 pub union Lithium { c1: usize, c2: u8 }
29 pub const CARBON
: usize = 1;
30 pub static NITROGEN
: usize = 2;
31 pub type Oxygen
= bool
;
33 macro_rules
! define_empty_struct_with_visibility
{
34 ($visibility
: vis
, $name
: ident
) => { $visibility struct $name {}
}
36 define_empty_struct_with_visibility
!(pub, Fluorine
);
39 pub fn catalyze() -> bool
;
42 // items leaked through signatures (see `get_neon` below) are OK
45 // crate-visible items are OK
46 crate struct Sodium {}
50 // module is public: these are OK, too
51 pub struct Magnesium {}
52 crate struct Aluminum {}
55 pub fn get_neon() -> private_mod
::Neon
{