@@ -282,7 +282,8 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
282
282
283
283
match pred {
284
284
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) ?;
286
287
ty. print ( cx) . fmt ( f) ?;
287
288
f. write_str ( ":" ) ?;
288
289
if !bounds. is_empty ( ) {
@@ -386,7 +387,7 @@ impl clean::ConstantKind {
386
387
impl clean:: PolyTrait {
387
388
fn print < ' a , ' tcx : ' a > ( & ' a self , cx : & ' a Context < ' tcx > ) -> impl Display + ' a + Captures < ' tcx > {
388
389
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) ?;
390
391
self . trait_ . print ( cx) . fmt ( f)
391
392
} )
392
393
}
@@ -968,10 +969,12 @@ fn tybounds<'a, 'tcx: 'a>(
968
969
fn print_higher_ranked_params_with_space < ' a , ' tcx : ' a > (
969
970
params : & ' a [ clean:: GenericParamDef ] ,
970
971
cx : & ' a Context < ' tcx > ,
972
+ keyword : & ' static str ,
971
973
) -> impl Display + ' a + Captures < ' tcx > {
972
974
display_fn ( move |f| {
973
975
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 { "<" } ) ?;
975
978
comma_sep ( params. iter ( ) . map ( |lt| lt. print ( cx) ) , true ) . fmt ( f) ?;
976
979
f. write_str ( if f. alternate ( ) { "> " } else { "> " } ) ?;
977
980
}
@@ -1027,7 +1030,7 @@ fn fmt_type(
1027
1030
primitive_link ( f, prim, format_args ! ( "{}" , prim. as_sym( ) . as_str( ) ) , cx)
1028
1031
}
1029
1032
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) ?;
1031
1034
decl. safety . print_with_space ( ) . fmt ( f) ?;
1032
1035
print_abi_with_space ( decl. abi ) . fmt ( f) ?;
1033
1036
if f. alternate ( ) {
@@ -1037,6 +1040,10 @@ fn fmt_type(
1037
1040
}
1038
1041
decl. decl . print ( cx) . fmt ( f)
1039
1042
}
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
+ }
1040
1047
clean:: Tuple ( ref typs) => match & typs[ ..] {
1041
1048
& [ ] => primitive_link ( f, PrimitiveType :: Unit , format_args ! ( "()" ) , cx) ,
1042
1049
[ one] => {
@@ -1354,7 +1361,7 @@ impl clean::Impl {
1354
1361
// Hardcoded anchor library/core/src/primitive_docs.rs
1355
1362
// Link should match `# Trait implementations`
1356
1363
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) ?;
1358
1365
bare_fn. safety . print_with_space ( ) . fmt ( f) ?;
1359
1366
print_abi_with_space ( bare_fn. abi ) . fmt ( f) ?;
1360
1367
let ellipsis = if bare_fn. decl . c_variadic { ", ..." } else { "" } ;
0 commit comments