about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-16 17:25:25 +0000
committerbors <bors@rust-lang.org>2023-02-16 17:25:25 +0000
commiteac0bd9da39154f53d3251b19e6d5690332a5529 (patch)
tree19ea914b8826aed21163aed2943f9fb5a53a8027 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
parentbe7477381ba0327c0972c850e2428ee31e2cc7b8 (diff)
parent7e53e27dfdb5ce4cda44912fcc6c288c34ac7d91 (diff)
downloadrust-eac0bd9da39154f53d3251b19e6d5690332a5529.tar.gz
rust-eac0bd9da39154f53d3251b19e6d5690332a5529.zip
Auto merge of #10361 - nindalf:nth_bytes_copy, r=llogiq
Stop bytes_nth from suggesting code that does not compile

Fixes #10151

As discussed in the issue, this PR changes the lint in 2 ways

1. Replace `bytes().nth(n).unwrap()` with `as_bytes()[n]`
2. Replace other `bytes().nth(n)` with `as_bytes().get(n).copied()`

---

changelog: Stop bytes_nth from suggesting code that does not compile in some cases
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff')
0 files changed, 0 insertions, 0 deletions