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

More Clippy fixes #635

Merged
merged 2 commits into from
Mar 29, 2023
Merged

More Clippy fixes #635

merged 2 commits into from
Mar 29, 2023

Conversation

ltratt
Copy link
Contributor

@ltratt ltratt commented Mar 29, 2023

The first of these required a manual change (5bc2998) and the rest are fairly mechanical (f35941d).

@@ -703,7 +703,7 @@ impl<'t> YkPTBlockIterator<'t> {

/// Fetch the next packet and update iterator state.
fn packet(&mut self) -> Result<Packet, HWTracerError> {
let ret = if let Some(pkt_or_err) = self.parser.next() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This'll be an artifact of debugging. I wish there was a way to print the returned value without making a binding. Do you know a way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dbg!

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah.

@@ -25,6 +24,7 @@ use ykrt::{HotThreshold, Location, MT};
use yksmp::{Location as SMLocation, StackMapParser};

#[no_mangle]
#[allow(clippy::not_unsafe_ptr_arg_deref)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this related to: rust-lang/rust-clippy#3045 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just let it warn? I worry we will forget to remove these annotations.

This would of course work against the idea of adding regular automated clippy checks...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notice this warning is only disabled for this one function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I know. Still...

Also we have many instances of this for other functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue I linked explains that the clippy warning often triggers erroneously, as a false positive, right? As I understand, you are silencing a false positive here, right?

So what if a future code edit means that the clippy warning is actually justified, and that we've silenced a real concern?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand what you're saying: you appear to be asking me to suppress the false positive now while allowing true positives in the future. How can I do that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm asking: should we not suppress the false positive. We don't have to fix every warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the point of a warning that we then ignore? It's literally worse than suppressing it!

Copy link
Contributor

Choose a reason for hiding this comment

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

I give up. Please squash.

yksmp/src/lib.rs Outdated Show resolved Hide resolved
These are the last remaining Clippy fixes (well, at least until we
introduce some more or Clippy becomes more stringent!).
@ltratt ltratt force-pushed the more_clippy_fixes branch from 19f7a70 to b7575b5 Compare March 29, 2023 10:06
@ltratt
Copy link
Contributor Author

ltratt commented Mar 29, 2023

Squashed.

@vext01
Copy link
Contributor

vext01 commented Mar 29, 2023

bors r+

bors bot added a commit that referenced this pull request Mar 29, 2023
635: More Clippy fixes r=vext01 a=ltratt



Co-authored-by: Laurence Tratt <laurie@tratt.net>
@bors
Copy link
Contributor

bors bot commented Mar 29, 2023

Build failed:

@ltratt
Copy link
Contributor Author

ltratt commented Mar 29, 2023

Our old friend again. Retry?

@vext01
Copy link
Contributor

vext01 commented Mar 29, 2023

We really need to fix that.

bors r+

bors bot added a commit that referenced this pull request Mar 29, 2023
635: More Clippy fixes r=vext01 a=ltratt



Co-authored-by: Laurence Tratt <laurie@tratt.net>
@bors
Copy link
Contributor

bors bot commented Mar 29, 2023

Build failed:

@vext01
Copy link
Contributor

vext01 commented Mar 29, 2023

Uh oh... again...

Perhaps I should pause what I'm doing and priorities fixing this?

@vext01
Copy link
Contributor

vext01 commented Mar 29, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 29, 2023

Build succeeded:

@bors bors bot merged commit 6161661 into ykjit:master Mar 29, 2023
@ltratt ltratt deleted the more_clippy_fixes branch May 16, 2023 08:24
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