diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-09-29 13:43:25 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-09-29 13:43:25 +0200 |
| commit | 2e63708d39553ed882a20a198cdc0f269bb6cd30 (patch) | |
| tree | 04ae42edcb92ed13aa283860685e5976a0447114 /src/librustdoc | |
| parent | 632f2cb8a47cc16d7e1e6231ac25ba4711c32be8 (diff) | |
| download | rust-2e63708d39553ed882a20a198cdc0f269bb6cd30.tar.gz rust-2e63708d39553ed882a20a198cdc0f269bb6cd30.zip | |
Improve code comments
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index d4f0a196eda..e4d33416883 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1084,7 +1084,7 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute> let mut changed_auto_active_status = None; - // First we get all `doc(auto_cfg)` attributes. + // We get all `doc(auto_cfg)`, `cfg` and `target_feature` attributes. for attr in attrs { if let Some(ident) = attr.ident() && ident.name == sym::doc @@ -1146,11 +1146,9 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute> } } } - // If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because - // `doc(cfg())` overrides `cfg()`). } else if let hir::Attribute::Parsed(AttributeKind::TargetFeature { features, .. }) = attr { - // treat #[target_feature(enable = "feat")] attributes as if they were - // #[doc(cfg(target_feature = "feat"))] attributes as well + // Treat `#[target_feature(enable = "feat")]` attributes as if they were + // `#[doc(cfg(target_feature = "feat"))]` attributes as well. for (feature, _) in features { cfg_info.current_cfg &= Cfg::Cfg(sym::target_feature, Some(*feature)); } |
