]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/lint/unreachable_pub-pub_crate.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / lint / unreachable_pub-pub_crate.rs
index 27b437b22eb032050ab7d608e6fbd77a5da9adf6..94f79d69751f12f2c4e07e5176d8d846bbde9e3b 100644 (file)
@@ -4,44 +4,45 @@
 // suggestions to use `crate` given when it is on). When that feature becomes
 // stable, this test can be deleted.
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 
-#![allow(unused)]
 #![warn(unreachable_pub)]
 
 mod private_mod {
     // non-leaked `pub` items in private module should be linted
-    pub use std::fmt;
+    pub use std::fmt; //~ WARNING unreachable_pub
     pub use std::env::{Args}; // braced-use has different item spans than unbraced
+    //~^ WARNING unreachable_pub
 
-    pub struct Hydrogen {
+    pub struct Hydrogen { //~ WARNING unreachable_pub
         // `pub` struct fields, too
-        pub neutrons: usize,
+        pub neutrons: usize, //~ WARNING unreachable_pub
         // (... but not more-restricted fields)
         pub(crate) electrons: usize
     }
     impl Hydrogen {
         // impls, too
-        pub fn count_neutrons(&self) -> usize { self.neutrons }
+        pub fn count_neutrons(&self) -> usize { self.neutrons } //~ WARNING unreachable_pub
         pub(crate) fn count_electrons(&self) -> usize { self.electrons }
     }
 
-    pub enum Helium {}
-    pub union Lithium { c1: usize, c2: u8 }
-    pub fn beryllium() {}
-    pub trait Boron {}
-    pub const CARBON: usize = 1;
-    pub static NITROGEN: usize = 2;
-    pub type Oxygen = bool;
+    pub enum Helium {} //~ WARNING unreachable_pub
+    pub union Lithium { c1: usize, c2: u8 } //~ WARNING unreachable_pub
+    pub fn beryllium() {} //~ WARNING unreachable_pub
+    pub trait Boron {} //~ WARNING unreachable_pub
+    pub const CARBON: usize = 1; //~ WARNING unreachable_pub
+    pub static NITROGEN: usize = 2; //~ WARNING unreachable_pub
+    pub type Oxygen = bool; //~ WARNING unreachable_pub
 
     macro_rules! define_empty_struct_with_visibility {
         ($visibility: vis, $name: ident) => { $visibility struct $name {} }
+        //~^ WARNING unreachable_pub
     }
     define_empty_struct_with_visibility!(pub, Fluorine);
 
     extern {
-        pub fn catalyze() -> bool;
+        pub fn catalyze() -> bool; //~ WARNING unreachable_pub
     }
 
     // items leaked through signatures (see `get_neon` below) are OK