about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-08-15Rollup merge of #145369 - estebank:issue-145367, r=compiler-errorsStuart Cook-3/+33
Do not ICE on private type in field of unresolved struct Fix rust-lang/rust#145367.
2025-08-15Rollup merge of #145331 - theemathas:std-prelude-2024, r=tgross35Stuart Cook-1/+1
Make std use the edition 2024 prelude This seem to have been overlooked in <https://github.com/rust-lang/rust/pull/138162>
2025-08-15Rollup merge of #145322 - LorrensP-2158466:early-prelude-processing, ↵Stuart Cook-49/+53
r=petrochenkov Resolve the prelude import in `build_reduced_graph` This pr tries to resolve the prelude import at the `build_reduced_graph` stage. Part of batched import resolution in rust-lang/rust#145108 (cherry picked commit) and maybe needed for rust-lang/rust#139493. r? petrochenkov
2025-08-15Rollup merge of #145275 - StackOverflowExcept1on:fix-wasm32v1-none, ↵Stuart Cook-3/+87
r=alexcrichton fix(compiler/rustc_codegen_llvm): apply `target-cpu` attribute Resolves rust-lang/rust#140174 r? ```@alexcrichton``` try-job: `test-various*`
2025-08-15Rollup merge of #145235 - compiler-errors:comment, r=BoxyUwUStuart Cook-61/+2
Minor `[const]` tweaks Self explanatory
2025-08-15Rollup merge of #145189 - rust-lang:cargo_update, r=clubby789Stuart Cook-69/+69
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. r? dep-bumps The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 18 packages to latest compatible versions Updating anstream v0.6.19 -> v0.6.20 Updating anstyle-query v1.1.3 -> v1.1.4 Updating anstyle-svg v0.1.9 -> v0.1.10 Updating anstyle-wincon v3.0.9 -> v3.0.10 Updating camino v1.1.10 -> v1.1.11 Updating clap v4.5.42 -> v4.5.43 Updating clap_builder v4.5.42 -> v4.5.43 Updating cxx v1.0.161 -> v1.0.166 Updating cxx-build v1.0.161 -> v1.0.166 Updating cxxbridge-cmd v1.0.161 -> v1.0.166 Updating cxxbridge-flags v1.0.161 -> v1.0.166 Updating cxxbridge-macro v1.0.161 -> v1.0.166 Updating derive-where v1.5.0 -> v1.6.0 Updating hashbrown v0.15.4 -> v0.15.5 Updating indenter v0.3.3 -> v0.3.4 Updating rustversion v1.0.21 -> v1.0.22 Updating scratch v1.0.8 -> v1.0.9 Updating zerovec v0.11.2 -> v0.11.4 note: pass `--verbose` to see 36 unchanged dependencies behind latest library dependencies: Locking 1 package to latest compatible version Updating hashbrown v0.15.4 -> v0.15.5 note: pass `--verbose` to see 2 unchanged dependencies behind latest rustbook dependencies: Locking 10 packages to latest compatible versions Updating anstream v0.6.19 -> v0.6.20 Updating anstyle-query v1.1.3 -> v1.1.4 Updating anstyle-wincon v3.0.9 -> v3.0.10 Updating cc v1.2.31 -> v1.2.32 Updating clap v4.5.42 -> v4.5.43 Updating clap_builder v4.5.42 -> v4.5.43 Updating clap_complete v4.5.55 -> v4.5.56 Updating hashbrown v0.15.4 -> v0.15.5 Updating rustversion v1.0.21 -> v1.0.22 Updating zerovec v0.11.2 -> v0.11.4 ```
2025-08-15Rollup merge of #145120 - maurer:llvm-time, r=nikicStuart Cook-38/+42
llvm: Accept new LLVM lifetime format In llvm/llvm-project#150248 LLVM removed the size parameter from the lifetime format. Tolerate not having that size parameter.
2025-08-15Rollup merge of #145065 - petrochenkov:riblock, r=davidtwcoStuart Cook-93/+99
resolve: Introduce `RibKind::Block` to avoid confusing module items, blocks with items, and blocks without items. Addresses https://github.com/rust-lang/rust/pull/143141#discussion_r2254893953 and https://github.com/rust-lang/rust/pull/143141#discussion_r2258004452. A couple of related cleanups are also added on top.
2025-08-15Rollup merge of #145012 - Kivooeo:fun-problem-fun-fix, r=compiler-errorsStuart Cook-1/+93
Tail call diagnostics to include lifetime info Fixes https://github.com/rust-lang/rust/issues/144957 r? ```@WaffleLapkin``` ```@compiler-errors```
2025-08-15Rollup merge of #145005 - tardyp:lto_big_filesize, r=bjorn3Stuart Cook-2/+60
strip prefix of temporary file names when it exceeds filesystem name length limit When doing lto, rustc generates filenames that are concatenating many information. In the case of this testcase, it is concatenating crate name and rust file name, plus some hash, and the extension. In some other cases it will concatenate even more information reducing the maximum effective crate name to about 110 chars on linux filesystems where filename max length is 255 This commit is ensuring that the temporary file names are limited in size, while still reasonably ensuring the unicity (with hashing of the stripped part) Fix: rust-lang/rust#49914
2025-08-15Rollup merge of #145004 - bjorn3:remove_unused_fields, r=WaffleLapkinStuart Cook-51/+37
Couple of minor cleanups
2025-08-15Rollup merge of #144947 - tautschnig:remove-stray-checked_div-comment, ↵Stuart Cook-12/+6
r=Mark-Simulacrum Fix description of unsigned `checked_exact_div` Like its signed counterpart, this function does not panic. Also, fix the examples to document how it returns Some/None.
2025-08-15Add the directive `compare-output-by-lines`ywxt-19/+53
2025-08-15Rollup merge of #144944 - He1pa:E0793, r=compiler-errorsStuart Cook-1/+33
E0793: Clarify that it applies to unions as well pick up inactive PR: https://github.com/rust-lang/rust/pull/131472 Also: Adjust the language slightly to be more consistent with other similar messages (was created instead of got created). Add a short section on union. Add an example line showing referencing a field in a packed struct is safe if the field's type isn't more strictly aligned than the pack. r? compiler-errors
2025-08-15Rollup merge of #144865 - WaffleLapkin:track-tail, r=lqdStuart Cook-9/+135
Fix tail calls to `#[track_caller]` functions We want `#[track_caller]` to be semver independent, i.e. it should not be a breaking change to add or remove it. Since it changes ABI of a function (adding an additional argument) we have to be careful to preserve this property when adding tail calls. The only way to achieve this that I can see is: - we forbid tail calls in functions which are marked with `#[track_caller]` (already implemented) - tail-calling a `#[track_caller]` marked function downgrades the tail-call to a normal call (or equivalently tail-calls the shim made by fn def to fn ptr cast) (this pr) Ideally the downgrade would be performed by a MIR pass, but that requires post mono MIR opts (cc ```@saethlin,``` rust-lang/rust#131650). For now I've changed code in cg_ssa to accomodate this behaviour (+ added a hack to mono collector so that the shim is actually generated) Additionally I added a lint, although I don't think it's strictly necessary. Alternative to rust-lang/rust#144762 (and thus closes rust-lang/rust#144762) Fixes https://github.com/rust-lang/rust/issues/144755
2025-08-15Rollup merge of #143075 - workingjubilee:interrupts-may-return-nevermore, ↵Stuart Cook-3/+429
r=davidtwco compiler: Allow `extern "interrupt" fn() -> !` While reviewing rust-lang/rust#142633 I overlooked a few details because I was kind of excited. - Fixes rust-lang/rust#143072
2025-08-15Rollup merge of #142640 - Sa4dUs:ad-intrinsic, r=ZuseZ4Stuart Cook-1174/+660
Implement autodiff using intrinsics This PR aims to move autodiff logic to `autodiff` intrinsic. Allowing us to delete a great part of our frontend code and overall, simplify the compilation pipeline of autodiff functions.
2025-08-15Rollup merge of #122661 - estebank:assert-macro-span, r=petrochenkovStuart Cook-9/+16
Change the desugaring of `assert!` for better error output In the desugaring of `assert!`, we now expand to a `match` expression instead of `if !cond {..}`. The span of incorrect conditions will point only at the expression, and not the whole `assert!` invocation. ``` error[E0308]: mismatched types --> $DIR/issue-14091.rs:2:13 | LL | assert!(1,1); | ^ expected `bool`, found integer ``` We no longer mention the expression needing to implement the `Not` trait. ``` error[E0308]: mismatched types --> $DIR/issue-14091-2.rs:15:13 | LL | assert!(x, x); | ^ expected `bool`, found `BytePos` ``` Now `assert!(val)` desugars to: ```rust match val { true => {}, _ => $crate::panic::panic_2021!(), } ``` Fix #122159.
2025-08-15Rollup merge of #122661 - estebank:assert-macro-span, r=petrochenkovStuart Cook-51/+135
Change the desugaring of `assert!` for better error output In the desugaring of `assert!`, we now expand to a `match` expression instead of `if !cond {..}`. The span of incorrect conditions will point only at the expression, and not the whole `assert!` invocation. ``` error[E0308]: mismatched types --> $DIR/issue-14091.rs:2:13 | LL | assert!(1,1); | ^ expected `bool`, found integer ``` We no longer mention the expression needing to implement the `Not` trait. ``` error[E0308]: mismatched types --> $DIR/issue-14091-2.rs:15:13 | LL | assert!(x, x); | ^ expected `bool`, found `BytePos` ``` Now `assert!(val)` desugars to: ```rust match val { true => {}, _ => $crate::panic::panic_2021!(), } ``` Fix #122159.
2025-08-15Rollup merge of #118087 - GrigorenkoPV:refcell_try_map, r=Mark-SimulacrumStuart Cook-0/+93
Add Ref/RefMut try_map method Tracking issue: rust-lang/rust#143801 A more generalized version of [`filter_map`](https://doc.rust-lang.org/stable/core/cell/struct.Ref.html#method.filter_map), which allows to return some data on failure. ## Safety As far as I can tell, `E` cannot contain any `'b` data, so it is impossible to duplicate the `&'b [mut]` reference into the `RefCell`'s data. Other than this `E`, everything is analogous to the already stable `filter_map`. ## `Try` / `Residual` I have considered generalizing this to use the `Try` & `Residual` just like rust-lang/rust#79711 does for `array::try_map`, but it does not seem to be possible: we want to essentially `.map_err(|e| (orig, e))` but this does not seem to be supported with `Try`. (Plus I am not even sure if it is possible to express the fact that `&U` in `Try::Output` would have to have the same lifetime as the `&T` input of `F`.) ## ACP ~As far as I can tell, this [is not mandatory](https://std-dev-guide.rust-lang.org/development/feature-lifecycle.html#suitability-for-the-standard-library), and the implementation is small enough to probably be smaller than the doc I would have to write.~ ~https://github.com/rust-lang/libs-team/issues/341~ https://github.com/rust-lang/libs-team/issues/586
2025-08-15Auto merge of #144591 - RalfJung:pattern-valtrees, r=BoxyUwUbors-175/+146
Patterns: represent constants as valtrees Const patterns are always valtrees now. Let's represent that in the types. We use `ty::Value` for this since it nicely packages value and type, and has some convenient methods. Cc `@Nadrieril` `@BoxyUwU`
2025-08-15Merge pull request #4527 from rust-lang/rustup-2025-08-15Oli Scherer-5852/+7970
Automatic Rustup
2025-08-15Merge ref '3507a749b365' from rust-lang/rustThe Miri Cronjob Bot-5851/+7969
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 3507a749b365aae4eefa96ab700a9315d3280ee7 Filtered ref: 67f9124a1e199effc310447c1c1f9548093bd8f9 This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-15add commentjackh726-0/+7
2025-08-15Add test for webrender-2022 metricsjackh726-0/+32
2025-08-15Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to 3507a749b365aae4eefa96ab700a9315d3280ee7.
2025-08-15Use `LLVMSetTailCallKind`Zalathar-28/+3
2025-08-14bootstrap: Remove dependency on xattrJosh Triplett-14/+3
Extracting the Rust tarballs doesn't require this.
2025-08-14bootstrap: Switch from fd-lock to native locking in stdJosh Triplett-38/+21
In the process, fix a race condition, by never truncating or writing to the file unless we currently hold the lock.
2025-08-15std_detect: RISC-V platform guide documentationTsukasa OI-83/+114
This is practically a revert of a revert, making the commit e907456b2e10622ccd854a3bba8d02ce170b5dbb on `stdarch` come around again with minor fixes, enhancements and adjustments. An excerpt from the original commit message follows: Since there's no architectural feature detection on RISC-V (unlike `CPUID` on x86 architectures and some system registers on Arm/AArch64), runtime feature detection entirely depends on the platform-specific facility. As a result, availability of each feature heavily depends on the platform and its version. To help users make a decision for feature checking on a RISC-V system, this commit adds a platform guide with minimum supported platform versions.
2025-08-15refactor: Add tests for case conversionsKarl Meakin-11/+41
2025-08-15refactor: `generate_tests`Karl Meakin-52/+45
Rewrite `generate_tests` to be more idiomatic.
2025-08-15refactor: rewrite `ranges_from_set`Karl Meakin-66/+17
The `merge_ranges` function was very complicated and hard to understand. Forunately, we can use `slice::chunk_by` to achieve the same thing.
2025-08-15refactor: Include size of case conversion tablesKarl Meakin-18/+42
Include the sizes of the `to_lowercase` and `to_uppercase` tables in the total size calculations.
2025-08-15refactor: Include table sizes in comment at top of `unicode_data.rs`Karl Meakin-11/+19
To make changes in table size obvious from git diffs
2025-08-14Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`Trevor Gross-3/+3
Reference: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid
2025-08-14Auto merge of #145407 - Kobzol:rollup-g6yhx82, r=Kobzolbors-800/+963
Rollup of 11 pull requests Successful merges: - rust-lang/rust#137872 (Include whitespace in "remove |" suggestion and make it hidden) - rust-lang/rust#144631 (Fix test intrinsic-raw_eq-const-bad for big-endian) - rust-lang/rust#145233 (cfg_select: Support unbraced expressions) - rust-lang/rust#145261 (Improve tracing in bootstrap) - rust-lang/rust#145324 (Rename and document `ONLY_HOSTS` in bootstrap) - rust-lang/rust#145353 (bootstrap: Fix jemalloc 64K page support for aarch64 tools) - rust-lang/rust#145379 (bootstrap: Support passing `--timings` to cargo) - rust-lang/rust#145397 (Rust documentation, use `rustc-dev-guide` :3) - rust-lang/rust#145398 (Use `default_field_values` in `Resolver`) - rust-lang/rust#145401 (cleanup: Remove useless `[T].iter().last()`) - rust-lang/rust#145403 (Adjust error message grammar to be less awkward) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-14rustc_expand: ensure stack in `InvocationCollector::visit_expr`Josh Stone-1/+2
In Fedora, when we built rustc with PGO on ppc64le, we started failing the test `issue-74564-if-expr-stack-overflow.rs`. This could also be reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so it's probably just unlucky that ppc64le PGO created a large stack frame somewhere in this recursion path. Adding an `ensure_sufficient_stack` solves the stack overflow. Historically, that test and its fix were added in rust-lang/rust#74708, which was also an `ensure_sufficient_stack` in this area of code at the time. However, the refactor in rust-lang/rust#92573 basically left that to the general `MutVisitor`, and then rust-lang/rust#142240 removed even that ensure call. It may be luck that our tier-1 tested targets did not regress the original issue across those refactors.
2025-08-14Merge pull request #20453 from jackh726/nts-part2Lukas Wirth-2/+9
Fix webrender-2022 metrics - shift vars when mapping dyn
2025-08-14mbe: Handle applying `macro_rules` derivesJosh Triplett-17/+380
Add infrastructure to apply a derive macro to arguments, consuming and returning a `TokenTree` only. Handle `SyntaxExtensionKind::MacroRules` when expanding a derive, if the macro's kinds support derive. Add tests covering various cases of `macro_rules` derives. Note that due to a pre-existing FIXME in `expand.rs`, derives are re-queued and some errors get emitted twice. Duplicate diagnostic suppression makes them not visible, but the FIXME should still get fixed.
2025-08-14use `let-else` to reduce nestingAda Alakbarova-8/+8
..and create a nice linear structure
2025-08-14replace with `?`Ada Alakbarova-15/+15
2025-08-14mbe: Parse macro `derive` rulesJosh Triplett-13/+214
This handles various kinds of errors, but does not allow applying the derive yet. This adds the feature gate `macro_derive`.
2025-08-14Do not pass duplicated `-L` arguments to merged doctestsJakub Beránek-2/+8
2025-08-14Deduplicate `-L` paths passed to rustcJakub Beránek-10/+21
2025-08-14Rollup merge of #145403 - shepmaster:grammar, r=estebankJakub Beránek-61/+61
Adjust error message grammar to be less awkward r? ``@estebank``
2025-08-14Rollup merge of #145401 - estebank:remove-useless-iter, r=compiler-errorsJakub Beránek-2/+2
cleanup: Remove useless `[T].iter().last()`
2025-08-14Rollup merge of #145398 - estebank:use-default-fields-resolver, r=petrochenkovJakub Beránek-30/+17
Use `default_field_values` in `Resolver` Change `Resolver` to use `feature(default_field_values)`. This change is non-exhaustive, as fields may have been added since I made this commit, and `Fx(Index/Hash)(Map/Set)` types would need to have a `const` constructable to change the majority of the fields left over. Using default field values should make it easier to review when we add or remove fields to `Resolver` in the future, and highlight which fields are run-time dependent in `Resolver::new`. r? ``@petrochenkov``
2025-08-14Rollup merge of #145397 - lcnr:lcnr/rustc-dev-guide-3, r=BoxyUwUJakub Beránek-2/+2
Rust documentation, use `rustc-dev-guide` :3 reviving rust-lang/rust#145385 but on my own fork this time r? ``@BoxyUwU``
2025-08-14Rollup merge of #145379 - joshtriplett:bootstrap-timings, r=jieyouxuJakub Beránek-12/+47
bootstrap: Support passing `--timings` to cargo Useful for optimizing the sequencing of the compiler's own build.