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 #81493

Merged
merged 30 commits into from
Jan 29, 2021
Merged

Rollup of 10 pull requests #81493

merged 30 commits into from
Jan 29, 2021

Commits on Dec 20, 2020

  1. Configuration menu
    Copy the full SHA
    8553aee 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
    eaba3da View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. Improve flatten-fuse tests

    SkiFire13 committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    f241c10 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5aa625b View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2021

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

Commits on Jan 25, 2021

  1. 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

Commits on Jan 27, 2021

  1. Configuration menu
    Copy the full SHA
    c689b97 View commit details
    Browse the repository at this point in the history
  2. Update cargo.lock

    CraftSpider committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    428bc14 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    28f6cab View commit details
    Browse the repository at this point in the history
  4. Move into src/etc

    CraftSpider committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    3c28069 View commit details
    Browse the repository at this point in the history
  5. Simplify conversion

    CraftSpider committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    cca4eea View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3076e25 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    67b78a0 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2021

  1. Configuration menu
    Copy the full SHA
    74f26a1 View commit details
    Browse the repository at this point in the history
  2. rustdoc: Render HRTB correctly for bare functions

    The angle brackets were not rendered, so code like this:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    would be rendered as:
    
        some_func: fn'a(val: &'a i32) -> i32
    
    However, rendering with angle brackets is still invalid syntax:
    
        some_func: fn<'a>(val: &'a i32) -> i32
    
    so now it renders correctly as:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    -----
    
    However, note that this code:
    
        some_trait: dyn for<'a> Trait<'a>
    
    will still render as:
    
        some_trait: dyn Trait<'a>
    
    which is not invalid syntax, but is still unclear. Unfortunately I think
    it's hard to fix that case because there isn't enough information in the
    `rustdoc::clean::Type` that this code operates on. Perhaps that case can
    be fixed in a later PR.
    camelid committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    cd8dcee View commit details
    Browse the repository at this point in the history
  3. Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint

    cc rust-lang#79813
    
    This PR adds an allow-by-default future-compatibility lint
    `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
    macro body is ignored due to the macro being used in expression
    position:
    
    ```rust
    macro_rules! foo {
        () => {
            true; // WARN
        }
    }
    
    fn main() {
        let val = match true {
            true => false,
            _ => foo!()
        };
    }
    ```
    
    The lint takes its level from the macro call site, and
    can be allowed for a particular macro by adding
    `#[allow(semicolon_in_expressions_from_macros)]`.
    
    The lint is set to warn for all internal rustc crates (when being built
    by a stage1 compiler). After the next beta bump, we can enable
    the lint for the bootstrap compiler as well.
    Aaron1011 committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    f902551 View commit details
    Browse the repository at this point in the history
  4. Fix README typo

    CraftSpider committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    3aa8456 View commit details
    Browse the repository at this point in the history
  5. 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 rust-lang#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 rust-lang#79361
    alexcrichton committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    a124043 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2021

  1. Rollup merge of rust-lang#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 rust-lang#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 rust-lang#79361
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    d9e56f4 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#79819 - Aaron1011:feature/macro-trailing-se…

    …micolon, r=petrochenkov
    
    Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint
    
    cc rust-lang#79813
    
    This PR adds an allow-by-default future-compatibility lint
    `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
    macro body is ignored due to the macro being used in expression
    position:
    
    ```rust
    macro_rules! foo {
        () => {
            true; // WARN
        }
    }
    
    fn main() {
        let val = match true {
            true => false,
            _ => foo!()
        };
    }
    ```
    
    The lint takes its level from the macro call site, and
    can be allowed for a particular macro by adding
    `#[allow(macro_trailing_semicolon)]`.
    
    The lint is set to warn for all internal rustc crates (when being built
    by a stage1 compiler). After the next beta bump, we can enable
    the lint for the bootstrap compiler as well.
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    4003a73 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#79991 - camelid:rustdoc-for-lifetime, r=Gui…

    …llaumeGomez,jyn514
    
    rustdoc: Render HRTB correctly for bare functions
    
    The angle brackets were not rendered, so code like this:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    would be rendered as:
    
        some_func: fn'a(val: &'a i32) -> i32
    
    However, rendering with angle brackets is still invalid syntax:
    
        some_func: fn<'a>(val: &'a i32) -> i32
    
    so now it renders correctly as:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    -----
    
    However, note that this code:
    
        some_trait: dyn for<'a> Trait<'a>
    
    will still render as:
    
        some_trait: dyn Trait<'a>
    
    which is not invalid syntax, but is still unclear. Unfortunately I think
    it's hard to fix that case because there isn't enough information in the
    `rustdoc::clean::Type` that this code operates on. Perhaps that case can
    be fixed in a later PR.
    
    r? ``@jyn514``
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    3eac643 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#80215 - visigoth:issue-80202-fix, r=estebank

    Use -target when linking binaries for Mac Catalyst
    
    When running `rustc` with `-target x86_64-apple-ios-macabi`, the linker
    eventually gets run with `-arch x86_64`, because the linker back end splits the
    LLVM target triple and uses the first token as the target architecture. However,
    this does not work for the Mac Catalyst ABI, which is a separate target from
    Darwin.
    
    Specifying the full target triple with `-target` allows Mac Catalyst binaries to
    link and run.
    
    closes rust-lang#80202
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    a3c060c View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81158 - 1000teslas:issue-80313-fix, r=Aaron…

    …1011
    
    Point to span of upvar making closure FnMut
    
    For rust-lang#80313.
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    4283623 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#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
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    0c5fcce View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81287 - CraftSpider:json-crate, r=jyn514,Gu…

    …illaumeGomez
    
    Split rustdoc JSON types into separately versioned crate
    
    For now just an in-tree change.
    
    In the future, this may be exposed as a standalone crate with standard semver.
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    788036d View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#81306 - SkiFire13:fuse-flatten, r=cuviper

    Fuse inner iterator in FlattenCompat and improve related tests
    
    Fixes rust-lang#81248
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    94e093a View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#81333 - RalfJung:const-err-simplify, r=oli-obk

    clean up some const error reporting around promoteds
    
    These are some error reporting simplifications enabled by rust-lang#80579.
    
    Further simplifications are possible but could be blocked on making `const_err` a hard error.
    
    r? ``````@oli-obk``````
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    046a414 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#81459 - probablykasper:text-selection-fix, …

    …r=Nemo157
    
    Fix rustdoc text selection for page titles
    
    Fixes text selection of page titles by placing the `h1.fqn span.in-band` element before `h1.fqn span.out-of-band`.
    
    Before vs after:
    https://user-images.githubusercontent.com/11315492/105768203-55708700-5f5c-11eb-924b-4e7527ffe147.mp4
    
    Retry of PR rust-lang#81397 due to merge conflicts confusing me. Recreated the same changes as in that PR, but now when I run `./x.py doc library/std`, no changes I make to `src/librustdoc/html/render/mod.rs` to the file are reflected in the built doc files, even if I delete the `build` folder. I'm guessing there's some cache I'm missing?
    
    r? `@Nemo157`
    JohnTitor authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    2b4fa3d View commit details
    Browse the repository at this point in the history