Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs
This commit is contained in:
parent
ff7f220a43
commit
0d1864b8cf
1 changed files with 1 additions and 3 deletions
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue