rust/library/core/tests
Guillaume Gomez 0e45047e81
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`.
2024-07-28 20:07:45 +02:00
..
async_iter Remove unnecessary lets and borrowing from Waker::noop() usage. 2024-01-17 12:00:27 -08:00
ffi CStr: derive PartialEq, Eq; add test for Ord 2024-07-25 14:18:40 +03:00
fmt Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
hash rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
io Make io::BorrowedCursor::advance safe 2024-02-07 16:46:28 +01:00
iter regression test for leaks in the the Filter::next_chunk implementation 2024-06-25 23:22:27 +02:00
net Add blank lines after module-level // comments. 2024-06-20 09:23:20 +10:00
num add is_multiple_of for unsigned integer types 2024-07-23 18:02:13 +02:00
ops
panic Fix test (location_const_file) 2022-10-08 11:48:53 +00:00
alloc.rs rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
any.rs Adjust library tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
array.rs Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
ascii.rs optimize Cstr/EscapeAscii display 2023-06-29 01:55:03 +02:00
asserting.rs Spelling library/ 2023-04-26 02:10:22 -04:00
atomic.rs Adjust library tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
bool.rs fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
cell.rs apply fmt 2024-01-11 15:04:48 +03:00
char.rs remove redundant imports 2023-12-10 10:56:22 +08:00
clone.rs Add core::clone::CloneToUninit. 2024-06-22 08:08:00 -07:00
cmp.rs fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
const_ptr.rs cleanup code w/ pointers in std a little 2022-08-05 16:47:49 +04:00
convert.rs fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
error.rs apply fmt 2024-01-11 15:04:48 +03:00
ffi.rs CStr: derive PartialEq, Eq; add test for Ord 2024-07-25 14:18:40 +03:00
future.rs Avoid ref when using format! for perf 2024-07-19 12:23:49 -04:00
intrinsics.rs Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
lazy.rs Rollup merge of #110419 - jsoref:spelling-library, r=jyn514 2023-04-26 18:51:41 +02:00
lib.rs Rollup merge of #128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu 2024-07-28 20:07:45 +02:00
macros.rs Update tests 2024-02-07 10:42:01 +08:00
manually_drop.rs Flip cfg's for bootstrap bump 2023-07-12 21:38:55 -04:00
mem.rs [ACP 362] genericize ptr::from_raw_parts 2024-05-29 09:34:16 -07:00
nonzero.rs Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
ops.rs
option.rs Make Option::as_[mut_]slice const 2024-06-19 21:44:47 +01:00
panic.rs Add newlines 2022-09-27 19:23:52 +00:00
pattern.rs
pin_macro.rs Add blank lines after module-level // comments. 2024-06-20 09:23:20 +10:00
pin.rs
ptr.rs Fix doc nits 2024-07-26 13:26:33 +01:00
result.rs Allow for_loops_over_fallibles in test that tests &mut Result as IntoIterator. 2024-05-15 13:51:16 -05:00
simd.rs Fix library tests 2023-11-26 08:50:39 -05:00
slice.rs Auto merge of #124032 - Voultapher:a-new-sort, r=thomcc 2024-06-20 20:40:43 +00:00
str_lossy.rs Stabilize Utf8Chunks 2024-04-24 15:27:47 -07:00
str.rs Update paths in comments. 2022-12-30 14:00:42 +01:00
task.rs Remove test of static Context 2023-01-02 10:33:23 -08:00
time.rs core: add Duration constructors 2024-01-24 14:24:57 +01:00
tuple.rs
unicode.rs revert changes to unicode stability 2022-07-08 21:18:15 +00:00
waker.rs rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00