Skip to content

Commit

Permalink
Unrolled build for rust-lang#131359
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#131359 - practicalrs:fix_used_underscore_binding, r=jieyouxu

Fix used_underscore_binding in rustc_serialize

Hi,

This PR fixes the following clippy warnings in rustc_serialize

```
warning: used underscore-prefixed binding
   --> compiler/rustc_serialize/src/opaque.rs:443:27
    |
443 |         debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
    |                           ^^^^^^^^
    |
note: binding is defined here
   --> compiler/rustc_serialize/src/opaque.rs:442:13
    |
442 |         let _end_pos = e.position();
    |             ^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
    = note: requested on the command line with `-W clippy::used-underscore-binding`

warning: used underscore-prefixed binding
   --> compiler/rustc_serialize/src/opaque.rs:443:38
    |
443 |         debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
    |                                      ^^^^^^^^^^
    |
note: binding is defined here
   --> compiler/rustc_serialize/src/opaque.rs:440:13
    |
440 |         let _start_pos = e.position();
    |             ^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
```

Best regards,
Michal
  • Loading branch information
rust-timer authored Oct 7, 2024
2 parents 7caad69 + 4085b48 commit 67d212a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_serialize/src/opaque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ impl IntEncodedWithFixedSize {
impl Encodable<FileEncoder> for IntEncodedWithFixedSize {
#[inline]
fn encode(&self, e: &mut FileEncoder) {
let _start_pos = e.position();
let start_pos = e.position();
e.write_array(self.0.to_le_bytes());
let _end_pos = e.position();
debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
let end_pos = e.position();
debug_assert_eq!((end_pos - start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
}
}

Expand Down

0 comments on commit 67d212a

Please sign in to comment.