Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Fix clippy warnings in EncodingBits #1324

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

abrown
Copy link
Collaborator

@abrown abrown commented Jan 8, 2020

Prior to this I would see the following on cargo build:

$ cargo build
warning: identical conversion
  --> cranelift-codegen/shared/src/isa/x86/encoding_bits.rs:63:26
   |
63 |         debug_assert_eq!(u8::from(self.rrr()), 0);
   |                          ^^^^^^^^^^^^^^^^^^^^ help: consider removing `u8::from()`: `self.rrr()`
   |
   = note: `#[warn(clippy::identity_conversion)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion

warning: using `clone` on a `Copy` type
  --> cranelift-codegen/shared/src/isa/x86/encoding_bits.rs:64:23
   |
64 |         let mut enc = self.clone();
   |                       ^^^^^^^^^^^^ help: try removing the `clone` call: `self`
   |
   = note: `#[warn(clippy::clone_on_copy)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on a `Copy` type
  --> cranelift-codegen/shared/src/isa/x86/encoding_bits.rs:73:23
   |
73 |         let mut enc = self.clone();
   |                       ^^^^^^^^^^^^ help: try removing the `clone` call: `self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s

@abrown abrown requested a review from sstangl January 8, 2020 18:13
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Thanks!

cranelift-codegen/src/simple_gvn.rs Outdated Show resolved Hide resolved
@abrown abrown merged commit 82bb784 into bytecodealliance:master Jan 10, 2020
@abrown abrown deleted the fix-warnings branch January 10, 2020 18:12
@abrown abrown mentioned this pull request Jan 13, 2020
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants