Skip to content

Comments

Allow merging all libcore/alloc doctests into a single binary#153072

Open
jyn514 wants to merge 6 commits intorust-lang:mainfrom
ferrocene:jyn/libcore-doctest-merge
Open

Allow merging all libcore/alloc doctests into a single binary#153072
jyn514 wants to merge 6 commits intorust-lang:mainfrom
ferrocene:jyn/libcore-doctest-merge

Conversation

@jyn514
Copy link
Member

@jyn514 jyn514 commented Feb 25, 2026

This is only the changes needed to allow merging the tests. This doesn't actually turn doctest merging on in bootstrap. I think that might be a useful follow-up, since it makes them much faster to run, but it's not without downsides because it means we'll no longer be testing that doctests have all necessary feature() attributes.

The motivation for this change is to run the tests with -C instrument-coverage and then generate a coverage report from the output. Currently, this is very expensive because it requires parsing DWARF for each doctest binary. Merging the binaries decreases the time taken from several hours to ~30 seconds.


There are several parts to this change, most of which are independent and I'm happy to split out into other PRs.

  • Upgrade process spawning logging from debug->info so it's easier to see, including in a rustdoc built without debug symbols.
  • Core doctests now support being run with -C panic=abort. Ferrocene needs this downstream for complicated reasons; it's a one-line change so I figured it's not a big deal.
  • Downgrade errors about duplicate features from a hard error to a warning. The meaning is clear here, and doctest merging often creates duplicate features since it lifts them all to the crate root. This involves changes to the compiler but generally I expect this to be low-impact.
    • Enable this new warning, as well as several related feature lints, in rustdoc. By default rustdoc doesn't lint on anything except the lints it manually adds.
  • Rustdoc now treats allow(incomplete_features) as a crate-level attribute, just like internal_features. Without this, it's possible to get hard errors if rustdoc lifts features to the crate level but not allows.
  • Core doctests now support being built with --merge-doctests=yes. In particular, I removed a few $crate usages and explicitly marked a few doctests as standalone_crate.

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2026

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 25, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2026

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 13 candidates

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the jyn/libcore-doctest-merge branch from 16227c8 to d567da2 Compare February 25, 2026 04:30
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Feb 25, 2026
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
##[group]Runner Image Provisioner
Hosted Compute Agent
Version: 20260123.484
Commit: 6bd6555ca37d84114959e1c76d2c01448ff61c5d
Build Date: 2026-01-23T19:41:17Z
Worker ID: {be6ab1f4-78df-4585-98a8-e5020da14302}
Azure Region: southcentralus
##[endgroup]
##[group]VM Image
- OS: Linux (arm64)
- Source: Partner
- Name: Ubuntu 24.04 by Arm Limited
---
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   4 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip compiler \
  --skip src
#!/bin/bash

set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip tests \
  --skip coverage-map \
  --skip coverage-run \
  --skip library \
  --skip tidyselftest
---
##[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]
---
   Doc-tests rustc_codegen_llvm

running 3 tests
test compiler/rustc_codegen_llvm/src/debuginfo/doc.md - debuginfo (line 30) ... ignored
test compiler/rustc_codegen_llvm/src/mono_item.rs - mono_item::CodegenCx<'ll,'tcx>::add_static_aliases (line 120) ... ignored
test compiler/rustc_codegen_llvm/src/debuginfo/doc.md - debuginfo (line 57) ... ok

test result: ok. 1 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 1.03ms


---
test compiler/rustc_mir_transform/src/early_otherwise_branch.rs - early_otherwise_branch::EarlyOtherwiseBranch (line 11) ... ignored
test compiler/rustc_mir_transform/src/early_otherwise_branch.rs - early_otherwise_branch::EarlyOtherwiseBranch (line 21) ... ignored
test compiler/rustc_mir_transform/src/coroutine/by_move_body.rs - coroutine::by_move_body (line 31) ... ok
test compiler/rustc_mir_transform/src/lib.rs - declare_passes (line 61) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_copy (line 217) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_copy (line 224) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_eq_op (line 107) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_eq_op (line 89) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_int_to_int (line 152) ... ignored
test compiler/rustc_mir_transform/src/match_branches.rs - match_branches::SimplifyMatch<'tcx,'a>::unify_by_int_to_int (line 179) ... ignored
test compiler/rustc_mir_transform/src/shim.rs - shim::build_fn_ptr_addr_shim (line 1106) ... ignored
test compiler/rustc_mir_transform/src/coroutine/by_move_body.rs - coroutine::by_move_body (line 5) ... ok
test compiler/rustc_mir_transform/src/large_enums.rs - large_enums::EnumSizeOpt (line 15) ... ok
test compiler/rustc_mir_transform/src/simplify.rs - simplify (line 20) ... ok
test compiler/rustc_mir_transform/src/trivial_const.rs - trivial_const::trivial_const (line 19) ... ok
---
Doc path: /checkout/obj/build/aarch64-unknown-linux-gnu/doc/rustdoc/index.html
[TIMING:end] doc::RustdocBook> { target: aarch64-unknown-linux-gnu, name: "rustdoc", src: "/checkout/src/doc/rustdoc", parent: Some(RustdocBook { target: aarch64-unknown-linux-gnu }), languages: [], build_compiler: None } -- 0.094
[TIMING:end] doc::RustdocBook { target: aarch64-unknown-linux-gnu } -- 0.000
[TIMING:start] doc::RustByExample { target: aarch64-unknown-linux-gnu }
[TIMING:start] doc::RustByExample> { target: aarch64-unknown-linux-gnu, name: "rust-by-example", src: "/checkout/src/doc/rust-by-example", parent: Some(RustByExample { target: aarch64-unknown-linux-gnu }), languages: ["es", "ja", "zh", "ko"], build_compiler: None }
Rustbook (aarch64-unknown-linux-gnu) - rust-by-example
 INFO Book building has started
 WARN The command `mdbook-gettext` for preprocessor `gettext` was not found, but is marked as optional.
 INFO Running the html backend
 INFO HTML book written to `/checkout/obj/build/aarch64-unknown-linux-gnu/doc/rust-by-example`
