1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![feature(crate_visibility_modifier)]
16 #![warn(unreachable_pub)]
19 // non-leaked `pub` items in private module should be linted
21 pub use std::env::{Args}; // braced-use has different item spans than unbraced
24 // `pub` struct fields, too
26 // (... but not more-restricted fields)
27 crate electrons: usize
31 pub fn count_neutrons(&self) -> usize { self.neutrons }
32 crate fn count_electrons(&self) -> usize { self.electrons }
36 pub union Lithium { c1: usize, c2: u8 }
39 pub const CARBON: usize = 1;
40 pub static NITROGEN: usize = 2;
41 pub type Oxygen = bool;
43 macro_rules! define_empty_struct_with_visibility {
44 ($visibility: vis, $name: ident) => { $visibility struct $name {} }
46 define_empty_struct_with_visibility!(pub, Fluorine);
49 pub fn catalyze() -> bool;
52 // items leaked through signatures (see `get_neon` below) are OK
55 // crate-visible items are OK
56 crate struct Sodium {}
60 // module is public: these are OK, too
61 pub struct Magnesium {}
62 crate struct Aluminum {}
65 pub fn get_neon() -> private_mod::Neon {