Skip to content

Don't encode doc comments cross-crate#155001

Closed
JonathanBrouwer wants to merge 1 commit intorust-lang:mainfrom
JonathanBrouwer:dont-encode-docs
Closed

Don't encode doc comments cross-crate#155001
JonathanBrouwer wants to merge 1 commit intorust-lang:mainfrom
JonathanBrouwer:dont-encode-docs

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 8, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 8, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 8, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Executing "/scripts/stage_2_test_set2.sh"
+ /scripts/stage_2_test_set2.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
+ ../x.py --stage 2 test --skip tidy --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest
PR_CI_JOB set; skipping tidy
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
---
##[endgroup]
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, tool: "linkchecker", path: "src/tools/linkchecker", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 0.165
[TIMING:end] tool::Linkchecker { compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu } -- 0.000
##[group]Testing stage1 Linkcheck (aarch64-unknown-linux-gnu)
std/primitive.fn.html:6: broken link fragment `#options-and-pointers-nullable-pointers` pointing to `std/option/index.html`
std/primitive.fn.html:137: broken link fragment `#representation` pointing to `std/option/index.html`
std/error/index.html:27: broken link fragment `#the-question-mark-operator-` pointing to `std/result/index.html`
std/primitive.pointer.html:5: broken link fragment `#safety` pointing to `std/ptr/index.html`
std/os/fd/constant.STDERR.html:6: broken link fragment `#re-entrance` pointing to `std/alloc/trait.GlobalAlloc.html`
std/process/struct.Command.html:389: broken link fragment `#sign0` pointing to `std/fmt/index.html`
std/alloc/index.html:47: broken link fragment `#re-entrance` pointing to `std/alloc/trait.GlobalAlloc.html`
std/primitive.reference.html:104: broken link fragment `#allocation` pointing to `std/ptr/index.html`
core/fmt/enum.DebugAsHex.html:6: broken link fragment `#formatting-traits` pointing to `std/fmt/index.html`
core/fmt/enum.DebugAsHex.html:7: broken link fragment `#formatting-traits` pointing to `std/fmt/index.html`
core/fmt/trait.Display.html:31: broken link fragment `#formatting-traits` pointing to `std/fmt/index.html`
core/error/index.html:27: broken link fragment `#the-question-mark-operator-` pointing to `std/result/index.html`
alloc/vec/struct.Vec.html:593: broken link fragment `#currently-allocated-memory` pointing to `alloc/alloc/trait.Allocator.html`
alloc/vec/struct.Vec.html:603: broken link fragment `#memory-fitting` pointing to `alloc/alloc/trait.Allocator.html`
alloc/vec/struct.Vec.html:680: broken link fragment `#currently-allocated-memory` pointing to `alloc/alloc/trait.Allocator.html`
alloc/vec/struct.Vec.html:690: broken link fragment `#memory-fitting` pointing to `alloc/alloc/trait.Allocator.html`
nomicon/dot-operator.html:273: broken link fragment `#derivable` pointing to `std/clone/trait.Clone.html`
nomicon/print.html:3001: broken link fragment `#derivable` pointing to `std/clone/trait.Clone.html`
cargo/reference/semver.html:434: broken link fragment `#memory-layout` pointing to `std/cell/struct.UnsafeCell.html`
cargo/print.html:9240: broken link fragment `#memory-layout` pointing to `std/cell/struct.UnsafeCell.html`
checked links in: 22.4s
number of HTML files scanned: 49035
number of HTML redirects found: 15651
number of links checked: 2606322
number of links ignored due to external: 123545
---
   2: <std::backtrace::Backtrace>::create
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/backtrace.rs:331:13
   3: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   4: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   5: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   6: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   7: <bootstrap::core::build_steps::test::Linkcheck as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:191:77
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Linkcheck>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1579:36
   9: <bootstrap::core::build_steps::test::Linkcheck as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:137:21
  10: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
  11: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:141:22
  12: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1122:9
  13: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1101:14
  14: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:799:25
  15: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  16: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:250:5
  17: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/sys/backtrace.rs:166:18
  18: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:206:18
  19: <&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:287:21
  20: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
  21: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:544:19
  22: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panic.rs:359:14
  23: std::rt::lang_start_internal::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:175:24
  24: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
---
  31: __libc_start_main
  32: _start


Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:36:14
  local time: Wed Apr  8 18:48:31 UTC 2026
  network time: Wed, 08 Apr 2026 18:48:32 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@lqd
Copy link
Copy Markdown
Member

lqd commented Apr 8, 2026

This is a good idea (just look at the size of the docs in the stdlib rmeta), and we’ve discussed something like this in the past. The prototype broke the doc(inline) feature at the time unfortunately, and was thus delayed to the future. Maybe that future is now. It would be good to check that feature still works with this PR, as well as when inlining docs from the stdlib.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

JonathanBrouwer commented Apr 8, 2026

That feature definitely doesn't work with this PR, looking at the CI failure :c
I tried only cross-crate encoding if sess.opts.actually_rustdoc is set locally to fix that, but dependencies are still compiled with sess.opts.actually_rustdoc set to false during a rustdoc run so that doesn't fix it
Therefore I think this PR is pretty hopeless, still interested in the perf tho

@lqd
Copy link
Copy Markdown
Member

lqd commented Apr 8, 2026

Perf was good when I tried, reducing stdlib metadata makes every crate load it faster, in rustc and rustdoc, even more so for the benchmarks only using libcore, with its numerous stdarch intrinsics doc comments.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

☀️ Try build successful (CI)
Build commit: 99dc17f (99dc17f85ea04858877e47c9d71a81f7a143c245, parent: c771f6ee804969b5c046393c4110c22720e56114)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (99dc17f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.5% [0.3%, 0.5%] 5
Improvements ✅
(primary)
-2.3% [-15.4%, -0.2%] 61
Improvements ✅
(secondary)
-4.1% [-18.2%, -0.2%] 60
All ❌✅ (primary) -2.2% [-15.4%, 0.1%] 62

Max RSS (memory usage)

Results (primary -2.8%, secondary -3.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-11.9%, -0.6%] 187
Improvements ✅
(secondary)
-3.7% [-14.0%, -0.7%] 117
All ❌✅ (primary) -2.8% [-11.9%, -0.6%] 187

Cycles

Results (primary -7.3%, secondary -10.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-7.3% [-13.4%, -2.4%] 19
Improvements ✅
(secondary)
-10.3% [-20.8%, -1.4%] 24
All ❌✅ (primary) -7.3% [-13.4%, -2.4%] 19

Binary size

Results (primary -2.4%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-11.8%, -0.1%] 114
Improvements ✅
(secondary)
-1.6% [-4.1%, -0.2%] 23
All ❌✅ (primary) -2.4% [-11.8%, -0.1%] 114

Bootstrap: 490.389s -> 491.393s (0.20%)
Artifact size: 395.39 MiB -> 395.34 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 8, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants