We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ba169a commit 80e035cCopy full SHA for 80e035c
library/alloc/src/lib.rs
@@ -134,6 +134,7 @@
134
#![feature(ptr_metadata)]
135
#![feature(ptr_sub_ptr)]
136
#![feature(receiver_trait)]
137
+#![feature(saturating_int_impl)]
138
#![feature(set_ptr_value)]
139
#![feature(slice_from_ptr_range)]
140
#![feature(slice_group_by)]
library/alloc/src/vec/is_zero.rs
@@ -1,3 +1,5 @@
1
+use core::num::{Saturating, Wrapping};
2
+
3
use crate::boxed::Box;
4
5
#[rustc_specialization_trait]
@@ -144,3 +146,17 @@ impl_is_zero_option_of_nonzero!(
144
146
NonZeroUsize,
145
147
NonZeroIsize,
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
159
160
161
162
0 commit comments