about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-13JumpThreading: Re-enable and fix Not ops on non-booleansclubby789-27/+120
2025-04-13Auto merge of #139746 - ChrisDenton:rollup-eq08b2e, r=ChrisDentonbors-565/+494
Rollup of 10 pull requests Successful merges: - #138972 (std: Fix build for NuttX targets) - #139177 (Use -C target-cpu=z13 on s390x vector test) - #139511 (libtest: Pass the test's panic payload as Option instead of Result) - #139605 (update ```miniz_oxide``` to 0.8.8) - #139618 (compiletest: Make `SUGGESTION` annotations viral) - #139677 (Fix profiler_builtins build script to handle full path to profiler lib) - #139683 (Use `with_native_path` for Windows) - #139710 (Move `args` into `std::sys`) - #139721 (End all lines in src/stage0 with trailing newline) - #139726 (Move `select_unpredictable` to the `hint` module) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-13Rollup merge of #139726 - Amanieu:select_unpredictable_hint, r=dtolnayChris Denton-63/+64
Move `select_unpredictable` to the `hint` module There has been considerable discussion in both the ACP (rust-lang/libs-team#468) and tracking issue (#133962) about whether the `bool::select_unpredictable` method should be in `core::hint` instead. I believe this is the right move for the following reasons: - The documentation explicitly says that it is a hint, not a codegen guarantee. - `bool` doesn't have a corresponding `select` method, and I don't think we should be adding one. - This shouldn't be something that people reach for with auto-completion unless they specifically understand the interactions with branch prediction. Using conditional moves can easily make code *slower* by preventing the CPU from speculating past the condition due to the data dependency. - Although currently `core::hint` only contains no-ops, this isn't a hard rule (for example `unreachable_unchecked` is a bit of a gray area). The documentation only status that the module contains "hints to compiler that affects how code should be emitted or optimized". This is consistent with what `select_unpredictable` does.
2025-04-13Rollup merge of #139721 - dtolnay:stage0newline, r=onur-ozkanChris Denton-13/+14
End all lines in src/stage0 with trailing newline Most tools that process text files prefer if every line ends in \n. Text files without the last newline are aberrant and usually not what you want. **Before:** ```console $ cat src/stage0 src/stage0 dist_server=https://static.rust-lang.org artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds ... dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542 dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843dist_server=https://static.rust-lang.org artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds ... dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542 dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843$ โ–Œ ``` **After:** ```console $ cat src/stage0 src/stage0 dist_server=https://static.rust-lang.org artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds ... dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542 dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843 dist_server=https://static.rust-lang.org artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds ... dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542 dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843 $ โ–Œ ```
2025-04-13Rollup merge of #139710 - thaliaarchi:move-args-pal, r=joboetChris Denton-315/+171
Move `args` into `std::sys` Move platform definitions of `args` into `std::sys`, as part of https://github.com/rust-lang/rust/issues/117276. cc ``@joboet``
2025-04-13Rollup merge of #139683 - ChrisDenton:windows-with-native, r=tgross35,joboetChris Denton-47/+86
Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
2025-04-13Rollup merge of #139677 - jchecahi:profiler-builtin-rtlib-path-fix, r=kobzolChris Denton-2/+8
Fix profiler_builtins build script to handle full path to profiler lib LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds), but `-l` expects a library name, not a path. After #138273, this caused builds to fail with a "could not find native static library" error. This patch updates the build script to split the path into directory and filename, using `cargo::rustc-link-search` for the directory and `cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to correctly link the static library even when an absolute path is provided.
2025-04-13Rollup merge of #139618 - petrochenkov:virsugg, r=jieyouxuChris Denton-98/+109
compiletest: Make `SUGGESTION` annotations viral If one of them is expected in a test file, then others should be annotated as well, in the same way as with `HELP`s and `NOTE`s. This doesn't require much of an additional annotation burden, but simplifies the rules. r? ```@jieyouxu```
2025-04-13Rollup merge of #139605 - oyvindln:update_miniz_oxide_0_8, r=Mark-SimulacrumChris Denton-11/+11
update ```miniz_oxide``` to 0.8.8 I would normally let the auto actions handle this but it turns out 0.8.7 can trigger a panic when debug assertions are enabled in a few cases so I feel it's important it gets sorted more quickly. (and I would ideally like to yank that version but was worried that could cause some issues had been pulled in as a dependency by this repo already before I discovered the problem) As it can only happen when debug assertions are enabled (the overflow results in the intended result so it doesn't cause any issue in release mode) and using the wrapping buffer mode when decompressing it is very unlikely to cause any issues here but I would like to get it sorted just to be safe. ```miniz_oxide``` is used in the standard library (and some tools) via ```backtrace-rs ``` which doesn't use a wrapping buffer, and thus won't trigger this condition. There does however seem like there are some tools that do dependency on ```flate2``` which does use ```miniz_oxide``` decompression using a a wrapping buffer and could in theory trigger it if they are run when compiled with debug assertions enabled. It's kinda unclear what version what tool uses though as several of them specify older versions of flate2 which depended on ```miniz_oxide``` 0.7.x in cargo.toml, and ```miniz_oxide```, and not all have a cargo.lock and due to an older version of ```backtrace``` being in the root Cargo.lock which still depended on ```miniz_oxide``` 0.7.4, so that version is also pulled in alongside the newer version.
2025-04-13Rollup merge of #139511 - Zalathar:panic-payload, r=Mark-SimulacrumChris Denton-15/+20
libtest: Pass the test's panic payload as Option instead of Result Passing a `Result<(), &dyn Any>` to `calc_result` requires awkward code at both call sites to build a fake result, for no real benefit. It's much easier to just pass the payload as `Option<&dyn Any>`. No functional change.
2025-04-13Rollup merge of #139177 - fneddy:fix_s390x_codegen_bswap, r=Mark-SimulacrumChris Denton-1/+8
Use -C target-cpu=z13 on s390x vector test currently we see a regression in the `dont-shuffle-bswaps.rs` on s390x. This is due to, the default s390x cpu is set to z10 [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs#L9) which does not have vector instructions implemented. To make the test pass we need to create an extra test revision and set target-cpu at least to `z13`.
2025-04-13Rollup merge of #138972 - thaliaarchi:nuttx-build, r=Mark-SimulacrumChris Denton-0/+3
std: Fix build for NuttX targets Fix std build for all NuttX targets. It is the single largest set of failures on <https://does-it-build.noratrieb.dev/>. Although, ESP-IDF also requires these same gates, there are other issues for those targets. This can verified be running `x check library/std --target=` for all NuttX targets. cc ``@no1wudi``
2025-04-13Auto merge of #138881 - scottmcm:more-chaining-ord, r=Mark-Simulacrumbors-30/+260
Use the chaining methods on PartialOrd for slices too #138135 added these doc-hidden trait methods to improve the tuple codegen. This PR adds more implementations and callers so that the codegen for slice (and array) comparisons also improves.
2025-04-13Auto merge of #139734 - ChrisDenton:rollup-28qn740, r=ChrisDentonbors-133/+174
Rollup of 6 pull requests Successful merges: - #139107 (std: make `cmath` functions safe) - #139607 (Add regression test for #127424) - #139691 (Document that `opt-dist` requires metrics to be enabled) - #139707 (Fix comment in bootstrap) - #139708 (Fix name of field in doc comment) - #139709 (bootstrap: fix typo in doc string) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-12Extend the chaining logic to slices tooScott McMurray-36/+254
2025-04-13Auto merge of #139724 - ChrisDenton:rollup-zhcdtzh, r=ChrisDentonbors-160/+349
Rollup of 8 pull requests Successful merges: - #139163 (indirect-const-stabilize the `exact_div` intrinsic) - #139276 (Revert "Disable `f16` on Aarch64 without `neon`") - #139315 (Switch `time` to `jiff` for time formatting in ICE dumps) - #139382 (Update windows-bindgen to 0.61.0) - #139688 (rustdoc-search: add unbox flag to Result aliases) - #139701 (docs: clarify uint exponent for `is_power_of_two`) - #139705 (Removed outdated ui test suite README, give reasons for disabled tests) - #139713 (Fix typo in documentation) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-13Rollup merge of #139709 - tshepang:patch-5, r=KobzolChris Denton-1/+1
bootstrap: fix typo in doc string
2025-04-13Rollup merge of #139708 - samueltardieu:push-onttwlpwurov, r=petrochenkovChris Denton-1/+1
Fix name of field in doc comment Trivial doc fix
2025-04-13Rollup merge of #139707 - Kobzol:fix-comment, r=jieyouxuChris Denton-4/+1
Fix comment in bootstrap Didn't notice it in https://github.com/rust-lang/rust/pull/139588. r? ````@jieyouxu````
2025-04-13Rollup merge of #139691 - Kobzol:opt-dist-docs, r=jieyouxuChris Denton-2/+7
Document that `opt-dist` requires metrics to be enabled Suggested in https://github.com/rust-lang/rust/pull/139686.
2025-04-13Rollup merge of #139607 - reddevilmidzy:add-regression-test, r=petrochenkovChris Denton-0/+39
Add regression test for #127424 Fixes: https://github.com/rust-lang/rust/issues/127424 This ICE no longer reproduces, so it appears to have already been fixed. This PR adds a regression test to ensure the issue doesnโ€™t come back in the future. Please let me know if there's anything I should improve or revise!
2025-04-13Rollup merge of #139107 - joboet:safe_cmath, r=ibraheemdevChris Denton-125/+125
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until #119899 has merged before making them safe as well.
2025-04-13Move `select_unpredictable` to the `hint` moduleAmanieu d'Antras-63/+64
2025-04-12Rollup merge of #139713 - GenYuLi:master, r=compiler-errorsChris Denton-1/+1
Fix typo in documentation Correct the misspelling of "indentifier" to "identifier" in `library/alloc/src/fmt.rs`.
2025-04-12Rollup merge of #139705 - jieyouxu:tests-precursor, r=compiler-errorsChris Denton-42/+7
Removed outdated ui test suite README, give reasons for disabled tests ### Changes - `tests/ui/README.md` is very outdated, test suite docs should consistently live in rustc-dev-guide. - Add reasons for `//@ ignore-test` tests that don't have one.[^query] This is a precursor change to make follow-up changes easier (possibly more specialized directives or converting some auxiliaries into the canonical `auxiliary/` form). [^query]: searched via `rg --no-ignore -F -e "ignore-test" tests/`.
2025-04-12Rollup merge of #139701 - Rudxain:doc-pow2, r=tgross35Chris Denton-1/+1
docs: clarify uint exponent for `is_power_of_two` This makes the documentation more explicit for that method. I know this might seem "nit-picky", but `k` could be interpreted as "any Real or Complex number". A trivial example would be $`3 = 2^{log_2(3)}`$ which "proves that three is a power of two" (according to that vague definition). BTW, when I read the implementation, I was surprised to see that `1` is considered a power of 2 despite being odd (it does make sense in some contexts, but still not intuitive). So I wrote "positive int" before correcting it to "unsigned int"
2025-04-12Rollup merge of #139688 - rust-lang:notriddle/io-result-unbox, r=GuillaumeGomezChris Denton-0/+41
rustdoc-search: add unbox flag to Result aliases Fixes #139665
2025-04-12Rollup merge of #139382 - ChrisDenton:windows-bindgen-0-61, r=Mark-SimulacrumChris Denton-31/+290
Update windows-bindgen to 0.61.0 This updates the automatically generate Windows API bindings. Not much changed this time: - There's now `Default` implementations for many types, which is convenient. It does however conflict with one place where we implemented a non-zeroed default (to set the length field). But that's no big problem. - The `--no-core` flag has been renamed to `--no-deps` to more accurately reflect its meaning (i.e. generate all necessary code without requiring additional dependencies). - The `--link` flag allows us to set the location of the `link!` macro. Currently we use our workspace's `windows_targets` crate but we could move it into library/std using `--link`. However, this would need to be co-ordinated with the `backtrace` crate (which is a separate crate but included in std using `#[path]`). So I've left that for another time.
2025-04-12Rollup merge of #139315 - clubby789:deranged-bump, r=Mark-SimulacrumChris Denton-72/+8
Switch `time` to `jiff` for time formatting in ICE dumps Due to https://github.com/jhpratt/deranged/issues/21, Clippy, R-A and Miri currently fail to build if we bump to 0.4.1, pulled in via `time`. ~~Add some specific type annotations so we don't have to just pin it.~~ ~~I can open 3 PRs to the tool repos if preferred, but I thought it might be easier to do this than to pin the transitive dep and go back and remove it once the changes are synced back.~~
2025-04-12Rollup merge of #139276 - tgross35:enable-f16-without-neon, r=Mark-SimulacrumChris Denton-7/+0
Revert "Disable `f16` on Aarch64 without `neon`" The LLVM issue [1] was resolved and the fix was synced to rust-lang/rust in [2]. This reverts commit c51b229140c885cac757a405a328a07e90d5bca9. [1]: https://github.com/llvm/llvm-project/issues/129394 [2]: https://github.com/rust-lang/rust/pull/138695 try-job: aarch64-gnu try-job: aarch64-gnu-debug try-job: armhf-gnu try-job: dist-various-1
2025-04-12Rollup merge of #139163 - scottmcm:stabilize-exact_div, r=RalfJungChris Denton-6/+1
indirect-const-stabilize the `exact_div` intrinsic See https://github.com/rust-lang/rust/issues/74985#issuecomment-2759179184
2025-04-12Auto merge of #139640 - Zoxc:big-file-encoder, r=saethlinbors-1/+1
Bump `FileEncoder` buffer size to 64 kB This helps avoid file system overhead on Windows. The improvement are probably reduced a bit on other platforms. Making the buffer size even larger does further improve performance, but that increase memory use further. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Physical Memory</td><td align="right">Physical Memory</td><td align="right">%</th><td align="right">Committed Memory</td><td align="right">Committed Memory</td><td align="right">%</th></tr><tr><td>๐ŸŸฃ <b>clap</b>:check:unchanged</td><td align="right">0.3336s</td><td align="right">0.3242s</td><td align="right">๐Ÿ’š -2.82%</td><td align="right">96.97 MiB</td><td align="right">97.12 MiB</td><td align="right"> 0.16%</td><td align="right">167.87 MiB</td><td align="right">167.97 MiB</td><td align="right"> 0.06%</td></tr><tr><td>๐ŸŸฃ <b>hyper</b>:check:unchanged</td><td align="right">0.1331s</td><td align="right">0.1307s</td><td align="right">๐Ÿ’š -1.79%</td><td align="right">61.92 MiB</td><td align="right">62.05 MiB</td><td align="right"> 0.20%</td><td align="right">124.66 MiB</td><td align="right">124.74 MiB</td><td align="right"> 0.06%</td></tr><tr><td>๐ŸŸฃ <b>regex</b>:check:unchanged</td><td align="right">0.2485s</td><td align="right">0.2399s</td><td align="right">๐Ÿ’š -3.45%</td><td align="right">78.32 MiB</td><td align="right">78.55 MiB</td><td align="right"> 0.29%</td><td align="right">145.22 MiB</td><td align="right">145.45 MiB</td><td align="right"> 0.15%</td></tr><tr><td>๐ŸŸฃ <b>syn</b>:check:unchanged</td><td align="right">0.5321s</td><td align="right">0.5175s</td><td align="right">๐Ÿ’š -2.76%</td><td align="right">118.58 MiB</td><td align="right">118.77 MiB</td><td align="right"> 0.16%</td><td align="right">192.99 MiB</td><td align="right">193.17 MiB</td><td align="right"> 0.09%</td></tr><tr><td>Total</td><td align="right">1.2474s</td><td align="right">1.2123s</td><td align="right">๐Ÿ’š -2.81%</td><td align="right">355.78 MiB</td><td align="right">356.49 MiB</td><td align="right"> 0.20%</td><td align="right">630.74 MiB</td><td align="right">631.32 MiB</td><td align="right"> 0.09%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9729s</td><td align="right">๐Ÿ’š -2.71%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.20%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.09%</td></tr></table>
2025-04-12End all lines in src/stage0 with trailing newlineDavid Tolnay-13/+14
2025-04-12Auto merge of #139242 - jieyouxu:run-make-artifact-names-cross, r=Kobzolbors-19/+81
run-make-support: Calculate artifact names for target platform, not host platform This was implemented incorrectly during the porting process, where we relied on std consts. However, `run-make-support` is a host-only library, which meant that these artifact names were for the *host* and not the *target*. Helps with #138066. r? `@Kobzol` try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: aarch64-apple try-job: x86_64-apple-1
2025-04-12Fix typo in documentationGenYuLi-1/+1
Correct the misspelling of "indentifier" to "identifier" in `library/alloc/src/fmt.rs`.
2025-04-12Auto merge of #139697 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 12 commits in 0e93c5bf6a1d5ee7bc2af63d1afb16cd28793601..864f74d4eadcaea3eeda37a2e7f4d34de233d51e 2025-04-05 00:00:24 +0000 to 2025-04-11 20:37:27 +0000 - chore: Bump build-rs version (rust-lang/cargo#15421) - fix(build): Correct name of CARGO_CFG_FEATURE (rust-lang/cargo#15420) - Revert "fix(package): detect dirtiness for symlinks to submodule" (rust-lang/cargo#15419) - Improved error message when build-dir template var is invalid (rust-lang/cargo#15418) - Added validation for unmatched brackets in build-dir template (rust-lang/cargo#15414) - fix(package): detect dirtiness for symlinks to submodule (rust-lang/cargo#15416) - chore(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 (rust-lang/cargo#15415) - docs(metadata): Added build_directory to cargo metadata documentation (rust-lang/cargo#15410) - Added symlink resolution for `workspace-path-hash` (rust-lang/cargo#15400) - feat: print target and package names formatted as file hyperlinks (rust-lang/cargo#15405) - docs(ref): Use better example value in `CARGO_CFG_TARGET_ABI` (rust-lang/cargo#15404) - chore: Bump cargo-util-schemas to 0.8.2 (rust-lang/cargo#15403) r? ghost
2025-04-12Add regression test for #127424reddevilmidzy-0/+39
2025-04-12Unify owned Args types between platformsThalia Archibald-222/+77
2025-04-12Use unsupported args for espidf and vitaThalia Archibald-14/+3
2025-04-12Move args into std::sysThalia Archibald-41/+53
2025-04-12bootstrap: fix typo in doc stringTshepang Mbambo-1/+1
2025-04-12Fix name of field in doc commentSamuel Tardieu-1/+1
2025-04-12Fix comment in bootstrapJakub Berรกnek-4/+1
2025-04-12tests: ensure disabled tests have a reasonJieyou Xu-7/+7
2025-04-12tests/ui: remove outdated READMEJieyou Xu-35/+0
We should consolidate our test suite docs in rustc-dev-guide, and this README is very outdated.
2025-04-12tests: produce target artifacts and/or require crate type / ignore cross-compileJieyou Xu-6/+41
Some tests fail on cross-compiled targets due to various linker problems on cross-compiled target, and having test coverage for these against cross-compiled targets is nice but not necessary.
2025-04-12run-make-support: fix artifact name calculations for targetJieyou Xu-13/+40
This was implemented incorrectly during the porting process, where we relied on std consts. However, `run-make-support` is a host-only library, which meant that these artifact names were for the *host* and not the *target*.
2025-04-12docs: clarify uint exponent for `is_power_of_two`Ricardo Fernรกndez Serrata-1/+1
2025-04-11Update cargoWeihang Lo-0/+0
2025-04-11Auto merge of #139430 - scottmcm:polymorphic-array-into-iter, r=cuviperbors-144/+452
Polymorphize `array::IntoIter`'s iterator impl Today we emit all the iterator methods for every different array width. That's wasteful since the actual array length never even comes into it -- the indices used are from the separate `alive: IndexRange` field, not even the `N` const param. This PR switches things so that an `array::IntoIter<T, N>` stores a `PolymorphicIter<[MaybeUninit<T>; N]>`, which we *unsize* to `PolymorphicIter<[MaybeUninit<T>]>` and call methods on that non-`Sized` type for all the iterator methods. That also necessarily makes the layout consistent between the different lengths of arrays, because of the unsizing. Compare that to today <https://rust.godbolt.org/z/Prb4xMPrb>, where different widths can't even be deduped because the offset to the indices is different for different array widths.