about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-09-21Rollup merge of #144091 - thaliaarchi:stabilize-new-zeroed, r=Mark-SimulacrumStuart Cook-3/+3
Stabilize `new_zeroed_alloc` The corresponding `new_uninit` and `new_uninit_slice` functions were stabilized in rust-lang/rust#129401, but the zeroed counterparts were left for later out of a [desire](https://github.com/rust-lang/rust/issues/63291#issuecomment-2161039756) to stabilize only the minimal set. These functions are straightforward mirrors of the uninit functions and well-established. Since no blockers or design questions have surfaced in the past year, I think it's time to stabilize them. Tracking issue: rust-lang/rust#129396
2025-09-20Rollup merge of #146770 - hkBst:clippy-fix-10, r=fmeaseMatthias Krüger-36/+32
fixes for numerous clippy warnings
2025-09-20Rollup merge of #144592 - fee1-dead-contrib:target_spec, r=NoratriebMatthias Krüger-42/+19
generate list of all variants with `target_spec_enum` This helps us avoid the hardcoded lists elsewhere. r? ``@Noratrieb``
2025-09-19generate list of all variants with `target_spec_enum`Deadbeef-42/+19
This helps us avoid the hardcoded lists elsewhere.
2025-09-19Auto merge of #146797 - matthiaskrgr:rollup-xy0g8n7, r=matthiaskrgrbors-29/+23
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146690 (add `[const] PartialEq` bound to `PartialOrd`) - rust-lang/rust#146776 (fixes for numerous clippy warnings) - rust-lang/rust#146777 (fix ./x readdir logic when CDPATH is set) - rust-lang/rust#146781 (mbe: Fix feature gate for `macro_derive`) - rust-lang/rust#146785 (btree: safety comments for init and new) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-19fixes for numerous clippy warningsMarijn Schouten-36/+32
2025-09-19Rollup merge of #146781 - joshtriplett:mbe-derive-fix-feature-gate, ↵Matthias Krüger-1/+1
r=wesleywiser mbe: Fix feature gate for `macro_derive`
2025-09-19Rollup merge of #146776 - hkBst:clippy-fix-12, r=jdonszelmannMatthias Krüger-28/+22
fixes for numerous clippy warnings
2025-09-19Auto merge of #146700 - Zalathar:quoted-args, r=nikicbors-49/+92
cg_llvm: Move target machine command-line quoting from C++ to Rust When this code was introduced in rust-lang/rust#130446 and rust-lang/rust#131805, it was complicated by the need to maintain compatibility with earlier versions of LLVM. Now that LLVM 20 is the baseline (rust-lang/rust#145071), we can do all of the quoting in pure Rust code, and pass two flat strings to LLVM to be used as-is. --- In this PR, my priority has been to preserve the existing behaviour as much as possible, without worrying too much about what the behaviour *should* be. (Though I did avoid a leading space before the first argument.)
2025-09-19Auto merge of #146765 - Zalathar:rollup-ewh4s9o, r=Zalatharbors-586/+613
Rollup of 10 pull requests Successful merges: - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set) - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output) - rust-lang/rust#146541 (std: simplify host lookup) - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying) - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`) - rust-lang/rust#146663 (Allow windows resource compiler to be overridden) - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`) - rust-lang/rust#146709 (stdarch subtree update) - rust-lang/rust#146738 (Fix tidy spellchecking on Windows) - rust-lang/rust#146740 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-19mbe: Fix feature gate for `macro_derive`Josh Triplett-1/+1
2025-09-19fixes for numerous clippy warningsMarijn Schouten-28/+22
2025-09-19Rollup merge of #146663 - erickt:win, r=wesleywiserStuart Cook-2/+5
Allow windows resource compiler to be overridden In rust-lang/rust#146018, it is now required to provide a resource compiler on windows when compiling rust. This allows toolchain builders to explicitly provide a path to an alternative, such as llvm-rc, instead of the one that's provided by the Windows SDK. cc ```@lambdageek```
2025-09-19Rollup merge of #146638 - lcnr:canonical-separate-module, r=BoxyUwUStuart Cook-556/+576
`rustc_next_trait_solver`: canonical out of `EvalCtxt` we need to canonicalize outside of the trait solver as well, so it's just a lot nicer if canonicalization is more easily accessible if you review it commit by commit the move is properly shown
2025-09-19Rollup merge of #146615 - a4lg:codegen-llvm-feature-conversion-tidying, ↵Stuart Cook-22/+20
r=workingjubilee rustc_codegen_llvm: Feature Conversion Tidying The author thinks we can improve `to_llvm_features`, a function to convert a Rust target feature name into an LLVM feature (or nothing, to ignore features unsupported by LLVM) for better maintainability. 1. We can simplify some clauses and some expressions. 2. There are some readability issues. This PR attempts to resolve some of them by tidying many cases.
2025-09-19Rollup merge of #146229 - Hayden602:issue-142796-fix, r=ZuseZ4Stuart Cook-6/+12
Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set …t" is automatically set. closes: [#142796](https://github.com/rust-lang/rust/issues/142796)
2025-09-19Auto merge of #145737 - cjgillot:gvn-valueset, r=saethlinbors-44/+179
GVN: stop hashing opaque values GVN generates values that are not meant to be unified with any other. For instance `Opaque` (aka we don't know anything), non-deterministic constants and borrows. The current algorithm generates a unique index, so the generated `Value` will be different from all the existing. This is wasteful, as we should not hash that `Value` at all. This PR proposes to do this. This involves partially reimplementing a `FxIndexSet`, but yields a small but consistent perf improvement (https://github.com/rust-lang/rust/pull/145737#issuecomment-3276951054).
2025-09-18canonical: yeet `EvalCtxt`, mk `Canonicalizer` privatelcnr-211/+233
2025-09-18move `mod canonical` out of `eval_ctxt`lcnr-231/+229
2025-09-18Auto merge of #146727 - matthiaskrgr:rollup-98812uj, r=matthiaskrgrbors-61/+94
Rollup of 6 pull requests Successful merges: - rust-lang/rust#146434 (c-variadic: allow c-variadic inherent and trait methods) - rust-lang/rust#146487 (Improve `core::num` coverage) - rust-lang/rust#146597 (Add span for struct tail recursion limit error) - rust-lang/rust#146622 (Add regression test for issue rust-lang/rust#91831) - rust-lang/rust#146717 (Clean up universe evaluation during type test evaluation) - rust-lang/rust#146723 (Include patch in release notes) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-18Allow windows resource compiler to be overriddenErick Tryzelaar-2/+5
It is now required to provide a resource compiler on windows when compiling rust. This allows toolchain builders to explicitly provide a path to an alternative, such as llvm-rc, instead of the one that's provided by the Windows SDK.
2025-09-18Rollup merge of #146717 - amandasystems:remove-placeholder-hack, r=lcnrMatthias Krüger-12/+18
Clean up universe evaluation during type test evaluation The logic was, as the removed comments suggest, hackish and meant to implement previous logic that was factored out. The new logic does exactly what the comments say, and is much less surprising. I'm afraid we may want r? `@lcnr` for this one too. I am sorry, but at least it should be easier to review.
2025-09-18Rollup merge of #146597 - modhanami:add-struct-tail-recursion-limit-span, ↵Matthias Krüger-34/+66
r=oli-obk Add span for struct tail recursion limit error Fixes rust-lang/rust#135629 Changes 1. Add span to RecursionLimitReached 2. Add ObligationCause parameter to struct_tail_raw 4. Update call sites to pass nearby ObligationCause or create one 5. Update affected .stderr
2025-09-18Rollup merge of #146434 - folkertdev:c-variadic-inherent-methods, ↵Matthias Krüger-15/+10
r=workingjubilee c-variadic: allow c-variadic inherent and trait methods tracking issue: https://github.com/rust-lang/rust/issues/44930 Continuing the work of https://github.com/rust-lang/rust/pull/146342, allow inherent and trait methods to be c-variadic. However, a trait that contains a c-variadic method is no longer dyn-compatible. There is, presumably, some way to make c-variadic methods dyn-compatible. However currently, we don't have confidence that it'll work reliably: when methods from a `dyn` object are cast to a function pointer, a `ReifyShim` is created. If that shim is c-variadic, it would need to forward the C variable argument list. That does appear to work, because the `va_list` is not represented in MIR at all in this case, so the registers from the call site are untouched by the shim and can be read by the actual implementation. That just does not seem like a solid implementation. Also, intuitively, why would c-variadic function, primarily needed for FFI, need to be used with `dyn` objects at all? We can revisit this limitation if a need arises. r? `@workingjubilee`
2025-09-18Auto merge of #145993 - lcnr:allow-calling-opaques, r=BoxyUwUbors-134/+423
`-Znext-solver` allow `ExprKind::Call` for not-yet defined opaques Based on https://github.com/rust-lang/rust/pull/146329. Revival of rust-lang/rust#140496. See the comment on `OpaqueTypesJank`. I've used the following document while working on this https://hackmd.io/Js61f8PRTcyaiyqS-fH9iQ. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/181. It does introduce one subtle footgun we may want to handle before stabilization, opened https://github.com/rust-lang/trait-system-refactor-initiative/issues/230 for that. Also cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/231 for deref and index operations r? `@BoxyUwU`
2025-09-18Clean up universe evaluation during type test evaluationAmanda Stjerna-12/+18
The logic was, as the removed comments suggest, hackish and meant to implement previous logic that was factored out. The new logic does exactly what the comments say, and is much less surprising.
2025-09-18add tests, silence type annotations needed errors for opaqueslcnr-15/+19
2025-09-18support calls on opaque types :<lcnr-119/+404
2025-09-18Auto merge of #142544 - Sa4dUs:prevent-abi-changes, r=ZuseZ4bors-3/+44
Prevent ABI changes affect EnzymeAD This PR handles ABI changes for autodiff input arguments to improve Enzyme compatibility. Fundamentally this adjusts activities when a function argument is lowered as an `ScalarPair`, so there's no mismatch between diff activities and args. Also removes activities corresponding to ZSTs. fixes: https://github.com/rust-lang/rust/issues/144025 r? `@ZuseZ4`
2025-09-18Set lto="fat" automatically when compiling with RUSTFLAGS="-Zautodiff=Enable".Haidong Zhang-6/+12
2025-09-18Move target machine command-line quoting from C++ to RustZalathar-49/+92
2025-09-18Rollup merge of #146694 - camsteffen:impl-subject, r=compiler-errorsStuart Cook-56/+2
Remove ImplSubject It only has one usage in rustdoc.
2025-09-18Rollup merge of #146673 - Zalathar:di-builder, r=nnethercoteStuart Cook-112/+103
cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 4) - Part of rust-lang/rust#134001 - Follow-up to rust-lang/rust#146631 --- This is another batch of LLVMDIBuilder binding migrations, replacing some our own LLVMRust bindings with bindings to upstream LLVM-C APIs.
2025-09-18Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmannStuart Cook-782/+687
Clean up `ty::Dynamic` 1. As a follow-up to PR rust-lang/rust#143036, remove `DynKind` entirely. 2. Inside HIR ty lowering, consolidate modules `dyn_compatibility` and `lint` into `dyn_trait` * `dyn_compatibility` wasn't about dyn compatibility itself, it's about lowering trait object types * `lint` contained dyn-Trait-specific diagnostics+lints only
2025-09-18Rollup merge of #146566 - cjgillot:mir-overlap-lint, r=saethlinStuart Cook-27/+52
Lint more overlapping assignments in MIR. In an effort to make bugs like https://github.com/rust-lang/rust/issues/146383 more easily discovered, this PR extends the "overlapping assignment" MIR lint. I had to whitelist some rvalues, as they are actually allowed to alias, like `a = a + 1`.
2025-09-17Remove ImplSubjectCameron Steffen-56/+2
2025-09-17Lint overlapping assignments in MIR.Camille Gillot-27/+52
2025-09-17Rollup merge of #146647 - jdonszelmann:move-coherence-is-core, r=urgauJana Dönszelmann-20/+21
Move `#[rustc_coherence_is_core]` to the `crate_level` file I implemented this one without realizing it already was since it was (in my opinion) in the wrong file and implemented in a batch of all non-crate-level attributes. This commit just cleans it up slightly and moves it. Should be trivial r? `@oli-obk`
2025-09-17Rollup merge of #146598 - bjorn3:feature_llvm_enzyme, r=davidtwcoJana Dönszelmann-8/+20
Make llvm_enzyme a regular cargo feature This makes it clearer that it is set by the build system rather than by the rustc that compiles the current rustc. It also avoids bootstrap needing to pass `--check-cfg llvm_enzyme` to rustc.
2025-09-17Rollup merge of #146485 - zachs18:store_fn_arg-no-unsized, r=davidtwcoJana Dönszelmann-15/+5
Remove unsized arg handling in `ArgAbiBuilderMethods::store_fn_arg` implementations ... since it is unreachable and would ICE anyway. These branches are unreachable with how `store_fn_arg` is currently used (where it is called, unsized arguments are either: 1. not (yet) supported, or 2. handled differently)[^1], and even if they were reachable, they would ICE anyway, since they call [`OperandValue::store`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_codegen_ssa/mir/operand.rs.html#855-861), which calls [`OperandValue::store_with_flags`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_codegen_ssa/mir/operand.rs.html#887-926) which [panics on any unsized layout](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_codegen_ssa/mir/operand.rs.html#900-903). Also updates the `bug!` message in `store_arg` to not suggest `store_fn_arg` for unsized args. [^1]: `store_fn_arg` is only nontrivially[^2] called in `compiler/rustc_codegen_ssa/src/mir/mod.rs` for: Line 428 `extern "rust-call"` tuple (un)splitting, which does not support unsized arguments, Line 496 which is only for sized `PassMode::Indirect` (`meta_attrs: None`) arguments, and Line 521 which is only for non-`PassMode::Indirect` arguments which can never be unsized. [^2]: `<Bx as ArgAbiBuilderMethods>::store_fn_arg` is what is actually called, but codegen_llvm and codegen_gcc's builders both delegate to their own `codegen_crate::ArgAbiExt::store_fn_arg`, which contain the actual implementations that are changed in this PR.
2025-09-17port `#[rustc_coherence_is_core]` to the new attribute parsing infrastructureJana Dönszelmann-20/+21
2025-09-17Check ZST via `PassMode`Marcelo Domínguez-4/+19
2025-09-17Auto merge of #146331 - RalfJung:copy-prov-repeat, r=oli-obkbors-82/+88
interpret: copy_provenance: avoid large intermediate buffer for large repeat counts Copying provenance worked in this odd way where the "preparation" phase (which is supposed to just extract the necessary information from the source range) already did all the work of repeating the result N times for the target range. This was needed to use the existing `insert_presorted` function on `SortedMap`. This PR generalizes `insert_presorted` so that we can avoid this odd structure on copy-provenance, and maybe even improve performance.
2025-09-17rustc_codegen_llvm: Reorder conversion casesTsukasa OI-11/+11
For maintainability, this commit reorders target feature conversion cases by the architecture.
2025-09-17rustc_codegen_llvm: Simplify `arch` conversionTsukasa OI-10/+7
This commit simplifies construction of `arch` from `sess.target.arch`. It also preserves a reference to `sess.target.arch` as `raw_arch` to make this function future proof.
2025-09-17rustc_codegen_llvm: Name major version of LLVMTsukasa OI-1/+2
It makes LLVM version comparison clearer.
2025-09-17Use `LLVMDIBuilderCreateTypedef`Zalathar-25/+17
2025-09-17Use `LLVMDIBuilderCreateQualifiedType`Zalathar-16/+13
2025-09-17Use `LLVMDIBuilderCreateStaticMemberType`Zalathar-44/+57
2025-09-17Use `LLVMDIBuilderCreateMemberType`Zalathar-27/+16