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 14 pull requests #78952

Closed
wants to merge 56 commits into from
Closed

Rollup of 14 pull requests #78952

wants to merge 56 commits into from

Commits on Oct 22, 2020

  1. Dogfood Duration API in std::time tests

    This expands time's test suite to use more and in more places the
    range of methods and constants added to Duration in recent
    proposals for the sake of testing more API surface area and
    improving legibility.
    workingjubilee committed Oct 22, 2020
    Configuration menu
    Copy the full SHA
    d72d5f4 View commit details
    Browse the repository at this point in the history
  2. Duration::zero() -> Duration::ZERO

    Duration::ZERO composes better with match and various other things,
    at the cost of an occasional parens, and results in less work for the
    optimizer, so let's use that instead.
    workingjubilee committed Oct 22, 2020
    Configuration menu
    Copy the full SHA
    ef027a1 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2020

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

Commits on Oct 27, 2020

  1. Configuration menu
    Copy the full SHA
    af4d178 View commit details
    Browse the repository at this point in the history
  2. Remove Duration::MIN entirely

    Duration::ZERO supercedes it in effect.
    workingjubilee committed Oct 27, 2020
    Configuration menu
    Copy the full SHA
    82f3a23 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2020

  1. Configuration menu
    Copy the full SHA
    458a143 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d75046f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    561b872 View commit details
    Browse the repository at this point in the history
  4. Specialize panic_fmt lint for the {core,std}::panic!() macros.

    It now only reacts to expansion of those macros, and suggests
    inserting `"{}", ` in the right place.
    m-ou-se committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    ee99096 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    00dd663 View commit details
    Browse the repository at this point in the history
  6. Expand assert!(expr) to panic() function instead of panic!() macro.

    The panic message might contain braces which should never be
    interpreted as format placeholders, which panic!() will do in a future
    edition.
    m-ou-se committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    5c5232a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3e8350e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    098aaf9 View commit details
    Browse the repository at this point in the history
  9. Formatting.

    m-ou-se committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    d17364e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b754e2f View commit details
    Browse the repository at this point in the history
  11. Add cfg(not(bootstrap)) on the new rustc_diagnostic_item attributes.

    The beta compiler doesn't accept rustc_diagnostic_items on macros yet.
    m-ou-se committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    44a0318 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f6e4459 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6dce5b4 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    671d3e3 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    1481f0d View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7489ae2 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e6a6120 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    33a3f06 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    1eb0a2c View commit details
    Browse the repository at this point in the history
  20. Small cleanups in assert!() and panic_fmt lint.

    (From the PR feedback.)
    
    Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
    m-ou-se and estebank committed Oct 28, 2020
    Configuration menu
    Copy the full SHA
    db162b6 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8212aae View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    1e4bc20 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    9af971e View commit details
    Browse the repository at this point in the history
  24. Mark panic_fmt suggestion as machine applicable.

    Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
    m-ou-se and bjorn3 authored Oct 28, 2020
    Configuration menu
    Copy the full SHA
    2ab39e0 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2020

  1. Improve panic_fmt lint messages.

    (From the PR feedback.)
    
    Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
    m-ou-se and estebank committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    d2581f6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1e23473 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2020

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

Commits on Nov 8, 2020

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

