File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 134
134
#![feature(ptr_metadata)]
135
135
#![feature(ptr_sub_ptr)]
136
136
#![feature(receiver_trait)]
137
+ #![feature(saturating_int_impl)]
137
138
#![feature(set_ptr_value)]
138
139
#![feature(slice_from_ptr_range)]
139
140
#![feature(slice_group_by)]
Original file line number Diff line number Diff line change
1
+ use core::num::{Saturating, Wrapping};
2
+
1
3
use crate::boxed::Box;
2
4
3
5
#[rustc_specialization_trait]
@@ -144,3 +146,17 @@ impl_is_zero_option_of_nonzero!(
144
146
NonZeroUsize,
145
147
NonZeroIsize,
146
148
);
149
+
150
+ unsafe impl<T: IsZero> IsZero for Wrapping<T> {
151
+ #[inline]
152
+ fn is_zero(&self) -> bool {
153
+ self.0.is_zero()
154
+ }
155
+ }
156
+
157
+ unsafe impl<T: IsZero> IsZero for Saturating<T> {
158
+ #[inline]
159
+ fn is_zero(&self) -> bool {
160
+ self.0.is_zero()
161
+ }
162
+ }
You can’t perform that action at this time.
0 commit comments