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

Merged
merged 18 commits into from
Feb 21, 2024
Merged

Rollup of 8 pull requests #121400

merged 18 commits into from
Feb 21, 2024

Commits on Feb 20, 2024

  1. Configuration menu
    Copy the full SHA
    9c8b107 View commit details
    Browse the repository at this point in the history
  2. some type system cleanup

    lcnr committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    5fb67e2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ae3f4f1 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

  1. Merge diagnostic_builder.rs into diagnostic.rs.

    Because:
    - `diagnostic_builder.rs` is small (282 lines),
    - `Diagnostic` and `DiagnosticBuilder` are closely related types, and
    - there's already an `impl DiagnosticBuilder` block in `diagnostic.rs`.
    
    At the same time, reorder a few of things already in `diagnostic.rs`,
    e.g. move `struct Diagnostic` just before `impl Diagnostic`.
    
    This commit only moves code around. There are no functional changes.
    nnethercote committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    8f20a54 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1407057 View commit details
    Browse the repository at this point in the history
  3. Remove an unchecked_error_guaranteed call.

    If we abort immediately after complaining about the obsolete `impl Trait
    for ..` syntax, then we avoid reaching HIR lowering. This means we can
    use `TyKind::Dummy` instead of `TyKind::Err`.
    nnethercote committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    09ca866 View commit details
    Browse the repository at this point in the history
  4. Tweak block management

    Nadrieril committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    780beda View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c1514a6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9eabdc2 View commit details
    Browse the repository at this point in the history
  7. compiletest: support auxiliaries with auxiliaries

    To test behaviour that depends on the extern options of intermediate
    crates, compiletest auxiliaries must have their own auxiliaries.
    
    Auxiliary compilation previously did not trigger compilation of any
    auxiliaries in the auxiliary's headers. In addition, those auxiliaries
    would need to be in an `auxiliary/auxiliary` directory, which is
    unnecessary and makes some crate graphs harder to write tests for,
    such as when A depends on B and C, and B depends on C.
    
    For a test `tests/ui/$path/root.rs`, with the following crate graph:
    
    ```
    root
    |-- grandparent
    `-- parent
        `-- grandparent
    ```
    
    then the intermediate outputs from compiletest will be:
    
    ```
    build/$target/test/ui/$path/
    |-- auxiliary
    |   |-- libgrandparent.dylib
    |   |-- libparent.dylib
    |   |-- grandparent
    |   |   |-- grandparent.err
    |   |   `-- grandparent.out
    |   `-- parent
    |       |-- parent.err
    |       `-- parent.out
    |-- libroot.rmeta
    |-- root.err
    `-- root.out
    ```
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    a2aa967 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#121044 - compiler-errors:mbe-async-trait-bo…

    …unds, r=fmease
    
    Support async trait bounds in macros
    
    r? fmease
    
    This is similar to your work on const trait bounds. This theoretically regresses `impl async $ident:ident` in macros, but I doubt this is occurring in practice.
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    082b97a View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#121175 - Nadrieril:simplify-or-selection, r…

    …=matthewjasper
    
    match lowering: test one or pattern at a time
    
    This is a bit more opinionated than the previous PRs. On the face of it this is less efficient and more complex than before, but I personally found the loop that digs into `leaf_candidates` on each iteration very confusing. Instead this does "generate code for this or-pattern" then "generate further code for each branch if needed" in two steps.
    
    Incidentally this way we don't _require_ or patterns to be sorted at the end. It's still an important optimization but I find it clearer to not rely on it for correctness.
    
    r? `@matthewjasper`
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    4daa43a View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#121340 - GrigorenkoPV:bootstrap-clippy, r=o…

    …nur-ozkan
    
    bootstrap: apply most of clippy's suggestions
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    216f9a4 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#121347 - davidtwco:compiletest-aux-aux, r=o…

    …li-obk
    
    compiletest: support auxiliaries with auxiliaries
    
    To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries.
    
    Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C.
    
    For a test `tests/ui/$path/root.rs`, with the following crate graph:
    
    ```
    root
    |-- grandparent
    `-- parent
        `-- grandparent
    ```
    
    then the intermediate outputs from compiletest will be:
    
    ```
    build/$target/test/ui/$path/
    |-- auxiliary
    |   |-- libgrandparent.dylib
    |   |-- libparent.dylib
    |   |-- grandparent
    |   |   |-- grandparent.err
    |   |   `-- grandparent.out
    |   `-- parent
    |       |-- parent.err
    |       `-- parent.out
    |-- libroot.rmeta
    |-- root.err
    `-- root.out
    ```
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    2d98f05 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#121359 - lcnr:typesystem-cleanup, r=compile…

    …r-errors
    
    miscellaneous type system improvements
    
    see review comments for rationale
    
    r? `@compiler-errors`
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    8d27fc8 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#121366 - nnethercote:rm-diagnostic_builder.…

    …rs, r=compiler-errors
    
    Remove `diagnostic_builder.rs`
    
    rust-lang#120576 moved a big chunk of `DiagnosticBuilder`'s functionality out of `diagnostic_builder.rs` into `diagnostic.rs`, which left `DiagnosticBuilder` spread across the two files.
    
    This PR fixes that messiness by merging what remains of `diagnostic_builder.rs` into `diagnostic.rs`.
    
    This is part of rust-lang/compiler-team#722.
    
    r? `@davidtwco`
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    ef14c17 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#121379 - nnethercote:rm-unchecked_error_gua…

    …ranteed, r=oli-obk
    
    Remove an `unchecked_error_guaranteed` call.
    
    If we abort immediately after complaining about the obsolete `impl Trait for ..` syntax, then we avoid reaching HIR lowering. This means we can use `TyKind::Dummy` instead of `TyKind::Err`.
    
    r? `@oli-obk`
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    ae01e99 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#121396 - RalfJung:mir-const-value-inspect, …

    …r=oli-obk
    
    make it possible for outside crates to inspect a mir::ConstValue with the interpreter
    
    For MiniRust we need to convert MIR constant values into MiniRust constant values. However, it's not currently possible to get nice high-level access to the inerts of a `ConstValue`: we can access the raw contents (the allocation / `ScalarInt`), but if it is e.g. of enum type and we want to determine which variant is encoded, we are stuck. There's only `try_destructure_mir_constant_for_user_output` which is meant for diagnostics, so it doesn't fit.
    
    The interpreter has all the APIs to traverse such a value, so we just need a way to get such a ConstValue into an interpreter instance. This adds the public functions necessary to make that happen.
    fmease authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    bd7ba27 View commit details
    Browse the repository at this point in the history