Skip to content

Move range_minus_one to pedantic - #5752

Merged
bors merged 4 commits into
rust-lang:masterfrom
chrisduerr:pedantic_ranges
Jul 13, 2020
Merged

Move range_minus_one to pedantic#5752
bors merged 4 commits into
rust-lang:masterfrom
chrisduerr:pedantic_ranges

Conversation

@chrisduerr

@chrisduerr chrisduerr commented Jun 26, 2020

Copy link
Copy Markdown
Contributor

This moves the range_minus_one lint to the pedantic category, so there
will not be any warnings emitted by default. This should work around
problems where the suggestion is impossible to resolve due to the range
consumer only accepting a specific range implementation, rather than the
RangeBounds trait (see #3307).

While it is possible to work around this by extracting the boundary into
a variable, I don't think clippy should encourage people to disable or
work around lints, but instead the lints should be fixable. So hopefully
this will help until a proper implementation checks what the range is
used for.

Please keep the line below
changelog: move [range_minus_one] to pedantic

@rust-highfive

Copy link
Copy Markdown

r? @flip1995

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 26, 2020

@flip1995 flip1995 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to run cargo dev update_lints

@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jul 3, 2020
@bors

bors commented Jul 6, 2020

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #5301) made this pull request unmergeable. Please resolve the merge conflicts.

This moves the range_minus_one lint to the pedantic category, so there
will not be any warnings emitted by default. This should work around
problems where the suggestion is impossible to resolve due to the range
consumer only accepting a specific range implementation, rather than the
`RangeBounds` trait (see rust-lang#3307).

While it is possible to work around this by extracting the boundary into
a variable, I don't think clippy should encourage people to disable or
work around lints, but instead the lints should be fixable. So hopefully
this will help until a proper implementation checks what the range is
used for.
@chrisduerr
chrisduerr requested a review from flip1995 July 10, 2020 16:08
@flip1995

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jul 13, 2020

Copy link
Copy Markdown
Contributor

📌 Commit afa4148 has been approved by flip1995

@bors

bors commented Jul 13, 2020

Copy link
Copy Markdown
Contributor

⌛ Testing commit afa4148 with merge 9d381da...

bors added a commit that referenced this pull request Jul 13, 2020
Move range_minus_one to pedantic

This moves the range_minus_one lint to the pedantic category, so there
will not be any warnings emitted by default. This should work around
problems where the suggestion is impossible to resolve due to the range
consumer only accepting a specific range implementation, rather than the
`RangeBounds` trait (see #3307).

While it is possible to work around this by extracting the boundary into
a variable, I don't think clippy should encourage people to disable or
work around lints, but instead the lints should be fixable. So hopefully
this will help until a proper implementation checks what the range is
used for.

*Please keep the line below*
changelog: move [`range_minus_one`] to pedantic
@bors

bors commented Jul 13, 2020

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-action_test

@flip1995

Copy link
Copy Markdown
Member

@bors rollup=always

@flip1995

Copy link
Copy Markdown
Member

@bors retry

flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Jul 13, 2020
Move range_minus_one to pedantic

This moves the range_minus_one lint to the pedantic category, so there
will not be any warnings emitted by default. This should work around
problems where the suggestion is impossible to resolve due to the range
consumer only accepting a specific range implementation, rather than the
`RangeBounds` trait (see rust-lang#3307).

While it is possible to work around this by extracting the boundary into
a variable, I don't think clippy should encourage people to disable or
work around lints, but instead the lints should be fixable. So hopefully
this will help until a proper implementation checks what the range is
used for.

*Please keep the line below*
changelog: move [`range_minus_one`] to pedantic
This was referenced Jul 13, 2020
@flip1995 flip1995 added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Jul 13, 2020
bors added a commit that referenced this pull request Jul 13, 2020
Rollup of 5 pull requests

Successful merges:

 - #5443 (Some accuracy lints for floating point operations)
 - #5752 (Move range_minus_one to pedantic)
 - #5756 (unnecessary_sort_by: avoid linting if key borrows)
 - #5784 (Fix out of bounds access by checking length equality BEFORE accessing by index.)
 - #5786 (fix phrase in new_lint issue template)

Failed merges:

r? @ghost

changelog: rollup
@bors
bors merged commit 019e281 into rust-lang:master Jul 13, 2020
@chrisduerr
chrisduerr deleted the pedantic_ranges branch July 13, 2020 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: The marked PR was approved and is only waiting bors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants