2021-12-06 05:33:31 -06:00
|
|
|
error: this binding can be a slice pattern to avoid indexing
|
|
|
|
--> $DIR/slice_indexing_in_macro.rs:23:21
|
|
|
|
|
|
|
|
|
LL | if let Some(slice) = slice;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/slice_indexing_in_macro.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::index_refutable_slice)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try using a slice pattern here
|
|
|
|
|
|
|
|
|
LL | if let Some([slice_0, ..]) = slice;
|
|
|
|
| ~~~~~~~~~~~~~
|
|
|
|
help: and replace the index expressions here
|
|
|
|
|
|
|
|
|
LL | println!("{}", slice_0);
|
|
|
|
| ~~~~~~~
|
|
|
|
|
2023-11-21 11:08:42 -06:00
|
|
|
error: aborting due to 1 previous error
|
2021-12-06 05:33:31 -06:00
|
|
|
|