Skip to content

Conversation

@IoaNNUwU
Copy link
Contributor

@IoaNNUwU IoaNNUwU commented Oct 22, 2025

Fixes: #147944

fn main() {
    let mut vec = vec![1, 2, 3, 4, 5];
    vec.drain([..3]);
}

Using array of 1 range instead of range itself as argument of impl RangeBounds now additionally produces this suggestion:

help: consider removing `[]`
   |
LL -     vec.drain([..3]);
LL +     vec.drain(..3);
   |

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 22, 2025

r? @madsmtm

rustbot has assigned @madsmtm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggest removing [] for array of 1 RangeBounds arguments.

3 participants