diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-08 15:06:26 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-08 15:06:26 +0200 |
| commit | 43a2cbdfd33b02be90ab1616e1b706142fa5d498 (patch) | |
| tree | 2845a91ed0e45ca9bb7655e49cc4797ac8b89d69 /src/test/ui/self/elision/struct-async.rs | |
| parent | 04523404bcae5904fe29a54122040a7101f5c652 (diff) | |
| download | rust-43a2cbdfd33b02be90ab1616e1b706142fa5d498.tar.gz rust-43a2cbdfd33b02be90ab1616e1b706142fa5d498.zip | |
lifetime elision: add conforming-to-fn tests.
Diffstat (limited to 'src/test/ui/self/elision/struct-async.rs')
| -rw-r--r-- | src/test/ui/self/elision/struct-async.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/ui/self/elision/struct-async.rs b/src/test/ui/self/elision/struct-async.rs new file mode 100644 index 00000000000..f7c8591ebd3 --- /dev/null +++ b/src/test/ui/self/elision/struct-async.rs @@ -0,0 +1,35 @@ +// check-pass +// edition:2018 + +#![feature(async_await)] + +#![feature(arbitrary_self_types)] +#![allow(non_snake_case)] + +use std::rc::Rc; + +struct Struct { } + +impl Struct { + async fn ref_Struct(self: Struct, f: &u32) -> &u32 { + f + } + + async fn box_Struct(self: Box<Struct>, f: &u32) -> &u32 { + f + } + + async fn rc_Struct(self: Rc<Struct>, f: &u32) -> &u32 { + f + } + + async fn box_box_Struct(self: Box<Box<Struct>>, f: &u32) -> &u32 { + f + } + + async fn box_rc_Struct(self: Box<Rc<Struct>>, f: &u32) -> &u32 { + f + } +} + +fn main() { } |
