VecDeque::as_slices() is not behaving as I would expect. I am using VecDeque as a plain old FIFO queue, only adding items with extend() and only removing with pop_front(). As far as I can tell from the documentation, with this sort of use, the
let (a, b) = q.as_slices() should always be empty. However, after a moderate amount of insertions/removals, some items do end up in that
b. Here is an example that quickly breaks.
I can avoid this behavior by greatly increasing the VecDeque’s initial with_capacity() relative to how much it will be used (I’ve been using 10x or 100x what I would have, in my current workarounds).
This is with rustc 1.16.0 (30cf806ef 2017-03-10)
I would appreciate any help anyone can offer!