2019-07-18 13:43:10 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
async fn sink1<'a>(_: &'a str) {} // lint
|
|
|
|
async fn sink1_elided(_: &str) {} // ok
|
2019-07-18 13:43:10 -05:00
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
// lint
|
|
|
|
async fn one_to_one<'a>(s: &'a str) -> &'a str {
|
|
|
|
s
|
|
|
|
}
|
2019-07-19 10:03:34 -05:00
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
// ok
|
|
|
|
async fn one_to_one_elided(s: &str) -> &str {
|
|
|
|
s
|
|
|
|
}
|
2019-07-19 10:03:34 -05:00
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
// ok
|
|
|
|
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
|
|
|
|
a
|
|
|
|
}
|
2019-07-18 13:43:10 -05:00
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
|
2019-07-18 13:43:10 -05:00
|
|
|
|
2019-07-22 13:57:49 -05:00
|
|
|
// #3988
|
|
|
|
struct Foo;
|
|
|
|
impl Foo {
|
2019-07-19 11:50:18 -05:00
|
|
|
// ok
|
2021-07-19 04:52:05 -05:00
|
|
|
pub async fn new(&mut self) -> Self {
|
|
|
|
Foo {}
|
|
|
|
}
|
2019-07-22 13:57:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// rust-lang/rust#61115
|
|
|
|
// ok
|
|
|
|
async fn print(s: &str) {
|
|
|
|
println!("{}", s);
|
2019-07-18 13:43:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|