This repository was archived by the owner on May 28, 2025. It is now read-only.
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 {
439439 let modifier_str = match modifier {
440440 hir:: TraitBoundModifier :: None => "" ,
441441 hir:: TraitBoundModifier :: Maybe => "?" ,
442+ hir:: TraitBoundModifier :: Negative => "!" ,
442443 // ~const is experimental; do not display those bounds in rustdoc
443444 hir:: TraitBoundModifier :: MaybeConst => "" ,
444445 } ;
Original file line number Diff line number Diff line change @@ -533,6 +533,10 @@ pub(crate) fn from_trait_bound_modifier(
533533 None => TraitBoundModifier :: None ,
534534 Maybe => TraitBoundModifier :: Maybe ,
535535 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 ,
536540 }
537541}
538542
Original file line number Diff line number Diff line change @@ -552,6 +552,8 @@ impl Rewrite for ast::GenericBound {
552552 ast:: TraitBoundModifier :: MaybeConstMaybe => poly_trait_ref
553553 . rewrite ( context, shape. offset_left ( 8 ) ?)
554554 . map ( |s| format ! ( "~const ?{}" , s) ) ,
555+ rustc_ast:: TraitBoundModifier :: Negative
556+ | rustc_ast:: TraitBoundModifier :: MaybeConstNegative => None ,
555557 } ;
556558 rewrite. map ( |s| if has_paren { format ! ( "({})" , s) } else { s } )
557559 }
You can’t perform that action at this time.
0 commit comments