]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/issue_4266.rs
Rollup merge of #102345 - chenyukang:fix-102182-impl-trait, r=estebank
[rust.git] / src / tools / clippy / tests / ui / issue_4266.rs
1 #![allow(dead_code)]
2 #![allow(clippy::uninlined_format_args)]
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 new(&mut self) -> Self {
29         Foo {}
30     }
31 }
32
33 // rust-lang/rust#61115
34 // ok
35 async fn print(s: &str) {
36     println!("{}", s);
37 }
38
39 fn main() {}