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 8 pull requests #70711

Closed
wants to merge 21 commits into from
Closed

Commits on Mar 29, 2020

  1. Stabilize float::to_int_unchecked

    This renames and stabilizes unsafe floating point to integer casts, which are
    intended to be the substitute for the currently unsound `as` behavior, once that
    changes to safe-but-slower saturating casts.
    Mark-Simulacrum committed Mar 29, 2020
    Configuration menu
    Copy the full SHA
    5614721 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2020

  1. 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
  2. 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
    baa6d55 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2020

  1. Configuration menu
    Copy the full SHA
    f87afec View commit details
    Browse the repository at this point in the history
  2. Remove unused discriminant reads from MIR bodies

    Allow the `SimplifyLocals` pass to remove reads of discriminants if the
    read is never used.
    wesleywiser committed Apr 2, 2020
    Configuration menu
    Copy the full SHA
    75e2e8c View commit details
    Browse the repository at this point in the history
  3. Improve docs in AllocRef

    TimDiekmann committed Apr 2, 2020
    Configuration menu
    Copy the full SHA
    0b61239 View commit details
    Browse the repository at this point in the history
  4. Remove stack overflow handler stub for wasm.

    Vytautas Astrauskas committed Apr 2, 2020
    Configuration menu
    Copy the full SHA
    ec8275c View commit details
    Browse the repository at this point in the history
  5. Remove unnecessary intermediate pointer cast in Thread::new.

    Vytautas Astrauskas committed Apr 2, 2020
    Configuration menu
    Copy the full SHA
    1c1bd95 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    65fcc3f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e992565 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    354ddbf View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#70487 - Mark-Simulacrum:float-unchecked-cas…

    …ts, r=SimonSapin
    
    Stabilize float::to_int_unchecked
    
    This renames and stabilizes unsafe floating point to integer casts, which are intended to be the substitute for the currently unsound `as` behavior, once that changes to safe-but-slower saturating casts. As such, I believe this also likely unblocks rust-lang#10184 (our oldest I-unsound issue!), as once this rolls out to stable it would be far easier IMO to change the behavior of `as` to be safe by default.
    
    This does not stabilize the trait or the associated method, as they are deemed internal implementation details (and consumers should not, generally, want to expose them, as in practice all callers likely know statically/without generics what the return type is).
    
    Closes rust-lang#67058
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    29b3739 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#70595 - wesleywiser:remove_unused_discrimin…

    …ant_reads, r=oli-obk
    
    Remove unused discriminant reads from MIR bodies
    
    Allow the `SimplifyLocals` pass to remove reads of discriminants if the
    read is never used.
    
    Fixes rust-lang#70531
    
    r? @oli-obk
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    b205742 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#70597 - vakaras:thread_new_double_free_bug_…

    …fix, r=Amanieu,RalfJung
    
    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.
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    7ba229f View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#70691 - TimDiekmann:allocref-docs, r=RalfJung

    Improve docs in `AllocRef`
    
    r? @RalfJung
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    921dcaf View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#70694 - lzutao:self, r=Centril

    Use Self over specific type in return position
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    8827750 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#70698 - nikomatsakis:x-py-json-output, r=Ma…

    …rk-Simulacrum
    
    bootstrap: add `--json-output` for rust-analyzer
    
    Motivation is that this allows us to customize rust-analyzer's "cargo watch" integration to run x.py. You simply have to set the command to run to be `x.py --json-output`
    
    r? @Mark-Simulacrum -- feel free to make changes, this is quick and dirty for sure
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    d644a24 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#70700 - jrvidal:include-macro-paths, r=Dyla…

    …n-DPC
    
    Expand on platform details of `include_xxx` macros
    
    This is a small detail that is not explicitly mentioned, but it left me scratching my head for a while until I looked into its implementation details. Maybe worth mentioning.
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    8a8abc6 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#70708 - Pocakking:fix-ascii-case-conv-typo,…

    … r=sfackler
    
    Fix typo in u8::to_ascii_uppercase and u8::to_ascii_lowercase
    
    Corrects misspelling of fifth.
    Centril authored Apr 2, 2020
    Configuration menu
    Copy the full SHA
    6436059 View commit details
    Browse the repository at this point in the history