-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix unused_async with macros and sub async block #13205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
I think there's one more problem. |
I'm not sure if it's |
Confirmed. |
I would say the macro detection is working as intended - #13199 (comment) |
Thanks, I didn't know this before. |
I need help. I've fixed this, but didn't pass the mod issue9695 {
use std::future::Future;
async fn f() {}
async fn f2() {}
async fn f3() {}
//~^ ERROR: unused `async` for function with no await statements
fn needs_async_fn<F: Future<Output = ()>>(_: fn() -> F) {}
fn test() {
let x = f;
needs_async_fn(x); // async needed in f
needs_async_fn(f2); // async needed in f2
f3(); // async not needed in f3
}
}
|
r? @Alexendoo coming off of vacation and will be on planes for a while |
@oli-obk any idea what's happening with this diff? When I run it locally I get a more reasonable output of --- tests/ui/unused_async.stderr
+++ <stderr output>
error: unused `async` for function with no await statements
--> tests/ui/unused_async.rs:12:5
... 17 lines skipped ...
error: unused `async` for function with no await statements
+ --> tests/ui/unused_async.rs:43:5
+ |
+LL | async fn f() {}
+ | ^^^^^^^^^^^^^^^
+ |
+ = help: consider removing the `async` from this function
+
+error: unused `async` for function with no await statements
--> tests/ui/unused_async.rs:45:5
|
... 25 lines skipped ...
= help: consider removing the `async` from this function
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors |
Weird that it's only happening in CI... the full stderr doesn't really fit the diff you posted either. If it's a recurring thing, open an issue |
Oops, I was looking at the wrong run, that one is for an earlier commit. False alarm |
☔ The latest upstream changes (presumably #13471) made this pull request unmergeable. Please resolve the merge conflicts. |
changelog: [
unused_async
]:pro_macro_attribute
fixes #13199
I've run the test, but failed with the error that I didn't understand.