Skip to content

Commit c1f9e2a

Browse files
Rollup merge of #145179 - joshtriplett:number, r=RalfJung
Avoid abbreviating "numerator" as "numer", to allow catching typo "numer" elsewhere `typos.toml` has an exception for "numer", to avoid flagging its use as an abbreviation for "numerator". Remove the use of that abbrevation, spelling out "numerator" instead, and remove the exception, so that typo checks can find future instances of "numer" as a typo for "number".
2 parents 7d91d20 + c503487 commit c1f9e2a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

library/std/src/sys_common/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ pub trait FromInner<Inner> {
5151
fn from_inner(inner: Inner) -> Self;
5252
}
5353

54-
// Computes (value*numer)/denom without overflow, as long as both
55-
// (numer*denom) and the overall result fit into i64 (which is the case
56-
// for our time conversions).
54+
// Computes (value*numerator)/denom without overflow, as long as both (numerator*denom) and the
55+
// overall result fit into i64 (which is the case for our time conversions).
5756
#[allow(dead_code)] // not used on all platforms
58-
pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 {
57+
pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
5958
let q = value / denom;
6059
let r = value % denom;
6160
// Decompose value as (value/denom*denom + value%denom),
62-
// substitute into (value*numer)/denom and simplify.
63-
// r < denom, so (denom*numer) is the upper bound of (r*numer)
64-
q * numer + r * numer / denom
61+
// substitute into (value*numerator)/denom and simplify.
62+
// r < denom, so (denom*numerator) is the upper bound of (r*numerator)
63+
q * numerator + r * numerator / denom
6564
}
6665

6766
pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {

src/tools/miri/src/shims/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
322322

323323
// Since our emulated ticks in `mach_absolute_time` *are* nanoseconds,
324324
// no scaling needs to happen.
325-
let (numer, denom) = (1, 1);
326-
this.write_int_fields(&[numer.into(), denom.into()], &info)?;
325+
let (numerator, denom) = (1, 1);
326+
this.write_int_fields(&[numerator.into(), denom.into()], &info)?;
327327

328328
interp_ok(Scalar::from_i32(0)) // KERN_SUCCESS
329329
}

typos.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC"
5252
ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED"
5353
ERRNO_ACCES = "ERRNO_ACCES"
5454
tolen = "tolen"
55-
numer = "numer"
5655

5756
[default]
5857
extend-ignore-words-re = [

0 commit comments

Comments
 (0)