Expand const-if-const trait bounds correctly
This commit is contained in:
parent
e1eaa2d5d4
commit
56bf28d4f4
4 changed files with 23 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue