-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-ZSTArea: Zero-sized types (ZSTs).Area: Zero-sized types (ZSTs).A-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
This code panics under Miri, and also when I compile to WASM, though not when running normally.
use std::collections::VecDeque;
fn main() {
let _: VecDeque<()> = vec![()].into();
}
thread 'main' panicked at 'attempt to add with overflow', /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/vec_deque.rs:3236:36
The overflow is here:
rust/library/alloc/src/collections/vec_deque.rs
Line 3236 in a53fb30
let cap = cmp::max(buf.capacity() + 1, MINIMUM_CAPACITY + 1).next_power_of_two(); |
Metadata
Metadata
Assignees
Labels
A-ZSTArea: Zero-sized types (ZSTs).Area: Zero-sized types (ZSTs).A-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.