blob: c6bdee7dc67e2744ed60086e21537d421ef04fbd [file] [log] [blame]
//@ run-crash
//@ compile-flags: -Cdebug-assertions=yes
//@ error-pattern: unsafe precondition(s) violated: Vec::set_len requires that new_len <= capacity()
fn main() {
let mut vec: Vec<i32> = Vec::with_capacity(5);
// Test set_len with length > capacity
unsafe {
vec.set_len(10);
}
}