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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 7 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 5 additions & 5 deletions
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,

0 commit comments

Comments
 (0)