Skip to main content

core/num/
saturating.rs

1//! Definitions of `Saturating<T>`.
2
3use crate::fmt;
4use crate::ops::{
5    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
6    Mul, MulAssign, Neg, Not, Rem, RemAssign, Sub, SubAssign,
7};
8
9/// Provides intentionally-saturating arithmetic on `T`.
10///
11/// Operations like `+` on `u32` values are intended to never overflow,
12/// and in some debug configurations overflow is detected and results
13/// in a panic. While most arithmetic falls into this category, some
14/// code explicitly expects and relies upon saturating arithmetic.
15///
16/// Saturating arithmetic can be achieved either through methods like
17/// `saturating_add`, or through the `Saturating<T>` type, which says that
18/// all standard arithmetic operations on the underlying value are
19/// intended to have saturating semantics.
20///
21/// The underlying value can be retrieved through the `.0` index of the
22/// `Saturating` tuple.
23///
24/// # Examples
25///
26/// ```
27/// use std::num::Saturating;
28///
29/// let max = Saturating(u32::MAX);
30/// let one = Saturating(1u32);
31///
32/// assert_eq!(u32::MAX, (max + one).0);
33/// ```
34///
35/// # Layout
36///
37/// `Saturating<T>` is guaranteed to have the same layout and ABI as `T`.
38#[stable(feature = "saturating_int_impl", since = "1.74.0")]
39#[derive(#[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::cmp::PartialEq> crate::marker::StructuralPartialEq for
    Saturating<T> {
}
#[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::cmp::PartialEq> crate::cmp::PartialEq for Saturating<T> {
    #[inline]
    fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
}PartialEq, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::cmp::Eq> crate::cmp::Eq for Saturating<T> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) { let _: crate::cmp::AssertParamIsEq<T>; }
}Eq, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::cmp::PartialOrd> crate::cmp::PartialOrd for Saturating<T> {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> crate::option::Option<crate::cmp::Ordering> {
        crate::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
    }
}PartialOrd, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::cmp::Ord> crate::cmp::Ord for Saturating<T> {
    #[inline]
    fn cmp(&self, other: &Self) -> crate::cmp::Ordering {
        crate::cmp::Ord::cmp(&self.0, &other.0)
    }
}Ord, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::clone::Clone> crate::clone::Clone for Saturating<T> {
    #[inline]
    fn clone(&self) -> Self {
        Saturating(crate::clone::Clone::clone(&self.0))
    }
}Clone, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::marker::Copy> crate::marker::Copy for Saturating<T> { }Copy, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::default::Default> crate::default::Default for Saturating<T> {
    #[inline]
    fn default() -> Self { Saturating(crate::default::Default::default()) }
}Default, #[automatically_derived]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
impl<T: crate::hash::Hash> crate::hash::Hash for Saturating<T> {
    #[inline]
    fn hash<__H: crate::hash::Hasher>(&self, state: &mut __H) {
        crate::hash::Hash::hash(&self.0, state)
    }
}Hash)]
40#[repr(transparent)]
41#[rustc_diagnostic_item = "Saturating"]
42pub struct Saturating<T>(#[stable(feature = "saturating_int_impl", since = "1.74.0")] pub T);
43
44#[stable(feature = "saturating_int_impl", since = "1.74.0")]
45impl<T: fmt::Debug> fmt::Debug for Saturating<T> {
46    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
47        self.0.fmt(f)
48    }
49}
50
51#[stable(feature = "saturating_int_impl", since = "1.74.0")]
52impl<T: fmt::Display> fmt::Display for Saturating<T> {
53    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
54        self.0.fmt(f)
55    }
56}
57
58#[stable(feature = "saturating_int_impl", since = "1.74.0")]
59impl<T: fmt::Binary> fmt::Binary for Saturating<T> {
60    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
61        self.0.fmt(f)
62    }
63}
64
65#[stable(feature = "saturating_int_impl", since = "1.74.0")]
66impl<T: fmt::Octal> fmt::Octal for Saturating<T> {
67    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
68        self.0.fmt(f)
69    }
70}
71
72#[stable(feature = "saturating_int_impl", since = "1.74.0")]
73impl<T: fmt::LowerHex> fmt::LowerHex for Saturating<T> {
74    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
75        self.0.fmt(f)
76    }
77}
78
79#[stable(feature = "saturating_int_impl", since = "1.74.0")]
80impl<T: fmt::UpperHex> fmt::UpperHex for Saturating<T> {
81    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
82        self.0.fmt(f)
83    }
84}
85
86// FIXME the correct implementation is not clear. Waiting for a real world use case at https://github.com/rust-lang/libs-team/issues/230
87//
88// #[allow(unused_macros)]
89// macro_rules! sh_impl_signed {
90//     ($t:ident, $f:ident) => {
91//         // FIXME what is the correct implementation here? see discussion https://github.com/rust-lang/rust/pull/87921#discussion_r695870065
92//         //
93//         // #[unstable(feature = "saturating_int_impl", issue = "87920")]
94//         // impl Shl<$f> for Saturating<$t> {
95//         //     type Output = Saturating<$t>;
96//         //
97//         //     #[inline]
98//         //     fn shl(self, other: $f) -> Saturating<$t> {
99//         //         if other < 0 {
100//         //             Saturating(self.0.shr((-other & self::shift_max::$t as $f) as u32))
101//         //         } else {
102//         //             Saturating(self.0.shl((other & self::shift_max::$t as $f) as u32))
103//         //         }
104//         //     }
105//         // }
106//         // forward_ref_binop! { impl Shl, shl for Saturating<$t>, $f,
107//         // #[unstable(feature = "saturating_int_impl", issue = "87920")] }
108//         //
109//         // #[unstable(feature = "saturating_int_impl", issue = "87920")]
110//         // impl ShlAssign<$f> for Saturating<$t> {
111//         //     #[inline]
112//         //     fn shl_assign(&mut self, other: $f) {
113//         //         *self = *self << other;
114//         //     }
115//         // }
116//         // forward_ref_op_assign! { impl ShlAssign, shl_assign for Saturating<$t>, $f,
117//         // #[unstable(feature = "saturating_int_impl", issue = "87920")] }
118//
119//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
120//         impl Shr<$f> for Saturating<$t> {
121//             type Output = Saturating<$t>;
122//
123//             #[inline]
124//             fn shr(self, other: $f) -> Saturating<$t> {
125//                 if other < 0 {
126//                     Saturating(self.0.shl((-other & self::shift_max::$t as $f) as u32))
127//                 } else {
128//                     Saturating(self.0.shr((other & self::shift_max::$t as $f) as u32))
129//                 }
130//             }
131//         }
132//         forward_ref_binop! { impl Shr, shr for Saturating<$t>, $f,
133//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
134//
135//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
136//         impl ShrAssign<$f> for Saturating<$t> {
137//             #[inline]
138//             fn shr_assign(&mut self, other: $f) {
139//                 *self = *self >> other;
140//             }
141//         }
142//         forward_ref_op_assign! { impl ShrAssign, shr_assign for Saturating<$t>, $f,
143//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
144//     };
145// }
146//
147// macro_rules! sh_impl_unsigned {
148//     ($t:ident, $f:ident) => {
149//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
150//         impl Shl<$f> for Saturating<$t> {
151//             type Output = Saturating<$t>;
152//
153//             #[inline]
154//             fn shl(self, other: $f) -> Saturating<$t> {
155//                 Saturating(self.0.wrapping_shl(other as u32))
156//             }
157//         }
158//         forward_ref_binop! { impl Shl, shl for Saturating<$t>, $f,
159//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
160//
161//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
162//         impl ShlAssign<$f> for Saturating<$t> {
163//             #[inline]
164//             fn shl_assign(&mut self, other: $f) {
165//                 *self = *self << other;
166//             }
167//         }
168//         forward_ref_op_assign! { impl ShlAssign, shl_assign for Saturating<$t>, $f,
169//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
170//
171//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
172//         impl Shr<$f> for Saturating<$t> {
173//             type Output = Saturating<$t>;
174//
175//             #[inline]
176//             fn shr(self, other: $f) -> Saturating<$t> {
177//                 Saturating(self.0.wrapping_shr(other as u32))
178//             }
179//         }
180//         forward_ref_binop! { impl Shr, shr for Saturating<$t>, $f,
181//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
182//
183//         #[unstable(feature = "saturating_int_impl", issue = "87920")]
184//         impl ShrAssign<$f> for Saturating<$t> {
185//             #[inline]
186//             fn shr_assign(&mut self, other: $f) {
187//                 *self = *self >> other;
188//             }
189//         }
190//         forward_ref_op_assign! { impl ShrAssign, shr_assign for Saturating<$t>, $f,
191//         #[unstable(feature = "saturating_int_impl", issue = "87920")] }
192//     };
193// }
194//
195// // FIXME (#23545): uncomment the remaining impls
196// macro_rules! sh_impl_all {
197//     ($($t:ident)*) => ($(
198//         //sh_impl_unsigned! { $t, u8 }
199//         //sh_impl_unsigned! { $t, u16 }
200//         //sh_impl_unsigned! { $t, u32 }
201//         //sh_impl_unsigned! { $t, u64 }
202//         //sh_impl_unsigned! { $t, u128 }
203//         sh_impl_unsigned! { $t, usize }
204//
205//         //sh_impl_signed! { $t, i8 }
206//         //sh_impl_signed! { $t, i16 }
207//         //sh_impl_signed! { $t, i32 }
208//         //sh_impl_signed! { $t, i64 }
209//         //sh_impl_signed! { $t, i128 }
210//         //sh_impl_signed! { $t, isize }
211//     )*)
212// }
213//
214// sh_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
215
216// FIXME(30524): impl Op<T> for Saturating<T>, impl OpAssign<T> for Saturating<T>
217macro_rules! saturating_impl {
218    ($($t:ty)*) => ($(
219        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
220        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
221        const impl Add for Saturating<$t> {
222            type Output = Saturating<$t>;
223
224            #[inline]
225            fn add(self, other: Saturating<$t>) -> Saturating<$t> {
226                Saturating(self.0.saturating_add(other.0))
227            }
228        }
229        forward_ref_binop! { impl Add, add for Saturating<$t>, Saturating<$t>,
230        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
231        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
232
233        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
234        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
235        const impl AddAssign for Saturating<$t> {
236            #[inline]
237            fn add_assign(&mut self, other: Saturating<$t>) {
238                *self = *self + other;
239            }
240        }
241        forward_ref_op_assign! { impl AddAssign, add_assign for Saturating<$t>, Saturating<$t>,
242        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
243        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
244
245        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
246        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
247        const impl AddAssign<$t> for Saturating<$t> {
248            #[inline]
249            fn add_assign(&mut self, other: $t) {
250                *self = *self + Saturating(other);
251            }
252        }
253        forward_ref_op_assign! { impl AddAssign, add_assign for Saturating<$t>, $t,
254        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
255        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
256
257        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
258        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
259        const impl Sub for Saturating<$t> {
260            type Output = Saturating<$t>;
261
262            #[inline]
263            fn sub(self, other: Saturating<$t>) -> Saturating<$t> {
264                Saturating(self.0.saturating_sub(other.0))
265            }
266        }
267        forward_ref_binop! { impl Sub, sub for Saturating<$t>, Saturating<$t>,
268        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
269        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
270
271        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
272        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
273        const impl SubAssign for Saturating<$t> {
274            #[inline]
275            fn sub_assign(&mut self, other: Saturating<$t>) {
276                *self = *self - other;
277            }
278        }
279        forward_ref_op_assign! { impl SubAssign, sub_assign for Saturating<$t>, Saturating<$t>,
280        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
281        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
282
283        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
284        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
285        const impl SubAssign<$t> for Saturating<$t> {
286            #[inline]
287            fn sub_assign(&mut self, other: $t) {
288                *self = *self - Saturating(other);
289            }
290        }
291        forward_ref_op_assign! { impl SubAssign, sub_assign for Saturating<$t>, $t,
292        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
293        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
294
295        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
296        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
297        const impl Mul for Saturating<$t> {
298            type Output = Saturating<$t>;
299
300            #[inline]
301            fn mul(self, other: Saturating<$t>) -> Saturating<$t> {
302                Saturating(self.0.saturating_mul(other.0))
303            }
304        }
305        forward_ref_binop! { impl Mul, mul for Saturating<$t>, Saturating<$t>,
306        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
307        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
308
309        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
310        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
311        const impl MulAssign for Saturating<$t> {
312            #[inline]
313            fn mul_assign(&mut self, other: Saturating<$t>) {
314                *self = *self * other;
315            }
316        }
317        forward_ref_op_assign! { impl MulAssign, mul_assign for Saturating<$t>, Saturating<$t>,
318        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
319        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
320
321        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
322        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
323        const impl MulAssign<$t> for Saturating<$t> {
324            #[inline]
325            fn mul_assign(&mut self, other: $t) {
326                *self = *self * Saturating(other);
327            }
328        }
329        forward_ref_op_assign! { impl MulAssign, mul_assign for Saturating<$t>, $t,
330        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
331        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
332
333        /// # Examples
334        ///
335        /// ```
336        /// use std::num::Saturating;
337        ///
338        #[doc = concat!("assert_eq!(Saturating(2", stringify!($t), "), Saturating(5", stringify!($t), ") / Saturating(2));")]
339        #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MAX), Saturating(", stringify!($t), "::MAX) / Saturating(1));")]
340        #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN), Saturating(", stringify!($t), "::MIN) / Saturating(1));")]
341        /// ```
342        ///
343        /// ```should_panic
344        /// use std::num::Saturating;
345        ///
346        #[doc = concat!("let _ = Saturating(0", stringify!($t), ") / Saturating(0);")]
347        /// ```
348        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
349        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
350        const impl Div for Saturating<$t> {
351            type Output = Saturating<$t>;
352
353            #[inline]
354            fn div(self, other: Saturating<$t>) -> Saturating<$t> {
355                Saturating(self.0.saturating_div(other.0))
356            }
357        }
358        forward_ref_binop! { impl Div, div for Saturating<$t>, Saturating<$t>,
359        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
360        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
361
362        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
363        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
364        const impl DivAssign for Saturating<$t> {
365            #[inline]
366            fn div_assign(&mut self, other: Saturating<$t>) {
367                *self = *self / other;
368            }
369        }
370        forward_ref_op_assign! { impl DivAssign, div_assign for Saturating<$t>, Saturating<$t>,
371        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
372        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
373
374        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
375        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
376        const impl DivAssign<$t> for Saturating<$t> {
377            #[inline]
378            fn div_assign(&mut self, other: $t) {
379                *self = *self / Saturating(other);
380            }
381        }
382        forward_ref_op_assign! { impl DivAssign, div_assign for Saturating<$t>, $t,
383        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
384        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
385
386        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
387        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
388        const impl Rem for Saturating<$t> {
389            type Output = Saturating<$t>;
390
391            #[inline]
392            fn rem(self, other: Saturating<$t>) -> Saturating<$t> {
393                Saturating(self.0.rem(other.0))
394            }
395        }
396        forward_ref_binop! { impl Rem, rem for Saturating<$t>, Saturating<$t>,
397        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
398        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
399
400        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
401        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
402        const impl RemAssign for Saturating<$t> {
403            #[inline]
404            fn rem_assign(&mut self, other: Saturating<$t>) {
405                *self = *self % other;
406            }
407        }
408        forward_ref_op_assign! { impl RemAssign, rem_assign for Saturating<$t>, Saturating<$t>,
409        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
410        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
411
412        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
413        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
414        const impl RemAssign<$t> for Saturating<$t> {
415            #[inline]
416            fn rem_assign(&mut self, other: $t) {
417                *self = *self % Saturating(other);
418            }
419        }
420        forward_ref_op_assign! { impl RemAssign, rem_assign for Saturating<$t>, $t,
421        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
422        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
423
424        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
425        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
426        const impl Not for Saturating<$t> {
427            type Output = Saturating<$t>;
428
429            #[inline]
430            fn not(self) -> Saturating<$t> {
431                Saturating(!self.0)
432            }
433        }
434        forward_ref_unop! { impl Not, not for Saturating<$t>,
435        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
436        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
437
438        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
439        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
440        const impl BitXor for Saturating<$t> {
441            type Output = Saturating<$t>;
442
443            #[inline]
444            fn bitxor(self, other: Saturating<$t>) -> Saturating<$t> {
445                Saturating(self.0 ^ other.0)
446            }
447        }
448        forward_ref_binop! { impl BitXor, bitxor for Saturating<$t>, Saturating<$t>,
449        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
450        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
451
452        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
453        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
454        const impl BitXorAssign for Saturating<$t> {
455            #[inline]
456            fn bitxor_assign(&mut self, other: Saturating<$t>) {
457                *self = *self ^ other;
458            }
459        }
460        forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for Saturating<$t>, Saturating<$t>,
461        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
462        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
463
464        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
465        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
466        const impl BitXorAssign<$t> for Saturating<$t> {
467            #[inline]
468            fn bitxor_assign(&mut self, other: $t) {
469                *self = *self ^ Saturating(other);
470            }
471        }
472        forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for Saturating<$t>, $t,
473        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
474        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
475
476        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
477        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
478        const impl BitOr for Saturating<$t> {
479            type Output = Saturating<$t>;
480
481            #[inline]
482            fn bitor(self, other: Saturating<$t>) -> Saturating<$t> {
483                Saturating(self.0 | other.0)
484            }
485        }
486        forward_ref_binop! { impl BitOr, bitor for Saturating<$t>, Saturating<$t>,
487        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
488        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
489
490        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
491        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
492        const impl BitOrAssign for Saturating<$t> {
493            #[inline]
494            fn bitor_assign(&mut self, other: Saturating<$t>) {
495                *self = *self | other;
496            }
497        }
498        forward_ref_op_assign! { impl BitOrAssign, bitor_assign for Saturating<$t>, Saturating<$t>,
499        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
500        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
501
502        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
503        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
504        const impl BitOrAssign<$t> for Saturating<$t> {
505            #[inline]
506            fn bitor_assign(&mut self, other: $t) {
507                *self = *self | Saturating(other);
508            }
509        }
510        forward_ref_op_assign! { impl BitOrAssign, bitor_assign for Saturating<$t>, $t,
511        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
512        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
513
514        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
515        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
516        const impl BitAnd for Saturating<$t> {
517            type Output = Saturating<$t>;
518
519            #[inline]
520            fn bitand(self, other: Saturating<$t>) -> Saturating<$t> {
521                Saturating(self.0 & other.0)
522            }
523        }
524        forward_ref_binop! { impl BitAnd, bitand for Saturating<$t>, Saturating<$t>,
525        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
526        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
527
528        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
529        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
530        const impl BitAndAssign for Saturating<$t> {
531            #[inline]
532            fn bitand_assign(&mut self, other: Saturating<$t>) {
533                *self = *self & other;
534            }
535        }
536        forward_ref_op_assign! { impl BitAndAssign, bitand_assign for Saturating<$t>, Saturating<$t>,
537        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
538        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
539
540        #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
541        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
542        const impl BitAndAssign<$t> for Saturating<$t> {
543            #[inline]
544            fn bitand_assign(&mut self, other: $t) {
545                *self = *self & Saturating(other);
546            }
547        }
548        forward_ref_op_assign! { impl BitAndAssign, bitand_assign for Saturating<$t>, $t,
549        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
550        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
551
552    )*)
553}
554
555#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn add(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<usize>)
        -> <Saturating<usize> as Add<Saturating<usize>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Add<Saturating<usize>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Add<Saturating<usize>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<usize> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<usize>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<usize>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<usize> for Saturating<usize> {
    #[inline]
    fn add_assign(&mut self, other: usize) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &usize) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn sub(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<usize>)
        -> <Saturating<usize> as Sub<Saturating<usize>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Sub<Saturating<usize>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Sub<Saturating<usize>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<usize> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<usize>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<usize>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<usize> for Saturating<usize> {
    #[inline]
    fn sub_assign(&mut self, other: usize) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &usize) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn mul(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<usize>)
        -> <Saturating<usize> as Mul<Saturating<usize>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Mul<Saturating<usize>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Mul<Saturating<usize>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<usize> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<usize>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<usize>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<usize> for Saturating<usize> {
    #[inline]
    fn mul_assign(&mut self, other: usize) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &usize) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2usize), Saturating(5usize) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(usize::MAX), Saturating(usize::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(usize::MIN), Saturating(usize::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0usize) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn div(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<usize>)
        -> <Saturating<usize> as Div<Saturating<usize>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Div<Saturating<usize>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Div<Saturating<usize>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<usize> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<usize>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<usize>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<usize> for Saturating<usize> {
    #[inline]
    fn div_assign(&mut self, other: usize) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &usize) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn rem(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<usize>)
        -> <Saturating<usize> as Rem<Saturating<usize>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Rem<Saturating<usize>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<usize>)
        -> <Saturating<usize> as Rem<Saturating<usize>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<usize> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<usize>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<usize>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<usize> for Saturating<usize> {
    #[inline]
    fn rem_assign(&mut self, other: usize) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &usize) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn not(self) -> Saturating<usize> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<usize> {
    type Output = <Saturating<usize> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<usize> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn bitxor(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<usize>)
        -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<usize> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<usize>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<usize>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<usize> for Saturating<usize> {
    #[inline]
    fn bitxor_assign(&mut self, other: usize) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &usize) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn bitor(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<usize>)
        -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<usize> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<usize>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<usize>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<usize> for Saturating<usize> {
    #[inline]
    fn bitor_assign(&mut self, other: usize) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &usize) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<usize> {
    type Output = Saturating<usize>;
    #[inline]
    fn bitand(self, other: Saturating<usize>) -> Saturating<usize> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<usize>)
        -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<usize>> for Saturating<usize> {
    type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<usize>> for &Saturating<usize> {
    type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<usize>)
        -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<usize> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<usize>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<usize>> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<usize>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<usize> for Saturating<usize> {
    #[inline]
    fn bitand_assign(&mut self, other: usize) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&usize> for Saturating<usize> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &usize) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn add(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<u8>)
        -> <Saturating<u8> as Add<Saturating<u8>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Add<Saturating<u8>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Add<Saturating<u8>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<u8> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<u8>) { *self = *self + other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<u8>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<u8> for Saturating<u8> {
    #[inline]
    fn add_assign(&mut self, other: u8) { *self = *self + Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &u8) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn sub(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<u8>)
        -> <Saturating<u8> as Sub<Saturating<u8>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Sub<Saturating<u8>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Sub<Saturating<u8>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<u8> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<u8>) { *self = *self - other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<u8>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<u8> for Saturating<u8> {
    #[inline]
    fn sub_assign(&mut self, other: u8) { *self = *self - Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &u8) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn mul(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<u8>)
        -> <Saturating<u8> as Mul<Saturating<u8>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Mul<Saturating<u8>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Mul<Saturating<u8>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<u8> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<u8>) { *self = *self * other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<u8>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<u8> for Saturating<u8> {
    #[inline]
    fn mul_assign(&mut self, other: u8) { *self = *self * Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &u8) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2u8), Saturating(5u8) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(u8::MAX), Saturating(u8::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(u8::MIN), Saturating(u8::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0u8) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn div(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<u8>)
        -> <Saturating<u8> as Div<Saturating<u8>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Div<Saturating<u8>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Div<Saturating<u8>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<u8> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<u8>) { *self = *self / other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<u8>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<u8> for Saturating<u8> {
    #[inline]
    fn div_assign(&mut self, other: u8) { *self = *self / Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &u8) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn rem(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<u8>)
        -> <Saturating<u8> as Rem<Saturating<u8>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Rem<Saturating<u8>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u8>)
        -> <Saturating<u8> as Rem<Saturating<u8>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<u8> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<u8>) { *self = *self % other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<u8>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<u8> for Saturating<u8> {
    #[inline]
    fn rem_assign(&mut self, other: u8) { *self = *self % Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &u8) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn not(self) -> Saturating<u8> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<u8> {
    type Output = <Saturating<u8> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<u8> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn bitxor(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<u8>)
        -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<u8> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<u8>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<u8>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<u8> for Saturating<u8> {
    #[inline]
    fn bitxor_assign(&mut self, other: u8) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &u8) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn bitor(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<u8>)
        -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<u8> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<u8>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<u8>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<u8> for Saturating<u8> {
    #[inline]
    fn bitor_assign(&mut self, other: u8) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &u8) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<u8> {
    type Output = Saturating<u8>;
    #[inline]
    fn bitand(self, other: Saturating<u8>) -> Saturating<u8> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<u8>)
        -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u8>> for Saturating<u8> {
    type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u8>> for &Saturating<u8> {
    type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u8>)
        -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<u8> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<u8>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<u8>> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<u8>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<u8> for Saturating<u8> {
    #[inline]
    fn bitand_assign(&mut self, other: u8) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&u8> for Saturating<u8> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &u8) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn add(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<u16>)
        -> <Saturating<u16> as Add<Saturating<u16>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Add<Saturating<u16>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Add<Saturating<u16>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<u16> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<u16>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<u16>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<u16> for Saturating<u16> {
    #[inline]
    fn add_assign(&mut self, other: u16) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &u16) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn sub(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<u16>)
        -> <Saturating<u16> as Sub<Saturating<u16>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Sub<Saturating<u16>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Sub<Saturating<u16>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<u16> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<u16>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<u16>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<u16> for Saturating<u16> {
    #[inline]
    fn sub_assign(&mut self, other: u16) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &u16) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn mul(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<u16>)
        -> <Saturating<u16> as Mul<Saturating<u16>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Mul<Saturating<u16>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Mul<Saturating<u16>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<u16> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<u16>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<u16>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<u16> for Saturating<u16> {
    #[inline]
    fn mul_assign(&mut self, other: u16) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &u16) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2u16), Saturating(5u16) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(u16::MAX), Saturating(u16::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(u16::MIN), Saturating(u16::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0u16) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn div(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<u16>)
        -> <Saturating<u16> as Div<Saturating<u16>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Div<Saturating<u16>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Div<Saturating<u16>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<u16> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<u16>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<u16>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<u16> for Saturating<u16> {
    #[inline]
    fn div_assign(&mut self, other: u16) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &u16) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn rem(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<u16>)
        -> <Saturating<u16> as Rem<Saturating<u16>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Rem<Saturating<u16>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u16>)
        -> <Saturating<u16> as Rem<Saturating<u16>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<u16> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<u16>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<u16>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<u16> for Saturating<u16> {
    #[inline]
    fn rem_assign(&mut self, other: u16) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &u16) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn not(self) -> Saturating<u16> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<u16> {
    type Output = <Saturating<u16> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<u16> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn bitxor(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<u16>)
        -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<u16> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<u16>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<u16>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<u16> for Saturating<u16> {
    #[inline]
    fn bitxor_assign(&mut self, other: u16) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &u16) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn bitor(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<u16>)
        -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<u16> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<u16>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<u16>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<u16> for Saturating<u16> {
    #[inline]
    fn bitor_assign(&mut self, other: u16) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &u16) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<u16> {
    type Output = Saturating<u16>;
    #[inline]
    fn bitand(self, other: Saturating<u16>) -> Saturating<u16> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<u16>)
        -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u16>> for Saturating<u16> {
    type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u16>> for &Saturating<u16> {
    type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u16>)
        -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<u16> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<u16>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<u16>> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<u16>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<u16> for Saturating<u16> {
    #[inline]
    fn bitand_assign(&mut self, other: u16) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&u16> for Saturating<u16> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &u16) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn add(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<u32>)
        -> <Saturating<u32> as Add<Saturating<u32>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Add<Saturating<u32>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Add<Saturating<u32>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<u32> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<u32>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<u32>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<u32> for Saturating<u32> {
    #[inline]
    fn add_assign(&mut self, other: u32) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &u32) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn sub(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<u32>)
        -> <Saturating<u32> as Sub<Saturating<u32>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Sub<Saturating<u32>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Sub<Saturating<u32>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<u32> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<u32>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<u32>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<u32> for Saturating<u32> {
    #[inline]
    fn sub_assign(&mut self, other: u32) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &u32) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn mul(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<u32>)
        -> <Saturating<u32> as Mul<Saturating<u32>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Mul<Saturating<u32>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Mul<Saturating<u32>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<u32> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<u32>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<u32>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<u32> for Saturating<u32> {
    #[inline]
    fn mul_assign(&mut self, other: u32) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &u32) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2u32), Saturating(5u32) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(u32::MAX), Saturating(u32::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(u32::MIN), Saturating(u32::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0u32) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn div(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<u32>)
        -> <Saturating<u32> as Div<Saturating<u32>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Div<Saturating<u32>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Div<Saturating<u32>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<u32> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<u32>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<u32>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<u32> for Saturating<u32> {
    #[inline]
    fn div_assign(&mut self, other: u32) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &u32) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn rem(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<u32>)
        -> <Saturating<u32> as Rem<Saturating<u32>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Rem<Saturating<u32>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u32>)
        -> <Saturating<u32> as Rem<Saturating<u32>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<u32> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<u32>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<u32>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<u32> for Saturating<u32> {
    #[inline]
    fn rem_assign(&mut self, other: u32) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &u32) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn not(self) -> Saturating<u32> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<u32> {
    type Output = <Saturating<u32> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<u32> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn bitxor(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<u32>)
        -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<u32> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<u32>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<u32>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<u32> for Saturating<u32> {
    #[inline]
    fn bitxor_assign(&mut self, other: u32) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &u32) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn bitor(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<u32>)
        -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<u32> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<u32>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<u32>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<u32> for Saturating<u32> {
    #[inline]
    fn bitor_assign(&mut self, other: u32) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &u32) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<u32> {
    type Output = Saturating<u32>;
    #[inline]
    fn bitand(self, other: Saturating<u32>) -> Saturating<u32> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<u32>)
        -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u32>> for Saturating<u32> {
    type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u32>> for &Saturating<u32> {
    type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u32>)
        -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<u32> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<u32>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<u32>> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<u32>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<u32> for Saturating<u32> {
    #[inline]
    fn bitand_assign(&mut self, other: u32) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&u32> for Saturating<u32> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &u32) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn add(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<u64>)
        -> <Saturating<u64> as Add<Saturating<u64>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Add<Saturating<u64>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Add<Saturating<u64>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<u64> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<u64>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<u64>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<u64> for Saturating<u64> {
    #[inline]
    fn add_assign(&mut self, other: u64) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &u64) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn sub(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<u64>)
        -> <Saturating<u64> as Sub<Saturating<u64>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Sub<Saturating<u64>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Sub<Saturating<u64>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<u64> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<u64>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<u64>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<u64> for Saturating<u64> {
    #[inline]
    fn sub_assign(&mut self, other: u64) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &u64) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn mul(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<u64>)
        -> <Saturating<u64> as Mul<Saturating<u64>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Mul<Saturating<u64>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Mul<Saturating<u64>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<u64> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<u64>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<u64>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<u64> for Saturating<u64> {
    #[inline]
    fn mul_assign(&mut self, other: u64) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &u64) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2u64), Saturating(5u64) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(u64::MAX), Saturating(u64::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(u64::MIN), Saturating(u64::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0u64) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn div(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<u64>)
        -> <Saturating<u64> as Div<Saturating<u64>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Div<Saturating<u64>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Div<Saturating<u64>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<u64> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<u64>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<u64>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<u64> for Saturating<u64> {
    #[inline]
    fn div_assign(&mut self, other: u64) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &u64) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn rem(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<u64>)
        -> <Saturating<u64> as Rem<Saturating<u64>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Rem<Saturating<u64>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u64>)
        -> <Saturating<u64> as Rem<Saturating<u64>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<u64> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<u64>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<u64>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<u64> for Saturating<u64> {
    #[inline]
    fn rem_assign(&mut self, other: u64) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &u64) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn not(self) -> Saturating<u64> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<u64> {
    type Output = <Saturating<u64> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<u64> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn bitxor(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<u64>)
        -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<u64> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<u64>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<u64>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<u64> for Saturating<u64> {
    #[inline]
    fn bitxor_assign(&mut self, other: u64) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &u64) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn bitor(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<u64>)
        -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<u64> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<u64>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<u64>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<u64> for Saturating<u64> {
    #[inline]
    fn bitor_assign(&mut self, other: u64) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &u64) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<u64> {
    type Output = Saturating<u64>;
    #[inline]
    fn bitand(self, other: Saturating<u64>) -> Saturating<u64> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<u64>)
        -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u64>> for Saturating<u64> {
    type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u64>> for &Saturating<u64> {
    type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u64>)
        -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<u64> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<u64>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<u64>> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<u64>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<u64> for Saturating<u64> {
    #[inline]
    fn bitand_assign(&mut self, other: u64) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&u64> for Saturating<u64> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &u64) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn add(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<u128>)
        -> <Saturating<u128> as Add<Saturating<u128>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Add<Saturating<u128>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Add<Saturating<u128>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<u128> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<u128>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<u128>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<u128> for Saturating<u128> {
    #[inline]
    fn add_assign(&mut self, other: u128) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &u128) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn sub(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<u128>)
        -> <Saturating<u128> as Sub<Saturating<u128>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Sub<Saturating<u128>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Sub<Saturating<u128>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<u128> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<u128>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<u128>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<u128> for Saturating<u128> {
    #[inline]
    fn sub_assign(&mut self, other: u128) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &u128) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn mul(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<u128>)
        -> <Saturating<u128> as Mul<Saturating<u128>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Mul<Saturating<u128>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Mul<Saturating<u128>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<u128> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<u128>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<u128>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<u128> for Saturating<u128> {
    #[inline]
    fn mul_assign(&mut self, other: u128) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &u128) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2u128), Saturating(5u128) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(u128::MAX), Saturating(u128::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(u128::MIN), Saturating(u128::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0u128) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn div(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<u128>)
        -> <Saturating<u128> as Div<Saturating<u128>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Div<Saturating<u128>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Div<Saturating<u128>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<u128> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<u128>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<u128>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<u128> for Saturating<u128> {
    #[inline]
    fn div_assign(&mut self, other: u128) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &u128) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn rem(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<u128>)
        -> <Saturating<u128> as Rem<Saturating<u128>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Rem<Saturating<u128>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<u128>)
        -> <Saturating<u128> as Rem<Saturating<u128>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<u128> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<u128>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<u128>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<u128> for Saturating<u128> {
    #[inline]
    fn rem_assign(&mut self, other: u128) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &u128) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn not(self) -> Saturating<u128> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<u128> {
    type Output = <Saturating<u128> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<u128> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn bitxor(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<u128>)
        -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<u128> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<u128>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<u128>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<u128> for Saturating<u128> {
    #[inline]
    fn bitxor_assign(&mut self, other: u128) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &u128) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn bitor(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<u128>)
        -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<u128> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<u128>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<u128>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<u128> for Saturating<u128> {
    #[inline]
    fn bitor_assign(&mut self, other: u128) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &u128) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<u128> {
    type Output = Saturating<u128>;
    #[inline]
    fn bitand(self, other: Saturating<u128>) -> Saturating<u128> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<u128>)
        -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u128>> for Saturating<u128> {
    type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<u128>> for &Saturating<u128> {
    type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<u128>)
        -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<u128> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<u128>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<u128>> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<u128>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<u128> for Saturating<u128> {
    #[inline]
    fn bitand_assign(&mut self, other: u128) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&u128> for Saturating<u128> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &u128) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn add(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<isize>)
        -> <Saturating<isize> as Add<Saturating<isize>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Add<Saturating<isize>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Add<Saturating<isize>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<isize> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<isize>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<isize>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<isize> for Saturating<isize> {
    #[inline]
    fn add_assign(&mut self, other: isize) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &isize) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn sub(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<isize>)
        -> <Saturating<isize> as Sub<Saturating<isize>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Sub<Saturating<isize>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Sub<Saturating<isize>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<isize> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<isize>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<isize>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<isize> for Saturating<isize> {
    #[inline]
    fn sub_assign(&mut self, other: isize) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &isize) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn mul(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<isize>)
        -> <Saturating<isize> as Mul<Saturating<isize>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Mul<Saturating<isize>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Mul<Saturating<isize>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<isize> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<isize>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<isize>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<isize> for Saturating<isize> {
    #[inline]
    fn mul_assign(&mut self, other: isize) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &isize) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2isize), Saturating(5isize) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(isize::MAX), Saturating(isize::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(isize::MIN), Saturating(isize::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0isize) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn div(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<isize>)
        -> <Saturating<isize> as Div<Saturating<isize>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Div<Saturating<isize>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Div<Saturating<isize>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<isize> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<isize>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<isize>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<isize> for Saturating<isize> {
    #[inline]
    fn div_assign(&mut self, other: isize) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &isize) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn rem(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<isize>)
        -> <Saturating<isize> as Rem<Saturating<isize>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Rem<Saturating<isize>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<isize>)
        -> <Saturating<isize> as Rem<Saturating<isize>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<isize> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<isize>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<isize>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<isize> for Saturating<isize> {
    #[inline]
    fn rem_assign(&mut self, other: isize) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &isize) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn not(self) -> Saturating<isize> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<isize> {
    type Output = <Saturating<isize> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<isize> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn bitxor(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<isize>)
        -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<isize> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<isize>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<isize>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<isize> for Saturating<isize> {
    #[inline]
    fn bitxor_assign(&mut self, other: isize) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &isize) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn bitor(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<isize>)
        -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<isize> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<isize>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<isize>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<isize> for Saturating<isize> {
    #[inline]
    fn bitor_assign(&mut self, other: isize) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &isize) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<isize> {
    type Output = Saturating<isize>;
    #[inline]
    fn bitand(self, other: Saturating<isize>) -> Saturating<isize> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<isize>)
        -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<isize>> for Saturating<isize> {
    type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<isize>> for &Saturating<isize> {
    type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<isize>)
        -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<isize> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<isize>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<isize>> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<isize>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<isize> for Saturating<isize> {
    #[inline]
    fn bitand_assign(&mut self, other: isize) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&isize> for Saturating<isize> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &isize) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn add(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<i8>)
        -> <Saturating<i8> as Add<Saturating<i8>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Add<Saturating<i8>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Add<Saturating<i8>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<i8> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<i8>) { *self = *self + other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<i8>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<i8> for Saturating<i8> {
    #[inline]
    fn add_assign(&mut self, other: i8) { *self = *self + Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &i8) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn sub(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<i8>)
        -> <Saturating<i8> as Sub<Saturating<i8>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Sub<Saturating<i8>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Sub<Saturating<i8>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<i8> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<i8>) { *self = *self - other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<i8>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<i8> for Saturating<i8> {
    #[inline]
    fn sub_assign(&mut self, other: i8) { *self = *self - Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &i8) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn mul(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<i8>)
        -> <Saturating<i8> as Mul<Saturating<i8>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Mul<Saturating<i8>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Mul<Saturating<i8>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<i8> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<i8>) { *self = *self * other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<i8>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<i8> for Saturating<i8> {
    #[inline]
    fn mul_assign(&mut self, other: i8) { *self = *self * Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &i8) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2i8), Saturating(5i8) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(i8::MAX), Saturating(i8::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(i8::MIN), Saturating(i8::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0i8) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn div(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<i8>)
        -> <Saturating<i8> as Div<Saturating<i8>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Div<Saturating<i8>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Div<Saturating<i8>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<i8> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<i8>) { *self = *self / other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<i8>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<i8> for Saturating<i8> {
    #[inline]
    fn div_assign(&mut self, other: i8) { *self = *self / Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &i8) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn rem(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<i8>)
        -> <Saturating<i8> as Rem<Saturating<i8>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Rem<Saturating<i8>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i8>)
        -> <Saturating<i8> as Rem<Saturating<i8>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<i8> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<i8>) { *self = *self % other; }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<i8>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<i8> for Saturating<i8> {
    #[inline]
    fn rem_assign(&mut self, other: i8) { *self = *self % Saturating(other); }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &i8) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn not(self) -> Saturating<i8> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<i8> {
    type Output = <Saturating<i8> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<i8> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn bitxor(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<i8>)
        -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<i8> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<i8>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<i8>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<i8> for Saturating<i8> {
    #[inline]
    fn bitxor_assign(&mut self, other: i8) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &i8) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn bitor(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<i8>)
        -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<i8> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<i8>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<i8>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<i8> for Saturating<i8> {
    #[inline]
    fn bitor_assign(&mut self, other: i8) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &i8) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<i8> {
    type Output = Saturating<i8>;
    #[inline]
    fn bitand(self, other: Saturating<i8>) -> Saturating<i8> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<i8>)
        -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i8>> for Saturating<i8> {
    type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i8>> for &Saturating<i8> {
    type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i8>)
        -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<i8> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<i8>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<i8>> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<i8>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<i8> for Saturating<i8> {
    #[inline]
    fn bitand_assign(&mut self, other: i8) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&i8> for Saturating<i8> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &i8) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn add(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<i16>)
        -> <Saturating<i16> as Add<Saturating<i16>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Add<Saturating<i16>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Add<Saturating<i16>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<i16> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<i16>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<i16>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<i16> for Saturating<i16> {
    #[inline]
    fn add_assign(&mut self, other: i16) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &i16) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn sub(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<i16>)
        -> <Saturating<i16> as Sub<Saturating<i16>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Sub<Saturating<i16>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Sub<Saturating<i16>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<i16> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<i16>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<i16>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<i16> for Saturating<i16> {
    #[inline]
    fn sub_assign(&mut self, other: i16) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &i16) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn mul(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<i16>)
        -> <Saturating<i16> as Mul<Saturating<i16>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Mul<Saturating<i16>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Mul<Saturating<i16>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<i16> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<i16>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<i16>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<i16> for Saturating<i16> {
    #[inline]
    fn mul_assign(&mut self, other: i16) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &i16) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2i16), Saturating(5i16) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(i16::MAX), Saturating(i16::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(i16::MIN), Saturating(i16::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0i16) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn div(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<i16>)
        -> <Saturating<i16> as Div<Saturating<i16>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Div<Saturating<i16>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Div<Saturating<i16>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<i16> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<i16>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<i16>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<i16> for Saturating<i16> {
    #[inline]
    fn div_assign(&mut self, other: i16) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &i16) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn rem(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<i16>)
        -> <Saturating<i16> as Rem<Saturating<i16>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Rem<Saturating<i16>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i16>)
        -> <Saturating<i16> as Rem<Saturating<i16>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<i16> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<i16>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<i16>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<i16> for Saturating<i16> {
    #[inline]
    fn rem_assign(&mut self, other: i16) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &i16) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn not(self) -> Saturating<i16> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<i16> {
    type Output = <Saturating<i16> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<i16> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn bitxor(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<i16>)
        -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<i16> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<i16>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<i16>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<i16> for Saturating<i16> {
    #[inline]
    fn bitxor_assign(&mut self, other: i16) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &i16) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn bitor(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<i16>)
        -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<i16> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<i16>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<i16>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<i16> for Saturating<i16> {
    #[inline]
    fn bitor_assign(&mut self, other: i16) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &i16) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<i16> {
    type Output = Saturating<i16>;
    #[inline]
    fn bitand(self, other: Saturating<i16>) -> Saturating<i16> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<i16>)
        -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i16>> for Saturating<i16> {
    type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i16>> for &Saturating<i16> {
    type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i16>)
        -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<i16> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<i16>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<i16>> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<i16>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<i16> for Saturating<i16> {
    #[inline]
    fn bitand_assign(&mut self, other: i16) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&i16> for Saturating<i16> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &i16) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn add(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<i32>)
        -> <Saturating<i32> as Add<Saturating<i32>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Add<Saturating<i32>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Add<Saturating<i32>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<i32> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<i32>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<i32>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<i32> for Saturating<i32> {
    #[inline]
    fn add_assign(&mut self, other: i32) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &i32) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn sub(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<i32>)
        -> <Saturating<i32> as Sub<Saturating<i32>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Sub<Saturating<i32>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Sub<Saturating<i32>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<i32> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<i32>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<i32>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<i32> for Saturating<i32> {
    #[inline]
    fn sub_assign(&mut self, other: i32) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &i32) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn mul(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<i32>)
        -> <Saturating<i32> as Mul<Saturating<i32>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Mul<Saturating<i32>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Mul<Saturating<i32>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<i32> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<i32>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<i32>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<i32> for Saturating<i32> {
    #[inline]
    fn mul_assign(&mut self, other: i32) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &i32) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2i32), Saturating(5i32) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(i32::MAX), Saturating(i32::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(i32::MIN), Saturating(i32::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0i32) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn div(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<i32>)
        -> <Saturating<i32> as Div<Saturating<i32>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Div<Saturating<i32>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Div<Saturating<i32>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<i32> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<i32>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<i32>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<i32> for Saturating<i32> {
    #[inline]
    fn div_assign(&mut self, other: i32) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &i32) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn rem(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<i32>)
        -> <Saturating<i32> as Rem<Saturating<i32>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Rem<Saturating<i32>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i32>)
        -> <Saturating<i32> as Rem<Saturating<i32>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<i32> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<i32>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<i32>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<i32> for Saturating<i32> {
    #[inline]
    fn rem_assign(&mut self, other: i32) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &i32) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn not(self) -> Saturating<i32> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<i32> {
    type Output = <Saturating<i32> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<i32> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn bitxor(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<i32>)
        -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<i32> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<i32>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<i32>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<i32> for Saturating<i32> {
    #[inline]
    fn bitxor_assign(&mut self, other: i32) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &i32) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn bitor(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<i32>)
        -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<i32> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<i32>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<i32>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<i32> for Saturating<i32> {
    #[inline]
    fn bitor_assign(&mut self, other: i32) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &i32) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<i32> {
    type Output = Saturating<i32>;
    #[inline]
    fn bitand(self, other: Saturating<i32>) -> Saturating<i32> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<i32>)
        -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i32>> for Saturating<i32> {
    type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i32>> for &Saturating<i32> {
    type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i32>)
        -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<i32> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<i32>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<i32>> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<i32>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<i32> for Saturating<i32> {
    #[inline]
    fn bitand_assign(&mut self, other: i32) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&i32> for Saturating<i32> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &i32) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn add(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<i64>)
        -> <Saturating<i64> as Add<Saturating<i64>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Add<Saturating<i64>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Add<Saturating<i64>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<i64> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<i64>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<i64>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<i64> for Saturating<i64> {
    #[inline]
    fn add_assign(&mut self, other: i64) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &i64) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn sub(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<i64>)
        -> <Saturating<i64> as Sub<Saturating<i64>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Sub<Saturating<i64>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Sub<Saturating<i64>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<i64> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<i64>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<i64>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<i64> for Saturating<i64> {
    #[inline]
    fn sub_assign(&mut self, other: i64) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &i64) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn mul(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<i64>)
        -> <Saturating<i64> as Mul<Saturating<i64>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Mul<Saturating<i64>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Mul<Saturating<i64>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<i64> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<i64>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<i64>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<i64> for Saturating<i64> {
    #[inline]
    fn mul_assign(&mut self, other: i64) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &i64) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2i64), Saturating(5i64) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(i64::MAX), Saturating(i64::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(i64::MIN), Saturating(i64::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0i64) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn div(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<i64>)
        -> <Saturating<i64> as Div<Saturating<i64>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Div<Saturating<i64>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Div<Saturating<i64>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<i64> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<i64>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<i64>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<i64> for Saturating<i64> {
    #[inline]
    fn div_assign(&mut self, other: i64) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &i64) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn rem(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<i64>)
        -> <Saturating<i64> as Rem<Saturating<i64>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Rem<Saturating<i64>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i64>)
        -> <Saturating<i64> as Rem<Saturating<i64>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<i64> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<i64>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<i64>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<i64> for Saturating<i64> {
    #[inline]
    fn rem_assign(&mut self, other: i64) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &i64) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn not(self) -> Saturating<i64> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<i64> {
    type Output = <Saturating<i64> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<i64> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn bitxor(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<i64>)
        -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<i64> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<i64>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<i64>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<i64> for Saturating<i64> {
    #[inline]
    fn bitxor_assign(&mut self, other: i64) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &i64) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn bitor(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<i64>)
        -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<i64> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<i64>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<i64>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<i64> for Saturating<i64> {
    #[inline]
    fn bitor_assign(&mut self, other: i64) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &i64) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<i64> {
    type Output = Saturating<i64>;
    #[inline]
    fn bitand(self, other: Saturating<i64>) -> Saturating<i64> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<i64>)
        -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i64>> for Saturating<i64> {
    type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i64>> for &Saturating<i64> {
    type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i64>)
        -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<i64> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<i64>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<i64>> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<i64>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<i64> for Saturating<i64> {
    #[inline]
    fn bitand_assign(&mut self, other: i64) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&i64> for Saturating<i64> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &i64) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn add(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0.saturating_add(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: Saturating<i128>)
        -> <Saturating<i128> as Add<Saturating<i128>>>::Output {
        Add::add(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Add<Saturating<i128>>>::Output {
        Add::add(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Add<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn add(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Add<Saturating<i128>>>::Output {
        Add::add(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign for Saturating<i128> {
    #[inline]
    fn add_assign(&mut self, other: Saturating<i128>) {
        *self = *self + other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &Saturating<i128>) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<i128> for Saturating<i128> {
    #[inline]
    fn add_assign(&mut self, other: i128) {
        *self = *self + Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl AddAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn add_assign(&mut self, other: &i128) {
        AddAssign::add_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn sub(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0.saturating_sub(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: Saturating<i128>)
        -> <Saturating<i128> as Sub<Saturating<i128>>>::Output {
        Sub::sub(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Sub<Saturating<i128>>>::Output {
        Sub::sub(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Sub<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn sub(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Sub<Saturating<i128>>>::Output {
        Sub::sub(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign for Saturating<i128> {
    #[inline]
    fn sub_assign(&mut self, other: Saturating<i128>) {
        *self = *self - other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &Saturating<i128>) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<i128> for Saturating<i128> {
    #[inline]
    fn sub_assign(&mut self, other: i128) {
        *self = *self - Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl SubAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn sub_assign(&mut self, other: &i128) {
        SubAssign::sub_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn mul(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0.saturating_mul(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: Saturating<i128>)
        -> <Saturating<i128> as Mul<Saturating<i128>>>::Output {
        Mul::mul(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Mul<Saturating<i128>>>::Output {
        Mul::mul(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Mul<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn mul(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Mul<Saturating<i128>>>::Output {
        Mul::mul(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign for Saturating<i128> {
    #[inline]
    fn mul_assign(&mut self, other: Saturating<i128>) {
        *self = *self * other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &Saturating<i128>) {
        MulAssign::mul_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<i128> for Saturating<i128> {
    #[inline]
    fn mul_assign(&mut self, other: i128) {
        *self = *self * Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl MulAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn mul_assign(&mut self, other: &i128) {
        MulAssign::mul_assign(self, *other);
    }
}
/// # Examples
///
/// ```
/// use std::num::Saturating;
///
#[doc = "assert_eq!(Saturating(2i128), Saturating(5i128) / Saturating(2));"]
#[doc =
"assert_eq!(Saturating(i128::MAX), Saturating(i128::MAX) / Saturating(1));"]
#[doc =
"assert_eq!(Saturating(i128::MIN), Saturating(i128::MIN) / Saturating(1));"]
/// ```
///
/// ```should_panic
/// use std::num::Saturating;
///
#[doc = "let _ = Saturating(0i128) / Saturating(0);"]
/// ```
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn div(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0.saturating_div(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: Saturating<i128>)
        -> <Saturating<i128> as Div<Saturating<i128>>>::Output {
        Div::div(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Div<Saturating<i128>>>::Output {
        Div::div(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Div<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn div(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Div<Saturating<i128>>>::Output {
        Div::div(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign for Saturating<i128> {
    #[inline]
    fn div_assign(&mut self, other: Saturating<i128>) {
        *self = *self / other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &Saturating<i128>) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<i128> for Saturating<i128> {
    #[inline]
    fn div_assign(&mut self, other: i128) {
        *self = *self / Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl DivAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn div_assign(&mut self, other: &i128) {
        DivAssign::div_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn rem(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0.rem(other.0))
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: Saturating<i128>)
        -> <Saturating<i128> as Rem<Saturating<i128>>>::Output {
        Rem::rem(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Rem<Saturating<i128>>>::Output {
        Rem::rem(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Rem<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn rem(self, other: &Saturating<i128>)
        -> <Saturating<i128> as Rem<Saturating<i128>>>::Output {
        Rem::rem(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign for Saturating<i128> {
    #[inline]
    fn rem_assign(&mut self, other: Saturating<i128>) {
        *self = *self % other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &Saturating<i128>) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<i128> for Saturating<i128> {
    #[inline]
    fn rem_assign(&mut self, other: i128) {
        *self = *self % Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl RemAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn rem_assign(&mut self, other: &i128) {
        RemAssign::rem_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn not(self) -> Saturating<i128> { Saturating(!self.0) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Not for &Saturating<i128> {
    type Output = <Saturating<i128> as Not>::Output;
    #[inline]
    fn not(self) -> <Saturating<i128> as Not>::Output { Not::not(*self) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn bitxor(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0 ^ other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: Saturating<i128>)
        -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output {
        BitXor::bitxor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output {
        BitXor::bitxor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXor<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitxor(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output {
        BitXor::bitxor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign for Saturating<i128> {
    #[inline]
    fn bitxor_assign(&mut self, other: Saturating<i128>) {
        *self = *self ^ other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &Saturating<i128>) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<i128> for Saturating<i128> {
    #[inline]
    fn bitxor_assign(&mut self, other: i128) {
        *self = *self ^ Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitXorAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitxor_assign(&mut self, other: &i128) {
        BitXorAssign::bitxor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn bitor(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0 | other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: Saturating<i128>)
        -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output {
        BitOr::bitor(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output {
        BitOr::bitor(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOr<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitor(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output {
        BitOr::bitor(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign for Saturating<i128> {
    #[inline]
    fn bitor_assign(&mut self, other: Saturating<i128>) {
        *self = *self | other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &Saturating<i128>) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<i128> for Saturating<i128> {
    #[inline]
    fn bitor_assign(&mut self, other: i128) {
        *self = *self | Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitOrAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitor_assign(&mut self, other: &i128) {
        BitOrAssign::bitor_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd for Saturating<i128> {
    type Output = Saturating<i128>;
    #[inline]
    fn bitand(self, other: Saturating<i128>) -> Saturating<i128> {
        Saturating(self.0 & other.0)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: Saturating<i128>)
        -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output {
        BitAnd::bitand(*self, other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i128>> for Saturating<i128> {
    type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output {
        BitAnd::bitand(self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAnd<&Saturating<i128>> for &Saturating<i128> {
    type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output;
    #[inline]
    #[track_caller]
    fn bitand(self, other: &Saturating<i128>)
        -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output {
        BitAnd::bitand(*self, *other)
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign for Saturating<i128> {
    #[inline]
    fn bitand_assign(&mut self, other: Saturating<i128>) {
        *self = *self & other;
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&Saturating<i128>> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &Saturating<i128>) {
        BitAndAssign::bitand_assign(self, *other);
    }
}
#[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<i128> for Saturating<i128> {
    #[inline]
    fn bitand_assign(&mut self, other: i128) {
        *self = *self & Saturating(other);
    }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl BitAndAssign<&i128> for Saturating<i128> {
    #[inline]
    #[track_caller]
    fn bitand_assign(&mut self, other: &i128) {
        BitAndAssign::bitand_assign(self, *other);
    }
}saturating_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
556
557macro_rules! saturating_int_impl {
558    ($($t:ty)*) => ($(
559        impl Saturating<$t> {
560            /// Returns the smallest value that can be represented by this integer type.
561            ///
562            /// # Examples
563            ///
564            /// ```
565            /// use std::num::Saturating;
566            ///
567            #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::MIN, Saturating(", stringify!($t), "::MIN));")]
568            /// ```
569            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
570            pub const MIN: Self = Self(<$t>::MIN);
571
572            /// Returns the largest value that can be represented by this integer type.
573            ///
574            /// # Examples
575            ///
576            /// ```
577            /// use std::num::Saturating;
578            ///
579            #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::MAX, Saturating(", stringify!($t), "::MAX));")]
580            /// ```
581            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
582            pub const MAX: Self = Self(<$t>::MAX);
583
584            /// Returns the size of this integer type in bits.
585            ///
586            /// # Examples
587            ///
588            /// ```
589            /// use std::num::Saturating;
590            ///
591            #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::BITS, ", stringify!($t), "::BITS);")]
592            /// ```
593            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
594            pub const BITS: u32 = <$t>::BITS;
595
596            /// Returns the number of ones in the binary representation of `self`.
597            ///
598            /// # Examples
599            ///
600            /// ```
601            /// use std::num::Saturating;
602            ///
603            #[doc = concat!("let n = Saturating(0b01001100", stringify!($t), ");")]
604            ///
605            /// assert_eq!(n.count_ones(), 3);
606            /// ```
607            #[inline]
608            #[doc(alias = "popcount")]
609            #[doc(alias = "popcnt")]
610            #[must_use = "this returns the result of the operation, \
611                          without modifying the original"]
612            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
613            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
614            pub const fn count_ones(self) -> u32 {
615                self.0.count_ones()
616            }
617
618            /// Returns the number of zeros in the binary representation of `self`.
619            ///
620            /// # Examples
621            ///
622            /// ```
623            /// use std::num::Saturating;
624            ///
625            #[doc = concat!("assert_eq!(Saturating(!0", stringify!($t), ").count_zeros(), 0);")]
626            /// ```
627            #[inline]
628            #[must_use = "this returns the result of the operation, \
629                          without modifying the original"]
630            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
631            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
632            pub const fn count_zeros(self) -> u32 {
633                self.0.count_zeros()
634            }
635
636            /// Returns the number of trailing zeros in the binary representation of `self`.
637            ///
638            /// # Examples
639            ///
640            /// ```
641            /// use std::num::Saturating;
642            ///
643            #[doc = concat!("let n = Saturating(0b0101000", stringify!($t), ");")]
644            ///
645            /// assert_eq!(n.trailing_zeros(), 3);
646            /// ```
647            #[inline]
648            #[must_use = "this returns the result of the operation, \
649                          without modifying the original"]
650            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
651            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
652            pub const fn trailing_zeros(self) -> u32 {
653                self.0.trailing_zeros()
654            }
655
656            /// Shifts the bits to the left by a specified amount, `n`,
657            /// saturating the truncated bits to the end of the resulting
658            /// integer.
659            ///
660            /// Please note this isn't the same operation as the `<<` shifting
661            /// operator!
662            ///
663            /// # Examples
664            ///
665            /// ```
666            /// use std::num::Saturating;
667            ///
668            /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
669            /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
670            ///
671            /// assert_eq!(n.rotate_left(32), m);
672            /// ```
673            #[inline]
674            #[must_use = "this returns the result of the operation, \
675                          without modifying the original"]
676            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
677            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
678            pub const fn rotate_left(self, n: u32) -> Self {
679                Saturating(self.0.rotate_left(n))
680            }
681
682            /// Shifts the bits to the right by a specified amount, `n`,
683            /// saturating the truncated bits to the beginning of the resulting
684            /// integer.
685            ///
686            /// Please note this isn't the same operation as the `>>` shifting
687            /// operator!
688            ///
689            /// # Examples
690            ///
691            /// ```
692            /// use std::num::Saturating;
693            ///
694            /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
695            /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
696            ///
697            /// assert_eq!(n.rotate_right(4), m);
698            /// ```
699            #[inline]
700            #[must_use = "this returns the result of the operation, \
701                          without modifying the original"]
702            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
703            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
704            pub const fn rotate_right(self, n: u32) -> Self {
705                Saturating(self.0.rotate_right(n))
706            }
707
708            /// Reverses the byte order of the integer.
709            ///
710            /// # Examples
711            ///
712            /// ```
713            /// use std::num::Saturating;
714            ///
715            /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
716            /// assert_eq!(n, Saturating(85));
717            ///
718            /// let m = n.swap_bytes();
719            ///
720            /// assert_eq!(m, Saturating(0b01010101_00000000));
721            /// assert_eq!(m, Saturating(21760));
722            /// ```
723            #[inline]
724            #[must_use = "this returns the result of the operation, \
725                          without modifying the original"]
726            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
727            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
728            pub const fn swap_bytes(self) -> Self {
729                Saturating(self.0.swap_bytes())
730            }
731
732            /// Reverses the bit pattern of the integer.
733            ///
734            /// # Examples
735            ///
736            /// Please note that this example is shared among integer types, which is why `i16`
737            /// is used.
738            ///
739            /// ```
740            /// use std::num::Saturating;
741            ///
742            /// let n = Saturating(0b0000000_01010101i16);
743            /// assert_eq!(n, Saturating(85));
744            ///
745            /// let m = n.reverse_bits();
746            ///
747            /// assert_eq!(m.0 as u16, 0b10101010_00000000);
748            /// assert_eq!(m, Saturating(-22016));
749            /// ```
750            #[inline]
751            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
752            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
753            #[must_use = "this returns the result of the operation, \
754                          without modifying the original"]
755            pub const fn reverse_bits(self) -> Self {
756                Saturating(self.0.reverse_bits())
757            }
758
759            /// Converts an integer from big endian to the target's endianness.
760            ///
761            /// On big endian this is a no-op. On little endian the bytes are
762            /// swapped.
763            ///
764            /// # Examples
765            ///
766            /// ```
767            /// use std::num::Saturating;
768            ///
769            #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
770            ///
771            /// if cfg!(target_endian = "big") {
772            #[doc = concat!("    assert_eq!(<Saturating<", stringify!($t), ">>::from_be(n), n)")]
773            /// } else {
774            #[doc = concat!("    assert_eq!(<Saturating<", stringify!($t), ">>::from_be(n), n.swap_bytes())")]
775            /// }
776            /// ```
777            #[inline]
778            #[must_use]
779            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
780            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
781            pub const fn from_be(x: Self) -> Self {
782                Saturating(<$t>::from_be(x.0))
783            }
784
785            /// Converts an integer from little endian to the target's endianness.
786            ///
787            /// On little endian this is a no-op. On big endian the bytes are
788            /// swapped.
789            ///
790            /// # Examples
791            ///
792            /// ```
793            /// use std::num::Saturating;
794            ///
795            #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
796            ///
797            /// if cfg!(target_endian = "little") {
798            #[doc = concat!("    assert_eq!(<Saturating<", stringify!($t), ">>::from_le(n), n)")]
799            /// } else {
800            #[doc = concat!("    assert_eq!(<Saturating<", stringify!($t), ">>::from_le(n), n.swap_bytes())")]
801            /// }
802            /// ```
803            #[inline]
804            #[must_use]
805            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
806            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
807            pub const fn from_le(x: Self) -> Self {
808                Saturating(<$t>::from_le(x.0))
809            }
810
811            /// Converts `self` to big endian from the target's endianness.
812            ///
813            /// On big endian this is a no-op. On little endian the bytes are
814            /// swapped.
815            ///
816            /// # Examples
817            ///
818            /// ```
819            /// use std::num::Saturating;
820            ///
821            #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
822            ///
823            /// if cfg!(target_endian = "big") {
824            ///     assert_eq!(n.to_be(), n)
825            /// } else {
826            ///     assert_eq!(n.to_be(), n.swap_bytes())
827            /// }
828            /// ```
829            #[inline]
830            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
831            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
832            #[must_use = "this returns the result of the operation, \
833                          without modifying the original"]
834            pub const fn to_be(self) -> Self {
835                Saturating(self.0.to_be())
836            }
837
838            /// Converts `self` to little endian from the target's endianness.
839            ///
840            /// On little endian this is a no-op. On big endian the bytes are
841            /// swapped.
842            ///
843            /// # Examples
844            ///
845            /// ```
846            /// use std::num::Saturating;
847            ///
848            #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
849            ///
850            /// if cfg!(target_endian = "little") {
851            ///     assert_eq!(n.to_le(), n)
852            /// } else {
853            ///     assert_eq!(n.to_le(), n.swap_bytes())
854            /// }
855            /// ```
856            #[inline]
857            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
858            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
859            #[must_use = "this returns the result of the operation, \
860                          without modifying the original"]
861            pub const fn to_le(self) -> Self {
862                Saturating(self.0.to_le())
863            }
864
865            /// Raises self to the power of `exp`, using exponentiation by squaring.
866            ///
867            /// # Examples
868            ///
869            /// ```
870            /// use std::num::Saturating;
871            ///
872            #[doc = concat!("assert_eq!(Saturating(3", stringify!($t), ").pow(4), Saturating(81));")]
873            /// ```
874            ///
875            /// Results that are too large are saturated:
876            ///
877            /// ```
878            /// use std::num::Saturating;
879            ///
880            /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
881            /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
882            /// ```
883            #[inline]
884            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
885            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
886            #[must_use = "this returns the result of the operation, \
887                          without modifying the original"]
888            pub const fn pow(self, exp: u32) -> Self {
889                Saturating(self.0.saturating_pow(exp))
890            }
891        }
892    )*)
893}
894
895impl Saturating<usize> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<usize>>::MIN, Saturating(usize::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<usize>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<usize>>::MAX, Saturating(usize::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<usize>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<usize>>::BITS, usize::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <usize>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100usize);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0usize).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000usize);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ausize);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<usize>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<usize>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self {
        Saturating(<usize>::from_be(x.0))
    }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ausize);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<usize>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<usize>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self {
        Saturating(<usize>::from_le(x.0))
    }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ausize);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ausize);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3usize).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<u8> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u8>>::MIN, Saturating(u8::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<u8>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u8>>::MAX, Saturating(u8::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<u8>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u8>>::BITS, u8::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <u8>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100u8);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0u8).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000u8);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au8);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<u8>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u8>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<u8>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au8);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<u8>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u8>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<u8>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au8);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au8);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3u8).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<u16> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u16>>::MIN, Saturating(u16::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<u16>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u16>>::MAX, Saturating(u16::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<u16>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u16>>::BITS, u16::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <u16>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100u16);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0u16).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000u16);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au16);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<u16>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u16>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<u16>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au16);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<u16>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u16>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<u16>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au16);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au16);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3u16).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<u32> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u32>>::MIN, Saturating(u32::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<u32>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u32>>::MAX, Saturating(u32::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<u32>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u32>>::BITS, u32::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <u32>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100u32);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0u32).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000u32);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au32);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<u32>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u32>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<u32>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au32);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<u32>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u32>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<u32>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au32);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au32);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3u32).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<u64> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u64>>::MIN, Saturating(u64::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<u64>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u64>>::MAX, Saturating(u64::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<u64>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u64>>::BITS, u64::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <u64>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100u64);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0u64).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000u64);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au64);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<u64>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u64>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<u64>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au64);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<u64>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u64>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<u64>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au64);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au64);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3u64).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<u128> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u128>>::MIN, Saturating(u128::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<u128>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u128>>::MAX, Saturating(u128::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<u128>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<u128>>::BITS, u128::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <u128>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100u128);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0u128).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000u128);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au128);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<u128>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u128>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<u128>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au128);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<u128>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<u128>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<u128>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au128);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Au128);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3u128).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<isize> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<isize>>::MIN, Saturating(isize::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<isize>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<isize>>::MAX, Saturating(isize::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<isize>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<isize>>::BITS, isize::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <isize>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100isize);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0isize).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000isize);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Aisize);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<isize>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<isize>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self {
        Saturating(<isize>::from_be(x.0))
    }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Aisize);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<isize>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<isize>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self {
        Saturating(<isize>::from_le(x.0))
    }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Aisize);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Aisize);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3isize).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<i8> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i8>>::MIN, Saturating(i8::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<i8>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i8>>::MAX, Saturating(i8::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<i8>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i8>>::BITS, i8::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <i8>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100i8);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0i8).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000i8);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai8);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<i8>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i8>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<i8>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai8);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<i8>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i8>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<i8>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai8);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai8);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3i8).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<i16> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i16>>::MIN, Saturating(i16::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<i16>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i16>>::MAX, Saturating(i16::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<i16>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i16>>::BITS, i16::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <i16>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100i16);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0i16).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000i16);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai16);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<i16>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i16>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<i16>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai16);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<i16>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i16>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<i16>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai16);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai16);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3i16).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<i32> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i32>>::MIN, Saturating(i32::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<i32>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i32>>::MAX, Saturating(i32::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<i32>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i32>>::BITS, i32::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <i32>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100i32);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0i32).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000i32);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai32);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<i32>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i32>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<i32>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai32);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<i32>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i32>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<i32>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai32);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai32);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3i32).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<i64> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i64>>::MIN, Saturating(i64::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<i64>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i64>>::MAX, Saturating(i64::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<i64>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i64>>::BITS, i64::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <i64>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100i64);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0i64).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000i64);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai64);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<i64>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i64>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<i64>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai64);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<i64>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i64>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<i64>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai64);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai64);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3i64).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}
impl Saturating<i128> {
    /// Returns the smallest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i128>>::MIN, Saturating(i128::MIN));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MIN: Self = Self(<i128>::MIN);
    /// Returns the largest value that can be represented by this integer type.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i128>>::MAX, Saturating(i128::MAX));"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const MAX: Self = Self(<i128>::MAX);
    /// Returns the size of this integer type in bits.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(<Saturating<i128>>::BITS, i128::BITS);"]
    /// ```
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const BITS: u32 = <i128>::BITS;
    /// Returns the number of ones in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b01001100i128);"]
    ///
    /// assert_eq!(n.count_ones(), 3);
    /// ```
    #[inline]
    #[doc(alias = "popcount")]
    #[doc(alias = "popcnt")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_ones(self) -> u32 { self.0.count_ones() }
    /// Returns the number of zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(!0i128).count_zeros(), 0);"]
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn count_zeros(self) -> u32 { self.0.count_zeros() }
    /// Returns the number of trailing zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0b0101000i128);"]
    ///
    /// assert_eq!(n.trailing_zeros(), 3);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn trailing_zeros(self) -> u32 { self.0.trailing_zeros() }
    /// Shifts the bits to the left by a specified amount, `n`,
    /// saturating the truncated bits to the end of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `<<` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99);
    ///
    /// assert_eq!(n.rotate_left(32), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_left(self, n: u32) -> Self {
        Saturating(self.0.rotate_left(n))
    }
    /// Shifts the bits to the right by a specified amount, `n`,
    /// saturating the truncated bits to the beginning of the resulting
    /// integer.
    ///
    /// Please note this isn't the same operation as the `>>` shifting
    /// operator!
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i64> = Saturating(0x0123456789ABCDEF);
    /// let m: Saturating<i64> = Saturating(-0xFEDCBA987654322);
    ///
    /// assert_eq!(n.rotate_right(4), m);
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn rotate_right(self, n: u32) -> Self {
        Saturating(self.0.rotate_right(n))
    }
    /// Reverses the byte order of the integer.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n: Saturating<i16> = Saturating(0b0000000_01010101);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.swap_bytes();
    ///
    /// assert_eq!(m, Saturating(0b01010101_00000000));
    /// assert_eq!(m, Saturating(21760));
    /// ```
    #[inline]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn swap_bytes(self) -> Self { Saturating(self.0.swap_bytes()) }
    /// Reverses the bit pattern of the integer.
    ///
    /// # Examples
    ///
    /// Please note that this example is shared among integer types, which is why `i16`
    /// is used.
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// let n = Saturating(0b0000000_01010101i16);
    /// assert_eq!(n, Saturating(85));
    ///
    /// let m = n.reverse_bits();
    ///
    /// assert_eq!(m.0 as u16, 0b10101010_00000000);
    /// assert_eq!(m, Saturating(-22016));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn reverse_bits(self) -> Self {
        Saturating(self.0.reverse_bits())
    }
    /// Converts an integer from big endian to the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai128);"]
    ///
    /// if cfg!(target_endian = "big") {
    #[doc = "    assert_eq!(<Saturating<i128>>::from_be(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i128>>::from_be(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_be(x: Self) -> Self { Saturating(<i128>::from_be(x.0)) }
    /// Converts an integer from little endian to the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai128);"]
    ///
    /// if cfg!(target_endian = "little") {
    #[doc = "    assert_eq!(<Saturating<i128>>::from_le(n), n)"]
    /// } else {
    #[doc = "    assert_eq!(<Saturating<i128>>::from_le(n), n.swap_bytes())"]
    /// }
    /// ```
    #[inline]
    #[must_use]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn from_le(x: Self) -> Self { Saturating(<i128>::from_le(x.0)) }
    /// Converts `self` to big endian from the target's endianness.
    ///
    /// On big endian this is a no-op. On little endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai128);"]
    ///
    /// if cfg!(target_endian = "big") {
    ///     assert_eq!(n.to_be(), n)
    /// } else {
    ///     assert_eq!(n.to_be(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_be(self) -> Self { Saturating(self.0.to_be()) }
    /// Converts `self` to little endian from the target's endianness.
    ///
    /// On little endian this is a no-op. On big endian the bytes are
    /// swapped.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(0x1Ai128);"]
    ///
    /// if cfg!(target_endian = "little") {
    ///     assert_eq!(n.to_le(), n)
    /// } else {
    ///     assert_eq!(n.to_le(), n.swap_bytes())
    /// }
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn to_le(self) -> Self { Saturating(self.0.to_le()) }
    /// Raises self to the power of `exp`, using exponentiation by squaring.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(3i128).pow(4), Saturating(81));"]
    /// ```
    ///
    /// Results that are too large are saturated:
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    /// assert_eq!(Saturating(3i8).pow(5), Saturating(127));
    /// assert_eq!(Saturating(3i8).pow(6), Saturating(127));
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn pow(self, exp: u32) -> Self {
        Saturating(self.0.saturating_pow(exp))
    }
}saturating_int_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
896
897macro_rules! saturating_int_impl_signed {
898    ($($t:ty)*) => ($(
899        impl Saturating<$t> {
900            /// Returns the number of leading zeros in the binary representation of `self`.
901            ///
902            /// # Examples
903            ///
904            /// ```
905            /// use std::num::Saturating;
906            ///
907            #[doc = concat!("let n = Saturating(", stringify!($t), "::MAX >> 2);")]
908            ///
909            /// assert_eq!(n.leading_zeros(), 3);
910            /// ```
911            #[inline]
912            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
913            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
914            #[must_use = "this returns the result of the operation, \
915                          without modifying the original"]
916            pub const fn leading_zeros(self) -> u32 {
917                self.0.leading_zeros()
918            }
919
920            /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
921            /// instead of overflowing.
922            ///
923            /// # Examples
924            ///
925            /// ```
926            /// use std::num::Saturating;
927            ///
928            #[doc = concat!("assert_eq!(Saturating(100", stringify!($t), ").abs(), Saturating(100));")]
929            #[doc = concat!("assert_eq!(Saturating(-100", stringify!($t), ").abs(), Saturating(100));")]
930            #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating((", stringify!($t), "::MIN + 1).abs()));")]
931            #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating(", stringify!($t), "::MIN.saturating_abs()));")]
932            #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating(", stringify!($t), "::MAX));")]
933            /// ```
934            #[inline]
935            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
936            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
937            #[must_use = "this returns the result of the operation, \
938                          without modifying the original"]
939            pub const fn abs(self) -> Saturating<$t> {
940                Saturating(self.0.saturating_abs())
941            }
942
943            /// Returns a number representing sign of `self`.
944            ///
945            ///  - `0` if the number is zero
946            ///  - `1` if the number is positive
947            ///  - `-1` if the number is negative
948            ///
949            /// # Examples
950            ///
951            /// ```
952            /// use std::num::Saturating;
953            ///
954            #[doc = concat!("assert_eq!(Saturating(10", stringify!($t), ").signum(), Saturating(1));")]
955            #[doc = concat!("assert_eq!(Saturating(0", stringify!($t), ").signum(), Saturating(0));")]
956            #[doc = concat!("assert_eq!(Saturating(-10", stringify!($t), ").signum(), Saturating(-1));")]
957            /// ```
958            #[inline]
959            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
960            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
961            #[must_use = "this returns the result of the operation, \
962                          without modifying the original"]
963            pub const fn signum(self) -> Saturating<$t> {
964                Saturating(self.0.signum())
965            }
966
967            /// Returns `true` if `self` is positive and `false` if the number is zero or
968            /// negative.
969            ///
970            /// # Examples
971            ///
972            /// ```
973            /// use std::num::Saturating;
974            ///
975            #[doc = concat!("assert!(Saturating(10", stringify!($t), ").is_positive());")]
976            #[doc = concat!("assert!(!Saturating(-10", stringify!($t), ").is_positive());")]
977            /// ```
978            #[must_use]
979            #[inline]
980            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
981            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
982            pub const fn is_positive(self) -> bool {
983                self.0.is_positive()
984            }
985
986            /// Returns `true` if `self` is negative and `false` if the number is zero or
987            /// positive.
988            ///
989            /// # Examples
990            ///
991            /// ```
992            /// use std::num::Saturating;
993            ///
994            #[doc = concat!("assert!(Saturating(-10", stringify!($t), ").is_negative());")]
995            #[doc = concat!("assert!(!Saturating(10", stringify!($t), ").is_negative());")]
996            /// ```
997            #[must_use]
998            #[inline]
999            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
1000            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1001            pub const fn is_negative(self) -> bool {
1002                self.0.is_negative()
1003            }
1004        }
1005
1006        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1007        #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
1008        const impl Neg for Saturating<$t> {
1009            type Output = Self;
1010            #[inline]
1011            fn neg(self) -> Self {
1012                Saturating(self.0.saturating_neg())
1013            }
1014        }
1015        forward_ref_unop! { impl Neg, neg for Saturating<$t>,
1016        #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1017        #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
1018    )*)
1019}
1020
1021impl Saturating<isize> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(isize::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100isize).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100isize).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(isize::MIN).abs(), Saturating((isize::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(isize::MIN).abs(), Saturating(isize::MIN.saturating_abs()));"]
    #[doc =
    "assert_eq!(Saturating(isize::MIN).abs(), Saturating(isize::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<isize> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10isize).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0isize).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10isize).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<isize> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10isize).is_positive());"]
    #[doc = "assert!(!Saturating(-10isize).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10isize).is_negative());"]
    #[doc = "assert!(!Saturating(10isize).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<isize> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<isize> {
    type Output = <Saturating<isize> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<isize> as Neg>::Output { Neg::neg(*self) }
}
impl Saturating<i8> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(i8::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100i8).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100i8).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(i8::MIN).abs(), Saturating((i8::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(i8::MIN).abs(), Saturating(i8::MIN.saturating_abs()));"]
    #[doc = "assert_eq!(Saturating(i8::MIN).abs(), Saturating(i8::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<i8> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10i8).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0i8).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10i8).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<i8> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10i8).is_positive());"]
    #[doc = "assert!(!Saturating(-10i8).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10i8).is_negative());"]
    #[doc = "assert!(!Saturating(10i8).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<i8> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<i8> {
    type Output = <Saturating<i8> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<i8> as Neg>::Output { Neg::neg(*self) }
}
impl Saturating<i16> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(i16::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100i16).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100i16).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(i16::MIN).abs(), Saturating((i16::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(i16::MIN).abs(), Saturating(i16::MIN.saturating_abs()));"]
    #[doc = "assert_eq!(Saturating(i16::MIN).abs(), Saturating(i16::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<i16> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10i16).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0i16).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10i16).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<i16> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10i16).is_positive());"]
    #[doc = "assert!(!Saturating(-10i16).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10i16).is_negative());"]
    #[doc = "assert!(!Saturating(10i16).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<i16> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<i16> {
    type Output = <Saturating<i16> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<i16> as Neg>::Output { Neg::neg(*self) }
}
impl Saturating<i32> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(i32::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100i32).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100i32).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(i32::MIN).abs(), Saturating((i32::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(i32::MIN).abs(), Saturating(i32::MIN.saturating_abs()));"]
    #[doc = "assert_eq!(Saturating(i32::MIN).abs(), Saturating(i32::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<i32> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10i32).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0i32).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10i32).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<i32> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10i32).is_positive());"]
    #[doc = "assert!(!Saturating(-10i32).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10i32).is_negative());"]
    #[doc = "assert!(!Saturating(10i32).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<i32> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<i32> {
    type Output = <Saturating<i32> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<i32> as Neg>::Output { Neg::neg(*self) }
}
impl Saturating<i64> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(i64::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100i64).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100i64).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(i64::MIN).abs(), Saturating((i64::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(i64::MIN).abs(), Saturating(i64::MIN.saturating_abs()));"]
    #[doc = "assert_eq!(Saturating(i64::MIN).abs(), Saturating(i64::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<i64> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10i64).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0i64).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10i64).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<i64> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10i64).is_positive());"]
    #[doc = "assert!(!Saturating(-10i64).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10i64).is_negative());"]
    #[doc = "assert!(!Saturating(10i64).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<i64> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<i64> {
    type Output = <Saturating<i64> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<i64> as Neg>::Output { Neg::neg(*self) }
}
impl Saturating<i128> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(i128::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 3);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN`
    /// instead of overflowing.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(100i128).abs(), Saturating(100));"]
    #[doc = "assert_eq!(Saturating(-100i128).abs(), Saturating(100));"]
    #[doc =
    "assert_eq!(Saturating(i128::MIN).abs(), Saturating((i128::MIN + 1).abs()));"]
    #[doc =
    "assert_eq!(Saturating(i128::MIN).abs(), Saturating(i128::MIN.saturating_abs()));"]
    #[doc = "assert_eq!(Saturating(i128::MIN).abs(), Saturating(i128::MAX));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn abs(self) -> Saturating<i128> {
        Saturating(self.0.saturating_abs())
    }
    /// Returns a number representing sign of `self`.
    ///
    ///  - `0` if the number is zero
    ///  - `1` if the number is positive
    ///  - `-1` if the number is negative
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert_eq!(Saturating(10i128).signum(), Saturating(1));"]
    #[doc = "assert_eq!(Saturating(0i128).signum(), Saturating(0));"]
    #[doc = "assert_eq!(Saturating(-10i128).signum(), Saturating(-1));"]
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn signum(self) -> Saturating<i128> {
        Saturating(self.0.signum())
    }
    /// Returns `true` if `self` is positive and `false` if the number is zero or
    /// negative.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(10i128).is_positive());"]
    #[doc = "assert!(!Saturating(-10i128).is_positive());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_positive(self) -> bool { self.0.is_positive() }
    /// Returns `true` if `self` is negative and `false` if the number is zero or
    /// positive.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(-10i128).is_negative());"]
    #[doc = "assert!(!Saturating(10i128).is_negative());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_negative(self) -> bool { self.0.is_negative() }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for Saturating<i128> {
    type Output = Self;
    #[inline]
    fn neg(self) -> Self { Saturating(self.0.saturating_neg()) }
}
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
const impl Neg for &Saturating<i128> {
    type Output = <Saturating<i128> as Neg>::Output;
    #[inline]
    fn neg(self) -> <Saturating<i128> as Neg>::Output { Neg::neg(*self) }
}saturating_int_impl_signed! { isize i8 i16 i32 i64 i128 }
1022
1023macro_rules! saturating_int_impl_unsigned {
1024    ($($t:ty)*) => ($(
1025        impl Saturating<$t> {
1026            /// Returns the number of leading zeros in the binary representation of `self`.
1027            ///
1028            /// # Examples
1029            ///
1030            /// ```
1031            /// use std::num::Saturating;
1032            ///
1033            #[doc = concat!("let n = Saturating(", stringify!($t), "::MAX >> 2);")]
1034            ///
1035            /// assert_eq!(n.leading_zeros(), 2);
1036            /// ```
1037            #[inline]
1038            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
1039            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1040            #[must_use = "this returns the result of the operation, \
1041                          without modifying the original"]
1042            pub const fn leading_zeros(self) -> u32 {
1043                self.0.leading_zeros()
1044            }
1045
1046            /// Returns `true` if and only if `self == 2^k` for some `k`.
1047            ///
1048            /// # Examples
1049            ///
1050            /// ```
1051            /// use std::num::Saturating;
1052            ///
1053            #[doc = concat!("assert!(Saturating(16", stringify!($t), ").is_power_of_two());")]
1054            #[doc = concat!("assert!(!Saturating(10", stringify!($t), ").is_power_of_two());")]
1055            /// ```
1056            #[must_use]
1057            #[inline]
1058            #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
1059            #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1060            pub const fn is_power_of_two(self) -> bool {
1061                self.0.is_power_of_two()
1062            }
1063
1064        }
1065    )*)
1066}
1067
1068impl Saturating<usize> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(usize::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16usize).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10usize).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}
impl Saturating<u8> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(u8::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16u8).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10u8).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}
impl Saturating<u16> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(u16::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16u16).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10u16).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}
impl Saturating<u32> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(u32::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16u32).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10u32).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}
impl Saturating<u64> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(u64::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16u64).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10u64).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}
impl Saturating<u128> {
    /// Returns the number of leading zeros in the binary representation of `self`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "let n = Saturating(u128::MAX >> 2);"]
    ///
    /// assert_eq!(n.leading_zeros(), 2);
    /// ```
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[must_use =
    "this returns the result of the operation, \
                          without modifying the original"]
    pub const fn leading_zeros(self) -> u32 { self.0.leading_zeros() }
    /// Returns `true` if and only if `self == 2^k` for some `k`.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::num::Saturating;
    ///
    #[doc = "assert!(Saturating(16u128).is_power_of_two());"]
    #[doc = "assert!(!Saturating(10u128).is_power_of_two());"]
    /// ```
    #[must_use]
    #[inline]
    #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
    #[stable(feature = "saturating_int_impl", since = "1.74.0")]
    pub const fn is_power_of_two(self) -> bool { self.0.is_power_of_two() }
}saturating_int_impl_unsigned! { usize u8 u16 u32 u64 u128 }
1069
1070// Related to potential Shl and ShlAssign implementation
1071//
1072// mod shift_max {
1073//     #![allow(non_upper_case_globals)]
1074//
1075//     #[cfg(target_pointer_width = "16")]
1076//     mod platform {
1077//         pub const usize: u32 = super::u16;
1078//         pub const isize: u32 = super::i16;
1079//     }
1080//
1081//     #[cfg(target_pointer_width = "32")]
1082//     mod platform {
1083//         pub const usize: u32 = super::u32;
1084//         pub const isize: u32 = super::i32;
1085//     }
1086//
1087//     #[cfg(target_pointer_width = "64")]
1088//     mod platform {
1089//         pub const usize: u32 = super::u64;
1090//         pub const isize: u32 = super::i64;
1091//     }
1092//
1093//     pub const i8: u32 = (1 << 3) - 1;
1094//     pub const i16: u32 = (1 << 4) - 1;
1095//     pub const i32: u32 = (1 << 5) - 1;
1096//     pub const i64: u32 = (1 << 6) - 1;
1097//     pub const i128: u32 = (1 << 7) - 1;
1098//     pub use self::platform::isize;
1099//
1100//     pub const u8: u32 = i8;
1101//     pub const u16: u32 = i16;
1102//     pub const u32: u32 = i32;
1103//     pub const u64: u32 = i64;
1104//     pub const u128: u32 = i128;
1105//     pub use self::platform::usize;
1106// }