File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -376,8 +376,8 @@ impl Item {
376
376
self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_stability ( did) )
377
377
}
378
378
379
- crate fn const_stability < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Option < & ' tcx ConstStability > {
380
- self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_const_stability ( did) )
379
+ crate fn const_stability < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Option < ConstStability > {
380
+ self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_const_stability ( did) ) . map ( |cs| * cs )
381
381
}
382
382
383
383
crate fn deprecation ( & self , tcx : TyCtxt < ' _ > ) -> Option < Deprecation > {
Original file line number Diff line number Diff line change @@ -1349,10 +1349,7 @@ impl PrintWithSpace for hir::Mutability {
1349
1349
}
1350
1350
}
1351
1351
1352
- crate fn print_constness_with_space (
1353
- c : & hir:: Constness ,
1354
- s : Option < & ConstStability > ,
1355
- ) -> & ' static str {
1352
+ crate fn print_constness_with_space ( c : & hir:: Constness , s : Option < ConstStability > ) -> & ' static str {
1356
1353
match ( c, s) {
1357
1354
// const stable or when feature(staged_api) is not set
1358
1355
(
Original file line number Diff line number Diff line change @@ -805,7 +805,7 @@ fn assoc_type(
805
805
fn render_stability_since_raw (
806
806
w : & mut Buffer ,
807
807
ver : Option < Symbol > ,
808
- const_stability : Option < & ConstStability > ,
808
+ const_stability : Option < ConstStability > ,
809
809
containing_ver : Option < Symbol > ,
810
810
containing_const_ver : Option < Symbol > ,
811
811
) {
@@ -814,7 +814,7 @@ fn render_stability_since_raw(
814
814
match ( ver, const_stability) {
815
815
// stable and const stable
816
816
( Some ( v) , Some ( ConstStability { level : StabilityLevel :: Stable { since } , .. } ) )
817
- if Some ( * since) != containing_const_ver =>
817
+ if Some ( since) != containing_const_ver =>
818
818
{
819
819
write ! (
820
820
w,
You can’t perform that action at this time.
0 commit comments