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

Rollup of 3 pull requests #70676

Closed
wants to merge 11 commits into from

Commits on Mar 22, 2020

  1. Configuration menu
    Copy the full SHA
    4582c14 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2020

  1. Make the rustc respect the -C codegen-units flag in incremental mode.

    Before this commit `-C codegen-units` would just get silently be
    ignored if `-C incremental` was specified too. After this commit
    one can control the number of codegen units generated during
    incremental compilation. The default is rather high at 256, so most
    crates won't see a difference unless explicitly opting into a lower
    count.
    michaelwoerister committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    1e5b459 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    408e6e3 View commit details
    Browse the repository at this point in the history
  3. Fix double-free and undefined behaviour in libstd::syn::unix::Thread:…

    …:new.
    Vytautas Astrauskas committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    64e5327 View commit details
    Browse the repository at this point in the history
  4. Inline start_thread into its callers.

    Vytautas Astrauskas committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    753bc7d View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2020

  1. Use Box::into_raw instead of ManuallyDrop in Thread::new.

    Vytautas Astrauskas committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    5382347 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    98ead3e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    baa6d55 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#70156 - michaelwoerister:incr-cgus, r=nikom…

    …atsakis
    
    Make the rustc respect the `-C codegen-units` flag in incremental mode.
    
    This PR implements (the as of yet unapproved) major change proposal at rust-lang/compiler-team#245. See the description there for background and rationale.
    
    The changes are pretty straightforward and should be easy to rebase if the proposal gets accepted at some point.
    
    r? @nikomatsakis cc @pnkfelix
    Dylan-DPC authored Apr 1, 2020
    Configuration menu
    Copy the full SHA
    d4a0f7e View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#70281 - xfix:infallible-hash, r=dtolnay

    Implement Hash for Infallible
    
    https://www.reddit.com/r/rust/comments/fmllgx/never_crate_stable_alternative_to/ lists not implementing `Hash` as a reason for the `never` crate. I see no reason not to implement `Hash` for `Infallible`, so might as well do it.
    
    No changes necessary for `!`, because `!` already implements `Hash` (see rust-lang#51404).
    Dylan-DPC authored Apr 1, 2020
    Configuration menu
    Copy the full SHA
    a03fe9e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#70597 - vakaras:thread_new_double_free_bug_…

    …fix, r=Amanieu
    
    Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new
    
    While working on concurrency support for Miri, I found that the `libstd::syn::unix::Thread::new` method has two potential problems: double-free and undefined behaviour.
    
    **Double-free** could occur if the following events happened (credit for pointing this out goes to @RalfJung):
    
    1.  The call to `pthread_create` successfully launched a new thread that executed to completion and deallocated `p`.
    2.  The call to `pthread_attr_destroy` returned a non-zero value causing the `assert_eq!` to panic.
    3.  Since `mem::forget(p)` was not yet executed, the destructor of `p` would be executed and cause a double-free.
    
    As far as I understand, this code also violates the stacked-borrows aliasing rules and thus would result in **undefined behaviour** if these rules were adopted.  The problem is that the ownership of `p` is passed to the newly created thread before the call to `mem::forget`. Since the call to `mem::forget` is still a call, it counts as a use of `p` and triggers UB.
    
    This pull request changes the code to use `mem::ManuallyDrop` instead of `mem::forget`. As a consequence, in case of a panic, `p` would be potentially leaked, which while undesirable is probably better than double-free or undefined behaviour.
    Dylan-DPC authored Apr 1, 2020
    Configuration menu
    Copy the full SHA
    1cdf210 View commit details
    Browse the repository at this point in the history