update the async-fn-multiple-lifetimes test
This commit is contained in:
parent
b5fb906766
commit
2057136326
2 changed files with 4 additions and 23 deletions
|
@ -1,11 +1,13 @@
|
|||
// edition:2018
|
||||
// run-pass
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, pin)]
|
||||
// Test that we can use async fns with multiple arbitrary lifetimes.
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro)]
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {}
|
||||
//~^ ERROR ambiguous lifetime bound in `async fn`
|
||||
|
||||
async fn multiple_hrtb_and_single_named_lifetime_ok<'c>(
|
||||
_: impl for<'a> Add<&'a u8>,
|
||||
|
@ -14,6 +16,5 @@ async fn multiple_hrtb_and_single_named_lifetime_ok<'c>(
|
|||
) {}
|
||||
|
||||
async fn multiple_elided_lifetimes(_: &u8, _: &u8) {}
|
||||
//~^ ambiguous lifetime bound in `async fn`
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
error: ambiguous lifetime bound in `async fn`
|
||||
--> $DIR/async-fn-multiple-lifetimes.rs:7:65
|
||||
|
|
||||
LL | async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {}
|
||||
| ^ neither `'a` nor `'b` outlives the other
|
||||
|
|
||||
= note: multiple unrelated lifetimes are not allowed in `async fn`.
|
||||
= note: if you're using argument-position elided lifetimes, consider switching to a single named lifetime.
|
||||
|
||||
error: ambiguous lifetime bound in `async fn`
|
||||
--> $DIR/async-fn-multiple-lifetimes.rs:16:52
|
||||
|
|
||||
LL | async fn multiple_elided_lifetimes(_: &u8, _: &u8) {}
|
||||
| ^ the elided lifetimes here do not outlive one another
|
||||
|
|
||||
= note: multiple unrelated lifetimes are not allowed in `async fn`.
|
||||
= note: if you're using argument-position elided lifetimes, consider switching to a single named lifetime.
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue