Do not consider macro-origin await as chain item (#3671)

This commit is contained in:
Seiichi Uchida 2019-07-06 14:17:53 +09:00 committed by GitHub
parent ff49b80628
commit 3200af9785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -168,7 +168,7 @@ impl ChainItemKind {
let span = mk_sp(nested.span.hi(), field.span.hi());
(kind, span)
}
ast::ExprKind::Await(_, ref nested) => {
ast::ExprKind::Await(ast::AwaitOrigin::FieldLike, ref nested) => {
let span = mk_sp(nested.span.hi(), expr.span.hi());
(ChainItemKind::Await, span)
}
@ -396,7 +396,9 @@ impl Chain {
}
ast::ExprKind::Field(ref subexpr, _)
| ast::ExprKind::Try(ref subexpr)
| ast::ExprKind::Await(_, ref subexpr) => Some(Self::convert_try(subexpr, context)),
| ast::ExprKind::Await(ast::AwaitOrigin::FieldLike, ref subexpr) => {
Some(Self::convert_try(subexpr, context))
}
_ => None,
}
}

View File

@ -19,3 +19,8 @@ async unsafe fn rust() {
Ok(())
}
}
async fn await_macro() {
await ! (
something)?;
}

View File

@ -18,3 +18,7 @@ async unsafe fn rust() {
Ok(())
}
}
async fn await_macro() {
await!(something)?;
}