Skip to content

Commit 54a0a52

Browse files
committed
Add run-rustfix marker
1 parent 503fd56 commit 54a0a52

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

clippy_lints/src/manual_slice_size_calculation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// run-rustfix
12
use clippy_utils::diagnostics::span_lint_and_sugg;
23
use clippy_utils::source::snippet_with_context;
34
use clippy_utils::{expr_or_init, in_constant};

tests/ui/manual_slice_size_calculation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// run-rustfix
12
#![allow(unused)]
23
#![warn(clippy::manual_slice_size_calculation)]
34

tests/ui/manual_slice_size_calculation.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error: manual slice size calculation
2-
--> $DIR/manual_slice_size_calculation.rs:11:13
2+
--> $DIR/manual_slice_size_calculation.rs:12:13
33
|
44
LL | let _ = s_i32.len() * size_of::<i32>(); // WARNING
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
66
|
77
= note: `-D clippy::manual-slice-size-calculation` implied by `-D warnings`
88

99
error: manual slice size calculation
10-
--> $DIR/manual_slice_size_calculation.rs:12:13
10+
--> $DIR/manual_slice_size_calculation.rs:13:13
1111
|
1212
LL | let _ = size_of::<i32>() * s_i32.len(); // WARNING
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
1414

1515
error: manual slice size calculation
16-
--> $DIR/manual_slice_size_calculation.rs:13:13
16+
--> $DIR/manual_slice_size_calculation.rs:14:13
1717
|
1818
LL | let _ = size_of::<i32>() * s_i32.len() * 5; // WARNING
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
2020

2121
error: manual slice size calculation
22-
--> $DIR/manual_slice_size_calculation.rs:17:13
22+
--> $DIR/manual_slice_size_calculation.rs:18:13
2323
|
2424
LL | let _ = len * size_of::<i32>(); // WARNING
2525
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
2626

2727
error: manual slice size calculation
28-
--> $DIR/manual_slice_size_calculation.rs:18:13
28+
--> $DIR/manual_slice_size_calculation.rs:19:13
2929
|
3030
LL | let _ = s_i32.len() * size; // WARNING
3131
| ^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
3232

3333
error: manual slice size calculation
34-
--> $DIR/manual_slice_size_calculation.rs:19:13
34+
--> $DIR/manual_slice_size_calculation.rs:20:13
3535
|
3636
LL | let _ = len * size; // WARNING
3737
| ^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`

0 commit comments

Comments
 (0)