Async methods
This commit is contained in:
parent
d02631d3df
commit
d64e577fa3
8 changed files with 122 additions and 79 deletions
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue