@@ -30,7 +30,7 @@ use super::url_parts_builder::{UrlPartsBuilder, estimate_item_path_byte_length};
3030use crate :: clean:: types:: ExternalLocation ;
3131use crate :: clean:: utils:: find_nearest_parent_module;
3232use crate :: clean:: { self , ExternalCrate , PrimitiveType } ;
33- use crate :: display:: Joined as _;
33+ use crate :: display:: { Joined as _, MaybeDisplay as _ } ;
3434use crate :: formats:: cache:: Cache ;
3535use crate :: formats:: item_type:: ItemType ;
3636use crate :: html:: escape:: { Escape , EscapeBodyText } ;
@@ -178,12 +178,12 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
178178 cx : & ' a Context < ' tcx > ,
179179 indent : usize ,
180180 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+ }
186185
186+ Some ( fmt:: from_fn ( move |f| {
187187 let where_preds = fmt:: from_fn ( |f| {
188188 gens. where_predicates
189189 . iter ( )
@@ -246,7 +246,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
246246 }
247247 } ;
248248 write ! ( f, "{clause}" )
249- } )
249+ } ) )
250250}
251251
252252impl clean:: Lifetime {
@@ -1179,7 +1179,7 @@ impl clean::Impl {
11791179 self . print_type ( & self . for_ , f, use_absolute, cx) ?;
11801180 }
11811181
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)
11831183 } )
11841184 }
11851185 fn print_type < ' a , ' tcx : ' a > (
0 commit comments