about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/full-path-function.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-29 13:20:59 +0000
committerbors <bors@rust-lang.org>2023-11-29 13:20:59 +0000
commit8b0bf6423dfaf5545014db85fcba7bc745beed4c (patch)
tree2ded0fa3faedbbcc8d3f6cd2680f3982f9da9b2b /tests/rustdoc-js-std/full-path-function.js
parent57397a5190ba1b7a5a241ead090702b56959b025 (diff)
parent8f9c738ce9b8912571761ac08e50585a77d270c3 (diff)
downloadrust-8b0bf6423dfaf5545014db85fcba7bc745beed4c.tar.gz
rust-8b0bf6423dfaf5545014db85fcba7bc745beed4c.zip
Auto merge of #11818 - y21:more_redundant_guards, r=llogiq
[`redundant_guards`]: catch `is_empty`, `starts_with` and `ends_with` on slices and `str`s

Fixes #11807

Few things worth mentioning:
- Taking `snippet`s is now done at callsite, instead of passing a span and doing it in `emit_redundant_guards`. This is because we now need custom suggestion strings in certain places, like `""` for `str::is_empty`.
- This now uses `snippet` instead of `snippet_with_applicability`. I don't think this really makes any difference for `MaybeIncorrect`, though?
- This could also lint byte strings, as they're of type `&[u8; N]`, but that can be ugly so I decided to leave it out for now

changelog: [`redundant_guards`]: catch `str::is_empty`, `slice::is_empty`, `slice::starts_with` and `slice::ends_with`
Diffstat (limited to 'tests/rustdoc-js-std/full-path-function.js')
0 files changed, 0 insertions, 0 deletions