Skip to content

Rollup of 9 pull requests - #48652

Merged
bors merged 30 commits into
rust-lang:masterfrom
Manishearth:rollup
Mar 2, 2018
Merged

Rollup of 9 pull requests#48652
bors merged 30 commits into
rust-lang:masterfrom
Manishearth:rollup

Conversation

kennytmand others added 30 commits February 23, 2018 03:30
The *.md at the root directory in src/doc are no longer tested, but this
should be fine since all files there are deprecated.
Commit 0bd9667 added bounds checking of our current target byte
position to prevent infinite loops. Unfortunately it was comparing the
file-relative `target` versus the global relative `file_start_pos` and
`file_end_pos`.
The result is failing to detect multibyte characters unless their
file-relative offset fit within their global offset. This causes other
parts of the compiler to generate spans pointing to the middle of a
multibyte character which will ultimately panic in
`bytepos_to_file_charpos`.
Fix by comparing the `target` to the total file size when moving forward
and doing checked subtraction when moving backwards. This should
preserve the intent of the bounds check while removing the offset
confusion.
Fixesrust-lang#48508
This is named for the issue as it's testing the specific details of that
bug. It's a bit tricky as the ICE requires multiple files and debug info
enabled to trigger.
It isn't a valid LLVM feature for this architecture.
This commit is targeted at addressing rust-lang#48251 by specifically fixing a case where
a longjmp over Rust frames on MSVC runs cleanups, accidentally running the
"abort the program" cleanup as well. Added in rust-lang#46833 `extern` ABI functions in
Rust will abort the process if Rust panics, and currently this is modeled as a
normal cleanup like all other destructors.
Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the
same mechanism used to implement panics in Rust. This means that `longjmp` over
Rust frames will run Rust cleanups (even though we don't necessarily want it
to). Notably this means that if you `longjmp` over a Rust stack frame then that
probably means you'll abort the program because one of the cleanups will abort
the process.
After some discussion on IRC it turns out that `longjmp` doesn't run cleanups
for *caught* exceptions, it only runs cleanups for cleanup pads. Using this
information this commit tweaks the codegen for an `extern` function to
a catch-all clause for exceptions instead of a cleanup block. This catch-all is
equivalent to the C++ code:
try {
foo();
} catch (...) {
bar();
}
and in fact our codegen here is designed to match exactly what clang emits for
that C++ code!
With this tweak a longjmp over Rust code will no longer abort the process. A
longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC.
Other non-MSVC platforms will not rust destructors with a longjmp, so we'll
probably still recommend "don't have destructors on the stack", but in any case
this is a more surgical fix than rust-lang#48567 and should help us stick to standard
personality functions a bit longer.
Improve recovery for trailing comma after `..`
…Mark-Simulacrum
Auto-toolstate management follow-up.
Tracking comment: rust-lang#45861 (comment)
* Fixedrust-lang-nursery/rust-toolstate#1, a proper link to the PR will be included.
* Fixedrust-lang-nursery/rust-toolstate#2, a comment will be posted to the PR if the toolstate changed
* Toolstate regression will be rejected at the last week of the 6-week cycle (currently entirely date-based).
* Implemented https://internals.rust-lang.org/t/the-current-submodule-setup-is-not-tenable/6593, moved doc tests of Nomicon, Reference, Rust-by-Example and The Book to the "tools" job and thus allowed to fail like other external tools.
Remove E0245; improve E0404
Fixrust-lang#36337
Somehow this is currently breaking --explain, but I don't understand how.
r? @estebank
Support parentheses in patterns under feature gate
This is a prerequisite for any other extensions to pattern syntax - `|` with multiple patterns, type ascription, `..PAT` in slice patterns.
Closesrust-lang/rfcs#554
…-at-span-bounds-check, r=estebank
Fix find_width_of_character_at_span bounds check
Commit 0bd9667 added bounds checking of our current target byte position to prevent infinite loops. Unfortunately it was comparing the file-relative `target` versus the global `file_start_pos` and `file_end_pos`.
The result is failing to detect multibyte characters unless their file-relative offset fit within their global offset. This causes other parts of the compiler to generate spans pointing to the middle of a
multibyte character which will ultimately panic in `bytepos_to_file_charpos`.
Fix by comparing the `target` to the total file size when moving forward and doing checked subtraction when moving backwards. This should preserve the intent of the bounds check while removing the offset confusion.
cc @davidtwcoFixesrust-lang#48508
rustc: Tweak funclet cleanups of ffi functions
This commit is targeted at addressing rust-lang#48251 by specifically fixing a case where
a longjmp over Rust frames on MSVC runs cleanups, accidentally running the
"abort the program" cleanup as well. Added in rust-lang#46833 `extern` ABI functions in
Rust will abort the process if Rust panics, and currently this is modeled as a
normal cleanup like all other destructors.
Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the
same mechanism used to implement panics in Rust. This means that `longjmp` over
Rust frames will run Rust cleanups (even though we don't necessarily want it
to). Notably this means that if you `longjmp` over a Rust stack frame then that
probably means you'll abort the program because one of the cleanups will abort
the process.
After some discussion on IRC it turns out that `longjmp` doesn't run cleanups
for *caught* exceptions, it only runs cleanups for cleanup pads. Using this
information this commit tweaks the codegen for an `extern` function to
a catch-all clause for exceptions instead of a cleanup block. This catch-all is
equivalent to the C++ code:
try {
foo();
} catch (...) {
bar();
}
and in fact our codegen here is designed to match exactly what clang emits for
that C++ code!
With this tweak a longjmp over Rust code will no longer abort the process. A
longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC.
Other non-MSVC platforms will not rust destructors with a longjmp, so we'll
probably still recommend "don't have destructors on the stack", but in any case
this is a more surgical fix than rust-lang#48567 and should help us stick to standard
personality functions a bit longer.
…h, r=alexcrichton
Stabilize LocalKey::try_with
The `LocalKey::try_with` method is now stabilized.
`LocalKey::state` and `LocalKeyState` marked as deprecated. Although, is there any reason to keep them - should we perhaps remove them completely?
Closesrust-lang#27716
r? @alexcrichton
Fix link to rustc guide in README.md
This is a follow-up to rust-lang#48479 and fixes a minor bug with the link to the rustc guide in the README.
r? @nikomatsakis
cc @mark-i-m
@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 59937bb has been approved by Manishearth

