Refactor AST trait bound modifiers
This commit is contained in:
parent
bf9229a2e3
commit
5e4f12b41a
16 changed files with 195 additions and 201 deletions
|
@ -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
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue