@@ -250,7 +250,12 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
250
250
mutability,
251
251
expr : print_const_expr ( cx, body_id) ,
252
252
} ) ) ,
253
- ItemKind :: Const ( ty, body_id) => unimplemented ! ( ) ,
253
+ ItemKind :: Const ( ty, body_id) => NotInlined ( ConstantItem ( Constant {
254
+ type_ : ty. clean ( cx) ,
255
+ expr : print_const_expr ( cx, body_id) ,
256
+ value : print_evaluated_const ( cx, def_id) ,
257
+ is_literal : is_literal_expr ( cx, body_id. hir_id ) ,
258
+ } ) ) ,
254
259
ItemKind :: Union ( ref variant_data, ref generics) => NotInlined ( UnionItem ( Union {
255
260
struct_type : doctree:: struct_type_from_def ( & variant_data) ,
256
261
generics : generics. clean ( cx) ,
@@ -2070,24 +2075,6 @@ impl Clean<BareFunctionDecl> for hir::BareFnTy<'_> {
2070
2075
}
2071
2076
}
2072
2077
2073
- impl Clean < Item > for doctree:: Constant < ' _ > {
2074
- fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2075
- let def_id = cx. tcx . hir ( ) . local_def_id ( self . id ) . to_def_id ( ) ;
2076
-
2077
- Item :: from_def_id_and_parts (
2078
- def_id,
2079
- Some ( self . name ) ,
2080
- ConstantItem ( Constant {
2081
- type_ : self . type_ . clean ( cx) ,
2082
- expr : print_const_expr ( cx, self . expr ) ,
2083
- value : print_evaluated_const ( cx, def_id) ,
2084
- is_literal : is_literal_expr ( cx, self . expr . hir_id ) ,
2085
- } ) ,
2086
- cx,
2087
- )
2088
- }
2089
- }
2090
-
2091
2078
impl Clean < ImplPolarity > for ty:: ImplPolarity {
2092
2079
fn clean ( & self , _: & DocContext < ' _ > ) -> ImplPolarity {
2093
2080
match self {
0 commit comments