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 15 pull requests #122338

Merged
merged 50 commits into from
Mar 11, 2024
Merged

Rollup of 15 pull requests #122338

merged 50 commits into from
Mar 11, 2024

Commits on Feb 14, 2024

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

Commits on Feb 15, 2024

  1. Configuration menu
    Copy the full SHA
    5441523 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9a77ec9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f368922 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2024

  1. Configuration menu
    Copy the full SHA
    8bb49e2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6d115f5 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

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

Commits on Feb 22, 2024

  1. Configuration menu
    Copy the full SHA
    3908a93 View commit details
    Browse the repository at this point in the history
  2. Fix llvm hang

    coolreader18 committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    861c7e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    658a0a2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    125b26a View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2024

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

Commits on Feb 27, 2024

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

Commits on Mar 2, 2024

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

Commits on Mar 6, 2024

  1. Configuration menu
    Copy the full SHA
    30fa6a8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3bd8df9 View commit details
    Browse the repository at this point in the history
  3. Rename DropTree::add_entry to add_entry_point

    This clarifies that we're adding an "entry point", not just adding an "entry"
    of some kind.
    Zalathar committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    fbdac30 View commit details
    Browse the repository at this point in the history
  4. Replace tuples in DropTree with named structs

    This allows us to use real field names instead of tuple element numbers.
    
    Renaming `previous_drops` to `existing_drops_map` clarifies that "previous" was
    unrelated to drop order.
    Zalathar committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    5ba70bd View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

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

Commits on Mar 9, 2024

  1. Configuration menu
    Copy the full SHA
    bf47df8 View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    58f6aaa View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Configuration menu
    Copy the full SHA
    3830510 View commit details
    Browse the repository at this point in the history
  2. use ptradd for vtable indexing

    Like field offsets, these are always constant.
    erikdesjardins committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    a7cd803 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    73fc170 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    01e6b43 View commit details
    Browse the repository at this point in the history
  5. unix_sigpipe: Replace inherit with sig_dfl in syntax tests

    The `sig_dfl` variant of the attribute is the most likely variant to be
    stabilized first, and thus to become the "most allowed" variant of the
    attribute. Because of this, it is the most appropriate variant to use in
    syntax tests, because even if the most allowed variant is used, the
    compiler shall still emit errors if it e.g. is used in the wrong places.
    Enselic committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    aea60b0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    816dc96 View commit details
    Browse the repository at this point in the history
  7. LLVM_TOOLS: Include llvm-link as a llvm tool

    Kjetil Kjeka committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    ed252e9 View commit details
    Browse the repository at this point in the history
  8. LLVM Bitcode Linker: Added crate

    Kjetil Kjeka committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    222ce4f View commit details
    Browse the repository at this point in the history
  9. NVPTX: Enable self-contained for the nvptx target

    Kjetil Kjeka committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    af42d2a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    43f2055 View commit details
    Browse the repository at this point in the history
  11. Bootstrap: Add argument for building llvm bitcode linker

    Kjetil Kjeka committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    6a50d05 View commit details
    Browse the repository at this point in the history
  12. NVPTX: Enable previously disabled tests

    Kjetil Kjeka committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    843dd28 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    279465b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fb802f2 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#116791 - WaffleLapkin:unparallel-backends, …

    …r=oli-obk
    
    Allow codegen backends to opt-out of parallel codegen
    
    This makes it a bit easier to write cursed codegen backends.
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    88d387b View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#116793 - WaffleLapkin:target_rules_the_back…

    …end, r=cjgillot
    
    Allow targets to override default codegen backend
    
    Implements rust-lang/compiler-team#670.
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    86af4d2 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#117458 - kjetilkjeka:embedded-linker, r=pet…

    …rochenkov
    
    LLVM Bitcode Linker: A self contained linker for nvptx and other targets
    
    This PR introduces a new linker named `llvm-bitcode-linker`. It is a `self-contained` linker that can be used to link programs in `llbc` before optimizing and compiling to native code. It will first be used internally in the Rust compiler to enable tests for the `nvptx64-nvidia-cuda` target as the original `rust-ptx-linker` is deprecated. It will then be provided to users of the `nvptx64-nvidia-cuda` target with the purpose of linking ptx. More targets than nvptx will also be supported eventually.
    
    The PR introduces a new unstable `LinkerFlavor` for the compiler. The compiler will also not be shipped with rustc but most likely instead be shipped in it's own unstable component (a follow up PR will be opened for this). This means that merging this PR should not add any stability guarantees.
    
    When more details of `self-contained` is implemented it will only be possible to use the linker when `-Clink-self-contained=+linker` is passed.
    
    <details>
      <summary>Original Description</summary>
    
    **When this PR was created it was focused a bit differently. The original text is preserved here in case there's some interests in it**
    
    I have experimenting with approaches to replace the ptx-linker and enable the nvptx target tests again. I think it's time to get some feedback on the approach.
    
    ### The problem
    The only useful linker for the nvptx target is [this crate](https://github.com/denzp/rust-ptx-linker). Since this linker performs linking on llvm bitcode it needs to track the llvm version of rustc and use the same format. It has not been maintained for 3+ years and must be considered abandoned. Over the years rust have upgraded LLVM while the linker has been left to bitrot. It is no longer in a usable state.
    
    Due to the difficulty of keeping the ptx-linker up to date outside of tree the nvptx tests was [disabled a long time ago](rust-lang@f8f9a28). It was [previously discussed](rust-lang#96842 (comment)) if adding the ptx-linker to the rust repo would be a possibility. My efforts in doing this stopped at getting an answered if the license would prohibit it from inclusion in the [Rust repo](rust-lang#96842 (comment)). I therefore concluded that a re-write would be necessary.
    
    ### The possible solution presented here
    The llvm tools know perfectly well how to link and optimize llvm bitcode. Each of them only perform a single task, and are therefore a bit cumbersome to call with the current linker approach rustc takes.
    
    This PR adds a simple tool (current name `embedded-linker`) which can link self contained (often embedded) programs in llvm bitcode before compiling to the target format. Optimization will also be performed if lto is enabled. The rust compiler will make a single invocation to this tool, while the tool will orchestrate the many calls to the llvm tools.
    
    ### The questions
     - Is having control over the nvptx linking and therefore also tests worth it to add such tool? or should the tool live outside the rust repo?
     - Is the approach of calling llvm tools acceptable? Or would we want to keep the ptx-linker approach of using the llvm library? The tools seems to provide more simplicity and stability, but more intermediate files are being written. Perhaps there also are some performance penalty for the calling tools approach.
     - What is the process for adding such tool? MCP?
     - Does adding `llvm-link` to the llvm-tool component require any process?
     - Does it require some sort of FCP to remove ptx-linker as the default linker for ptx? Or is it sufficient that using the upstream ptx-linker is broken in its current state. it is possible to use a somewhat patched version of ptx-linker.
    </details>
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    e1ceadc View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#119385 - fmease:assoc-const-eq-fixes-2, r=o…

    …li-obk,cjgillot
    
    Fix type resolution of associated const equality bounds (take 2)
    
    Instead of trying to re-resolve the type of assoc const bindings inside the `type_of` query impl in an incomplete manner, transfer the already (correctly) resolved type from `add_predicates_for_ast_type_binding` to `type_of`/`anon_type_of` through query feeding.
    
    ---
    
    Together with rust-lang#118668 (merged) and rust-lang#121258, this supersedes rust-lang#118360.
    Fixes rust-lang#118040.
    
    r? ``@ghost``
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    a450339 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#121438 - coolreader18:wasm32-panic-unwind, …

    …r=cuviper
    
    std support for wasm32 panic=unwind
    
    Tracking issue: rust-lang#118168
    
    This adds std support for `-Cpanic=unwind` on wasm, and with it slightly more fleshed out rustc support. Now, the stable default is still panic=abort without exception-handling, but if you `-Zbuild-std` with `RUSTFLAGS=-Cpanic=unwind`, you get wasm exception-handling try/catch blocks in the binary:
    
    ```rust
    #[no_mangle]
    pub fn foo_bar(x: bool) -> *mut u8 {
        let s = Box::<str>::from("hello");
        maybe_panic(x);
        Box::into_raw(s).cast()
    }
    
    #[inline(never)]
    #[no_mangle]
    fn maybe_panic(x: bool) {
        if x {
            panic!("AAAAA");
        }
    }
    ```
    ```wat
    ;; snip...
    (try $label$5
     (do
      (call $maybe_panic
       (local.get $0)
      )
      (br $label$1)
     )
     (catch_all
      (global.set $__stack_pointer
       (local.get $1)
      )
      (call $__rust_dealloc
       (local.get $2)
       (i32.const 5)
       (i32.const 1)
      )
      (rethrow $label$5)
     )
    )
    ;; snip...
    ```
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    1279830 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#121893 - RalfJung:const-interior-mut-tests,…

    … r=oli-obk
    
    Add tests (and a bit of cleanup) for interior mut handling in promotion and const-checking
    
    Basically these are the parts of rust-lang#121786 that can be salvaged.
    
    r? ``@oli-obk``
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    9300fbb View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#122080 - Zalathar:drop-tree, r=oli-obk

    Clarity improvements to `DropTree`
    
    These changes are based on some points of confusion I had when initially trying to understand this code.
    
    The only “functional” change is an additional assertion in `<ExitScopes as DropTreeBuilder>::link_entry_point`, checking that the dummy terminator is `TerminatorKind::UnwindResume` as expected.
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    e3f9b2f View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#122152 - wutchzone:120892, r=fmease

    Improve diagnostics for parenthesized type arguments
    
    Fixes rust-lang#120892
    
    r? fmease
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    05ff86c View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#122166 - beetrees:remove-field-remapping, r…

    …=davidtwco
    
    Remove the unused `field_remapping` field from `TypeLowering`
    
    The `field_remapping` field of `TypeLowering` has  been unused since rust-lang#121665. This PR removes it, then replaces the `TypeLowering` struct with its only remaining member `&'ll Type`.
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    afa0581 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#122249 - RalfJung:machine-read-hook, r=oli-obk

    interpret: do not call machine read hooks during validation
    
    Fixes rust-lang/miri#3347
    
    r? ``@oli-obk``
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    f6ca425 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#122299 - compiler-errors:bt-for-must-diag, …

    …r=nnethercote
    
    Store backtrace for `must_produce_diag`
    
    This makes it significantly easier to debug a `must_produce_diag` ICE, since we have no other way to know where the heck the bug originates from.
    
    Backtrace rendering kinda sucks right now since we're just printing it in the panic message; happy to apply some suggestions to make it prettier or reuse other bug printing machinery, but also don't want to iterate too much on the rendering since this really is just for debug purposes.
    
    r? nnethercote
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    671fc18 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#122318 - compiler-errors:next-solver-tests,…

    … r=lcnr
    
    Revision-related tweaks for next-solver tests
    
    1. Add `ignore-compare-mode-next-solver` to any test that already has explicit `current next` revisions, since the test failures when testing with `--compare-mode=next-solver` will be false positives.
    2. Explicitly add revisions to a handful of tests where we expect behavior to diverge.
    
    r? lcnr
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    a11e6c3 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#122320 - erikdesjardins:vtable, r=nikic

    Use ptradd for vtable indexing
    
    Extension of rust-lang#121665.
    
    After this, the only remaining usages of GEP are [this](https://github.com/rust-lang/rust/blob/cd81f5b27ee00b49d413db50b5e6af871cebcf23/compiler/rustc_codegen_llvm/src/intrinsic.rs#L909-L920) kinda janky Emscription EH code, which I'll change in a future PR, and array indexing / pointer offsets, where there isn't yet a canonical `ptradd` form. (Out of curiosity I tried converting the latter to `ptradd(ptr, mul(size, index))`, but that causes codegen regressions right now.)
    
    r? `@nikic`
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    028e260 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#122328 - Enselic:sig_dfl-not-inherit, r=dav…

    …idtwco
    
    unix_sigpipe: Replace `inherit` with `sig_dfl` in syntax tests
    
    The `sig_dfl` variant of the attribute is the most likely variant to be stabilized first, and thus to become the "most allowed" variant of the attribute. Because of this, it is the most appropriate variant to use in syntax tests, because even if the most allowed variant is used, the compiler shall still emit errors if it e.g. is used in the wrong places.
    
    r? ``@davidtwco`` who already [approved ](rust-lang#120832 (review)) this commit in rust-lang#120832.
    
    It would be nice to land the last preparatory commit of that PR before we begin to [rename ](rust-lang#120832 (comment)) things which will of course create a lot of code conflicts.
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    9aca5c0 View commit details
    Browse the repository at this point in the history
  29. Rollup merge of rust-lang#122330 - tshepang:patch-1, r=clubby789

    bootstrap readme: fix, improve, update
    workingjubilee committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    7fa6fa4 View commit details
    Browse the repository at this point in the history