-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
macros: Improve IDE support #6968
base: master
Are you sure you want to change the base?
Conversation
I will send a fix tomorrow. |
What’s really blocking the CI is that, Current changes preserved async body as-is: #[tokio::main]
async fn test_with_semicolon_without_return_type() {
#![deny(clippy::semicolon_if_nothing_returned)]
#[deny(clippy::semicolon_if_nothing_returned)]
0;
} So would convert into: fn test_with_semicolon_without_return_type() {
let body = async {
#![deny(clippy::semicolon_if_nothing_returned)] // ❌
#[deny(clippy::semicolon_if_nothing_returned)]
0;
};
...
} I didn’t realize this, The previous implementation moved global inner attributes outside: #[deny(clippy::semicolon_if_nothing_returned)]
fn test_with_semicolon_without_return_type() {
let body = async {
#[deny(clippy::semicolon_if_nothing_returned)]
0;
};
...
} There are many ways to address this issue. |
If you believe the output changes are acceptable, you can update the outputs to make the tests pass. See But keep in mind that just because something is not explained in the documentation, that doesn't mean we can just change it. We don't want to break existing users of the macro. |
Speaking as a person who works on rust-analyzer:
|
Oh! It turns out span is used for type suggestion in return or end statements, so I'll revert the previous change. Seems like it also fix some code suggestion: #3766 |
This refectory improve performance and enhance better compatibility with IDEs.
Here is two examples,
Before: Note that there is no inlay hints for function arguments.
After: Fixed inlay hint hints problem.
channel(buffer: ..
,tokio::spawn(future: ..
Before: On syntax error.
Run Test | Debug
button dissipated. which is frustrating because the editor toggles back and forth while typing.After: It fix that.
It introduce two changes:
Removespaned
, Because as it's not meant to be used here.