-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix async_yields_async
wrongly unmangled macros
#15553
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not directly linked to macros, but what if the return_expr
requires parenthesis around it before applying .await
?
format!("{}.await", snippet(cx, return_expr_span, "..")),
Shouldn't this use Sugg
and Sugg::maybe_paren()
here?
For example:
impl std::ops::Add for CustomFutureType {
type Output = Self;
fn add(self, other: Self) -> Self {
Self
}
}
let _ = async || {
CustomFutureType + CustomFutureType
};
will not be processed properly.
If you don't mind, could you also fix this?
r? samueltardieu
@samueltardieu Done. Thank you! |
Can you squash the changes (and fix the CI of course)? Then it's good for me. |
Done. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes left.
Closes #15552
changelog: [
async_yields_async
] fix wrong unmangle of macros