File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2921,6 +2921,25 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
2921
2921
}
2922
2922
}
2923
2923
2924
+ impl < ' tcx > Clean < Constant > for ty:: LazyConst < ' tcx > {
2925
+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Constant {
2926
+ if let ty:: LazyConst :: Evaluated ( ct) = self {
2927
+ ct. clean ( cx)
2928
+ } else {
2929
+ unimplemented ! ( ) // FIXME(const_generics)
2930
+ }
2931
+ }
2932
+ }
2933
+
2934
+ impl < ' tcx > Clean < Constant > for ty:: Const < ' tcx > {
2935
+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Constant {
2936
+ Constant {
2937
+ type_ : self . ty . clean ( cx) ,
2938
+ expr : format ! ( "{:?}" , self . val) , // FIXME(const_generics)
2939
+ }
2940
+ }
2941
+ }
2942
+
2924
2943
impl Clean < Item > for hir:: StructField {
2925
2944
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2926
2945
let local_did = cx. tcx . hir ( ) . local_def_id_from_hir_id ( self . hir_id ) ;
Original file line number Diff line number Diff line change @@ -259,6 +259,12 @@ impl fmt::Display for clean::Lifetime {
259
259
}
260
260
}
261
261
262
+ impl fmt:: Display for clean:: Constant {
263
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
264
+ write ! ( f, "{}: {}" , self . expr, self . type_)
265
+ }
266
+ }
267
+
262
268
impl fmt:: Display for clean:: PolyTrait {
263
269
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
264
270
if !self . generic_params . is_empty ( ) {
You can’t perform that action at this time.
0 commit comments