Skip to content

Commit 704d598

Browse files
committed
rustdoc: Report deprecation reason first
1 parent 0346833 commit 704d598

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,9 +2700,14 @@ impl Clean<Stability> for attr::Stability {
27002700
Some(attr::Deprecation {ref since, ..}) => since.to_string(),
27012701
_=> "".to_string(),
27022702
},
2703-
reason: match self.level {
2704-
attr::Unstable {reason: Some(ref reason), ..} => reason.to_string(),
2705-
_ => "".to_string(),
2703+
reason: {
2704+
if let Some(ref depr) = self.depr {
2705+
depr.reason.to_string()
2706+
} else if let attr::Unstable {reason: Some(ref reason), ..} = self.level {
2707+
reason.to_string()
2708+
} else {
2709+
"".to_string()
2710+
}
27062711
},
27072712
issue: match self.level {
27082713
attr::Unstable {issue, ..} => Some(issue),

0 commit comments

Comments
 (0)