]> git.lizzy.rs Git - rust.git/commitdiff
Reexport -> re-export in error messages
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Fri, 12 Jan 2018 21:41:45 +0000 (16:41 -0500)
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Mon, 15 Jan 2018 18:36:52 +0000 (13:36 -0500)
18 files changed:
src/librustc/lint/builtin.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/diagnostics.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/resolve_imports.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail-fulldeps/gated-macro-reexports.rs
src/test/compile-fail/E0365.rs
src/test/compile-fail/imports/reexports.rs
src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs
src/test/compile-fail/macro-reexport-malformed-1.rs
src/test/compile-fail/macro-reexport-malformed-2.rs
src/test/compile-fail/macro-reexport-malformed-3.rs
src/test/compile-fail/macro-reexport-undef.rs
src/test/compile-fail/privacy/legacy-ctor-visibility.rs
src/test/compile-fail/privacy/restricted/test.rs
src/test/compile-fail/private-variant-reexport.rs
src/test/compile-fail/pub-reexport-priv-extern-crate.rs

index 7410386c6f45b67f9fac90286149f5061571b45d..143d2c2ea28bba8361cdf48539715bb418d45d39 100644 (file)
 declare_lint! {
     pub PUB_USE_OF_PRIVATE_EXTERN_CRATE,
     Deny,
-    "detect public reexports of private extern crates"
+    "detect public re-exports of private extern crates"
 }
 
 declare_lint! {
index 10bd72ac4a00afb10912d2ef087e07b92f78b93e..c55bf395d71b3247b384ca990482f25dc41bdacf 100644 (file)
@@ -683,7 +683,7 @@ fn process_legacy_macro_imports(&mut self, item: &Item, module: Module<'a>, expa
                 let (def, vis) = (binding.def(), binding.vis);
                 self.macro_exports.push(Export { ident, def, vis, span, is_import: true });
             } else {
-                span_err!(self.session, span, E0470, "reexported macro not found");
+                span_err!(self.session, span, E0470, "re-exported macro not found");
             }
         }
         used
