Skip to content

Conversation

tnowacki
Copy link
Contributor

Description

  • Updated filtering for absint lints

Test plan

  • ran tests

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Sep 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 0:12am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 0:12am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 0:12am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 0:12am

// utils
//**************************************************************************************************

pub fn has_special<FCommand, FExp>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of special, maybe any? The names has_any_command and has_any_exp might better-communicate what this code is doing.

Comment on lines 827 to 831
fn has_special_(
cfg: &ImmForwardCFG,
p_command: &mut impl FnMut(&Command) -> bool,
p_exp: &mut impl FnMut(&Exp) -> bool,
) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work?

Suggested change
fn has_special_(
cfg: &ImmForwardCFG,
p_command: &mut impl FnMut(&Command) -> bool,
p_exp: &mut impl FnMut(&Exp) -> bool,
) -> bool {
fn has_special_<FCmd, FExp>(
cfg: &ImmForwardCFG,
p_command: &mut impl FCommand,
p_exp: &mut impl FExp,
) -> bool
where
FCommand: FnMut(&Command) -> bool,
FExp: FnMut(&Exp) -> bool {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did not, but I'll try again to be sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

error[E0382]: use of moved value: `p_exp`
   --> crates/move-compiler/src/cfgir/visitor.rs:861:86
    |
846 |     mut p_exp: FExp,
    |     --------- move occurs because `p_exp` has type `FExp`, which does not implement the `Copy` trait
...
861 |             C::Mutate(el, er) => has_special_exp_(el, p_exp) || has_special_exp_(er, p_ex...
    |                                                       ----- value moved here         ^^^^^ value used here after move
    |
note: consider changing this parameter type in function `has_special_exp_` to borrow instead if owning the value isn't necessary
   --> crates/move-compiler/src/cfgir/visitor.rs:868:43
    |
868 | fn has_special_exp_<FExp>(e: &Exp, mut p: FExp) -...
    |    ---------------- in this function      ^^^^ this parameter takes ownership of the value
help: if `FExp` implemented `Clone`, you could clone the value
   --> crates/move-compiler/src/cfgir/visitor.rs:843:35
    |
843 | ...mmand, FExp>(
    |           ^^^^ consider constraining this type parameter with `Clone`
...
861 | ...r) => has_special_exp_(el, p_exp) || has_spec...
    |                               ----- you could clone this value
help: consider mutably borrowing `p_exp`
    |
861 |             C::Mutate(el, er) => has_special_exp_(el, &mut p_exp) || has_special_exp_(er, p_exp),
    |                                                       ++++

Copy link
Contributor

@cgswords cgswords left a comment

Choose a reason for hiding this comment

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

I do wonder how much work the pre-filtering is saving us in terms of clock time, but otherwise LGTM.

@tnowacki
Copy link
Contributor Author

I do wonder how much work the pre-filtering is saving us in terms of clock time, but otherwise LGTM.

It is a good question. For the abstract interpretation ones, I would imagine a good bit? And these are the only ones I put it on. But I haven't really clocked it. Maybe I should

@tnowacki tnowacki merged commit c092832 into MystenLabs:main Sep 17, 2024
43 of 44 checks passed
@tnowacki tnowacki deleted the lint-imp branch September 17, 2024 02:29
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.

2 participants