Async methods

This commit is contained in:
Taylor Cramer 2018-06-18 21:18:10 -07:00
parent d02631d3df
commit d64e577fa3
8 changed files with 122 additions and 79 deletions

View file

@ -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))
}
}
}

View file

@ -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