rust/tests
llogiq cd61be7c56
Fix sliced_string_as_bytes FP with a RangeFull (#15873)
changelog: [`sliced_string_as_bytes`]: don't fire on
`str[..].as_bytes()`

So I ran into this in some codebase I was working on,
where the lint fired on this line:
```rust
let string: &str;
string[..].as_bytes()
```
So I was trying to understand the rationale behind this lint, and it
says:
> It involves doing an unnecessary UTF-8 alignment check which is less
efficient, and can cause a panic.

This is obviously not true in the case where a `RangeFull` slice is
being taken, since there is no UTF-8 boundary check, and no panic can be
caused. So I created an exemption for `RangeFull`s.

Two other notes:
1. I'm not sure the word "alignment" in the lint's description (quoted
above) is really correct, should probably say "char boundary" instead?
2. I might be missing something, but isn't there a lint for doing
superfluous slice indexing, and then calling a slice method? e.g.
`str[..].len()` or `slice[..].len()`, where `str` and `slice` are `&str`
and `&[T]`, respectively. If we had one, I would expect *it* to fire for
the example code I quoted above.
2025-11-15 08:53:12 +00:00
..
test_utils
ui Fix sliced_string_as_bytes FP with a RangeFull (#15873) 2025-11-15 08:53:12 +00:00
ui-cargo Merge commit 'd9fb15c4b1' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
ui-internal Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
ui-toml Merge commit 'c936595d17' into clippy-subtree-update 2025-10-31 19:15:42 +01:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Merge commit 'd9fb15c4b1' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
config-consistency.rs Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
config-metadata.rs
dogfood.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
integration.rs Merge commit '0450db33a5' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
lint_message_convention.rs
missing-test-files.rs Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
no-profile-in-cargo-toml.rs Merge commit '20ce69b9a6' into clippy-subtree-update 2025-09-18 17:21:44 +02:00
symbols-used.rs Merge commit 'd9fb15c4b1' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
versioncheck.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
workspace.rs