diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/format.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 4 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index aac7dbaca2b..5aaaa99dadb 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -376,8 +376,8 @@ impl Item { self.def_id.as_def_id().and_then(|did| tcx.lookup_stability(did)) } - crate fn const_stability<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<&'tcx ConstStability> { - self.def_id.as_def_id().and_then(|did| tcx.lookup_const_stability(did)) + crate fn const_stability<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<ConstStability> { + self.def_id.as_def_id().and_then(|did| tcx.lookup_const_stability(did)).map(|cs| *cs) } crate fn deprecation(&self, tcx: TyCtxt<'_>) -> Option<Deprecation> { diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 34742fac0e4..fdb52703edf 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -1349,10 +1349,7 @@ impl PrintWithSpace for hir::Mutability { } } -crate fn print_constness_with_space( - c: &hir::Constness, - s: Option<&ConstStability>, -) -> &'static str { +crate fn print_constness_with_space(c: &hir::Constness, s: Option<ConstStability>) -> &'static str { match (c, s) { // const stable or when feature(staged_api) is not set ( diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index eaeda4d178b..a1db66a4d52 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -805,7 +805,7 @@ fn assoc_type( fn render_stability_since_raw( w: &mut Buffer, ver: Option<Symbol>, - const_stability: Option<&ConstStability>, + const_stability: Option<ConstStability>, containing_ver: Option<Symbol>, containing_const_ver: Option<Symbol>, ) { @@ -814,7 +814,7 @@ fn render_stability_since_raw( match (ver, const_stability) { // stable and const stable (Some(v), Some(ConstStability { level: StabilityLevel::Stable { since }, .. })) - if Some(*since) != containing_const_ver => + if Some(since) != containing_const_ver => { write!( w, |
