Skip to content

Commit 39c3558

Browse files
committed
Fix clippy tests
1 parent 1ff6551 commit 39c3558

File tree

5 files changed

+26
-28
lines changed

5 files changed

+26
-28
lines changed

src/tools/clippy/tests/ui/arithmetic_side_effects.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
arithmetic_overflow,
88
unconditional_panic
99
)]
10-
#![feature(const_mut_refs, inline_const, saturating_int_impl)]
10+
#![feature(const_mut_refs, saturating_int_impl)]
1111
#![warn(clippy::arithmetic_side_effects)]
1212

1313
use core::num::{Saturating, Wrapping};

src/tools/clippy/tests/ui/indexing_slicing_index.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(inline_const)]
21
#![warn(clippy::indexing_slicing)]
32
// We also check the out_of_bounds_indexing lint here, because it lints similar things and
43
// we want to avoid false positives.

src/tools/clippy/tests/ui/indexing_slicing_index.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0080]: evaluation of `main::{constant#3}` failed
2-
--> $DIR/indexing_slicing_index.rs:31:14
2+
--> $DIR/indexing_slicing_index.rs:30:14
33
|
44
LL | const { &ARR[idx4()] }; // Ok, let rustc handle const contexts.
55
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
66

77
error[E0080]: erroneous constant used
8-
--> $DIR/indexing_slicing_index.rs:31:5
8+
--> $DIR/indexing_slicing_index.rs:30:5
99
|
1010
LL | const { &ARR[idx4()] }; // Ok, let rustc handle const contexts.
1111
| ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
1212

1313
error: indexing may panic
14-
--> $DIR/indexing_slicing_index.rs:22:5
14+
--> $DIR/indexing_slicing_index.rs:21:5
1515
|
1616
LL | x[index];
1717
| ^^^^^^^^
@@ -20,47 +20,47 @@ LL | x[index];
2020
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
2121

2222
error: indexing may panic
23-
--> $DIR/indexing_slicing_index.rs:38:5
23+
--> $DIR/indexing_slicing_index.rs:37:5
2424
|
2525
LL | v[0];
2626
| ^^^^
2727
|
2828
= help: consider using `.get(n)` or `.get_mut(n)` instead
2929

3030
error: indexing may panic
31-
--> $DIR/indexing_slicing_index.rs:39:5
31+
--> $DIR/indexing_slicing_index.rs:38:5
3232
|
3333
LL | v[10];
3434
| ^^^^^
3535
|
3636
= help: consider using `.get(n)` or `.get_mut(n)` instead
3737

3838
error: indexing may panic
39-
--> $DIR/indexing_slicing_index.rs:40:5
39+
--> $DIR/indexing_slicing_index.rs:39:5
4040
|
4141
LL | v[1 << 3];
4242
| ^^^^^^^^^
4343
|
4444
= help: consider using `.get(n)` or `.get_mut(n)` instead
4545

4646
error: indexing may panic
47-
--> $DIR/indexing_slicing_index.rs:46:5
47+
--> $DIR/indexing_slicing_index.rs:45:5
4848
|
4949
LL | v[N];
5050
| ^^^^
5151
|
5252
= help: consider using `.get(n)` or `.get_mut(n)` instead
5353

5454
error: indexing may panic
55-
--> $DIR/indexing_slicing_index.rs:47:5
55+
--> $DIR/indexing_slicing_index.rs:46:5
5656
|
5757
LL | v[M];
5858
| ^^^^
5959
|
6060
= help: consider using `.get(n)` or `.get_mut(n)` instead
6161

6262
error[E0080]: evaluation of constant value failed
63-
--> $DIR/indexing_slicing_index.rs:10:24
63+
--> $DIR/indexing_slicing_index.rs:9:24
6464
|
6565
LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
6666
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4

src/tools/clippy/tests/ui/panicking_macros.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![allow(clippy::assertions_on_constants, clippy::eq_op, clippy::let_unit_value)]
2-
#![feature(inline_const)]
32
#![warn(clippy::unimplemented, clippy::unreachable, clippy::todo, clippy::panic)]
43

54
extern crate core;

src/tools/clippy/tests/ui/panicking_macros.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
11
error: `panic` should not be present in production code
2-
--> $DIR/panicking_macros.rs:23:5
2+
--> $DIR/panicking_macros.rs:22:5
33
|
44
LL | panic!();
55
| ^^^^^^^^
66
|
77
= note: `-D clippy::panic` implied by `-D warnings`
88

