Skip to content
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

Merged
merged 9 commits into from
Dec 17, 2022
Merged

chore: use rust 1.66.0 #17078

merged 9 commits into from
Dec 17, 2022

Conversation

linbingquan
Copy link
Contributor

This PR tested cargo run and lint.js in windows 11, I‘m not sure this PR 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 in fastci in my repo (I don't know how to fix it), maybe I missed something...

runtime/ops/fs.rs Outdated Show resolved Hide resolved
cli/lsp/documents.rs Outdated Show resolved Hide resolved
@bartlomieju bartlomieju changed the title feat: use rust 1.66.0 chore: use rust 1.66.0 Dec 16, 2022
@@ -910,6 +910,7 @@ impl Aarch64Apple {
aarch64!(self.assmblr; str x0, [x19]);
}

#[allow(clippy::unnecessary_cast)]
Copy link
Member

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?

Copy link
Contributor Author

@linbingquan linbingquan Dec 17, 2022

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.

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

@magurotuna magurotuna Dec 17, 2022

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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you

Copy link
Member

@bartlomieju bartlomieju left a 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

@bartlomieju bartlomieju merged commit f46df3e into denoland:main Dec 17, 2022
bartlomieju pushed a commit that referenced this pull request Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants