about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-14normalize: prefer ParamEnv over AliasBoundlcnr-21/+59
2025-04-14Auto merge of #124141 - ↵bors-532/+164
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-14Auto merge of #139766 - jhpratt:rollup-afrfmnk, r=jhprattbors-393/+827
Rollup of 10 pull requests Successful merges: - #137043 (Initial `UnsafePinned` implementation [Part 1: Libs]) - #138962 (Expect an array when expected and acutal types are both arrays during cast) - #139001 (add `naked_functions_rustic_abi` feature gate) - #139379 (Use delayed bug for normalization errors in drop elaboration) - #139582 (Various coercion cleanups) - #139628 (Suggest remove redundant `$()?` around `vis`) - #139644 (Micro-optimize `InstSimplify`'s `simplify_primitive_clone`) - #139674 (In `rustc_mir_transform`, iterate over index newtypes instead of ints) - #139740 (Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test) - #139741 (fix smir's run! doc and import) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-13Rollup merge of #139741 - os-checker:smir-run-macro, r=scottmcmJacob Pratt-21/+3
fix smir's run! doc and import This PR * adds missing `extern crate rustc_middle` in `rustc_smir::run!` docstring * adds missing `use rustc_smir::rustc_internal` in `run_driver!` scope * also adjust some tests that don't need to import rustc_internalany more
2025-04-13Rollup merge of #139740 - jieyouxu:known-bug, r=nnethercoteJacob Pratt-54/+20
Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test I did a survey pass over `tests/`, and this test seems like the only candidate suitable for conversion into a known-bug test. (Other tests had varying degrees of other issues that known-bug would not be suitable.) r? compiler
2025-04-13Rollup merge of #139674 - yotamofek:pr/mir_transform/index-iterators, ↵Jacob Pratt-53/+46
r=compiler-errors In `rustc_mir_transform`, iterate over index newtypes instead of ints Just makes code more idiomatic/easier to read, IMHO. Also, some drive-by simplifications and cleanups.
2025-04-13Rollup merge of #139644 - ↵Jacob Pratt-17/+8
yotamofek:pr/mir_transform/instsimplify/simplify_primitive_clone, r=compiler-errors Micro-optimize `InstSimplify`'s `simplify_primitive_clone` r? ````@compiler-errors```` , since you already did #139411 and got randomly selected for #139638 (feel free to reassign!) Another one similar in spirit to #139411, but this time for `simplify_primitive_clone`, which is doing a bit of redundant work. Might not show up in benches, but probably worth micro-optimizing since the transformation is run even for debug builds. See inline comments for my reasoning for making these changes.
2025-04-13Rollup merge of #139628 - makai410:suggest-vis, r=compiler-errorsJacob Pratt-6/+128
Suggest remove redundant `$()?` around `vis` Resolves: #139480 .
2025-04-13Rollup merge of #139582 - oli-obk:coercion-cleanups, r=compiler-errorsJacob Pratt-94/+82
Various coercion cleanups I think the commit order is the most reasonable one, but there's probably more ways to get to the same goal. Essentially I got rid of the `simple` and `identity` helpers by adding a dedicated function for the common `identity` case and getting rid of the callbacks alltogether by realizing that all callbacks were of the pattern "use this fixed prefix list of adjustments, then add another adjustment with the unified type as the target type". No behavioral changes intended
2025-04-13Rollup merge of #139379 - matthewjasper:drop-elab-normalization, ↵Jacob Pratt-10/+70
r=compiler-errors Use delayed bug for normalization errors in drop elaboration Normalization can fail due to a lot of different earlier errors, so just use span_delayed_bug if normalization failed. Closes #137287 Closes #135668 r? compiler-errors
2025-04-13Rollup merge of #139001 - folkertdev:naked-function-rustic-abi, ↵Jacob Pratt-107/+142
r=traviscross,compiler-errors add `naked_functions_rustic_abi` feature gate tracking issue: https://github.com/rust-lang/rust/issues/138997 Because the details of the rust abi are unstable, and a naked function must match its stated ABI, this feature gate keeps naked functions with a rustic abi ("Rust", "rust-cold", "rust-call" and "rust-intrinsic") unstable. r? ````@traviscross````
2025-04-13Rollup merge of #138962 - xizheyin:issue-138836, r=compiler-errorsJacob Pratt-23/+38
Expect an array when expected and acutal types are both arrays during cast Closes #138836
2025-04-13Rollup merge of #137043 - Sky9x:unsafe-pinned-pt1-libs, ↵Jacob Pratt-8/+290
r=tgross35,RalfJung,WaffleLapkin Initial `UnsafePinned` implementation [Part 1: Libs] Initial libs changes necessary to unblock further work on [RFC 3467](https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html). Tracking issue: #125735 This PR is split off from #136964, and includes just the libs changes: - `UnsafePinned` struct - private `UnsafeUnpin` structural auto trait - Lang items for both - Compiler changes necessary to block niches on `UnsafePinned` This PR does not change codegen, miri, the existing `!Unpin` hack, or anything else. That work is to be split into later PRs. --- cc ``@RalfJung`` ``@Noratrieb`` ``@rustbot`` label F-unsafe_pinned T-libs-api
2025-04-13Auto merge of #131203 - clubby789:jumpthreading-not, r=compiler-errorsbors-90/+207
JumpThreading: fix bitwise not on non-booleans Fixes #131195 Alternative to #131201
2025-04-13JumpThreading: Bail out on interp errorsclubby789-67/+91
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-13import rustc_smir::rustc_internal in run_driver!zjp-21/+1
2025-04-13add missing `extern crate rustc_middle` in rustc_smir::run! docstringzjp-0/+2
2025-04-13tests: convert `tests/ui/lint/dead-code/self-assign.rs` to known-bugJieyou Xu-54/+20
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-13Initial `UnsafePinned`/`UnsafeUnpin` impl [Part 1: Libs]Sky-8/+290
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