Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1 #60330

Merged
merged 9 commits into from
May 1, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented Apr 27, 2019

Fixes #47213.

@rust-highfive
Copy link
Collaborator

r? @eddyb

(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 Apr 27, 2019
@varkor varkor force-pushed the range-endpoint-overflow-lint branch from ccdf86e to 5574826 Compare April 27, 2019 12:56
@varkor
Copy link
Member Author

varkor commented Apr 27, 2019

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned eddyb Apr 27, 2019
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc_lint/types.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

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

looks good for the most part, with caveat of the style issues that centril pointed out

src/librustc_lint/types.rs Outdated Show resolved Hide resolved
src/librustc_lint/types.rs Show resolved Hide resolved
src/librustc_lint/types.rs Outdated Show resolved Hide resolved
@bors

This comment has been minimized.

@varkor varkor force-pushed the range-endpoint-overflow-lint branch from 5574826 to 80f90d8 Compare April 30, 2019 22:37
@varkor
Copy link
Member Author

varkor commented Apr 30, 2019

I've done the suggested refactoring and pulled several functions out of check_expr (the last commit is probably worth checking in isolation, as it's just moving functions around).

src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
@estebank
Copy link
Contributor

estebank commented May 1, 2019

@bors r+

@bors
Copy link
Contributor

bors commented May 1, 2019

📌 Commit b7711bf has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2019
Centril added a commit to Centril/rust that referenced this pull request May 1, 2019
…, r=estebank

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1

Fixes rust-lang#47213.
Centril added a commit to Centril/rust that referenced this pull request May 1, 2019
…, r=estebank

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1

Fixes rust-lang#47213.
bors added a commit that referenced this pull request May 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #60327 (Search for incompatible universes in borrow errors)
 - #60330 (Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1)
 - #60366 (build-gcc: Create missing cc symlink)
 - #60369 (Support ZSTs in DispatchFromDyn)
 - #60404 (Implement `BorrowMut<str>` for `String`)
 - #60417 (Rename hir::ExprKind::Use to ::DropTemps and improve docs.)
 - #60432 (Update clippy)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request May 1, 2019
…, r=estebank

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1

Fixes rust-lang#47213.
bors added a commit that referenced this pull request May 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #60287 (Use references for variances_of)
 - #60327 (Search for incompatible universes in borrow errors)
 - #60330 (Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1)
 - #60366 (build-gcc: Create missing cc symlink)
 - #60369 (Support ZSTs in DispatchFromDyn)
 - #60404 (Implement `BorrowMut<str>` for `String`)
 - #60417 (Rename hir::ExprKind::Use to ::DropTemps and improve docs.)

Failed merges:

r? @ghost
@bors bors merged commit b7711bf into rust-lang:master May 1, 2019
@varkor varkor deleted the range-endpoint-overflow-lint branch May 1, 2019 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ops::Range::end out of range (overflowing_literals)
6 participants