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

Another rollup #48653

Merged
merged 30 commits into from
Mar 2, 2018
Merged

Another rollup #48653

merged 30 commits into from
Mar 2, 2018

Conversation

Manishearth
Copy link
Member

No description provided.

kennytm and 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.

Fixes rust-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)

* Fixed rust-lang-nursery/rust-toolstate#1, a proper link to the PR will be included.
* Fixed rust-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

Fix rust-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.

Closes rust-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 @davidtwco

Fixes rust-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?

Closes rust-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
@Manishearth
Copy link
Member Author

@bors r+ p=9

to land after #48652 (if that fails or passes, either way)

@bors
Copy link
Contributor

bors commented Mar 2, 2018

📌 Commit 2b3c815 has been approved by Manishearth

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 2, 2018
@bors
Copy link
Contributor

bors commented Mar 2, 2018

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

bors added a commit that referenced this pull request Mar 2, 2018
@bors
Copy link
Contributor

bors commented Mar 2, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Manishearth
Pushing 9cb18a9 to master...

@bors bors merged commit 2b3c815 into rust-lang:master Mar 2, 2018
@Manishearth Manishearth deleted the rollup2 branch March 2, 2018 08:56
@kennytm-githubbot
Copy link

📣 Toolstate changed by #48653!

Tested on commit 9cb18a9.
Direct link to PR: #48653

🎉 book on windows: test-fail → test-pass.
🎉 nomicon on windows: test-fail → test-pass.
🎉 reference on windows: test-fail → test-pass.
🎉 rust-by-example on windows: test-fail → test-pass.

kennytm-githubbot added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Mar 2, 2018
Tested on commit rust-lang/rust@9cb18a9.
Direct link to PR: <rust-lang/rust#48653>

🎉 book on windows: test-fail → test-pass.
🎉 nomicon on windows: test-fail → test-pass.
🎉 reference on windows: test-fail → test-pass.
🎉 rust-by-example on windows: test-fail → test-pass.
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup 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.