Skip to content

Commit c98cbb5

Browse files
committed
alter wording, fix formatting issues
1 parent e3c7798 commit c98cbb5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ http://doc.rust-lang.org/reference.html#types
200200
"##,
201201

202202
E0364: r##"
203-
Private items cannot be publicly re-exported. This error indicates
204-
that you attempted to write a `pub use` against a type or value that was
205-
not itself public.
203+
Private items cannot be publicly re-exported. This error indicates that
204+
you attempted to `pub use` a type or value that was not itself public.
206205
207206
Here is an example that demonstrates the error:
208207
@@ -231,8 +230,7 @@ http://doc.rust-lang.org/reference.html#use-declarations
231230

232231
E0365: r##"
233232
Private modules cannot be publicly re-exported. This error indicates
234-
that you attempted to write a `pub use` against a module that was
235-
not itself public.
233+
that you attempted to `pub use` a module that was not itself public.
236234
237235
Here is an example that demonstrates the error:
238236

src/librustc_resolve/resolve_imports.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,11 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
431431
value_result = BoundResult(target_module.clone(),
432432
(*child_name_bindings).clone());
433433
if directive.is_public && !child_name_bindings.is_public(ValueNS) {
434-
let msg = format!("`{}` is private, and cannot be reexported", token::get_name(source));
435-
let note_msg = format!("Consider marking `{}` as pub in the imported module",
436-
token::get_name(source));
434+
let msg = format!("`{}` is private, and cannot be reexported",
435+
token::get_name(source));
436+
let note_msg =
437+
format!("Consider marking `{}` as `pub` in the imported module",
438+
token::get_name(source));
437439
span_err!(self.resolver.session, directive.span, E0364, "{}", &msg);
438440
self.resolver.session.span_note(directive.span, &note_msg);
439441
pub_err = true;
@@ -444,9 +446,10 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
444446
type_result = BoundResult(target_module.clone(),
445447
(*child_name_bindings).clone());
446448
if !pub_err && directive.is_public && !child_name_bindings.is_public(TypeNS) {
447-
let msg = format!("`{}` is private, and cannot be reexported", token::get_name(source));
448-
let note_msg = format!("Consider changing module {} so that it is declared as `pub mod`",
449-
token::get_name(source));
449+
let msg = format!("`{}` is private, and cannot be reexported",
450+
token::get_name(source));
451+
let note_msg = format!("Consider declaring module {} as `pub mod`",
452+
token::get_name(source));
450453
span_err!(self.resolver.session, directive.span, E0365, "{}", &msg);
451454
self.resolver.session.span_note(directive.span, &note_msg);
452455
}

0 commit comments

Comments
 (0)