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