Skip to content

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

Merged
bors merged 9 commits into
rust-lang:masterfrom
varkor:range-endpoint-overflow-lint
May 1, 2019
Merged

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1#60330
bors merged 9 commits into
rust-lang:masterfrom
varkor:range-endpoint-overflow-lint

Conversation

@varkor

Copy link
Copy Markdown
Contributor

Fixes#47213.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 2019
@varkor
varkorforce-pushed the range-endpoint-overflow-lint branch from ccdf86e to 5574826CompareApril 27, 2019 12:56
@varkor

Copy link
Copy Markdown
ContributorAuthor

r? @estebank

@rust-highfiverust-highfive assigned estebank and unassigned eddybApr 27, 2019
Comment threadsrc/librustc_lint/types.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc_lint/types.rs Outdated

@estebankestebank left a comment

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/librustc_lint/types.rs Outdated
Comment threadsrc/librustc_lint/types.rs Outdated
Comment threadsrc/librustc_lint/types.rs Outdated
@bors

This comment has been minimized.

@varkor
varkorforce-pushed the range-endpoint-overflow-lint branch from 5574826 to 80f90d8CompareApril 30, 2019 22:37
@varkor

Copy link
Copy Markdown
ContributorAuthor

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).

Comment threadsrc/librustc/hir/lowering.rs Outdated
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 1, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit b7711bf has been approved by estebank

@borsbors 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
Fixesrust-lang#47213.
@CentrilCentril mentioned this pull request 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
Fixesrust-lang#47213.
@CentrilCentril mentioned this pull request May 1, 2019
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
Fixesrust-lang#47213.
@CentrilCentril mentioned this pull request May 1, 2019
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:masterMay 1, 2019
@varkor
varkor deleted the range-endpoint-overflow-lint branch May 1, 2019 21:54
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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

@varkor@rust-highfive@bors@estebank@eddyb@Centril