@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 Mar 2, 2018
@Manishearth

Copy link
Copy Markdown
MemberAuthor

@bors r+ p=10

@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 2b3c815 has been approved by Manishearth

@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2b3c815 with merge 9d3360bd784246cbba8c8ebe925d8bb376405417...

@ManishearthManishearth changed the title Rollup of 5 pull requestsRollup of 9 pull requestsMar 2, 2018
@ManishearthManishearth mentioned this pull request Mar 2, 2018
@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 2, 2018
@Manishearth

Copy link
Copy Markdown
MemberAuthor

@bors retry

timeout

@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 Mar 2, 2018
@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2b3c815 with merge 9cb18a9...

@bors
bors merged commit 2b3c815 into rust-lang:masterMar 2, 2018
@bors

bors commented Mar 2, 2018

Copy link
Copy Markdown
Collaborator

💥 Test timed out

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 2, 2018
@Manishearth

Copy link
Copy Markdown
MemberAuthor

@bors r-

you confused

@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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2018
@kennytm

Copy link
Copy Markdown
Member

@bors clean retry r-

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 3, 2018
@CentrilCentril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollupA PR which is a rollupS-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.

13 participants

@Manishearth@rust-highfive@bors@kennytm@Centril@petrochenkov@etaoins@ishitatsuyuki@Amanieu@nikomatsakis@mark-i-m@alexcrichton@teiesti