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

Merged
merged 26 commits into from
Sep 19, 2023
Merged

Rollup of 8 pull requests #115952

merged 26 commits into from
Sep 19, 2023

Commits on Sep 15, 2023

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

Commits on Sep 18, 2023

  1. coverage: Fix an unstable-sort inconsistency in coverage spans

    This code was calling `sort_unstable_by`, but failed to impose a total order on
    the initial spans. That resulted in unpredictable handling of closure spans,
    producing inconsistencies in the coverage maps and in user-visible coverage
    reports.
    
    This patch fixes the problem by always sorting closure spans before
    otherwise-identical non-closure spans, and also switches to a stable sort in
    case the ordering is still not total.
    Zalathar committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    4690f97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a4cb31b View commit details
    Browse the repository at this point in the history
  3. coverage: Simplify sorting of coverage spans extracted from MIR

    Switching to `Ordering::then_with` makes control-flow less complicated, and
    there is no need to use `partial_cmp` here.
    Zalathar committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    01b67f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    354397f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bf693d1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6496181 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dcb3e70 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c2841e2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    94920cc View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    82471e9 View commit details
    Browse the repository at this point in the history
  11. Migrate 'trivial cast' lint

    clubby789 committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    80a9699 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9c5de75 View commit details
    Browse the repository at this point in the history
  13. make more pretty

    BoxyUwU committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    b2bf4b6 View commit details
    Browse the repository at this point in the history
  14. Add myself to .mailmap

    lnicola committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    de6de23 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    10a5b9a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    f27c06c View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#115869 - ferrocene:pa-fix-tests-cargo-remap…

    …, r=compiler-errors
    
    Avoid blessing cargo deps's source code in ui tests
    
    Before this PR, the source code of dependencies was included in UI test error messages whenever possible. Unfortunately, "whenever possible" means in some cases the source code wouldn't be injected, resulting in a test failure.
    
    One such case is when `$CARGO_HOME` is remapped to something that is not present on disk [^1]. As the remapped path doesn't exist on disk, the source code wouldn't be showed in `tests/ui/issues/issue-21763.rs`:
    
    ```diff
        = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
     note: required because it appears within the type `HashMap<Rc<()>, Rc<()>, RandomState>`
       --> $HASHBROWN_SRC_LOCATION
    -   |
    -LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator + Clone = Global> {
    -   |            ^^^^^^^
     note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
       --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
     note: required by a bound in `foo`
    ```
    
    This PR fixes the problem by always hiding dependencies source code in the error messages generated during UI tests. This is implemented with a new internal flag, `-Z ignore-directory-in-diagnostics-source-blocks=$path`, which compiletest passes during UI tests. Once this is merged, remapping the Cargo home will be supported.
    
    This PR is best reviewed commit-by-commit.
    
    [^1]: After being puzzled for a bit, I discovered why this never impacted `rust-lang/rust`: we don't remap `$CARGO_HOME` :sweat_smile:. Instead, we set `$CARGO_HOME` to `/cargo` in CI, which sort-of-but-not-really achieves the same effect.
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    0eec5e3 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#115873 - BoxyUwU:tykind_adt_debug, r=oli-obk

    Make `TyKind::Adt`'s `Debug` impl be more pretty
    
    Currently `{:?}` on `Ty` for a `TyKind::Adt` would print as `Adt(Foo, [])`. This PR changes it to be `Foo` when there are no generics or `Foo<T>`/`Foo<T, U>` when there _are_ generics. Example from debug log:
    `├─0ms DEBUG rustc_hir_analysis::astconv return=Bar<T/#0, U/#1>`
    
    I should have done this in my initial PR for a prettier TyKind: Debug impl but I thought I would need to be accessing generics_of to figure out where in the "path" the generics would have to go??? but no, adts literally only have a single place the generics can go (on the end). Feel a bit silly about this :)
    
    r? `@oli-obk`
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    48c6051 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#115879 - clubby789:migrate-hir-typeck-cast,…

    … r=compiler-errors
    
    Migrate diagnostics in `hir_typeck/src/cast.rs`
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    970ee09 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#115930 - Zalathar:spans-bug, r=compiler-errors

    coverage: Fix an unstable-sort inconsistency in coverage spans
    
    This code was calling `sort_unstable_by`, but failed to impose a total order on the initial spans. That resulted in unpredictable handling of closure spans, producing inconsistencies in the coverage maps and in user-visible coverage reports.
    
    This PR fixes the problem by always sorting closure spans before otherwise-identical non-closure spans, and also switches to a stable sort in case the ordering is still not total.
    
    ---
    
    In addition to the fix itself, this PR also contains a cleanup to the comparison function that I was working on when I discovered the bug.
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    3cf5a6b View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#115931 - GuillaumeGomez:remove-empty-h2, r=…

    …notriddle
    
    Move mobile topbar title creation entirely into JS
    
    I was looking at potential size improvements and saw that we had an empty `h2` tag for the mobile topbar title that was filled with JS. So at this point, I think it's fine to just completely generate it from JS, like that the w3c HTML validator will emit one less warning.
    
    r? `@notriddle`
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    575e091 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#115941 - lnicola:lnicola-mailmap, r=Mark-Si…

    …mulacrum
    
    Add myself to .mailmap
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    3ddad37 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#115943 - ehuss:compiletest-errors, r=compil…

    …er-errors
    
    compiletest: Don't swallow some error messages.
    
    This updates some error handling in compiletest to display the underlying error rather than discarding it. There have been cases where the lack of error information makes it difficult to understand what went wrong.
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    8c5fc20 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#115949 - GuillaumeGomez:update-browser-ui-t…

    …est, r=notriddle
    
    Update browser-ui-test version
    
    It includes the fix from `@notriddle` (GuillaumeGomez/browser-UI-test#537).
    
    r? `@notriddle`
    matthiaskrgr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    aa55d7d View commit details
    Browse the repository at this point in the history