about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-04Rollup merge of #142007 - nnethercote:visitor-comments, r=chenyukangMatthias Krüger-5/+11
Improve some `Visitor` comments. For AST/HIR/THIR visitors, explain the use of deconstruction. r? ``@BoxyUwU``
2025-06-04Rollup merge of #141959 - ferrocene:lw/2015-edition-directives2, ↵Matthias Krüger-46/+74
r=compiler-errors Add more missing 2015 edition directives These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-06-04Rollup merge of #141939 - Qelxiros:139911-exact-div-tests, r=workingjubileeMatthias Krüger-0/+62
exact_div: add tests tracking issue: rust-lang/rust#139911 I neglected to add tests in my last PR (rust-lang/rust#141237), so I've added them here. r? ``@workingjubilee`` (Feel free to reroll, I just picked you since you reviewed the last one.)
2025-06-04Rollup merge of #141924 - rs-sac:extr-doc, r=jhprattMatthias Krüger-7/+7
Lightly tweak docs for BTree{Map,Set}::extract_if - Move explanations into comments to match style - Explain the second examples - Make variable names match the data structure Related rust-lang/rust#70530
2025-06-04Rollup merge of #141893 - usamoi:lossless, r=tgross35Matthias Krüger-1/+0
remove `f16: From<u16>` it's not a lossless conversion r? ``@tgross35``
2025-06-04Rollup merge of #141570 - chenyukang:yukang-fix-eq_unspanned, r=workingjubileeMatthias Krüger-16/+12
Fix incorrect eq_unspanned in TokenStream Fixes rust-lang/rust#141522 r? ``@workingjubilee`` should we remove this function? since it's used in several places, i'd prefer to keep it.
2025-06-04Rollup merge of #141271 - nnethercote:attr-streamline, r=jdonszelmannMatthias Krüger-64/+19
Streamline some attr parsing APIs r? ``@jdonszelmann``
2025-06-04Auto merge of #142003 - matthiaskrgr:rollup-ad8l9ns, r=matthiaskrgrbors-632/+688
Rollup of 8 pull requests Successful merges: - rust-lang/rust#136687 (Improve the documentation of `Display` and `FromStr`, and their interactions) - rust-lang/rust#137306 (Remove `i128` and `u128` from `improper_ctypes_definitions`) - rust-lang/rust#138699 (build dist for x86_64-pc-solaris and sparcv9-sun-solaris) - rust-lang/rust#141250 (add s390x z17 target features) - rust-lang/rust#141467 (make `OsString::new` and `PathBuf::new` unstably const) - rust-lang/rust#141871 (index: add method for checking range on DenseBitSet) - rust-lang/rust#141888 (Use non-2015 edition paths in tests that do not test for their resolution) - rust-lang/rust#142000 (bootstrap: don't symlink source dir into stage0 sysroot) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-04Improve some `Visitor` comments.Nicholas Nethercote-5/+11
For AST/HIR/THIR visitors, explain the use of deconstruction.
2025-06-04Rollup merge of #142000 - lambdageek:no-symlink-stage0, r=onur-ozkanMatthias Krüger-13/+17
bootstrap: don't symlink source dir into stage0 sysroot In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy will overwrite the repo sources with the toolchain's sources. Fixes https://github.com/rust-lang/rust/issues/141991
2025-06-04Rollup merge of #141888 - ferrocene:lw/decouple-tests-from-2015, ↵Matthias Krüger-193/+194
r=compiler-errors Use non-2015 edition paths in tests that do not test for their resolution This allows for testing these tests on editions other than 2015
2025-06-04Rollup merge of #141871 - nia-e:fix-bitset, r=eholkMatthias Krüger-4/+46
index: add method for checking range on DenseBitSet Micro-optimisation that Miri benefits from with the new isolated allocator for native-libs mode. Also possibly just a useful method to have on `DenseBitSet`
2025-06-04Rollup merge of #141467 - cyrgani:const-empty-stringlikes, r=AmanieuMatthias Krüger-5/+7
make `OsString::new` and `PathBuf::new` unstably const Since #129041, `String::into_bytes` is `const`, which allows making `OsString::new` and `PathBuf::new` unstably const now. Not sure what the exact process for this is; does it need an ACP?
2025-06-04Rollup merge of #141250 - folkertdev:s390x-z17-target-features, r=workingjubileeMatthias Krüger-10/+36
add s390x z17 target features tracking issue: https://github.com/rust-lang/rust/issues/130869 earlier target features were added in https://github.com/rust-lang/rust/pull/135630, and https://github.com/rust-lang/rust/issues/135413#issuecomment-2886439455 has some extra context on these new features. r? ``@ghost`` cc ``@uweigand``
2025-06-04Rollup merge of #138699 - psumbera:solaris-ci-build3, r=marcoieniMatthias Krüger-172/+285
build dist for x86_64-pc-solaris and sparcv9-sun-solaris try-job: dist-sparcv9-solaris try-job: dist-x86_64-solaris try-job: dist-various-2 try-job: dist-x86_64-illumos
2025-06-04Rollup merge of #137306 - tgross35:remove-i128-u128-improper-ctypes, ↵Matthias Krüger-235/+75
r=traviscross,workingjubilee Remove `i128` and `u128` from `improper_ctypes_definitions` Rust's 128-bit integers have historically been incompatible with C [1]. However, there have been a number of changes in Rust and LLVM that mean this is no longer the case: * Incorrect alignment of `i128` on x86 [1]: adjusting Rust's alignment proposed at https://github.com/rust-lang/compiler-team/issues/683, implemented at https://github.com/rust-lang/rust/pull/116672. * LLVM version of the above: resolved in LLVM, including ABI fix. Present in LLVM18 (our minimum supported version). * Incorrect alignment of `i128` on 64-bit PowerPC, SPARC, and MIPS [2]: Rust's data layouts adjusted at https://github.com/rust-lang/rust/pull/132422, https://github.com/rust-lang/rust/pull/132741, https://github.com/rust-lang/rust/pull/134115. * LLVM version of the above: done in LLVM 20 https://github.com/llvm/llvm-project/issues/102783. * Incorrect return convention of `i128` on Windows: adjusted to match GCC and Clang at https://github.com/rust-lang/rust/pull/134290. At https://github.com/rust-lang/lang-team/issues/255#issuecomment-2088855084, the lang team considered it acceptable to remove `i128` from `improper_ctypes_definitions` if the LLVM version is known to be compatible. Time has elapsed since then and we have dropped support for LLVM versions that do not have the x86 fixes, meaning a per-llvm-version lint should no longer be necessary. The PowerPC, SPARC, and MIPS changes only came in LLVM 20 but since Rust's datalayouts have also been updated to match, we will be using the correct alignment regardless of LLVM version. `repr(i128)` was added to this lint in https://github.com/rust-lang/rust/pull/138282, but is also removed here. Part of the decision is that `i128` should match `__int128` in C on platforms that provide it, which documentation is updated to indicate. We will not guarantee that `i128` matches `_BitInt(128)` since that can be different from `__int128`. Some platforms (usually 32-bit) do not provide `__int128`; if any ABIs are extended in the future to define it, we will need to make sure that our ABI matches. Closes: https://github.com/rust-lang/rust/issues/134288 [1]: https://github.com/rust-lang/rust/issues/54341 [2]: https://github.com/rust-lang/rust/issues/128950
2025-06-04Rollup merge of #136687 - joshtriplett:improve-display-and-fromstr-docs, ↵Matthias Krüger-0/+28
r=Amanieu Improve the documentation of `Display` and `FromStr`, and their interactions In particular: - `Display` is not necessarily lossless - The output of `Display` might not be parseable by `FromStr`, and might not produce the same value if it is. - Calling `.parse()` on the output of `Display` is usually a mistake unless a type's documented output and input formats match. - The input formats accepted by `FromStr` depend on the type. This documentation adds no API surface area and makes no guarantees about stability. To the best of my knowledge, everything it says is already established to be true. As such, I don't think it needs an FCP.
2025-06-04Auto merge of #141652 - compiler-errors:more-collect-and-apply, r=lqdbors-46/+90
Rework `collect_and_apply` to not rely on size hint for optimization I saw that we have quite a few `collect_and_apply` calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.
2025-06-04bootstrap: don't symlink source dir into stage0 sysrootAleksey Kliger-13/+17
In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy will overwrite the repo sources with the toolchain's sources.
2025-06-03add tests for negative numbersJeremy Smart-0/+14
2025-06-03Auto merge of #141984 - matthiaskrgr:rollup-wy6j9ca, r=matthiaskrgrbors-5460/+5958
Rollup of 8 pull requests Successful merges: - rust-lang/rust#137725 (Add `iter` macro) - rust-lang/rust#141455 (std: abort the process on failure to allocate a TLS key) - rust-lang/rust#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`) - rust-lang/rust#141698 (Use the informative error as the main const eval error message) - rust-lang/rust#141925 (Remove bootstrap cfgs from library/) - rust-lang/rust#141943 (Remove pre-expansion AST stats.) - rust-lang/rust#141945 (Remove `Path::is_ident`.) - rust-lang/rust#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-04index: add method for checking range on DenseBitSetNia Espera-4/+46
2025-06-03`Display`: Rework explanation of `FromStr`/`Display` round-trippingJosh Triplett-2/+7
- Drop "usually a mistake" - Add phrasing from `FromStr` about round-tripping, and about how the inability to round-trip may surprise users.
2025-06-03`FromStr`: Rework explanation of `FromStr`/`Display` round-trippingJosh Triplett-6/+5
- Drop the phrasing "usually a mistake". - Mention that `Display` may not be lossless. - Drop a misplaced parenthetical about round-tripping that didn't fit the paragraph it was in.
2025-06-03Add some more description of interactions between `Display` and `FromStr`Josh Triplett-0/+6
2025-06-03Improve the documentation of `Display` and `FromStr`, and their interactionsJosh Triplett-0/+18
In particular: - `Display` is not necessarily lossless - The output of `Display` might not be parseable by `FromStr`, and might not produce the same value if it is. - Calling `.parse()` on the output of `Display` is usually a mistake unless a type's documented output and input formats match. - The input formats accepted by `FromStr` depend on the type.
2025-06-03Rollup merge of #141957 - ferrocene:lw/missing-dyn-kw2, r=compiler-errorsMatthias Krüger-31/+26
Add missing `dyn` keywords to tests that do not test for them Part 2 Some more tests that were found
2025-06-03Rollup merge of #141945 - nnethercote:rm-Path-is_ident, r=compiler-errorsMatthias Krüger-14/+10
Remove `Path::is_ident`. It checks that a path has a single segment that matches the given symbol, and that there are zero generic arguments. It has a single use. We also have `impl PartialEq<Symbol> for Path` which does exactly the same thing *except* it doesn't check for zero generic arguments, which seems like an oversight. It has numerous uses. This commit removes `Path::is_ident`, adds a test for zero generic arguments to `PartialEq<Symbol> for Path`, and changes the single use of `is_ident` to instead use `==`. r? `@wesleywiser`
2025-06-03Rollup merge of #141943 - nnethercote:rm-pre-expansion-ast-stats, ↵Matthias Krüger-122/+61
r=compiler-errors Remove pre-expansion AST stats. They're very little value, because they only measure the top-level `main.rs` or `lib.rs` file. (Other `.rs` files don't get read and parsed until expansion occurs.) I saw an example recently where the pre-expansion AST was 3KB in size and the post-expansion AST was 66MB. I kept the "POST EXPANSION" in the output header, I think that's useful information to avoid possible confusion about when the measurement happens. r? `@davidtwco`
2025-06-03Rollup merge of #141925 - cuviper:vestigial-bootstrap, r=workingjubileeMatthias Krüger-134/+14
Remove bootstrap cfgs from library/ These `cfg(bootstrap)` are always false now that rust-lang/rust#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
2025-06-03Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJungMatthias Krüger-4299/+4132
Use the informative error as the main const eval error message r? `@RalfJung` I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
2025-06-03Rollup merge of #141569 - workingjubilee:canonicalize-abi, r=bjorn3Matthias Krüger-788/+879
Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi` Our `conv_from_spec_abi`, `adjust_abi`, and `is_abi_supported` combine to give us a very confusing way of reasoning about what _actual_ calling convention we want to lower our code to and whether we want to compile the resulting code at all. Instead of leaving this code as a miniature adventure game in which someone tries to combine stateful mutations into a Rube Goldberg machine that will let them escape the maze and arrive at the promised land of codegen, we let `AbiMap` devour this complexity. Once you have an `AbiMap`, you can answer which `ExternAbi`s will lower to what `CanonAbi`s (and whether they will lower at all). Removed: - `conv_from_spec_abi` replaced by `AbiMap::canonize_abi` - `adjust_abi` replaced by same - `Conv::PreserveAll` as unused - `Conv::Cold` as unused - `enum Conv` replaced by `enum CanonAbi` target-spec.json changes: - If you have a target-spec.json then now your "entry-abi" key will be specified in terms of one of the `"{abi}"` strings Rust recognizes, e.g. ```json "entry-abi": "C", "entry-abi": "win64", "entry-abi": "aapcs", ```
2025-06-03Rollup merge of #141455 - joboet:tls_exhaustion_abort, r=tgross35Matthias Krüger-11/+10
std: abort the process on failure to allocate a TLS key The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see https://github.com/rust-lang/rust/issues/140798#issuecomment-2872307377). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
2025-06-03Rollup merge of #137725 - oli-obk:i-want-to-move-it-move-it, ↵Matthias Krüger-61/+826
r=compiler-errors,traviscross Add `iter` macro See related discussion in https://rust-lang.zulipchat.com/#narrow/channel/481571-t-lang.2Fgen/topic/iter!.20macro/near/500784563 very little error case testing so far, but the success path works. There is also no `IterFn` trait yet, as T-lang didn't consider it something urgently needed I think we can implement it in follow-up PRs. r? lang for the tests, `@compiler-errors` for the impl
2025-06-03Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzolbors-3/+53018
Merge `compiler-builtins` as a Josh subtree Use the Josh [1] utility to add `compiler-builtins` as a subtree, which will allow us to stop using crates.io for updates. This is intended to help resolve some problems when unstable features change and require code changes in `compiler-builtins`, which sometimes gets trapped in a bootstrap cycle. This was done using `josh-filter` built from the r24.10.04 tag: git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD git merge --allow-unrelated FILTERED_HEAD The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if statement that can be collapsed"). [1]: https://github.com/josh-project/josh
2025-06-03Add `iter` macroOli Scherer-61/+826
This adds an `iter!` macro that can be used to create movable generators. This also adds a yield_expr feature so the `yield` keyword can be used within iter! macro bodies. This was needed because several unstable features each need `yield` expressions, so this allows us to stabilize them separately from any individual feature. Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de> Co-authored-by: Jieyou Xu <jieyouxu@outlook.com> Co-authored-by: Travis Cross <tc@traviscross.com>
2025-06-03Rework collect_and_apply to not rely on size hint for optimizationMichael Goulet-46/+90
2025-06-03compiler: actually remove Conv now that it is irrelevantJubilee Young-163/+1
2025-06-03compiler: simplify TargetOptions ABI functionsJubilee Young-108/+2
`adjust_abi` is not needed and `is_abi_supported` can be a 1-liner.
2025-06-03bless test for CanonAbi::X86(SysV64) changeJubilee Young-1/+3
2025-06-03miri: sed to CanonAbiJubilee Young-327/+354
2025-06-03cg_gcc: convert to CanonAbiJubilee Young-48/+31
2025-06-03cg_clif: convert to CanonAbiJubilee Young-27/+22
2025-06-03cg_llvm: convert to CanonAbiJubilee Young-29/+40
2025-06-03compiler: change Conv to CanonAbiJubilee Young-65/+64
2025-06-03compiler: use CanonAbi for entry_abiJubilee Young-22/+27
makes entry_abi a lowering of the ABI string, so now it can be ```json "entry_abi": "C", "entry_abi": "win64", "entry_abi": "aapcs", ```
2025-06-03compiler: add AbiMapJubilee Young-1/+190
- Add AbiMapping for encoding the nuance of deprecated ABIs
2025-06-03Auto merge of #141961 - matthiaskrgr:rollup-r09j2sp, r=matthiaskrgrbors-241/+673
Rollup of 8 pull requests Successful merges: - rust-lang/rust#141724 (fix(rust-lang/rust#141141): When expanding `PartialEq`, check equality of scalar types first.) - rust-lang/rust#141833 (`tests/ui`: A New Order [2/N]) - rust-lang/rust#141861 (Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images) - rust-lang/rust#141914 (redesign stage 0 std follow-ups) - rust-lang/rust#141918 (Deconstruct values in the THIR visitor) - rust-lang/rust#141923 (Update books) - rust-lang/rust#141931 (Deconstruct values in the THIR visitor) - rust-lang/rust#141956 (Remove two trait methods from cg_ssa) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-03Auto merge of #136942 - Kobzol:stage0-sccache, r=jieyouxubors-0/+22
Use ccache for stage0 tool builds Now after the stage0 redesign, we can actually start ccaching the build of the compiler itself. We can also cache the bootstrap tools, since these are also built with the stage0 compiler. Stage0 compiler builds are now being cached: https://github.com/rust-lang/rust/actions/runs/15397246267#summary-43321151192 (`..bootstrap::core::build_steps::compile::Rustc 483.10s 40.41s -91.6%`). It's not a gigantic win everywhere, but it should help. It seems to make the Linux jobs ~10 minute faster. It should be especially useful on PR builds after https://github.com/rust-lang/rust/pull/141948. r? `@jieyouxu` try-job: `x86_64-gnu-llvm-19*` try-job: `x86_64-msvc*` try-job: `x86_64-apple*` try-job: `dist-x86_64-linux`
2025-06-03Rollup merge of #141956 - bjorn3:minor_cg_ssa_cleanup, r=oli-obkMatthias Krüger-25/+11
Remove two trait methods from cg_ssa They are only called by cg_llvm.