-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Closed
Copy link
Labels
A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
Two crates: dep, and main depending on dep.
// dep/lib.rs
#[doc(alias = "answer")]
pub fn number() -> i32 { 42 }
// main/main.rs
pub use dep::number;Reproduction Steps
The following Bash code sets everything up:
cargo new dep --lib
cargo new main
cd main
cargo add dep --path ../dep
echo '#[doc(alias = "answer")] pub fn number() -> i32 { 42 }' > ../dep/src/lib.rs
echo 'pub use dep::number;' > src/lib.rs
cargo doc --no-deps --openYou can change rustup default stable/nightly beforehand to switch between behaviors.
Expected Outcome
In the docs page now opened in the browser, search for the string "answer".
On stable Rust, the alias across crates is found in search:
Also, when running cargo doc on nightly without --no-deps, the alias is found in the other crate dep:
Actual Output
On nightly with cargo doc --no-deps, no results when looking for "answer":
Version
Stable and nightly (both latest as of today):
rustdoc 1.93.1 (01f6ddf75 2026-02-11)
rustdoc 1.95.0-nightly (0376d43d4 2026-02-20)
Additional Details
Similar but not identical to #141475.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Fields
Give feedbackNo fields configured for issues without a type.