Skip to content

Commit

Permalink
Ignore unused_allocation lint in tests
Browse files Browse the repository at this point in the history
```
warning: unnecessary allocation, use `&mut` instead
   --> tests/test_buf_mut.rs:247:5
    |
247 |     Box::new(Special).put_u8(b'x');
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_allocation)]` on by default

warning: unnecessary allocation, use `&mut` instead
   --> tests/test_buf.rs:102:16
    |
102 |     assert_eq!(Box::new(Special).get_u8(), b'x');
    |                ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_allocation)]` on by default
```
  • Loading branch information
taiki-e committed Jun 4, 2023
1 parent b29112c commit 9ee9db1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ fn test_vec_deque() {
assert_eq!(b"world piece", &out[..]);
}

#[allow(unused_allocation)] // This is intentional.
#[test]
fn test_deref_buf_forwards() {
struct Special;
Expand Down
1 change: 1 addition & 0 deletions tests/test_buf_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ fn test_maybe_uninit_buf_mut_put_bytes_overflow() {
do_test_slice_put_bytes_panics(make_maybe_uninit_slice);
}

#[allow(unused_allocation)] // This is intentional.
#[test]
fn test_deref_bufmut_forwards() {
struct Special;
Expand Down

0 comments on commit 9ee9db1

Please sign in to comment.