diff --git a/rust-version b/rust-version index 3a0cf96e13..b2b29eb527 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -f5c81e0a986e4285d3d0fd781a1bd475753eb12c +4af3ee8ee2a2bc1286b021db7600ba990359cf3f 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 4da2c0c61b..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 @@ -5,8 +5,10 @@ static FOO: fn() = || { assert_ne!(42, 43) }; static BAR: fn(i32, i32) = |a, b| { assert_ne!(a, b) }; // use to first make the closure FnOnce() before making it fn() -fn magic0 R>(f: F) -> F { f } -fn magic1 R>(f: F) -> F { f } +fn force_once0 R>(f: F) -> F { f } +fn force_once1 R>(f: F) -> F { f } +fn force_mut0 R>(f: F) -> F { f } +fn force_mut1 R>(f: F) -> F { f } fn main() { FOO(); @@ -18,19 +20,15 @@ fn main() { let f: fn() = ||{}; f(); - let f = magic0(||{}) as fn(); + let f = force_once0(||{}) as fn(); + f(); + let f = force_mut0(||{}) as fn(); f(); let g: fn(i32) = |i| assert_eq!(i, 2); g(2); - let g = magic1(|i| assert_eq!(i, 2)) as fn(i32); + let g = force_once1(|i| assert_eq!(i, 2)) as fn(i32); + 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. +}