diff options
| author | bors <bors@rust-lang.org> | 2018-06-23 09:02:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-23 09:02:45 +0000 |
| commit | 56e8f29dbe89f2109cacc8eb5e92ea3de32eefb9 (patch) | |
| tree | 8630b3d600677d35ce9c956fbfe12923b57e302d /src/test | |
| parent | 2ea922a96d676ff84cd78421d314e6aac305b5e9 (diff) | |
| parent | 30c17ccbffdbb88020e6ed42d89cc214fc3e6e5f (diff) | |
Auto merge of #51580 - cramertj:async-await, r=eddyb
async/await This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3. Based on https://github.com/rust-lang/rust/pull/51414. cc @petrochenkov for parsing changes. r? @eddyb
Diffstat (limited to 'src/test')
23 files changed, 355 insertions, 21 deletions
diff --git a/src/test/parse-fail/issue-20711-2.rs b/src/test/parse-fail/issue-20711-2.rs index 3a330d8bee2..05df16d21d8 100644 --- a/src/test/parse-fail/issue-20711-2.rs +++ b/src/test/parse-fail/issue-20711-2.rs @@ -16,6 +16,6 @@ impl Foo { fn foo() {} #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe` +} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or fn main() {} diff --git a/src/test/parse-fail/issue-20711.rs b/src/test/parse-fail/issue-20711.rs index cd79fa8be7c..f30e20ad7db 100644 --- a/src/test/parse-fail/issue-20711.rs +++ b/src/test/parse-fail/issue-20711.rs @@ -14,6 +14,6 @@ struct Foo; impl Foo { #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe` +} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or fn main() {} diff --git a/src/test/parse-fail/removed-syntax-static-fn.rs b/src/test/parse-fail/removed-syntax-static-fn.rs index 3b783aa79e2..fbc6848f372 100644 --- a/src/test/parse-fail/removed-syntax-static-fn.rs +++ b/src/test/parse-fail/removed-syntax-static-fn.rs @@ -15,4 +15,4 @@ struct S; impl S { static fn f() {} } -//~^^ ERROR expected one of `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe` +//~^^ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, diff --git a/src/test/parse-fail/trait-non-item-macros.rs b/src/test/parse-fail/trait-non-item-macros.rs index fd356f4a817..9f94d5d41fd 100644 --- a/src/test/parse-fail/trait-non-item-macros.rs +++ b/src/test/parse-fail/trait-non-item-macros.rs @@ -10,7 +10,7 @@ macro_rules! bah { ($a:expr) => ($a) - //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `2` + //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `2` } trait bar { diff --git a/src/test/parse-fail/trait-pub-assoc-const.rs b/src/test/parse-fail/trait-pub-assoc-const.rs index 6bc24e2081d..cce6b5c4cbf 100644 --- a/src/test/parse-fail/trait-pub-assoc-const.rs +++ b/src/test/parse-fail/trait-pub-assoc-const.rs @@ -10,7 +10,7 @@ trait Foo { pub const Foo: u32; - //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found } fn main() {} diff --git a/src/test/parse-fail/trait-pub-assoc-ty.rs b/src/test/parse-fail/trait-pub-assoc-ty.rs index 493ff087eaf..d6a4e5e021d 100644 --- a/src/test/parse-fail/trait-pub-assoc-ty.rs +++ b/src/test/parse-fail/trait-pub-assoc-ty.rs @@ -10,7 +10,7 @@ trait Foo { pub type Foo; - //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found } fn main() {} diff --git a/src/test/parse-fail/trait-pub-method.rs b/src/test/parse-fail/trait-pub-method.rs index c2ee3c31d88..286cb4dbff7 100644 --- a/src/test/parse-fail/trait-pub-method.rs +++ b/src/test/parse-fail/trait-pub-method.rs @@ -10,7 +10,7 @@ trait Foo { pub fn foo(); - //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found } fn main() {} diff --git a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs index 3a848a31c4d..bbd81e790b8 100644 --- a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs @@ -124,6 +124,7 @@ fn iter_exprs(depth: usize, f: &mut FnMut(P<Expr>)) { }); iter_exprs(depth - 1, &mut |e| g( ExprKind::Closure(CaptureBy::Value, + IsAsync::NotAsync, Movability::Movable, decl.clone(), e, diff --git a/src/test/run-pass/async-await.rs b/src/test/run-pass/async-await.rs new file mode 100644 index 00000000000..817db4bb79e --- /dev/null +++ b/src/test/run-pass/async-await.rs @@ -0,0 +1,152 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --edition=2018 + +#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)] + +use std::boxed::PinBox; +use std::mem::PinMut; +use std::future::Future; +use std::sync::{ + Arc, + atomic::{self, AtomicUsize}, +}; +use std::task::{ + Context, Poll, Wake, + Executor, TaskObj, SpawnObjError, + local_waker_from_nonlocal, +}; + +struct Counter { + wakes: AtomicUsize, +} + +impl Wake for Counter { + fn wake(this: &Arc<Self>) { + this.wakes.fetch_add(1, atomic::Ordering::SeqCst); + } +} + +struct NoopExecutor; +impl Executor for NoopExecutor { + fn spawn_obj(&mut self, _: TaskObj) -> Result<(), SpawnObjError> { + Ok(()) + } +} + +struct WakeOnceThenComplete(bool); + +fn wake_and_yield_once() -> WakeOnceThenComplete { WakeOnceThenComplete(false) } + +impl Future for WakeOnceThenComplete { + type Output = (); + fn poll(mut self: PinMut<Self>, cx: &mut Context) -> Poll<()> { + if self.0 { + Poll::Ready(()) + } else { + cx.waker().wake(); + self.0 = true; + Poll::Pending + } + } +} + +fn async_block(x: u8) -> impl Future<Output = u8> { + async move { + await!(wake_and_yield_once()); + x + } +} + +fn async_nonmove_block(x: u8) -> impl Future<Output = u8> { + async move { + let future = async { + await!(wake_and_yield_once()); + x + }; + await!(future) + } +} + +fn async_closure(x: u8) -> impl Future<Output = u8> { + (async move |x: u8| -> u8 { + await!(wake_and_yield_once()); + x + })(x) +} + +async fn async_fn(x: u8) -> u8 { + await!(wake_and_yield_once()); + x +} + +async fn async_fn_with_borrow(x: &u8) -> u8 { + await!(wake_and_yield_once()); + *x +} + +fn async_fn_with_internal_borrow(y: u8) -> impl Future<Output = u8> { + async move { + await!(async_fn_with_borrow(&y)) + } +} + +unsafe async fn unsafe_async_fn(x: u8) -> u8 { + await!(wake_and_yield_once()); + x +} + +struct Foo; + +trait Bar { + fn foo() {} +} + +impl Foo { + async fn async_method(x: u8) -> u8 { + unsafe { + await!(unsafe_async_fn(x)) + } + } +} + +fn test_future_yields_once_then_returns<F, Fut>(f: F) +where + F: FnOnce(u8) -> Fut, + Fut: Future<Output = u8>, +{ + let mut fut = PinBox::new(f(9)); + let counter = Arc::new(Counter { wakes: AtomicUsize::new(0) }); + let waker = local_waker_from_nonlocal(counter.clone()); + let executor = &mut NoopExecutor; + let cx = &mut Context::new(&waker, executor); + + assert_eq!(0, counter.wakes.load(atomic::Ordering::SeqCst)); + assert_eq!(Poll::Pending, fut.as_pin_mut().poll(cx)); + assert_eq!(1, counter.wakes.load(atomic::Ordering::SeqCst)); + assert_eq!(Poll::Ready(9), fut.as_pin_mut().poll(cx)); +} + +fn main() { + macro_rules! test { + ($($fn_name:ident,)*) => { $( + test_future_yields_once_then_returns($fn_name); + )* } + } + + test! { + async_block, + async_nonmove_block, + async_closure, + async_fn, + async_fn_with_internal_borrow, + } +} diff --git a/src/test/ui/async-fn-multiple-lifetimes.rs b/src/test/ui/async-fn-multiple-lifetimes.rs new file mode 100644 index 00000000000..ce062ded7f7 --- /dev/null +++ b/src/test/ui/async-fn-multiple-lifetimes.rs @@ -0,0 +1,30 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --edition=2018 + +#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)] + +use std::ops::Add; + +async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {} +//~^ ERROR multiple different lifetimes used in arguments of `async fn` + +async fn multiple_hrtb_and_single_named_lifetime_ok<'c>( + _: impl for<'a> Add<&'a u8>, + _: impl for<'b> Add<&'b u8>, + _: &'c u8, +) {} + +async fn multiple_elided_lifetimes(_: &u8, _: &u8) {} +//~^ ERROR multiple elided lifetimes used +//~^^ ERROR missing lifetime specifier + +fn main() {} diff --git a/src/test/ui/async-fn-multiple-lifetimes.stderr b/src/test/ui/async-fn-multiple-lifetimes.stderr new file mode 100644 index 00000000000..d76bfc5d0e1 --- /dev/null +++ b/src/test/ui/async-fn-multiple-lifetimes.stderr @@ -0,0 +1,32 @@ +error[E0725]: multiple different lifetimes used in arguments of `async fn` + --> $DIR/async-fn-multiple-lifetimes.rs:17:49 + | +LL | async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {} + | --^^^^^^^^^-- different lifetime here + | | + | first lifetime here + | + = help: `async fn` can only accept borrowed values with identical lifetimes + +error[E0726]: multiple elided lifetimes used in arguments of `async fn` + --> $DIR/async-fn-multiple-lifetimes.rs:26:39 + | +LL | async fn multiple_elided_lifetimes(_: &u8, _: &u8) {} + | -^^^^^^^- different lifetime here + | | + | first lifetime here + | + = help: consider giving these arguments named lifetimes + +error[E0106]: missing lifetime specifier + --> $DIR/async-fn-multiple-lifetimes.rs:26:39 + | +LL | async fn multiple_elided_lifetimes(_: &u8, _: &u8) {} + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_` or `_` + +error: aborting due to 3 previous errors + +Some errors occurred: E0106, E0725, E0726. +For more information about an error, try `rustc --explain E0106`. diff --git a/src/test/ui/did_you_mean/issue-40006.stderr b/src/test/ui/did_you_mean/issue-40006.stderr index a3433939573..d3ce2cf12f2 100644 --- a/src/test/ui/did_you_mean/issue-40006.stderr +++ b/src/test/ui/did_you_mean/issue-40006.stderr @@ -38,11 +38,11 @@ LL | L = M; //~ ERROR missing LL | | Z = { 2 + 3 }; //~ ERROR expected one of | |____^ missing `fn`, `type`, or `const` -error: expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;` +error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;` --> $DIR/issue-40006.rs:23:18 | LL | Z = { 2 + 3 }; //~ ERROR expected one of - | ^ expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}` here + | ^ expected one of 7 possible tokens here error: expected one of `!` or `::`, found `(` --> $DIR/issue-40006.rs:24:9 diff --git a/src/test/ui/edition-keywords-2018-2015-parsing.rs b/src/test/ui/edition-keywords-2018-2015-parsing.rs index 29c5ea41f1f..02dc8c87956 100644 --- a/src/test/ui/edition-keywords-2018-2015-parsing.rs +++ b/src/test/ui/edition-keywords-2018-2015-parsing.rs @@ -25,7 +25,7 @@ pub fn check_async() { r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` r#async = consumes_async_raw!(r#async); // OK - if passes_ident!(async) == 1 {} //~ ERROR expected expression, found reserved keyword `async` + if passes_ident!(async) == 1 {} if passes_ident!(r#async) == 1 {} // OK module::async(); //~ ERROR expected identifier, found reserved keyword `async` module::r#async(); // OK diff --git a/src/test/ui/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/edition-keywords-2018-2015-parsing.stderr index 0b3ca57bfab..ceab5ea730e 100644 --- a/src/test/ui/edition-keywords-2018-2015-parsing.stderr +++ b/src/test/ui/edition-keywords-2018-2015-parsing.stderr @@ -22,11 +22,11 @@ error: no rules expected the token `async` LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ -error: expected expression, found reserved keyword `async` - --> $DIR/edition-keywords-2018-2015-parsing.rs:28:22 +error: expected one of `move`, `|`, or `||`, found `<eof>` + --> <passes_ident macros>:1:22 | -LL | if passes_ident!(async) == 1 {} //~ ERROR expected expression, found reserved keyword `async` - | ^^^^^ expected expression +LL | ( $ i : ident ) => ( $ i ) + | ^^^ expected one of `move`, `|`, or `||` here error: aborting due to 5 previous errors diff --git a/src/test/ui/edition-keywords-2018-2018-parsing.rs b/src/test/ui/edition-keywords-2018-2018-parsing.rs index a94808eb224..f9b4d0e18c1 100644 --- a/src/test/ui/edition-keywords-2018-2018-parsing.rs +++ b/src/test/ui/edition-keywords-2018-2018-parsing.rs @@ -25,7 +25,7 @@ pub fn check_async() { r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` r#async = consumes_async_raw!(r#async); // OK - if passes_ident!(async) == 1 {} //~ ERROR expected expression, found reserved keyword `async` + if passes_ident!(async) == 1 {} if passes_ident!(r#async) == 1 {} // OK module::async(); //~ ERROR expected identifier, found reserved keyword `async` module::r#async(); // OK diff --git a/src/test/ui/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/edition-keywords-2018-2018-parsing.stderr index 1b18d8a39be..e48aac0a2bb 100644 --- a/src/test/ui/edition-keywords-2018-2018-parsing.stderr +++ b/src/test/ui/edition-keywords-2018-2018-parsing.stderr @@ -22,11 +22,11 @@ error: no rules expected the token `async` LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ -error: expected expression, found reserved keyword `async` - --> $DIR/edition-keywords-2018-2018-parsing.rs:28:22 +error: expected one of `move`, `|`, or `||`, found `<eof>` + --> <passes_ident macros>:1:22 | -LL | if passes_ident!(async) == 1 {} //~ ERROR expected expression, found reserved keyword `async` - | ^^^^^ expected expression +LL | ( $ i : ident ) => ( $ i ) + | ^^^ expected one of `move`, `|`, or `||` here error: aborting due to 5 previous errors diff --git a/src/test/ui/feature-gate-async-await-2015-edition.rs b/src/test/ui/feature-gate-async-await-2015-edition.rs new file mode 100644 index 00000000000..b1dd6a77e97 --- /dev/null +++ b/src/test/ui/feature-gate-async-await-2015-edition.rs @@ -0,0 +1,20 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --edition=2015 + +#![feature(futures_api)] + +async fn foo() {} //~ ERROR async fn is unstable + +fn main() { + let _ = async {}; //~ ERROR cannot find struct, variant or union type `async` + let _ = async || {}; //~ ERROR cannot find value `async` in this scope +} diff --git a/src/test/ui/feature-gate-async-await-2015-edition.stderr b/src/test/ui/feature-gate-async-await-2015-edition.stderr new file mode 100644 index 00000000000..3db90a48e90 --- /dev/null +++ b/src/test/ui/feature-gate-async-await-2015-edition.stderr @@ -0,0 +1,24 @@ +error[E0422]: cannot find struct, variant or union type `async` in this scope + --> $DIR/feature-gate-async-await-2015-edition.rs:18:13 + | +LL | let _ = async {}; //~ ERROR cannot find struct, variant or union type `async` + | ^^^^^ not found in this scope + +error[E0425]: cannot find value `async` in this scope + --> $DIR/feature-gate-async-await-2015-edition.rs:19:13 + | +LL | let _ = async || {}; //~ ERROR cannot find value `async` in this scope + | ^^^^^ not found in this scope + +error[E0658]: async fn is unstable (see issue #50547) + --> $DIR/feature-gate-async-await-2015-edition.rs:15:1 + | +LL | async fn foo() {} //~ ERROR async fn is unstable + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(async_await)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +Some errors occurred: E0422, E0425, E0658. +For more information about an error, try `rustc --explain E0422`. diff --git a/src/test/ui/feature-gate-async-await.rs b/src/test/ui/feature-gate-async-await.rs new file mode 100644 index 00000000000..971b75c6dd0 --- /dev/null +++ b/src/test/ui/feature-gate-async-await.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --edition=2018 +#![feature(futures_api)] + +async fn foo() {} //~ ERROR async fn is unstable + +fn main() { + let _ = async {}; //~ ERROR async blocks are unstable + let _ = async || {}; //~ ERROR async closures are unstable +} diff --git a/src/test/ui/feature-gate-async-await.stderr b/src/test/ui/feature-gate-async-await.stderr new file mode 100644 index 00000000000..fdee6e20575 --- /dev/null +++ b/src/test/ui/feature-gate-async-await.stderr @@ -0,0 +1,27 @@ +error[E0658]: async fn is unstable (see issue #50547) + --> $DIR/feature-gate-async-await.rs:14:1 + | +LL | async fn foo() {} //~ ERROR async fn is unstable + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(async_await)] to the crate attributes to enable + +error[E0658]: async blocks are unstable (see issue #50547) + --> $DIR/feature-gate-async-await.rs:17:13 + | +LL | let _ = async {}; //~ ERROR async blocks are unstable + | ^^^^^^^^ + | + = help: add #![feature(async_await)] to the crate attributes to enable + +error[E0658]: async closures are unstable (see issue #50547) + --> $DIR/feature-gate-async-await.rs:18:13 + | +LL | let _ = async || {}; //~ ERROR async closures are unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(async_await)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/no-args-non-move-async-closure.rs b/src/test/ui/no-args-non-move-async-closure.rs new file mode 100644 index 00000000000..f2ecc447718 --- /dev/null +++ b/src/test/ui/no-args-non-move-async-closure.rs @@ -0,0 +1,18 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --edition=2018 + +#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)] + +fn main() { + let _ = async |x: u8| {}; + //~^ ERROR `async` non-`move` closures with arguments are not currently supported +} diff --git a/src/test/ui/no-args-non-move-async-closure.stderr b/src/test/ui/no-args-non-move-async-closure.stderr new file mode 100644 index 00000000000..34cd0069c04 --- /dev/null +++ b/src/test/ui/no-args-non-move-async-closure.stderr @@ -0,0 +1,11 @@ +error[E0727]: `async` non-`move` closures with arguments are not currently supported + --> $DIR/no-args-non-move-async-closure.rs:16:13 + | +LL | let _ = async |x: u8| {}; + | ^^^^^^^^^^^^^ + | + = help: consider using `let` statements to manually capture variables by reference before entering an `async move` closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0727`. diff --git a/src/test/ui/token/issue-41155.stderr b/src/test/ui/token/issue-41155.stderr index b56b95a8aaf..84dbc7ffc2f 100644 --- a/src/test/ui/token/issue-41155.stderr +++ b/src/test/ui/token/issue-41155.stderr @@ -1,8 +1,8 @@ -error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` +error: expected one of `(`, `async`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` --> $DIR/issue-41155.rs:13:1 | LL | pub - | - expected one of 7 possible tokens here + | - expected one of 8 possible tokens here LL | } //~ ERROR expected one of | ^ unexpected token |
