diff options
Diffstat (limited to 'tests/ui/numbers-arithmetic')
21 files changed, 87 insertions, 11 deletions
diff --git a/tests/ui/numbers-arithmetic/issue-105626.rs b/tests/ui/numbers-arithmetic/issue-105626.rs index f97edd510..5466f8e18 100644 --- a/tests/ui/numbers-arithmetic/issue-105626.rs +++ b/tests/ui/numbers-arithmetic/issue-105626.rs @@ -1,6 +1,5 @@ // run-pass // only-x86 -// min-system-llvm-version: 16 // compile-flags: -Ctarget-feature=+sse2 use std::hint::black_box; diff --git a/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs new file mode 100644 index 000000000..2c4bdad3e --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs @@ -0,0 +1,8 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-add-assign-overflow.rs + +fn main() { + let mut a: u8 = 255; + a += &1; +} diff --git a/tests/ui/numbers-arithmetic/location-add-overflow.rs b/tests/ui/numbers-arithmetic/location-add-overflow.rs new file mode 100644 index 000000000..085623c9b --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-add-overflow.rs @@ -0,0 +1,7 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-add-overflow.rs + +fn main() { + let _: u8 = 255 + &1; +} diff --git a/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs new file mode 100644 index 000000000..21b5e7a81 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs @@ -0,0 +1,8 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-divide-assign-by-zero.rs + +fn main() { + let mut a = 1; + a /= &0; +} diff --git a/tests/ui/numbers-arithmetic/location-divide-by-zero.rs b/tests/ui/numbers-arithmetic/location-divide-by-zero.rs new file mode 100644 index 000000000..7d045fc56 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-divide-by-zero.rs @@ -0,0 +1,9 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-divide-by-zero.rs + +// https://github.com/rust-lang/rust/issues/114814 + +fn main() { + let _ = 1 / &0; +} diff --git a/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs new file mode 100644 index 000000000..88d602e4b --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs @@ -0,0 +1,8 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-mod-assign-by-zero.rs + +fn main() { + let mut a = 1; + a %= &0; +} diff --git a/tests/ui/numbers-arithmetic/location-mod-by-zero.rs b/tests/ui/numbers-arithmetic/location-mod-by-zero.rs new file mode 100644 index 000000000..4397adb75 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mod-by-zero.rs @@ -0,0 +1,7 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-mod-by-zero.rs + +fn main() { + let _ = 1 % &0; +} diff --git a/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs new file mode 100644 index 000000000..b042751de --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs @@ -0,0 +1,8 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-mul-assign-overflow.rs + +fn main() { + let mut a: u8 = 255; + a *= &2; +} diff --git a/tests/ui/numbers-arithmetic/location-mul-overflow.rs b/tests/ui/numbers-arithmetic/location-mul-overflow.rs new file mode 100644 index 000000000..6dd588748 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mul-overflow.rs @@ -0,0 +1,7 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-mul-overflow.rs + +fn main() { + let _: u8 = 255 * &2; +} diff --git a/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs new file mode 100644 index 000000000..5b92ada2e --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs @@ -0,0 +1,8 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-sub-assign-overflow.rs + +fn main() { + let mut a: u8 = 0; + a -= &1; +} diff --git a/tests/ui/numbers-arithmetic/location-sub-overflow.rs b/tests/ui/numbers-arithmetic/location-sub-overflow.rs new file mode 100644 index 000000000..2d77cb8f5 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-sub-overflow.rs @@ -0,0 +1,7 @@ +// run-fail +// ignore-wasm32 +// error-pattern:location-sub-overflow.rs + +fn main() { + let _: u8 = 0 - &1; +} diff --git a/tests/ui/numbers-arithmetic/overflowing-lsh-1.stderr b/tests/ui/numbers-arithmetic/overflowing-lsh-1.stderr index 434c9d5b4..5d2c4a6c8 100644 --- a/tests/ui/numbers-arithmetic/overflowing-lsh-1.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-lsh-1.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-lsh-2.stderr b/tests/ui/numbers-arithmetic/overflowing-lsh-2.stderr index c3b44e5a0..8ac72aefe 100644 --- a/tests/ui/numbers-arithmetic/overflowing-lsh-2.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-lsh-2.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-lsh-3.stderr b/tests/ui/numbers-arithmetic/overflowing-lsh-3.stderr index 9d6479bd7..43d541b03 100644 --- a/tests/ui/numbers-arithmetic/overflowing-lsh-3.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-lsh-3.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-lsh-4.stderr b/tests/ui/numbers-arithmetic/overflowing-lsh-4.stderr index 2bb5b6a6d..00a358106 100644 --- a/tests/ui/numbers-arithmetic/overflowing-lsh-4.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-lsh-4.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-1.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-1.stderr index b2b3114d1..62763e9e1 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-1.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-1.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-2.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-2.stderr index ad18c3bb7..519e62fef 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-2.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-2.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-3.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-3.stderr index 37d02e09d..de24ea1fc 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-3.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-3.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-4.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-4.stderr index 692602c07..47588012f 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-4.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-4.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-5.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-5.stderr index e3b5859df..e9a1572d3 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-5.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-5.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-6.stderr b/tests/ui/numbers-arithmetic/overflowing-rsh-6.stderr index a3475c04c..005f73782 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-6.stderr +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-6.stderr @@ -10,5 +10,5 @@ note: the lint level is defined here LL | #![deny(arithmetic_overflow)] | ^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error |