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 8 pull requests #83855

Merged
merged 29 commits into from
Apr 4, 2021
Merged

Rollup of 8 pull requests #83855

merged 29 commits into from
Apr 4, 2021

Commits on Feb 1, 2021

  1. Configuration menu
    Copy the full SHA
    af424c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    524b0c9 View commit details
    Browse the repository at this point in the history
  3. Move test

    SkiFire13 committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    c6c8f3b View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2021

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

Commits on Mar 3, 2021

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

Commits on Mar 8, 2021

  1. Emit unused externs

    est31 committed Mar 8, 2021
    Configuration menu
    Copy the full SHA
    aef1e35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3f2ca47 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2d52006 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    13371b5 View commit details
    Browse the repository at this point in the history
  5. Emit the lint level of the unused-crate-dependencies

    Also, turn off the lint when the unused dependencies json flag
    is specified so that cargo doesn't have to supress the lint
    est31 committed Mar 8, 2021
    Configuration menu
    Copy the full SHA
    3a62eb7 View commit details
    Browse the repository at this point in the history
  6. Fix the tests

    est31 committed Mar 8, 2021
    Configuration menu
    Copy the full SHA
    d8c9a28 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d018ef1 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2021

  1. Fix compiletest on FreeBSD

    Recent FreeBSD gdb packages have a different format for the version string.
    asomers committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    4f73d21 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2021

  1. rustdoc: highlight macros more efficiently

    Instead of producing `<span class=macro>assert_eq</span><span class=macro>!</span>`,
    just produce `<span class=macro>assert_eq!</span>`.
    notriddle committed Apr 2, 2021
    Configuration menu
    Copy the full SHA
    617e135 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2fb1fb7 View commit details
    Browse the repository at this point in the history
  3. Reduce size of statements

    roxelo committed Apr 2, 2021
    Configuration menu
    Copy the full SHA
    0a97eee View commit details
    Browse the repository at this point in the history
  4. fix clippy error

    roxelo committed Apr 2, 2021
    Configuration menu
    Copy the full SHA
    c29dc12 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2021

  1. Configuration menu
    Copy the full SHA
    f64038f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    13e482b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3bd241f View commit details
    Browse the repository at this point in the history
  4. suggestion from review

    Co-authored-by: Ralf Jung <post@ralfj.de>
    the8472 and RalfJung committed Apr 3, 2021
    Configuration menu
    Copy the full SHA
    572873f View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2021

  1. Rollup merge of rust-lang#73945 - est31:unused_externs, r=Mark-Simula…

    …crum
    
    Add an unstable --json=unused-externs flag to print unused externs
    
    This adds an unstable flag to print a list of the extern names not used by cargo.
    
    This PR will enable cargo to collect unused dependencies from all units and provide warnings.
    The companion PR to cargo is: rust-lang/cargo#8437
    
    The goal is eventual stabilization of this flag in rustc as well as in cargo.
    
    Discussion of this feature is mostly contained inside these threads: rust-lang#57274 rust-lang#72342 rust-lang#72603
    
    The feature builds upon the internal datastructures added by rust-lang#72342
    
    Externs are uniquely identified by name and the information is sufficient for cargo.
    If the mode is enabled, rustc will print json messages like:
    
    ```
    {"unused_extern_names":["byteorder","openssl","webpki"]}
    ```
    
    For a crate that got passed byteorder, openssl and webpki dependencies but needed none of them.
    
    ### Q: Why not pass -Wunused-crate-dependencies?
    A: See [ehuss's comment here](rust-lang#57274 (comment))
       TLDR: it's cleaner. Rust's warning system wasn't built to be filtered or edited by cargo.
       Even a basic implementation of the feature would have to change the "n warnings emitted" line that rustc prints at the end.
       Cargo ideally wants to synthesize its own warnings anyways. For example, it would be hard for rustc to emit warnings like
       "dependency foo is only used by dev targets", suggesting to make it a dev-dependency instead.
    
    ### Q: Make rustc emit used or unused externs?
    A: Emitting used externs has the advantage that it simplifies cargo's collection job.
       However, emitting unused externs creates less data to be communicated between rustc and cargo.
       Often you want to paste a cargo command obtained from `cargo build -vv` for doing something
       completely unrelated. The message is emitted always, even if no warning or error is emitted.
       At that point, even this tiny difference in "noise" matters. That's why I went with emitting unused externs.
    
    ### Q: One json msg per extern or a collective json msg?
    A: Same as above, the data format should be concise. Having 30 lines for the 30 crates a crate uses would be disturbing to readers.
       Also it helps the cargo implementation to know that there aren't more unused deps coming.
    
    ### Q: Why use names of externs instead of e.g. paths?
    A: Names are both sufficient as well as neccessary to uniquely identify a passed `--extern` arg.
       Names are sufficient because you *must* pass a name when passing an `--extern` arg.
       Passing a path is optional on the other hand so rustc might also figure out a crate's location from the file system.
       You can also put multiple paths for the same extern name, via e.g. `--extern hello=/usr/lib/hello.rmeta --extern hello=/usr/local/lib/hello.rmeta`,
       but rustc will only ever use one of those paths.
       Also, paths don't identify a dependency uniquely as it is possible to have multiple different extern names point to the same path.
       So paths are ill-suited for identification.
    
    ### Q: What about 2015 edition crates?
    A: They are fully supported.
       Even on the 2015 edition, an explicit `--extern` flag is is required to enable `extern crate foo;` to work (outside of sysroot crates, which this flag doesn't warn about anyways).
       So the lint would still fire on 2015 edition crates if you haven't included a dependency specified in Cargo.toml using `extern crate foo;` or similar.
       The lint won't fire if your sole use in the crate is through a `extern crate foo;`   statement, but that's not its job.
       For detecting unused `extern crate foo` statements, there is the `unused_extern_crates` lint
       which can be enabled by `#![warn(unused_extern_crates)]` or similar.
    
    cc ```@jsgf``` ```@ehuss``` ```@petrochenkov``` ```@estebank```
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    a1c3449 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#81619 - SkiFire13:resultshunt-inplace, r=th…

    …e8472
    
    Implement `SourceIterator` and `InPlaceIterable` for `ResultShunt`
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    869726d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#82726 - ssomers:btree_node_rearange, r=Mark…

    …-Simulacrum
    
    BTree: move blocks around in node.rs
    
    Without changing any names or implementation, reorder some members:
    - Move down the ones defined long ago on the demised `struct Root`, to below the definition of their current host `struct NodeRef`.
    - Move up some defined on `struct NodeRef` that are interspersed with those defined on `struct Handle`.
    - Move up the `correct_…` methods squeezed between the two flavours of `push`.
    - Move the unchecked static downcasts (`cast_to_…`) after the upcasts (`forget_`) and the (weirdly named) dynamic downcasts (`force`).
    r? ````@Mark-Simulacrum````
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    6c13556 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#83521 - sexxi-goose:quick-diagnostic-fix, r…

    …=nikomatsakis
    
    2229: Fix diagnostic issue when using FakeReads in closures
    
    This PR fixes a diagnostic issue caused by rust-lang#82536. A temporary work around was used in this merged PR which involved feature gating the addition of FakeReads introduced as a result of pattern matching in closures.
    
    The fix involves adding an optional closure DefId to ForLet and ForMatchedPlace FakeReadCauses. This DefId will only be added if a closure pattern matches a Place starting with an Upvar.
    
    r? ```@nikomatsakis```
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    a89eab9 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#83532 - asomers:gdb-fbsd, r=Mark-Simulacrum

    Fix compiletest on FreeBSD
    
    Recent FreeBSD gdb packages have a different format for the version string.
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    3cbed89 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#83793 - notriddle:single-span-macro-highlig…

    …ht, r=GuillaumeGomez
    
    rustdoc: highlight macros more efficiently
    
    Instead of producing `<span class=macro>assert_eq</span><span class=macro>!</span>`,
    just produce `<span class=macro>assert_eq!</span>`.
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    25026c9 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#83809 - GuillaumeGomez:remove-initial-ids, …

    …r=camelid
    
    Remove unneeded INITIAL_IDS const
    
    Some IDs inside this map didn't exist anymore, some others were duplicates of what we have inside `IdMap`. So instead of keeping the two around and since `INITIAL_IDS` was only used by `IdMap`, no need to keep both of them.
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    e62fce3 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#83827 - the8472:fix-inplace-panic-on-drop, …

    …r=RalfJung
    
    cleanup leak after test to make miri happy
    
    Contains changes that were requested in rust-lang#83629 but didn't make it into the rollup.
    
    r? `````@RalfJung`````
    Dylan-DPC committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    b943ea8 View commit details
    Browse the repository at this point in the history