---
 INFO Book building has started
 INFO Running the html backend
 INFO HTML book written to `/checkout/obj/build/aarch64-unknown-linux-gnu/doc/rust-by-example/ko`
Doc path: /checkout/obj/build/aarch64-unknown-linux-gnu/doc/rust-by-example/index.html
[TIMING:end] doc::RustByExample> { target: aarch64-unknown-linux-gnu, name: "rust-by-example", src: "/checkout/src/doc/rust-by-example", parent: Some(RustByExample { target: aarch64-unknown-linux-gnu }), languages: ["es", "ja", "zh", "ko"], build_compiler: None } -- 5.100
[TIMING:end] doc::RustByExample { target: aarch64-unknown-linux-gnu } -- 0.000
[TIMING:start] doc::RustcBook { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, validate: false }
Generating lint docs (aarch64-unknown-linux-gnu)
[TIMING:start] tool::LintDocs { compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu }
[TIMING:start] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, tool: "lint-docs", path: "src/tools/lint-docs", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary }
---
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: proc_macro_test_impl::fn_like_panic
             at /checkout/obj/build/aarch64-unknown-linux-gnu/stage2-tools/aarch64-unknown-linux-gnu/release/build/proc-macro-test-7fbbd7df2dd0fd89/out/proc-macro-test-imp-staging/src/lib.rs:15:5
   3: <proc_macro_test_impl::fn_like_panic as core::ops::function::Fn<(proc_macro::TokenStream,)>>::call
             at /checkout/library/core/src/ops/function.rs:79:5
test test_bidi_set_config ... ok
test test_bidi_list_macros_invalid_path ... ok
   4: <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1::<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:299:44
test test_bidi_set_config_rust_analyzer_mode ... ok
   5: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:265:44
   6: proc_macro::bridge::client::state::set::<core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/client.rs:164:9
   7: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:265:22
   8: <core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
             at /checkout/library/core/src/panic/unwind_safe.rs:274:9
   9: std::panicking::catch_unwind::do_call::<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>, ()>
             at /checkout/library/std/src/panicking.rs:581:40
  10: __rust_try
  11: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>>
             at /checkout/library/std/src/panicking.rs:544:19
  12: std::panic::catch_unwind::<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>, ()>
             at /checkout/library/std/src/panic.rs:359:14
  13: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/client.rs:253:5
  14: <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1::<proc_macro_test_impl::fn_like_panic>::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:299:17
  15: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::<proc_macro::bridge::buffer::Buffer, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/selfless_reify.rs:60:9
test test_bidi_version_check_bidirectional ... ok
  16: <rustc_proc_macro::bridge::server::MaybeCrossThread as rustc_proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client::<proc_macro_srv::server_impl::token_id::SpanIdServer>
  17: rustc_proc_macro::bridge::server::run_server::<proc_macro_srv::server_impl::token_id::SpanIdServer, rustc_proc_macro::bridge::Marked<proc_macro_srv::token_stream::TokenStream<proc_macro_srv::server_impl::token_id::SpanId>, rustc_proc_macro::bridge::client::TokenStream>, core::option::Option<rustc_proc_macro::bridge::Marked<proc_macro_srv::token_stream::TokenStream<proc_macro_srv::server_impl::token_id::SpanId>, rustc_proc_macro::bridge::client::TokenStream>>, rustc_proc_macro::bridge::server::MaybeCrossThread>
  18: <rustc_proc_macro::bridge::client::Client<rustc_proc_macro::TokenStream, rustc_proc_macro::TokenStream>>::run::<proc_macro_srv::server_impl::token_id::SpanIdServer, rustc_proc_macro::bridge::server::MaybeCrossThread>
  19: <proc_macro_srv::dylib::proc_macros::ProcMacros>::expand::<proc_macro_srv::server_impl::token_id::SpanId>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test test_bidi_expand_macro_panic ... ok
test test_bidi_expand_nonexistent_macro ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 20.80ms
---
   1: core::panicking::panic_fmt
