Skip to content

Commit 9f9e547

Browse files
committed
test diverging closure fn ptr coercion
1 parent bba9359 commit 9f9e547

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs

-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,4 @@ fn main() {
3131
g(2);
3232
let g = force_mut1(|i| assert_eq!(i, 2)) as fn(i32);
3333
g(2);
34-
35-
// FIXME: This fails with "invalid use of NULL pointer" <https://github.com/rust-lang/miri/issues/1075>
36-
//let h: fn() -> ! = || std::process::exit(0);
37-
//h();
38-
// FIXME: This does not even compile?!? <https://github.com/rust-lang/rust/issues/66738>
39-
//let h = magic0(|| std::process::exit(0)) as fn() -> !;
40-
//h();
41-
// Once these tests pass, they should be in separate files as they terminate the process.
4234
}

tests/run-pass/issue-miri-1075.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let f: fn() -> ! = || std::process::exit(0);
3+
f();
4+
5+
// FIXME: Also add a test for <https://github.com/rust-lang/rust/issues/66738>, once that is fixed.
6+
}

0 commit comments

Comments
 (0)