-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
chore: use rust 1.66.0 #17078
chore: use rust 1.66.0 #17078
Conversation
370b50a
to
01ab5c8
Compare
This reverts commit 9b1e40b.
@@ -910,6 +910,7 @@ impl Aarch64Apple { | |||
aarch64!(self.assmblr; str x0, [x19]); | |||
} | |||
|
|||
#[allow(clippy::unnecessary_cast)] |
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.
Can't we remove this suppression as well?
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.
Can't we remove this suppression as well?
Yes, I think we remove this suppression is better.
TBH, I have no experience about dynasm-rs, but I want to resolved it with some help. Could you help me.
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.
Removed #[allow(clippy::unnecessary_cast)]
code has this error info:
error: casting to the same type is unnecessary (`u32` -> `u32`)
--> ext\ffi\turbocall.rs:920:28
|
920 | ; stp x29, x30, [sp, self.allocated_stack - 16]
| ^^^^ help: try: `dynasm!($assembler; .arch aarch64; $($tokens)+)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `-D clippy::unnecessary-cast` implied by `-D clippy::all`
error: casting to the same type is unnecessary (`u32` -> `u32`)
--> ext\ffi\turbocall.rs:932:47
|
932 | aarch64!(self.assmblr; ldp x29, x30, [sp, self.allocated_stack - 16])
| ^^^^ help: try: `dynasm!($assembler; .arch aarch64; $($tokens)+)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
error: could not compile `deno_ffi` due to 2 previous errors
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.
Seems like a the lint error comes from the macro expansion. I think its fine to keep the clippy suppression here
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.
It's really complicated as the proc macro is involved here. Apparently this macro is expanded to something like this:
{
assmblr
.push_u32(
2835381245u32
| ((((allocated_stack - 16 >> 3u8) as u32) & 127u32) << 15u8),
);
};
So clippy compains about as u32
part of this expansion.
I don't think this clippy rule should check for the resulting code generated from macros, so probably we could fix it on the clippy side, but for the time being it would make sense to suppress the lint in my opinion.
One suggestion though, is that we would like to limit the scope of the suppression. So could you put #[allow(clippy::unnecessary_cast)]
right before the macro invocation, like:
#[allow(clippy::unnecessary_cast)]
{
aarch64!(self.assmblr
// Frame record is stored at the bottom of the stack frame
; stp x29, x30, [sp, self.allocated_stack - 16]
; add x29, sp, self.allocated_stack - 16
)
}
Also a comment on why we add a suppression would be really good. My idea is as follows (feel free to modify :D
// This macro generates code that contains `as u32` for a u32 value, which is
// obviously unneeded. However we can't control the generated code - so we
// ignore clippy's warning.
@@ -922,6 +923,7 @@ impl Aarch64Apple { | |||
) | |||
} | |||
|
|||
#[allow(clippy::unnecessary_cast)] |
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.
Ditto
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.
LGTM! 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.
LGTM, nice work @linbingquan, thank you
This PR tested
cargo run
andlint.js
inwindows 11
, I‘m not sure thisPR
is no problem, if it has any problem, please tell me.This PR passed
release macos/windows
tests, but I not know why it's failed infastci
in my repo (I don't know how to fix it), maybe I missed something...