diff options
| author | Taylor Cramer <cramertj@google.com> | 2018-06-18 21:18:10 -0700 |
|---|---|---|
| committer | Taylor Cramer <cramertj@google.com> | 2018-06-21 22:38:05 -0700 |
| commit | d64e577fa3220a7a26dbfd54d503240f5856cc2a (patch) | |
| tree | 1ee76c45da9aab30c7c67c6156b0bf68c6c4d4b0 /src/test | |
| parent | d02631d3dfd71b446648fa1c8a41c9f099cf89f8 (diff) | |
| download | rust-d64e577fa3220a7a26dbfd54d503240f5856cc2a.tar.gz rust-d64e577fa3220a7a26dbfd54d503240f5856cc2a.zip | |
Async methods
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/async-await.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/async-fn-multiple-lifetimes.stderr | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/test/run-pass/async-await.rs b/src/test/run-pass/async-await.rs index bc8b8a152fb..817db4bb79e 100644 --- a/src/test/run-pass/async-await.rs +++ b/src/test/run-pass/async-await.rs @@ -104,10 +104,16 @@ unsafe async fn unsafe_async_fn(x: u8) -> u8 { x } -struct Foo { +struct Foo; + +trait Bar { + fn foo() {} +} + +impl Foo { async fn async_method(x: u8) -> u8 { unsafe { - await!(unsafe_async_fn()) + await!(unsafe_async_fn(x)) } } } diff --git a/src/test/ui/async-fn-multiple-lifetimes.stderr b/src/test/ui/async-fn-multiple-lifetimes.stderr index 227dd4483f2..085b9499a41 100644 --- a/src/test/ui/async-fn-multiple-lifetimes.stderr +++ b/src/test/ui/async-fn-multiple-lifetimes.stderr @@ -6,7 +6,7 @@ LL | async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {} | | | first lifetime here | - = help: `async fn` can only accept borrowed values identical lifetimes + = help: `async fn` can only accept borrowed values with identical lifetimes error[E0704]: multiple elided lifetimes used in arguments of `async fn` --> $DIR/async-fn-multiple-lifetimes.rs:26:39 |
