Skip to content

Commit 90fcd44

Browse files
committed
Reexport -> re-export in error messages
1 parent c698496 commit 90fcd44

18 files changed

+44
-41
lines changed

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ declare_lint! {
127127
declare_lint! {
128128
pub PUB_USE_OF_PRIVATE_EXTERN_CRATE,
129129
Deny,
130-
"detect public reexports of private extern crates"
130+
"detect public re-exports of private extern crates"
131131
}
132132

133133
declare_lint! {

src/librustc_resolve/build_reduced_graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ impl<'a> Resolver<'a> {
683683
let (def, vis) = (binding.def(), binding.vis);
684684
self.macro_exports.push(Export { ident, def, vis, span, is_import: true });
685685
} else {
686-
span_err!(self.session, span, E0470, "reexported macro not found");
686+
span_err!(self.session, span, E0470, "re-exported macro not found");
687687
}
688688
}
689689
used
@@ -729,7 +729,7 @@ impl<'a> Resolver<'a> {
729729
}
730730
} else if attr.check_name("macro_reexport") {
731731
let bad_macro_reexport = |this: &mut Self, span| {
732-
span_err!(this.session, span, E0467, "bad macro reexport");
732+
span_err!(this.session, span, E0467, "bad macro re-export");
733733
};
734734
if let Some(names) = attr.meta_item_list() {
735735
for attr in names {

src/librustc_resolve/diagnostics.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ arguments.
13741374
"##,
13751375

13761376
E0467: r##"
1377-
Macro reexport declarations were empty or malformed.
1377+
Macro re-export declarations were empty or malformed.
13781378
13791379
Erroneous code examples:
13801380
@@ -1389,12 +1389,12 @@ extern crate core as other_macros_for_good;
13891389
This is a syntax error at the level of attribute declarations.
13901390
13911391
Currently, `macro_reexport` requires at least one macro name to be listed.
1392-
Unlike `macro_use`, listing no names does not reexport all macros from the
1392+
Unlike `macro_use`, listing no names does not re-export all macros from the
13931393
given crate.
13941394
13951395
Decide which macros you would like to export and list them properly.
13961396
1397-
These are proper reexport declarations:
1397+
These are proper re-export declarations:
13981398
13991399
```ignore (cannot-doctest-multicrate-project)
14001400
#[macro_reexport(some_macro, another_macro)]
@@ -1475,7 +1475,7 @@ extern crate some_crate; //ok!
14751475
"##,
14761476

14771477
E0470: r##"
1478-
A macro listed for reexport was not found.
1478+
A macro listed for re-export was not found.
14791479
14801480
Erroneous code example:
14811481
@@ -1493,7 +1493,7 @@ exported from the given crate.
14931493
14941494
This could be caused by a typo. Did you misspell the macro's name?
14951495
1496-
Double-check the names of the macros listed for reexport, and that the crate
1496+
Double-check the names of the macros listed for re-export, and that the crate
14971497
in question exports them.
14981498
14991499
A working version:

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ impl<'a> Resolver<'a> {
27512751
let lint = lint::builtin::LEGACY_CONSTRUCTOR_VISIBILITY;
27522752
self.session.buffer_lint(lint, id, span,
27532753
"private struct constructors are not usable through \
2754-
reexports in outer modules",
2754+
re-exports in outer modules",
27552755
);
27562756
res = Some(PathResolution::new(ctor_def));
27572757
}

src/librustc_resolve/resolve_imports.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -803,21 +803,22 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
803803
if !any_successful_reexport {
804804
let (ns, binding) = reexport_error.unwrap();
805805
if ns == TypeNS && binding.is_extern_crate() {
806-
let msg = format!("extern crate `{}` is private, and cannot be reexported \
807-
(error E0365), consider declaring with `pub`",
806+
let msg = format!("extern crate `{}` is private, and cannot be \
807+
re-exported (error E0365), consider declaring with \
808+
`pub`",
808809
ident);
809810
self.session.buffer_lint(PUB_USE_OF_PRIVATE_EXTERN_CRATE,
810811
directive.id,
811812
directive.span,
812813
&msg);
813814
} else if ns == TypeNS {
814815
struct_span_err!(self.session, directive.span, E0365,
815-
"`{}` is private, and cannot be reexported", ident)
816-
.span_label(directive.span, format!("reexport of private `{}`", ident))
816+
"`{}` is private, and cannot be re-exported", ident)
817+
.span_label(directive.span, format!("re-export of private `{}`", ident))
817818
.note(&format!("consider declaring type or module `{}` with `pub`", ident))
818819
.emit();
819820
} else {
820-
let msg = format!("`{}` is private, and cannot be reexported", ident);
821+
let msg = format!("`{}` is private, and cannot be re-exported", ident);
821822
let note_msg =
822823
format!("consider marking `{}` as `pub` in the imported module", ident);
823824
struct_span_err!(self.session, directive.span, E0364, "{}", &msg)
@@ -932,12 +933,12 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
932933
!orig_binding.vis.is_at_least(binding.vis, &*self) {
933934
let msg = match directive.subclass {
934935
ImportDirectiveSubclass::SingleImport { .. } => {
935-
format!("variant `{}` is private and cannot be reexported",
936+
format!("variant `{}` is private and cannot be re-exported",
936937
ident)
937938
},
938939
ImportDirectiveSubclass::GlobImport { .. } => {
939940
let msg = "enum is private and its variants \
940-
cannot be reexported".to_owned();
941+
cannot be re-exported".to_owned();
941942
let error_id = (DiagnosticMessageId::ErrorId(0), // no code?!
942943
Some(binding.span),
943944
msg.clone());

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
14791479
ast::ItemKind::ExternCrate(_) => {
14801480
if let Some(attr) = attr::find_by_name(&i.attrs[..], "macro_reexport") {
14811481
gate_feature_post!(&self, macro_reexport, attr.span,
1482-
"macros reexports are experimental \
1482+
"macros re-exports are experimental \
14831483
and possibly buggy");
14841484
}
14851485
}

src/test/compile-fail-fulldeps/gated-macro-reexports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
#![crate_type = "dylib"]
1717

1818
#[macro_reexport(reexported)]
19-
//~^ ERROR macros reexports are experimental and possibly buggy
19+
//~^ ERROR macros re-exports are experimental and possibly buggy
2020
#[macro_use] #[no_link]
2121
extern crate macro_reexport_1;

src/test/compile-fail/E0365.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ mod foo {
1313
}
1414

1515
pub use foo as foo2;
16-
//~^ ERROR `foo` is private, and cannot be reexported [E0365]
16+
//~^ ERROR `foo` is private, and cannot be re-exported [E0365]
1717

1818
fn main() {}

src/test/compile-fail/imports/reexports.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod a {
1313
mod foo {}
1414

1515
mod a {
16-
pub use super::foo; //~ ERROR cannot be reexported
16+
pub use super::foo; //~ ERROR cannot be re-exported
1717
pub use super::*; //~ ERROR must import something with the glob's visibility
1818
}
1919
}
@@ -24,17 +24,17 @@ mod b {
2424

2525
pub mod a {
2626
pub use super::foo; // This is OK since the value `foo` is visible enough.
27-
fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` reexported).
27+
fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` re-exported).
2828
}
2929

3030
pub mod b {
3131
pub use super::*; // This is also OK since the value `foo` is visible enough.
32-
fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` reexported).
32+
fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` re-exported).
3333
}
3434
}
3535

3636
mod c {
37-
// Test that `foo` is not reexported.
37+
// Test that `foo` is not re-exported.
3838
use b::a::foo::S; //~ ERROR `foo`
3939
use b::b::foo::S as T; //~ ERROR `foo`
4040
}

src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
mod rank {
1414
pub use self::Professor::*;
15-
//~^ ERROR enum is private and its variants cannot be reexported
15+
//~^ ERROR enum is private and its variants cannot be re-exported
1616
pub use self::Lieutenant::{JuniorGrade, Full};
17-
//~^ ERROR variant `JuniorGrade` is private and cannot be reexported
18-
//~| ERROR variant `Full` is private and cannot be reexported
17+
//~^ ERROR variant `JuniorGrade` is private and cannot be re-exported
18+
//~| ERROR variant `Full` is private and cannot be re-exported
1919
pub use self::PettyOfficer::*;
20-
//~^ ERROR enum is private and its variants cannot be reexported
20+
//~^ ERROR enum is private and its variants cannot be re-exported
2121
pub use self::Crewman::*;
22-
//~^ ERROR enum is private and its variants cannot be reexported
22+
//~^ ERROR enum is private and its variants cannot be re-exported
2323

2424
enum Professor {
2525
Adjunct,

src/test/compile-fail/macro-reexport-malformed-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
#![feature(macro_reexport)]
1313

1414
#[allow(unused_extern_crates)]
15-
#[macro_reexport] //~ ERROR bad macro reexport
15+
#[macro_reexport] //~ ERROR bad macro re-export
1616
extern crate std;

src/test/compile-fail/macro-reexport-malformed-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
#![feature(macro_reexport)]
1313

1414
#[allow(unused_extern_crates)]
15-
#[macro_reexport="foo"] //~ ERROR bad macro reexport
15+
#[macro_reexport="foo"] //~ ERROR bad macro re-export
1616
extern crate std;

src/test/compile-fail/macro-reexport-malformed-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
#![feature(macro_reexport)]
1313

1414
#[allow(unused_extern_crates)]
15-
#[macro_reexport(foo="bar")] //~ ERROR bad macro reexport
15+
#[macro_reexport(foo="bar")] //~ ERROR bad macro re-export
1616
extern crate std;

src/test/compile-fail/macro-reexport-undef.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(macro_reexport)]
1414

1515
#[macro_use(macro_two)]
16-
#[macro_reexport(no_way)] //~ ERROR reexported macro not found
16+
#[macro_reexport(no_way)] //~ ERROR re-exported macro not found
1717
extern crate two_macros;
1818

1919
pub fn main() {

src/test/compile-fail/privacy/legacy-ctor-visibility.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-tidy-linelength
12+
1113
#![allow(unused)]
1214

1315
use m::S;
@@ -19,7 +21,7 @@ mod m {
1921
use S;
2022
fn f() {
2123
S(10);
22-
//~^ ERROR private struct constructors are not usable through reexports in outer modules
24+
//~^ ERROR private struct constructors are not usable through re-exports in outer modules
2325
//~| WARN this was previously accepted
2426
}
2527
}

src/test/compile-fail/privacy/restricted/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod foo {
2828
fn f() {
2929
use foo::bar::S;
3030
pub(self) use foo::bar::f; // ok
31-
pub(super) use foo::bar::f as g; //~ ERROR cannot be reexported
31+
pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported
3232
S::default().x; // ok
3333
S::default().f(); // ok
3434
S::g(); // ok

src/test/compile-fail/private-variant-reexport.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
// except according to those terms.
1010

1111
mod m1 {
12-
pub use ::E::V; //~ ERROR variant `V` is private and cannot be reexported
12+
pub use ::E::V; //~ ERROR variant `V` is private and cannot be re-exported
1313
}
1414

1515
mod m2 {
16-
pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be reexported
16+
pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be re-exported
1717
}
1818

1919
mod m3 {
20-
pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be reexported
20+
pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be re-exported
2121
}
2222

2323
mod m4 {
24-
pub use ::E::*; //~ ERROR enum is private and its variants cannot be reexported
24+
pub use ::E::*; //~ ERROR enum is private and its variants cannot be re-exported
2525
}
2626

2727
enum E { V }

src/test/compile-fail/pub-reexport-priv-extern-crate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
#![allow(unused)]
1212

1313
extern crate core;
14-
pub use core as reexported_core; //~ ERROR `core` is private, and cannot be reexported
14+
pub use core as reexported_core; //~ ERROR `core` is private, and cannot be re-exported
1515
//~^ WARN this was previously accepted
1616

1717
mod foo1 {
1818
extern crate core;
1919
}
2020

2121
mod foo2 {
22-
use foo1::core; //~ ERROR `core` is private, and cannot be reexported
22+
use foo1::core; //~ ERROR `core` is private, and cannot be re-exported
2323
//~^ WARN this was previously accepted
2424
pub mod bar {
2525
extern crate core;
2626
}
2727
}
2828

2929
mod baz {
30-
pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be reexported
30+
pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be re-exported
3131
//~^ WARN this was previously accepted
3232
}
3333

0 commit comments

Comments
 (0)