mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Make tools happy
This commit is contained in:
parent
86f50b9f5c
commit
40a63cb06f
@ -439,6 +439,7 @@ impl clean::GenericBound {
|
||||
let modifier_str = match modifier {
|
||||
hir::TraitBoundModifier::None => "",
|
||||
hir::TraitBoundModifier::Maybe => "?",
|
||||
hir::TraitBoundModifier::Negative => "!",
|
||||
// ~const is experimental; do not display those bounds in rustdoc
|
||||
hir::TraitBoundModifier::MaybeConst => "",
|
||||
};
|
||||
|
@ -533,6 +533,10 @@ pub(crate) fn from_trait_bound_modifier(
|
||||
None => TraitBoundModifier::None,
|
||||
Maybe => TraitBoundModifier::Maybe,
|
||||
MaybeConst => TraitBoundModifier::MaybeConst,
|
||||
// FIXME(negative-bounds): This bound should be rendered negative, but
|
||||
// since that's experimental, maybe let's not add it to the rustdoc json
|
||||
// API just now...
|
||||
Negative => TraitBoundModifier::None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -552,6 +552,8 @@ impl Rewrite for ast::GenericBound {
|
||||
ast::TraitBoundModifier::MaybeConstMaybe => poly_trait_ref
|
||||
.rewrite(context, shape.offset_left(8)?)
|
||||
.map(|s| format!("~const ?{}", s)),
|
||||
rustc_ast::TraitBoundModifier::Negative
|
||||
| rustc_ast::TraitBoundModifier::MaybeConstNegative => None,
|
||||
};
|
||||
rewrite.map(|s| if has_paren { format!("({})", s) } else { s })
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user