Reexport -> re-export in error messages

This commit is contained in:
Carol (Nichols || Goulding) 2018-01-12 16:41:45 -05:00
parent c698496f84
commit 90fcd4476c
No known key found for this signature in database
GPG key ID: D04B39A6CA243902
18 changed files with 44 additions and 41 deletions

View file

@ -683,7 +683,7 @@ impl<'a> Resolver<'a> {
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 @@ impl<'a> Resolver<'a> {
}
} 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 {

View file

@ -1374,7 +1374,7 @@ arguments.
"##,
E0467: r##"
Macro reexport declarations were empty or malformed.
Macro re-export declarations were empty or malformed.
Erroneous code examples:
@ -1389,12 +1389,12 @@ extern crate core as other_macros_for_good;
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 @@ extern crate some_crate; //ok!
"##,
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 @@ exported from the given crate.
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:

View file

@ -2751,7 +2751,7 @@ impl<'a> Resolver<'a> {
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));
}

View file

@ -803,8 +803,9 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
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 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
&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 @@ impl<'a, 'b:'a> ImportResolver<'a, '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());