about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-08-09 11:53:30 -0700
committerJosh Triplett <josh@joshtriplett.org>2025-08-09 15:01:58 -0700
commitc503487a6f1402ed37051e435af0c410a3815b14 (patch)
tree80b8f61fc8494ecda3e66294830c06bfbb9533e5
parentca77504943887037504c7fc0b9bf06dab3910373 (diff)
downloadrust-c503487a6f1402ed37051e435af0c410a3815b14.tar.gz
rust-c503487a6f1402ed37051e435af0c410a3815b14.zip
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".
-rw-r--r--library/std/src/sys_common/mod.rs13
-rw-r--r--src/tools/miri/src/shims/time.rs4
-rw-r--r--typos.toml1
3 files changed, 8 insertions, 10 deletions
diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs
index cce88d936b7..24b6cff1309 100644
--- a/library/std/src/sys_common/mod.rs
+++ b/library/std/src/sys_common/mod.rs
@@ -51,17 +51,16 @@ pub trait FromInner<Inner> {
     fn from_inner(inner: Inner) -> Self;
 }
 
-// Computes (value*numer)/denom without overflow, as long as both
-// (numer*denom) and the overall result fit into i64 (which is the case
-// for our time conversions).
+// Computes (value*numerator)/denom without overflow, as long as both (numerator*denom) and the
+// overall result fit into i64 (which is the case for our time conversions).
 #[allow(dead_code)] // not used on all platforms
-pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 {
+pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
     let q = value / denom;
     let r = value % denom;
     // Decompose value as (value/denom*denom + value%denom),
-    // substitute into (value*numer)/denom and simplify.
-    // r < denom, so (denom*numer) is the upper bound of (r*numer)
-    q * numer + r * numer / denom
+    // substitute into (value*numerator)/denom and simplify.
+    // r < denom, so (denom*numerator) is the upper bound of (r*numerator)
+    q * numerator + r * numerator / denom
 }
 
 pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {
diff --git a/src/tools/miri/src/shims/time.rs b/src/tools/miri/src/shims/time.rs
index b5b35797fec..6e56fdfe35a 100644
--- a/src/tools/miri/src/shims/time.rs
+++ b/src/tools/miri/src/shims/time.rs
@@ -322,8 +322,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
 
         // Since our emulated ticks in `mach_absolute_time` *are* nanoseconds,
         // no scaling needs to happen.
-        let (numer, denom) = (1, 1);
-        this.write_int_fields(&[numer.into(), denom.into()], &info)?;
+        let (numerator, denom) = (1, 1);
+        this.write_int_fields(&[numerator.into(), denom.into()], &info)?;
 
         interp_ok(Scalar::from_i32(0)) // KERN_SUCCESS
     }
diff --git a/typos.toml b/typos.toml
index 4035f206a46..317aafc8615 100644
--- a/typos.toml
+++ b/typos.toml
@@ -52,7 +52,6 @@ ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC"
 ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED"
 ERRNO_ACCES = "ERRNO_ACCES"
 tolen = "tolen"
-numer = "numer"
 
 [default]
 extend-ignore-words-re = [