Commits on Nov 9, 2020

  1. Support inlining diverging function calls

    Additionally introduce storage markers for all temporaries created by
    the inliner. The temporary introduced for destination rebrorrow, didn't
    use them previously.
    tmiasko committed Nov 9, 2020
    Configuration menu
    Copy the full SHA
    ffa70d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26f0f12 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2020

  1. Add flags customizing behaviour of MIR inlining

    * `-Zinline-mir-threshold` to change the default threshold.
    * `-Zinline-mir-hint-threshold` to change the threshold used by
      functions with inline hint.
    tmiasko committed Nov 10, 2020
    Configuration menu
    Copy the full SHA
    c8943c6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    03eec5c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ce91c68 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2020

  1. Configuration menu
    Copy the full SHA
    ca17a91 View commit details
    Browse the repository at this point in the history
  2. Fix typo in comment

    occurences -> occurrences
    eltociear authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    1854425 View commit details
    Browse the repository at this point in the history
  3. Implement destructuring assignment for structs and slices

    Co-authored-by: varkor <github@varkor.com>
    fanzier and varkor committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    de84ad9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2453ce7 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=e…

    …stebank
    
    Add lint for panic!("{}")
    
    This adds a lint that warns about `panic!("{}")`.
    
    `panic!(msg)` invocations with a single argument use their argument as panic payload literally, without using it as a format string. The same holds for `assert!(expr, msg)`.
    
    This lints checks if `msg` is a string literal (after expansion), and warns in case it contained braces. It suggests to insert `"{}", ` to use the message literally, or to add arguments to use it as a format string.
    
    ![image](https://user-images.githubusercontent.com/783247/96643867-79eb1080-1328-11eb-8d4e-a5586837c70a.png)
    
    This lint is also a good starting point for adding warnings about `panic!(not_a_string)` later, once [`panic_any()`](#74622) becomes a stable alternative.
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    80058c5 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #78138 - fortanix:raoul/dlmalloc0.2, r=Mark-Simulacrum

    Upgrade dlmalloc to version 0.2
    
    In preparation of adding dynamic memory management support for SGXv2-enabled platforms, the dlmalloc crate has been refactored. More specifically, support has been added to implement platform specification outside of the dlmalloc crate. (see alexcrichton/dlmalloc-rs#15)
    
    This PR upgrades dlmalloc to version 0.2 for the `wasm` and `sgx` targets.
    
    As the dlmalloc changes have received a positive review, but have not been merged yet, this PR contains a commit to prevent tidy from aborting CI prematurely.
    
    cc: `@jethrogb`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    5b27915 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #78216 - workingjubilee:duration-zero, r=m-ou-se

    Duration::zero() -> Duration::ZERO
    
    In review for #72790, whether or not a constant or a function should be favored for `#![feature(duration_zero)]` was seen as an open question. In #73544 (comment) an invitation was opened to either stabilize the methods or propose a switch to the constant value, supplemented with reasoning. Followup comments suggested community preference leans towards the const ZERO, which would be reason enough.
    
    ZERO also "makes sense" beside existing associated consts for Duration. It is ever so slightly awkward to have a series of constants specifying 1 of various units but leave 0 as a method, especially when they are side-by-side in code. It seems unintuitive for the one non-dynamic value (that isn't from Default) to be not-a-const, which could hurt discoverability of the associated constants overall. Elsewhere in `std`, methods for obtaining a constant value were even deprecated, as seen with [std::u32::min_value](https://doc.rust-lang.org/std/primitive.u32.html#method.min_value).
    
    Most importantly, ZERO costs less to use. A match supports a const pattern, but const fn can only be used if evaluated through a const context such as an inline `const { const_fn() }` or a `const NAME: T = const_fn()` declaration elsewhere. Likewise, while #73544 (comment) notes `Duration::zero()` can optimize to a constant value, "can" is not "will". Only const contexts have a strong promise of such. Even without that in mind, the comment in question still leans in favor of the constant for simplicity. As it costs less for a developer to use, may cost less to optimize, and seems to have more of a community consensus for it, the associated const seems best.
    
    r? `@LukasKalbertodt`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    d38a21c View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-Simulacrum

    Support enable/disable sanitizers/profiler per target
    
    This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target.
    If these options are empty, the global options under `[build]` will take effect.
    
    Fix #78329
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    82a2731 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #78417 - ssomers:btree_chop_up_2, r=Mark-Simulacrum

    BTreeMap: split off most code of append
    
    To complete #78056, move the last single-purpose pieces of code out of map.rs into a separate module. Also, tweaked documentation and safeness - I doubt think this code would be safe if the iterators passed in wouldn't be as sorted as the method says they should be - and bounds on MergeIterInner.
    
    r? `@Mark-Simulacrum`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    0b5e169 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #78832 - lcnr:const-evaluatable-unevaluated, r=oli-obk

    look at assoc ct, check the type of nodes
    
    an example where types matter are function objects, see the added test which previously passed.
    
    Now does a shallow comparison of unevaluated constants.
    
    r? `@oli-obk`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    727b0aa View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=pe…

    …trochenkov
    
    Implement destructuring assignment for structs and slices
    
    This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: #71126). This PR is the second part of #71156, which was split up to allow for easier review.
    
    Note that the first PR (#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If `@petrochenkov` prefers to wait until the first PR is merged, I totally understand, of course.
    
    This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following *parser change* was necessary: struct expressions are not required to have a base expression, i.e. `Struct { a: 1, .. }` becomes legal (in order to act like a struct pattern).
    
    Unfortunately, this PR slightly regresses the diagnostics implemented in #77283. However, it is only a missing help message in `src/test/ui/issues/issue-77218.rs`. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR.
    
    Thanks to `@varkor` who helped with the implementation, particularly around the struct rest changes.
    
    r? `@petrochenkov`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    598da98 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #78873 - tmiasko:inline-opts, r=oli-obk

    Add flags customizing behaviour of MIR inlining
    
    * `-Zinline-mir-threshold` to change the default threshold.
    * `-Zinline-mir-hint-threshold` to change the threshold used by
      functions with inline hint.
    
    Having those as configurable flags makes it possible to experiment with with
    different inlining thresholds and substantially increase test coverage of MIR
    inlining when used with increased thresholds (for example, necessary to test
    #78844).
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    16937db View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #78899 - tmiasko:inline-diverging, r=oli-obk

    Support inlining diverging function calls
    
    The existing heuristic does penalize diverging calls to some degree, but since
    it never inlined them previously it might need some further modifications.
    
    Additionally introduce storage markers for all temporaries created by
    the inliner. The temporary introduced for destination rebrorrow, didn't
    use them previously.
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    8185c0d View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #78923 - jyn514:intra-doc-comments, r=Manishearth

    Cleanup and comment intra-doc link pass
    
    r? `@Manishearth`
    cc `@seeplusplus`
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    79b6b2c View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #78929 - petrochenkov:linuxbase, r=joshtriplett

    rustc_target: Move target env "gnu" from `linux_base` to `linux_gnu_base`
    
    Follow up to #77729.
    
    Changes the target spec hierarchy for Linux from
    ```
    linux_base
    ├── linux_musl_base
    └── linux_uclibc_base
    ```
    where `linux_base` is really `linux_gnu_base` and the inheriting targets replace target env "gnu" with "musl"/"uclibc" to
    ```
    linux_base
    ├── linux_gnu_base
    ├── linux_musl_base
    └── linux_uclibc_base
    ```
    which is slightly less confusing (I think).
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    b1c5e96 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of #78930 - petrochenkov:notlikeandroid, r=Mark-Simulacrum

    rustc_taret: Remove `TargetOptions::is_like_android`
    
    This option was replaced by more specific options and is no longer used by the compiler.
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    fb8adb3 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #78942 - eltociear:patch-1, r=jonas-schievink

    Fix typo in comment
    
    occurences -> occurrences
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    30e7c91 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of #78947 - dalance:llvm_cov, r=Mark-Simulacrum

    Ship llvm-cov through llvm-tools
    
    `llvm-cov` is used to generate coverage report with LLVM InstrProf-based code coverage #34701.
    So if `llvm-cov` is shipped through llvm-tools, users can try it easily accorging to the instruction of [The Rust Unstable Book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/source-based-code-coverage.html).
    jonas-schievink authored Nov 11, 2020
    Configuration menu
    Copy the full SHA
    68c5bc3 View commit details
    Browse the repository at this point in the history