bors
d71e9c4f10
Auto merge of #4266 - uHOOCCOOHu:fix/async_fn_lifetime, r=flip1995
...
Ignore generated fresh lifetimes in elision check
<!--
Thank you for making Clippy better!
We're collecting our changelog from pull request descriptions.
If your PR only updates to the latest nightly, you can leave the
`changelog` entry as `none`. Otherwise, please write a short comment
explaining your change.
If your PR fixes an issue, you can add "fixes #issue_number" into this
PR description. This way the issue will be automatically closed when
your PR is merged.
If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.
- [ ] Followed [lint naming conventions][lint_naming]
- [ ] Added passing UI tests (including committed `.stderr` file)
- [ ] `cargo test` passes locally
- [ ] Executed `util/dev update_lints`
- [ ] Added lint documentation
- [ ] Run `cargo fmt`
Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.
Delete this line and everything above before opening your PR -->
fixes #3988
changelog: Ignore generated fresh lifetimes in elision check.
**HELP**: It seems `tests/ui` are compiled under edition 2015, and I don't know how to add tests for this properly.
Here is the test input it had already passed:
```rust
#![feature(async_await)]
#![allow(dead_code)]
async fn sink1<'a>(_: &'a str) {} // lint
async fn sink1_elided(_: &str) {} // ok
async fn one_to_one<'a>(s: &'a str) -> &'a str { s } // lint
async fn one_to_one_elided(s: &str) -> &str { s } // ok
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str { a } // ok
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
// #3988
struct Foo;
impl Foo {
pub async fn foo(&mut self) {} // ok
}
// rust-lang/rust#61115
async fn print(s: &str) { // ok
println!("{}", s);
}
fn main() {}
```
2019-07-23 09:52:18 +00:00
..
2019-05-28 15:34:25 +02:00
2019-07-11 08:47:05 +02:00
2019-07-16 21:23:43 +02:00
2019-05-23 20:19:00 +02:00
2019-07-19 00:35:32 +02:00
2019-07-19 00:35:32 +02:00
2019-04-18 11:48:19 +02:00
2019-04-18 12:05:09 +02:00
2019-07-19 00:35:32 +02:00
2019-04-16 20:42:54 +02:00
2019-04-16 20:42:54 +02:00
2019-04-16 20:42:54 +02:00
2019-05-30 08:31:09 +02:00
2019-05-30 08:31:09 +02:00
2019-07-09 17:02:26 +02:00
2019-07-09 17:02:26 +02:00
2019-04-18 06:54:32 +02:00
2019-04-18 06:54:32 +02:00
2019-04-23 16:53:09 -07:00
2019-04-18 06:54:32 +02:00
2019-04-18 06:54:32 +02:00
2019-04-23 16:53:09 -07:00
2019-04-25 12:06:20 +02:00
2019-04-25 12:06:20 +02:00
2019-05-18 09:33:26 +02:00
2019-05-18 09:33:26 +02:00
2019-05-18 09:33:26 +02:00
2019-05-18 09:33:25 +02:00
2019-07-23 03:59:09 +08:00
2019-07-23 03:59:09 +08:00
2019-06-23 17:24:45 +02:00
2019-06-23 17:24:45 +02:00
2019-07-19 00:35:32 +02:00
2019-04-16 20:32:54 +02:00
2019-04-16 20:32:54 +02:00
2019-04-16 20:32:54 +02:00
2019-04-16 20:32:54 +02:00
2019-04-16 20:32:54 +02:00
2019-07-19 00:35:32 +02:00
2019-07-23 03:59:09 +08:00
2019-07-23 03:59:09 +08:00
2019-07-19 07:29:25 +02:00
2019-07-19 00:35:32 +02:00
2019-05-12 13:07:58 +02:00
2019-05-12 13:07:58 +02:00
2019-05-30 08:31:09 +02:00
2019-06-12 13:43:36 +02:00
2019-06-12 13:43:36 +02:00
2019-06-10 13:58:40 +03:00
2019-05-30 08:31:09 +02:00
2019-05-20 19:19:49 +02:00
2019-04-30 16:45:28 -03:00
2019-04-30 16:45:28 -03:00
2019-04-30 16:45:28 -03:00
2019-04-30 16:45:28 -03:00
2019-06-17 16:42:43 +02:00
2019-07-15 12:46:58 -05:00
2019-06-17 16:42:43 +02:00
2019-07-19 00:35:32 +02:00
2019-04-24 08:01:16 +02:00
2019-05-24 08:19:51 +02:00
2019-04-13 01:39:10 +09:00
2019-04-13 01:39:10 +09:00
2019-04-13 01:39:10 +09:00
2019-05-02 10:36:59 -04:00
2019-05-02 10:36:59 -04:00
2019-05-20 18:01:21 -06:00
2019-05-20 18:01:21 -06:00
2019-05-20 18:01:21 -06:00
2019-05-08 09:24:24 +02:00
2019-05-08 09:24:24 +02:00
2019-07-01 15:53:48 +02:00
2019-05-12 21:32:29 +02:00
2019-05-12 21:32:29 +02:00
2019-07-23 03:59:09 +08:00
2019-07-23 09:52:18 +00:00
2019-07-11 08:47:05 +02:00
2019-07-11 08:47:05 +02:00
2019-07-16 14:46:33 +02:00
2019-07-16 14:46:33 +02:00
2019-07-16 21:28:03 +02:00
2019-07-19 00:35:32 +02:00
2019-07-19 00:35:32 +02:00
2019-07-19 00:35:32 +02:00
2019-07-17 08:58:36 +02:00
2019-07-17 08:58:36 +02:00
2019-06-12 09:37:14 -03:00
2019-06-12 09:37:14 -03:00
2019-05-10 23:40:42 -07:00
2019-05-10 23:40:42 -07:00
2019-06-29 09:34:42 -04:00
2019-07-19 00:35:32 +02:00
2019-04-02 11:39:43 -03:00
2019-07-23 02:57:49 +08:00
2019-07-23 02:57:49 +08:00
2019-04-11 08:23:43 +02:00
2019-04-11 08:23:43 +02:00
2019-04-16 21:46:07 +02:00
2019-04-16 21:46:07 +02:00
2019-05-30 08:31:09 +02:00
2019-05-30 08:31:09 +02:00
2019-04-16 21:46:07 +02:00
2019-04-25 19:41:23 -07:00
2019-04-23 23:32:16 -07:00
2019-05-24 14:52:55 -04:00
2019-04-17 09:35:23 -07:00
2019-07-19 00:35:32 +02:00
2019-05-14 13:46:10 +02:00
2019-05-12 18:40:32 +02:00
2019-05-16 20:18:07 +02:00
2019-05-16 20:18:07 +02:00
2019-04-28 11:14:39 -07:00
2019-04-19 12:08:34 +02:00
2019-04-19 12:08:34 +02:00
2019-04-19 12:08:34 +02:00
2019-06-01 07:54:47 +02:00
2019-07-19 00:35:32 +02:00
2019-06-01 07:54:47 +02:00
2019-06-01 07:54:47 +02:00
2019-07-17 08:08:26 +02:00
2019-07-17 08:08:26 +02:00
2019-07-02 08:18:55 +02:00
2019-07-02 08:18:55 +02:00
2019-07-17 08:08:26 +02:00
2019-07-17 08:08:26 +02:00
2019-06-02 08:50:20 +02:00
2019-06-02 08:50:20 +02:00
2019-07-19 00:35:32 +02:00
2019-04-19 12:53:03 +02:00
2019-04-19 12:53:03 +02:00
2019-05-23 17:03:59 +02:00
2019-05-30 08:31:09 +02:00
2019-05-30 08:31:09 +02:00
2019-05-30 08:31:09 +02:00
2019-04-01 20:37:05 +02:00
2019-04-24 08:01:16 +02:00
2019-04-24 08:01:16 +02:00
2019-06-21 14:17:59 +02:00
2019-07-08 20:45:51 +02:00
2019-07-01 07:22:04 +02:00
2019-07-19 00:35:32 +02:00
2019-06-20 01:36:23 +07:00
2019-05-30 08:31:09 +02:00
2019-07-19 00:35:32 +02:00
2019-05-12 18:40:32 +02:00
2019-05-12 18:40:32 +02:00
2019-04-05 10:07:39 -04:00
2019-04-18 08:12:59 +02:00
2019-04-18 08:12:59 +02:00
2019-04-18 08:12:59 +02:00
2019-05-12 10:18:38 +02:00
2019-05-12 10:18:38 +02:00
2019-07-21 09:36:31 +02:00
2019-07-21 09:36:31 +02:00
2019-04-21 10:24:51 -07:00
2019-04-21 10:24:51 -07:00
2019-04-21 10:24:51 -07:00
2019-05-30 13:46:04 -04:00
2019-05-30 13:46:04 -04:00
2019-07-19 00:35:32 +02:00
2019-06-14 10:45:03 +02:00
2019-06-14 10:45:03 +02:00
2019-06-14 10:45:03 +02:00
2019-06-14 10:45:03 +02:00
2019-07-06 12:34:32 +07:00
2019-07-06 12:34:32 +07:00
2019-07-06 12:34:32 +07:00
2019-05-20 12:31:53 +02:00
2019-05-20 12:31:53 +02:00
2019-04-08 21:55:50 +09:00
2019-04-08 21:55:50 +09:00
2019-04-08 21:55:50 +09:00
2019-06-01 07:54:47 +02:00
2019-06-01 07:54:47 +02:00
2019-07-08 13:13:01 -03:00
2019-07-08 13:13:01 -03:00
2019-07-08 13:13:01 -03:00
2019-07-19 00:35:32 +02:00
2019-04-19 15:18:32 +02:00
2019-06-20 01:36:23 +07:00
2019-04-02 11:39:43 -03:00
2019-04-02 11:39:43 -03:00
2019-07-03 07:15:21 +02:00
2019-05-23 23:48:20 +02:00
2019-06-30 18:28:12 -04:00
2019-06-30 18:28:12 -04:00
2019-06-30 18:28:12 -04:00
2019-04-23 16:53:09 -07:00
2019-05-20 16:02:50 +02:00
2019-05-30 08:31:09 +02:00
2019-07-19 00:35:32 +02:00
2019-05-15 14:57:56 +02:00
2019-05-15 14:57:56 +02:00
2019-05-15 14:57:56 +02:00
2019-07-23 03:59:09 +08:00
2019-07-23 03:59:09 +08:00
2019-05-30 08:31:09 +02:00
2019-05-30 08:31:09 +02:00
2019-05-11 21:39:02 -07:00
2019-04-20 09:33:13 +02:00
2019-05-18 14:22:16 +09:00
2019-05-18 14:22:16 +09:00
2019-05-08 09:24:24 +02:00
2019-05-08 09:24:24 +02:00
2019-05-09 05:58:54 +02:00
2019-05-09 05:54:05 +02:00
2019-05-30 13:46:04 -04:00
2019-05-30 13:46:04 -04:00
2019-07-19 00:35:32 +02:00