@@ -30,7 +30,7 @@ use super::url_parts_builder::{UrlPartsBuilder, estimate_item_path_byte_length};
30
30
use crate :: clean:: types:: ExternalLocation ;
31
31
use crate :: clean:: utils:: find_nearest_parent_module;
32
32
use crate :: clean:: { self , ExternalCrate , PrimitiveType } ;
33
- use crate :: display:: Joined as _;
33
+ use crate :: display:: { Joined as _, MaybeDisplay as _ } ;
34
34
use crate :: formats:: cache:: Cache ;
35
35
use crate :: formats:: item_type:: ItemType ;
36
36
use crate :: html:: escape:: { Escape , EscapeBodyText } ;
@@ -178,12 +178,12 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
178
178
cx : & ' a Context < ' tcx > ,
179
179
indent : usize ,
180
180
ending : Ending ,
181
- ) -> impl Display + ' a + Captures < ' tcx > {
182
- fmt:: from_fn ( move |f| {
183
- if gens. where_predicates . is_empty ( ) {
184
- return Ok ( ( ) ) ;
185
- }
181
+ ) -> Option < impl Display + ' a + Captures < ' tcx > > {
182
+ if gens. where_predicates . is_empty ( ) {
183
+ return None ;
184
+ }
186
185
186
+ Some ( fmt:: from_fn ( move |f| {
187
187
let where_preds = fmt:: from_fn ( |f| {
188
188
gens. where_predicates
189
189
. iter ( )
@@ -246,7 +246,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
246
246
}
247
247
} ;
248
248
write ! ( f, "{clause}" )
249
- } )
249
+ } ) )
250
250
}
251
251
252
252
impl clean:: Lifetime {
@@ -1179,7 +1179,7 @@ impl clean::Impl {
1179
1179
self . print_type ( & self . for_ , f, use_absolute, cx) ?;
1180
1180
}
1181
1181
1182
- print_where_clause ( & self . generics , cx, 0 , Ending :: Newline ) . fmt ( f)
1182
+ print_where_clause ( & self . generics , cx, 0 , Ending :: Newline ) . maybe_display ( ) . fmt ( f)
1183
1183
} )
1184
1184
}
1185
1185
fn print_type < ' a , ' tcx : ' a > (
0 commit comments