about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/crashes/ice-9463.rs7
-rw-r--r--tests/ui/crashes/ice-9463.stderr29
-rw-r--r--tests/ui/indexing_slicing_index.rs1
-rw-r--r--tests/ui/indexing_slicing_index.stderr31
4 files changed, 12 insertions, 56 deletions
diff --git a/tests/ui/crashes/ice-9463.rs b/tests/ui/crashes/ice-9463.rs
index 93808e0f892..cfa6cdac6fa 100644
--- a/tests/ui/crashes/ice-9463.rs
+++ b/tests/ui/crashes/ice-9463.rs
@@ -1,8 +1,7 @@
-#![deny(arithmetic_overflow)]
+//@check-pass
+
 fn main() {
     let _x = -1_i32 >> -1;
-    //~^ ERROR: this arithmetic operation will overflow
+    #[expect(overflowing_literals)]
     let _y = 1u32 >> 10000000000000u32;
-    //~^ ERROR: this arithmetic operation will overflow
-    //~| ERROR: literal out of range
 }
diff --git a/tests/ui/crashes/ice-9463.stderr b/tests/ui/crashes/ice-9463.stderr
deleted file mode 100644
index 9a3a5e444ad..00000000000
--- a/tests/ui/crashes/ice-9463.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error: this arithmetic operation will overflow
-  --> tests/ui/crashes/ice-9463.rs:3:14
-   |
-LL |     let _x = -1_i32 >> -1;
-   |              ^^^^^^^^^^^^ attempt to shift right by `-1_i32`, which would overflow
-   |
-note: the lint level is defined here
-  --> tests/ui/crashes/ice-9463.rs:1:9
-   |
-LL | #![deny(arithmetic_overflow)]
-   |         ^^^^^^^^^^^^^^^^^^^
-
-error: this arithmetic operation will overflow
-  --> tests/ui/crashes/ice-9463.rs:5:14
-   |
-LL |     let _y = 1u32 >> 10000000000000u32;
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift right by `1316134912_u32`, which would overflow
-
-error: literal out of range for `u32`
-  --> tests/ui/crashes/ice-9463.rs:5:22
-   |
-LL |     let _y = 1u32 >> 10000000000000u32;
-   |                      ^^^^^^^^^^^^^^^^^
-   |
-   = note: the literal `10000000000000u32` does not fit into the type `u32` whose range is `0..=4294967295`
-   = note: `#[deny(overflowing_literals)]` on by default
-
-error: aborting due to 3 previous errors
-
diff --git a/tests/ui/indexing_slicing_index.rs b/tests/ui/indexing_slicing_index.rs
index cfa1c2f7c75..2510a023acd 100644
--- a/tests/ui/indexing_slicing_index.rs
+++ b/tests/ui/indexing_slicing_index.rs
@@ -68,7 +68,6 @@ fn main() {
     // This should be linted, since `suppress-restriction-lint-in-const` default is false.
     const { &ARR[idx4()] };
     //~^ ERROR: indexing may panic
-    //~| ERROR: evaluation of `main
 
     let y = &x;
     // Ok, referencing shouldn't affect this lint. See the issue 6021
diff --git a/tests/ui/indexing_slicing_index.stderr b/tests/ui/indexing_slicing_index.stderr
index 50ee9b9edc7..c68e1d53a93 100644
--- a/tests/ui/indexing_slicing_index.stderr
+++ b/tests/ui/indexing_slicing_index.stderr
@@ -9,18 +9,6 @@ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-re
    = note: `-D clippy::indexing-slicing` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
 
-error[E0080]: evaluation of `main::{constant#3}` failed
-  --> tests/ui/indexing_slicing_index.rs:69:14
-   |
-LL |     const { &ARR[idx4()] };
-   |              ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
-
-note: erroneous constant encountered
-  --> tests/ui/indexing_slicing_index.rs:69:5
-   |
-LL |     const { &ARR[idx4()] };
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-
 error: indexing may panic
   --> tests/ui/indexing_slicing_index.rs:48:5
    |
@@ -63,13 +51,13 @@ LL |     const { &ARR[idx4()] };
    = note: the suggestion might not be applicable in constant blocks
 
 error: index is out of bounds
-  --> tests/ui/indexing_slicing_index.rs:77:5
+  --> tests/ui/indexing_slicing_index.rs:76:5
    |
 LL |     y[4];
    |     ^^^^
 
 error: indexing may panic
-  --> tests/ui/indexing_slicing_index.rs:81:5
+  --> tests/ui/indexing_slicing_index.rs:80:5
    |
 LL |     v[0];
    |     ^^^^
@@ -77,7 +65,7 @@ LL |     v[0];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> tests/ui/indexing_slicing_index.rs:83:5
+  --> tests/ui/indexing_slicing_index.rs:82:5
    |
 LL |     v[10];
    |     ^^^^^
@@ -85,7 +73,7 @@ LL |     v[10];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> tests/ui/indexing_slicing_index.rs:85:5
+  --> tests/ui/indexing_slicing_index.rs:84:5
    |
 LL |     v[1 << 3];
    |     ^^^^^^^^^
@@ -93,13 +81,13 @@ LL |     v[1 << 3];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: index is out of bounds
-  --> tests/ui/indexing_slicing_index.rs:93:5
+  --> tests/ui/indexing_slicing_index.rs:92:5
    |
 LL |     x[N];
    |     ^^^^
 
 error: indexing may panic
-  --> tests/ui/indexing_slicing_index.rs:97:5
+  --> tests/ui/indexing_slicing_index.rs:96:5
    |
 LL |     v[N];
    |     ^^^^
@@ -107,7 +95,7 @@ LL |     v[N];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> tests/ui/indexing_slicing_index.rs:99:5
+  --> tests/ui/indexing_slicing_index.rs:98:5
    |
 LL |     v[M];
    |     ^^^^
@@ -115,11 +103,10 @@ LL |     v[M];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: index is out of bounds
-  --> tests/ui/indexing_slicing_index.rs:103:13
+  --> tests/ui/indexing_slicing_index.rs:102:13
    |
 LL |     let _ = x[4];
    |             ^^^^
 
-error: aborting due to 15 previous errors
+error: aborting due to 14 previous errors
 
-For more information about this error, try `rustc --explain E0080`.