I've noticed that VecDeque::new allocates. We don't guarantee that it doesn't, but this felt inconsistent with, e.g., Vec::new, for which we do guarantee that it does not allocate.
I'm not sure what the appropriate venue is for discussing this, but I think it would make sense to remove the surprise here and guarantee that VecDeque::new does not heap-allocate either.
cc @rust-lang/libs
I've noticed that
VecDeque::newallocates. We don't guarantee that it doesn't, but this felt inconsistent with, e.g.,Vec::new, for which we do guarantee that it does not allocate.I'm not sure what the appropriate venue is for discussing this, but I think it would make sense to remove the surprise here and guarantee that
VecDeque::newdoes not heap-allocate either.cc @rust-lang/libs