1
Fork 0

Allow ~const bounds on inherent impls

This commit is contained in:
Deadbeef 2021-09-03 10:37:57 +00:00
parent 146abdd119
commit f749e05f6b
No known key found for this signature in database
GPG key ID: 027DF9338862ADDD
2 changed files with 24 additions and 1 deletions

View file

@ -1655,7 +1655,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
walk_list!(self, visit_ty, ty);
}
AssocItemKind::Fn(box FnKind(_, ref sig, ref generics, ref body))
if self.in_const_trait_impl || ctxt == AssocCtxt::Trait =>
if self.in_const_trait_impl
|| ctxt == AssocCtxt::Trait
|| matches!(sig.header.constness, Const::Yes(_)) =>
{
self.visit_vis(&item.vis);
self.visit_ident(item.ident);