File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1185,8 +1185,12 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
1185
1185
impl Div <NonZero <$Int>> for $Int {
1186
1186
type Output = $Int;
1187
1187
1188
+ /// Same as `self / other.get()`, but because `other` is a `NonZero<_>`,
1189
+ /// there's never a runtime check for division-by-zero.
1190
+ ///
1188
1191
/// This operation rounds towards zero, truncating any fractional
1189
1192
/// part of the exact result, and cannot panic.
1193
+ #[ doc( alias = "unchecked_div" ) ]
1190
1194
#[ inline]
1191
1195
fn div( self , other: NonZero <$Int>) -> $Int {
1192
1196
// SAFETY: Division by zero is checked because `other` is non-zero,
@@ -1197,6 +1201,9 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
1197
1201
1198
1202
#[ stable( feature = "nonzero_div_assign" , since = "1.79.0" ) ]
1199
1203
impl DivAssign <NonZero <$Int>> for $Int {
1204
+ /// Same as `self /= other.get()`, but because `other` is a `NonZero<_>`,
1205
+ /// there's never a runtime check for division-by-zero.
1206
+ ///
1200
1207
/// This operation rounds towards zero, truncating any fractional
1201
1208
/// part of the exact result, and cannot panic.
1202
1209
#[ inline]
You can’t perform that action at this time.
0 commit comments