source);
self.session.add_lint(PRIVATE_IN_PUBLIC, directive.id, directive.span, msg);
} else {
- let msg = format!("`{}` is private, and cannot be reexported", source);
- let note_msg =
- format!("consider declaring type or module `{}` with `pub`", source);
- struct_span_err!(self.session, directive.span, E0365, "{}", &msg)
- .span_note(directive.span, ¬e_msg)
- .emit();
+ let mut err = struct_span_err!(self.session, directive.span, E0365,
+ "`{}` is private, and cannot be reexported",
+ source);
+ err.span_label(directive.span, &format!("reexport of private `{}`", source));
+ err.note(&format!("consider declaring type or module `{}` with `pub`", source));
+ err.emit();
}
}
pub const X: u32 = 1;
}
-pub use foo as foo2; //~ ERROR E0365
+pub use foo as foo2;
+//~^ ERROR `foo` is private, and cannot be reexported [E0365]
+//~| NOTE reexport of private `foo`
+//~| NOTE consider declaring type or module `foo` with `pub`
fn main() {}