mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 21:34:18 +00:00
Add more unwind tests for failure during construction of allocated things
This commit is contained in:
parent
80778f642f
commit
956bc69330
18
src/test/run-fail/unwind-partial-box.rs
Normal file
18
src/test/run-fail/unwind-partial-box.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn f() -> [int] { fail; }
|
||||
|
||||
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
|
||||
// have been to do with memory allocation patterns.
|
||||
fn prime() {
|
||||
@0;
|
||||
}
|
||||
|
||||
fn partial() {
|
||||
let x = @f();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
prime();
|
||||
partial();
|
||||
}
|
18
src/test/run-fail/unwind-partial-vec.rs
Normal file
18
src/test/run-fail/unwind-partial-vec.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn f() -> [int] { fail; }
|
||||
|
||||
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
|
||||
// have been to do with memory allocation patterns.
|
||||
fn prime() {
|
||||
@0;
|
||||
}
|
||||
|
||||
fn partial() {
|
||||
let x = [[0], f(), [0]];
|
||||
}
|
||||
|
||||
fn main() {
|
||||
prime();
|
||||
partial();
|
||||
}
|
Loading…
Reference in New Issue
Block a user