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 10 pull requests #73408

Closed
wants to merge 52 commits into from

Commits on May 30, 2020

  1. Configuration menu
    Copy the full SHA
    f7d745f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a6d03c View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2020

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

Commits on Jun 7, 2020

  1. Configuration menu
    Copy the full SHA
    5837518 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d684855 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b5fdbbe View commit details
    Browse the repository at this point in the history
  4. Preserve expressions that get a DefId

    Namely closures and `async` blocks. We have to make a few modifications
    to closures to make them compile.
    ecstatic-morse committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    d8c99f3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1a30042 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e319f20 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. Configuration menu
    Copy the full SHA
    c920ae9 View commit details
    Browse the repository at this point in the history
  2. 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 10, 2020
    Configuration menu
    Copy the full SHA
    d14ee0b View commit details
    Browse the repository at this point in the history
  3. 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 10, 2020
    Configuration menu
    Copy the full SHA
    fb16ee7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    373c735 View commit details
    Browse the repository at this point in the history
  5. Add -O compile flag to test

    Amanieu committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    2af53e9 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. 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 11, 2020
    Configuration menu
    Copy the full SHA
    83c5028 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. add raw_ref macros

    RalfJung committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    f0d2e78 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2020

  1. Configuration menu
    Copy the full SHA
    01e29c7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e785472 View commit details
    Browse the repository at this point in the history
  3. Speed up bootstrap a little.

    ehuss committed Jun 13, 2020
    Configuration menu
    Copy the full SHA
    0687b78 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2020

  1. Configuration menu
    Copy the full SHA
    d5ea0e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a40156e View commit details
    Browse the repository at this point in the history
  3. Switch bootstrap metadata to --no-deps.

    This should run much faster.
    
    There are also some drive-by cleanups here to try to simplify things.
    Also, the paths for in-tree crates are now displayed as relative
    in `x.py test -h -v`.
    ehuss committed Jun 14, 2020
    Configuration menu
    Copy the full SHA
    607e851 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2b920f View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. Configuration menu
    Copy the full SHA
    f17fd7b View commit details
    Browse the repository at this point in the history
  2. Change how compiler-builtins gets many CGUs

    This commit intends to fix an accidental regression from rust-lang#70846. The
    goal of rust-lang#70846 was to build compiler-builtins with a maximal number of
    CGUs to ensure that each module in the source corresponds to an object
    file. This high degree of control for compiler-builtins is desirable to
    ensure that there's at most one exported symbol per CGU, ideally
    enabling compiler-builtins to not conflict with the system libgcc as
    often.
    
    In rust-lang#70846, however, only part of the compiler understands that
    compiler-builtins is built with many CGUs. The rest of the compiler
    thinks it's building with `sess.codegen_units()`. Notably the
    calculation of `sess.lto()` consults `sess.codegen_units()`, which when
    there's only one CGU it disables ThinLTO. This means that
    compiler-builtins is built without ThinLTO, which is quite harmful to
    performance! This is the root of the cause from rust-lang#73135 where intrinsics
    were found to not be inlining trivial functions.
    
    The fix applied in this commit is to remove the special-casing of
    compiler-builtins in the compiler. Instead the build system is now
    responsible for special-casing compiler-builtins. It doesn't know
    exactly how many CGUs will be needed but it passes a large number that
    is assumed to be much greater than the number of source-level modules
    needed. After reading the various locations in the compiler source, this
    seemed like the best solution rather than adding more and more special
    casing in the compiler for compiler-builtins.
    
    Closes rust-lang#73135
    alexcrichton committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    d6156e8 View commit details
    Browse the repository at this point in the history
  3. Tweak "non-primitive cast" error

    - Suggest borrowing expression if it would allow cast to work.
    - Suggest using `<Type>::from(<expr>)` when appropriate.
    - Minor tweak to `;` typo suggestion.
    
    Partily address rust-lang#47136.
    estebank committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    e857696 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81c9094 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4e90f17 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    921f35f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e755889 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bc15790 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    539e978 View commit details
    Browse the repository at this point in the history
  10. review comments: wording

    estebank committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    31ea589 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    10d9bf1 View commit details
    Browse the repository at this point in the history
  12. Register new eror code

    estebank committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    34d8692 View commit details
    Browse the repository at this point in the history
  13. small tweaks

    estebank committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    e31367d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f7a1f97 View commit details
    Browse the repository at this point in the history
  15. fix rebase

    estebank committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    bfe1434 View commit details
    Browse the repository at this point in the history
  16. Update src/librustc_typeck/check/cast.rs

    Co-authored-by: lzutao <[email protected]>
    nikomatsakis and tesuji authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    b5809b0 View commit details
    Browse the repository at this point in the history
  17. add FIXME to EnumTagInfo

    RalfJung committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    10c8d2a View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

  1. Adjust error message

    oddg committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    f3dfe80 View commit details
    Browse the repository at this point in the history
  2. add tracking issue

    RalfJung committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    0265e4e View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#72279 - RalfJung:raw-ref-macros, r=nikomats…

    …akis
    
    add raw_ref macros
    
    In rust-lang#64490, various people were in favor of exposing `&raw` as a macro first before making the actual syntax stable. So this PR (unstably) introduces those macros.
    
    I'll create the tracking issue if we're okay moving forward with this.
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    b03de50 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#72331 - oddg:forbid-cast-of-cenum-implement…

    …ing-drop, r=matthewjasper,nikomatsakis
    
    Report error when casting an C-like enum implementing Drop
    
    Following approach described in rust-lang#35941
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    259b3f6 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#72497 - RalfJung:tag-term, r=oli-obk

    tag/niche terminology cleanup
    
    The term "discriminant" was used in two ways throughout the compiler:
    * every enum variant has a corresponding discriminant, that can be given explicitly with `Variant = N`.
    * that discriminant is then encoded in memory to store which variant is active -- but this encoded form of the discriminant was also often called "discriminant", even though it is conceptually quite different (e.g., it can be smaller in size, or even use niche-filling).
    
    After discussion with @eddyb, this renames the second term to "tag". The way the tag is encoded can be either `TagEncoding::Direct` (formerly `DiscriminantKind::Tag`) or `TagEncoding::Niche` (formerly `DiscrimianntKind::Niche`).
    
    This finally resolves some long-standing confusion I had about the handling of variant indices and discriminants, which surfaced in rust-lang#72419.
    
    (There is also a `DiscriminantKind` type in libcore, it remains unaffected. I think this corresponds to the discriminant, not the tag, so that seems all right.)
    
    r? @eddyb
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    dd83a9b View commit details
    Browse the repository at this point in the history
  6. 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 16, 2020
    Configuration menu
    Copy the full SHA
    0daff91 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#72804 - estebank:opaque-missing-lts-in-fn-2…

    …, r=nikomatsakis
    
    Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position
    
    * Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` instead of `Trait + 'static + '_`
    * When `'static` is explicit, also suggest constraining argument with it
    * Reduce verbosity of suggestion message and mention lifetime in label
    * Tweak output for overlapping required/captured spans
    * Give these errors an error code
    
    Follow up to rust-lang#72543.
    
    r? @nikomatsakis
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    49cbe7a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73065 - Amanieu:tls-fix, r=oli-obk

    Fix link error with #[thread_local] introduced by rust-lang#71192
    
    r? @oli-obk
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    00816ca View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73103 - ecstatic-morse:replace-body-with-lo…

    …op, r=pnkfelix
    
    Preserve `Expr`s that have `DefId`s in `ReplaceBodyWithLoop`
    
    This PR fixes rust-lang#71820 as well as the last part of rust-lang#71104 by preserving expressions that are assigned their own `DefId`s (closures and `async` blocks) when passing them to `rustdoc`. This avoids having a `DefId` without a corresponding `HirId`.
    
    The first commit in this PR makes `-Zunpretty=everybody_loops` actually work again, and the subsequent two are miscellaneous cleanup. They should probably get merged regardless of what we end up doing here.
    
    Sample input:
    ```rust
    fn foo() -> Box<i32> {
        let x = |a: i64| {
            const FOO: i64 = 1;
        };
    
        let a = 4;
        Box::new(a)
    }
    ```
    
    Sample output:
    ```rust
    fn foo() -> Box<i32> {
        || -> !
            {
                const FOO: i64 = 1;
                loop  { }
            };
        loop  { }
    }
    ```
    
    r? @ghost
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    289dabd View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73136 - alexcrichton:thinlto-compiler-built…

    …ins, r=Mark-Simulacrum
    
    Change how compiler-builtins gets many CGUs
    
    This commit intends to fix an accidental regression from rust-lang#70846. The
    goal of rust-lang#70846 was to build compiler-builtins with a maximal number of
    CGUs to ensure that each module in the source corresponds to an object
    file. This high degree of control for compiler-builtins is desirable to
    ensure that there's at most one exported symbol per CGU, ideally
    enabling compiler-builtins to not conflict with the system libgcc as
    often.
    
    In rust-lang#70846, however, only part of the compiler understands that
    compiler-builtins is built with many CGUs. The rest of the compiler
    thinks it's building with `sess.codegen_units()`. Notably the
    calculation of `sess.lto()` consults `sess.codegen_units()`, which when
    there's only one CGU it disables ThinLTO. This means that
    compiler-builtins is built without ThinLTO, which is quite harmful to
    performance! This is the root of the cause from rust-lang#73135 where intrinsics
    were found to not be inlining trivial functions.
    
    The fix applied in this commit is to remove the special-casing of
    compiler-builtins in the compiler. Instead the build system is now
    responsible for special-casing compiler-builtins. It doesn't know
    exactly how many CGUs will be needed but it passes a large number that
    is assumed to be much greater than the number of source-level modules
    needed. After reading the various locations in the compiler source, this
    seemed like the best solution rather than adding more and more special
    casing in the compiler for compiler-builtins.
    
    Closes rust-lang#73135
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    16b1a49 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73352 - ehuss:bootstrap-metadata, r=Mark-Si…

    …mulacrum
    
    Speed up bootstrap a little.
    
    The bootstrap script was calling `cargo metadata` 3 times (or 6 with `-v`). This is a very expensive operation, and this attempts to avoid the extra calls. On my system, a simple command like `./x.py test -h -v` goes from about 3 seconds to 0.4.
    
    An overview of the changes:
    
    - Call `cargo metadata` only once with `--no-deps`. Optional dependencies are filtered in `in_tree_crates` (handling `profiler_builtins` and `rustc_codegen_llvm` which are driven by the config).
    - Remove a duplicate call to `metadata::build` when using `-v`. I'm not sure why it was there, it looks like a mistake or vestigial from previous behavior.
    - Remove check for `_shim`, I believe all the `_shim` crates are now gone.
    - Remove check for `rustc_` and `*san` for `test::Crate::should_run`, these are no longer dependencies in the `test` tree.
    - Use relative paths in `./x.py test -h -v` output.
    - Some code cleanup (remove unnecessary `find_compiler_crates`, etc.).
    - Show suite paths (`src/test/ui/...`) in `./x.py test -h -v` output.
    - Some doc comments.
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    c824b3b View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#73361 - estebank:non-primitive-cast, r=davi…

    …dtwco
    
    Tweak "non-primitive cast" error
    
    - Suggest borrowing expression if it would allow cast to work.
    - Suggest using `<Type>::from(<expr>)` when appropriate.
    - Minor tweak to `;` typo suggestion.
    
    Partily address rust-lang#47136.
    Manishearth authored Jun 16, 2020
    Configuration menu
    Copy the full SHA
    b2b67e4 View commit details
    Browse the repository at this point in the history