Skip to content

Commit 2e63708

Browse files
Improve code comments
1 parent 632f2cb commit 2e63708

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustdoc/clean/types.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute>
10841084

10851085
let mut changed_auto_active_status = None;
10861086

1087-
// First we get all `doc(auto_cfg)` attributes.
1087+
// We get all `doc(auto_cfg)`, `cfg` and `target_feature` attributes.
10881088
for attr in attrs {
10891089
if let Some(ident) = attr.ident()
10901090
&& ident.name == sym::doc
@@ -1146,11 +1146,9 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute>
11461146
}
11471147
}
11481148
}
1149-
// If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because
1150-
// `doc(cfg())` overrides `cfg()`).
11511149
} else if let hir::Attribute::Parsed(AttributeKind::TargetFeature { features, .. }) = attr {
1152-
// treat #[target_feature(enable = "feat")] attributes as if they were
1153-
// #[doc(cfg(target_feature = "feat"))] attributes as well
1150+
// Treat `#[target_feature(enable = "feat")]` attributes as if they were
1151+
// `#[doc(cfg(target_feature = "feat"))]` attributes as well.
11541152
for (feature, _) in features {
11551153
cfg_info.current_cfg &= Cfg::Cfg(sym::target_feature, Some(*feature));
11561154
}

0 commit comments

Comments
 (0)