tokio-rs / slab

Slab allocator for Rust
MIT License
699 stars 84 forks source link

FromIterator impl gives a corrupt vacant list #100

Closed alecmocatta closed 3 years ago

alecmocatta commented 3 years ago
fn main() {
    let x: slab::Slab<()> = std::iter::once((1, ())).collect();
}

This gives a slab with a corrupt vacant list. Once corrupted, I was hitting this panic https://github.com/tokio-rs/slab/blob/v0.4.3/src/lib.rs#L942

Patching vacant_list_broken = true; is a workaround.

taiki-e commented 3 years ago

Fixed in v0.4.4.