Skip to content

Commit f513aa3

Browse files
committed
Allow const_err in out_of_bounds_indexing tests
1 parent 9e166e0 commit f513aa3

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

tests/ui/out_of_bounds_indexing/empty_array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::out_of_bounds_indexing)]
2-
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
2+
#![allow(clippy::no_effect, clippy::unnecessary_operation, const_err)]
33

44
fn main() {
55
let empty: [i8; 0] = [];

tests/ui/out_of_bounds_indexing/empty_array.stderr

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
error: index out of bounds: the len is 0 but the index is 0
2-
--> $DIR/empty_array.rs:6:5
3-
|
4-
LL | empty[0];
5-
| ^^^^^^^^
6-
|
7-
= note: `#[deny(const_err)]` on by default
8-
91
error: range is out of bounds
102
--> $DIR/empty_array.rs:7:12
113
|
@@ -50,5 +42,5 @@ error: range is out of bounds
5042
LL | &empty[..=0];
5143
| ^
5244

53-
error: aborting due to 8 previous errors
45+
error: aborting due to 7 previous errors
5446

tests/ui/out_of_bounds_indexing/issue-3102.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::out_of_bounds_indexing)]
2-
#![allow(clippy::no_effect)]
2+
#![allow(clippy::no_effect, const_err)]
33

44
fn main() {
55
let x = [1, 2, 3, 4];

tests/ui/out_of_bounds_indexing/simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::out_of_bounds_indexing)]
2-
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
2+
#![allow(clippy::no_effect, clippy::unnecessary_operation, const_err)]
33

44
fn main() {
55
let x = [1, 2, 3, 4];

0 commit comments

Comments
 (0)