Open
Description
For example, uncommenting the #[doc(hidden)]
line is a breaking change since the struct is no longer considered public API, even though it is public. This is because some non-public API may need to be accessible from outside its crate, for example in macro-heavy crates like pyo3
.
// #[doc(hidden)]
pub struct Example;
We need lints for this kind of situation for:
- structs: implement struct_now_doc_hidden lint #587
- enums: implement enum_now_doc_hidden lint #593
- unions: rule: add
union_now_doc_hidden
#679 - functions: implement function_now_doc_hidden lint #594
- traits: implement trait_now_doc_hidden lint #595
- statics: Add lint pub_static_now_doc_hidden #712
- module-level constants: Added lint public_module_level_constant_now_doc_hidden #690, Rename new lint to
pub_module_level_const_now_doc_hidden
. #703 -
ImplOwner
(struct/enum/union) inherent associated functions / methods: Inherent method now doc hidden #821 -
ImplOwner
associated constants: Added inherent_associated_const_now_doc_hidden #820 - struct fields (Add lint for pub field becoming doc(hidden) #649)
- union fields (Add union pub field now doc hidden lint #844)
- enum variants #596
- enum tuple variant fields: Added lint enum_tuple_variant_field_now_doc_hidden #685
- enum struct variant fields: Added lint enum_struct_variant_field_now_doc_hidden #687
- trait associated functions / methods: add trait_method_now_doc_hidden lint #684
- trait associated types: Added lint trait_associated_type_now_doc_hidden #776
- trait associated constants: Added lint trait_associated_const_now_doc_hidden #779
- macros (declarative, proc macro, etc.), tracked in detail by New lints: Breaking changes in macros #946
Remaining work item
We should figure out what are the appropriate semantics of marking an impl
block #[doc(hidden)]
with respect to the block's contents. Are the contents considered not public API anymore? Is #[doc(hidden)]
simply ignored on that impl
block?
The action items here are:
- Figure out how
rustdoc
itself treats items defined inside a#[doc(hidden)]
impl block. Does it think they are hidden, or no? - Adjust all affected lints accordingly (e.g. Added inherent_associated_const_now_doc_hidden #820, Inherent method now doc hidden #821)