mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 20:03:37 +00:00
avoid excessive number of revisions
This commit is contained in:
parent
5e19350a4c
commit
58bb47ebe5
@ -1,48 +0,0 @@
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:19:13
|
||||
|
|
||||
LL | let a = -std::i8::MIN;
|
||||
| ^^^^^^^^^^^^^ attempt to negate with overflow
|
||||
|
|
||||
= note: `#[deny(arithmetic_overflow)]` on by default
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:21:18
|
||||
|
|
||||
LL | let a_i128 = -std::i128::MIN;
|
||||
| ^^^^^^^^^^^^^^^ attempt to negate with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:23:13
|
||||
|
|
||||
LL | let b = 200u8 + 200u8 + 200u8;
|
||||
| ^^^^^^^^^^^^^ attempt to add with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:25:18
|
||||
|
|
||||
LL | let b_i128 = std::i128::MIN - std::i128::MAX;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:27:13
|
||||
|
|
||||
LL | let c = 200u8 * 4;
|
||||
| ^^^^^^^^^ attempt to multiply with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/const-err2.rs:29:13
|
||||
|
|
||||
LL | let d = 42u8 - (42u8 + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/const-err2.rs:31:14
|
||||
|
|
||||
LL | let _e = [5u8][1];
|
||||
| ^^^^^^^^ index out of bounds: the len is 1 but the index is 1
|
||||
|
|
||||
= note: `#[deny(unconditional_panic)]` on by default
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
@ -2,7 +2,7 @@
|
||||
// optimized compilation and unoptimized compilation and thus would
|
||||
// lead to different lints being emitted
|
||||
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
@ -1,72 +0,0 @@
|
||||
warning: this arithmetic operation will overflow
|
||||
--> $DIR/promoted_errors.rs:14:14
|
||||
|
|
||||
LL | let _x = 0u32 - 1;
|
||||
| ^^^^^^^^ attempt to subtract with overflow
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/promoted_errors.rs:9:20
|
||||
|
|
||||
LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: this operation will panic at runtime
|
||||
--> $DIR/promoted_errors.rs:16:20
|
||||
|
|
||||
LL | println!("{}", 1 / (1 - 1));
|
||||
| ^^^^^^^^^^^ attempt to divide by zero
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/promoted_errors.rs:9:41
|
||||
|
|
||||
LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: reaching this expression at runtime will panic or abort
|
||||
--> $DIR/promoted_errors.rs:16:20
|
||||
|
|
||||
LL | println!("{}", 1 / (1 - 1));
|
||||
| ^^^^^^^^^^^ dividing by zero
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/promoted_errors.rs:9:9
|
||||
|
|
||||
LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
warning: erroneous constant used
|
||||
--> $DIR/promoted_errors.rs:16:20
|
||||
|
|
||||
LL | println!("{}", 1 / (1 - 1));
|
||||
| ^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
warning: this operation will panic at runtime
|
||||
--> $DIR/promoted_errors.rs:20:14
|
||||
|
|
||||
LL | let _x = 1 / (1 - 1);
|
||||
| ^^^^^^^^^^^ attempt to divide by zero
|
||||
|
||||
warning: this operation will panic at runtime
|
||||
--> $DIR/promoted_errors.rs:22:20
|
||||
|
|
||||
LL | println!("{}", 1 / (false as u32));
|
||||
| ^^^^^^^^^^^^^^^^^^ attempt to divide by zero
|
||||
|
||||
warning: reaching this expression at runtime will panic or abort
|
||||
--> $DIR/promoted_errors.rs:22:20
|
||||
|
|
||||
LL | println!("{}", 1 / (false as u32));
|
||||
| ^^^^^^^^^^^^^^^^^^ dividing by zero
|
||||
|
||||
warning: erroneous constant used
|
||||
--> $DIR/promoted_errors.rs:22:20
|
||||
|
|
||||
LL | println!("{}", 1 / (false as u32));
|
||||
| ^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
warning: this operation will panic at runtime
|
||||
--> $DIR/promoted_errors.rs:26:14
|
||||
|
|
||||
LL | let _x = 1 / (false as u32);
|
||||
| ^^^^^^^^^^^^^^^^^^ attempt to divide by zero
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
@ -1,30 +0,0 @@
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-69020.rs:21:22
|
||||
|
|
||||
LL | const NEG: i32 = -i32::MIN + T::NEG;
|
||||
| ^^^^^^^^^ attempt to negate with overflow
|
||||
|
|
||||
= note: `#[deny(arithmetic_overflow)]` on by default
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-69020.rs:23:22
|
||||
|
|
||||
LL | const ADD: i32 = (i32::MAX+1) + T::ADD;
|
||||
| ^^^^^^^^^^^^ attempt to add with overflow
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-69020.rs:25:22
|
||||
|
|
||||
LL | const DIV: i32 = (1/0) + T::DIV;
|
||||
| ^^^^^ attempt to divide by zero
|
||||
|
|
||||
= note: `#[deny(unconditional_panic)]` on by default
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-69020.rs:27:22
|
||||
|
|
||||
LL | const OOB: i32 = [1][1] + T::OOB;
|
||||
| ^^^^^^ index out of bounds: the len is 1 but the index is 1
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
@ -1,150 +0,0 @@
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:14:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
|
||||
= note: `#[deny(arithmetic_overflow)]` on by default
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:16:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:18:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:20:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:22:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:24:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^^ attempt to divide with overflow
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:26:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
|
||||
| ^^^^^^^^^^ attempt to divide by zero
|
||||
|
|
||||
= note: `#[deny(unconditional_panic)]` on by default
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:28:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
|
||||
| ^^^^^^^ attempt to divide by zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:30:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to divide by zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:32:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to divide by zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:34:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to divide by zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:36:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
|
||||
| ^^^^^^^^^ attempt to divide by zero
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:38:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:40:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:42:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:44:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:46:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/issue-8460-const.rs:48:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
|
||||
| ^^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:50:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
|
||||
| ^^^^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:52:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
|
||||
| ^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:54:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:56:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:58:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
|
||||
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: this operation will panic at runtime
|
||||
--> $DIR/issue-8460-const.rs:60:36
|
||||
|
|
||||
LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
|
||||
| ^^^^^^^^^ attempt to calculate the remainder with a divisor of zero
|
||||
|
||||
error: aborting due to 24 previous errors
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
@ -1,146 +0,0 @@
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:22:13
|
||||
|
|
||||
LL | let _ = x << 42;
|
||||
| ^^^^^^^ attempt to shift left with overflow
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:9:9
|
||||
|
|
||||
LL | #![deny(arithmetic_overflow, const_err)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:27:15
|
||||
|
|
||||
LL | let n = 1u8 << 8;
|
||||
| ^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:29:15
|
||||
|
|
||||
LL | let n = 1u16 << 16;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:31:15
|
||||
|
|
||||
LL | let n = 1u32 << 32;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:33:15
|
||||
|
|
||||
LL | let n = 1u64 << 64;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:35:15
|
||||
|
|
||||
LL | let n = 1i8 << 8;
|
||||
| ^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:37:15
|
||||
|
|
||||
LL | let n = 1i16 << 16;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:39:15
|
||||
|
|
||||
LL | let n = 1i32 << 32;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:41:15
|
||||
|
|
||||
LL | let n = 1i64 << 64;
|
||||
| ^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:44:15
|
||||
|
|
||||
LL | let n = 1u8 >> 8;
|
||||
| ^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:46:15
|
||||
|
|
||||
LL | let n = 1u16 >> 16;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:48:15
|
||||
|
|
||||
LL | let n = 1u32 >> 32;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:50:15
|
||||
|
|
||||
LL | let n = 1u64 >> 64;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:52:15
|
||||
|
|
||||
LL | let n = 1i8 >> 8;
|
||||
| ^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:54:15
|
||||
|
|
||||
LL | let n = 1i16 >> 16;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:56:15
|
||||
|
|
||||
LL | let n = 1i32 >> 32;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:58:15
|
||||
|
|
||||
LL | let n = 1i64 >> 64;
|
||||
| ^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:62:15
|
||||
|
|
||||
LL | let n = n << 8;
|
||||
| ^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:64:15
|
||||
|
|
||||
LL | let n = 1u8 << -8;
|
||||
| ^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:69:15
|
||||
|
|
||||
LL | let n = 1u8 << (4+4);
|
||||
| ^^^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:71:15
|
||||
|
|
||||
LL | let n = 1i64 >> [64][0];
|
||||
| ^^^^^^^^^^^^^^^ attempt to shift right with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:77:15
|
||||
|
|
||||
LL | let n = 1_isize << BITS;
|
||||
| ^^^^^^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: this arithmetic operation will overflow
|
||||
--> $DIR/lint-exceeding-bitshifts.rs:78:15
|
||||
|
|
||||
LL | let n = 1_usize << BITS;
|
||||
| ^^^^^^^^^^^^^^^ attempt to shift left with overflow
|
||||
|
||||
error: aborting due to 23 previous errors
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: default noopt opt opt_with_overflow_checks
|
||||
// revisions: noopt opt opt_with_overflow_checks
|
||||
//[noopt]compile-flags: -C opt-level=0
|
||||
//[opt]compile-flags: -O
|
||||
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
|
||||
|
Loading…
Reference in New Issue
Block a user