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 9 pull requests #73563

Merged
merged 52 commits into from
Jun 21, 2020
Merged

Rollup of 9 pull requests #73563

merged 52 commits into from
Jun 21, 2020

Commits on Jun 15, 2020

  1. ci: allow gating gha on everything but macOS

    In our GitHub Actions setup macOS is too unreliable to gate on it, but
    the other builders work fine. This commit splits the macOS builders into
    a separate job (called auto-fallible), allowing us to gate on the auto
    job without failing due to macOS spurious failures.
    pietroalbini committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    8bc3122 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ea3864 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

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

Commits on Jun 20, 2020

  1. Configuration menu
    Copy the full SHA
    936b6bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a98f35f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6a0f1af View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    94817e3 View commit details
    Browse the repository at this point in the history
  5. Decouple Autoderef with FnCtxt and move Autoderef to `librustc_…

    …trait_selection`.
    ldm0 committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5155518 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ef68bf3 View commit details
    Browse the repository at this point in the history
  7. lint: normalize projections using opaque types

    This commit normalizes projections which contain opaque types (opaque types
    are otherwise linted against, which is would have previously made the
    test cases added in this commit fail).
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    2e781dd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    29272fc View commit details
    Browse the repository at this point in the history
  9. Consider fewer predicates for projection candidates

    We now require that projection candidates are applicable with the
    idenitity substs of the trait, rather than allowing predicates that are
    only applicable for certain substs.
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    04e589c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f1e0710 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    13104ef View commit details
    Browse the repository at this point in the history
  12. Check associated type satisfy their bounds

    This was currently only happening due to eager normalization, which
    isn't possible if there's specialization or bound variables.
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    d660dbc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9818bc0 View commit details
    Browse the repository at this point in the history
  14. Move bounds on associated types to the type

    Given `trait X { type U; }` the bound `<Self as X>::U` now lives
    on the type, rather than the trait. This is feature gated on
    `feature(generic_associated_types)` for now until more testing can
    be done.
    
    The also enabled type-generic associated types since we no longer
    need "implies bounds".
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    db4826d View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5e8c9f4 View commit details
    Browse the repository at this point in the history
  16. core/time: Add Duration methods for zero

    This patch adds two methods to `Duration`. The first, `Duration::zero`,
    provides a `const` constructor for getting an zero-length duration. This
    is also what `Default` provides (this was clarified in the docs), though
    `default` is not `const`.
    
    The second, `Duration::is_zero`, returns true if a `Duration` spans no
    time (i.e., because its components are all zero). Previously, the way to
    do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
    compare against `Duration::new(0, 0)`, or to use the `u128` method
    `as_nanos`, none of which were particularly elegant.
    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    3ff5879 View commit details
    Browse the repository at this point in the history
  17. Doctests need feature

    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    ad7fd62 View commit details
    Browse the repository at this point in the history
  18. Revise according to review

    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    386114b View commit details
    Browse the repository at this point in the history
  19. Allow multiple asm! options

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c883fa4 View commit details
    Browse the repository at this point in the history
  20. Update tests

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    e614116 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    1d2acdf View commit details
    Browse the repository at this point in the history
  22. Clean up

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    27cc7c7 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    820bba1 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    2be403c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    7aaadb6 View commit details
    Browse the repository at this point in the history
  26. Make warning an error; use help instead of suggestion; clean up code

    For some reason, the help message is now in a separate message, which
    adds a lot of noise. I would like to try to get it back to one message.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    b94b7e7 View commit details
    Browse the repository at this point in the history
  27. Use span_label

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    ac54265 View commit details
    Browse the repository at this point in the history
  28. Update duplicate options test

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    7c5b66f View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    c7da50d View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    e8be797 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    b00b1a4 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    f4dfc61 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    4ba6697 View commit details
    Browse the repository at this point in the history
  34. Create a separate, tool-only suggestion for the comma

    That way the comma isn't highlighted as part of the option in the UI.
    
    Weirdly, the comma removal suggestion shows up in the UI.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    8fe6710 View commit details
    Browse the repository at this point in the history
  35. Add documentation

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    db9d376 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    58f812b View commit details
    Browse the repository at this point in the history
  37. Fix duplicate options error

    The UI isn't glitching anymore.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    8d80cc5 View commit details
    Browse the repository at this point in the history
  38. Run ./x.py fmt

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c31785a View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    5a8e915 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    bfb0e8d View commit details
    Browse the repository at this point in the history
  41. Rollup merge of rust-lang#72456 - ldm0:dereftrait, r=estebank

    Try to suggest dereferences on trait selection failed
    
    Fixes rust-lang#39029 Fixes rust-lang#62530
    This PR consists of two parts:
    1. Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_trait_selection`.
    2. Try to suggest dereferences when trait selection failed.
    
    The first is needed because:
    1. For suggesting dereferences, the struct `Autoderef` should be used. But before this PR, it is placed in `librustc_typeck`, which depends on `librustc_trait_selection`. But trait selection error emitting happens in `librustc_trait_selection`, if we want to use `Autoderef` in it, dependency loop is inevitable. So I moved the `Autoderef` to `librustc_trait_selection`.
    2. Before this PR, `FnCtxt` is coupled to `Autoderef`, and `FnCtxt` only exists in `librustc_typeck`. So decoupling is needed.
    
    After this PR, we can get suggestion like this:
    ```
    error[E0277]: the trait bound `&Baz: Happy` is not satisfied
      --> $DIR/trait-suggest-deferences-multiple.rs:34:9
       |
    LL | fn foo<T>(_: T) where T: Happy {}
       |                          ----- required by this bound in `foo`
    ...
    LL |     foo(&baz);
       |         ^^^^
       |         |
       |         the trait `Happy` is not implemented for `&Baz`
       |         help: consider adding dereference here: `&***baz`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0277`.
    ```
    
    r? @estebank
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    a1404a9 View commit details
    Browse the repository at this point in the history
  42. Rollup merge of rust-lang#72788 - matthewjasper:projection-bound-vali…

    …dation, r=nikomatsakis
    
    Projection bound validation
    
    During selection we use bounds declared on associated types (e.g. `type X: Copy`) to satisfy trait/projection bounds. This would be fine so long as those bounds are checked on any impls/trait objects. For simple cases they are because the bound `Self::X: Copy` gets normalized when we check the impl.
    
    However, for default values with specialization and higher-ranked bounds from GATs or otherwise, we can't normalize when checking the impl, and so we use the bound from the trait to prove that the bound applies to the impl, which is clearly unsound.
    
    This PR makes 2 fixes for this:
    
    1. Requiring that the bounds on the trait apply to a projection type with the corresponding substs, so a bound `for<'a> <Self as X<'a>>::U: Copy` on the trait cannot be used to prove `<T as X<'_>>::U: Copy`.
    2. Actually checking that the bounds that we still allow apply to generic/default associated types.
    
    Opening for a crater run.
    
    Closes rust-lang#68641
    Closes rust-lang#68642
    Closes rust-lang#68643
    Closes rust-lang#68644
    Closes rust-lang#68645
    Closes rust-lang#68656
    
    r? @ghost
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    1a171d0 View commit details
    Browse the repository at this point in the history
  43. Rollup merge of rust-lang#72790 - jonhoo:duration-is-zero, r=LukasKal…

    …bertodt
    
    core/time: Add Duration methods for zero
    
    This patch adds two methods to `Duration`. The first, `Duration::zero`,
    provides a `const` constructor for getting an zero-length duration. This
    is also what `Default` provides (this was clarified in the docs), though
    `default` is not `const`.
    
    The second, `Duration::is_zero`, returns true if a `Duration` spans no
    time (i.e., because its components are all zero). Previously, the way to
    do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
    compare against `Duration::new(0, 0)`, or to use the `u128` method
    `as_nanos`, none of which were particularly elegant.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c47550f View commit details
    Browse the repository at this point in the history
  44. Rollup merge of rust-lang#73227 - camelid:multiple-asm-options, r=Ama…

    …nieu
    
    Allow multiple `asm!` options groups and report an error on duplicate options
    
    Fixes rust-lang#73193
    
    Cc @joshtriplett @Amanieu
    
    - [x] Allow multiple options
    - [x] Update existing test
    - [x] Add new tests
    - [x] Check for duplicate options
    - [x] Add duplicate options tests
    - [x] Finalize suggestion format for duplicate options error
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    45d6aef View commit details
    Browse the repository at this point in the history
  45. Rollup merge of rust-lang#73287 - davidtwco:issue-73251-opaque-types-…

    …in-projections, r=estebank
    
    lint: normalize projections using opaque types
    
    Fixes rust-lang#73251.
    
    This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9003087 View commit details
    Browse the repository at this point in the history
  46. Rollup merge of rust-lang#73291 - marmeladema:hir-id-ification-fix, r…

    …=petrochenkov
    
    Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs
    
    cc rust-lang#50928
    
    I don't know who is exactly the best person to review this.
    
    r? @petrochenkov
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    0a8fd43 View commit details
    Browse the repository at this point in the history
  47. Rollup merge of rust-lang#73378 - matthewjasper:arena-not-special, r=…

    …oli-obk
    
    Remove use of specialization from librustc_arena
    
    This reworks the macro so that specialization, `transmute` and `#[marker]` are not used.
    
    r? @oli-obk
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    a876a5a View commit details
    Browse the repository at this point in the history
  48. Rollup merge of rust-lang#73411 - ehuss:bump-stage0, r=Mark-Simulacrum

    Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15)
    
    Pulls in changes from rust-lang#73326.
    
    Closes rust-lang#73286
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9a82736 View commit details
    Browse the repository at this point in the history
  49. Rollup merge of rust-lang#73443 - pietroalbini:gha-auto-fallible, r=M…

    …ark-Simulacrum
    
    ci: allow gating GHA on everything but macOS
    
    In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures.
    
    cc rust-lang/rust-central-station#848
    r? @Mark-Simulacrum
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    929f032 View commit details
    Browse the repository at this point in the history