From 9f9e547d791c5031f2dde9fa5424903d52934cc1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 27 Nov 2019 23:28:59 +0100 Subject: [PATCH] test diverging closure fn ptr coercion --- tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs | 8 -------- tests/run-pass/issue-miri-1075.rs | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 tests/run-pass/issue-miri-1075.rs diff --git a/tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs b/tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs index 71f244b2bc..32393a37d2 100644 --- a/tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs +++ b/tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs @@ -31,12 +31,4 @@ fn main() { g(2); let g = force_mut1(|i| assert_eq!(i, 2)) as fn(i32); g(2); - - // FIXME: This fails with "invalid use of NULL pointer" - //let h: fn() -> ! = || std::process::exit(0); - //h(); - // FIXME: This does not even compile?!? - //let h = magic0(|| std::process::exit(0)) as fn() -> !; - //h(); - // Once these tests pass, they should be in separate files as they terminate the process. } diff --git a/tests/run-pass/issue-miri-1075.rs b/tests/run-pass/issue-miri-1075.rs new file mode 100644 index 0000000000..8bacaca9c2 --- /dev/null +++ b/tests/run-pass/issue-miri-1075.rs @@ -0,0 +1,6 @@ +fn main() { + let f: fn() -> ! = || std::process::exit(0); + f(); + + // FIXME: Also add a test for , once that is fixed. +}