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 9 pull requests #119648

Merged
merged 32 commits into from
Jan 6, 2024
Merged

Commits on Dec 29, 2023

  1. bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo

    It prevents a full rebuild of stage 1 compiler when issuing "x.py test"
    with rust.lto != thin-local in config.toml.
    xry111 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    786e0bb View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2023

  1. Configuration menu
    Copy the full SHA
    1ab60f2 View commit details
    Browse the repository at this point in the history
  2. rustdoc-search: tighter encoding for f index

    Two optimizations for the function signature search:
    
    * Instead of using JSON arrays, like `[1,20]`, it uses VLQ
      hex with no commas, like `[aAd]`.
    * This also adds backrefs: if you have more than one function
      with exactly the same signature, it'll not only store it once,
      it'll *decode* it once, and store in the typeIdMap only once.
    
    Size change
    -----------
    
    standard library
    
    ```console
    $ du -bs search-index-old.js search-index-new.js
    4976370 search-index-old.js
    4404391 search-index-new.js
    ```
    
    ((4976370-4404391)/4404391)*100% = 12.9%
    
    Benchmarks are similarly shrunk:
    
    ```console
    $ du -hs tmp/{arti,cortex-m,sqlx,stm32f4,ripgrep}/toolchain_{old,new}/doc/search-index.js
    10555067        tmp/arti/toolchain_old/doc/search-index.js
    8921236 tmp/arti/toolchain_new/doc/search-index.js
    77018   tmp/cortex-m/toolchain_old/doc/search-index.js
    66676   tmp/cortex-m/toolchain_new/doc/search-index.js
    2876330 tmp/sqlx/toolchain_old/doc/search-index.js
    2436812 tmp/sqlx/toolchain_new/doc/search-index.js
    63632890        tmp/stm32f4/toolchain_old/doc/search-index.js
    52337438        tmp/stm32f4/toolchain_new/doc/search-index.js
    631150  tmp/ripgrep/toolchain_old/doc/search-index.js
    541646  tmp/ripgrep/toolchain_new/doc/search-index.js
    ```
    notriddle committed Dec 31, 2023
    Configuration menu
    Copy the full SHA
    86b9550 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

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

