Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs

This commit is contained in:
Simon Sapin 2017-07-17 14:52:36 +02:00
parent ff7f220a43
commit 0d1864b8cf

View file

@ -56,9 +56,7 @@ pub struct NestedNonZero<T: Zeroable> {
impl<T: Zeroable+One> Default for NestedNonZero<T> {
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 }
}
}