]> git.lizzy.rs Git - rust.git/blob - tests/ui/issue_4266.rs
Revert global fmt config and use `rustfmt::skip`
[rust.git] / tests / ui / issue_4266.rs
1 // compile-flags: --edition 2018
2 #![feature(async_await)]
3 #![allow(dead_code)]
4
5 // No edition 2018
6 #[rustfmt::skip]
7 mod m {
8     async fn sink1<'a>(_: &'a str) {} // lint
9     async fn sink1_elided(_: &str) {} // ok
10
11     // lint
12     async fn one_to_one<'a>(s: &'a str) -> &'a str {
13         s
14     }
15
16     // ok
17     async fn one_to_one_elided(s: &str) -> &str {
18         s
19     }
20
21     // ok
22     async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
23         a
24     }
25
26     // async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
27
28     // #3988
29     struct Foo;
30     impl Foo {
31         // ok
32         pub async fn foo(&mut self) {}
33     }
34
35     // rust-lang/rust#61115
36     // ok
37     async fn print(s: &str) {
38         println!("{}", s);
39     }
40 }
41
42 fn main() {}