From 704d598fac81c31e65b0718a63d402ba2fd2ac9d Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 15 Oct 2015 01:28:38 +0300 Subject: [PATCH] rustdoc: Report deprecation reason first --- src/librustdoc/clean/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 88e254b86b2..defdfc497bd 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2700,9 +2700,14 @@ impl Clean for attr::Stability { Some(attr::Deprecation {ref since, ..}) => since.to_string(), _=> "".to_string(), }, - reason: match self.level { - attr::Unstable {reason: Some(ref reason), ..} => reason.to_string(), - _ => "".to_string(), + reason: { + if let Some(ref depr) = self.depr { + depr.reason.to_string() + } else if let attr::Unstable {reason: Some(ref reason), ..} = self.level { + reason.to_string() + } else { + "".to_string() + } }, issue: match self.level { attr::Unstable {issue, ..} => Some(issue),