@@ -37,7 +37,7 @@ use crate::clean::cfg::Cfg;
37
37
use crate :: clean:: clean_visibility;
38
38
use crate :: clean:: external_path;
39
39
use crate :: clean:: inline:: { self , print_inlined_const} ;
40
- use crate :: clean:: utils:: { is_literal_expr, print_const_expr, print_evaluated_const} ;
40
+ use crate :: clean:: utils:: { has_doc_flag , is_literal_expr, print_const_expr, print_evaluated_const} ;
41
41
use crate :: core:: DocContext ;
42
42
use crate :: formats:: cache:: Cache ;
43
43
use crate :: formats:: item_type:: ItemType ;
@@ -119,7 +119,7 @@ pub(crate) struct Crate {
119
119
pub ( crate ) module : Item ,
120
120
pub ( crate ) primitives : ThinVec < ( DefId , PrimitiveType ) > ,
121
121
/// Only here so that they can be filtered through the rustdoc passes.
122
- pub ( crate ) external_traits : Rc < RefCell < FxHashMap < DefId , TraitWithExtraInfo > > > ,
122
+ pub ( crate ) external_traits : Rc < RefCell < FxHashMap < DefId , Trait > > > ,
123
123
}
124
124
125
125
impl Crate {
@@ -132,13 +132,6 @@ impl Crate {
132
132
}
133
133
}
134
134
135
- /// This struct is used to wrap additional information added by rustdoc on a `trait` item.
136
- #[ derive( Clone , Debug ) ]
137
- pub ( crate ) struct TraitWithExtraInfo {
138
- pub ( crate ) trait_ : Trait ,
139
- pub ( crate ) is_notable : bool ,
140
- }
141
-
142
135
#[ derive( Copy , Clone , Debug ) ]
143
136
pub ( crate ) struct ExternalCrate {
144
137
pub ( crate ) crate_num : CrateNum ,
@@ -1530,6 +1523,9 @@ impl Trait {
1530
1523
pub ( crate ) fn is_auto ( & self , tcx : TyCtxt < ' _ > ) -> bool {
1531
1524
tcx. trait_is_auto ( self . def_id )
1532
1525
}
1526
+ pub ( crate ) fn is_notable_trait ( & self , tcx : TyCtxt < ' _ > ) -> bool {
1527
+ has_doc_flag ( tcx, self . def_id , sym:: notable_trait)
1528
+ }
1533
1529
pub ( crate ) fn unsafety ( & self , tcx : TyCtxt < ' _ > ) -> hir:: Unsafety {
1534
1530
tcx. trait_def ( self . def_id ) . unsafety
1535
1531
}
0 commit comments