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 11 pull requests #81390

Closed
wants to merge 33 commits into from
Closed

Rollup of 11 pull requests #81390

wants to merge 33 commits into from

Commits on Jan 10, 2021

  1. Print failure message on all tests that should panic, but don't

    This already happens with should_panic tests without an expected
    message. This commit fixes should_panic tests with an expected message
    to have the same behavior.
    johanngan committed Jan 10, 2021
    Configuration menu
    Copy the full SHA
    b43aa96 View commit details
    Browse the repository at this point in the history
  2. Add unwrap_unchecked() methods for Option and Result

    In particular:
      - `unwrap_unchecked()` for `Option`.
      - `unwrap_unchecked()` and `unwrap_err_unchecked()` for `Result`.
    
    These complement other `*_unchecked()` methods in `core` etc.
    
    Currently there are a couple of places it may be used inside rustc
    (`LinkedList`, `BTree`). It is also easy to find other repositories
    with similar functionality.
    
    Fixes #48278.
    
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 10, 2021
    Configuration menu
    Copy the full SHA
    679f6f3 View commit details
    Browse the repository at this point in the history
  3. Add SAFETY annotations

    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 10, 2021
    Configuration menu
    Copy the full SHA
    76299b3 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2021

  1. rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo

    This commit adds a new stable codegen option to rustc,
    `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
    subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
    subsumed by this flag but still requires `-Zunstable-options` to
    actually activate. The `-Csplit-debuginfo` flag takes one of
    three values:
    
    * `off` - This indicates that split-debuginfo from the final artifact is
      not desired. This is not supported on Windows and is the default on
      Unix platforms except macOS. On macOS this means that `dsymutil` is
      not executed.
    
    * `packed` - This means that debuginfo is desired in one location
      separate from the main executable. This is the default on Windows
      (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
      `-Zsplit-dwarf=single` and produces a `*.dwp` file.
    
    * `unpacked` - This means that debuginfo will be roughly equivalent to
      object files, meaning that it's throughout the build directory
      rather than in one location (often the fastest for local development).
      This is not the default on any platform and is not supported on Windows.
    
    Each target can indicate its own default preference for how debuginfo is
    handled. Almost all platforms default to `off` except for Windows and
    macOS which default to `packed` for historical reasons.
    
    Some equivalencies for previous unstable flags with the new flags are:
    
    * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
    * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
    * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
    * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`
    
    Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
    non-macOS platforms since split-dwarf support was *just* implemented in
    rustc.
    
    There's some more rationale listed on #79361, but the main gist of the
    motivation for this commit is that `dsymutil` can take quite a long time
    to execute in debug builds and provides little benefit. This means that
    incremental compile times appear that much worse on macOS because the
    compiler is constantly running `dsymutil` over every single binary it
    produces during `cargo build` (even build scripts!). Ideally rustc would
    switch to not running `dsymutil` by default, but that's a problem left
    to get tackled another day.
    
    Closes #79361
    alexcrichton committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    f97c7a5 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2021

  1. Reset LateContext enclosing body in nested items

    Prevents LateContext::maybe_typeck_results() from returning data in a
    nested item without a body. Consequently, LateContext::qpath_res is less
    likely to ICE when called in a nested item. Would have prevented
    rust-lang/rust-clippy#4545, presumably.
    camsteffen committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    63a1eee View commit details
    Browse the repository at this point in the history
  2. Query for TypeckResults in LateContext::qpath_res

    Actually fulfills the documented guarantees.
    camsteffen committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    21fb586 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    def0e9b View commit details
    Browse the repository at this point in the history
  4. Move test to src/test/ui/consts/

    Apparently `tidy` has a hard limit of 2830 tests in the
    `src/test/ui/issues/` directory, and this test hit that limit.
    
    `src/test/ui/consts/` is probably a better location anyway.
    camelid committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    a7b7a43 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eaba3da View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2021

  1. Make more traits of the From/Into family diagnostic items

    Following traits are now diagnostic items:
    - `From` (unchanged)
    - `Into`
    - `TryFrom`
    - `TryInto`
    
    This also adds symbols for those items:
    - `into_trait`
    - `try_from_trait`
    - `try_into_trait`
    flip1995 committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    e25959b View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. Configuration menu
    Copy the full SHA
    3a4786d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    78e57d3 View commit details
    Browse the repository at this point in the history
  3. Test exploring the interactions between all of the different kinds of…

    … method collisions I could imagine.
    
    The different impls are all guarded by cfg-flags, and the revisions could be
    used to cover the full power-set of combinations.
    
    (I only included 20 of the possible 32 cases here; the null-set is not
    interesting, and the remaining 11 all yielded ambiguous method resolution errors
    which did not mix well with this testing strategy; I'm not trying to check UI
    for the resolution diagnostics; I'm trying to create checkpoint of current
    resolution semantics when compilation succeeds.)
    pnkfelix committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    d78f0a1 View commit details
    Browse the repository at this point in the history
  4. placate tidy.

    pnkfelix committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    aa8fdad View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2021

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

