]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/issue_4266.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / issue_4266.rs
CommitLineData
f20569fa
XL
1// edition:2018
2#![allow(dead_code)]
3
4async fn sink1<'a>(_: &'a str) {} // lint
5async fn sink1_elided(_: &str) {} // ok
6
7// lint
8async fn one_to_one<'a>(s: &'a str) -> &'a str {
9 s
10}
11
12// ok
13async fn one_to_one_elided(s: &str) -> &str {
14 s
15}
16
17// ok
18async 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
25struct Foo;
26impl Foo {
27 // ok
136023e0
XL
28 pub async fn new(&mut self) -> Self {
29 Foo {}
30 }
f20569fa
XL
31}
32
33// rust-lang/rust#61115
34// ok
35async fn print(s: &str) {
36 println!("{}", s);
37}
38
39fn main() {}