|
| 1 | +error: use `.as_slice()` instead of full range slice |
| 2 | + --> tests/ui/manual_as_slice.rs:11:24 |
| 3 | + | |
| 4 | +LL | let slice: &[u8] = &array[..]; |
| 5 | + | ^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: `-D clippy::manual-as-slice` implied by `-D warnings` |
| 8 | + = help: to override `-D warnings` add `#[allow(clippy::manual_as_slice)]` |
| 9 | +help: try |
| 10 | + | |
| 11 | +LL - let slice: &[u8] = &array[..]; |
| 12 | +LL + let slice: &[u8] = array.as_slice(); |
| 13 | + | |
| 14 | + |
| 15 | +error: use `.as_mut_slice()` instead of full range slice |
| 16 | + --> tests/ui/manual_as_slice.rs:15:28 |
| 17 | + | |
| 18 | +LL | let mut slice: &[u8] = &mut array[..]; |
| 19 | + | ^^^^^^^^^^^^^^ |
| 20 | + | |
| 21 | +help: try |
| 22 | + | |
| 23 | +LL - let mut slice: &[u8] = &mut array[..]; |
| 24 | +LL + let mut slice: &[u8] = array.as_mut_slice(); |
| 25 | + | |
| 26 | + |
| 27 | +error: use `.as_slice()` instead of full range slice |
| 28 | + --> tests/ui/manual_as_slice.rs:18:24 |
| 29 | + | |
| 30 | +LL | let slice: &[u8] = &nested_1::nested_2::SOME_VALUE[..]; |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + | |
| 33 | +help: try |
| 34 | + | |
| 35 | +LL - let slice: &[u8] = &nested_1::nested_2::SOME_VALUE[..]; |
| 36 | +LL + let slice: &[u8] = nested_1::nested_2::SOME_VALUE.as_slice(); |
| 37 | + | |
| 38 | + |
| 39 | +error: use `.as_slice()` instead of full range slice |
| 40 | + --> tests/ui/manual_as_slice.rs:22:24 |
| 41 | + | |
| 42 | +LL | let slice: &[u8] = &slice[..]; |
| 43 | + | ^^^^^^^^^^ |
| 44 | + | |
| 45 | +help: try |
| 46 | + | |
| 47 | +LL - let slice: &[u8] = &slice[..]; |
| 48 | +LL + let slice: &[u8] = slice.as_slice(); |
| 49 | + | |
| 50 | + |
| 51 | +error: use `.as_slice()` instead of full range slice |
| 52 | + --> tests/ui/manual_as_slice.rs:26:24 |
| 53 | + | |
| 54 | +LL | let slice: &[u8] = &slice[..]; |
| 55 | + | ^^^^^^^^^^ |
| 56 | + | |
| 57 | +help: try |
| 58 | + | |
| 59 | +LL - let slice: &[u8] = &slice[..]; |
| 60 | +LL + let slice: &[u8] = slice.as_slice(); |
| 61 | + | |
| 62 | + |
| 63 | +error: use `.as_slice()` instead of full range slice |
| 64 | + --> tests/ui/manual_as_slice.rs:31:13 |
| 65 | + | |
| 66 | +LL | &$a[..] |
| 67 | + | ^^^^^^^ |
| 68 | +... |
| 69 | +LL | perform_the_slice!([1, 2, 3]); |
| 70 | + | ----------------------------- in this macro invocation |
| 71 | + | |
| 72 | + = note: this error originates in the macro `perform_the_slice` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 73 | +help: try |
| 74 | + | |
| 75 | +LL - &$a[..] |
| 76 | +LL + $a.as_slice() |
| 77 | + | |
| 78 | + |
| 79 | +error: use `.as_slice()` instead of full range slice |
| 80 | + --> tests/ui/manual_as_slice.rs:38:24 |
| 81 | + | |
| 82 | +LL | let slice: &[u8] = &vec![1, 2, 3][..]; |
| 83 | + | ^^^^^^^^^^^^^^^^^^ |
| 84 | + | |
| 85 | +help: try |
| 86 | + | |
| 87 | +LL - let slice: &[u8] = &vec![1, 2, 3][..]; |
| 88 | +LL + let slice: &[u8] = vec![1, 2, 3].as_slice(); |
| 89 | + | |
| 90 | + |
| 91 | +error: aborting due to 7 previous errors |
| 92 | + |
0 commit comments