@@ -282,7 +282,8 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
282282
283283 match pred {
284284 clean:: WherePredicate :: BoundPredicate { ty, bounds, bound_params } => {
285- print_higher_ranked_params_with_space ( bound_params, cx) . fmt ( f) ?;
285+ print_higher_ranked_params_with_space ( bound_params, cx, "for" )
286+ . fmt ( f) ?;
286287 ty. print ( cx) . fmt ( f) ?;
287288 f. write_str ( ":" ) ?;
288289 if !bounds. is_empty ( ) {
@@ -386,7 +387,7 @@ impl clean::ConstantKind {
386387impl clean:: PolyTrait {
387388 fn print < ' a , ' tcx : ' a > ( & ' a self , cx : & ' a Context < ' tcx > ) -> impl Display + ' a + Captures < ' tcx > {
388389 display_fn ( move |f| {
389- print_higher_ranked_params_with_space ( & self . generic_params , cx) . fmt ( f) ?;
390+ print_higher_ranked_params_with_space ( & self . generic_params , cx, "for" ) . fmt ( f) ?;
390391 self . trait_ . print ( cx) . fmt ( f)
391392 } )
392393 }
@@ -968,10 +969,12 @@ fn tybounds<'a, 'tcx: 'a>(
968969fn print_higher_ranked_params_with_space < ' a , ' tcx : ' a > (
969970 params : & ' a [ clean:: GenericParamDef ] ,
970971 cx : & ' a Context < ' tcx > ,
972+ keyword : & ' static str ,
971973) -> impl Display + ' a + Captures < ' tcx > {
972974 display_fn ( move |f| {
973975 if !params. is_empty ( ) {
974- f. write_str ( if f. alternate ( ) { "for<" } else { "for<" } ) ?;
976+ f. write_str ( keyword) ?;
977+ f. write_str ( if f. alternate ( ) { "<" } else { "<" } ) ?;
975978 comma_sep ( params. iter ( ) . map ( |lt| lt. print ( cx) ) , true ) . fmt ( f) ?;
976979 f. write_str ( if f. alternate ( ) { "> " } else { "> " } ) ?;
977980 }
@@ -1027,7 +1030,7 @@ fn fmt_type(
10271030 primitive_link ( f, prim, format_args ! ( "{}" , prim. as_sym( ) . as_str( ) ) , cx)
10281031 }
10291032 clean:: BareFunction ( ref decl) => {
1030- print_higher_ranked_params_with_space ( & decl. generic_params , cx) . fmt ( f) ?;
1033+ print_higher_ranked_params_with_space ( & decl. generic_params , cx, "for" ) . fmt ( f) ?;
10311034 decl. safety . print_with_space ( ) . fmt ( f) ?;
10321035 print_abi_with_space ( decl. abi ) . fmt ( f) ?;
10331036 if f. alternate ( ) {
@@ -1037,6 +1040,10 @@ fn fmt_type(
10371040 }
10381041 decl. decl . print ( cx) . fmt ( f)
10391042 }
1043+ clean:: UnsafeBinder ( ref binder) => {
1044+ print_higher_ranked_params_with_space ( & binder. generic_params , cx, "unsafe" ) . fmt ( f) ?;
1045+ binder. ty . print ( cx) . fmt ( f)
1046+ }
10401047 clean:: Tuple ( ref typs) => match & typs[ ..] {
10411048 & [ ] => primitive_link ( f, PrimitiveType :: Unit , format_args ! ( "()" ) , cx) ,
10421049 [ one] => {
@@ -1354,7 +1361,7 @@ impl clean::Impl {
13541361 // Hardcoded anchor library/core/src/primitive_docs.rs
13551362 // Link should match `# Trait implementations`
13561363
1357- print_higher_ranked_params_with_space ( & bare_fn. generic_params , cx) . fmt ( f) ?;
1364+ print_higher_ranked_params_with_space ( & bare_fn. generic_params , cx, "for" ) . fmt ( f) ?;
13581365 bare_fn. safety . print_with_space ( ) . fmt ( f) ?;
13591366 print_abi_with_space ( bare_fn. abi ) . fmt ( f) ?;
13601367 let ellipsis = if bare_fn. decl . c_variadic { ", ..." } else { "" } ;
0 commit comments