rust/library
Dylan DPC 83faac9da4
Rollup merge of #82683 - jturner314:int-div-rem-doc-panic, r=nikomatsakis
Document panicking cases for integer division and remainder

This PR documents the cases when integer division and remainder operations panic. These operations panic in two cases: division by zero and overflow.

It's surprising that these operations always panic on overflow, unlike most other arithmetic operations, which panic on overflow only when `debug_assertions` is enabled. The panic on overflow for the remainder is also surprising because a return value of `0` would be reasonable in this case. ("Overflow" occurs only for `MIN % -1`.) Since the panics on overflow are somewhat surprising, they should be documented.

I guess it's worth asking: is panic on overflow (even when `debug_assertions` is disabled) the intended behavior? If not, what's the best way forward?
2021-03-22 15:21:24 +01:00
..
alloc Rollup merge of #82374 - clehner:licenses, r=joshtriplett 2021-03-22 15:21:23 +01:00
backtrace@af078ecc0b
core Rollup merge of #82683 - jturner314:int-div-rem-doc-panic, r=nikomatsakis 2021-03-22 15:21:24 +01:00
panic_abort Add license metadata for std dependencies 2021-02-21 13:36:18 -05:00
panic_unwind Add license metadata for std dependencies 2021-02-21 13:36:18 -05:00
proc_macro impl PartialEq<Punct> for char; symmetry for #78636 2021-02-19 17:28:19 -08:00
profiler_builtins Build newly added InstrProfilingVersionVar.c file 2021-03-01 23:35:35 +01:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #82686 - CDirkx:unix-platform, r=m-ou-se 2021-03-22 02:20:28 +01:00
stdarch@9c732a56f6
term Allow/fix non_fmt_panic in tests. 2021-02-03 23:15:45 +01:00
test Auto merge of #82350 - ehuss:test-chapter, r=jyn514 2021-02-28 09:18:27 +00:00
unwind Rollup merge of #82374 - clehner:licenses, r=joshtriplett 2021-03-22 15:21:23 +01:00