test count_3 fails
Hello,
The tests of this crate fails:
$ cargo test
Compiling alloc_counter v0.0.4 (/home/lechatp/deploy/alloc-counter)
warning: unused return value of `Box::<T>::new` that must be used
--> examples/count_alloc_macro.rs:19:5
|
19 | Box::new(0);
| ^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
19 | let _ = Box::new(0);
| +++++++
warning: unused return value of `Box::<T>::new` that must be used
--> examples/count_alloc_macro.rs:20:5
|
20 | Box::new([0usize; 120]);
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `let _ = ...` to ignore the resulting value
|
20 | let _ = Box::new([0usize; 120]);
| +++++++
warning: unused return value of `Box::<T>::new` that must be used
--> tests/counters.rs:20:9
|
20 | Box::new(0);
| ^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
20 | let _ = Box::new(0);
| +++++++
warning: variable does not need to be mutable
--> tests/no_alloc_macro.rs:57:18
|
57 | fn baz(self, mut a: usize) -> usize {
| ----^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: struct `Foo` is never constructed
--> tests/no_alloc_macro.rs:47:8
|
47 | struct Foo;
| ^^^
|
= note: `#[warn(dead_code)]` on by default
warning: unused return value of `Box::<T>::new` that must be used
--> tests/no_alloc_macro.rs:13:9
|
13 | Box::new(0);
| ^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
13 | let _ = Box::new(0);
| +++++++
warning: `alloc_counter` (example "count_alloc_macro") generated 2 warnings
warning: unused return value of `Box::<T>::new` that must be used
--> tests/panic_on_alloc.rs:8:5
|
8 | Box::new(0);
| ^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
8 | let _ = Box::new(0);
| +++++++
warning: `alloc_counter` (test "counters") generated 1 warning
warning: `alloc_counter` (test "no_alloc_macro") generated 3 warnings (run `cargo fix --test "no_alloc_macro"` to apply 1 suggestion)
warning: `alloc_counter` (test "panic_on_alloc") generated 1 warning
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.59s
Running unittests src/lib.rs (target/debug/deps/alloc_counter-d46582ca0a455bba)
running 4 tests
test count_0 ... ok
test count_1 ... ok
test count_3 ... FAILED
test count_2 ... ok
failures:
---- count_3 stdout ----
thread 'count_3' panicked at tests/counters.rs:34:5:
assertion `left == right` failed
left: (1, 0, 1)
right: (1, 1, 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
count_3
test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test counters`
Is it normal ?