about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-24Rollup merge of #140075 - Urgau:midpoint-average, r=tgross35Matthias Krüger-9/+25
Mention average in midpoint documentations Added a mention to "average" in midpoint documentations and as well as some `#[doc(alias = "average")]`[^1]. This is done to improve the discoverability of the function. [^1]: https://docs.rs/num-integer/latest/num_integer/trait.Average.html#tymethod.average_floor
2025-04-24Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obkMatthias Krüger-12/+68
mitigate MSVC alignment issue on x86-32 This implements mitigation for https://github.com/rust-lang/rust/issues/112480 by stopping to emit `align` attributes on loads and function arguments when building for a win32 MSVC target. MSVC is known to not properly align `u64` and similar types, and claiming to LLVM that everything is properly aligned increases the chance that this will cause problems. Of course, the misalignment is still a bug, but we can't fix that bug, only MSVC can. Also add an errata note to the platform support page warning users about this known problem. try-job: `i686-msvc*`
2025-04-24Mention average in midpoint documentationsUrgau-9/+25
2025-04-24Auto merge of #140168 - joshlf:no-nfas, r=jswrennbors-161/+778
transmute: Mark edges by byte sets, not byte values This leads to drastic performance improvements. For example, on the author's 2024 MacBook Pro, the time to convert the `Tree` representation of a `u64` to its equivalent DFA representation drops from ~8.5ms to ~1us, a reduction of ~8,500x. See `bench_dfa_from_tree`. Similarly, the time to execute a transmutability query from `u64` to `u64` drops from ~35us to ~1.7us, a reduction of ~20x. See `bench_transmute`. r? `@jswrenn`
2025-04-24Auto merge of #139309 - RalfJung:abi_unsupported_vector_types, ↵bors-978/+157
r=fee1-dead,traviscross make abi_unsupported_vector_types a hard error Fixes https://github.com/rust-lang/rust/issues/116558 by completing the transition; see that issue for context. The lint was introduced with Rust 1.84 and this has been shown in cargo's future breakage reports since Rust 1.85, released 6 weeks ago, and so far we got 0 complaints by users. There's not even a backlink on the tracking issue. We did a [crater run](https://github.com/rust-lang/rust/pull/127731#issuecomment-2286736295) when the lint was originally added and found no breakage. So I don't think we need another crater run now, but I can do one if the team prefers that. https://github.com/rust-lang/rust/issues/131800 is done, so for most current targets (in particular, all tier 1 and tier 2 targets) we have the information to implement this check (modulo the targets where we don't properly support SIMD vectors yet, see the sub-issues of https://github.com/rust-lang/rust/issues/116558). If a new target gets added in the future, it will default to reject all SIMD vector types until proper information is added, which is the default we want. This will need approval by for `@rust-lang/lang.` Cc `@workingjubilee` `@veluca93` try-job: test-various try-job: armhf-gnu try-job: dist-i586-gnu-i586-i686-musl
2025-04-23Auto merge of #138845 - compiler-errors:stall-generators, r=lcnrbors-153/+436
Properly stall coroutine witnesses in new solver TODO: write description r? lcnr
2025-04-23transmutability: Mark edges by ranges, not valuesJoshua Liebow-Feeser-161/+778
In the `Tree` and `Dfa` representations of a type's layout, store byte ranges rather than needing to separately store each byte value. This permits us to, for example, represent a `u8` using a single 0..=255 edge in the DFA rather than using 256 separate edges. This leads to drastic performance improvements. For example, on the author's 2024 MacBook Pro, the time to convert the `Tree` representation of a `u64` to its equivalent DFA representation drops from ~8.5ms to ~1us, a reduction of ~8,500x. See `bench_dfa_from_tree`. Similarly, the time to execute a transmutability query from `u64` to `u64` drops from ~35us to ~1.7us, a reduction of ~20x. See `bench_transmute`.
2025-04-23Auto merge of #139983 - flip1995:clippy-subtree-update, r=Manishearthbors-7047/+13740
Clippy subtree update r? `@Manishearth` Cargo.lock update due to the Clippy version bump and because Clippy moved from rinja (unmaintained) to askama. Last sync was skipped due to the askama issue and me not getting to fixing this in time.
2025-04-23Auto merge of #140180 - ChrisDenton:rollup-5pvs08u, r=ChrisDentonbors-355/+373
Rollup of 7 pull requests Successful merges: - #140142 (Some more graphviz tweaks) - #140146 (Update `compiler_builtins` to 0.1.156) - #140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.) - #140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic) - #140163 (Validate extension in `PathBuf::add_extension`) - #140173 (Ping Mara when touching format_args!() internals.) - #140175 (`rc""` more clear error message) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-23MoreMichael Goulet-187/+189
2025-04-23Auto merge of #139998 - Zalathar:new-executor, r=onur-ozkanbors-7/+11
compiletest: Use the new non-libtest executor by default The new executor was implemented in #139660, but required a manual opt-in. This PR activates the new executor by default, but leaves the old libtest-based executor in place (temporarily) to make reverting easier if something unexpectedly goes horribly wrong. Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency. The flag is mostly there to make manual comparative testing easier if something does go wrong. As before, there *should* be no user-visible difference between the old executor and the new executor. --- I didn't get much of a response to my [call for testing thread on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Call.20for.20testing.3A.20New.20test.20executor.20for.20compiletest/with/512452105), and the reports I did get (along with my own usage) indicate that there aren't any problems. So I think it's reasonable to move forward with making this the default, in the hopes of being able to remove the libtest dependency relatively soon. When the libtest dependency is removed, it should be reasonable to build compiletest against pre-built stage0 std by default, even after the stage0 redesign. (Though we should probably have at least one CI job using in-tree stage1 std instead, to guard against the possibility of the `#![feature(internal_output_capture)]` API actually changing.)
2025-04-23wasm, arm, x86-without-SSE need simd to be explicitly enabledRalf Jung-23/+33
2025-04-23Clippy: Fix doc issuePhilipp Krones-0/+1
2025-04-23Auto merge of #138591 - Kobzol:git-ci, r=Mark-Simulacrumbors-345/+877
Refactor git change detection in bootstrap While working on https://github.com/rust-lang/rust/pull/138395, I finally found the courage to delve into the insides of git path change detection in bootstrap, which is used (amongst other things) to detect if we should rebuilt od download `[llvm|rustc|gcc]`. I found it a bit hard to understand, and given that this code was historically quite fragile, I thought that it would be better to rebuild it from scratch. The previous approach had a bunch of limitations: - It separated the computation of "are there local changes?" and "what upstream SHA should we use?" even though these two things are intertwined. - It used hacks to work around what happens on CI. - It had special cases for CI scattered throughout the codebase, rather than centralized in one place. - It wasn't documented enough and didn't have tests for the git behavior. The current approach should hopefully resolve all of that. I implemented a single entrypoint called `check_path_modifications` (naming bikeshed pending, half of the time I spend on this PR was thinking about names, as it's quite tricky here..) that explicitly receives a mode of operation (in CI or outside CI), and accordingly figures out that upstream SHA that we should use for downloading artifacts and it also figures out if there are any local changes. Users of this function can then use this unified output to implement `download-ci-X` and other functionality. Notably, this change detection no longer uses `git merge-base`, which makes it easier to use and doesn't require setting up remotes. I also added a bunch of integration tests that literally spawn a git repository on disk and then check that the function can deal with various situations (PR CI, auto/try CI, local builds). After I built this inner layer, I used it for downloading GCC, LLVM and rustc. The latter two (and especially rustc) were using the `last_modified_commit` function before, but in all cases but one this function was actually only used to check if there are any local changes, which was IMO confusing. The LLVM handling would deserve a bit of refactoring, but that's a larger change that can be done as a follow-up. I hope that the implementation is now clear and easy to understand, so that in combination with the tests we can have more confidence that it does what we want. I tried to include a lot of documentation in the code, so I won't be repeating the actual implementation details here, if there are any questions, I'll add the answers to the documentation too :) The new approach explicitly supports three scenarios: - Running on PR CI, where we have one upstream bors parent commit and one PR merge commit made by GitHub. - Running on try/auto CI, where we have one upstream bors parent commit and one PR merge commit made by bors. - Running locally, where we assume that we have at least one upstream bors parent commit in our git history. I removed the handling of upstreams on CI, as I think that it shouldn't be needed and I considered it to be a hack. However, it's possible that there are other use-cases that I haven't considered, so I want to ask around if people have other situations than the three use-cases described above. If there are other such use-cases, I would like to include them in the new centralized implementation and add them to the git test suite, rather than going back to the old ways :) In particular, the code before relied on `git merge-base`, but I don't see why we can't just lookup the most recent bors commit and assume that is a merge commit that is also upstream? I might be running into Chesterton's Fence here :) CC `@pietroalbini` To make sure that this won't break downstream users of Rust's CI. Best reviewed commit by commit. Companion PRs: - For testing beta: https://github.com/rust-lang/rust/pull/138597 r? `@onur-ozkan` Fixes: https://github.com/rust-lang/rust/issues/101907 try-job: x86_64-gnu-aux try-job: aarch64-gnu try-job: dist-x86_64-apple
2025-04-23compiletest: Use the new non-libtest executor by defaultZalathar-7/+11
Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency.
2025-04-23Rollup merge of #140175 - Kivooeo:new-fix-one, r=compiler-errorsChris Denton-2/+41
`rc""` more clear error message here is small fix that provides better error message when user is trying to use `rc""` the same way it was made for `rb""` example of it's work ```rust | 2 | rc"\n"; | ^^ unknown prefix | = note: prefixed identifiers and literals are reserved since Rust 2021 help: use `cr` for a raw C-string | 2 - rc"\n"; 2 + cr"\n"; | ``` **related issue** fixes #140170 cc `@cyrgani` (issue author)
2025-04-23Rollup merge of #140173 - m-ou-se:triagebot-config, r=ChrisDentonChris Denton-0/+5
Ping Mara when touching format_args!() internals.
2025-04-23Rollup merge of #140163 - thaliaarchi:pathbuf-validate-extension, r=ChrisDentonChris Denton-7/+17
Validate extension in `PathBuf::add_extension` The extension is validated in `PathBuf::set_extension`, but not `add_extension`. Fix that. Check for both `/` and `\` path separators on Windows, even when the path is verbatim, since this is logically like `PathBuf::push` which normalizes separators (i.e., keeping the current behavior). `PathBuf::add_extension` is tracked in #127292. r? `@ChrisDenton`
2025-04-23Rollup merge of #140160 - oli-obk:lang-items, r=jieyouxuChris Denton-219/+193
Use `is_lang_item` and `as_lang_item` instead of handrolling their logic Various cleanups and deduplication. Most notably `if is_lang_item(foo, bar) {} else if is_lang_item...` chains are turned into matches. No behaviour changes intended beyond turning ICEs into fatal "lang item not found" errors
2025-04-23Rollup merge of #140147 - xizheyin:issue-138401-1, r=compiler-errorsChris Denton-50/+54
Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`. Clean code prepared for resolving #138401. To avoid having too many extraneous changes in one PR, I cleaned up some of the naming and method placement in lexer in this PR. 1. For the make_unclosed_delims_error function defined in mod.rs is only used in lexer, so moved into lexer, which enhances encapsulation. 2. For open_braces in TokenTreeDiagInfo the naming is not canonical, as Brace refers to `{...} ` and this variable can store all kinds of different Delimiters. so I named it open_delimiters. r? `@chenyukang`
2025-04-23Rollup merge of #140146 - tgross35:update-builtins, r=tgross35Chris Denton-4/+4
Update `compiler_builtins` to 0.1.156 Includes the following changes: * Provide `abort` on AVR [1] [1]: https://github.com/rust-lang/compiler-builtins/pull/830
2025-04-23Rollup merge of #140142 - nnethercote:some-graphviz-tweaks-2, r=compiler-errorsChris Denton-73/+59
Some more graphviz tweaks A follow-up to #132346. r? `@davidtwco`
2025-04-23rc and cr more clear error messageKivooeo-2/+41
2025-04-22Auto merge of #140165 - ChrisDenton:rollup-on2dpr5, r=ChrisDentonbors-83/+324
Rollup of 8 pull requests Successful merges: - #139617 (Use posix_spawn on cygwin) - #139921 (improve diagnostic for raw pointer field access with ->) - #140031 (compiletest: Fix deadline bugs in new executor) - #140072 (handle function alignment in miri) - #140104 (Fix auto diff failing on inherent impl blocks) - #140124 (Update books) - #140144 (Handle another negated literal in `eat_token_lit`.) - #140149 (test_nan: ensure the NAN contant is quiet) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-22Ping Mara when touching format_args!() internals.Mara Bos-0/+5
2025-04-22Consider Copy/Clone tooMichael Goulet-1/+18
2025-04-22Don't compute query unless in new solverMichael Goulet-1/+5
2025-04-22Eagerly instantiate coroutine witness in new solverMichael Goulet-23/+31
2025-04-22Properly drain pending obligations for coroutinesMichael Goulet-63/+241
2025-04-22Collect and resolve ambiguous obligations from normalizing in writebackMichael Goulet-10/+84
2025-04-22tidy: Remove rinja deps from proc_macro_depsPhilipp Krones-4/+0
2025-04-22Update Cargo.lockPhilipp Krones-63/+22
2025-04-22Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into ↵Philipp Krones-6980/+13717
clippy-subtree-update
2025-04-22Rollup merge of #140149 - RalfJung:test_nan, r=tgross35Chris Denton-0/+20
test_nan: ensure the NAN contant is quiet Follow-up to https://github.com/rust-lang/rust/pull/139483 r? ``@tgross35``
2025-04-22Rollup merge of #140144 - nnethercote:fix-140098, r=petrochenkovChris Denton-23/+42
Handle another negated literal in `eat_token_lit`. Extends the change from #139653, which was on expressions, to literals. Fixes #140098. r? ``@petrochenkov``
2025-04-22Rollup merge of #140124 - rustbot:docs-update, r=ehussChris Denton-0/+0
Update books ## rust-lang/nomicon 1 commits in 0c10c30cc54736c5c194ce98c50e2de84eeb6e79..c76a20f0d987145dcedf05c5c073ce8d91f2e82a 2025-04-15 20:54:57 UTC to 2025-04-15 20:54:57 UTC - Say that dereferencing a pointer to a ZST is no longer undefined (rust-lang/nomicon#467) ## rust-lang/reference 7 commits in 3340922df189bddcbaad17dc3927d51a76bcd5ed..3bf3402aea982b876eb56c87da17b0685c6461d5 2025-04-18 13:44:45 UTC to 2025-04-17 17:27:01 UTC - Use `cfg(false)` instead of `cfg(FALSE)` (rust-lang/reference#1763) - Add `cfg(true)` and `cfg(false)` to conditional compilation (RFC 3695) (rust-lang/reference#1762) - Refactor rendering with `RenderCtx` (rust-lang/reference#1796) - attributes/codegen: update aarch64 features (rust-lang/reference#1791) - Simplify GenericParams grammar (rust-lang/reference#1795) - Add rule identifiers for the ABI chapter (rust-lang/reference#1793) - Remove broken footnote links from grammar summary (rust-lang/reference#1794)
2025-04-22Rollup merge of #140104 - ↵Chris Denton-8/+71
Shourya742:2025-04-21-auto-diff-fails-on-impl-block, r=ZuseZ4 Fix auto diff failing on inherent impl blocks closes: #139557 r? ``@ZuseZ4``
2025-04-22Rollup merge of #140072 - folkertdev:miri-fn-align, r=RalfJungChris Denton-2/+36
handle function alignment in miri tracking issue: https://github.com/rust-lang/rust/issues/82232 Fixes https://github.com/rust-lang/miri/issues/4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
2025-04-22Rollup merge of #140031 - Zalathar:deadline, r=jieyouxuChris Denton-21/+47
compiletest: Fix deadline bugs in new executor The experimental new executor for compiletest (#139660) was found to have two major bugs in deadline handling for detecting slow tests: - The comparison between `now` and test deadlines was reversed, causing no timeouts to ever be recognised. - After fixing that bug, it was found that the existing code would issue timeouts for any test that had started more than 60 seconds ago, even if the test had finished long before its deadline was reached. This PR fixes those bugs. (The new executor is not yet enabled by default, so this PR has no immediate effect on contributors.) --- I noted in https://github.com/rust-lang/rust/pull/139998#issuecomment-2815127046 that I hoped to have some unit tests to accompany these fixes. Unfortunately that turned out to be infeasible, because `DeadlineQueue` is tightly coupled to concrete `mpsc::Receiver` APIs (in addition to `Instant::now`), and trying to mock all of those would make the code much more complicated. I did, however, add a few assertions that would have caught the failure to remove tests from the queue after their deadline. r? jieyouxu
2025-04-22Rollup merge of #139921 - Kivooeo:master, r=WaffleLapkinChris Denton-27/+102
improve diagnostic for raw pointer field access with -> This PR enhances the error messages emitted by the Rust compiler when users attempt to use the `->` operator for field access on raw pointers or when dereferencing is needed. The changes aim to provide clearer guidance, by suggesting the correct use of the `.` operator and explicit dereferencing. **Before:** ``` help: `xs` is a raw pointer; try dereferencing it | LL | (*xs)->count += 1; | ++ + ``` **Now:** ``` help: use `.` on a dereferenced raw pointer instead | LL - xs->count += 1; LL + (*xs).count += 1; | ``` I added extra clarification in the message. Since this error occurs in the parser, we can't be certain that the type is a raw pointer. That's why the message includes only a small note in brackets. (In contrast, the message above is emitted in HIR, where we *can* check whether it's a raw pointer.) **Before:** ``` --> main.rs:11:11 | 11 | xs->count += 1; | ^^ | = help: the . operator will dereference the value if needed ``` **After:** ``` --> main.rs:11:11 | 11 | xs->count += 1; | ^^ | = help: the `.` operator will automatically dereference the value, except if the value is a raw pointer ```
2025-04-22Rollup merge of #139617 - Berrysoft:cygwin-posix-spawn, r=joboetChris Denton-2/+6
Use posix_spawn on cygwin r? ``@joboet`` Depends on: - [x] https://github.com/rust-lang/libc/pull/4387 - [x] https://github.com/rust-lang/rust/pull/140081
2025-04-22Rustup (#14667)Philipp Krones-18/+18
Out of cycle sync, as the sync to Rust failed again and resolving conflicts there is awkward. r? @ghost changelog: none
2025-04-22Bump nightly version -> 2025-04-22Philipp Krones-2/+2
2025-04-22Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-6992/+13764
2025-04-22Consider side effects when rewriting iterator behaviors (#14490)Jason Newcomb-97/+292
Closes #9191 Closes #14444 Closes #8055 Adds a new helper to partly check for side effects by recursively checking if the iterator type contains closures with mutable captures. changelog: [`double_ended_iterator_last`] fix FP when iter has side effects changelog: [`needless_collect`] fix lint not consider side effects
2025-04-22Expand mutable capture check for `is_iter_with_side_effects()`yanglsh-127/+201
2025-04-22Validate extension in `PathBuf::add_extension`Thalia Archibald-7/+17
The extension is validated in `PathBuf::set_extension`, but not `add_extension`. Fix that. Check for both / and \ path separators on Windows, even when the path is verbatim, since this is logically like `PathBuf::push` which normalizes separators (i.e., keeping the current behavior).
2025-04-22compiletest: Fix deadline bugs in new executorZalathar-21/+47
2025-04-22Auto merge of #139960 - amandasystems:placeholder-ui-tests, r=lcnrbors-0/+110
Add tests for two untested cases of placeholder relations During work on #130227, I discovered several situations not covered by any previously existing UI test. This commit introudces tests to cover that. r? lcnr
2025-04-22Use `is_lang_item` and `as_lang_item` instead of handrolling their logicOli Scherer-219/+193