Mac calls

This commit is contained in:
David Tolnay 2022-01-29 22:16:35 -08:00
parent 47f92a58a4
commit 858d6a0711
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 17 additions and 5 deletions

View file

@ -1237,15 +1237,17 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool {
impl Visitor<'_> for MayContainYieldPoint {
fn visit_expr(&mut self, e: &ast::Expr) {
if let ast::ExprKind::Await(_) | ast::ExprKind::Yield(_) | ast::ExprKind::MacCall(_) =
e.kind
{
if let ast::ExprKind::Await(_) | ast::ExprKind::Yield(_) = e.kind {
self.0 = true;
} else {
visit::walk_expr(self, e);
}
}
fn visit_mac_call(&mut self, _: &ast::MacCall) {
self.0 = true;
}
fn visit_attribute(&mut self, _: &ast::Attribute) {
// Conservatively assume this may be a proc macro attribute in
// expression position.