Skip to content

Detect overflow in proc_macro_server subspan - #75146

Merged
bors merged 3 commits into
rust-lang:masterfrom
tmiasko:range-overflow
Sep 16, 2020
Merged

Detect overflow in proc_macro_server subspan#75146
bors merged 3 commits into
rust-lang:masterfrom
tmiasko:range-overflow

Conversation

@tmiasko

@tmiaskotmiasko commented Aug 4, 2020

Copy link
Copy Markdown
Contributor
  • Detect overflow in proc_macro_server subspan
  • Add tests for overflow in Vec::drain
  • Add tests for overflow in String / VecDeque operations using ranges

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @sfackler

(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 Aug 4, 2020
Comment threadlibrary/alloc/src/collections/vec_deque.rs Outdated
@crlf0710crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2020
@bors

bors commented Aug 30, 2020

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Sep 3, 2020

Copy link
Copy Markdown
Collaborator

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

@tmiasko

Copy link
Copy Markdown
ContributorAuthor

r? @Mark-Simulacrum

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@estebank -- I note that the issue suggested that we were unsure about the DWIM semantics you meant (#72237 (comment)).

That said this has been open for a month now and looks reasonable to me; if there are semantics that move us from panicking to not panicking I think that'd relatively (if not perfectly) backwards compatible to move to. I am going to approve it, but we can revert or otherwise pause if necessary.

@bors r+

@bors

bors commented Sep 4, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit e7b0bb0056c268cce0682b99beaf4e2979745245 has been approved by Mark-Simulacrum

@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 Sep 4, 2020
@bors

bors commented Sep 4, 2020

Copy link
Copy Markdown
Collaborator

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout range-overflow(switch to your branch)
  2. git fetch upstream master(retrieve the latest master)
  3. git rebase upstream/master -p(rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self range-overflow --force-with-lease(update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging library/alloc/src/vec.rs
CONFLICT (content): Merge conflict in library/alloc/src/vec.rs
Auto-merging library/alloc/src/string.rs
CONFLICT (content): Merge conflict in library/alloc/src/string.rs
Auto-merging library/alloc/src/collections/vec_deque.rs
CONFLICT (content): Merge conflict in library/alloc/src/collections/vec_deque.rs
Automatic merge failed; fix conflicts and then commit the result.

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 4, 2020
@bors

bors commented Sep 4, 2020

Copy link
Copy Markdown
Collaborator

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

@tmiasko

Copy link
Copy Markdown
ContributorAuthor

The #75207 introduced a new bounds checking API for ranges, and used it to fix
most of overflow issues, making most of changes here unnecessary. It didn't add
any new tests, so I retained those.

@tmiaskotmiasko changed the title Detect overflow in operations using range boundsDetect overflow in proc_macro_server subspanSep 4, 2020
@tmiasko

Copy link
Copy Markdown
ContributorAuthor

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@rustbotrustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 15, 2020
@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2020
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Sep 15, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit f8cfb2f has been approved by Mark-Simulacrum

@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 Sep 15, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2020
Rollup of 10 pull requests
Successful merges:
- rust-lang#73955 (deny(unsafe_op_in_unsafe_fn) in libstd/process.rs)
- rust-lang#75146 (Detect overflow in proc_macro_server subspan)
- rust-lang#75304 (Note when a a move/borrow error is caused by a deref coercion)
- rust-lang#75749 (Consolidate some duplicate code in the sys modules.)
- rust-lang#75882 (Use translated variable for test string)
- rust-lang#75886 (Test that bounds checks are elided for [..index] after .position())
- rust-lang#76048 (Initial support for riscv32gc_unknown_linux_gnu)
- rust-lang#76198 (Make some Ordering methods const)
- rust-lang#76689 (Upgrade to pulldown-cmark 0.8.0)
- rust-lang#76763 (Update cargo)
Failed merges:
r? `@ghost`
@bors

bors commented Sep 16, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit f8cfb2f with merge f4e4485...

@bors
bors merged commit fb9bb2b into rust-lang:masterSep 16, 2020
@rustbotrustbot added this to the 1.48.0 milestone Sep 16, 2020
@tmiasko
tmiasko deleted the range-overflow branch September 16, 2020 07:22
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.

7 participants

@tmiasko@rust-highfive@bors@Mark-Simulacrum@sfackler@crlf0710@rustbot