about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-05Rollup merge of #143291 - RalfJung:result-isnt-either, r=scottmcmBen Kimock-23/+24
codegen_ssa: replace a Result by an Either `Err` here clearly does not indicate an "error" of any sort, so the use of `Result` is confusing. Let's use a sum type that does not come with the baggage of `Result`.
2025-07-05codegen_ssa: replace a Result by an EitherRalf Jung-23/+24
2025-07-05Auto merge of #143474 - jieyouxu:bootstrap-llvm-snapshot, r=Kobzolbors-0/+8
Pretend in bootstrap snapshot tests that we always build in-tree LLVM Otherwise, depending on whether CI LLVM is inhibited or if an externally-provided LLVM is used, bootstrap host LLVM build step could be missing in step snapshots. Note that I'm not sure if this is the *right* solution (this might be *a* solution). I imagine we do want to control for the set of configuration that these snapshot tests are run, as much as possible. r? `@Kobzol`
2025-07-05Auto merge of #143473 - workingjubilee:rollup-bxie7zg, r=scottmcmbors-948/+1256
Rollup of 11 pull requests Successful merges: - rust-lang/rust#142440 (`tests/ui`: A New Order [14/N]) - rust-lang/rust#143040 (Add `const Rem`) - rust-lang/rust#143086 (Update poison.rs to fix the typo (sys->sync)) - rust-lang/rust#143202 (`tests/ui`: A New Order [18/N]) - rust-lang/rust#143296 (`tests/ui`: A New Order [21/N]) - rust-lang/rust#143297 (`tests/ui`: A New Order [22/N]) - rust-lang/rust#143299 (`tests/ui`: A New Order [24/N]) - rust-lang/rust#143300 (`tests/ui`: A New Order [25/N]) - rust-lang/rust#143397 (test passing a `VaList` from rust to C) - rust-lang/rust#143410 (Block SIMD in transmute_immediate; delete `OperandValueKind`) - rust-lang/rust#143452 (Fix CLI completion check in `tidy`) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-05Pretend in bootstrap snapshot tests that we always build in-tree LLVMJieyou Xu-0/+8
2025-07-05Auto merge of #139598 - compiler-errors:no-bound-var-symbol, r=WaffleLapkinbors-407/+375
Remove `Symbol` from `Named` variant of `BoundRegionKind`/`LateParamRegionKind` The `Symbol` is redundant, since we already store a `DefId` in the region variant. Instead, load the name via `item_name` when needed (which is almost always on the diagnostic path). This introduces a `BoundRegionKind::NamedAnon` which is used for giving anonymous bound regions names, but which should only be used during pretty printing and error reporting.
2025-07-04Rollup merge of #143452 - Kobzol:completions-fix, r=jieyouxuJubilee-35/+39
Fix CLI completion check in `tidy` The list of CLI completion files that were generated and that were checked by `x test tidy` was not synced. Recently, some PR only updated some of the files, which caused the rest of the files (not checked by `x test tidy`) to be dirty on `master`. This PR fixes the logic in bootstrap to always synchronize the list of completion paths. Fixes: https://github.com/rust-lang/rust/issues/143451 r? `@jieyouxu`
2025-07-04Rollup merge of #143410 - scottmcm:redo-transmute-again, ↵Jubilee-214/+138
r=RalfJung,workingjubilee Block SIMD in transmute_immediate; delete `OperandValueKind` Vectors have been causing me problems for years in this code, for example https://github.com/rust-lang/rust/pull/110021#discussion_r1160975086 and https://github.com/rust-lang/rust/pull/143194 See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>. By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit. Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang/rust#108442. And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy. cc `@folkertdev` `@workingjubilee` from the zulip conversation too
2025-07-04Rollup merge of #143397 - folkertdev:test-variadic-call-from-rust-to-c, ↵Jubilee-11/+104
r=RalfJung test passing a `VaList` from rust to C Have C define various functions that take a `...` or `va_list` as an argument, and call them from rust. As far as I can see, this just wasn't actually tested before. In particular this tests a difference between rust `VaList` and C `va_list` where C uses array-to-pointer decay, but rust cannot. I've locally tested this for - `x86_64-unknown-linux-gnu` - `aarch64-unknown-linux-gnu` - `s390x-unknown-linux-gnu` - `powerpc64-unknown-linux-gnu` - `powerpc64le-unknown-linux-gnu` The latter 2 use an opaque pointer, the first 3 use a single-element array. cc `@beetrees` if you see anything incorrect here r? `@workingjubilee`
2025-07-04Rollup merge of #143300 - Kivooeo:tf25, r=tgross35Jubilee-97/+155
`tests/ui`: A New Order [25/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143299 - Kivooeo:tf24, r=tgross35Jubilee-204/+264
`tests/ui`: A New Order [24/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143297 - Kivooeo:tf22, r=tgross35Jubilee-60/+57
`tests/ui`: A New Order [22/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143296 - Kivooeo:tf21, r=tgross35Jubilee-55/+70
`tests/ui`: A New Order [21/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143202 - Kivooeo:tf18, r=tgross35Jubilee-133/+224
`tests/ui`: A New Order [18/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143086 - SciMind2460:patch-2, r=workingjubileeJubilee-1/+1
Update poison.rs to fix the typo (sys->sync)
2025-07-04Rollup merge of #143040 - SciMind2460:patch-1, r=workingjubileeJubilee-1/+1
Add `const Rem`
2025-07-04Rollup merge of #142440 - Kivooeo:tf14, r=tgross35Jubilee-137/+203
`tests/ui`: A New Order [14/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@jieyouxu`
2025-07-05Auto merge of #138759 - scottmcm:operand-builder, r=saethlinbors-77/+380
Allow `enum` and `union` literals to also create SSA values Today, `Some(x)` always goes through an `alloca`, even in trivial cases where the niching means the constructor doesn't even change the value. For example, <https://rust.godbolt.org/z/6KG6PqoYz> ```rust pub fn demo(r: &i32) -> Option<&i32> { Some(r) } ``` currently emits the IR ```llvm define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr { start: %_0 = alloca [8 x i8], align 8 store ptr %r, ptr %_0, align 8 %0 = load ptr, ptr %_0, align 8 ret ptr %0 } ``` but with this PR it becomes just ```llvm define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr { start: ret ptr %r } ``` (Of course the optimizer can clean that up, but it'd be nice if it didn't have to -- especially in debug where it doesn't run. This is like rust-lang/rust#123886, but that only handled non-simd `struct`s -- this PR generalizes it to all non-simd ADTs.) Doing this means handing variants other than `FIRST_VARIANT`, handling the active field for unions, refactoring the discriminant code so the Place and Operand parts can share the calculation, etc. Other PRs that led up to this one: - https://github.com/rust-lang/rust/pull/142005 - https://github.com/rust-lang/rust/pull/142103 - https://github.com/rust-lang/rust/pull/142324 - https://github.com/rust-lang/rust/pull/142383 --- try-job: aarch64-gnu
2025-07-04Make Rem const for floatsKurt Heiritz (pseudo)-1/+1
2025-07-04Auto merge of #143459 - matthiaskrgr:rollup-gsv6uzl, r=matthiaskrgrbors-180/+385
Rollup of 8 pull requests Successful merges: - rust-lang/rust#141532 (std: sys: net: uefi: tcp4: Implement write) - rust-lang/rust#143085 (Port `#[non_exhaustive]` to the new attribute parsing infrastructure) - rust-lang/rust#143372 (Remove names_imported_by_glob_use query.) - rust-lang/rust#143386 (Assign dependency bump PRs to me) - rust-lang/rust#143406 (Remove some unnecessary `unsafe` in VecCache) - rust-lang/rust#143408 (mbe: Gracefully handle macro rules that end after `=>`) - rust-lang/rust#143414 (remove special-casing of boxes from match exhaustiveness/usefulness analysis) - rust-lang/rust#143444 (clean up GVN TypeId test) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-05Rollup merge of #143444 - lukas-code:gvn-test, r=RalfJungMatthias Krüger-34/+95
clean up GVN TypeId test addresses https://github.com/rust-lang/rust/pull/142789#discussion_r2184897992 This is an attempt to clarify what this test is actually supposed to test and make it less dependent on `TypeId` internals (it now depends on the output of `type_name` instead). I verified that this version still miscompiles on `nightly-2025-02-11`. r? ``@oli-obk`` ``@RalfJung``
2025-07-05Rollup merge of #143414 - dianne:box-usefulness-cleanup, r=NadrierilMatthias Krüger-81/+55
remove special-casing of boxes from match exhaustiveness/usefulness analysis As a first step in replacing `box_patterns` with `deref_patterns`, this treats box patterns as deref patterns in the THIR and exhaustiveness analysis. This allows a bunch of special-casing to be removed. The emitted MIR is unchanged. Incidentally, this fixes a bug caused by box patterns being treated like structs rather than pointers, where enabling `exhaustive_patterns` (rust-lang/rust#51085) could give rise to spurious `unreachable_patterns` lints on arms required for exhaustiveness. Following the lint's advice to remove the match arm would result in an error. I'm not sure what the current state of `exhaustive_patterns` is with regard to reference/box opsem, or whether there's any intention to have `unreachable_patterns` be more granular than the whole arm, but regardless this should hopefully make them easier to handle consistently. Tracking issue for deref patterns: rust-lang/rust#87121 r? `@Nadrieril`
2025-07-05Rollup merge of #143408 - joshtriplett:fix-mbe-parser, r=compiler-errorsMatthias Krüger-0/+87
mbe: Gracefully handle macro rules that end after `=>` Add a test for various cases of invalid macro definitions. Closes: https://github.com/rust-lang/rust/issues/143351
2025-07-05Rollup merge of #143406 - scottmcm:did-we-need-that-unsafe, r=compiler-errorsMatthias Krüger-2/+2
Remove some unnecessary `unsafe` in VecCache I'm pretty sure, but until perf confirms, r? ghost
2025-07-05Rollup merge of #143386 - clubby789:dep-bump-me, r=compiler-errorsMatthias Krüger-0/+4
Assign dependency bump PRs to me These PRs sometimes get lost as GH reduces their visibility, so I wanted to get an assignment so I can help these PRs land
2025-07-05Rollup merge of #143372 - cjgillot:bare-glob-map, r=petrochenkovMatthias Krüger-8/+1
Remove names_imported_by_glob_use query. Based on https://github.com/rust-lang/rust/pull/143247 r? ``@ghost`` for perf
2025-07-05Rollup merge of #143085 - JonathanBrouwer:non_exhaustive_parser, r=jdonszelmannMatthias Krüger-49/+88
Port `#[non_exhaustive]` to the new attribute parsing infrastructure Ports `non_exhaustive` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-07-05Rollup merge of #141532 - Ayush1325:uefi-tcp4-send, r=tgross35Matthias Krüger-6/+53
std: sys: net: uefi: tcp4: Implement write A blocking implementation of tcp4 write.
2025-07-04Workaround a MemorySanitizer test issueScott McMurray-2/+8
2025-07-05cleaned up some testsKivooeo-68/+126
2025-07-05cleaned up some testsKivooeo-55/+70
2025-07-04Update completionsJakub Beránek-3/+3
2025-07-04Unify completion list between `x test tidy` and `x run generate-completions`Jakub Beránek-32/+36
2025-07-05cleaned up some testsKivooeo-22/+36
2025-07-05moved & deleted testsKivooeo-17/+0
opeq.rs was removed as duplicating test logic in other tests
2025-07-05cleaned up some testsKivooeo-108/+168
2025-07-05moved testsKivooeo-0/+0
2025-07-04Address PR feedbackScott McMurray-48/+59
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-49/+88
2025-07-04NitsMichael Goulet-20/+16
2025-07-04Fix elided lifetimes in rustdocMichael Goulet-10/+10
2025-07-04Fix pretty printing of placeholder typesMichael Goulet-36/+41
2025-07-04Same for typesMichael Goulet-36/+28
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-327/+302
2025-07-04Auto merge of #114669 - cjgillot:metadata-wp, r=petrochenkovbors-35/+123
Make metadata a workproduct and reuse it This PR aims to skip the generation of metadata by reusing the infrastructure that already exists for compiled codegen-units, namely "workproducts". This can yield substantial gains (~10%) when we can demonstrate that metadata does not change between an incremental session and the next. This is the case if the crate is unchanged, or if all the changes are in upstream crates and have no effect on it. This latter case is most interesting, as it arises regularly for users with several crates in their workspace. TODO: - [x] Materialize the fact that metadata encoding relies on the relative order of definitions; - [x] Refactor the handling of doc links.
2025-07-04Rename `transmute_immediate` → `transmute_scalar`Scott McMurray-11/+13
2025-07-04clean up GVN TypeId testLukas Markeffsky-34/+95
2025-07-04std: sys: net: uefi: tcp4: Implement writeAyush Singh-6/+53
A blocking implementation of tcp4 write. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-07-04test rust calling a C C-variadic functionFolkert de Vries-11/+104
2025-07-04Auto merge of #143434 - matthiaskrgr:rollup-eyr4rcb, r=matthiaskrgrbors-2638/+3908
Rollup of 7 pull requests Successful merges: - rust-lang/rust#140643 (Refactor StableMIR) - rust-lang/rust#143286 (Make -Ztrack-diagnostics emit like a note) - rust-lang/rust#143308 (Remove `PointerLike` trait) - rust-lang/rust#143387 (Make __rust_alloc_error_handler_should_panic a function) - rust-lang/rust#143400 (Port `#[rustc_pass_by_value]` to the new attribute system) - rust-lang/rust#143417 (bump termize dep) - rust-lang/rust#143420 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup