Add/improve code comments
This commit is contained in:
parent
0979bf7413
commit
32f056ce6b
@ -2377,7 +2377,7 @@ fn filter_tokens_from_list(
|
||||
tokens
|
||||
}
|
||||
|
||||
/// When inlining items, we merge its attributes (and all the reexports attributes too) with the
|
||||
/// When inlining items, we merge their attributes (and all the reexports attributes too) with the
|
||||
/// final reexport. For example:
|
||||
///
|
||||
/// ```ignore (just an example)
|
||||
|
@ -956,6 +956,8 @@ fn single<T: IntoIterator>(it: T) -> Option<T::Item> {
|
||||
.filter_map(|attr| Cfg::parse(attr.meta_item()?).ok())
|
||||
.fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg)
|
||||
} else if doc_auto_cfg_active {
|
||||
// If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because
|
||||
// `doc(cfg())` overrides `cfg()`).
|
||||
self.iter()
|
||||
.filter(|attr| attr.has_name(sym::cfg))
|
||||
.filter_map(|attr| single(attr.meta_item_list()?))
|
||||
@ -2387,6 +2389,7 @@ pub(crate) fn as_blanket_ty(&self) -> Option<&Type> {
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct Import {
|
||||
pub(crate) kind: ImportKind,
|
||||
/// The item being re-exported.
|
||||
pub(crate) source: ImportSource,
|
||||
pub(crate) should_be_displayed: bool,
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
|
||||
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
|
||||
// module will still be displayed (the re-export, not the item).
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
Loading…
Reference in New Issue
Block a user