Skip to content

Commit 0d1864b

Browse files
committed
Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs
1 parent ff7f220 commit 0d1864b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/test/ui/print_type_sizes/nullable.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ pub struct NestedNonZero<T: Zeroable> {
5656

5757
impl<T: Zeroable+One> Default for NestedNonZero<T> {
5858
fn default() -> Self {
59-
unsafe {
60-
NestedNonZero { pre: 0, val: NonZero::new_unchecked(T::one()), post: 0 }
61-
}
59+
NestedNonZero { pre: 0, val: NonZero::new(T::one()).unwrap(), post: 0 }
6260
}
6361
}
6462

0 commit comments

Comments
 (0)