Extend byte_char_slices to cover arrays#16770
Conversation
|
rustbot has assigned @samueltardieu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Lintcheck changes for d0c0f3a
This comment will be updated if you push new changes |
|
I wonder whether it would be interesting to see how this array is then used. If all uses are adjusted and auto-dereferenced, then suggesting |
|
Agree. |
|
Implemented. The lint is now moved to late pass. I also avoid arrays with comments or cfg, looking into the lint check results. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Could you also add some more tests? Like:
let with_escape: u8 = [b'\'', b'"', b'\x00', b'\n', b'\\'].iter().copied().sum();
//~^ byte_char_slices
takes_array_ref(&[b'a', b'b']);
//~^ byte_char_slices
takes_array_ref_ref(&&[b'a', b'b']);
//~^ byte_char_slices
}
fn takes_array_ref(_: &[u8; 2]) {}
fn takes_array_ref_ref(_: &&[u8; 2]) {}
This comment has been minimized.
This comment has been minimized.
byte_char_slices FN on arraysbyte_char_slices to cover arrays
|
Done. Thank you! |
This comment has been minimized.
This comment has been minimized.
|
@profetia Tell me when you've rebased it and I'll merge it. |
|
Also, can you invert the order of the two commits? This would make sure that tests pass after every commit, whereas in the current situation after the first commit tests won't pass. |
714608c to
d0c0f3a
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I have been quite busy lately. Big thanks for help working on this :) |
Closes #16759
changelog: [
byte_char_slices] enhance to cover arrays