Commits on Jan 5, 2024

  1. Configuration menu
    Copy the full SHA
    506b9f9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df0df52 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cd3a976 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d4d2f14 View commit details
    Browse the repository at this point in the history
  5. coverage: Split out SpanFromMir from CoverageSpan

    This draws a clear distinction between the fields/methods that are needed by
    initial span extraction and preprocessing, and those that are needed by the
    main "refinement" loop.
    Zalathar committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    cd50843 View commit details
    Browse the repository at this point in the history
  6. coverage: Make the remaining fields of CoverageSpan non-public

    The struct itself is already non-public, so having public fields doesn't
    achieve anything.
    Zalathar committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    514e026 View commit details
    Browse the repository at this point in the history
  7. Allow emitting diagnostics from the #[diagnostic] namespace without a

    nightly feature
    
    (Using this attribute still requires a nightly feature, this just
    enables that this feature does not need to be enabled on the child crate
    as well)
    weiznich committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    ddfcf86 View commit details
    Browse the repository at this point in the history
  8. Replace some usage of #[rustc_on_unimplemented] with

    `#[diagnostic::on_unimplemented]`
    
    This commit replaces those `#[rustc_on_unimplemented]` attributes with
    their equivalent `#[diagnostic::on_unimplemented]` where this is
    supported (So no filter or any extended option)
    weiznich committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    2c3aeea View commit details
    Browse the repository at this point in the history
  9. Add a test that emitting diagnostics does not require the crate to use

    the corresponding feature.
    weiznich committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    91e1af3 View commit details
    Browse the repository at this point in the history
  10. remove duplicate test

    RalfJung committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    97c8238 View commit details
    Browse the repository at this point in the history
  11. Ignore a rustdoc test

    fmease committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    54967d7 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    004bfc5 View commit details
    Browse the repository at this point in the history
  13. fix OOM when ty::Instance is used in query description

    Lukas Markeffsky committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    2746748 View commit details
    Browse the repository at this point in the history
  14. fix cycle error for "use constructor" suggestion

    Lukas Markeffsky committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    339fa31 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7366bda View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6dfdeab View commit details
    Browse the repository at this point in the history
  17. Rebase fallout.

    cjgillot committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    eeaea57 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    0489fd0 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0d70e58 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2024

  1. Rollup merge of rust-lang#119208 - Zalathar:hoist, r=WaffleLapkin,Swa…

    …tinem
    
    coverage: Hoist some complex code out of the main span refinement loop
    
    The span refinement loop in `spans.rs` takes the spans that have been extracted from MIR, and modifies them to produce more helpful output in coverage reports.
    
    It is also one of the most complicated pieces of code in the coverage instrumentor. It has an abundance of moving pieces that make it difficult to understand, and most attempts to modify it end up accidentally changing its behaviour in unacceptable ways.
    
    This PR nevertheless tries to make a dent in it by hoisting two pieces of special-case logic out of the main loop, and into separate preprocessing passes. Coverage tests show that the resulting mappings are *almost* identical, with all known differences being unimportant.
    
    This should hopefully unlock further simplifications to the refinement loop, since it now has fewer edge cases to worry about.
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    bacddd3 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#119216 - weiznich:use_diagnostic_namespace_…

    …in_stdlib, r=compiler-errors
    
    Use diagnostic namespace in stdlib
    
    This required a minor fix to have the diagnostics shown in third party crates when the `diagnostic_namespace` feature is not enabled. See rust-lang@5d63f5d for details. I've opted for having a single PR for both changes as it's really not that much code. If it is required it should be easy to split up the change into several PR's.
    
    r? `@compiler-errors`
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    d90c702 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#119414 - xry111:xry111/lto-test, r=Mark-Sim…

    …ulacrum
    
    bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo
    
    It prevents a full rebuild of stage 1 compiler when issuing "x.py test" with rust.lto != thin-local in config.toml.
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    98ba299 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#119420 - cjgillot:issue-119295, r=compiler-…

    …errors
    
    Handle ForeignItem as TAIT scope.
    
    Fixes rust-lang#119295
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    9585ebc View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#119468 - notriddle:notriddle/compression, r…

    …=GuillaumeGomez
    
    rustdoc-search: tighter encoding for f index
    
    Depends on rust-lang#119457
    
    Two optimizations for the function signature search:
    
    * Instead of using JSON arrays, like `[1,20]`, it uses VLQ
      hex with no commas, like `[aAd]`.
    * This also adds backrefs: if you have more than one function
      with exactly the same signature, it'll not only store it once,
      it'll *decode* it once, and store in the typeIdMap only once.
    
    Based partially on discussions on zulip:
    https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/search.20index.20size
    
    Performance
    -----------
    
    https://notriddle.com/rustdoc-html-demo-8/compression-perf-v2/index.html
    
    ### memory/time profiler output (for more details, consult the above link)
    
    <table>
    <thead><tr><th>benchmark<th>before<th>after</tr></thead>
    <tbody>
    <tr><th>arti<td>
    
    ```
    user: 002.789 s
    sys:  000.390 s
    wall: 002.096 s
    child_RSS_high:     440796 KiB
    group_mem_high:     414924 KiB
    ```
    
    </td><td>
    
    ```
    user: 002.295 s
    sys:  000.278 s
    wall: 001.738 s
    child_RSS_high:     314588 KiB
    group_mem_high:     285220 KiB
    ```
    
    </td></tr><tr><th>cortex-m<td>
    
    ```
    user: 000.127 s
    sys:  000.030 s
    wall: 000.134 s
    child_RSS_high:      60264 KiB
    group_mem_high:      23824 KiB
    ```
    
    </td><td>
    
    ```
    user: 000.136 s
    sys:  000.038 s
    wall: 000.137 s
    child_RSS_high:      59204 KiB
    group_mem_high:      22712 KiB
    ```
    
    </td></tr><tr><th>sqlx<td>
    
    ```
    user: 000.887 s
    sys:  000.118 s
    wall: 000.592 s
    child_RSS_high:     190408 KiB
    group_mem_high:     157804 KiB
    ```
    
    </td><td>
    
    ```
    user: 000.798 s
    sys:  000.101 s
    wall: 000.525 s
    child_RSS_high:     159292 KiB
    group_mem_high:     126292 KiB
    ```
    
    </td></tr><tr><th>stm32f4<td>
    
    ```
    user: 013.884 s
    sys:  005.399 s
    wall: 013.149 s
    child_RSS_high:    1942244 KiB
    group_mem_high:    1954916 KiB
    ```
    
    </td><td>
    
    ```
    user: 006.128 s
    sys:  003.297 s
    wall: 007.994 s
    child_RSS_high:    1038108 KiB
    group_mem_high:    1023900 KiB
    ```
    
    </td></tr><tr><th>ripgrep<td>
    
    ```
    user: 000.441 s
    sys:  000.063 s
    wall: 000.264 s
    child_RSS_high:     109180 KiB
    group_mem_high:      74272 KiB
    ```
    
    </td><td>
    
    ```
    user: 000.408 s
    sys:  000.044 s
    wall: 000.238 s
    child_RSS_high:     101488 KiB
    group_mem_high:      66000 KiB
    ```
    
    </td></tr></tbody></table>
    
    Size change
    -----------
    
    standard library without gzip:
    
    ```console
    $ du -bs search-index-old.js search-index-new.js
    4976370 search-index-old.js
    4404391 search-index-new.js
    ```
    
    ((4976370-4404391)/4404391)*100% = 12.9%
    
    with gzip:
    
    ```console
    $ du -hs search-index-old.js.gz search-index-new.js.gz
    520K    search-index-old.js.gz
    504K    search-index-new.js.gz
    
    $ du -bs search-index-old.js.gz search-index-new.js.gz
    522092  search-index-old.js.gz
    507654  search-index-new.js.gz
    ```
    
    ((522092-507654)/507654)*100% = 2.8%
    
    Benchmarks are similarly shrunk.
    
    Without gzip:
    
    ```console
    $ du -hs tmp/{arti,cortex-m,sqlx,stm32f4,ripgrep}/toolchain_{old,new}/doc/search-index.js
    10555067        tmp/arti/toolchain_old/doc/search-index.js
    8921236 tmp/arti/toolchain_new/doc/search-index.js
    77018   tmp/cortex-m/toolchain_old/doc/search-index.js
    66676   tmp/cortex-m/toolchain_new/doc/search-index.js
    2876330 tmp/sqlx/toolchain_old/doc/search-index.js
    2436812 tmp/sqlx/toolchain_new/doc/search-index.js
    63632890        tmp/stm32f4/toolchain_old/doc/search-index.js
    52337438        tmp/stm32f4/toolchain_new/doc/search-index.js
    631150  tmp/ripgrep/toolchain_old/doc/search-index.js
    541646  tmp/ripgrep/toolchain_new/doc/search-index.js
    ```
    
    With gzip:
    
    ```console
    $ du -bs tmp/{arti,cortex-m,sqlx,stm32f4,ripgrep}/toolchain_{old,new}/doc/search-index.js.gz
    1618852 tmp/arti/toolchain_old/doc/search-index.js.gz
    1582007 tmp/arti/toolchain_new/doc/search-index.js.gz
    16109   tmp/cortex-m/toolchain_old/doc/search-index.js.gz
    15831   tmp/cortex-m/toolchain_new/doc/search-index.js.gz
    422257  tmp/sqlx/toolchain_old/doc/search-index.js.gz
    411507  tmp/sqlx/toolchain_new/doc/search-index.js.gz
    4454761 tmp/stm32f4/toolchain_old/doc/search-index.js.gz
    4334924 tmp/stm32f4/toolchain_new/doc/search-index.js.gz
    98312   tmp/ripgrep/toolchain_old/doc/search-index.js.gz
    96864   tmp/ripgrep/toolchain_new/doc/search-index.js.gz
    
    $ du -hs tmp/{arti,cortex-m,sqlx,stm32f4,ripgrep}/toolchain_{old,new}/doc/search-index.j
    s.gz
    1.6M    tmp/arti/toolchain_old/doc/search-index.js.gz
    1.6M    tmp/arti/toolchain_new/doc/search-index.js.gz
    24K     tmp/cortex-m/toolchain_old/doc/search-index.js.gz
    24K     tmp/cortex-m/toolchain_new/doc/search-index.js.gz
    424K    tmp/sqlx/toolchain_old/doc/search-index.js.gz
    412K    tmp/sqlx/toolchain_new/doc/search-index.js.gz
    4.3M    tmp/stm32f4/toolchain_old/doc/search-index.js.gz
    4.2M    tmp/stm32f4/toolchain_new/doc/search-index.js.gz
    108K    tmp/ripgrep/toolchain_old/doc/search-index.js.gz
    104K    tmp/ripgrep/toolchain_new/doc/search-index.js.gz
    ```
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    b3f3074 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#119628 - RalfJung:duplicate-test, r=compile…

    …r-errors
    
    remove duplicate test
    
    This was added in rust-lang@ace6fc3 where overflowing-rsh-6 differed from overflowing-rsh-5 in a feature gate, but the feature has since been stabilized, making the tests 100% identical.
    
    Most of these tests in numbers-arithmetic could be put into one file rather than having so many files that all test the same lint... but it doesn't seem worth the effort. After rust-lang#119432 we might be able to remove most of them entirely as they will be covered by the new tests added there.
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    a95a363 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#119638 - lukas-code:suggest-constructor-cyc…

    …le-error, r=cjgillot
    
    fix cyle error when suggesting to use associated function instead of constructor
    
    Fixes rust-lang#119625.
    
    The first commit fixes the infinite recursion and makes the cycle error actually show up. We do this by making the `Display` for `ty::Instance` impl  respect `with_no_queries` so that it can be used in query descriptions.
    
    The second commit fixes the cycle error `resolver_for_lowering` -> `normalize` -> `resolve_instance` (for evaluating const) -> `lang_items` (for `drop_in_place`) -> `resolver_for_lowering` (for collecting lang items). We do this by simply skipping the suggestion when encountering an unnormalized type.
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    61c776a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#119640 - petrochenkov:rtstartup, r=Mark-Sim…

    …ulacrum
    
    library: Fix warnings in rtstartup
    
    Not sure why global `deny(warnings)` in bootstrap doesn't apply to this code, it did in the past.
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    a98993c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#119642 - petrochenkov:winstdtest, r=ChrisDe…

    …nton
    
    library: Fix a symlink test failing on Windows
    compiler-errors committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    71610e2 View commit details
    Browse the repository at this point in the history