rust/tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr

23 lines
715 B
Plaintext
Raw Normal View History

error: this binding can be a slice pattern to avoid indexing
2024-02-17 06:16:29 -06:00
--> tests/ui/index_refutable_slice/slice_indexing_in_macro.rs:23:21
|
LL | if let Some(slice) = slice;
| ^^^^^
|
note: the lint level is defined here
2024-02-17 06:16:29 -06:00
--> tests/ui/index_refutable_slice/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);
| ~~~~~~~
error: aborting due to 1 previous error