2021-12-06 05:33:31 -06:00
|
|
|
error: this binding can be a slice pattern to avoid indexing
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/index_refutable_slice/slice_indexing_in_macro.rs:25:21
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | if let Some(slice) = slice;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/index_refutable_slice/slice_indexing_in_macro.rs:1:9
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
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
|
|
|
|