Commit graph

258129 commits

Author SHA1 Message Date
Lukas Wirth
ef4b97490f Move proc-macro-test test path fetching from include to env var 2024-06-30 15:37:00 +02:00
Lukas Wirth
d8a74a2b60 Rename proc-macro-srv::server to server_impl 2024-06-30 15:36:46 +02:00
Lukas Wirth
05c77898d9 Move proc-macro-srv RUSTC_VERSION fetching from include to env var 2024-06-30 15:28:31 +02:00
Lukas Wirth
f4c2ac456e Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
Lukas Wirth
8c526eefd3 Move interior mutability into ProcMacroSrvProcess 2024-06-30 15:22:39 +02:00
Lukas Wirth
fd9dce7fb8 Move dylib version stuff to proc-macro-srv 2024-06-30 15:05:35 +02:00
Lukas Wirth
eb72a9e2fd Simplify 2024-06-30 14:00:55 +02:00
Lukas Wirth
4453fd49cd Fix expression scope calculation when within macro expansions 2024-06-30 13:26:17 +02:00
Lukas Wirth
00fc75885f Simplify unresolved proc-macro handling 2024-06-30 13:26:13 +02:00
bors
2445d537e6 Auto merge of #17489 - Veykril:tt-iter, r=Veykril
minro: move tt-iter into tt crate
2024-06-24 12:48:53 +00:00
Lukas Wirth
3db288136e move tt-iter into tt crate 2024-06-24 14:47:21 +02:00
bors
a16d63c8b3 Auto merge of #17488 - alibektas:17485/duplicate_snippets, r=alibektas
minor : Fix duplicate snippets showing up on hover.

With each `config::apply_change` duplicate configs were being added.
Now we first drain the vec that holds these and then start adding. This fixes #17485
2024-06-24 11:34:13 +00:00
Ali Bektas
f93d2ddb40 Apply minor changes 2024-06-24 13:15:33 +02:00
Ali Bektas
6145b1f34f minor : Fix duplicate snippets showing up on hover.
With each `config::apply_change` duplicate configs were being added.
Now we first drain the vec that holds these and then start adding.
2024-06-24 13:01:40 +02:00
bors
7cf4cc7d90 Auto merge of #17487 - Veykril:ty-perf-stuff, r=Veykril
internal: Some more small memory optimizations

Not a big impact on metrics, though there are some more savings in queries mainly used by the IDE layer from this
2024-06-24 09:50:35 +00:00
Lukas Wirth
0b69c601fb Fix term_search filtering enum variant generics incorrectly 2024-06-24 10:31:21 +02:00
bors
1cd8bc0cf2 Auto merge of #17471 - davidsemakula:fix-remove-parenthesis, r=Veykril
fix: don't remove parentheses for calls of function-like pointers that are members of a struct or union

Fixes #17111
2024-06-24 08:25:49 +00:00
bors
f9a337cc88 Auto merge of #17411 - Wilfred:clearer_unlinked_file, r=Veykril
fix: Improve hover text in unlinked file diagnostics

Use full sentences, and mention how to disable the diagnostic if users are intentionally working on unowned files.

![Screenshot 2024-06-12 at 5 55 48 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/c91ee1ed-1c72-495a-9ee3-9e360a5c6977)

(Full disclosure: I've tested a rust-analyzer build in VS Code, but the pop-up logic is currently disabled due to #17062, so I haven't tested that.)
2024-06-24 08:11:43 +00:00
Lukas Wirth
04b6b04092 Shrink mbe's Op 2024-06-24 10:07:32 +02:00
Lukas Wirth
7a7446bb94 Intern ModPath within RawVisibility 2024-06-24 10:07:32 +02:00
Lukas Wirth
71c6e23ffc Save a bit on empty item trees by deduplicating them 2024-06-24 10:07:32 +02:00
Lukas Wirth
eace303b9d Enum variants are not generic def ids 2024-06-24 10:07:31 +02:00
bors
a32ce24b0c Auto merge of #17466 - chenyukang:patch-1, r=Veykril
chore: Fix diagnostic name in macro_error.rs
2024-06-24 07:57:45 +00:00
bors
91f0eecc44 Auto merge of #17481 - roife:fix-issue-17480, r=Veykril
fix: pattern completions in let-stmt

fix #17480.

We can write `let S { a, b } = s;` or `let Some(x) = a else {}`, so it is reasonable to allow pattern completions in `LetStmt`.
2024-06-24 07:34:08 +00:00
bors
4dd0ad7afd Auto merge of #17478 - kilpkonn:master, r=Veykril
Simplify some term search tactics

