Skip to content

Commit eafaec5

Browse files
committed
rustdoc: use import stability marker in display
1 parent 336209e commit eafaec5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/librustdoc/passes/propagate_stability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl DocFolder for StabilityPropagator<'_, '_> {
3636

3737
let stability = match item.item_id {
3838
ItemId::DefId(def_id) => {
39+
let def_id = item.inline_stmt_id.map(|did| did.into()).unwrap_or(def_id);
3940
let own_stability = self.cx.tcx.lookup_stability(def_id);
4041

4142
let (ItemKind::StrippedItem(box kind) | kind) = &item.kind;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// https://github.com/rust-lang/rust/issues/135078
2+
#![crate_name = "foo"]
3+
#![feature(staged_api)]
4+
#![stable(feature = "v1", since="1.0.0")]
5+
6+
#[stable(feature = "v1", since="1.0.0")]
7+
pub mod ffi {
8+
#[stable(feature = "core_ffi", since="1.99.0")]
9+
//@ matches "foo/ffi/struct.CStr.html" "//span[@class='sub-heading']/span[@class='since']" "1.99.0"
10+
//@ !matches - "//span[@class='sub-heading']/span[@class='since']" "1.0.0"
11+
pub struct CStr;
12+
}
13+
14+
#[stable(feature = "v1", since = "1.0.0")]
15+
#[doc(inline)]
16+
//@ matches "foo/struct.CStr.html" "//span[@class='sub-heading']/span[@class='since']" "1.0.0"
17+
//@ !matches - "//span[@class='sub-heading']/span[@class='since']" "1.99.0"
18+
pub use ffi::CStr;

0 commit comments

Comments
 (0)