Skip to content

Commit 40a63cb

Browse files
Make tools happy
1 parent 86f50b9 commit 40a63cb

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/librustdoc/html/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
};

src/librustdoc/json/conversions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/tools/rustfmt/src/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)