| /*! Reserving space when a BitVec is filled to a boundary induces false panic. | ||
| This is due to a faulty validity check (`BitIdx::span` calls `BitIdx::is_valid`) | ||
| called during `BitVec::reserve` using the *tail* of the vector, which at the | ||
| boundary, is a valid tail but not a valid head. | ||
| This is a regression. | ||
| !*/ | ||
| #![cfg(any(feature = "alloc", feature = "std"))] | ||
| use bitvec::prelude::*; | ||
| #[test] | ||
| fn issue_15() { | ||
| let mut bv = bitvec![0; 8]; | ||
| bv.reserve(16); | ||
| } |
| { | ||
| "git": { | ||
| "sha1": "7eb347c383f0cb36e63a8635a14dcaec3f9c9297" | ||
| "sha1": "ef30c30199d0efc27c891e46838cf5d8265a9f50" | ||
| } | ||
| } |
+1
-1
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "bitvec" | ||
| version = "0.11.2" | ||
| version = "0.11.3" | ||
| authors = ["myrrlyn <self@myrrlyn.dev>"] | ||
@@ -19,0 +19,0 @@ description = "A crate for manipulating memory, bit by bit" |
+8
-0
@@ -7,2 +7,8 @@ # Changelog | ||
| ## 0.11.3 | ||
| [Issue #15]: Incorrect validity check in `BitIdx::span`; excluded tail indices | ||
| which were used in `BitVec::push`, inducing false `panic!` events. Thanks to | ||
| GitHub user [@schomatis] for the report. | ||
| ## 0.11.2 | ||
@@ -337,2 +343,3 @@ | ||
| [@ratorx]: https://github.com/ratorx | ||
| [@schomatis]: https://github.com/schomatis | ||
| [@torce]: https://github.com/torce | ||
@@ -344,3 +351,4 @@ [Issue #7]: https://github.com/myrrlyn/bitvec/issues/7 | ||
| [Issue #12]: https://github.com/myrrlyn/bitvec/issues/12 | ||
| [Issue #15]: https://github.com/myrrlyn/bitvec/issues/15 | ||
| [`Sync`]: https://doc.rust-lang.org/stable/core/marker/trait.Sync.html | ||
| [kac]: https://keepachangelog.com/en/1.0.0/ |
+1
-1
@@ -966,3 +966,3 @@ /*! Bit management | ||
| assert!( | ||
| self.is_valid::<T>(), | ||
| *self <= T::BITS, | ||
| "Index {} is invalid for type {}", | ||
@@ -969,0 +969,0 @@ *self, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display