Add ~const bounds trait bounds when using derive_const
This commit is contained in:
parent
56bf28d4f4
commit
7a4505900d
5 changed files with 46 additions and 12 deletions
|
@ -131,10 +131,14 @@ impl<'a> ExtCtxt<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn trait_bound(&self, path: ast::Path) -> ast::GenericBound {
|
||||
pub fn trait_bound(&self, path: ast::Path, is_const: bool) -> ast::GenericBound {
|
||||
ast::GenericBound::Trait(
|
||||
self.poly_trait_ref(path.span, path),
|
||||
ast::TraitBoundModifier::None,
|
||||
if is_const {
|
||||
ast::TraitBoundModifier::MaybeConst
|
||||
} else {
|
||||
ast::TraitBoundModifier::None
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue