Skip to content

Commit 2499dac

Browse files
committed
TEMP: crash and fail run-pass, crash and pass run-fail, fail and pass run-crash
1 parent 8ea46cc commit 2499dac

File tree

6 files changed

+12
-19
lines changed

6 files changed

+12
-19
lines changed

tests/ui/deref.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ run-pass
22

33
pub fn main() {
4-
let x: Box<isize> = Box::new(10);
5-
let _y: isize = *x;
4+
panic!("moop");
65
}

tests/ui/inlined-main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//@ run-pass
22

33
#[inline(always)]
4-
fn main() {}
4+
fn main() {
5+
unsafe {
6+
let null: *mut u32 = std::ptr::null_mut();
7+
*null = 42;
8+
}
9+
}

tests/ui/mir/alignment/borrow_misaligned_field_projection.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@
33
//@ compile-flags: -C debug-assertions
44
//@ error-pattern: misaligned pointer dereference: address must be a multiple of 0x4 but is
55

6-
struct Misalignment {
7-
a: u32,
8-
}
9-
106
fn main() {
11-
let mut items: [Misalignment; 2] = [Misalignment { a: 0 }, Misalignment { a: 1 }];
12-
unsafe {
13-
let ptr: *const Misalignment = items.as_ptr().byte_add(1);
14-
let _ptr: &u32 = unsafe { &(*ptr).a };
15-
}
167
}

tests/ui/mir/alignment/misaligned_borrow.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
//@ error-pattern: misaligned pointer dereference: address must be a multiple of 0x4 but is
55

66
fn main() {
7-
let x = [0u32; 2];
8-
let ptr = x.as_ptr();
9-
unsafe {
10-
let _ptr = &(*(ptr.byte_add(1)));
11-
}
7+
panic!("moop");
128
}

tests/ui/panics/main-panic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
//@ needs-subprocess
44

55
fn main() {
6-
panic!()
6+
unsafe {
7+
let null: *mut u32 = std::ptr::null_mut();
8+
*null = 42;
9+
}
710
}

tests/ui/panics/panic-main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
//@ needs-subprocess
44

55
fn main() {
6-
panic!("moop");
76
}

0 commit comments

Comments
 (0)