Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obk
Implement negative bounds for internal testing purposes Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature. Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
This commit is contained in:
commit
80df4ab403
42 changed files with 481 additions and 188 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue