You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---- test_bitvec_last_ones stdout ----
bv=BitVec<bitvec::order::Lsb0, usize> { addr: 0x7f7fcc0009a0, head: 000000, bits: 1, capacity: 64 } [0]
thread 'test_bitvec_last_ones' panicked at 'attempt to subtract with overflow', /home/vhallivu/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.22.0/src/slice/specialization.rs:200:21
stack backtrace:
0: rust_begin_unwind
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/panicking.rs:92:14
2: core::panicking::panic
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/panicking.rs:50:5
3: bitvec::slice::specialization::<impl bitvec::slice::BitSlice<bitvec::order::Lsb0,T>>::sp_iter_ones_last
at /home/vhallivu/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.22.0/src/slice/specialization.rs:200:6
4: <bitvec::slice::iter::IterOnes<O,T> as core::iter::traits::double_ended::DoubleEndedIterator>::next_back
at /home/vhallivu/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.22.0/src/slice/iter.rs:2405:4
5: bitvec::slice::BitSlice<O,T>::last_one
at /home/vhallivu/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.22.0/src/slice.rs:1209:3
6: bitvec_test::test_bitvec_last_ones
at ./src/main.rs:12:22
7: bitvec_test::test_bitvec_last_ones::{{closure}}
at ./src/main.rs:8:1
8: core::ops::function::FnOnce::call_once
at /home/vhallivu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
9: core::ops::function::FnOnce::call_once
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
test_bitvec_last_ones
The text was updated successfully, but these errors were encountered:
It seems that there is subraction overflow in BitVec last_one()/last_zero() on cases where there are not matches. Counting works properly.
Example to reproduce:
Result:
The text was updated successfully, but these errors were encountered: