1
Fork 0

Convert uses of BuiltinLintDiag::Normal to custom variants

This ensures all diagnostic messages are created at diagnostic emission
time, making them translatable.
This commit is contained in:
Xiretza 2024-04-14 20:11:14 +00:00
parent 41a20b4c56
commit b7abf014ec
20 changed files with 295 additions and 173 deletions

View file

@ -1246,16 +1246,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
if !any_successful_reexport {
let (ns, binding) = reexport_error.unwrap();
if pub_use_of_private_extern_crate_hack(import, binding) {
let msg = format!(
"extern crate `{ident}` is private, and cannot be \
re-exported (error E0365), consider declaring with \
`pub`"
);
self.lint_buffer.buffer_lint(
self.lint_buffer.buffer_lint_with_diagnostic(
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
import_id,
import.span,
msg,
BuiltinLintDiag::PrivateExternCrateReexport(ident),
);
} else {
if ns == TypeNS {