1
Fork 0

Rollup merge of #135171 - notriddle:notriddle/stable-path-is-better, r=GuillaumeGomez

rustdoc: use stable paths as preferred canonical paths

This accomplishes something like 16a4ad7d7b, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length.

Fixes #131676
This commit is contained in:
Matthias Krüger 2025-01-07 21:39:41 +01:00 committed by GitHub
commit 0e48e96e65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 47 additions and 1 deletions

View file

@ -0,0 +1,40 @@
//! Test case for [134702]
//!
//! [134702]: https://github.com/rust-lang/rust/issues/134702
#![crate_name = "foo"]
#![stable(since = "1.0", feature = "v1")]
#![feature(staged_api, rustc_attrs)]
#[stable(since = "1.0", feature = "stb1")]
pub mod stb1 {
#[doc(inline)]
#[stable(since = "1.0", feature = "stb1")]
pub use crate::uns::Inside1;
}
#[unstable(feature = "uns", issue = "135003")]
pub mod uns {
#[stable(since = "1.0", feature = "stb1")]
#[rustc_allowed_through_unstable_modules]
pub struct Inside1;
#[stable(since = "1.0", feature = "stb2")]
#[rustc_allowed_through_unstable_modules]
pub struct Inside2;
}
#[stable(since = "1.0", feature = "stb2")]
pub mod stb2 {
#[doc(inline)]
#[stable(since = "1.0", feature = "stb2")]
pub use crate::uns::Inside2;
}
#[stable(since = "1.0", feature = "nested")]
pub mod nested {
//! [Inside1] [Inside2]
//@ has foo/nested/index.html '//a[@href="../stb1/struct.Inside1.html"]' 'Inside1'
//@ has foo/nested/index.html '//a[@href="../stb2/struct.Inside2.html"]' 'Inside2'
use crate::stb1::Inside1;
use crate::stb2::Inside2;
}