@@ -729,7 +729,7 @@ fn legacy_macro_imports(&mut self, attrs: &[ast::Attribute]) -> LegacyMacroImpor
                 }
             } else if attr.check_name("macro_reexport") {
                 let bad_macro_reexport = |this: &mut Self, span| {
-                    span_err!(this.session, span, E0467, "bad macro reexport");
+                    span_err!(this.session, span, E0467, "bad macro re-export");
                 };
                 if let Some(names) = attr.meta_item_list() {
                     for attr in names {
index 564626ac39885328089f8be721805ed6e8045981..3f0f1a1a4cb58ef2cd5c3e1fef2966955c3e5874 100644 (file)
@@ -1374,7 +1374,7 @@ macro_rules! get_pimientos {
 "##,
 
 E0467: r##"
-Macro reexport declarations were empty or malformed.
+Macro re-export declarations were empty or malformed.
 
 Erroneous code examples:
 
@@ -1389,12 +1389,12 @@ macro_rules! get_pimientos {
 This is a syntax error at the level of attribute declarations.
 
 Currently, `macro_reexport` requires at least one macro name to be listed.
-Unlike `macro_use`, listing no names does not reexport all macros from the
+Unlike `macro_use`, listing no names does not re-export all macros from the
 given crate.
 
 Decide which macros you would like to export and list them properly.
 
-These are proper reexport declarations:
+These are proper re-export declarations:
 
 ```ignore (cannot-doctest-multicrate-project)
 #[macro_reexport(some_macro, another_macro)]
@@ -1475,7 +1475,7 @@ macro_rules! drink {
 "##,
 
 E0470: r##"
-A macro listed for reexport was not found.
+A macro listed for re-export was not found.
 
 Erroneous code example:
 
@@ -1493,7 +1493,7 @@ fn main() {
 
 This could be caused by a typo. Did you misspell the macro's name?
 
-Double-check the names of the macros listed for reexport, and that the crate
+Double-check the names of the macros listed for re-export, and that the crate
 in question exports them.
 
 A working version:
index 0a29441cef7efdfe7395d53fcc41a47242101c15..3aedc840521665145472ba1ac061f00a9cef5c0b 100644 (file)
@@ -2751,7 +2751,7 @@ fn smart_resolve_path_fragment(&mut self,
                                 let lint = lint::builtin::LEGACY_CONSTRUCTOR_VISIBILITY;
                                 self.session.buffer_lint(lint, id, span,
                                     "private struct constructors are not usable through \
-                                     reexports in outer modules",
+                                     re-exports in outer modules",
                                 );
                                 res = Some(PathResolution::new(ctor_def));
                             }
index 132119e961bc377459d8af78f84872523c49a127..b5a949b30878ca7386832bdffa8b8bc8434661e0 100644 (file)
@@ -803,8 +803,9 @@ fn finalize_import(&mut self, directive: &'b ImportDirective<'b>) -> Option<(Spa
         if !any_successful_reexport {
             let (ns, binding) = reexport_error.unwrap();
             if ns == TypeNS && binding.is_extern_crate() {
-                let msg = format!("extern crate `{}` is private, and cannot be reexported \
-                                   (error E0365), consider declaring with `pub`",
+                let msg = format!("extern crate `{}` is private, and cannot be \
+                                   re-exported (error E0365), consider declaring with \
+                                   `pub`",
                                    ident);
                 self.session.buffer_lint(PUB_USE_OF_PRIVATE_EXTERN_CRATE,
                                          directive.id,
@@ -812,12 +813,12 @@ fn finalize_import(&mut self, directive: &'b ImportDirective<'b>) -> Option<(Spa
                                          &msg);
             } else if ns == TypeNS {
                 struct_span_err!(self.session, directive.span, E0365,
-                                 "`{}` is private, and cannot be reexported", ident)
-                    .span_label(directive.span, format!("reexport of private `{}`", ident))
+                                 "`{}` is private, and cannot be re-exported", ident)
+                    .span_label(directive.span, format!("re-export of private `{}`", ident))
                     .note(&format!("consider declaring type or module `{}` with `pub`", ident))
                     .emit();
             } else {
-                let msg = format!("`{}` is private, and cannot be reexported", ident);
+                let msg = format!("`{}` is private, and cannot be re-exported", ident);
                 let note_msg =
                     format!("consider marking `{}` as `pub` in the imported module", ident);
                 struct_span_err!(self.session, directive.span, E0364, "{}", &msg)
@@ -932,12 +933,12 @@ fn finalize_resolutions_in(&mut self, module: Module<'b>) {
                         !orig_binding.vis.is_at_least(binding.vis, &*self) {
                             let msg = match directive.subclass {
                                 ImportDirectiveSubclass::SingleImport { .. } => {
-                                    format!("variant `{}` is private and cannot be reexported",
+                                    format!("variant `{}` is private and cannot be re-exported",
                                             ident)
                                 },
                                 ImportDirectiveSubclass::GlobImport { .. } => {
                                     let msg = "enum is private and its variants \
-                                               cannot be reexported".to_owned();
+                                               cannot be re-exported".to_owned();
                                     let error_id = (DiagnosticMessageId::ErrorId(0), // no code?!
                                                     Some(binding.span),
                                                     msg.clone());
index 196fadcc997f5b954384d17e1584a7b33589e01d..fb0ef2ea730a7e39d1c977e00f2a1c564db3562c 100644 (file)
@@ -1479,7 +1479,7 @@ fn visit_item(&mut self, i: &'a ast::Item) {
             ast::ItemKind::ExternCrate(_) => {
                 if let Some(attr) = attr::find_by_name(&i.attrs[..], "macro_reexport") {
                     gate_feature_post!(&self, macro_reexport, attr.span,
-                                       "macros reexports are experimental \
+                                       "macros re-exports are experimental \
                                         and possibly buggy");
                 }
             }
index 2a20c28cfb871f5abac1973d6edbfc906647a7ed..c11f4356176a60fe05d860bd3bcc5c73023698be 100644 (file)
@@ -16,6 +16,6 @@
 #![crate_type = "dylib"]
 
 #[macro_reexport(reexported)]
-//~^ ERROR macros reexports are experimental and possibly buggy
+//~^ ERROR macros re-exports are experimental and possibly buggy
 #[macro_use] #[no_link]
 extern crate macro_reexport_1;
index a1efcde42b05bdc9054a75624c2ecf2cf06827f4..18a72b0ff9a55a70361236962013d25030088914 100644 (file)
@@ -13,6 +13,6 @@ mod foo {
 }
 
 pub use foo as foo2;
-//~^ ERROR `foo` is private, and cannot be reexported [E0365]
+//~^ ERROR `foo` is private, and cannot be re-exported [E0365]
 
 fn main() {}
index 65e6e8d01b05f119c6bd6de43eb287c5ed4df57c..f50b5b0e849992ed3bb0c12e21d24d6325bf3e3d 100644 (file)
@@ -13,7 +13,7 @@ fn foo() {}
     mod foo {}
 
     mod a {
-        pub use super::foo; //~ ERROR cannot be reexported
+        pub use super::foo; //~ ERROR cannot be re-exported
         pub use super::*; //~ ERROR must import something with the glob's visibility
     }
 }
@@ -24,17 +24,17 @@ pub fn foo() {}
 
     pub mod a {
         pub use super::foo; // This is OK since the value `foo` is visible enough.
-        fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` reexported).
+        fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` re-exported).
     }
 
     pub mod b {
         pub use super::*; // This is also OK since the value `foo` is visible enough.
-        fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` reexported).
+        fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` re-exported).
     }
 }
 
 mod c {
-    // Test that `foo` is not reexported.
+    // Test that `foo` is not re-exported.
     use b::a::foo::S; //~ ERROR `foo`
     use b::b::foo::S as T; //~ ERROR `foo`
 }
index 5b23e5e815053467be7ce0150b11917460e587a0..f5a20dd96dc902d354c33449dfdfad2dec6178df 100644 (file)
 
 mod rank {
     pub use self::Professor::*;
-    //~^ ERROR enum is private and its variants cannot be reexported
+    //~^ ERROR enum is private and its variants cannot be re-exported
     pub use self::Lieutenant::{JuniorGrade, Full};
-    //~^ ERROR variant `JuniorGrade` is private and cannot be reexported
-    //~| ERROR variant `Full` is private and cannot be reexported
+    //~^ ERROR variant `JuniorGrade` is private and cannot be re-exported
+    //~| ERROR variant `Full` is private and cannot be re-exported
     pub use self::PettyOfficer::*;
-    //~^ ERROR enum is private and its variants cannot be reexported
+    //~^ ERROR enum is private and its variants cannot be re-exported
     pub use self::Crewman::*;
-    //~^ ERROR enum is private and its variants cannot be reexported
+    //~^ ERROR enum is private and its variants cannot be re-exported
 
     enum Professor {
         Adjunct,
index a2778a831306bbb7a5ec6c54c588788f0a7ee391..36a6fce00a13a05f9e6b20607ba30e727ee1606e 100644 (file)
@@ -12,5 +12,5 @@
 #![feature(macro_reexport)]
 
 #[allow(unused_extern_crates)]
-#[macro_reexport]  //~ ERROR bad macro reexport
+#[macro_reexport]  //~ ERROR bad macro re-export
 extern crate std;
index c5af9e3799de77bc3d1e0b379dd85e344d394dc8..5f741d010de806e0d4910ad5b5887988f8e5d007 100644 (file)
@@ -12,5 +12,5 @@
 #![feature(macro_reexport)]
 
 #[allow(unused_extern_crates)]
-#[macro_reexport="foo"]  //~ ERROR bad macro reexport
+#[macro_reexport="foo"]  //~ ERROR bad macro re-export
 extern crate std;
index d72d1ee004ef77ce09923c960fa8fc0f1c0713d8..1a7e3b918cd966d53b8d68230f1f89556ce74a8c 100644 (file)
@@ -12,5 +12,5 @@
 #![feature(macro_reexport)]
 
 #[allow(unused_extern_crates)]
-#[macro_reexport(foo="bar")]  //~ ERROR bad macro reexport
+#[macro_reexport(foo="bar")]  //~ ERROR bad macro re-export
 extern crate std;
index 5bb0b8759f486c4d0407bc6e750269355be36aa2..50ac89e49e08ffab0b0f3590eee6f0bcd66e7c9b 100644 (file)
@@ -13,7 +13,7 @@
 #![feature(macro_reexport)]
 
 #[macro_use(macro_two)]
-#[macro_reexport(no_way)] //~ ERROR reexported macro not found
+#[macro_reexport(no_way)] //~ ERROR re-exported macro not found
 extern crate two_macros;
 
 pub fn main() {
index fb65af230ace5cf05eaeb02574a83c06bd81b748..95144916fd7852046e6132751c8de6dcc58494e7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-tidy-linelength
+
 #![allow(unused)]
 
 use m::S;
@@ -19,7 +21,7 @@ mod n {
         use S;
         fn f() {
             S(10);
-            //~^ ERROR private struct constructors are not usable through reexports in outer modules
+            //~^ ERROR private struct constructors are not usable through re-exports in outer modules
             //~| WARN this was previously accepted
         }
     }
index 7f076ebf287e2dcd89ccc82db647e7682eb92d08..8c1d609e2446725e28259fe87fcd1f6e8b8b65a8 100644 (file)
@@ -28,7 +28,7 @@ pub(super) fn g() {}
     fn f() {
         use foo::bar::S;
         pub(self) use foo::bar::f; // ok
-        pub(super) use foo::bar::f as g; //~ ERROR cannot be reexported
+        pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported
         S::default().x; // ok
         S::default().f(); // ok
         S::g(); // ok
index 1280aba3076abbb3654f79619cbeadff461c64a2..5d770f88155ec9f03f8b24d27d1802d2554b0b21 100644 (file)
@@ -9,19 +9,19 @@
 // except according to those terms.
 
 mod m1 {
-    pub use ::E::V; //~ ERROR variant `V` is private and cannot be reexported
+    pub use ::E::V; //~ ERROR variant `V` is private and cannot be re-exported
 }
 
 mod m2 {
-    pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be reexported
+    pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be re-exported
 }
 
 mod m3 {
-    pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be reexported
+    pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be re-exported
 }
 
 mod m4 {
-    pub use ::E::*; //~ ERROR enum is private and its variants cannot be reexported
+    pub use ::E::*; //~ ERROR enum is private and its variants cannot be re-exported
 }
 
 enum E { V }
index 5479be54533e033b96b23053e20754021e803d9f..2e71e007e9eed6f011eab933fd34d33ba47c4f93 100644 (file)
@@ -11,7 +11,7 @@
 #![allow(unused)]
 
 extern crate core;
-pub use core as reexported_core; //~ ERROR `core` is private, and cannot be reexported
+pub use core as reexported_core; //~ ERROR `core` is private, and cannot be re-exported
                                  //~^ WARN this was previously accepted
 
 mod foo1 {
@@ -19,7 +19,7 @@ mod foo1 {
 }
 
 mod foo2 {
-    use foo1::core; //~ ERROR `core` is private, and cannot be reexported
+    use foo1::core; //~ ERROR `core` is private, and cannot be re-exported
                     //~^ WARN this was previously accepted
     pub mod bar {
         extern crate core;
@@ -27,7 +27,7 @@ pub mod bar {
 }
 
 mod baz {
-    pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be reexported
+    pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be re-exported
                              //~^ WARN this was previously accepted
 }