about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-04-24CI: print message when skipping PRRalf Jung-1/+1
2025-04-24Merge from rustcRalf Jung-7337/+14610
2025-04-24Preparing for merge from rustcRalf Jung-1/+1
2025-04-24Merge pull request #19675 from Veykril/push-uuluymsosttrLukas Wirth-12/+29
fix: Fix type argument mismatch incorrectly triggering on inferred trait args
2025-04-24Arena allocate `LifetimeRef`sLukas Wirth-60/+126
2025-04-24Shrink `WherePredicate` by 8 bytesLukas Wirth-2/+3
2025-04-24Correctly set `infer_args = true` in more placesChayim Refael Friedman-8/+10
Previously this being incorrect wasn't a problem, it just meant we put an error type that then changed to infer type, so exactly what rustc does at the end. But now there is a diagnostic.
2025-04-24fix: Fix type argument mismatch incorrectly triggering on inferred trait argsLukas Wirth-4/+19
2025-04-24refactor: Remove `WherePredicateTypeTarget`Lukas Wirth-311/+302
2025-04-24Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etcbendn-67/+87
2025-04-24Rollup merge of #140232 - nnethercote:rm-unnecessary-clones, r=SparrowLiiMatthias Krüger-3/+3
Remove unnecessary clones r? `@SparrowLii`
2025-04-24Rollup merge of #140028 - dianne:lit-deref-pats-p1, r=oli-obkMatthias Krüger-0/+21
`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns When `deref_patterns` is enabled, this allows string literal patterns to be used where `str` is expected and byte string literal patterns to be used where `[u8]` or `[u8; N]` is expected. This lets them be used in explicit `deref!("...")` patterns to match on `String`, `Box<str>`, `Vec<u8>`, `Box<[u8;N]>`, etc. (as well as to match on slices and arrays obtained through other means). Implementation-wise, this follows up on #138992: similar to how byte string literals matching on `&[u8]` is implemented, this changes the type of the patterns as determined by HIR typeck, which informs const-to-pat on how to translate them to THIR (though strings needed a bit of extra work since we need references to call `<str as PartialEq>::eq` in the MIR lowering for string equality tests). This PR does not add support for implicit deref pattern syntax (e.g. `"..."` matching on `String`, as `string_deref_patterns` allows). I have that implemented locally, but I'm saving it for a follow-up PR[^1]. This also does not add support for using named or associated constants of type `&str` where `str` is expected (nor likewise with named byte string constants). It'd be possible to add that if there's an appetite for it, but I figure it's simplest to start with literals. This is gated by the `deref_patterns` feature since it's motivated by deref patterns. That said, its impact reaches outside of deref patterns; it may warrant a separate experiment and feature gate, particularly factoring in the follow-up[^1]. Even without deref patterns, I think there's probably motivation for these changes. The update to the unstable book added by this will conflict with #140022, so they shouldn't be merged at the same time. Tracking issue for deref patterns: #87121 r? ``@oli-obk`` cc ``@Nadrieril`` [^1]: The piece missing from this PR to support implicit deref pattern syntax is to allow string literal patterns to implicitly dereference their scrutinees before matching (see #44849). As a consequence, it also makes examples like the one in that issue work (though it's still gated by `deref_patterns`). I can provide more information on how I've implemented it or open a draft if it'd help in reviewing this PR.
2025-04-24Rollup merge of #134446 - tgross35:stabilize-cell_update, r=jhprattMatthias Krüger-1/+0
Stabilize the `cell_update` feature Included API: ```rust impl<T: Copy> Cell<T> { pub fn update(&self, f: impl FnOnce(T) -> T); } ``` FCP completed once at https://github.com/rust-lang/rust/issues/50186#issuecomment-2198783432 but the signature has since changed. Closes: https://github.com/rust-lang/rust/issues/50186
2025-04-24Properly handle lifetimes when checking generic arguments lenChayim Refael Friedman-226/+858
And also, prepare for correct lowering of lifetime. We still don't handle most lifetimes correctly, but a bit more of the foundation to lifetime elision is now implemented.
2025-04-24Merge from rustcThe rustc-dev-guide Cronjob Bot-7422/+14759
2025-04-24Preparing for merge from rustcThe rustc-dev-guide Cronjob Bot-1/+1
2025-04-24Separate `Analysis` and `Results`.Nicholas Nethercote-2/+1
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate thing about this is that the analysis needs to be mutable everywhere (`&mut Analysis`) which forces the `Results` to be mutable everywhere, even though `EntryStates` is immutable everywhere. To fix this, this commit renames `Results` as `AnalysisAndResults`, renames `EntryStates` as `Results`, and separates the analysis and results as much as possible. (`AnalysisAndResults` doesn't get much use, it's mostly there to facilitate method chaining of `iterate_to_fixpoint`.) `Results` is immutable everywhere, which: - is a bit clearer on how the data is used, - avoids an unnecessary clone of entry states in `locals_live_across_suspend_points`, and - moves the results outside the `RefCell` in Formatter. The commit also reformulates `ResultsHandle` as the generic `CowMut`, which is simpler than `ResultsHandle` because it doesn't need the `'tcx` lifetime and the trait bounds. It also which sits nicely alongside the new use of `Cow` in `ResultsCursor`.
2025-04-24Revert compiletest new-executor, to re-land without download-rustcZalathar-11/+7
Revert <https://github.com/rust-lang/rust/pull/139998> because the original merge triggered download-rustc, which messes with test metrics and prevents us from properly comparing them before/after the change. The plan is to re-land this PR as-is, combined with a trivial compiler change to avoid download-rustc and get proper test metrics for comparison. This reverts commit be181dd75c83d72fcc95538e235768bc367b76b9, reversing changes made to 645d0ad2a4f145ae576e442ec5c73c0f8eed829b.
2025-04-24Remove some unnecessary clones.Nicholas Nethercote-3/+3
I found these by grepping for `&[a-z_\.]*\.clone()`, i.e. expressions like `&a.b.clone()`, which are sometimes unnecessary clones, and also looking at clones nearby to cases like that.
2025-04-23Update wasm-component-ld to 0.5.13Alex Crichton-1/+1
This commit updates the vendored `wasm-component-ld` binary to 0.5.13 which includes some various bug fixes and new feature updates for upcoming component model features coming down the pike. Not expected to break any existing workflows, just a normal update.
2025-04-23Fix detection of `main` function if there are expressions around itGuillaume Gomez-4/+17
2025-04-23Unify sidebar buttons to use the same imageGuillaume Gomez-21/+22
2025-04-23Update browser-ui-test version to 0.20.6Guillaume Gomez-1/+1
2025-04-23Auto merge of #139983 - flip1995:clippy-subtree-update, r=Manishearthbors-6984/+13718
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-23fix: Fix incorrect diagnostic for lifetime parameter count mismatchLukas Wirth-15/+21
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-23CI: use aws codebuild for job dist-arm-linuxMarcoIeni-13/+78
2025-04-23Mark `incorrect_generics_len` diagnostic as experimentalLukas Wirth-0/+1
2025-04-23rustc-dev-guide: document that `//@ add-core-stubs` imply ↵Jieyou Xu-7/+19
`-Cforce-unwind-tables=yes`
2025-04-23compiletest: `//@ add-core-stubs` implies `-Cforce-unwind-tables=yes`Jieyou Xu-2/+6
To preserve CFI directives in assembly tests.
2025-04-23Download GCC from CI on test buildersJakub Beránek-0/+3
2025-04-23Clippy: Fix doc issuePhilipp Krones-0/+1
2025-04-23Remove `git_repository` from the `stage0` fileJakub Beránek-1/+0
2025-04-23Remove `git_repository` field from `GitConfig`Jakub Beránek-15/+0
It is no longer needed after a recent refactoring.
2025-04-23Make algebraic intrinsics into 'const fn' items; Make algebraic functions of ↵Gabriel Bjørnager Jensen-26/+0
'f16', 'f32', 'f64', and 'f128' into 'const fn' items;
2025-04-23Merge from rustcThe Miri Cronjob Bot-21/+68
2025-04-23Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-23Auto merge of #138591 - Kobzol:git-ci, r=Mark-Simulacrumbors-342/+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-23Update doc of cygwin targetBerrysoft-2/+3
2025-04-22[compiletest] Parallelize test discoveryTyler Mandry-38/+60
Certain filesystems for large monorepos are slow to service individual read requests, but can service many in parallel. This change brings down the time to run a single cached test on one of those filesystems from 40s to about 8s.
2025-04-22update unstable book to mention string/bytestring typingdianne-0/+21
2025-04-22Merge pull request #19647 from roife/fix-issue-19646Lukas Wirth-41/+31
fix: panics in inlay hints that produce empty text edits for closure return types
2025-04-22tidy: Remove rinja deps from proc_macro_depsPhilipp Krones-4/+0
2025-04-22Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into ↵Philipp Krones-15/+17
clippy-subtree-update
2025-04-22Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into ↵Philipp Krones-6980/+13717
clippy-subtree-update
2025-04-23fix: panics in inlay hints that produce empty text edits for closure return ↵roifewu-41/+31
types
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 #140072 - folkertdev:miri-fn-align, r=RalfJungChris Denton-0/+21
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-22Merge pull request #19657 from ChayimFriedman2/better-offset-ofLukas Wirth-3/+230
feat: Better support `offset_of!()`