Skip to content

Commit 32f056c

Browse files
Add/improve code comments
1 parent 0979bf7 commit 32f056c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,7 @@ fn filter_tokens_from_list(
23772377
tokens
23782378
}
23792379

2380-
/// When inlining items, we merge its attributes (and all the reexports attributes too) with the
2380+
/// When inlining items, we merge their attributes (and all the reexports attributes too) with the
23812381
/// final reexport. For example:
23822382
///
23832383
/// ```ignore (just an example)

src/librustdoc/clean/types.rs

+3
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,8 @@ pub(crate) trait AttributesExt {
956956
.filter_map(|attr| Cfg::parse(attr.meta_item()?).ok())
957957
.fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg)
958958
} else if doc_auto_cfg_active {
959+
// If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because
960+
// `doc(cfg())` overrides `cfg()`).
959961
self.iter()
960962
.filter(|attr| attr.has_name(sym::cfg))
961963
.filter_map(|attr| single(attr.meta_item_list()?))
@@ -2387,6 +2389,7 @@ impl ImplKind {
23872389
#[derive(Clone, Debug)]
23882390
pub(crate) struct Import {
23892391
pub(crate) kind: ImportKind,
2392+
/// The item being re-exported.
23902393
pub(crate) source: ImportSource,
23912394
pub(crate) should_be_displayed: bool,
23922395
}

tests/rustdoc/reexport-doc-hidden-inside-private.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
1+
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
22
// module will still be displayed (the re-export, not the item).
33

44
#![crate_name = "foo"]

0 commit comments

Comments
 (0)