Fix test checking that into_boxed_slice does not panic
The memory allocation in vec might panic in the case of capacity overflow. Move the allocation outside the function to fix the test.
This commit is contained in:
parent
77180db6f8
commit
899d9b9bd5
1 changed files with 2 additions and 2 deletions
|
|
@ -15,9 +15,9 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
|
|||
|
||||
// CHECK-LABEL: @issue71861
|
||||
#[no_mangle]
|
||||
pub fn issue71861(n: usize) -> Box<[u32]> {
|
||||
pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
|
||||
// CHECK-NOT: panic
|
||||
vec![0; n].into_boxed_slice()
|
||||
vec.into_boxed_slice()
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @issue75636
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue