From 27a66a1e4220afc859d3ee93a208a7f19b1c693f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 31 May 2019 19:05:31 +0200 Subject: [PATCH 1/2] test for no-validation-only failure --- tests/run-pass/without-validation.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/run-pass/without-validation.rs diff --git a/tests/run-pass/without-validation.rs b/tests/run-pass/without-validation.rs new file mode 100644 index 0000000000..8cff3a5c4b --- /dev/null +++ b/tests/run-pass/without-validation.rs @@ -0,0 +1,24 @@ +// When we notice something breaks only without validation, we add a test here. +// compile-flags: -Zmiri-disable-validation +use std::cell::*; + +fn refcell_unsize() { + let cell: RefCell<[i32; 3]> = RefCell::new([1, 2, 3]); + { + let mut cellref: RefMut<'_, [i32; 3]> = cell.borrow_mut(); + cellref[0] = 4; + let mut coerced: RefMut<'_, [i32]> = cellref; + coerced[2] = 5; + } + { + let comp: &mut [i32] = &mut [4, 2, 5]; + let cellref: Ref<'_, [i32; 3]> = cell.borrow(); + assert_eq!(&*cellref, comp); + let coerced: Ref<'_, [i32]> = cellref; + assert_eq!(&*coerced, comp); + } +} + +fn main() { + refcell_unsize(); +} From c06134c4afdc82c298e424e8f3e43c7e5379197c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 4 Jun 2019 13:22:27 +0200 Subject: [PATCH 2/2] bump Rust --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 7604934a98..930c6c17ac 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -627486af15d222bcba336b12ea92a05237cc9ab1 +021a5033098ff0e3f7126acc7ac35149d325f16d