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 12 pull requests #79037

Closed
wants to merge 52 commits into from

Commits on Oct 25, 2020

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

Commits on Nov 11, 2020

  1. Use Places to express closure/generator Captures

    Co-authored-by: Archer Zhang <archer.xn@gmail.com>
    arora-aman and Azhng committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    127a6ed View commit details
    Browse the repository at this point in the history
  2. Indroduce feature flag for RFC-2229

    Signed-off-by: Aman Arora <me@aman-arora.com>
    arora-aman committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    88310cc View commit details
    Browse the repository at this point in the history
  3. Add initial set of testcases for RFC 2229

    Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
    arora-aman and null-sleep committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    58e8f8f View commit details
    Browse the repository at this point in the history
  4. Add helper function for Capture Esclations and expressions

    Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
    arora-aman and null-sleep committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    1453120 View commit details
    Browse the repository at this point in the history
  5. Initial work for doing minimum capture analysis for RFC-2229

    Co-authored-by: Chris Pardy <chrispardy36@gmail.com>
    Co-authored-by: Logan Mosier <logmosier@gmail.com>
    3 people committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    8f0c0d6 View commit details
    Browse the repository at this point in the history
  6. Update tests with min capture information

    Co-authored-by: Chris Pardy <chrispardy36@gmail.com>
    Co-authored-by: Logan Mosier <logmosier@gmail.com>
    3 people committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    b16815b View commit details
    Browse the repository at this point in the history
  7. Reduce verbosity of capture analysis logs

    Co-authored-by: Jenny Wills <wills.jenniferg@gmail.com>
    Co-authored-by: Aman Arora <me@aman-arora.com>
    3 people committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    825e9e4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fa38160 View commit details
    Browse the repository at this point in the history
  9. More pattern testcases

    arora-aman committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    be77402 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    abc4004 View commit details
    Browse the repository at this point in the history
  11. Address review comments

    arora-aman committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    43423f6 View commit details
    Browse the repository at this point in the history
  12. Address review comments 2

    arora-aman committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    deeb025 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d0fac05 View commit details
    Browse the repository at this point in the history
  14. rustc_target: Change os from "unknown" to "none" for bare metal targets

    x86_64-fortanix-unknown-sgx and wasm32-unknown-unknown still have os == "unknown" because both have libstd
    petrochenkov committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    443b45f View commit details
    Browse the repository at this point in the history
  15. rustc_target: Normalize vendor from "" to "unknown" for all targets

    Majority of targets use "unknown" vendor and changing it from "unknown" to omitted doesn't make sense.
    From the LLVM docs (https://clang.llvm.org/docs/CrossCompilation.html#target-triple):
    
    >Most of the time it can be omitted (and Unknown) will be assumed, which sets the defaults for the specified architecture.
    >When a parameter is not important, it can be omitted, or you can choose unknown and the defaults will be used. If you choose a parameter that Clang doesn’t know, like blerg, it’ll ignore and assume unknown
    petrochenkov committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    1def24c View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    e0a8f22 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2020

  1. Configuration menu
    Copy the full SHA
    f5e67b5 View commit details
    Browse the repository at this point in the history
  2. Ignore tidy linelength

    poliorcetics committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    9c70696 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bd0eb07 View commit details
    Browse the repository at this point in the history
  4. Use intradoc-links for the whole test, add a @Has check

    Co-authored-by: Joshua Nelson <joshua@yottadb.com>
    poliorcetics and Joshua Nelson committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    ecfeac5 View commit details
    Browse the repository at this point in the history
  5. Include llvm-as in llvm-tools-preview component

    Including llvm-as adds the ability to include assembly language fragments
    that can be inlined using LTO.
    zec committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    562d50e View commit details
    Browse the repository at this point in the history
  6. Merge changes from rust-lang/rust

    zec committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    e4a43fc View commit details
    Browse the repository at this point in the history
  7. Overcome Sync issues with non-parallel compiler

    Per Mark's recommendation at:
    rust-lang#78963 (comment)
    richkadel committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    eb9f2bb View commit details
    Browse the repository at this point in the history
  8. fix pretty print for qpath

    gui1117 committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    775f1e5 View commit details
    Browse the repository at this point in the history
  9. rustc_target: Mark UEFI targets as is_like_windows/is_like_msvc

    Document what `is_like_windows` and `is_like_msvc` mean in more detail.
    petrochenkov committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    04d41e1 View commit details
    Browse the repository at this point in the history
  10. Never inline when no_sanitize attributes differ

    The inliner looks if a sanitizer is enabled before considering
    `no_sanitize` attribute as possible source of incompatibility.
    
    The MIR inlining could happen in a crate with sanitizer disabled, but
    code generation in a crate with sanitizer enabled, thus the attribute
    would be incorrectly ignored.
    
    To avoid the issue never inline functions with different `no_sanitize`
    attributes.
    tmiasko committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    0b4af16 View commit details
    Browse the repository at this point in the history
  11. Never inline cold functions

    The information about cold attribute is lost during inlining,
    Avoid the issue by never inlining cold functions.
    tmiasko committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    ae43326 View commit details
    Browse the repository at this point in the history
  12. Remove check for impossible condition

    The callee body is already transformed; the condition is always false.
    tmiasko committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    9bb3d6b View commit details
    Browse the repository at this point in the history
  13. rustc_parse: Remove optimization for 0-length streams in `collect_tok…

    …ens`
    
    The optimization conflates empty token streams with unknown token stream, which is at least suspicious, and doesn't affect performance because 0-length token streams are very rare.
    petrochenkov committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    2879ab7 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    66cadec View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    79d853e View commit details
    Browse the repository at this point in the history
  16. ./x.py test --bless

    tmiasko committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    2a010dd View commit details
    Browse the repository at this point in the history
  17. Normalize function type during validation

    During inlining, the callee body is normalized and has types revealed,
    but some of locals corresponding to the arguments might come from the
    caller body which is not. As a result the caller body does not pass
    validation without additional normalization.
    tmiasko committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    d486bfc View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    99be78d View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2020

  1. Added a unit test for BcbCounters

    Restructured the code a little, to allow getting both the mir::Body and
    coverage graph.
    richkadel committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    c131063 View commit details
    Browse the repository at this point in the history
  2. Fix wrong XPath

    poliorcetics committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    309d863 View commit details
    Browse the repository at this point in the history
  3. Addressed feedback

    richkadel committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    b4b0ef3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bf6902c View commit details
    Browse the repository at this point in the history
  5. Log closure as well

    arora-aman committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    c50e57f View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2020

  1. Rollup merge of rust-lang#78352 - JohnTitor:issue-75229, r=Dylan-DPC

    Do not call `unwrap` with `signatures` option enabled
    
    Fixes rust-lang#75229
    Didn't add a test since I couldn't set `RUST_SAVE_ANALYSIS_CONFIG` even with `rustc-env`.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    a5b7f24 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#78736 - petrochenkov:lazyenum, r=Aaron1011

    rustc_parse: Remove optimization for 0-length streams in `collect_tokens`
    
    The optimization conflates empty token streams with unknown token stream, which is at least suspicious, and doesn't affect performance because 0-length token streams are very rare.
    
    r? `@Aaron1011`
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6272915 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#78801 - sexxi-goose:min_capture, r=nikomats…

    …akis
    
    RFC-2229: Implement Precise Capture Analysis
    
    ### This PR introduces
    - Feature gate for RFC-2229 (incomplete) `capture_disjoint_field`
    - Rustc Attribute to print out the capture analysis `rustc_capture_analysis`
    - Precise capture analysis
    
    ### Description of the analysis
    1. If the feature gate is not set then all variables that are not local to the closure will be added to the list of captures. (This is for backcompat)
    2. The rest of the analysis is based entirely on how the captured `Place`s are used within the closure. Precise information (i.e. projections) about the `Place` is maintained throughout.
    3. To reduce the amount of information we need to keep track of, we do a minimization step. In this step, we determine a list such that no Place within this list represents an ancestor path to another entry in the list.  Check rust-lang/project-rfc-2229#9 for more detailed examples.
    4. To keep the compiler functional as before we implement a Bridge between the results of this new analysis to existing data structures used for closure captures. Note the new capture analysis results are only part of MaybeTypeckTables that is the information is only available during typeck-ing.
    
    ### Known issues
    - Statements like `let _ = x` will make the compiler ICE when used within a closure with the feature enabled. More generally speaking the issue is caused by `let` statements that create no bindings and are init'ed using a Place expression.
    
    ### Testing
    We removed the code that would handle the case where the feature gate is not set, to enable the feature as default and did a bors try and perf run. More information here: rust-lang#78762
    
    ### Thanks
    This has been slowly in the works for a while now.
    I want to call out `@Azhng` `@ChrisPardy` `@null-sleep` `@jenniferwills` `@logmosier` `@roxelo` for working on this and the previous PRs that led up to this, `@nikomatsakis` for guiding us.
    
    Closes rust-lang/project-rfc-2229#7
    Closes rust-lang/project-rfc-2229#9
    Closes rust-lang/project-rfc-2229#6
    Closes rust-lang/project-rfc-2229#19
    
    r? `@nikomatsakis`
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    0c0e8c4 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#78951 - petrochenkov:unknown, r=ehuss

    rustc_target: Change os and vendor values to "none" and "unknown" for some targets
    
    Closes rust-lang#77730
    r? ```@ehuss```
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    d8fcf18 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#78959 - petrochenkov:likeuefi, r=nagisa

    rustc_target: Mark UEFI targets as `is_like_windows`/`is_like_msvc`
    
    And document what `is_like_windows` and `is_like_msvc` actually mean in more detail.
    
    Addresses FIXMEs left from rust-lang#71030.
    r? ```@nagisa```
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    e427499 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#78962 - poliorcetics:rustdoc-raw-ident-test…

    …, r=jyn514
    
    Add a test for r# identifiers
    
    I'm not entirely sure I properly ran the test locally (I think so though), waiting for CI to confirm. :)
    
    ```@rustbot``` modify labels: T-rustdoc
    
    r? ```@jyn514```
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    dd9485e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#78963 - richkadel:llvm-coverage-counters-2.…

    …0.4, r=tmandry
    
    Added some unit tests as requested
    
    As discussed in PR rust-lang#78267, for example:
    
    * rust-lang#78267 (comment)
    * rust-lang#78267 (comment)
    
    r? ```@tmandry```
    FYI: ```@wesleywiser```
    
    This is pretty much self contained, but depending on feedback and timing, I may have a chance to add a few more unit tests requested against `counters.rs`. I'm looking at those now.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    09cafd7 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#78966 - tmiasko:inline-never, r=oli-obk

    Never inline C variadics, cold functions, functions with incompatible attributes ...
    
    ... and fix generator inlining.
    
    Closes rust-lang#67863.
    Closes rust-lang#78859.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    591a39a View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#78968 - zec:add-llvm-as, r=Mark-Simulacrum

    Include llvm-as in llvm-tools-preview component
    
    Including `llvm-as` adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    2eceb84 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#78969 - tmiasko:normalize, r=davidtwco

    Normalize function type during validation
    
    During inlining, the callee body is normalized and has types revealed,
    but some of locals corresponding to the arguments might come from the
    caller body which is not. As a result the caller body does not pass
    validation without additional normalization.
    
    Closes rust-lang#78442.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    e70291f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#78980 - thiolliere:gui-fix-qpath, r=estebank

    Fix rustc_ast_pretty print_qpath resulting in invalid macro input
    
    related rust-lang#76874 (third case)
    
    ### Issue:
    
    The input for a procedural macro is incorrect, for the rust code:
    ```rust
    
    mod m {
        pub trait Tr {
            type Ts: super::Tu;
        }
    }
    
    trait Tu {
        fn dummy() { }
    }
    
    #[may_proc_macro]
    fn foo() {
        <T as m::Tr>::Ts::dummy();
    }
    ```
    the macro will get the input:
    ```rust
    fn foo() {
        <T as m::Tr>::dummy();
    }
    ```
    Thus `Ts` has disappeared.
    
    ### Fix:
    
    This is due to invalid pretty print of qpath. This PR fix it.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    9eb4693 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#79026 - mbrubeck:btree_retain, r=m-ou-se

    Implement BTreeMap::retain and BTreeSet::retain
    
    Adds new methods `BTreeMap::retain` and `BTreeSet::retain`.  These are implemented on top of `drain_filter` (rust-lang#70530).
    
    The API of these methods is identical to `HashMap::retain` and `HashSet::retain`, which were implemented in rust-lang#39560 and stabilized in rust-lang#36648.  The docs and tests are also copied from HashMap/HashSet.
    
    The new methods are unstable, behind the `btree_retain` feature gate, with tracking issue rust-lang#79025.  See also rust-lang/rfcs#1338.
    Dylan-DPC committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    d82ad6c View commit details
    Browse the repository at this point in the history