Merge pull request #3 from steffahn/fix-doc-links
Some checks failed
Build / build (push) Has been cancelled
Build / keep-alive (push) Has been cancelled
Build / deploy (push) Has been cancelled

add doc links generation in definitions
This commit is contained in:
nora 2026-03-02 21:47:11 +01:00 committed by GitHub
commit eedc321477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 1 deletions

View file

@ -9,6 +9,11 @@ cp index.html "$root/www-root"
# use a higher depth because bootstrap might be broken with depth 1?
if [ ! -d 'rust' ]; then
git clone --depth 50 https://github.com/rust-lang/rust.git
pushd rust
git ls-files -z -- ':(glob)library/**/*.rs' \
| xargs -0 sed -i'' -E 's@^[[:space:]]*#!?\[doc\(cfg.*$@// & // commented out for std.noratrieb.dev@'
git apply ../disable-cfg-doc.patch
popd
fi
cd rust
@ -43,7 +48,9 @@ for target in "${targets[@]}"; do
--document-hidden-items \
--html-before-content=$root/before.html \
--extend-css=$root/style.css \
--cap-lints=allow"
--cap-lints=allow \
--generate-link-to-definition \
--generate-macro-expansion"
./x doc library --target "$target" --stage 1

22
disable-cfg-doc.patch Normal file
View file

@ -0,0 +1,22 @@
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index 375f833831..942dba29e6 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -202,7 +202,7 @@ pub(crate) fn create_config(
diagnostic_width,
libs,
externs,
- mut cfgs,
+ cfgs,
check_cfgs,
codegen_options,
unstable_opts,
@@ -220,7 +220,7 @@ pub(crate) fn create_config(
render_options: &RenderOptions,
) -> rustc_interface::Config {
// Add the doc cfg into the doc build.
- cfgs.push("doc".to_string());
+ // cfgs.push("doc".to_string());
// By default, rustdoc ignores all lints.
// Specifically unblock lints relevant to documentation or the lint machinery itself.