Working on the paper `@phijor` found that "Data constructor" tactic could be simplified quite a bit by running it only in the backwards direction. With n+1 rounds it has same coverage as previous implementation in n rounds, however the tactic it self is more simple and also potentially faster as there is less to do.

In a nutshell the idea is to only work with types in the wish-list rather than with any types.

Turns out it is quite a bit faster:

Before:
```
ripgrep:
Tail Expr syntactic hits: 238/1692 (14%)
Tail Exprs found: 1223/1692 (72%)
Term search avg time: 15ms

nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2143/3001 (71%)
Term search avg time: 849ms
```

After
````
ripgrep:
Tail Expr syntactic hits: 246/1692 (14%)
Tail Exprs found: 1209/1692 (71%)
Term search avg time: 8ms

nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2028/3001 (67%)
Term search avg time: 305ms
````

_Also removed niche optimization of removing scope defs from the search space as this wasn't helping much anyway and made code a bit more complex._
2024-06-24 07:20:50 +00:00
roife
9dd4e3ecec fix: pattern completions in let-stmt 2024-06-23 22:27:54 +08:00
Tavo Annus
efecb90b7f Fix suggestions of unstable constants 2024-06-22 21:33:58 +03:00
Tavo Annus
8b6dda78b3 Increase search depth to account for more granual steps 2024-06-22 15:06:07 +03:00
bors
70e9582f4c Auto merge of #17475 - lnicola:changelog-title, r=lnicola
minor: Remove Changelog: XXX title from Github release notes

Fixes #16455
Closes #17165
2024-06-22 11:57:52 +00:00
Laurențiu Nicola
0744b36d53 Remove Changelog: XXX title from Github release notes 2024-06-22 14:55:23 +03:00
Tavo Annus
83026d47ab Simplify impl_method tactic 2024-06-22 14:22:56 +03:00
Tavo Annus
117068d71f Simplify impl_static_method tactic 2024-06-22 14:14:42 +03:00
Tavo Annus
29425bd377 Remove remove not-very-helpful optimizations 2024-06-22 10:17:33 +03:00
Tavo Annus
b3c924ddb0 Run data_constructor tactic only backwards 2024-06-21 22:01:06 +03:00
bors
9b33872c89 Auto merge of #17469 - roife:fix-issue-17425, r=Veykril
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs

fix #17425.

When converting `PathResolution` to `ItemInNs`, we should convert `ModuleDef::Macro` to `ItemInNs::Macros` to ensure that it can be found in `DefMap`.
2024-06-21 17:52:42 +00:00
bors
398e3a3c28 Auto merge of #17474 - Veykril:ty-perf-stuff, r=Veykril
internal: Remove some allocations from hir-ty
2024-06-21 17:39:45 +00:00
Lukas Wirth
619574928c Prevent re-allocation in CallableSig::from_params_and_return 2024-06-21 19:26:08 +02:00
Lukas Wirth
54f3f56ee8 Save allocations for empty generic_defaults query results 2024-06-21 19:21:27 +02:00
bors
36c37313a0 Auto merge of #17473 - Veykril:generics, r=Veykril
internal: Tidy up generics handling in hir-ty a bit
2024-06-21 17:12:35 +00:00
Lukas Wirth
2893153c34 Don't attempt to compute implict sized clauses for empty generics 2024-06-21 19:10:57 +02:00
Lukas Wirth
5cbaa3f554 Save allocations for empty generic_predicates query results 2024-06-21 19:10:45 +02:00
Lukas Wirth
873dcf4b9c Lazy generics 2024-06-21 18:38:37 +02:00
Lukas Wirth
3b97b75599 Simplify 2024-06-21 18:27:05 +02:00
Lukas Wirth
3a66230a44 There can only be one self param 2024-06-21 17:55:16 +02:00
Lukas Wirth
c133c649a0 Light docs and privacy 2024-06-21 17:54:40 +02:00
davidsemakula
f1debd96e4 fix: don't remove parentheses for calls of function-like pointers that are members of a struct or union 2024-06-21 17:57:53 +03:00
roife
51b138cc79 fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs 2024-06-21 21:05:14 +08:00
Lukas Wirth
7b50a5ff43 Extract generics module 2024-06-21 10:55:05 +02:00
Wilfred Hughes
39179c49c6 fix: Improve hover text in unlinked file diagnostics
Use full sentences, and mention how to disable the diagnostic
if users are intentionally working on unowned files.
2024-06-20 09:32:48 -07:00
Yukang
a904bc3761
Fix diagnostic name in macro_error.rs 2024-06-21 00:13:34 +08:00