1
Fork 0

gate const closures

This commit is contained in:
Deadbeef 2022-12-21 14:51:02 +00:00
parent 4fb10c0ce4
commit e7fea8c7e6
5 changed files with 28 additions and 1 deletions

View file

@ -385,6 +385,14 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
ast::ExprKind::TryBlock(_) => {
gate_feature_post!(&self, try_blocks, e.span, "`try` expression is experimental");
}
ast::ExprKind::Closure(box ast::Closure { constness: ast::Const::Yes(_), .. }) => {
gate_feature_post!(
&self,
const_closures,
e.span,
"const closures are experimental"
);
}
_ => {}
}
visit::walk_expr(self, e)