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

Merged
merged 21 commits into from
Jul 31, 2024
Merged

Rollup of 9 pull requests #128435

merged 21 commits into from
Jul 31, 2024

Commits on Jul 16, 2024

  1. When an archive fails to build, print the path

    Currently the output on failure is as follows:
    
           Compiling block-buffer v0.10.4
           Compiling crypto-common v0.1.6
           Compiling digest v0.10.7
           Compiling sha2 v0.10.8
           Compiling xz2 v0.1.7
        error: failed to build archive: No such file or directory
    
        error: could not compile `bootstrap` (lib) due to 1 previous error
    
    Print which file is being constructed to give some hint about what is
    going on.
    tgross35 committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    e0af3c6 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Structured suggestion for extern crate foo when foo isn't resolve…

    …d in import
    
    When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate.
    
    When encountering `_` in an import, do not suggest `extern crate _;`.
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ maybe a missing crate `spam`?
       |
    help: consider importing the `spam` crate
       |
    LL + extern crate spam;
       |
    ```
    estebank committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b61570a View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    918cdcc View commit details
    Browse the repository at this point in the history
  2. Attribute checking simplifications

    remove an unused boolean and then merge two big matches into one
    oli-obk committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    67a08b5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e7f89a7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fe6478c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e657773 View commit details
    Browse the repository at this point in the history
  6. bump-stage0: use IndexMap for determinism

    When it used `HashMap`, `bump-stage0` would change `src/stage0` every
    time it ran, whereas `IndexMap` will keep insertion order -- matching
    the manifest file.
    cuviper committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    3659d9d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2e9298b View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Print thir::PatRange, not its surrounding thir::Pat

    This further reduces the amount of code that relies on `thir::Pat` being
    printable.
    Zalathar committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    a2b3256 View commit details
    Browse the repository at this point in the history
  2. Revert "Make thir::Pat not implement fmt::Display directly"

    This reverts commit ae0ec73.
    
    The original change in rust-lang#128304 was intended to be a step towards being able to
    print `thir::Pat` even after switching to `PatId`.
    
    But because the only patterns that need to be printed are the synthetic ones
    created by pattern analysis (for diagnostic purposes only), it makes more sense
    to completely separate the printable patterns from the real THIR patterns.
    Zalathar committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    a9ea85e View commit details
    Browse the repository at this point in the history
  3. Use a separate pattern type for rustc_pattern_analysis diagnostics

    The pattern-analysis code needs to print patterns, as part of its user-visible
    diagnostics. But it never actually tries to print "real" patterns! Instead, it
    only ever prints synthetic patterns that it has reconstructed from its own
    internal represenations.
    
    We can therefore simultaneously remove two obstacles to changing `thir::Pat`,
    by having the pattern-analysis code use its own dedicated type for building
    printable patterns, and then making `thir::Pat` not printable at all.
    Zalathar committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    dd5a8d7 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#126454 - cuviper:deterministic-bump, r=Kobzol

    bump-stage0: use IndexMap for determinism
    
    When it used `HashMap`, `bump-stage0` would change `src/stage0` every
    time it ran, whereas `IndexMap` will keep insertion order -- matching
    the manifest file.
    
    I included an actual bump here mainly to reset the order, but that did
    update to a new rustfmt nightly too.
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    579eb68 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#127681 - dingxiangfei2009:smart-ptr-bounds,…

    … r=compiler-errors
    
    derive(SmartPointer): rewrite bounds in where and generic bounds
    
    Fix rust-lang#127647
    
    Due to the `Unsize` bounds, we need to commute the bounds on the pointee type to the new self type.
    
    cc ```@Darksonn```
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    563f938 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#127830 - tgross35:archive-failure-message, …

    …r=BoxyUwU
    
    When an archive fails to build, print the path
    
    Currently the output on failure is as follows:
    
           Compiling block-buffer v0.10.4
           Compiling crypto-common v0.1.6
           Compiling digest v0.10.7
           Compiling sha2 v0.10.8
           Compiling xz2 v0.1.7
        error: failed to build archive: No such file or directory
    
        error: could not compile `bootstrap` (lib) due to 1 previous error
    
    Change this to print which file is being constructed, to give some hint about what is going on.
    
        error: failed to build archive at `path/to/output`: No such file or directory
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    75dfe1e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#128151 - estebank:missing-extern-crate, r=p…

    …etrochenkov
    
    Structured suggestion for `extern crate foo` when `foo` isn't resolved in import
    
    When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate.
    
    When encountering `_` in an import, do not suggest `extern crate _;`.
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ maybe a missing crate `spam`?
       |
    help: consider importing the `spam` crate
       |
    LL + extern crate spam;
       |
    ```
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    336a378 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#128387 - liigo:patch-14, r=tgross35

    More detailed note to deprecate ONCE_INIT
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    22dbf88 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#128388 - beetrees:f16-f128-slightly-improve…

    …-windows-abi, r=tgross35
    
    Match LLVM ABI in `extern "C"` functions for `f128` on Windows
    
    As MSVC doesn't support `_Float128`, x86-64 Windows doesn't have a defined ABI for `f128`. Currently, Rust will pass and return `f128` indirectly for `extern "C"` functions. This is inconsistent with LLVM, which passes and returns `f128` in XMM registers, meaning that e.g. the ABI of `extern "C"` compiler builtins won't match. This PR fixes this discrepancy by making the x86-64 Windows `extern "C"` ABI pass `f128` directly through to LLVM, so that Rust will follow whatever LLVM does. This still leaves the difference between LLVM and GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054) but this PR is still an improvement as at least Rust is now consistent with it's primary codegen backend and compiler builtins from `compiler-builtins` will now work.
    
    I've also fixed the x86-64 Windows `has_reliable_f16` match arm in `std` `build.rs` to refer to the correct target, and added an equivalent match arm to `has_reliable_f128` as the LLVM-GCC ABI difference affects both `f16` and `f128`.
    
    Tracking issue: rust-lang#116909
    
    try-job: x86_64-msvc
    try-job: x86_64-mingw
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    5c63363 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#128402 - oli-obk:checked_attrs, r=compiler-…

    …errors
    
    Attribute checking simplifications
    
    remove an unused boolean and then merge two big matches into one
    
    I was reviewing some attributes and realized we don't really check this list against the list of builtin attributes, so we "may" totally be missing some attributes that we should be checking (like the `coroutine` attribute, which you can just apply to random stuff)
    
    ```rust
    #![feature(coroutines)]
    #[coroutine]
    struct Foo;
    ```
    
    just compiles for example. Unless we check that the fallthrough match arm is never reached for builtin attributes, we're just going to keep forgetting to add them here, too. I can do that without the changes in this PR, but it seemed like a nice cleanup
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    e2d8f1a View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#128412 - compiler-errors:crate-level-only, …

    …r=cjgillot
    
    Remove `crate_level_only` from `ELIDED_LIFETIMES_IN_PATHS`
    
    As far as I can tell, we provide the right node id to the `ELIDED_LIFETIMES_IN_PATHS` lint:
    
    https://github.com/rust-lang/rust/blob/f8060d282d42770fadd73905e3eefb85660d3278/compiler/rustc_resolve/src/late.rs#L2015-L2027
    
    So I've gone ahead and removed the restriction from this lint.
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    06b8372 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#128430 - Zalathar:print-pat, r=Nadrieril

    Use a separate pattern type for `rustc_pattern_analysis` diagnostics
    
    The pattern-analysis code needs to print patterns, as part of its user-visible diagnostics. But it never actually tries to print "real" patterns! Instead, it only ever prints synthetic patterns that it has reconstructed from its own internal represenations.
    
    We can therefore simultaneously remove two obstacles to changing `thir::Pat`, by having the pattern-analysis code use its own dedicated type for building printable patterns, and then making `thir::Pat` not printable at all.
    
    r? `@Nadrieril`
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    031093f View commit details
    Browse the repository at this point in the history