1use 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#[stable(feature = "saturating_int_impl", since = "1.74.0")]
35#[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: &Saturating<T>) -> 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: &Saturating<T>)
-> 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: &Saturating<T>) -> 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) -> Saturating<T> {
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() -> Saturating<T> {
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)]
36#[repr(transparent)]
37#[rustc_diagnostic_item = "Saturating"]
38pub struct Saturating<T>(#[stable(feature = "saturating_int_impl", since = "1.74.0")] pub T);
39
40#[stable(feature = "saturating_int_impl", since = "1.74.0")]
41impl<T: fmt::Debug> fmt::Debug for Saturating<T> {
42 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
43 self.0.fmt(f)
44 }
45}
46
47#[stable(feature = "saturating_int_impl", since = "1.74.0")]
48impl<T: fmt::Display> fmt::Display for Saturating<T> {
49 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
50 self.0.fmt(f)
51 }
52}
53
54#[stable(feature = "saturating_int_impl", since = "1.74.0")]
55impl<T: fmt::Binary> fmt::Binary for Saturating<T> {
56 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
57 self.0.fmt(f)
58 }
59}
60
61#[stable(feature = "saturating_int_impl", since = "1.74.0")]
62impl<T: fmt::Octal> fmt::Octal for Saturating<T> {
63 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
64 self.0.fmt(f)
65 }
66}
67
68#[stable(feature = "saturating_int_impl", since = "1.74.0")]
69impl<T: fmt::LowerHex> fmt::LowerHex for Saturating<T> {
70 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71 self.0.fmt(f)
72 }
73}
74
75#[stable(feature = "saturating_int_impl", since = "1.74.0")]
76impl<T: fmt::UpperHex> fmt::UpperHex for Saturating<T> {
77 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
78 self.0.fmt(f)
79 }
80}
81
82macro_rules! saturating_impl {
214 ($($t:ty)*) => ($(
215 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
216 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
217 const impl Add for Saturating<$t> {
218 type Output = Saturating<$t>;
219
220 #[inline]
221 fn add(self, other: Saturating<$t>) -> Saturating<$t> {
222 Saturating(self.0.saturating_add(other.0))
223 }
224 }
225 forward_ref_binop! { impl Add, add for Saturating<$t>, Saturating<$t>,
226 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
227 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
228
229 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
230 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
231 const impl AddAssign for Saturating<$t> {
232 #[inline]
233 fn add_assign(&mut self, other: Saturating<$t>) {
234 *self = *self + other;
235 }
236 }
237 forward_ref_op_assign! { impl AddAssign, add_assign for Saturating<$t>, Saturating<$t>,
238 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
239 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
240
241 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
242 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
243 const impl AddAssign<$t> for Saturating<$t> {
244 #[inline]
245 fn add_assign(&mut self, other: $t) {
246 *self = *self + Saturating(other);
247 }
248 }
249 forward_ref_op_assign! { impl AddAssign, add_assign for Saturating<$t>, $t,
250 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
251 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
252
253 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
254 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
255 const impl Sub for Saturating<$t> {
256 type Output = Saturating<$t>;
257
258 #[inline]
259 fn sub(self, other: Saturating<$t>) -> Saturating<$t> {
260 Saturating(self.0.saturating_sub(other.0))
261 }
262 }
263 forward_ref_binop! { impl Sub, sub for Saturating<$t>, Saturating<$t>,
264 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
265 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
266
267 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
268 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
269 const impl SubAssign for Saturating<$t> {
270 #[inline]
271 fn sub_assign(&mut self, other: Saturating<$t>) {
272 *self = *self - other;
273 }
274 }
275 forward_ref_op_assign! { impl SubAssign, sub_assign for Saturating<$t>, Saturating<$t>,
276 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
277 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
278
279 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
280 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
281 const impl SubAssign<$t> for Saturating<$t> {
282 #[inline]
283 fn sub_assign(&mut self, other: $t) {
284 *self = *self - Saturating(other);
285 }
286 }
287 forward_ref_op_assign! { impl SubAssign, sub_assign for Saturating<$t>, $t,
288 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
289 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
290
291 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
292 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
293 const impl Mul for Saturating<$t> {
294 type Output = Saturating<$t>;
295
296 #[inline]
297 fn mul(self, other: Saturating<$t>) -> Saturating<$t> {
298 Saturating(self.0.saturating_mul(other.0))
299 }
300 }
301 forward_ref_binop! { impl Mul, mul for Saturating<$t>, Saturating<$t>,
302 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
303 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
304
305 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
306 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
307 const impl MulAssign for Saturating<$t> {
308 #[inline]
309 fn mul_assign(&mut self, other: Saturating<$t>) {
310 *self = *self * other;
311 }
312 }
313 forward_ref_op_assign! { impl MulAssign, mul_assign for Saturating<$t>, Saturating<$t>,
314 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
315 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
316
317 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
318 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
319 const impl MulAssign<$t> for Saturating<$t> {
320 #[inline]
321 fn mul_assign(&mut self, other: $t) {
322 *self = *self * Saturating(other);
323 }
324 }
325 forward_ref_op_assign! { impl MulAssign, mul_assign for Saturating<$t>, $t,
326 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
327 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
328
329 #[doc = concat!("assert_eq!(Saturating(2", stringify!($t), "), Saturating(5", stringify!($t), ") / Saturating(2));")]
335 #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MAX), Saturating(", stringify!($t), "::MAX) / Saturating(1));")]
336 #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN), Saturating(", stringify!($t), "::MIN) / Saturating(1));")]
337 #[doc = concat!("let _ = Saturating(0", stringify!($t), ") / Saturating(0);")]
343 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
345 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
346 const impl Div for Saturating<$t> {
347 type Output = Saturating<$t>;
348
349 #[inline]
350 fn div(self, other: Saturating<$t>) -> Saturating<$t> {
351 Saturating(self.0.saturating_div(other.0))
352 }
353 }
354 forward_ref_binop! { impl Div, div for Saturating<$t>, Saturating<$t>,
355 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
356 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
357
358 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
359 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
360 const impl DivAssign for Saturating<$t> {
361 #[inline]
362 fn div_assign(&mut self, other: Saturating<$t>) {
363 *self = *self / other;
364 }
365 }
366 forward_ref_op_assign! { impl DivAssign, div_assign for Saturating<$t>, Saturating<$t>,
367 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
368 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
369
370 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
371 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
372 const impl DivAssign<$t> for Saturating<$t> {
373 #[inline]
374 fn div_assign(&mut self, other: $t) {
375 *self = *self / Saturating(other);
376 }
377 }
378 forward_ref_op_assign! { impl DivAssign, div_assign for Saturating<$t>, $t,
379 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
380 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
381
382 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
383 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
384 const impl Rem for Saturating<$t> {
385 type Output = Saturating<$t>;
386
387 #[inline]
388 fn rem(self, other: Saturating<$t>) -> Saturating<$t> {
389 Saturating(self.0.rem(other.0))
390 }
391 }
392 forward_ref_binop! { impl Rem, rem for Saturating<$t>, Saturating<$t>,
393 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
394 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
395
396 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
397 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
398 const impl RemAssign for Saturating<$t> {
399 #[inline]
400 fn rem_assign(&mut self, other: Saturating<$t>) {
401 *self = *self % other;
402 }
403 }
404 forward_ref_op_assign! { impl RemAssign, rem_assign for Saturating<$t>, Saturating<$t>,
405 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
406 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
407
408 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
409 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
410 const impl RemAssign<$t> for Saturating<$t> {
411 #[inline]
412 fn rem_assign(&mut self, other: $t) {
413 *self = *self % Saturating(other);
414 }
415 }
416 forward_ref_op_assign! { impl RemAssign, rem_assign for Saturating<$t>, $t,
417 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
418 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
419
420 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
421 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
422 const impl Not for Saturating<$t> {
423 type Output = Saturating<$t>;
424
425 #[inline]
426 fn not(self) -> Saturating<$t> {
427 Saturating(!self.0)
428 }
429 }
430 forward_ref_unop! { impl Not, not for Saturating<$t>,
431 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
432 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
433
434 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
435 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
436 const impl BitXor for Saturating<$t> {
437 type Output = Saturating<$t>;
438
439 #[inline]
440 fn bitxor(self, other: Saturating<$t>) -> Saturating<$t> {
441 Saturating(self.0 ^ other.0)
442 }
443 }
444 forward_ref_binop! { impl BitXor, bitxor for Saturating<$t>, Saturating<$t>,
445 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
446 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
447
448 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
449 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
450 const impl BitXorAssign for Saturating<$t> {
451 #[inline]
452 fn bitxor_assign(&mut self, other: Saturating<$t>) {
453 *self = *self ^ other;
454 }
455 }
456 forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for Saturating<$t>, Saturating<$t>,
457 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
458 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
459
460 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
461 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
462 const impl BitXorAssign<$t> for Saturating<$t> {
463 #[inline]
464 fn bitxor_assign(&mut self, other: $t) {
465 *self = *self ^ Saturating(other);
466 }
467 }
468 forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for Saturating<$t>, $t,
469 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
470 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
471
472 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
473 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
474 const impl BitOr for Saturating<$t> {
475 type Output = Saturating<$t>;
476
477 #[inline]
478 fn bitor(self, other: Saturating<$t>) -> Saturating<$t> {
479 Saturating(self.0 | other.0)
480 }
481 }
482 forward_ref_binop! { impl BitOr, bitor for Saturating<$t>, Saturating<$t>,
483 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
484 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
485
486 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
487 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
488 const impl BitOrAssign for Saturating<$t> {
489 #[inline]
490 fn bitor_assign(&mut self, other: Saturating<$t>) {
491 *self = *self | other;
492 }
493 }
494 forward_ref_op_assign! { impl BitOrAssign, bitor_assign for Saturating<$t>, Saturating<$t>,
495 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
496 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
497
498 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
499 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
500 const impl BitOrAssign<$t> for Saturating<$t> {
501 #[inline]
502 fn bitor_assign(&mut self, other: $t) {
503 *self = *self | Saturating(other);
504 }
505 }
506 forward_ref_op_assign! { impl BitOrAssign, bitor_assign for Saturating<$t>, $t,
507 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
508 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
509
510 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
511 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
512 const impl BitAnd for Saturating<$t> {
513 type Output = Saturating<$t>;
514
515 #[inline]
516 fn bitand(self, other: Saturating<$t>) -> Saturating<$t> {
517 Saturating(self.0 & other.0)
518 }
519 }
520 forward_ref_binop! { impl BitAnd, bitand for Saturating<$t>, Saturating<$t>,
521 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
522 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
523
524 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
525 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
526 const impl BitAndAssign for Saturating<$t> {
527 #[inline]
528 fn bitand_assign(&mut self, other: Saturating<$t>) {
529 *self = *self & other;
530 }
531 }
532 forward_ref_op_assign! { impl BitAndAssign, bitand_assign for Saturating<$t>, Saturating<$t>,
533 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
534 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
535
536 #[stable(feature = "saturating_int_assign_impl", since = "1.74.0")]
537 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
538 const impl BitAndAssign<$t> for Saturating<$t> {
539 #[inline]
540 fn bitand_assign(&mut self, other: $t) {
541 *self = *self & Saturating(other);
542 }
543 }
544 forward_ref_op_assign! { impl BitAndAssign, bitand_assign for Saturating<$t>, $t,
545 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
546 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
547
548 )*)
549}
550
551#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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);
}
}
#[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));"]
#[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 }
552
553macro_rules! saturating_int_impl {
554 ($($t:ty)*) => ($(
555 impl Saturating<$t> {
556 #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::MIN, Saturating(", stringify!($t), "::MIN));")]
564 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
566 pub const MIN: Self = Self(<$t>::MIN);
567
568 #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::MAX, Saturating(", stringify!($t), "::MAX));")]
576 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
578 pub const MAX: Self = Self(<$t>::MAX);
579
580 #[doc = concat!("assert_eq!(<Saturating<", stringify!($t), ">>::BITS, ", stringify!($t), "::BITS);")]
588 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
590 pub const BITS: u32 = <$t>::BITS;
591
592 #[doc = concat!("let n = Saturating(0b01001100", stringify!($t), ");")]
600 #[inline]
604 #[doc(alias = "popcount")]
605 #[doc(alias = "popcnt")]
606 #[must_use = "this returns the result of the operation, \
607 without modifying the original"]
608 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
609 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
610 pub const fn count_ones(self) -> u32 {
611 self.0.count_ones()
612 }
613
614 #[doc = concat!("assert_eq!(Saturating(!0", stringify!($t), ").count_zeros(), 0);")]
622 #[inline]
624 #[must_use = "this returns the result of the operation, \
625 without modifying the original"]
626 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
627 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
628 pub const fn count_zeros(self) -> u32 {
629 self.0.count_zeros()
630 }
631
632 #[doc = concat!("let n = Saturating(0b0101000", stringify!($t), ");")]
640 #[inline]
644 #[must_use = "this returns the result of the operation, \
645 without modifying the original"]
646 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
647 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
648 pub const fn trailing_zeros(self) -> u32 {
649 self.0.trailing_zeros()
650 }
651
652 #[inline]
670 #[must_use = "this returns the result of the operation, \
671 without modifying the original"]
672 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
673 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
674 pub const fn rotate_left(self, n: u32) -> Self {
675 Saturating(self.0.rotate_left(n))
676 }
677
678 #[inline]
696 #[must_use = "this returns the result of the operation, \
697 without modifying the original"]
698 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
699 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
700 pub const fn rotate_right(self, n: u32) -> Self {
701 Saturating(self.0.rotate_right(n))
702 }
703
704 #[inline]
720 #[must_use = "this returns the result of the operation, \
721 without modifying the original"]
722 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
723 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
724 pub const fn swap_bytes(self) -> Self {
725 Saturating(self.0.swap_bytes())
726 }
727
728 #[inline]
747 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
748 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
749 #[must_use = "this returns the result of the operation, \
750 without modifying the original"]
751 pub const fn reverse_bits(self) -> Self {
752 Saturating(self.0.reverse_bits())
753 }
754
755 #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
766 #[doc = concat!(" assert_eq!(<Saturating<", stringify!($t), ">>::from_be(n), n)")]
769 #[doc = concat!(" assert_eq!(<Saturating<", stringify!($t), ">>::from_be(n), n.swap_bytes())")]
771 #[inline]
774 #[must_use]
775 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
776 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
777 pub const fn from_be(x: Self) -> Self {
778 Saturating(<$t>::from_be(x.0))
779 }
780
781 #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
792 #[doc = concat!(" assert_eq!(<Saturating<", stringify!($t), ">>::from_le(n), n)")]
795 #[doc = concat!(" assert_eq!(<Saturating<", stringify!($t), ">>::from_le(n), n.swap_bytes())")]
797 #[inline]
800 #[must_use]
801 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
802 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
803 pub const fn from_le(x: Self) -> Self {
804 Saturating(<$t>::from_le(x.0))
805 }
806
807 #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
818 #[inline]
826 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
827 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
828 #[must_use = "this returns the result of the operation, \
829 without modifying the original"]
830 pub const fn to_be(self) -> Self {
831 Saturating(self.0.to_be())
832 }
833
834 #[doc = concat!("let n = Saturating(0x1A", stringify!($t), ");")]
845 #[inline]
853 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
854 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
855 #[must_use = "this returns the result of the operation, \
856 without modifying the original"]
857 pub const fn to_le(self) -> Self {
858 Saturating(self.0.to_le())
859 }
860
861 #[doc = concat!("assert_eq!(Saturating(3", stringify!($t), ").pow(4), Saturating(81));")]
869 #[inline]
880 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
881 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
882 #[must_use = "this returns the result of the operation, \
883 without modifying the original"]
884 pub const fn pow(self, exp: u32) -> Self {
885 Saturating(self.0.saturating_pow(exp))
886 }
887 }
888 )*)
889}
890
891impl Saturating<usize> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<usize>>::BITS, usize::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <usize>::BITS;
#[doc = "let n = Saturating(0b01001100usize);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000usize);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ausize);"]
#[doc = " assert_eq!(<Saturating<usize>>::from_be(n), n)"]
#[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))
}
#[doc = "let n = Saturating(0x1Ausize);"]
#[doc = " assert_eq!(<Saturating<usize>>::from_le(n), n)"]
#[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))
}
#[doc = "let n = Saturating(0x1Ausize);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ausize);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3usize).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<u8>>::BITS, u8::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <u8>::BITS;
#[doc = "let n = Saturating(0b01001100u8);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000u8);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Au8);"]
#[doc = " assert_eq!(<Saturating<u8>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au8);"]
#[doc = " assert_eq!(<Saturating<u8>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au8);"]
#[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()) }
#[doc = "let n = Saturating(0x1Au8);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3u8).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<u16>>::BITS, u16::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <u16>::BITS;
#[doc = "let n = Saturating(0b01001100u16);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000u16);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Au16);"]
#[doc = " assert_eq!(<Saturating<u16>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au16);"]
#[doc = " assert_eq!(<Saturating<u16>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au16);"]
#[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()) }
#[doc = "let n = Saturating(0x1Au16);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3u16).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<u32>>::BITS, u32::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <u32>::BITS;
#[doc = "let n = Saturating(0b01001100u32);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000u32);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Au32);"]
#[doc = " assert_eq!(<Saturating<u32>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au32);"]
#[doc = " assert_eq!(<Saturating<u32>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au32);"]
#[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()) }
#[doc = "let n = Saturating(0x1Au32);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3u32).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<u64>>::BITS, u64::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <u64>::BITS;
#[doc = "let n = Saturating(0b01001100u64);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000u64);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Au64);"]
#[doc = " assert_eq!(<Saturating<u64>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au64);"]
#[doc = " assert_eq!(<Saturating<u64>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au64);"]
#[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()) }
#[doc = "let n = Saturating(0x1Au64);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3u64).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<u128>>::BITS, u128::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <u128>::BITS;
#[doc = "let n = Saturating(0b01001100u128);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000u128);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Au128);"]
#[doc = " assert_eq!(<Saturating<u128>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au128);"]
#[doc = " assert_eq!(<Saturating<u128>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Au128);"]
#[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()) }
#[doc = "let n = Saturating(0x1Au128);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3u128).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<isize>>::BITS, isize::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <isize>::BITS;
#[doc = "let n = Saturating(0b01001100isize);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000isize);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Aisize);"]
#[doc = " assert_eq!(<Saturating<isize>>::from_be(n), n)"]
#[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))
}
#[doc = "let n = Saturating(0x1Aisize);"]
#[doc = " assert_eq!(<Saturating<isize>>::from_le(n), n)"]
#[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))
}
#[doc = "let n = Saturating(0x1Aisize);"]
#[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()) }
#[doc = "let n = Saturating(0x1Aisize);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3isize).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<i8>>::BITS, i8::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <i8>::BITS;
#[doc = "let n = Saturating(0b01001100i8);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000i8);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ai8);"]
#[doc = " assert_eq!(<Saturating<i8>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai8);"]
#[doc = " assert_eq!(<Saturating<i8>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai8);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ai8);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3i8).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<i16>>::BITS, i16::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <i16>::BITS;
#[doc = "let n = Saturating(0b01001100i16);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000i16);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ai16);"]
#[doc = " assert_eq!(<Saturating<i16>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai16);"]
#[doc = " assert_eq!(<Saturating<i16>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai16);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ai16);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3i16).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<i32>>::BITS, i32::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <i32>::BITS;
#[doc = "let n = Saturating(0b01001100i32);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000i32);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ai32);"]
#[doc = " assert_eq!(<Saturating<i32>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai32);"]
#[doc = " assert_eq!(<Saturating<i32>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai32);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ai32);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3i32).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<i64>>::BITS, i64::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <i64>::BITS;
#[doc = "let n = Saturating(0b01001100i64);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000i64);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ai64);"]
#[doc = " assert_eq!(<Saturating<i64>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai64);"]
#[doc = " assert_eq!(<Saturating<i64>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai64);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ai64);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3i64).pow(4), Saturating(81));"]
#[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> {
#[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);
#[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);
#[doc = "assert_eq!(<Saturating<i128>>::BITS, i128::BITS);"]
#[stable(feature = "saturating_int_impl", since = "1.74.0")]
pub const BITS: u32 = <i128>::BITS;
#[doc = "let n = Saturating(0b01001100i128);"]
#[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() }
#[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() }
#[doc = "let n = Saturating(0b0101000i128);"]
#[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() }
#[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))
}
#[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))
}
#[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()) }
#[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())
}
#[doc = "let n = Saturating(0x1Ai128);"]
#[doc = " assert_eq!(<Saturating<i128>>::from_be(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai128);"]
#[doc = " assert_eq!(<Saturating<i128>>::from_le(n), n)"]
#[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)) }
#[doc = "let n = Saturating(0x1Ai128);"]
#[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()) }
#[doc = "let n = Saturating(0x1Ai128);"]
#[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()) }
#[doc = "assert_eq!(Saturating(3i128).pow(4), Saturating(81));"]
#[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 }
892
893macro_rules! saturating_int_impl_signed {
894 ($($t:ty)*) => ($(
895 impl Saturating<$t> {
896 #[doc = concat!("let n = Saturating(", stringify!($t), "::MAX >> 2);")]
904 #[inline]
908 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
909 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
910 #[must_use = "this returns the result of the operation, \
911 without modifying the original"]
912 pub const fn leading_zeros(self) -> u32 {
913 self.0.leading_zeros()
914 }
915
916 #[doc = concat!("assert_eq!(Saturating(100", stringify!($t), ").abs(), Saturating(100));")]
925 #[doc = concat!("assert_eq!(Saturating(-100", stringify!($t), ").abs(), Saturating(100));")]
926 #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating((", stringify!($t), "::MIN + 1).abs()));")]
927 #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating(", stringify!($t), "::MIN.saturating_abs()));")]
928 #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN).abs(), Saturating(", stringify!($t), "::MAX));")]
929 #[inline]
931 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
932 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
933 #[must_use = "this returns the result of the operation, \
934 without modifying the original"]
935 pub const fn abs(self) -> Saturating<$t> {
936 Saturating(self.0.saturating_abs())
937 }
938
939 #[doc = concat!("assert_eq!(Saturating(10", stringify!($t), ").signum(), Saturating(1));")]
951 #[doc = concat!("assert_eq!(Saturating(0", stringify!($t), ").signum(), Saturating(0));")]
952 #[doc = concat!("assert_eq!(Saturating(-10", stringify!($t), ").signum(), Saturating(-1));")]
953 #[inline]
955 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
956 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
957 #[must_use = "this returns the result of the operation, \
958 without modifying the original"]
959 pub const fn signum(self) -> Saturating<$t> {
960 Saturating(self.0.signum())
961 }
962
963 #[doc = concat!("assert!(Saturating(10", stringify!($t), ").is_positive());")]
972 #[doc = concat!("assert!(!Saturating(-10", stringify!($t), ").is_positive());")]
973 #[must_use]
975 #[inline]
976 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
977 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
978 pub const fn is_positive(self) -> bool {
979 self.0.is_positive()
980 }
981
982 #[doc = concat!("assert!(Saturating(-10", stringify!($t), ").is_negative());")]
991 #[doc = concat!("assert!(!Saturating(10", stringify!($t), ").is_negative());")]
992 #[must_use]
994 #[inline]
995 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
996 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
997 pub const fn is_negative(self) -> bool {
998 self.0.is_negative()
999 }
1000 }
1001
1002 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1003 #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
1004 const impl Neg for Saturating<$t> {
1005 type Output = Self;
1006 #[inline]
1007 fn neg(self) -> Self {
1008 Saturating(self.0.saturating_neg())
1009 }
1010 }
1011 forward_ref_unop! { impl Neg, neg for Saturating<$t>,
1012 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1013 #[rustc_const_unstable(feature = "const_ops", issue = "143802")] }
1014 )*)
1015}
1016
1017impl Saturating<isize> {
#[doc = "let n = Saturating(isize::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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> {
#[doc = "let n = Saturating(i8::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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> {
#[doc = "let n = Saturating(i16::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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> {
#[doc = "let n = Saturating(i32::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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> {
#[doc = "let n = Saturating(i64::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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> {
#[doc = "let n = Saturating(i128::MAX >> 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() }
#[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())
}
#[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())
}
#[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() }
#[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 }
1018
1019macro_rules! saturating_int_impl_unsigned {
1020 ($($t:ty)*) => ($(
1021 impl Saturating<$t> {
1022 #[doc = concat!("let n = Saturating(", stringify!($t), "::MAX >> 2);")]
1030 #[inline]
1034 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
1035 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1036 #[must_use = "this returns the result of the operation, \
1037 without modifying the original"]
1038 pub const fn leading_zeros(self) -> u32 {
1039 self.0.leading_zeros()
1040 }
1041
1042 #[doc = concat!("assert!(Saturating(16", stringify!($t), ").is_power_of_two());")]
1050 #[doc = concat!("assert!(!Saturating(10", stringify!($t), ").is_power_of_two());")]
1051 #[must_use]
1053 #[inline]
1054 #[rustc_const_stable(feature = "saturating_int_impl", since = "1.74.0")]
1055 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
1056 pub const fn is_power_of_two(self) -> bool {
1057 self.0.is_power_of_two()
1058 }
1059
1060 }
1061 )*)
1062}
1063
1064impl Saturating<usize> {
#[doc = "let n = Saturating(usize::MAX >> 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() }
#[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> {
#[doc = "let n = Saturating(u8::MAX >> 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() }
#[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> {
#[doc = "let n = Saturating(u16::MAX >> 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() }
#[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> {
#[doc = "let n = Saturating(u32::MAX >> 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() }
#[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> {
#[doc = "let n = Saturating(u64::MAX >> 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() }
#[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> {
#[doc = "let n = Saturating(u128::MAX >> 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() }
#[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 }
1065
1066