diff options
| author | Petr Portnov <me@progrm-jarvis.ru> | 2024-03-17 17:06:12 +0300 |
|---|---|---|
| committer | Petr Portnov <me@progrm-jarvis.ru> | 2024-03-17 17:06:12 +0300 |
| commit | e7d397024f6eebdd36bfa31ea8cf56496d348f7f (patch) | |
| tree | fdf0ba885d475ca3a2a69bc2bf9cedc79f037985 | |
| parent | 5ebed0ba4b057ade343a9390c39490c599c41d86 (diff) | |
| download | rust-e7d397024f6eebdd36bfa31ea8cf56496d348f7f.tar.gz rust-e7d397024f6eebdd36bfa31ea8cf56496d348f7f.zip | |
chore(121952): echo comments on the `*_assign` methods
| -rw-r--r-- | library/core/src/num/nonzero.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index d025cea6cb9..a8f637280df 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -851,6 +851,8 @@ macro_rules! nonzero_integer_signedness_dependent_impls { #[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")] impl DivAssign<$Ty> for $Int { + /// This operation rounds towards zero, + /// truncating any fractional part of the exact result, and cannot panic. #[inline] fn div_assign(&mut self, other: $Ty) { *self = *self / other; @@ -872,6 +874,7 @@ macro_rules! nonzero_integer_signedness_dependent_impls { #[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")] impl RemAssign<$Ty> for $Int { + /// This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #[inline] fn rem_assign(&mut self, other: $Ty) { *self = *self % other; |