test test_list_macros_invalid_path ... ok
   2: proc_macro_test_impl::fn_like_panic
             at /checkout/obj/build/aarch64-unknown-linux-gnu/stage2-tools/aarch64-unknown-linux-gnu/release/build/proc-macro-test-7fbbd7df2dd0fd89/out/proc-macro-test-imp-staging/src/lib.rs:15:5
   3: <proc_macro_test_impl::fn_like_panic as core::ops::function::Fn<(proc_macro::TokenStream,)>>::call
             at /checkout/library/core/src/ops/function.rs:79:5
test test_set_config ... ok
   4: <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1::<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:299:44
   5: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:265:44
   6: proc_macro::bridge::client::state::set::<core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<test test_version_check ... ok
proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/client.rs:164:9
   7: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:265:22
   8: <core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
             at /checkout/library/core/src/panic/unwind_safe.rs:274:9
   9: std::panicking::catch_unwind::do_call::<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>, ()>
             at /checkout/library/std/src/panicking.rstest test_set_config_rust_analyzer_mode ... ok
:581:40
  10: __rust_try
  11: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>>
             at /checkout/library/std/src/panicking.rs:544:19
  12: std::panic::catch_unwind::<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>::{closure#0}>, ()>
             at /checkout/library/std/src/panic.rs:359:14
  13: proc_macro::bridge::client::run_client::<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/client.rs:253:5
  14: <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1::<proc_macro_test_impl::fn_like_panic>::{closure#0}
             at /checkout/library/proc_macro/src/bridge/client.rs:299:17
  15: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::<proc_macro::bridge::buffer::Buffer, <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::expand1<proc_macro_test_impl::fn_like_panic>::{closure#0}>
             at /checkout/library/proc_macro/src/bridge/selfless_reify.rs:60:9
  16: <rustc_proc_macro::bridge::server::MaybeCrossThread as rustc_proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client::<proc_macro_srv::server_impl::token_id::SpanIdServer>
  17: rustc_proc_macro::bridge::server::run_server::<proc_macro_srv::server_impl::token_id::SpanIdServer, rustc_proc_macro::bridge::Marked<proc_macro_srv::token_stream::TokenStream<proc_macro_srv::server_impl::token_id::SpanId>, rustc_proc_macro::bridge::client::TokenStream>, core::option::Option<rustc_proc_macro::bridge::Marked<proc_macro_srv::token_stream::TokenStream<proc_macro_srv::server_impl::token_id::SpanId>, rustc_proc_macro::bridge::client::TokenStream>>, rustc_proc_macro::bridge::server::MaybeCrossThread>
  18: <rustc_proc_macro::bridge::client::Client<rustc_proc_macro::TokenStream, rustc_proc_macro::TokenStream>>::run::<proc_macro_srv::server_impl::token_id::SpanIdServer, rustc_proc_macro::bridge::server::MaybeCrossThread>
  19: <proc_macro_srv::dylib::proc_macros::ProcMacros>::expand::<proc_macro_srv::server_impl::token_id::SpanId>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test test_expand_macro_panic ... ok
test test_expand_nonexistent_macro ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 20.31ms
---
[TIMING:start] test::LintDocs { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu }
[TIMING:start] doc::RustcBook { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, validate: true }
Generating lint docs (aarch64-unknown-linux-gnu)
##[group]Running stage2 lint-docs (stage1 -> stage2, aarch64-unknown-linux-gnu)
error: failed to test example in lint docs for `duplicate_features` in /checkout/compiler/rustc_lint_defs/src/builtin.rs:1102: lint docs should contain the line `### Example`

This error was generated by the lint-docs tool.
This tool extracts documentation for lints from the source code and places
them in the rustc book. See the declare_lint! documentation
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html
for an example of the format of documentation this tool expects.

To re-run these tests, run: ./x.py test --keep-stage=0 src/tools/lint-docs
The --keep-stage flag should be used if you have already built the compiler
and are only modifying the doc comments to avoid rebuilding the compiler.

Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/lint-docs --build-rustc-stage 1 --src /checkout/compiler --out /checkout/obj/build/aarch64-unknown-linux-gnu/md-doc/rustc/src/lints --rustc /checkout/obj/build/aarch64-unknown-linux-gnu/stage1/bin/rustc --rustc-target aarch64-unknown-linux-gnu --validate` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1612:23
Executed at: src/bootstrap/src/core/build_steps/doc.rs:1421:13

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --skip tidy --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 0:50:20
  local time: Wed Feb 25 05:25:41 UTC 2026
  network time: Wed, 25 Feb 2026 05:25:42 GMT
##[error]Process completed with exit code 1.

@bjorn3
Copy link
Member

bjorn3 commented Feb 25, 2026

Merging doctest would mean that we did no longer test that the set of features in doc tests are accurate, right? Those are visible to the user.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 25, 2026

☔ The latest upstream changes (presumably #153074) made this pull request unmergeable. Please resolve the merge conflicts.

@jyn514
Copy link
Member Author

jyn514 commented Feb 25, 2026

Yes. That’s why this doesn’t actually switch on merging, as mentioned in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants