37567 Commits

Author SHA1 Message Date
Lukas Wirth
bbd40f8780
Merge pull request #21341 from Veykril/veykril/push-wsrtvrkzqyvr
internal: Move library and local root inputs to base-db
2025-12-27 10:24:52 +00:00
Lukas Wirth
1c67944f99 internal: Move library and local root inputs to base-db 2025-12-27 11:16:17 +01:00
Lukas Wirth
e08a7862a8
Merge pull request #20741 from A4-Tacks/comp-macro-segment
feat: Add macro segment completion
2025-12-27 10:02:35 +00:00
A4-Tacks
b5baf71afb
Minor fixup 2025-12-27 17:28:22 +08:00
Lukas Wirth
f9e29cfb70
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
6ae410ccc7
remove crossbeam-channel from proc-macro-srv-cli 2025-12-27 10:40:42 +05:30
bit-aloo
5a91849218
make source_text take non mutable reference of self 2025-12-27 09:43:01 +05:30
bit-aloo
76ea9828a7
rename handler's to be context specific 2025-12-27 09:21:32 +05:30
bit-aloo
91b5c3c664
add bidirectional handle in proc-macro-srv-cli to interact with client and srv 2025-12-27 09:07:08 +05:30
A4-Tacks
d2cc89ffc7
Add macro segment completion
Example
---
```rust
macro_rules! foo {
    ($($x:$0)*) => ();
}
```

**Completion items**:

```text
ba block
ba expr
ba expr_2021
ba ident
ba item
ba lifetime
ba literal
ba meta
ba pat
ba pat_param
ba path
ba stmt
ba tt
ba ty
ba vis
```
2025-12-27 05:04:18 +08:00
bit-aloo
346625f5f8
adapt source_text to new handler 2025-12-26 23:04:19 +05:30
bit-aloo
3441c230e3
remove old subreq/resp constructs 2025-12-26 23:04:04 +05:30
bit-aloo
af0e298818
add bidirectionalHandler trait 2025-12-26 23:03:42 +05:30
Lukas Wirth
8c5a68e214
Merge pull request #21200 from ChayimFriedman2/fake-impls
perf: Do not really expand builtin derives, instead treat them specifically
nightly
2025-12-26 13:31:48 +00:00
Chayim Refael Friedman
6ed7084fe8 Test builtin derives expansions
Via a hack to disable their fast path.
2025-12-26 15:00:27 +02:00
Chayim Refael Friedman
bd934c08cf 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
97ac158aaa
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
075b3beb5d
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
e2fea49975
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
c83c1a544c
Merge pull request #21335 from ChayimFriedman2/tupled-closure
internal: Store closures with "tupled" inputs
2025-12-26 08:18:20 +00:00
Lukas Wirth
c8d3e3abed
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
d39a9f2474
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
5813fe7ff6 Stabilize type mismatch diagnostic 🎉 2025-12-26 09:35:55 +02:00
Chayim Refael Friedman
5fbff1d7fb Make builtin derives cheaper, by not really expanding them, instead store them unexpanded 2025-12-25 16:26:11 +02:00
Chayim Refael Friedman
7e515fccf8 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
9581ba4daf
Merge pull request #21334 from Veykril/veykril/push-ozmlxzxpvrun
Introduce cargo-machete ci step
2025-12-25 10:13:35 +00:00
Lukas Wirth
af45994feb Introduce cargo-machete ci step 2025-12-25 10:38:05 +01:00
Laurențiu Nicola
51d133b75f
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
958d68ccd2 Merge ref 'e7d44143a12a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: e7d44143a12a526488e4f0c0d7ea8e62a4fe9354
Filtered ref: fe2cf3fa56a4ce08f56aee660fbe289c7d13dede
Upstream diff: f41f40408d...e7d44143a1

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
314785513e Prepare for merging from rust-lang/rust
This updates the rust-version file to e7d44143a12a526488e4f0c0d7ea8e62a4fe9354.
2025-12-25 04:19:22 +00:00
A4-Tacks
f953e2fa9d
Fix indent for convert_to_guarded_return 2025-12-24 21:46:57 +08:00
bors
fe2cf3fa56 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](e951f470d7/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
Laurențiu Nicola
be7d98ab08
Merge pull request #21327 from ada4a/patch-1
Fix typo in a URL
2025-12-23 20:31:49 +00:00
Ada Alakbarova
6cfdce929b
Fix typo in a URL 2025-12-23 21:20:11 +01:00
bit-aloo
41dade9006
return error on combination of bidirectional message and json framing 2025-12-23 23:14:47 +05:30
Shoyu Vanilla (Flint)
e14db0f5f8
Merge pull request #21326 from Veykril/push-vzswtlulupxv
fix: Fix flycheck generations not being synced for multiple workspaces
2025-12-23 13:41:33 +00:00
bit-aloo
9b03499a3b
chore: remove unwanted comments, extra lines and putting cli srv on default 2025-12-23 18:30:47 +05:30
Lukas Wirth
d63914222e fix: Fix flycheck generations not being synced for multiple workspaces
The diagnostics collection globally tracks the generation for all loaded workspaces as its shared between them, yet the flycheck actors track their own separate generations per workspace.
This mismatch could cause flycheck to not work correctly when multiple workspaces were loaded.
2025-12-23 13:57:06 +01:00
bit-aloo
1f64a69249
remove channels with callbacks in proc-macro-srv 2025-12-23 11:59:56 +05:30
bors
41271940aa Auto merge of #150291 - alexcrichton:wasi-use-usleep, r=ChrisDenton
std: Use `usleep` temporarily on WASI targets

This fixes some fallout from rust-lang/rust#147572 where the `thread::sleep` function is is broken on `wasm32-wasip2` after that PR. The cause for this is a broken implementation of `nanosleep` in wasi-libc itself which is being fixed in WebAssembly/wasi-libc#696. Similar to rust-lang/rust#149864 this avoids the problematic function for now while the wasi-libc changes take some time to propagate into a wasi-sdk release.

Closes rust-lang/rust#150290
2025-12-23 06:26:53 +00:00
bors
036a966d9b Auto merge of #150133 - ZuseZ4:enzyme-frontend-nightly, r=jieyouxu
remove llvm_enzyme and enzyme fallbacks from most places

Using dlopen to get symbols has the nice benefit that rustc itself doesn't depend on libenzyme symbols anymore. We can therefore delete most fallback implementations in the backend (independently of whether we enable enzyme or not). When trying to use autodiff on nightly, we will now fail with a nice error if and only if we fail to load libEnzyme-21.so in our backend.

Verified:
Build as nightly, without Enzyme
Build as nightly, with Enzyme
Build as stable (without Enzyme)

With this PR we will now run `tests/ui/autodiff` on nightly, the tests are passing.

r? `@kobzol`
2025-12-23 02:49:04 +00:00
bit-aloo
336f025424
remove internal callbacks, and move callback to rust-analyzer level 2025-12-23 07:58:53 +05:30
bors
0dae47933d Auto merge of #150217 - notriddle:stringdex-0.0.4, r=yotamofek,GuillaumeGomez
rustdoc: upgrade to stringdex 0.0.4

- code cleanup
- smaller encoding for runs
- fast path for the common encoding case
2025-12-22 23:19:14 +00:00
bors
85f5182a02 Auto merge of #150284 - JonathanBrouwer:rollup-yeibc0p, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149928 (Detail expectation on non-`()` block tail in `if` then condition with no `else`)
 - rust-lang/rust#150166 (Don't lint on interior mutable `const` item coming from derefs)
 - rust-lang/rust#150281 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-22 20:09:56 +00:00
bors
f07c54e547 Auto merge of #150277 - JonathanBrouwer:rollup-gvmdw36, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150098 (remove `legacy_const_generic_args` cache)
 - rust-lang/rust#150155 (fix ICE when {{root}} appears in import suggestions)
 - rust-lang/rust#150267 (`rust-analyzer` subtree update)
 - rust-lang/rust#150274 (Fix typo)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-22 17:03:07 +00:00
Jonathan Brouwer
90ba183984
Rollup merge of #150274 - ada4a:patch-4, r=Kivooeo
Fix typo
2025-12-22 17:33:38 +01:00
Jonathan Brouwer
f2e76266df
Rollup merge of #150267 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 31d2019672.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-12-22 17:33:37 +01:00
Jonathan Brouwer
f46d635fb5
Rollup merge of #150155 - Aditya-PS-05:fix/ice-150103-root-in-suggestions, r=estebank
fix ICE when {{root}} appears in import suggestions

Fixes rust-lang/rust#150103

When wrong nested imports like `use A::{::Fish}` were used, the internal {{root}} would appear in diagnostic suggestions, causing an ICE in `join_path_idents` which asserted that **{{root}} should only appear at the start of a path**.

r? ``@matthiaskrgr``
2025-12-22 17:33:37 +01:00
Jonathan Brouwer
a464c104e9
Rollup merge of #150098 - Bryntet:perf-testing, r=JonathanBrouwer
remove `legacy_const_generic_args` cache

putting this here to run perf
2025-12-22 17:33:36 +01:00
bit-aloo
2c71fa8cd4
rename PostcardNew to bidirectional-postcard-prototype 2025-12-22 20:56:16 +05:30