File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,11 @@ impl Sig for ast::Generics {
646
646
param_text. push_str ( & pprust:: bounds_to_string ( & param. bounds ) ) ;
647
647
// FIXME descend properly into bounds.
648
648
}
649
+ ast:: GenericParamKind :: Const { ref ty } => {
650
+ param_text. push_str ( & pprust:: bounds_to_string ( & param. bounds ) ) ;
651
+ param_text. push_str ( "= " ) ;
652
+ param_text. push_str ( & pprust:: ty_to_string ( & ty) ) ;
653
+ }
649
654
}
650
655
}
651
656
text. push_str ( & param_text) ;
Original file line number Diff line number Diff line change @@ -1025,6 +1025,7 @@ impl<'a> State<'a> {
1025
1025
match generic_arg {
1026
1026
GenericArg :: Lifetime ( lt) => self . print_lifetime ( * lt) ,
1027
1027
GenericArg :: Type ( ty) => self . print_type ( ty) ,
1028
+ GenericArg :: Const ( ct) => self . print_expr ( & ct. value ) ,
1028
1029
}
1029
1030
}
1030
1031
@@ -2929,7 +2930,7 @@ impl<'a> State<'a> {
2929
2930
s. print_outer_attributes_inline ( & param. attrs ) ?;
2930
2931
let lt = ast:: Lifetime { id : param. id , ident : param. ident } ;
2931
2932
s. print_lifetime_bounds ( lt, & param. bounds )
2932
- } ,
2933
+ }
2933
2934
ast:: GenericParamKind :: Type { ref default } => {
2934
2935
s. print_outer_attributes_inline ( & param. attrs ) ?;
2935
2936
s. print_ident ( param. ident ) ?;
@@ -2943,6 +2944,15 @@ impl<'a> State<'a> {
2943
2944
_ => Ok ( ( ) )
2944
2945
}
2945
2946
}
2947
+ ast:: GenericParamKind :: Const { ref ty } => {
2948
+ s. print_outer_attributes_inline ( & param. attrs ) ?;
2949
+ s. word_space ( "const" ) ?;
2950
+ s. print_ident ( param. ident ) ?;
2951
+ s. s . space ( ) ?;
2952
+ s. word_space ( ":" ) ?;
2953
+ s. print_type ( ty) ?;
2954
+ s. print_type_bounds ( ":" , & param. bounds )
2955
+ }
2946
2956
}
2947
2957
} ) ?;
2948
2958
You can’t perform that action at this time.
0 commit comments