-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Backport of PRs to Beta #25004
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
Merged
Merged
Backport of PRs to Beta #25004
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Conflicts: src/libsyntax/parse/parser.rs
Currently if a standard I/O handle is set to inherited on Windows, no action is taken and the slot in the process information description is set to `INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however, this means that the handle is actually set to nothing and if a child tries to print it will generate an error. This commit fixes this behavior by explicitly creating stdio handles to be placed in these slots by duplicating the current process's I/O handles. This is presumably what previously happened silently by using a file-descriptor-based implementation instead of a `HANDLE`-centric implementation. Along the way this cleans up a lot of code in `Process::spawn` for Windows by ensuring destructors are always run, using more RAII, and limiting the scope of `unsafe` wherever possible.
[breaking-change] What does this break? Basically, code that implements `Drop` and is using `T:Copy` for one of its type parameters and is relying on the Drop Check rule not applying to it. Here is an example: ```rust #![allow(dead_code,unused_variables,unused_assignments)] struct D<T:Copy>(T); impl<T:Copy> Drop for D<T> { fn drop(&mut self) { } } trait UserT { fn c(&self) { } } impl<T:Copy> UserT for T { } struct E<T:UserT>(T); impl<T:UserT> Drop for E<T> { fn drop(&mut self) { } } // This one will start breaking. fn foo() { let (d2, d1); d1 = D(34); d2 = D(&d1); } #[cfg(this_one_does_and_should_always_break)] fn bar() { let (e2, e1); e1 = E(34); e2 = E(&e1); } fn main() { foo(); } ```
use visible characters for the multibyte character filler.
THis includes tests for struct and enum. (I suspect the closure case is actually unreachable, but i see no harm in including it.)
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry pick of the following PRs:
Copy
from special-cased traits #24906MultiByteChar
#24932#[repr(C)]
with Drop #24935