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 18 pull requests #76945

Closed
wants to merge 56 commits into from

Commits on Sep 4, 2020

  1. shim: monomorphic FnPtrShims during construction

    This commit adjusts MIR shim construction so that substitutions are
    applied to function pointer shims during construction, rather than
    during codegen (as determined by `substs_for_mir_body`) - as
    substitutions will no longer occur during codegen, function pointer
    shims can now be polymorphic without incurring double substitutions.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    f8376b5 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 15, 2020

  1. Configuration menu
    Copy the full SHA
    176956c View commit details
    Browse the repository at this point in the history
  2. Extract some intrinsics out of rustc_codegen_llvm

    A significant amount of intrinsics do not actually need backend-specific
    behaviors to be implemented, instead relying on methods already in
    rustc_codegen_ssa. So, extract those methods out to rustc_codegen_ssa,
    so that each backend doesn't need to reimplement the same code.
    khyperia committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    21b0c12 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
    94dae60 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. Fix wording in mir doc

    pickfire authored Sep 17, 2020
    Configuration menu
    Copy the full SHA
    b7c8bea View commit details
    Browse the repository at this point in the history
  2. Don't compile regex at every function call.

    Use `SyncOnceCell` to only compile it once.
    I believe this still adds some kind of locking mechanism?
    hbina committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    f4a7149 View commit details
    Browse the repository at this point in the history
  3. Remove intrinsics::arith_offset use from libarena

    The use of arith_offset was added in 803e9ae
    before the stable wrapper of the intrinsic was available.
    
    https://doc.rust-lang.org/stable/std/intrinsics/fn.arith_offset.html
    est31 committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    b479139 View commit details
    Browse the repository at this point in the history
  4. Replace const_generics feature gate with min_const_generics

    The latter is on the path to stabilization.
    est31 committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    4fe6ca3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ebdea01 View commit details
    Browse the repository at this point in the history
  6. fix array_windows docs

    lcnr committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    5f58e00 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2793672 View commit details
    Browse the repository at this point in the history
  8. array pattern

    lcnr committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    f193593 View commit details
    Browse the repository at this point in the history
  9. docs array -> slice

    Co-authored-by: est31 <est31@users.noreply.github.com>
    lcnr and est31 authored Sep 17, 2020
    Configuration menu
    Copy the full SHA
    764d307 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1dd3df6 View commit details
    Browse the repository at this point in the history
  11. Set BUILD_TRIPLE via build script

    This moves build triple discovery for rustbuild from bootstrap.py into a build
    script, meaning it will "just work" if building rustbuild via Cargo rather than
    Python.
    Mark-Simulacrum committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    1ccfcb6 View commit details
    Browse the repository at this point in the history
  12. Remove support for different src directory

    This requires that bootstrap is run from the same worktree as the sources it'll
    build, but this is basically required for the build to work anyway. You can
    still run it from a different directory, just that the files it builds must be
    beside it.
    Mark-Simulacrum committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    ccdb48a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f0392c2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    aac7d9e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    afed561 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2020

  1. Configuration menu
    Copy the full SHA
    4382436 View commit details
    Browse the repository at this point in the history
  2. char not char

    varkor committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    c9c5068 View commit details
    Browse the repository at this point in the history
  3. Bless mir-opt tests

    varkor committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    5ec9e96 View commit details
    Browse the repository at this point in the history
  4. Bless mir-opt 32-bit tests

    varkor committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    e2e000a View commit details
    Browse the repository at this point in the history
  5. 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. cleanup promotion const_kind checks

    in particular allow a few more promotions for consistency when they were already allowed in other contexts
    RalfJung committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    4d1ef03 View commit details
    Browse the repository at this point in the history
  5. fix doc comment

    RalfJung committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    7febd5a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7b99c8e View commit details
    Browse the repository at this point in the history
  7. fix some comments

    RalfJung committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    9216eb8 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#75346 - davidtwco:issue-69925-polymorphic-i…

    …nstancedef-fnptrshim, r=nikomatsakis
    
    shim: monomorphic `FnPtrShim`s during construction
    
    Fixes rust-lang#69925.
    
    This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`).
    
    r? @eddyb
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    7dafad3 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#76411 - RalfJung:promote-in-const-fn, r=ecs…

    …tatic-morse
    
    Some promotion cleanup
    
    Based on top of both rust-lang#75502 and rust-lang#75585, this does some cleanup of the promotion code. The last 2 commits are new.
    
    * Remove the remaining cases where `const fn` is treated different from `fn`. This means no longer promoting ptr-to-int casts, raw ptr operations, and union field accesses in `const fn` -- or anywhere, for that matter. These are all unstable in const-context so this should not break any stable code. Fixes rust-lang#75586.
    * ~~Promote references to statics even outside statics (i.e., in functions) for consistency.~~
    * Promote `&mut []` everywhere, not just in non-`const` functions, for consistency.
    * Explain why we do not promote deref's of statics outside statics. ~~(This is the only remaining direct user of `const_kind`.)~~
    
    This can only land once the other two PRs land; I am mostly putting this up already because I couldn't wait ;) and to get some feedback from @rust-lang/wg-const-eval .
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    bbccaed View commit details
    Browse the repository at this point in the history
  10. 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 19, 2020
    Configuration menu
    Copy the full SHA
    6a6a5b6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#76544 - Mark-Simulacrum:less-python, r=alex…

    …crichton
    
    De-couple Python and bootstrap slightly
    
    This revises rustbuild's entry points from Python to rely less on magic environment variables, preferring to use Cargo-provided environment variables where feasible.
    
    Notably, BUILD_DIR and BOOTSTRAP_CONFIG are *not* moved, because both more-or-less have some non-trivial discovery logic and replicating it in rustbuild seems unfortunate; if it moved to Cargo that would be a different story.
    
    Best reviewed by-commit.
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    6b21e93 View commit details
    Browse the repository at this point in the history
  12. 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 19, 2020
    Configuration menu
    Copy the full SHA
    aa81536 View commit details
    Browse the repository at this point in the history
  13. 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 19, 2020
    Configuration menu
    Copy the full SHA
    8549f2e View commit details
    Browse the repository at this point in the history
  14. 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 19, 2020
    Configuration menu
    Copy the full SHA
    2b56019 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#76722 - ssomers:btree_send_sync, r=Mark-Sim…

    …ulacrum
    
    Test and fix Send and Sync traits of BTreeMap artefacts
    
    Fixes rust-lang#76686.
    
    I'm not quite sure what all this implies. E.g. comparing with the definitions for `NodeRef` in node.rs,  maybe an extra bound `T: 'a` is useful for something. The test compiles on stable/beta (apart from `drain_filter`) so I bet `Sync` is equally desirable.
    
    r? @Mark-Simulacrum
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    12da3b0 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#76754 - varkor:diagnostic-cleanup-ii, r=ecs…

    …tatic-morse
    
    Clean up diagnostics for arithmetic operation errors
    
    Plus a small tweak to a range pattern error message.
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    678268e View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#76766 - khyperia:generic_intrinsics, r=eddyb

    Extract some intrinsics out of rustc_codegen_llvm
    
    A significant amount of intrinsics do not actually need backend-specific behaviors to be implemented, instead relying on methods already in rustc_codegen_ssa. So, extract those methods out to rustc_codegen_ssa, so that each backend doesn't need to reimplement the same code.
    
    Almost everything should be a pretty direct translation. A notable not-direct-translation is `add_with_overflow` and friends being changed to `bx.checked_binop`, but it's pretty simple.
    
    I could have been a lot more aggressive here and pulled out way more methods, and add a few new methods in the rustc_codegen_ssa "API". However, because this is my second rustc PR, I thought that moving those to a follow-up PR and doing more incremental changes here would be better (and I guess ask if this work is even desired in the first place). I'm hoping to eventually remove the mess of intrinsic handling in the backend entirely, which would be hecking fantastic ✨
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    64efb80 View commit details
    Browse the repository at this point in the history
  18. 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 19, 2020
    Configuration menu
    Copy the full SHA
    a2e1b15 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#76809 - matthiaskrgr:simplify_cond, r=varkor

    simplfy condition in ItemLowerer::with_trait_impl_ref()
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    52891e0 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#76815 - pickfire:patch-6, r=jonas-schievink

    Fix wording in mir doc
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    92077f1 View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#76818 - hbina:dont_compile_regex_all_the_ti…

    …me, r=ecstatic-morse
    
    Don't compile regex at every function call.
    
    Use `SyncOnceCell` to only compile it once.
    I believe this still adds some kind of locking mechanism?
    
    Related issue: rust-lang#76817
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    c377533 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#76821 - est31:remove_redundant_nightly_feat…

    …ures, r=oli-obk,Mark-Simulacrum
    
    Remove redundant nightly features
    
    Removes a bunch of redundant/outdated nightly features. The first commit removes a `core_intrinsics` use for which a stable wrapper has been provided since. The second commit replaces the `const_generics` feature with `min_const_generics` which might get stabilized this year. The third commit is the result of a trial/error run of removing every single feature and then adding it back if compile failed. A bunch of unused features are the result that the third commit removes.
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    ea11a23 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#76823 - RalfJung:black-box-warn, r=joshtrip…

    …lett
    
    black_box: silence unused_mut warning when building with cfg(miri)
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    d0d8e7d View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#76825 - lcnr:array-windows-apply, r=varkor

    use `array_windows` instead of `windows` in the compiler
    
    I do think these changes are beautiful, but do have to admit that using type inference for the window length
    can easily be confusing. This seems like a general issue with const generics, where inferring constants adds an additional
    complexity which users have to learn and keep in mind.
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    6403603 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#76827 - lcnr:array_windows-docs, r=jonas-sc…

    …hievink
    
    fix array_windows docs
    
    r? @Dylan-DPC
    Dylan-DPC authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    68301a0 View commit details
    Browse the repository at this point in the history