You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression in nightly-2025-06-28: rustdoc --test -Zcrate-attr=feature(used_with_arg) #147276
A-attributesArea: Attributes (`#[…]`, `#![…]`)A-doctestsArea: Documentation tests, run by rustdocC-bugCategory: This is a bug.F-used_with_arg`#![feature(used_with_arg)]`S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-untriagedUntriaged performance or correctness regression.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
$ rustdoc +nightly-2025-06-28 --test -Zcrate-attr='feature(used_with_arg)' lib.rserror[E0658]: `#[used(linker)]` is currently unstable --> lib.rs:1:1 |1 | #[used(linker)] | ^^^^^^^^^^^^^^^ | = note: see issue #93798 <https://github.com/rust-lang/rust/issues/93798> for more information = help: add `#![feature(used_with_arg)]` to the crate attributes to enable = note: this compiler was built on 2025-06-27; consider upgrading it if it is out of dateerror: aborting due to 1 previous errorFor more information about this error, try `rustc --explain E0658`.
The most recent nightly (nightly-2025-10-02) remains affected.
Adding unstable_opts: options.unstable_opts.clone() to sessopts initialization fixes the issue, but that's kind of surprising since the code around that area hasn't been touched in over a year, I wonder how that could have worked before.
A-attributesArea: Attributes (`#[…]`, `#![…]`)A-doctestsArea: Documentation tests, run by rustdocC-bugCategory: This is a bug.F-used_with_arg`#![feature(used_with_arg)]`S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-untriagedUntriaged performance or correctness regression.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Activity
JonathanBrouwer commentedon Oct 2, 2025
@rustbot claim
Will fix
Urgau commentedon Oct 2, 2025
Part of the issue is that rustdoc is not populating the
unstable_opts(and thus-Zcrate-attr) when testing doctests.rust/src/librustdoc/doctest.rs
Lines 162 to 177 in 5c7ae0c
Adding
unstable_opts: options.unstable_opts.clone()tosessoptsinitialization fixes the issue, but that's kind of surprising since the code around that area hasn't been touched in over a year, I wonder how that could have worked before.fmease commentedon Oct 2, 2025
#143930 is probably another instance of what Urgau wrote; I never got around to fixing it
Urgau commentedon Oct 3, 2025
Talked with @JonathanBrouwer, I'm gonna post the above fix. @rustbot claim
Rollup merge of rust-lang#147292 - Urgau:rustdoc-test-unstable_opts, …
Rollup merge of rust-lang#147292 - Urgau:rustdoc-test-unstable_opts, …
Rollup merge of rust-lang#147292 - Urgau:rustdoc-test-unstable_opts, …
Unrolled build for #147292