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

Fix clippy warnings #242

Closed
32 tasks
dlrobertson opened this issue Jun 19, 2018 · 4 comments
Closed
32 tasks

Fix clippy warnings #242

dlrobertson opened this issue Jun 19, 2018 · 4 comments

Comments

@whitequark
Copy link
Contributor

I'm not extremely enthusiastic about clippy and I believe that blindly following its suggestions can easily degrade code quality. r=me on every PR addressing its lints.

@dlrobertson
Copy link
Collaborator Author

believe that blindly following its suggestions can easily degrade code quality.

I agree 100% with this. I'm definitely not suggesting we blindly follow the suggestions. unreadable_literal is a great example of a lint that IMO doesn't help. IMO 0xffff_ffff does not help readability at all. I do think that we could improve the code quality by following some of these e.g. unnecessary_mut_passed.

r=me on every PR addressing its lints.

Will do.

@jhwgh1968
Copy link
Contributor

After doing a nightly compiler update, I noticed this new warning:

warning[E0713]: borrow may still be in use when destructor runs
  --> src/socket/ref_.rs:61:9
   |
39 | impl<'a, T: Session + 'a> Ref<'a, T> {
   |      -- lifetime `'a` defined here
...
61 |         ref_.socket
   |         ^^^^^^^^^^^ returning this value requires that `*ref_.socket` is borrowed for `'a`
62 |     }
   |     - here, drop of `ref_` needs exclusive access to `*ref_.socket`, because the type `socket::ref_::Ref<'_, T>` implements the `Drop` trait
   |
   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future

Since I presume the code not causing any problems right now, I thought it should be addressed along with the clippy lints. If this should be a separate issue, I can easily create one.

@Dirbaio
Copy link
Member

Dirbaio commented Jan 6, 2021

This is now done. Additionally, CI enforces no clippy warnings.

@Dirbaio Dirbaio closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants