about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-12Merge pull request #19980 from Veykril/push-qsuttvtvtytrLukas Wirth-38/+39
`ItemTree`'s `ItemVisibilities` has no identity, so deduplicate
2025-06-12`ItemTree`'s `ItemVisibilities` has no identity, so deduplicateLukas Wirth-38/+39
2025-06-12Merge pull request #19837 from ChayimFriedman2/stable-astidLukas Wirth-1945/+2256
Provide better incrementality when items are changed
2025-06-12LRU ast id mapChayim Refael Friedman-0/+1
We can do that and it's pretty heavy.
2025-06-12Ignore ast id hashes in typos checkChayim Refael Friedman-0/+1
2025-06-12Remove most of the item treeChayim Refael Friedman-443/+52
I'm joking, but now that the def map is the only thing that uses the item tree, we can remove a lot of things from it that aren't needed for the def map.
2025-06-12Avoid referring to the item tree except in the def mapChayim Refael Friedman-955/+981
Item tree IDs are very unstable (adding an item of a kind invalidates all following items of the same kind). Instead use ast ids, which, since the previous commit, are pretty stable.
2025-06-12Use stable AST IDsChayim Refael Friedman-556/+1230
Instead of simple numbering, we hash important bits, like the name of the item. This will allow for much better incrementality, e.g. when you add an item. Currently, this invalidates the IDs of all following items, which invalidates pretty much everything.
2025-06-12Merge pull request #19942 from ChayimFriedman2/fauxLukas Wirth-28/+26
fix: Fix completion with some attribute macros
2025-06-12Merge pull request #19979 from ↵Chayim Refael Friedman-15/+15
rust-lang/dependabot/npm_and_yarn/editors/code/brace-expansion-1.1.12 chore(deps-dev): bump brace-expansion from 1.1.11 to 1.1.12 in /editors/code
2025-06-11chore(deps-dev): bump brace-expansion in /editors/codedependabot[bot]-15/+15
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.12 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11Merge pull request #19975 from ↵Chayim Refael Friedman-1/+87
davidbarsky/davidbarsky/test-trait-solve-invalidation hir-ty: test incremental trait solving
2025-06-11hir-ty: test (the absence of) incremental trait solvingDavid Barsky-1/+87
2025-06-11Merge pull request #19973 from Veykril/push-ppltxvqvqmkkLukas Wirth-3/+9
fix: Hide dyn inlay hints for incomplete `impl`s
2025-06-11fix: Hide dyn inlay hints for incomplete `impl`sLukas Wirth-3/+9
2025-06-11Merge pull request #19970 from ChayimFriedman2/proc-macro-srv-minusLukas Wirth-31/+26
fix: Fix proc macro server handling of strings with minuses
2025-06-11Fix proc macro server handling of strings with minusesChayim Refael Friedman-31/+26
It used to decompose them thinking they were numbers.
2025-06-10Merge pull request #19964 from Wilfred/fix_typosChayim Refael Friedman-2/+2
[minor] Fix typos
2025-06-10[minor] Fix typosWilfred Hughes-2/+2
2025-06-10Merge pull request #19963 from ChayimFriedman2/unsized-impl-itemsLukas Wirth-3/+64
fix: Do not error at impls for unsized types that do not include `where Self: Sized` items
2025-06-10Do not error at impls for unsized types that do not include `where Self: ↵Chayim Refael Friedman-3/+64
Sized` items
2025-06-09Merge pull request #19930 from regexident/dyn-semantics-take-twoDavid Barsky-2/+18
Make `Semantics<'db, DB>` support `Semantics<'db, dyn HirDatabase>`, take two
2025-06-09Merge pull request #19954 from lnicola/sync-from-rustLaurențiu Nicola-37427/+107501
minor: Sync from downstream
2025-06-09Merge from rust-lang/rustLaurențiu Nicola-37426/+107500
2025-06-09Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-06-09Auto merge of #142234 - matthiaskrgr:rollup-kg5wibu, r=matthiaskrgrbors-45/+152
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141751 (Remap compiler vs non-compiler sources differently (bootstrap side)) - rust-lang/rust#142160 (Only allow `bootstrap` cfg in rustc & related) - rust-lang/rust#142191 (early return in trait detection for non-trait item) - rust-lang/rust#142211 (Do not checkout GCC submodule for the tidy job) - rust-lang/rust#142218 (CI: rfl: move job forward to Linux v6.16-rc1) - rust-lang/rust#142224 (Avoid a gratuitous 10s wait in a stress test) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-09Rollup merge of #142224 - ↵Matthias Krüger-6/+16
joshtriplett:remove-gratuitous-wait-in-stress-test, r=workingjubilee Avoid a gratuitous 10s wait in a stress test `stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred. The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second. Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s. Add a check that at least one timeout occurred.
2025-06-09Rollup merge of #142218 - ojeda:rfl, r=KobzolMatthias Krüger-2/+1
CI: rfl: move job forward to Linux v6.16-rc1 Another hopefully routine upgrade to Linux v6.16-rc1, just released. r? `@lqd` `@Kobzol` try-job: x86_64-rust-for-linux `@rustbot` label A-rust-for-linux `@bors` try
2025-06-09Rollup merge of #142211 - Kobzol:try-fast-submodule-checkout, r=Mark-SimulacrumMatthias Krüger-0/+8
Do not checkout GCC submodule for the tidy job This is not a fully general solution, but the GCC submodule checkout is so slow that I think it's worth it to special-case it. This brings down the time required to checkout submodules from ~1.5 minute to ~0.5 minute.
2025-06-09Rollup merge of #142191 - bvanjoi:issue-135863, r=compiler-errorsMatthias Krüger-18/+43
early return in trait detection for non-trait item Fixes rust-lang/rust#135863
2025-06-09Rollup merge of #142160 - Urgau:check-cfg-bootstrap-only-rustc, r=KobzolMatthias Krüger-9/+14
Only allow `bootstrap` cfg in rustc & related Fixes https://github.com/rust-lang/rust/issues/142150 r? bootstrap
2025-06-09Rollup merge of #141751 - jieyouxu:remap, r=KobzolMatthias Krüger-10/+70
Remap compiler vs non-compiler sources differently (bootstrap side) See [#t-compiler/help > Span pointing to wrong file location (&#96;rustc-dev&#96; component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083). The path remapping and unremapping for compiler sources (distributed via `rustc-dev` dist component) is broken because bootstrap currently remaps all sources unconditionally (if remapping is enabled) to the `/rustc/{hash}` form. However, the `rustc-dev` dist component (compiler sources) and `rust-src` dist component (library sources) unpacks differently: - `rust-src` unpacks sources to a path like `$sysroot/lib/rustlib/src/rust`, whereas - `rustc-dev` unpacks sources to a path like `$sysroot/lib/rustlib/rustc-src/rust`[^note], meaning that the compiler need to unremap them differently. But the same remapping means that the compiler has no way to distinguish between compiler and non-compiler (esp. standard library) sources. To remedy this, this PR adopts the approach of: - remapping compiler sources (corresponding to `rustc-dev` dist component) with `/rustc-dev/{hash}` (this is `RemapScheme::Compiler`), and - remapping non-compiler sources (corresponding to `rust-src` dist component or other non-compiler sources) with `/rustc/{hash}` (this is `RemapScheme::NonCompiler`). A different remapping allows the compiler to reverse the remapping differently. This PR implements the bootstrap side. A follow-up compiler-side change is needed to implement the unremapping change to address the reported issue completely. This PR introduces another env var `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` that is made available to the compiler when building compiler sources to know what the remap scheme for `rustc-dev` (`RemapScheme::Compiler`) is. Compiler sources are built with the compiler remapping scheme. As far as I know, this change should not introduce new regressions, because the compiler source unremapping (through `rustc-dev`) is already broken. [^note]: (Notice the `src` vs `rustc-src` difference.)
2025-06-09Do not checkout GCC submodule for the tidy jobJakub Beránek-0/+8
2025-06-09Auto merge of #141435 - RalfJung:unsupported_calling_conventions, ↵bors-358/+1510
r=workingjubilee Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions This adds back the `unsupported_calling_conventions` lint that was removed in https://github.com/rust-lang/rust/pull/129935, in order to start the process of dealing with https://github.com/rust-lang/rust/issues/137018. Specifically, we are going for the plan laid out [here](https://github.com/rust-lang/rust/issues/137018#issuecomment-2672118326): - thiscall, stdcall, fastcall, cdecl should only be accepted on x86-32 - vectorcall should only be accepted on x86-32 and x86-64 The difference to the status quo is that: - We stop accepting stdcall, fastcall on targets that are windows && non-x86-32 (we already don't accept these on targets that are non-windows && non-x86-32) - We stop accepting cdecl on targets that are non-x86-32 - (There is no difference for thiscall, this was already a hard error on non-x86-32) - We stop accepting vectorcall on targets that are windows && non-x86-* Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the `unsupported_calling_conventions` forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred. try-job: i686-msvc-1 try-job: x86_64-msvc-1 try-job: test-various
2025-06-08Avoid a gratuitous 10s wait in a stress testJosh Triplett-6/+16
`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred. The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite. Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s. Add a check that at least one timeout occurred.
2025-06-09Auto merge of #142220 - workingjubilee:rollup-idgfpof, r=workingjubileebors-773/+629
Rollup of 12 pull requests Successful merges: - rust-lang/rust#141803 (Remove rustc's notion of "preferred" alignment AKA `__alignof`) - rust-lang/rust#142053 (Add new Tier-3 targets: `loongarch32-unknown-none*`) - rust-lang/rust#142089 (Replace all uses of sysroot_candidates with get_or_default_sysroot) - rust-lang/rust#142108 (compiler: Add track_caller to AbiMapping::unwrap) - rust-lang/rust#142132 (`tests/ui`: A New Order [6/N]) - rust-lang/rust#142162 (UnsafePinned: update get() docs and signature to allow shared mutation) - rust-lang/rust#142171 (`tests/ui`: A New Order [7/N]) - rust-lang/rust#142179 (store `target.min_global_align` as an `Align`) - rust-lang/rust#142183 (Added test for 30904) - rust-lang/rust#142194 (Remove all unused feature gates from the compiler) - rust-lang/rust#142199 (Do not free disk space in the `mingw-check-tidy` job) - rust-lang/rust#142210 (Run `mingw-check-tidy` on auto builds) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-08Rollup merge of #142210 - Kobzol:tidy-auto-builds, r=Mark-SimulacrumJubilee-0/+4
Run `mingw-check-tidy` on auto builds This has two advantages: - It moves `auto` builds closer to being a superset of PR CI builds - It allows us to reuse the Docker cache for the job in PR CI, thus speeding up the job in PR CI considerably Discussed [here](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/PR.20ci.20seems.20much.20to.20slow). r? ``@Mark-Simulacrum``
2025-06-08Rollup merge of #142199 - Kobzol:tidy-speed-up, r=Mark-SimulacrumJubilee-0/+1
Do not free disk space in the `mingw-check-tidy` job It's not needed an it slows down the job considerably. It took ~2 minutes out of the total 8-9 minutes of running `mingw-check-tidy`.
2025-06-08Rollup merge of #142194 - bjorn3:less_unstable_features, r=jieyouxuJubilee-28/+1
Remove all unused feature gates from the compiler
2025-06-08Rollup merge of #142183 - Kivooeo:30904-test, r=compiler-errorsJubilee-0/+53
Added test for 30904 Test that was deleted by mistake in this commit https://github.com/rust-lang/rust/commit/564c78a6981174b32079f576eb6e7f965a13945e#diff-85d65712084246fc61f287664eef63b0b25ba0a5c8b69a4a59a9454b6a3ebac4 The original issue is still open and the problem is not solved (if this is even a problem, but the error is still here at least)
2025-06-08Rollup merge of #142179 - folkertdev:min-global-align-parse, r=workingjubileeJubilee-63/+37
store `target.min_global_align` as an `Align` Parse the alignment properly when the target is defined/parsed, and error out on invalid alignment values. That means this work doesn't need to happen for every global in each backend.
2025-06-08Rollup merge of #142171 - Kivooeo:tf7, r=workingjubileeJubilee-19/+18
`tests/ui`: A New Order [7/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-08Rollup merge of #142162 - RalfJung:unsafe-pinned-get, ↵Jubilee-17/+16
r=workingjubilee,traviscross UnsafePinned: update get() docs and signature to allow shared mutation Follow-up to https://github.com/rust-lang/rust/pull/140638, making `get` consistent with the fact that there's an `UnsafeCell` inside this type now by returning `*mut T` instead of `*const T`. Cc ``@rust-lang/libs-api`` Tracking issue: https://github.com/rust-lang/rust/issues/125735
2025-06-08Rollup merge of #142132 - Kivooeo:tf6, r=workingjubileeJubilee-79/+45
`tests/ui`: A New Order [6/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `````@jieyouxu````` auxiliary tag means some changes in realted auxiliary file for test
2025-06-08Rollup merge of #142108 - workingjubilee:track-caller-in-abi-map, r=jieyouxuJubilee-0/+1
compiler: Add track_caller to AbiMapping::unwrap Same reason as it is on Option's.
2025-06-08Rollup merge of #142089 - bjorn3:sysroot_handling_cleanup3, r=petrochenkovJubilee-69/+33
Replace all uses of sysroot_candidates with get_or_default_sysroot Before this change we had two different ways to attempt to locate the sysroot which are inconsistently used: * `get_or_default_sysroot` which tries to locate based on the 0th cli argument and if that doesn't work falls back to locating it using the librustc_driver.so location and returns a single path., * `sysroot_candidates` which takes the former and additionally does another attempt at locating using `librustc_driver.so` except without linux multiarch handling and then returns both paths., The latter was originally introduced to be able to locate the codegen backend back when cg_llvm was dynamically linked even for a custom driver when the `--sysroot` passed in does not contain a copy of cg_llvm. Back then `get_or_default_sysroot` did not attempt to locate the sysroot based on the location of librustc_driver.so yet. Because that is now done, the only case where removing `sysroot_candidates` can break things is if you have a custom driver inside what looks like a sysroot including the `lib/rustlib` directory, but which is missing some parts of the full sysroot like eg rust-lld. Follow up to https://github.com/rust-lang/rust/pull/138404
2025-06-08Rollup merge of #142053 - heiher:loong32-none, r=wesleywiserJubilee-53/+181
Add new Tier-3 targets: `loongarch32-unknown-none*` MCP: https://github.com/rust-lang/compiler-team/issues/865 NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
2025-06-08Rollup merge of #141803 - workingjubilee:remove-pref-align, r=bjorn3Jubilee-445/+239
Remove rustc's notion of "preferred" alignment AKA `__alignof` In PR rust-lang/rust#90877 T-lang decided not to remove `intrinsics::pref_align_of`. However, the intrinsic and its supporting code 1. is a nightly feature, so can be removed at compiler/libs discretion 2. requires considerable effort in the compiler to support, as it necessarily complicates every single site reasoning about alignment 3. has been justified based on relevance to codegen, but it is only a requirement for C++ (not C, not Rust) stack frame layout for AIX[^1], in ways Rust would not consider even with increased C++ interop 4. is only used by rustc to overalign some globals, not correctness[^2] 5. can be adequately replaced by other rules for globals, as it mostly affects alignments for a few types under 16 bytes of alignment 6. has only one clear beneficiary: automating C -> Rust translation for GNU extensions like `__alignof`[^3] 7. such code was likely intended to be `alignof` or `_Alignof`, because the GNU extension is a "false friend" of the C keyword, which makes the choice to support such a mapping very questionable 8. makes it easy to do incorrect codegen in the compiler by its mere presence as usual Rust rules of alignment (e.g. `size == align * N`) do not hold with preferred alignment[^4] Despite an automated translation tool like c2rust using it, we have made multiple attempts to find a crate that actually has been committed to public repositories, like GitHub or crates.io, using such translated code. We have found none. While it is possible someone privately uses this intrinsic, it seems unlikely, and it is behind a feature gate that will warn about using the internal features of rustc. The implementation is clearly damaging the code quality of the compiler. Thus it is within the compiler team's purview to simply rip it out. If T-lang wishes to have this intrinsic restored for c2rust's benefit, it would have to use a radically different implementation that somehow does not cause internal incorrectness. Until then, remove the intrinsic and its supporting code, as one tool and an ill-considered GCC extension cannot justify risking correctness. Because we touch a fair amount of the compiler to change this at all, and unfortunately the duplication of AbiAndPrefAlign is deep-rooted, we keep an "AbiAlign" type which we can wean code off later. [^1]: https://github.com/rust-lang/rust/issues/91971#issuecomment-2451330704 [^2]: as viewable in the code altered by this PR [^3]: c2rust: https://github.com/immunant/c2rust/blame/3b1ec86b9b0cf363adfd3178cc45a891a970eef2/c2rust-transpile/src/translator/mod.rs#L3175 [^4]: https://github.com/rust-lang/rustc_codegen_cranelift/issues/1560
2025-06-08compiler: add Deref to AbiAlign to ease transitionJubilee Young-1/+9
We will want to remove many cases of `.abi`, including `.abi.thing`, so this may simplify future PRs and certainly doesn't hurt. We omit DerefMut because mutation is much rarer and localized.
2025-06-08Remove rustc's notion of "preferred" alignment AKA `__alignof`Jubilee Young-444/+230
In PR 90877 T-lang decided not to remove `intrinsics::pref_align_of`. However, the intrinsic and its supporting code 1. is a nightly feature, so can be removed at compiler/libs discretion 2. requires considerable effort in the compiler to support, as it necessarily complicates every single site reasoning about alignment 3. has been justified based on relevance to codegen, but it is only a requirement for C++ (not C, not Rust) stack frame layout for AIX, in ways Rust would not consider even with increased C++ interop 4. is only used by rustc to overalign some globals, not correctness 5. can be adequately replaced by other rules for globals, as it mostly affects alignments for a few types under 16 bytes of alignment 6. has only one clear benefactor: automating C -> Rust translation for GNU extensions like `__alignof` 7. such code was likely intended to be `alignof` or `_Alignof`, because the GNU extension is a "false friend" of the C keyword, which makes the choice to support such a mapping very questionable 8. makes it easy to do incorrect codegen in the compiler by its mere presence as usual Rust rules of alignment (e.g. `size == align * N`) do not hold with preferred alignment The implementation is clearly damaging the code quality of the compiler. Thus it is within the compiler team's purview to simply rip it out. If T-lang wishes to have this intrinsic restored for c2rust's benefit, it would have to use a radically different implementation that somehow does not cause internal incorrectness. Until then, remove the intrinsic and its supporting code, as one tool and an ill-considered GCC extension cannot justify risking correctness. Because we touch a fair amount of the compiler to change this at all, and unfortunately the duplication of AbiAndPrefAlign is deep-rooted, we keep an "AbiAlign" type which we can wean code off later.