Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddle

Add/improve code comments

Working on something else and did some small comments updates/adds.

r? `@notriddle`
This commit is contained in:
Matthias Krüger 2023-06-27 07:01:32 +02:00 committed by GitHub
commit 3238a97d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -2371,7 +2371,7 @@ fn filter_tokens_from_list(
tokens 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: /// final reexport. For example:
/// ///
/// ```ignore (just an example) /// ```ignore (just an example)

View File

@ -956,6 +956,8 @@ pub(crate) trait AttributesExt {
.filter_map(|attr| Cfg::parse(attr.meta_item()?).ok()) .filter_map(|attr| Cfg::parse(attr.meta_item()?).ok())
.fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg) .fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg)
} else if doc_auto_cfg_active { } 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() self.iter()
.filter(|attr| attr.has_name(sym::cfg)) .filter(|attr| attr.has_name(sym::cfg))
.filter_map(|attr| single(attr.meta_item_list()?)) .filter_map(|attr| single(attr.meta_item_list()?))
@ -2387,6 +2389,7 @@ impl ImplKind {
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub(crate) struct Import { pub(crate) struct Import {
pub(crate) kind: ImportKind, pub(crate) kind: ImportKind,
/// The item being re-exported.
pub(crate) source: ImportSource, pub(crate) source: ImportSource,
pub(crate) should_be_displayed: bool, pub(crate) should_be_displayed: bool,
} }

View File

@ -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). // module will still be displayed (the re-export, not the item).
#![crate_name = "foo"] #![crate_name = "foo"]