99
error: `panic` should not be present in production code
10-
--> $DIR/panicking_macros.rs:24:5
10+
--> $DIR/panicking_macros.rs:23:5
1111
|
1212
LL | panic!("message");
1313
| ^^^^^^^^^^^^^^^^^
1414

1515
error: `panic` should not be present in production code
16-
--> $DIR/panicking_macros.rs:25:5
16+
--> $DIR/panicking_macros.rs:24:5
1717
|
1818
LL | panic!("{} {}", "panic with", "multiple arguments");
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

2121
error: `todo` should not be present in production code
22-
--> $DIR/panicking_macros.rs:31:5
22+
--> $DIR/panicking_macros.rs:30:5
2323
|
2424
LL | todo!();
2525
| ^^^^^^^
2626
|
2727
= note: `-D clippy::todo` implied by `-D warnings`
2828

2929
error: `todo` should not be present in production code
30-
--> $DIR/panicking_macros.rs:32:5
30+
--> $DIR/panicking_macros.rs:31:5
3131
|
3232
LL | todo!("message");
3333
| ^^^^^^^^^^^^^^^^
3434

3535
error: `todo` should not be present in production code
36-
--> $DIR/panicking_macros.rs:33:5
36+
--> $DIR/panicking_macros.rs:32:5
3737
|
3838
LL | todo!("{} {}", "panic with", "multiple arguments");
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040

4141
error: `unimplemented` should not be present in production code
42-
--> $DIR/panicking_macros.rs:39:5
42+
--> $DIR/panicking_macros.rs:38:5
4343
|
4444
LL | unimplemented!();
4545
| ^^^^^^^^^^^^^^^^
4646
|
4747
= note: `-D clippy::unimplemented` implied by `-D warnings`
4848

4949
error: `unimplemented` should not be present in production code
50-
--> $DIR/panicking_macros.rs:40:5
50+
--> $DIR/panicking_macros.rs:39:5
5151
|
5252
LL | unimplemented!("message");
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^
5454

5555
error: `unimplemented` should not be present in production code
56-
--> $DIR/panicking_macros.rs:41:5
56+
--> $DIR/panicking_macros.rs:40:5
5757
|
5858
LL | unimplemented!("{} {}", "panic with", "multiple arguments");
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

6161
error: usage of the `unreachable!` macro
62-
--> $DIR/panicking_macros.rs:47:5
62+
--> $DIR/panicking_macros.rs:46:5
6363
|
6464
LL | unreachable!();
6565
| ^^^^^^^^^^^^^^
6666
|
6767
= note: `-D clippy::unreachable` implied by `-D warnings`
6868

6969
error: usage of the `unreachable!` macro
70-
--> $DIR/panicking_macros.rs:48:5
70+
--> $DIR/panicking_macros.rs:47:5
7171
|
7272
LL | unreachable!("message");
7373
| ^^^^^^^^^^^^^^^^^^^^^^^
7474

7575
error: usage of the `unreachable!` macro
76-
--> $DIR/panicking_macros.rs:49:5
76+
--> $DIR/panicking_macros.rs:48:5
7777
|
7878
LL | unreachable!("{} {}", "panic with", "multiple arguments");
7979
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8080

8181
error: `panic` should not be present in production code
82-
--> $DIR/panicking_macros.rs:55:5
82+
--> $DIR/panicking_macros.rs:54:5
8383
|
8484
LL | panic!();
8585
| ^^^^^^^^
8686

8787
error: `todo` should not be present in production code
88-
--> $DIR/panicking_macros.rs:56:5
88+
--> $DIR/panicking_macros.rs:55:5
8989
|
9090
LL | todo!();
9191
| ^^^^^^^
9292

9393
error: `unimplemented` should not be present in production code
94-
--> $DIR/panicking_macros.rs:57:5
94+
--> $DIR/panicking_macros.rs:56:5
9595
|
9696
LL | unimplemented!();
9797
| ^^^^^^^^^^^^^^^^
9898

9999
error: usage of the `unreachable!` macro
100-
--> $DIR/panicking_macros.rs:58:5
100+
--> $DIR/panicking_macros.rs:57:5
101101
|
102102
LL | unreachable!();
103103
| ^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)