about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph/implementation/tests.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-07-28 20:07:45 +0200
committerGitHub <noreply@github.com>2024-07-28 20:07:45 +0200
commit0e45047e81603f0b9d666dcc74d4f8915fea31cc (patch)
tree3bb5d5e95e3c7086ed72e7d8a9e1c50f5e351930 /compiler/rustc_data_structures/src/graph/implementation/tests.rs
parent19feb90d69ff05979561f8329a99bc1f1e1f6508 (diff)
parentaded725d6b955e5b24bda4b985996667fe9dc16f (diff)
downloadrust-0e45047e81603f0b9d666dcc74d4f8915fea31cc.tar.gz
rust-0e45047e81603f0b9d666dcc74d4f8915fea31cc.zip
Rollup merge of #128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu
add `is_multiple_of` for unsigned integer types

tracking issue: https://github.com/rust-lang/rust/issues/128101

This adds the `.is_multiple_of` method on unsigned integers.

Returns `true` if `self` is an integer multiple of `rhs`, and false otherwise.

This function is equivalent to `self % rhs == 0`, except that it will not panic for `rhs == 0`. Instead, `0.is_multiple_of(0) == true`, and for any non-zero `n`, `n.is_multiple_of(0) == false`.
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/implementation/tests.rs')
0 files changed, 0 insertions, 0 deletions