Skip to content

Commit 9a80eff

Browse files
committed
show deprecation message in rustdoc, too
1 parent f1fcde4 commit 9a80eff

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/librustdoc/clean/types.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use std::{fmt, iter};
66

77
use arrayvec::ArrayVec;
88
use rustc_abi::{ExternAbi, VariantIdx};
9-
use rustc_attr_parsing::{ConstStability, Deprecation, Stability, StableSince};
9+
use rustc_attr_parsing::{
10+
AllowedThroughUnstableModules, ConstStability, Deprecation, Stability, StableSince,
11+
};
1012
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
1113
use rustc_hir::def::{CtorKind, DefKind, Res};
1214
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId};
@@ -406,15 +408,19 @@ impl Item {
406408
// were never supposed to work at all.
407409
let stab = self.stability(tcx)?;
408410
if let rustc_attr_parsing::StabilityLevel::Stable {
409-
allowed_through_unstable_modules: Some(_),
411+
allowed_through_unstable_modules: Some(note),
410412
..
411413
} = stab.level
412414
{
415+
let note = match note {
416+
AllowedThroughUnstableModules::WithDeprecation(note) => Some(note),
417+
// FIXME: Would be better to say *something* here about the *path* being
418+
// deprecated rather than the item.
419+
AllowedThroughUnstableModules::WithoutDeprecation => None,
420+
};
413421
Some(Deprecation {
414-
// FIXME(#131676, #135003): when a note is added to this stability tag,
415-
// translate it here
416422
since: rustc_attr_parsing::DeprecatedSince::Unspecified,
417-
note: None,
423+
note,
418424
suggestion: None,
419425
})
420426
} else {

0 commit comments

Comments
 (0)