1
Fork 0

Expand const-if-const trait bounds correctly

This commit is contained in:
Michael Goulet 2023-02-07 20:22:42 +00:00
parent e1eaa2d5d4
commit 56bf28d4f4
4 changed files with 23 additions and 5 deletions

View file

@ -1567,8 +1567,18 @@ impl<'a> State<'a> {
match bound {
GenericBound::Trait(tref, modifier) => {
if modifier == &TraitBoundModifier::Maybe {
self.word("?");
match modifier {
TraitBoundModifier::None => {}
TraitBoundModifier::Maybe => {
self.word("?");
}
TraitBoundModifier::MaybeConst => {
self.word_space("~const");
}
TraitBoundModifier::MaybeConstMaybe => {
self.word_space("~const");
self.word("?");
}
}
self.print_poly_trait_ref(tref);
}