Skip to content

Commit

Permalink
Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jul 22, 2017
1 parent ff7f220 commit 0d1864b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/test/ui/print_type_sizes/nullable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}

Expand Down

0 comments on commit 0d1864b

Please sign in to comment.