mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 00:56:14 +00:00
189 lines
5.3 KiB
Plaintext
189 lines
5.3 KiB
Plaintext
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:28:5
|
|
|
|
|
LL | / if u_8 > 0 {
|
|
LL | | u_8 = u_8 - 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_8 = u_8.saturating_sub(1);`
|
|
|
|
|
= note: `-D clippy::implicit-saturating-sub` implied by `-D warnings`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:35:13
|
|
|
|
|
LL | / if u_8 > 0 {
|
|
LL | | u_8 -= 1;
|
|
LL | | }
|
|
| |_____________^ help: try: `u_8 = u_8.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:49:5
|
|
|
|
|
LL | / if u_16 > 0 {
|
|
LL | | u_16 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_16 = u_16.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:59:5
|
|
|
|
|
LL | / if u_32 != 0 {
|
|
LL | | u_32 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_32 = u_32.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:80:5
|
|
|
|
|
LL | / if u_64 > 0 {
|
|
LL | | u_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_64 = u_64.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:85:5
|
|
|
|
|
LL | / if 0 < u_64 {
|
|
LL | | u_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_64 = u_64.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:90:5
|
|
|
|
|
LL | / if 0 != u_64 {
|
|
LL | | u_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_64 = u_64.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:111:5
|
|
|
|
|
LL | / if u_usize > 0 {
|
|
LL | | u_usize -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `u_usize = u_usize.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:123:5
|
|
|
|
|
LL | / if i_8 > i8::MIN {
|
|
LL | | i_8 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_8 = i_8.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:128:5
|
|
|
|
|
LL | / if i_8 > i8::MIN {
|
|
LL | | i_8 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_8 = i_8.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:133:5
|
|
|
|
|
LL | / if i_8 != i8::MIN {
|
|
LL | | i_8 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_8 = i_8.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:138:5
|
|
|
|
|
LL | / if i_8 != i8::MIN {
|
|
LL | | i_8 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_8 = i_8.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:148:5
|
|
|
|
|
LL | / if i_16 > i16::MIN {
|
|
LL | | i_16 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_16 = i_16.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:153:5
|
|
|
|
|
LL | / if i_16 > i16::MIN {
|
|
LL | | i_16 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_16 = i_16.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:158:5
|
|
|
|
|
LL | / if i_16 != i16::MIN {
|
|
LL | | i_16 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_16 = i_16.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:163:5
|
|
|
|
|
LL | / if i_16 != i16::MIN {
|
|
LL | | i_16 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_16 = i_16.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:173:5
|
|
|
|
|
LL | / if i_32 > i32::MIN {
|
|
LL | | i_32 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_32 = i_32.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:178:5
|
|
|
|
|
LL | / if i_32 > i32::MIN {
|
|
LL | | i_32 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_32 = i_32.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:183:5
|
|
|
|
|
LL | / if i_32 != i32::MIN {
|
|
LL | | i_32 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_32 = i_32.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:188:5
|
|
|
|
|
LL | / if i_32 != i32::MIN {
|
|
LL | | i_32 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_32 = i_32.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:198:5
|
|
|
|
|
LL | / if i64::MIN < i_64 {
|
|
LL | | i_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_64 = i_64.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:203:5
|
|
|
|
|
LL | / if i64::MIN != i_64 {
|
|
LL | | i_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_64 = i_64.saturating_sub(1);`
|
|
|
|
error: implicitly performing saturating subtraction
|
|
--> $DIR/implicit_saturating_sub.rs:208:5
|
|
|
|
|
LL | / if i64::MIN < i_64 {
|
|
LL | | i_64 -= 1;
|
|
LL | | }
|
|
| |_____^ help: try: `i_64 = i_64.saturating_sub(1);`
|
|
|
|
error: aborting due to 23 previous errors
|
|
|