-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rustc_lint::builtin::has_doc #7247
Comments
This is still not the same behavior of fn has_doc(sess: &Session, attr: &ast::Attribute) -> bool {
if attr.is_doc_comment() {
return true;
}
if !sess.check_name(attr, sym::doc) {
return false;
}
if attr.value_str().is_some() {
return true;
}
if let Some(list) = attr.meta_item_list() {
for meta in list {
if meta.has_name(sym::hidden) {
return true;
}
}
}
false
} Seems not great for them to be inconsistent. |
Hmm, I take it back, clippy just checks for Also, I suspect clippy has the same bug as rustdoc when items under a hidden module are re-exported: rust-lang/rust#59368 |
I'm not sure if there is something actionable here? Maybe there is still room for sharing code but it seems insignificant. I don't know how that bug would apply to the Clippy lint. |
@camsteffen here is how I think the false negative would show up: #[doc(hidden)]
pub mod inner {
pub struct MissingDocs;
}
pub use inner::MissingDocs; // should warn about an undocumented struct, but does not. It doesn't matter until the rustdoc bug is fixed, though. |
See rust-lang/rust#85457 (comment)
The text was updated successfully, but these errors were encountered: