core/num/imp/
overflow_panic.rs1#[cold]
6#[track_caller]
7pub(in crate::num) const fn add() -> ! {
8 panic!("attempt to add with overflow")
9}
10
11#[cold]
12#[track_caller]
13pub(in crate::num) const fn sub() -> ! {
14 panic!("attempt to subtract with overflow")
15}
16
17#[cold]
18#[track_caller]
19pub(in crate::num) const fn mul() -> ! {
20 panic!("attempt to multiply with overflow")
21}
22
23#[cold]
24#[track_caller]
25pub(in crate::num) const fn div() -> ! {
26 panic!("attempt to divide with overflow")
27}
28
29#[cold]
30#[track_caller]
31pub(in crate::num) const fn rem() -> ! {
32 panic!("attempt to calculate the remainder with overflow")
33}
34
35#[cold]
36#[track_caller]
37pub(in crate::num) const fn neg() -> ! {
38 panic!("attempt to negate with overflow")
39}
40
41#[cold]
42#[track_caller]
43pub(in crate::num) const fn shr() -> ! {
44 panic!("attempt to shift right with overflow")
45}
46
47#[cold]
48#[track_caller]
49pub(in crate::num) const fn shl() -> ! {
50 panic!("attempt to shift left with overflow")
51}