1
Fork 0

Refactor AST trait bound modifiers

This commit is contained in:
León Orell Valerian Liehr 2023-12-20 15:22:06 +01:00
parent bf9229a2e3
commit 5e4f12b41a
No known key found for this signature in database
GPG key ID: D17A07215F68E713
16 changed files with 195 additions and 201 deletions

View file

@ -134,10 +134,13 @@ impl<'a> ExtCtxt<'a> {
pub fn trait_bound(&self, path: ast::Path, is_const: bool) -> ast::GenericBound {
ast::GenericBound::Trait(
self.poly_trait_ref(path.span, path),
if is_const {
ast::TraitBoundModifier::MaybeConst(DUMMY_SP)
} else {
ast::TraitBoundModifier::None
ast::TraitBoundModifiers {
polarity: ast::BoundPolarity::Positive,
constness: if is_const {
ast::BoundConstness::Maybe(DUMMY_SP)
} else {
ast::BoundConstness::Never
},
},
)
}