Commit Graph

314111 Commits

Author SHA1 Message Date
Yotam Ofek e80997d02c Fix grammar in "Use of AI tools" section 2025-12-27 11:58:14 +02:00
Lukas Wirth 9ab53d6d9e Merge pull request #21340 from Shourya742/2025-12-26-better-bm-ergonomics
Refactor: Bidirectional messages
2025-12-27 08:59:21 +00:00
bit-aloo 720d9eecc7 remove crossbeam-channel from proc-macro-srv-cli 2025-12-27 10:40:42 +05:30
bit-aloo 38f1cccef2 make source_text take non mutable reference of self 2025-12-27 09:43:01 +05:30
bit-aloo 8ae38dc333 rename handler's to be context specific 2025-12-27 09:21:32 +05:30
bit-aloo 231690657e add bidirectional handle in proc-macro-srv-cli to interact with client and srv 2025-12-27 09:07:08 +05:30
bit-aloo 8aa859476c adapt source_text to new handler 2025-12-26 23:04:19 +05:30
bit-aloo 8f141eaab3 remove old subreq/resp constructs 2025-12-26 23:04:04 +05:30
bit-aloo abf22599e3 add bidirectionalHandler trait 2025-12-26 23:03:42 +05:30
Lukas Wirth 50ed4e91fc Merge pull request #21200 from ChayimFriedman2/fake-impls
perf: Do not really expand builtin derives, instead treat them specifically
2025-12-26 13:31:48 +00:00
Chayim Refael Friedman 02763ff0ec Test builtin derives expansions
Via a hack to disable their fast path.
2025-12-26 15:00:27 +02:00
Chayim Refael Friedman 04529b2e83 Allow IDE layer to "see" fake builtin derive impls
It sees them as regular impls; the details are abstracted. It's beautiful for the IDE layer, and less beautiful for `hir`, so this is a big change.

Some small differences still exist:

 - We show builtin derives impl (to the IDE layer) as if they have had no generic parameters. It is possible to show the parameters, but that means also having to handle fake impls in `TypeParam` etc., and the benefit is questionable.
 - Getting the fn *def* type of a method of a builtin derive impl is not supported, as there is no real `FunctionId`, therefore no `CallableDefId`. The trait method is returned instead. Note: getting the fn *ptr* type of the method is supported well.
 - Builtin derive impls and their methods do not fully support `HasSource`, because, well, they have no source (at least, not in the form of `ast::Impl` and `ast::Fn`). To support them, we use the derive's `TextRange` where possible, and the trait method's source when not.

 It's important to note that the def map still records the `MacroCallId`. I have doubts over this, as this means it's very easy to create the queries we don't want to create, but it does make things more convenient. In particular, a nicety of this setup is that even "Expand macro recursively" works (it creates the macro input/output query, but given that they will only be created when the user invokes the command, that does not seem to be a problem).
2025-12-26 15:00:08 +02:00
Lukas Wirth abefb5254a Merge pull request #20193 from ChayimFriedman2/setting-rename-conflict
feat: Provide a setting to disable showing rename conflicts
2025-12-26 09:08:49 +00:00
Lukas Wirth 9fcf441721 Merge pull request #21297 from osdyne/fix-lsp-configuration-request
fix: Fix LSP configuration request handling
2025-12-26 09:05:09 +00:00
Lukas Wirth 4665de582c Merge pull request #21330 from A4-Tacks/to-guarded-indent
Fix indent for convert_to_guarded_return
2025-12-26 09:02:22 +00:00
Lukas Wirth 856cc543a3 Merge pull request #21335 from ChayimFriedman2/tupled-closure
internal: Store closures with "tupled" inputs
2025-12-26 08:18:20 +00:00
Lukas Wirth 2986b2714e Merge pull request #21249 from Shourya742/2025-11-27-bidirectional-protocol
Add bidirectional messaging proc-macro-srv
2025-12-26 08:08:24 +00:00
Chayim Refael Friedman 9d0a93fdf3 Merge pull request #21337 from ChayimFriedman2/stabilize-type-mismatch-diag
feat: Stabilize type mismatch diagnostic 🎉
2025-12-26 08:01:56 +00:00
Chayim Refael Friedman 2f3a23c7e9 Stabilize type mismatch diagnostic 🎉 2025-12-26 09:35:55 +02:00
Chayim Refael Friedman ebb0d0b7bd Make builtin derives cheaper, by not really expanding them, instead store them unexpanded 2025-12-25 16:26:11 +02:00
Chayim Refael Friedman 2c7bd6d462 Store closures with "tupled" inputs
And remove it when needed, the opposite of what was previously, where we stored without a tuple and tupled for the solver (because it requires that).

Because this is what rustc does, and generally, the closer we follow rustc, the easier our lives become.

The weird name `signature_unclosure()` also comes from rustc.
2025-12-25 16:18:11 +02:00
Lukas Wirth 4b68b7ae35 Merge pull request #21334 from Veykril/veykril/push-ozmlxzxpvrun
Introduce cargo-machete ci step
2025-12-25 10:13:35 +00:00
Lukas Wirth 38ff5a7a5e Introduce cargo-machete ci step 2025-12-25 10:38:05 +01:00
Laurențiu Nicola a8ad2e2459 Merge pull request #21331 from rust-lang/rustc-pull
minor: Rustc pull update
2025-12-25 06:00:15 +00:00
The rustc-josh-sync Cronjob Bot a1ae5afd66 Merge ref 'e7d44143a12a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: e7d44143a1
Filtered ref: fe2cf3fa56a4ce08f56aee660fbe289c7d13dede
Upstream diff: https://github.com/rust-lang/rust/compare/f41f40408d719aa9ae0c6bfa17619d8f3f9e5b99...e7d44143a12a526488e4f0c0d7ea8e62a4fe9354

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-25 04:19:28 +00:00
The rustc-josh-sync Cronjob Bot faac1b517f Prepare for merging from rust-lang/rust
This updates the rust-version file to e7d44143a1.
2025-12-25 04:19:22 +00:00
bors e7d44143a1 Auto merge of #150351 - JonathanBrouwer:rollup-knpqs9d, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150141 (Misc cleanups from reading some borrowck code)
 - rust-lang/rust#150297 (Fix compile issue in Vita libstd)
 - rust-lang/rust#150341 (Fix some divergences with the cg_clif subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-24 16:30:07 +00:00
Jonathan Brouwer 990783f83e Rollup merge of #150341 - bjorn3:fix_cg_clif_divergence, r=bjorn3
Fix some divergences with the cg_clif subtree

For some reason git-subtree incorrectly synced those changes.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-12-24 16:37:11 +01:00
Jonathan Brouwer 8e84475e25 Rollup merge of #150297 - forkgull:notgull/vita, r=joboet
Fix compile issue in Vita libstd

Unfortunately it looks like the Vita libc does not support
the "utimensat" function, which is needed for setting file times.
To fix the build, this commit marks Vita as unsupported for the
function that sets the file times.
2025-12-24 16:37:11 +01:00
Jonathan Brouwer c772ca3a6a Rollup merge of #150141 - BoxyUwU:borrowck_cleanup_1, r=lcnr
Misc cleanups from reading some borrowck code

title

r? lcnr
2025-12-24 16:37:10 +01:00
bjorn3 a8c9cb5f77 Fix some divergences with the cg_clif subtree
For some reason git-subtree incorrectly synced those changes.
2025-12-24 15:16:59 +00:00
Boxy Uwu 0e0911b5d8 Misc cleanups 2025-12-24 15:06:06 +00:00
A4-Tacks 5c99ebf42c Fix indent for convert_to_guarded_return 2025-12-24 21:46:57 +08:00
bors 24ac030a79 Auto merge of #150343 - JonathanBrouwer:rollup-1mwkrdv, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150311 (Avoid using env::temp when linking a binary)
 - rust-lang/rust#150336 (Disable f16 on LoongArch for LLVM < 21)
 - rust-lang/rust#150338 (Include rustc version in ICE messages)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-24 13:21:20 +00:00
Jonathan Brouwer e84aea3db1 Rollup merge of #150338 - bjorn3:ice_message_version, r=lqd,hkBst
Include rustc version in ICE messages

Rather than only including them in the ICE file. Not every user includes the ICE file in their bug reports, nor do they always list the rustc version.
2025-12-24 14:19:23 +01:00
Jonathan Brouwer 2622cc2129 Rollup merge of #150336 - heiher:loong-no-f16-llvm20, r=lqd
Disable f16 on LoongArch for LLVM < 21

The `f16` type works on the LoongArch target starting from LLVM 21. However, the current minimum supported external LLVM version is 20, so `f16` must not be enabled on LoongArch for LLVM version < 21.
2025-12-24 14:19:23 +01:00
Jonathan Brouwer 77fe25a741 Rollup merge of #150311 - ChrisDenton:no-temp, r=Kivooeo
Avoid using env::temp when linking a binary

This keeps all build artefacts (even temporary ones) within the build directory.

Fixes rust-lang/rust#139963
2025-12-24 14:19:22 +01:00
bjorn3 13c6256efe Include rustc version in ICE messages
Rather than only including them in the ICE file. Not every user includes
the ICE file in their bug reports, nor do they always list the rustc
version.
2025-12-24 10:21:07 +00:00
bors c4aa646f15 Auto merge of #150334 - jhpratt:rollup-met2i6d, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150016 (stabilize `lazy_get`)
 - rust-lang/rust#150139 (Correct terminology in Clone)
 - rust-lang/rust#150238 (mir_build: Classify `TestableCase::Constant` into multiple sub-kinds)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-24 09:31:51 +00:00
WANG Rui 855281c887 Disable f16 on LoongArch for LLVM < 21
The `f16` type works on the LoongArch target starting from LLVM 21.
However, the current minimum supported external LLVM version is 20,
so `f16` must not be enabled on LoongArch for LLVM version < 21.
2025-12-24 16:10:38 +08:00
Jacob Pratt f9e3c618b8 Rollup merge of #150238 - Zalathar:pat-const-kind, r=Nadrieril
mir_build: Classify `TestableCase::Constant` into multiple sub-kinds

In match lowering, when choosing a test for a `TestableCase::Constant`, there is some ad-hoc logic for inspecting the pattern type and deciding what kind of test is suitable. There is also some very similar logic later, when partitioning cases into buckets based on the chosen test.

Instead of having that ad-hoc logic in multiple places, I think it's better to perform an up-front classification when lowering `thir::PatKind::Constant` to `TestableCase::Constant`, and then have the later steps simply match on an enum variant.

There should be no change to the resulting built MIR.

(I will note that the logic/invariants involved are a bit unclear, so there is a risk of accidental minor differences.)
2025-12-24 02:52:59 -05:00
Jacob Pratt ef4f2d640e Rollup merge of #150139 - GKFX:clone-docs, r=jhpratt
Correct terminology in Clone

I think the current wording around Clone here is confusing:

- "Rust does not allow you to reimplement `Copy`" - reimplement isn't a piece of Rust terminology, but as written it sounds like you can't write `impl Copy for X`, which you can.
- "you may reimplement `Clone`" - again reimplement isn't really a thing that you do to a trait, the distinction is between manually implementing and deriving.
- "you can automatically make anything `Copy` be `Clone` as well" - you don't have a choice about it, so it doesn't really make sense to say you "can ... make" this happen.
2025-12-24 02:52:59 -05:00
Jacob Pratt 1c2dbcf33b Rollup merge of #150016 - usamoi:stabilize-lazy-get, r=jhpratt
stabilize `lazy_get`

closes https://github.com/rust-lang/rust/issues/129333
FCP is finished in https://github.com/rust-lang/rust/issues/129333#issuecomment-3477510482

```@rustbot``` modify labels: +T-libs-api
2025-12-24 02:52:58 -05:00
Chris Denton 6e354544bf Rename invalid-tmpdir-env-var
to invalid-tmpdir-no-ice
2025-12-24 06:41:44 +00:00
Chris Denton b5c473e414 Avoid using env::temp when linking a binary
This keeps all build artefacts (even temporary ones) within the build directory.
2025-12-24 06:41:42 +00:00
bors efa32de15b Auto merge of #150283 - Urgau:remap-debuginfo-absolute, r=jieyouxu
Remap both absolute and relative paths when building `rustc` and `std`

Turns out [#150110](https://github.com/rust-lang/rust/issues/150110) didn't work as expected, because when the standard library sources are present, we [helpfully un-remap the paths](https://github.com/rust-lang/rust/blob/e951f470d76febcc6f0a5b409c509eb77450a336/compiler/rustc_metadata/src/rmeta/decoder.rs#L1656-L1702) to the local directory of the user, including when we are building the compiler and standard library it-self (duh!), and since those paths are absolute (not relative), our purely relative remapping didn't pick them up.

This behavior wasn't a issue before because the un-remap logic immediately tries to remap them again, and since we had the absolute remapping we would just remap them to the the same thing.

To fix that issue I've adjusted our remapping to remap both the absolute and relative paths when building `rustc` and `std`, as well as added a run-make to make sure we don't regress it again (with a new `needs-std-remap-debuginfo` directive).

r? `@jieyouxu`
2025-12-24 06:23:00 +00:00
bors 5a7ad8ee06 Auto merge of #150324 - matthiaskrgr:rollup-cl7wrqn, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#149800 (Fix ICE in normalization during closure capture analysis (rust-lang/rust#149746))
 - rust-lang/rust#150182 (Don't export upstream monomorphizations from compiler-builtins)
 - rust-lang/rust#150216 (Tidying up tests/ui/issues 15 tests [6/N])
 - rust-lang/rust#150308 (Update bors configuration)
 - rust-lang/rust#150314 (rustc-dev-guide subtree update)
 - rust-lang/rust#150319 (use new term in description of --target)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-24 03:02:44 +00:00
Zalathar 1296925d1b Split out a separate PatConstKind::Float
Unlike the other types covered by `PatConstKind::Other`, const-float patterns
can also interact with range patterns.
2025-12-24 13:40:08 +11:00
Zalathar b7729998d2 Classify TestableCase::Constant into multiple sub-kinds 2025-12-24 13:40:07 +11:00
Matthias Krüger 2237db5d27 Rollup merge of #150319 - tshepang:triple-is-tuple, r=Kivooeo
use new term in description of --target

this changes _triple_ to _tuple_ in `--target` description
2025-12-24 00:54:37 +01:00