]> git.lizzy.rs Git - rust.git/blob - tests/ui/issue_4266.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / issue_4266.rs
1 // compile-flags: --edition 2018
2 #![allow(dead_code)]
3
4 async fn sink1<'a>(_: &'a str) {} // lint
5 async fn sink1_elided(_: &str) {} // ok
6
7 // lint
8 async fn one_to_one<'a>(s: &'a str) -> &'a str {
9     s
10 }
11
12 // ok
13 async fn one_to_one_elided(s: &str) -> &str {
14     s
15 }
16
17 // ok
18 async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
19     a
20 }
21
22 // async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
23
24 // #3988
25 struct Foo;
26 impl Foo {
27     // ok
28     pub async fn foo(&mut self) {}
29 }
30
31 // rust-lang/rust#61115
32 // ok
33 async fn print(s: &str) {
34     println!("{}", s);
35 }
36
37 fn main() {}