@@ -37,7 +37,7 @@ use crate::clean::cfg::Cfg;
3737use crate :: clean:: clean_visibility;
3838use crate :: clean:: external_path;
3939use 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} ;
4141use crate :: core:: DocContext ;
4242use crate :: formats:: cache:: Cache ;
4343use crate :: formats:: item_type:: ItemType ;
@@ -119,7 +119,7 @@ pub(crate) struct Crate {
119119 pub ( crate ) module : Item ,
120120 pub ( crate ) primitives : ThinVec < ( DefId , PrimitiveType ) > ,
121121 /// 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 > > > ,
123123}
124124
125125impl Crate {
@@ -132,13 +132,6 @@ impl Crate {
132132 }
133133}
134134
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-
142135#[ derive( Copy , Clone , Debug ) ]
143136pub ( crate ) struct ExternalCrate {
144137 pub ( crate ) crate_num : CrateNum ,
@@ -1530,6 +1523,9 @@ impl Trait {
15301523 pub ( crate ) fn is_auto ( & self , tcx : TyCtxt < ' _ > ) -> bool {
15311524 tcx. trait_is_auto ( self . def_id )
15321525 }
1526+ pub ( crate ) fn is_notable_trait ( & self , tcx : TyCtxt < ' _ > ) -> bool {
1527+ has_doc_flag ( tcx, self . def_id , sym:: notable_trait)
1528+ }
15331529 pub ( crate ) fn unsafety ( & self , tcx : TyCtxt < ' _ > ) -> hir:: Unsafety {
15341530 tcx. trait_def ( self . def_id ) . unsafety
15351531 }
0 commit comments