1
Fork 0

Add warn-by-default lint for local binding shadowing exported glob re-export item

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2023-05-09 07:15:46 +08:00
parent 1a5f8bce74
commit b9606589c4
No known key found for this signature in database
GPG key ID: C5FD5D32014FDB47
12 changed files with 207 additions and 27 deletions

View file

@ -952,6 +952,10 @@ pub trait LintContext: Sized {
db.span_label(first_reexport_span, format!("the name `{}` in the {} namespace is first re-exported here", name, namespace));
db.span_label(duplicate_reexport_span, format!("but the name `{}` in the {} namespace is also re-exported here", name, namespace));
}
BuiltinLintDiagnostics::HiddenGlobReexports { name, namespace, glob_reexport_span, private_item_span } => {
db.span_label(glob_reexport_span, format!("the name `{}` in the {} namespace is supposed to be publicly re-exported here", name, namespace));
db.span_label(private_item_span, "but the private item here shadows it");
}
}
// Rewrap `db`, and pass control to the user.
decorate(db)