about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-03-19 09:46:11 +0100
committerRalf Jung <post@ralfj.de>2019-03-26 09:23:19 +0100
commit853ae8d931c3fe4cd303edf7d80271c1930b9654 (patch)
tree40886165f9fcd93316af8df1e5e24df224debee0 /src/test
parent0e0383abc6d1f7d1edc456f66a2e3f4082e9a0a8 (diff)
downloadrust-853ae8d931c3fe4cd303edf7d80271c1930b9654.tar.gz
rust-853ae8d931c3fe4cd303edf7d80271c1930b9654.zip
fix some uses I missed
Diffstat (limited to 'src/test')
-rw-r--r--src/test/codegen/box-maybe-uninit.rs5
-rw-r--r--src/test/run-pass/panic-uninitialized-zeroed.rs6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/test/codegen/box-maybe-uninit.rs b/src/test/codegen/box-maybe-uninit.rs
index ad1d259a0da..0dd67bb95cc 100644
--- a/src/test/codegen/box-maybe-uninit.rs
+++ b/src/test/codegen/box-maybe-uninit.rs
@@ -12,5 +12,8 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
     // CHECK-NOT: alloca
     // CHECK-NOT: memcpy
     // CHECK-NOT: memset
-    Box::new(MaybeUninit::uninitialized())
+    Box::new(MaybeUninit::uninit())
 }
+
+// FIXME: add a test for a bigger box. Currently broken, see
+// https://github.com/rust-lang/rust/issues/58201.
diff --git a/src/test/run-pass/panic-uninitialized-zeroed.rs b/src/test/run-pass/panic-uninitialized-zeroed.rs
index 31c0d2994d4..3f6e489bb83 100644
--- a/src/test/run-pass/panic-uninitialized-zeroed.rs
+++ b/src/test/run-pass/panic-uninitialized-zeroed.rs
@@ -36,7 +36,7 @@ fn main() {
 
         assert_eq!(
             panic::catch_unwind(|| {
-                mem::MaybeUninit::<!>::uninitialized().into_initialized()
+                mem::MaybeUninit::<!>::uninit().assume_init()
             }).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
                 s == "Attempted to instantiate uninhabited type !"
             })),
@@ -63,7 +63,7 @@ fn main() {
 
         assert_eq!(
             panic::catch_unwind(|| {
-                mem::MaybeUninit::<Foo>::uninitialized().into_initialized()
+                mem::MaybeUninit::<Foo>::uninit().assume_init()
             }).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
                 s == "Attempted to instantiate uninhabited type Foo"
             })),
@@ -90,7 +90,7 @@ fn main() {
 
         assert_eq!(
             panic::catch_unwind(|| {
-                mem::MaybeUninit::<Bar>::uninitialized().into_initialized()
+                mem::MaybeUninit::<Bar>::uninit().assume_init()
             }).err().and_then(|a| a.downcast_ref::<String>().map(|s| {
                 s == "Attempted to instantiate uninhabited type Bar"
             })),