about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2025-01-02 18:30:38 +0000
committerGitHub <noreply@github.com>2025-01-02 18:30:38 +0000
commit631d9a2c5cb5136705c7003e3d7681457156addf (patch)
tree2092ad567ca5ca6fd0aa18e70231c141467a98ea /compiler/rustc_codegen_gcc
parent034f3d224ca797ecc7c92ece4d87c94df6afed02 (diff)
parentd67c00f7232b104817cd30f76ad7089a3be5a389 (diff)
downloadrust-631d9a2c5cb5136705c7003e3d7681457156addf.tar.gz
rust-631d9a2c5cb5136705c7003e3d7681457156addf.zip
Add lint for calling `Iterator::last()` on `DoubleEndedIterator` (#13922)
I [recently realized that `.last()` might not call `next_back()` when it
is
available](https://qsantos.fr/2025/01/01/rust-gotcha-last-on-doubleendediterator/).
Although the implementor could make sure to implement `last()` to do so,
this is not what will happen by default. As a result, I think it is
useful to add a lint to promote using `.next_back()` over `.last()` on
`DoubleEndedIterator`.

If this is merged, we might want to close #1822.

changelog: [`double_ended_iterator_last`]: Add lint for calling
`Iterator::last()` on `DoubleEndedIterator`
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions