about summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-29 18:39:08 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-27 11:29:49 +0200
commit553308b11503eafac6341b82f345bd62b09ba317 (patch)
tree0149dbb52ae9088cde28314584b7556227ae58aa /src/librustdoc/clean/inline.rs
parent1561efe41afe40c1afaf3d11316ef754d9a8f9a9 (diff)
downloadrust-553308b11503eafac6341b82f345bd62b09ba317.tar.gz
rust-553308b11503eafac6341b82f345bd62b09ba317.zip
Improve code and better check `doc(cfg(...))` attributes
Diffstat (limited to 'src/librustdoc/clean/inline.rs')
-rw-r--r--src/librustdoc/clean/inline.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 8ffa6033c9b..8beea0580de 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -605,6 +605,10 @@ pub(crate) fn build_impl(
         });
     }
 
+    // In here, we pass an empty `CfgInfo` because the computation of `cfg` happens later, so it
+    // doesn't matter at this point.
+    //
+    // We need to pass this empty `CfgInfo` because `merge_attrs` is used when computing the `cfg`.
     let (merged_attrs, cfg) = merge_attrs(cx, load_attrs(cx, did), attrs, &mut CfgInfo::default());
     trace!("merged_attrs={merged_attrs:?}");