]> git.lizzy.rs Git - rust.git/blob - tests/ui/issue_4266.rs
Add test
[rust.git] / tests / ui / issue_4266.rs
1 // compile-flags: --edition 2018
2 #![feature(async_await)]
3 #![allow(dead_code)]
4
5 async fn sink1<'a>(_: &'a str) {} // lint
6 async fn sink1_elided(_: &str) {} // ok
7
8 async fn one_to_one<'a>(s: &'a str) -> &'a str { s } // lint
9 async fn one_to_one_elided(s: &str) -> &str { s } // ok
10 async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str { a } // ok
11 // async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
12
13 // #3988
14 struct Foo;
15 impl Foo {
16     pub async fn foo(&mut self) {} // ok
17 }
18
19 // rust-lang/rust#61115
20 async fn print(s: &str) { // ok
21     println!("{}", s);
22 }
23
24 fn main() {}