Commits on Jan 25, 2021

  1. Configuration menu
    Copy the full SHA
    2be1993 View commit details
    Browse the repository at this point in the history
  2. Point to span of upvar making closure FnMut

    Add expected error
    
    Add comment
    
    Tweak comment wording
    
    Fix after rebase to updated master
    
    Fix after rebase to updated master
    
    Distinguish mutation in normal and move closures
    
    Tweak error message
    
    Fix error message for nested closures
    
    Refactor code showing mutated upvar in closure
    
    Remove debug assert
    
    B
    sledgehammervampire committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    26b4baf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    088c89d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    042facb View commit details
    Browse the repository at this point in the history
  5. Link the reference about undefined behavior

    Suggested-by: Mara Bos <m-ou.se@m-ou.se>
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    0140dac View commit details
    Browse the repository at this point in the history
  6. Add tracking issue

    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    01250fc View commit details
    Browse the repository at this point in the history
  7. Blessed change to output of flaky test.

    See issue 81296. I hope to have a PR up fixing *that* soon after this one.
    pnkfelix committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    24149d7 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3

    rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
    
    This commit adds a new stable codegen option to rustc,
    `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
    subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
    subsumed by this flag but still requires `-Zunstable-options` to
    actually activate. The `-Csplit-debuginfo` flag takes one of
    three values:
    
    * `off` - This indicates that split-debuginfo from the final artifact is
      not desired. This is not supported on Windows and is the default on
      Unix platforms except macOS. On macOS this means that `dsymutil` is
      not executed.
    
    * `packed` - This means that debuginfo is desired in one location
      separate from the main executable. This is the default on Windows
      (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
      `-Zsplit-dwarf=single` and produces a `*.dwp` file.
    
    * `unpacked` - This means that debuginfo will be roughly equivalent to
      object files, meaning that it's throughout the build directory
      rather than in one location (often the fastest for local development).
      This is not the default on any platform and is not supported on Windows.
    
    Each target can indicate its own default preference for how debuginfo is
    handled. Almost all platforms default to `off` except for Windows and
    macOS which default to `packed` for historical reasons.
    
    Some equivalencies for previous unstable flags with the new flags are:
    
    * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
    * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
    * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
    * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`
    
    Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
    non-macOS platforms since split-dwarf support was *just* implemented in
    rustc.
    
    There's some more rationale listed on #79361, but the main gist of the
    motivation for this commit is that `dsymutil` can take quite a long time
    to execute in debug builds and provides little benefit. This means that
    incremental compile times appear that much worse on macOS because the
    compiler is constantly running `dsymutil` over every single binary it
    produces during `cargo build` (even build scripts!). Ideally rustc would
    switch to not running `dsymutil` by default, but that's a problem left
    to get tackled another day.
    
    Closes #79361
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    02291a1 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…

    …m-ou-se
    
    Print failure message on all tests that should panic, but don't
    
    Fixes #80861. Tests with the `#[should_panic]` attribute should always print a failure message if no panic occurs, regardless of whether or not an `expected` panic message is specified.
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    16983d9 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #80876 - ojeda:option-result-unwrap_unchecked, r=m-ou-se

    Add `unwrap_unchecked()` methods for `Option` and `Result`
    
    In particular:
      - `unwrap_unchecked()` for `Option`.
      - `unwrap_unchecked()` and `unwrap_err_unchecked()` for `Result`.
    
    These complement other `*_unchecked()` methods in `core` etc.
    
    Currently there are a couple of places it may be used inside rustc (`LinkedList`, `BTree`). It is also easy to find other repositories with similar functionality.
    
    Fixes #48278.
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    fb253d8 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obk

    Fix ICE with `ReadPointerAsBytes` validation error
    
    Fixes #79690.
    
    r? ``@oli-obk``
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    590e7a1 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011

    Point to span of upvar making closure FnMut
    
    For #80313.
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    018ac7c View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk

    Improve safety of `LateContext::qpath_res`
    
    This is my first rustc code change, inspired by hacking on clippy!
    
    The first change is to clear cached `TypeckResults` from `LateContext` when visiting a nested item. I took a hint from [here](https://github.com/rust-lang/rust/blob/5e91c4ecc09312d8b63d250a432b0f3ef83f1df7/compiler/rustc_privacy/src/lib.rs#L1300).
    
    Clippy has a `qpath_res` util function to avoid a possible ICE in `LateContext::qpath_res`. But the docs of `LateContext::qpath_res` promise no ICE. So this updates the `LateContext` method to keep its promises, and removes the util function.
    
    Related: rust-lang/rust-clippy#4545
    
    CC `@eddyb` since you've done related work
    CC `@flip1995` FYI
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    8e8891f View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params,…

    … r=oli-obk
    
    Account for generics when suggesting bound
    
    Fix #81175.
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    daaebcc View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper

    Make more traits of the From/Into family diagnostic items
    
    Following traits are now diagnostic items:
    - `From` (unchanged)
    - `Into`
    - `TryFrom`
    - `TryInto`
    
    This also adds symbols for those items:
    - `into_trait`
    - `try_from_trait`
    - `try_into_trait`
    
    Related: rust-lang/rust-clippy#6620 (comment)
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    b3f474b View commit details
    Browse the repository at this point in the history
  16. Rollup merge of #81294 - pnkfelix:issue-81211-use-ufcs-in-derive-debu…

    …g, r=oli-obk
    
    Use ufcs in derive(Debug)
    
    Cc #81211.
    
    (Arguably this *is* the fix for it.)
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    dd8d7a1 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=N…

    …emo157
    
    Fix some bugs reported by eslint
    
    Simply went into `src/librustdoc/html/static/` and ran `eslint *.js` in case you want to reproduce. :)
    
    r? ``@Nemo157``
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    2600baf View commit details
    Browse the repository at this point in the history
  18. Rollup merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk

    codegen: assume constants cannot fail to evaluate
    
    #80579 landed, so we can finally remove this old hack from codegen and instead assume that consts never fail to evaluate. :)
    
    r? ``@oli-obk``
    jonas-schievink committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    0de16e1 View commit details
    Browse the repository at this point in the history