]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/issue_4266.rs
New upstream version 1.52.1+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
28 pub async fn foo(&mut self) {}
29}
30
31// rust-lang/rust#61115
32// ok
33async fn print(s: &str) {
34 println!("{}", s);
35}
36
37fn main() {}