`single_range_in_vec_init` should detect all kind of ranges
Description
Right now, it looks like only a..b ranges are recognized. ..a, a.., and a..=b won't trigger the lint.
clippy_utils::higher::Range might be useful here.
Version
rustc 1.95.0-nightly (366a1b93e 2026-02-03)
binary: rustc
commit-hash: 366a1b93e7f466ebe559477add05f064873d0c71
commit-date: 2026-02-03
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 22.1.0
Additional Labels
No response
Possible reproducer: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=ed39f90831f528bc21f5db251ca604c6
From the reddit thread where the bug was discussed: https://www.reddit.com/r/rust/s/OyVxUVoahT
Possible reproducer: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=ed39f90831f528bc21f5db251ca604c6
I would even expect single_element_loop in this example. A better reproducer for the current issue would be akin _ = [..10];.
@rustbot claim
Hi @samueltardieu ! I’m interested in working on this issue.
Is it still open and looking for a contribution?
Sure
Hi!
@samueltardieu If Carlos is done with it, would it be okay for me to take over?
If Carlos is done with it, would it be okay for me to take over?
Sure!
@rustbot claim
@rustbot claim, Hi @zayutaha @samueltardieu I am interested in helping with this. I see this is currently assigned, so I do not want to duplicate work. If the assignee is no longer working on it, I can pick up the task.
Error: Parsing assign command in comment failed: expected end of command when parsing: claim[!], Hi @zayu
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.
Hi @arunsingh, they didn’t respond to the pull request, which is why there hasn’t been any activity. I’m going to give it another try, and if they still don’t respond, you can have it.
Hi @arunsingh, I reached out again but didn’t get a response, so I think it makes sense to hand this over. Feel free to pick it up if you’d still like to work on it.
thanks @zayutaha, fine I will take this issue