Skip to content

Commit

Permalink
test diverging closure fn ptr coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 2, 2019
1 parent bba9359 commit 9f9e547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/run-pass/coerce_non_capture_closure_to_fn_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" <https://github.com/rust-lang/miri/issues/1075>
//let h: fn() -> ! = || std::process::exit(0);
//h();
// FIXME: This does not even compile?!? <https://github.com/rust-lang/rust/issues/66738>
//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.
}
6 changes: 6 additions & 0 deletions tests/run-pass/issue-miri-1075.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main() {
let f: fn() -> ! = || std::process::exit(0);
f();

// FIXME: Also add a test for <https://github.com/rust-lang/rust/issues/66738>, once that is fixed.
}

0 comments on commit 9f9e547

Please sign in to comment.