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 17 pull requests #76988

Closed
wants to merge 61 commits into from

Commits on Aug 10, 2020

  1. Configuration menu
    Copy the full SHA
    b1375cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a22b21 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2020

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

Commits on Sep 9, 2020

  1. Fix segfault if pthread_getattr_np fails

    glibc destroys[1] the passed pthread_attr_t if pthread_getattr_np()
    fails.  Destroying it again leads to a segfault.  Fix it by only
    destroying it on success for glibc.
    
    [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getattr_np.c;h=ce437205e41dc05653e435f6188768cccdd91c99;hb=HEAD#l205
    tavianator committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    a06edda View commit details
    Browse the repository at this point in the history
  2. Only call pthread_attr_destroy() after getattr_np() succeeds on all l…

    …ibcs
    
    The calling convention of pthread_getattr_np() is to initialize the
    pthread_attr_t, so _destroy() is only necessary on success (and _init()
    isn't necessary beforehand).  On the other hand, FreeBSD wants the
    attr_t to be initialized before pthread_attr_get_np(), and therefore it
    should always be destroyed afterwards.
    tavianator committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    a684153 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2020

  1. Make some methods of Pin unstable const

    Make the following methods unstable const under the `const_pin` feature:
    - `new`
    - `new_unchecked`
    - `into_inner`
    - `into_inner_unchecked`
    - `get_ref`
    - `into_ref`
    
    Also adds tests for these methods in a const context.
    
    Tracking issue: rust-lang#76654
    CDirkx committed Sep 12, 2020
    Configuration menu
    Copy the full SHA
    8f27e3c View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2020

  1. Fix rust-lang#76432

    Only insert StorageDeads if we actually removed one.
    Fixes an issue where we added StorageDead to a place with no StorageLive
    simonvandel committed Sep 13, 2020
    Configuration menu
    Copy the full SHA
    e5447a2 View commit details
    Browse the repository at this point in the history
  2. MIR pass to remove unneeded drops on types not needing drop

    This is heavily dependent on MIR inlining running to actually see the drop statement
    simonvandel committed Sep 13, 2020
    Configuration menu
    Copy the full SHA
    9c5d0c1 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. Suggestion from review

    Co-authored-by: Andreas Jonson <andjo403@users.noreply.github.com>
    simonvandel and andjo403 authored Sep 14, 2020
    Configuration menu
    Copy the full SHA
    9d47ecf View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2020

  1. Only get ImplKind::Impl once

    tesuji committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    eede953 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed6c7ef View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c3607bd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e4edc16 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    81b3b66 View commit details
    Browse the repository at this point in the history
  6. Bless miri-unleashed tests

    `const_mut_refs` doesn't actually work in a `const` or `static`
    ecstatic-morse committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    1e1257b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    abc7167 View commit details
    Browse the repository at this point in the history
  8. Pass --target to lint docs

    Otherwise, we may not have a standard library built for the native "host" target
    of the rustc being run.
    Mark-Simulacrum committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    7e24136 View commit details
    Browse the repository at this point in the history
  9. Build rustdoc for cross-compiled targets

    This isn't an issue for most folks who use x.py dist, which will directly depend
    on this. But for x.py build, if we don't properly set target here rustdoc will
    not be built.
    
    Currently, there is not a default-on step for generating a rustc for a given
    target either, so we will fail to build a rustc as well.
    Mark-Simulacrum committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    bd4e0af View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. Remove redundant to_string

    zzau13 committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    7b5d983 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    363aff0 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2020

  1. Configuration menu
    Copy the full SHA
    28cfa97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4675a31 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bffd211 View commit details
    Browse the repository at this point in the history
  4. Fix broken link

    poliorcetics committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    982ec0d View commit details
    Browse the repository at this point in the history
  5. Fix broken link

    poliorcetics committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    b534d9f View commit details
    Browse the repository at this point in the history
  6. Make some methods of Pin<&mut T> unstable const

    Make the following methods unstable const under the `const_pin` feature:
    - `into_ref`
    - `get_mut`
    - `get_unchecked_mut`
    CDirkx committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    e3c6e46 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2020

  1. Configuration menu
    Copy the full SHA
    673935f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    30dd6cf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    804f673 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    924cd13 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    af1e363 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ca15e9d View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2020

  1. Configuration menu
    Copy the full SHA
    2a00dda View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6734230 View commit details
    Browse the repository at this point in the history
  3. update stderr file

    lcnr committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    65b3419 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cebbd9f View commit details
    Browse the repository at this point in the history
  5. Use as_secs_f64 in profiling.rs

    est31 committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    43193dc View commit details
    Browse the repository at this point in the history
  6. Replace write_fmt with write!

    Latter is simpler
    est31 committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    4bc0e55 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0e56b52 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    08b85a6 View commit details
    Browse the repository at this point in the history
  9. Add non-unsafe .get_mut() for UnsafeCell

    Update the tracking issue number
    
    Updated the documentation for `UnsafeCell`
    
    Address review comments
    
    Address more review comments + minor changes
    danielhenrymantilla committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    8169989 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5886c38 View commit details
    Browse the repository at this point in the history
  11. Fix nits

    poliorcetics committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    aaddcdb View commit details
    Browse the repository at this point in the history
  12. Add sample defaults for config.toml

    - Allow including defaults in `src/bootstrap/defaults` using `profile = "..."`
    - Add default config files
    - Combine config files using the merge dependency.
    - Add comments to default config files
    - Add a README asking to open an issue if the defaults are bad
    - Give a loud error if trying to merge `.target`, since it's not
      currently supported
    - Use an exhaustive match
    - Use `<none>` in config.toml.example to avoid confusion
    - Fix bugs in `Merge` derives
    
    Previously, it would completely ignore the profile defaults if there
    were any settings in `config.toml`. I sent an email to the `merge` maintainer
    asking them to make the behavior in this commit the default.
    
    This introduces a new dependency on `merge` that hasn't yet been vetted.
    
    I want to improve the output when `include = "x"` isn't found:
    
    ```
    thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy
    Build completed unsuccessfully in 0:00:00
    ```
    
    However that seems like it could be fixed in a follow-up.
    jyn514 committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    c9c8fb8 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2020

  1. Rollup merge of rust-lang#74225 - poliorcetics:std-thread-unsafe-op-i…

    …n-unsafe-fn, r=joshtriplett
    
    Std/thread: deny unsafe op in unsafe fn
    
    Partial fix of rust-lang#73904.
    
    This encloses `unsafe` operations in `unsafe fn` in `libstd/thread`.
    @rustbot modify labels: F-unsafe-block-in-unsafe-fn
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    7e86f01 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#75974 - SkiFire13:peekmut-opt-sift, r=Lukas…

    …Kalbertodt
    
    Avoid useless sift_down when std::collections::binary_heap::PeekMut is never mutably dereferenced
    
    If `deref_mut` is never called then it's not possible for the element to be mutated without internal mutability, meaning there's no need to call `sift_down`.
    
    This could be a little improvement in cases where you want to mutate the biggest element of the heap only if it satisfies a certain predicate that needs only read access to the element.
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    d125cba View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#76521 - tavianator:fix-pthread-getattr-dest…

    …roy, r=Amanieu
    
    Fix segfault if pthread_getattr_np fails
    
    glibc [destroys][1] the passed pthread_attr_t if pthread_getattr_np()
    fails.  Destroying it again leads to a segfault.  Fix it by only
    destroying it on success for glibc.
    
    [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getattr_np.c;h=ce437205e41dc05653e435f6188768cccdd91c99;hb=HEAD#l205
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    d4f73be View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#76581 - lcnr:bound-too-generic, r=eddyb

    do not ICE on bound variables, return `TooGeneric` instead
    
    fixes rust-lang#73260, fixes rust-lang#74634, fixes rust-lang#76595
    
    r? @nikomatsakis
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    27b30cd View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#76628 - jyn514:default-config-files, r=Mark…

    …-Simulacrum
    
    Add sample defaults for config.toml
    
    - Allow including defaults in `src/bootstrap/defaults` using `profile = "..."`.
    - Add default config files, with a README noting they're experimental and asking you to open an issue if you run into trouble. The config files have comments explaining why the defaults are set.
    - Combine config files using the `merge` dependency.
    
    This introduces a new dependency on `merge` that hasn't yet been vetted.
    
    I want to improve the output when `include = "x"` isn't found:
    
    ```
    thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy
    Build completed unsuccessfully in 0:00:00
    ```
    
    However that seems like it could be fixed in a follow-up.
    
    Closes rust-lang#76619
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    f820b58 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#76655 - CDirkx:const-pin, r=ecstatic-morse

    Make some methods of `Pin` unstable const
    
    Make the following methods unstable const under the `const_pin` feature:
    - `new`
    - `new_unchecked`
    - `into_inner`
    - `into_inner_unchecked`
    - `get_ref`
    - `into_ref`
    - `get_mut`
    - `get_unchecked_mut`
    
    Of these, `into_inner` and `into_inner_unchecked` require the unstable `const_precise_live_drops`.
    
    Also adds tests for these methods in a const context.
    
    Tracking issue: rust-lang#76654
    
    r? @ecstatic-morse
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    b6d50d1 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#76659 - simonvandel:76432, r=oli-obk

    SimplifyComparisonIntegral: fix miscompilation
    
    Fixes rust-lang#76432
    Only insert StorageDeads if we actually removed one.
    Fixes an issue where we added StorageDead to a place with no StorageLive
    
    r? @oli-obk
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    cc7258a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#76673 - simonvandel:remove-unneeded-drops, …

    …r=oli-obk
    
    MIR pass to remove unneeded drops on types not needing drop
    
    This is heavily dependent on MIR inlining running to actually see the drop statement.
    
    Do we want to special case replacing a call to std::mem::drop with a goto aswell?
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    4c51474 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#76783 - lzutao:rd_impl_kind, r=GuillaumeGomez

    Only get ImplKind::Impl once
    
    With this, the code panics in one place instead of two.
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    0da8ede View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#76799 - Mark-Simulacrum:fix-cross-compile-d…

    …ist, r=alexcrichton
    
    Fix cross compiling dist/build invocations
    
    I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build.
    
    Both commits are standalone; together they should resolve rust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    a9d2a35 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#76807 - ecstatic-morse:const-checking-stage…

    …d-api, r=oli-obk
    
    Use const-checking to forbid use of unstable features in const-stable functions
    
    First step towards rust-lang#76618.
    
    Currently this code isn't ever hit because `qualify_min_const_fn` runs first and catches pretty much everything. One exception is `const_precise_live_drops`, which does not use the newly added code since it runs as part of a separate pass.
    
    Also contains some unrelated refactoring, which is split into separate commits.
    
    r? @oli-obk
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    eb25717 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#76846 - botika:master, r=davidtwco

    Avoiding unnecesary allocations at rustc_errors
    
    Simplify the code avoiding allocations with easy alternative
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    153813c View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#76867 - poliorcetics:intra-doc-core-iter, r…

    …=jyn514
    
    Use intra-doc links in core/src/iter when possible
    
    Helps with rust-lang#75080.
    
    I also updated lots of links to use `fn()` instead of `fn` when possible.
    
    @rustbot modify labels: T-doc A-intra-doc-links
    
    r? @jyn514
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    de4f13c View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#76868 - poliorcetics:intra-doc-std-sync, r=…

    …jyn514
    
    Finish moving to intra doc links for std::sync
    
    Helps with rust-lang#75080.
    
    @rustbot modify labels: T-doc A-intra-doc-links
    
    r? @jyn514
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    0f5f2e4 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#76936 - danielhenrymantilla:unsafecell_get_…

    …mut, r=RalfJung
    
    Add non-`unsafe` `.get_mut()` for `Unsafecell`
    
      - Tracking issue: rust-lang#76943
    
    As discussed in: https://internals.rust-lang.org/t/add-non-unsafe-get-mut-for-unsafecell/12407
    
      - ### [Rendered documentation](https://modest-dubinsky-1f9f47.netlify.app/core/cell/struct.unsafecell)
    
    This PR tries to move the sound `&mut UnsafeCell<T> -> &mut T` projection that all the "downstream" constructions were already relying on, up to the root abstraction, where it rightfully belongs, and officially blessing it.
    
      - this **helps reduce the amount of `unsafe` snippets out there** (_c.f._, the second commit of this PR: rust-lang@09503fd)
    
    The fact that this getter is now expose for `UnsafeCell<T>` itself, will also help convey the idea that **`UnsafeCell` is not magical _w.r.t._ `&mut` accesses**, contrary to what some people incorrectly think.
    
      - Even the standard library itself at some point had such a confusion, _c.f._ this comment where there is a mention of multi-threaded (and thus _shared_) access despite dealing with exclusive references over unique ownership: https://github.com/rust-lang/rust/blob/59fb88d061544a035f3043b47594b34789204cee/library/core/src/cell.rs#L498-L499
    
    r? @RalfJung
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    4e37c22 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#76958 - est31:ns, r=oli-obk

    Replace manual as_nanos and as_secs_f64 reimplementations
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    423919f View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#76959 - est31:write, r=oli-obk

    Replace write_fmt with write!
    
    Latter is simpler
    Dylan-DPC authored Sep 21, 2020
    Configuration menu
    Copy the full SHA
    94ad5d1 View commit details
    Browse the repository at this point in the history