-
Notifications
You must be signed in to change notification settings - Fork 722
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
clippy::suspicious_else_formatting
triggered by fake_return_edge
#2410
Comments
We noticed this because we tried to fix it ourselves in our code, but because the new instance is nested inside the first one, the fix to #1613 insulates the new instance and prevents external attributes from affecting it. |
Alternatively, we could move the |
The fake return edge was added in tokio-rs#2270 to improve type errors in instrumented async functions. However, it meant that the user block was being modified outside of `gen_block`. This created a negative interaction with tokio-rs#1614, which suppressed a clippy lint internally while explicitly enabling it on the user block. The installed fake return edge generated this same lint, but the user had no way to suppress it: lint directives above the instrumentation were ignored because of the internal suppression, and lints inside the user block could not influence the fake return edge's scope. We now avoid modifying the user block outside of `gen_block`, and restrict the fake return edge to async functions. We also apply the same clippy lint suppression technique to the installed fake return edge. Closes tokio-rs#2410.
tracing/tracing-attributes/src/expand.rs
Lines 66 to 79 in 02903cb
This generates code (with Rust 1.56.0) like:
We can see that the code added to fix #1613 looks correct, but we need to do the same thing for
fake_return_edge
.The text was updated successfully, but these errors were encountered: