Skip to content

Sync from rust 2026/03/13#862

Open
antoyo wants to merge 32 commits intomasterfrom
sync_from_rust_2026_03_13
Open

Sync from rust 2026/03/13#862
antoyo wants to merge 32 commits intomasterfrom
sync_from_rust_2026_03_13

Conversation

@antoyo
Copy link
Contributor

@antoyo antoyo commented Mar 13, 2026

No description provided.

flip1995 and others added 30 commits February 12, 2026 16:55
Clippy subtree update

r? @Manishearth 

1 week late, due to vacation and some technical issues.
It was just a dummy implementation to workarround the fact that thin
local lto is the default in rustc. By adding a thin_lto_supported thin
local lto can be automatically disabled for cg_gcc, removing the need
for this dummy implementation. This makes improvements to the LTO
handling on the cg_ssa side a lot easier.
This allows us to get rid of box_new entirely
This allows removing the Metadata associated type from BackendTypes.
In Cranelift the regular Type enum can't represent function signatures.
Function pointers are represented as plain pointer sized integer.
Previously this was not correctly implemented. Each funclet may need its own terminate
block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which
can have a terminate_block for each funclet. We key on the first basic block of the
funclet -- in particular, this is the start block for the old case of the top level
terminate function.

Rather than using a catchswitch/catchpad pair, I used a cleanuppad. The reason for the
pair is to avoid catching foreign exceptions on MSVC. On wasm, it seems that the
catchswitch/catchpad pair is optimized back into a single cleanuppad and a catch_all
instruction is emitted which will catch foreign exceptions. Because the new logic is
only used on wasm, it seemed better to take the simpler approach seeing as they do the
same thing.
In Cranelift a Value can't hold arbitrarily sized values.
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup

Previously this was not correctly implemented. Each funclet may need its own terminate block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which can have a terminate_block for each funclet. We key on the first basic block of the funclet -- in particular, this is the start block for the old case of the top level terminate function.

I also fixed the `terminate` handler to not be invoked when a foreign exception is raised, mimicking the behavior from msvc. On wasm, in order to avoid generating a `catch_all` we need to call `llvm.wasm.get.exception` and `llvm.wasm.get.ehselector`.
Couple of cg_ssa refactorings

These should help a bit with using cg_ssa in cg_clif at some point in the future.
This is already CodegenResults without CrateInfo. The driver can
calculate the CrateInfo and pass it by-ref to the backend. Using
CompiledModules makes it a bit easier to move some other things out of
the backend as will be necessary for moving LTO to the link phase.
Make `size`/`align` always correct rather than conditionally on the
`safe` field. This makes it less error prone and easier to work with for
`MaybeDangling` / potential future pointer kinds like `Aligned<_>`.
Instead of defaulting to `None` it now defaults to `Align::ONE` i.e.
no alignment restriction. Codegen test changes are due to us now skipping
`align 1` annotations (they are useless; not skipping them makes all the
raw pointers gain an `align 1` annotation which doesn't seem any good)
…Jung

Implement `MaybeDangling` compiler support



Tracking issue: rust-lang/rust#118166



cc @RalfJung
Renaming to remove any ambiguity as to what "vector" refers to in this
context
It's defined in `rustc_span::source_map` which doesn't make any sense
because it has nothing to do with source maps. This commit moves it to
the crate root, a more sensible spot for something this basic.
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#153560 (Introduce granular tidy_ctx's check in extra_checks)
 - rust-lang/rust#153666 (Add a regression test for rust-lang/rust#153599)
 - rust-lang/rust#153493 (Remove `FromCycleError` trait)
 - rust-lang/rust#153549 (tests/ui/binop: add annotations for reference rules)
 - rust-lang/rust#153641 (Move `Spanned`.)
 - rust-lang/rust#153663 (Remove `TyCtxt::node_lint` method and `rustc_middle::lint_level` function)
 - rust-lang/rust#153664 (Add test for rust-lang/rust#109804)
@antoyo
Copy link
Contributor Author

antoyo commented Mar 13, 2026

@bjorn3: We still get the same error.
Does rustc provide the main function differently when doing LTO?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.