File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ impl clean::GenericBound {
439
439
let modifier_str = match modifier {
440
440
hir:: TraitBoundModifier :: None => "" ,
441
441
hir:: TraitBoundModifier :: Maybe => "?" ,
442
+ hir:: TraitBoundModifier :: Negative => "!" ,
442
443
// ~const is experimental; do not display those bounds in rustdoc
443
444
hir:: TraitBoundModifier :: MaybeConst => "" ,
444
445
} ;
Original file line number Diff line number Diff line change @@ -533,6 +533,10 @@ pub(crate) fn from_trait_bound_modifier(
533
533
None => TraitBoundModifier :: None ,
534
534
Maybe => TraitBoundModifier :: Maybe ,
535
535
MaybeConst => TraitBoundModifier :: MaybeConst ,
536
+ // FIXME(negative-bounds): This bound should be rendered negative, but
537
+ // since that's experimental, maybe let's not add it to the rustdoc json
538
+ // API just now...
539
+ Negative => TraitBoundModifier :: None ,
536
540
}
537
541
}
538
542
Original file line number Diff line number Diff line change @@ -552,6 +552,8 @@ impl Rewrite for ast::GenericBound {
552
552
ast:: TraitBoundModifier :: MaybeConstMaybe => poly_trait_ref
553
553
. rewrite ( context, shape. offset_left ( 8 ) ?)
554
554
. map ( |s| format ! ( "~const ?{}" , s) ) ,
555
+ rustc_ast:: TraitBoundModifier :: Negative
556
+ | rustc_ast:: TraitBoundModifier :: MaybeConstNegative => None ,
555
557
} ;
556
558
rewrite. map ( |s| if has_paren { format ! ( "({})" , s) } else { s } )
557
559
}
You can’t perform that action at this time.
0 commit comments