rust/tests/ui/lint/lint-overflowing-ops.opt_with_overflow_checks.stderr
Gurinder Singh 5010ca001c Enable ConstPropLint for promoteds
This fixes the issue wherein the lint didn't fire for promoteds
in the case of SHL/SHR operators in non-optimized builds
and all arithmetic operators in optimized builds
2024-02-17 10:44:46 +05:30

1031 lines
36 KiB
Plaintext

error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:26:14
|
LL | let _n = 1u8 << 8;
| ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
|
note: the lint level is defined here
--> $DIR/lint-overflowing-ops.rs:17:9
|
LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:212:15
|
LL | let _n = &(usize::MAX * 5);
| ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:209:15
|
LL | let _n = &(isize::MAX * 5);
| ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:206:15
|
LL | let _n = &(i128::MAX * 5);
| ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:203:15
|
LL | let _n = &(i64::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:200:15
|
LL | let _n = &(i32::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:197:15
|
LL | let _n = &(i16::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:194:15
|
LL | let _n = &(i8::MAX * i8::MAX);
| ^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:191:15
|
LL | let _n = &(u128::MAX * 5);
| ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:188:15
|
LL | let _n = &(u64::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:185:15
|
LL | let _n = &(u32::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:182:15
|
LL | let _n = &(u16::MAX * 5);
| ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:179:15
|
LL | let _n = &(u8::MAX * 5);
| ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:174:15
|
LL | let _n = &(1usize - 5);
| ^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:171:15
|
LL | let _n = &(-5isize - isize::MAX);
| ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:168:15
|
LL | let _n = &(-5i128 - i128::MAX);
| ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:165:15
|
LL | let _n = &(-5i64 - i64::MAX);
| ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:162:15
|
LL | let _n = &(-5i32 - i32::MAX);
| ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:159:15
|
LL | let _n = &(-5i16 - i16::MAX);
| ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:156:15
|
LL | let _n = &(-5i8 - i8::MAX);
| ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:153:15
|
LL | let _n = &(1u128 - 5);
| ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:150:15
|
LL | let _n = &(1u64 - 5);
| ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:147:15
|
LL | let _n = &(1u32 - 5);
| ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:144:15
|
LL | let _n = &(1u16 - 5);
| ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:141:15
|
LL | let _n = &(1u8 - 5);
| ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:136:15
|
LL | let _n = &(1usize + usize::MAX);
| ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:133:15
|
LL | let _n = &(1isize + isize::MAX);
| ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:130:15
|
LL | let _n = &(1i128 + i128::MAX);
| ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:127:15
|
LL | let _n = &(1i64 + i64::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:124:15
|
LL | let _n = &(1i32 + i32::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:121:15
|
LL | let _n = &(1i16 + i16::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:118:15
|
LL | let _n = &(1i8 + i8::MAX);
| ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:115:15
|
LL | let _n = &(1u128 + u128::MAX);
| ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:112:15
|
LL | let _n = &(1u64 + u64::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:109:15
|
LL | let _n = &(1u32 + u32::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:106:15
|
LL | let _n = &(1u16 + u16::MAX);
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:103:15
|
LL | let _n = &(1u8 + u8::MAX);
| ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:98:15
|
LL | let _n = &(1_usize >> BITS);
| ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:95:15
|
LL | let _n = &(1_isize >> BITS);
| ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:92:15
|
LL | let _n = &(1i128 >> 128);
| ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:89:15
|
LL | let _n = &(1i64 >> 64);
| ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:86:15
|
LL | let _n = &(1i32 >> 32);
| ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:83:15
|
LL | let _n = &(1i16 >> 16);
| ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:80:15
|
LL | let _n = &(1i8 >> 8);
| ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:77:15
|
LL | let _n = &(1u128 >> 128);
| ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:74:15
|
LL | let _n = &(1u64 >> 64);
| ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:71:15
|
LL | let _n = &(1u32 >> 32);
| ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:68:15
|
LL | let _n = &(1u16 >> 16);
| ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:65:15
|
LL | let _n = &(1u8 >> 8);
| ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:60:15
|
LL | let _n = &(1_usize << BITS);
| ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:57:15
|
LL | let _n = &(1_isize << BITS);
| ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:54:15
|
LL | let _n = &(1i128 << 128);
| ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:51:15
|
LL | let _n = &(1i64 << 64);
| ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:48:15
|
LL | let _n = &(1i32 << 32);
| ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:45:15
|
LL | let _n = &(1i16 << 16);
| ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:42:15
|
LL | let _n = &(1i8 << 8);
| ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:39:15
|
LL | let _n = &(1u128 << 128);
| ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:36:15
|
LL | let _n = &(1u64 << 64);
| ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:33:15
|
LL | let _n = &(1u32 << 32);
| ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:30:15
|
LL | let _n = &(1u16 << 16);
| ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:27:15
|
LL | let _n = &(1u8 << 8);
| ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:29:14
|
LL | let _n = 1u16 << 16;
| ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:32:14
|
LL | let _n = 1u32 << 32;
| ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:35:14
|
LL | let _n = 1u64 << 64;
| ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:38:14
|
LL | let _n = 1u128 << 128;
| ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:41:14
|
LL | let _n = 1i8 << 8;
| ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:44:14
|
LL | let _n = 1i16 << 16;
| ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:47:14
|
LL | let _n = 1i32 << 32;
| ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:50:14
|
LL | let _n = 1i64 << 64;
| ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:53:14
|
LL | let _n = 1i128 << 128;
| ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:56:14
|
LL | let _n = 1_isize << BITS;
| ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:59:14
|
LL | let _n = 1_usize << BITS;
| ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:64:14
|
LL | let _n = 1u8 >> 8;
| ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:67:14
|
LL | let _n = 1u16 >> 16;
| ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:70:14
|
LL | let _n = 1u32 >> 32;
| ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:73:14
|
LL | let _n = 1u64 >> 64;
| ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:76:14
|
LL | let _n = 1u128 >> 128;
| ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:79:14
|
LL | let _n = 1i8 >> 8;
| ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:82:14
|
LL | let _n = 1i16 >> 16;
| ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:85:14
|
LL | let _n = 1i32 >> 32;
| ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:88:14
|
LL | let _n = 1i64 >> 64;
| ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:91:14
|
LL | let _n = 1i128 >> 128;
| ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:94:14
|
LL | let _n = 1_isize >> BITS;
| ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:97:14
|
LL | let _n = 1_usize >> BITS;
| ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:102:14
|
LL | let _n = 1u8 + u8::MAX;
| ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:105:14
|
LL | let _n = 1u16 + u16::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:108:14
|
LL | let _n = 1u32 + u32::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:111:14
|
LL | let _n = 1u64 + u64::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:114:14
|
LL | let _n = 1u128 + u128::MAX;
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:117:14
|
LL | let _n = 1i8 + i8::MAX;
| ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:120:14
|
LL | let _n = 1i16 + i16::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:123:14
|
LL | let _n = 1i32 + i32::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:126:14
|
LL | let _n = 1i64 + i64::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:129:14
|
LL | let _n = 1i128 + i128::MAX;
| ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:132:14
|
LL | let _n = 1isize + isize::MAX;
| ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:135:14
|
LL | let _n = 1usize + usize::MAX;
| ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:140:14
|
LL | let _n = 1u8 - 5;
| ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:143:14
|
LL | let _n = 1u16 - 5;
| ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:146:14
|
LL | let _n = 1u32 - 5;
| ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:149:14
|
LL | let _n = 1u64 - 5 ;
| ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:152:14
|
LL | let _n = 1u128 - 5 ;
| ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:155:14
|
LL | let _n = -5i8 - i8::MAX;
| ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:158:14
|
LL | let _n = -5i16 - i16::MAX;
| ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:161:14
|
LL | let _n = -5i32 - i32::MAX;
| ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:164:14
|
LL | let _n = -5i64 - i64::MAX;
| ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:167:14
|
LL | let _n = -5i128 - i128::MAX;
| ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:170:14
|
LL | let _n = -5isize - isize::MAX;
| ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:173:14
|
LL | let _n = 1usize - 5;
| ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:178:14
|
LL | let _n = u8::MAX * 5;
| ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:181:14
|
LL | let _n = u16::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:184:14
|
LL | let _n = u32::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:187:14
|
LL | let _n = u64::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:190:14
|
LL | let _n = u128::MAX * 5;
| ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:193:14
|
LL | let _n = i8::MAX * i8::MAX;
| ^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:196:14
|
LL | let _n = i16::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:199:14
|
LL | let _n = i32::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:202:14
|
LL | let _n = i64::MAX * 5;
| ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:205:14
|
LL | let _n = i128::MAX * 5;
| ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:208:14
|
LL | let _n = isize::MAX * 5;
| ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
error: this arithmetic operation will overflow
--> $DIR/lint-overflowing-ops.rs:211:14
|
LL | let _n = usize::MAX * 5;
| ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:216:14
|
LL | let _n = 1u8 / 0;
| ^^^^^^^ attempt to divide `1_u8` by zero
|
= note: `#[deny(unconditional_panic)]` on by default
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:217:15
|
LL | let _n = &(1u8 / 0);
| ^^^^^^^^^ attempt to divide `1_u8` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:219:14
|
LL | let _n = 1u16 / 0;
| ^^^^^^^^ attempt to divide `1_u16` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:220:15
|
LL | let _n = &(1u16 / 0);
| ^^^^^^^^^^ attempt to divide `1_u16` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:222:14
|
LL | let _n = 1u32 / 0;
| ^^^^^^^^ attempt to divide `1_u32` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:223:15
|
LL | let _n = &(1u32 / 0);
| ^^^^^^^^^^ attempt to divide `1_u32` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:225:14
|
LL | let _n = 1u64 / 0;
| ^^^^^^^^ attempt to divide `1_u64` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:226:15
|
LL | let _n = &(1u64 / 0);
| ^^^^^^^^^^ attempt to divide `1_u64` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:228:14
|
LL | let _n = 1u128 / 0;
| ^^^^^^^^^ attempt to divide `1_u128` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:229:15
|
LL | let _n = &(1u128 / 0);
| ^^^^^^^^^^^ attempt to divide `1_u128` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:231:14
|
LL | let _n = 1i8 / 0;
| ^^^^^^^ attempt to divide `1_i8` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:232:15
|
LL | let _n = &(1i8 / 0);
| ^^^^^^^^^ attempt to divide `1_i8` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:234:14
|
LL | let _n = 1i16 / 0;
| ^^^^^^^^ attempt to divide `1_i16` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:235:15
|
LL | let _n = &(1i16 / 0);
| ^^^^^^^^^^ attempt to divide `1_i16` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:237:14
|
LL | let _n = 1i32 / 0;
| ^^^^^^^^ attempt to divide `1_i32` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:238:15
|
LL | let _n = &(1i32 / 0);
| ^^^^^^^^^^ attempt to divide `1_i32` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:240:14
|
LL | let _n = 1i64 / 0;
| ^^^^^^^^ attempt to divide `1_i64` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:241:15
|
LL | let _n = &(1i64 / 0);
| ^^^^^^^^^^ attempt to divide `1_i64` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:243:14
|
LL | let _n = 1i128 / 0;
| ^^^^^^^^^ attempt to divide `1_i128` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:244:15
|
LL | let _n = &(1i128 / 0);
| ^^^^^^^^^^^ attempt to divide `1_i128` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:246:14
|
LL | let _n = 1isize / 0;
| ^^^^^^^^^^ attempt to divide `1_isize` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:247:15
|
LL | let _n = &(1isize / 0);
| ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:249:14
|
LL | let _n = 1usize / 0;
| ^^^^^^^^^^ attempt to divide `1_usize` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:250:15
|
LL | let _n = &(1usize / 0);
| ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:254:14
|
LL | let _n = 1u8 % 0;
| ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:255:15
|
LL | let _n = &(1u8 % 0);
| ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:257:14
|
LL | let _n = 1u16 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:258:15
|
LL | let _n = &(1u16 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:260:14
|
LL | let _n = 1u32 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:261:15
|
LL | let _n = &(1u32 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:263:14
|
LL | let _n = 1u64 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:264:15
|
LL | let _n = &(1u64 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:266:14
|
LL | let _n = 1u128 % 0;
| ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:267:15
|
LL | let _n = &(1u128 % 0);
| ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:269:14
|
LL | let _n = 1i8 % 0;
| ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:270:15
|
LL | let _n = &(1i8 % 0);
| ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:272:14
|
LL | let _n = 1i16 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:273:15
|
LL | let _n = &(1i16 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:275:14
|
LL | let _n = 1i32 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:276:15
|
LL | let _n = &(1i32 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:278:14
|
LL | let _n = 1i64 % 0;
| ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:279:15
|
LL | let _n = &(1i64 % 0);
| ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:281:14
|
LL | let _n = 1i128 % 0;
| ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:282:15
|
LL | let _n = &(1i128 % 0);
| ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:284:14
|
LL | let _n = 1isize % 0;
| ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:285:15
|
LL | let _n = &(1isize % 0);
| ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:287:14
|
LL | let _n = 1usize % 0;
| ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:288:15
|
LL | let _n = &(1usize % 0);
| ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:292:14
|
LL | let _n = [1, 2, 3][4];
| ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
error: this operation will panic at runtime
--> $DIR/lint-overflowing-ops.rs:293:15
|
LL | let _n = &([1, 2, 3][4]);
| ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
error: aborting due to 170 previous errors