From 0d1864b8cf9585e6133aa3da2b06b29cbfb791bd Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 17 Jul 2017 14:52:36 +0200 Subject: [PATCH] Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs --- src/test/ui/print_type_sizes/nullable.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/ui/print_type_sizes/nullable.rs b/src/test/ui/print_type_sizes/nullable.rs index a8f07d8d95569..5052c59a39dcf 100644 --- a/src/test/ui/print_type_sizes/nullable.rs +++ b/src/test/ui/print_type_sizes/nullable.rs @@ -56,9 +56,7 @@ pub struct NestedNonZero { impl Default for NestedNonZero { fn default() -> Self { - unsafe { - NestedNonZero { pre: 0, val: NonZero::new_unchecked(T::one()), post: 0 } - } + NestedNonZero { pre: 0, val: NonZero::new(T::one()).unwrap(), post: 0 } } }