Commit graph

17066 commits

Author SHA1 Message Date
tamasfe
0b9c0c5088
feat(syntax): RTN in bounds
Limited syntactic support for experimental return type notations.
https://github.com/rust-lang/rust/issues/109417
2023-04-01 15:26:03 +02:00
hkalbasi
8a6ca86247 Use async block in async fn type inference 2023-04-01 04:35:28 +03:30
Lukas Wirth
b3919ea80d Cleanup crate_graph construction 2023-03-31 14:14:04 +02:00
Lukas Wirth
31db1fc75f internal: Refine CrateOrigin variants 2023-03-31 10:36:13 +02:00
bors
562477b4da Auto merge of #14439 - Veykril:proc-mac-attr-durability, r=Veykril
internal: Set Durability to HIGH for enable_proc_attr_macros input
2023-03-30 13:21:49 +00:00
Lukas Wirth
e244942209 internal: Set Durability to HIGH for enable_proc_attr_macros input 2023-03-30 15:11:22 +02:00
bors
5c6a38abde Auto merge of #14449 - Veykril:parser-vis-recov, r=Veykril
fix: Recover from `pub()` visibility modifier
2023-03-30 13:08:14 +00:00
bors
5390949c11 Auto merge of #14448 - Veykril:infer-table, r=Veykril
internal: Don't expose InferenceTable outside of hir-ty
2023-03-30 12:49:23 +00:00
bors
02ea92fecb Auto merge of #14445 - Veykril:adt-flags, r=Veykril
internal: Introduce StructFlags
2023-03-30 12:34:37 +00:00
bors
fc8c5139fa Auto merge of #14410 - Veykril:query-lru-capacities, r=Veykril
internal: Add config to specifiy lru capacities for all queries

Might help figuring out what queries should be limited by LRU by default, as currently we only limit `parse`, `parse_macro_expansion` and `macro_expand`.
2023-03-30 12:20:24 +00:00
Lukas Wirth
cb546390da fix: Recover from pub() visibility modifier 2023-03-30 13:42:15 +02:00
Lukas Wirth
fc840dbb2d internal: Don't expose InferenceTable outside of hir-ty 2023-03-30 13:27:10 +02:00
Lukas Wirth
5616d91b73 internal: Add config to specifiy lru capacities for all queries 2023-03-30 12:52:28 +02:00
Lukas Wirth
33b6012827 Introduce StructFlags 2023-03-30 12:49:08 +02:00
bors
b915eb32fa Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril
fix: allow new, subsequent `rust-project.json`-based workspaces to get proc macro expansion

As detailed in https://github.com/rust-lang/rust-analyzer/issues/14417#issuecomment-1485336174, `rust-project.json` workspaces added after the initial `rust-project.json`-based workspace was already indexed by rust-analyzer would not receive procedural macro expansion despite `config.expand_proc_macros` returning true. To fix this issue:
1. I changed `reload.rs` to check which workspaces are newly added.
2. Spawned new procedural macro expansion servers based on the _new_ workspaces.
    1. This is to prevent spawning duplicate procedural macro expansion servers for already existing workspaces. While the overall memory usage of duplicate procedural macro servers is minimal, this is more about the _principle_ of not leaking processes 😅.
3. Launched procedural macro expansion if any workspaces are `rust-project.json`-based _or_ `same_workspaces` is true. `same_workspaces` being true (and reachable) indicates that that build scripts have finished building (in Cargo-based projects), while the build scripts in `rust-project.json`-based projects have _already been built_ by the build system that produced the `rust-project.json`.

I couldn't really think of structuring this code in a better way without engaging with https://github.com/rust-lang/rust-analyzer/issues/7444.
2023-03-30 07:50:27 +00:00
Lukas Wirth
251b3a47af Simplify 2023-03-30 09:21:10 +02:00
Lukas Wirth
e797479651 fix: Handle box and raw pointers correctly in builtin_deref 2023-03-29 21:38:32 +02:00
David Barsky
25c59b8e92 address PR comments 2023-03-29 15:29:32 -04:00
Lukas Wirth
f1f64e92d7 Fix mutability_error::overloaded_index test 2023-03-29 18:07:25 +02:00
Lukas Wirth
798990bf33 fix: Add missing autoborrow adjustment for index expressions 2023-03-29 16:11:48 +02:00
Lukas Wirth
bea1c71f83 Use struct_tail_without_normalization in Expectation::rvalue_hint 2023-03-29 14:49:06 +02:00
bors
7a98e24777 Auto merge of #14431 - Veykril:simplify, r=Veykril
minor: Simplify
2023-03-29 07:28:42 +00:00
bors
0d1ed56bb3 Auto merge of #14430 - Veykril:canonicalize-project-manifest, r=Veykril
fix: Canonicalize rust-project.json manifest path

Looked a bit more into this and I think we can do this after all, I don't see any place where this should break things
cc https://github.com/rust-lang/rust-analyzer/pull/14168 https://github.com/rust-lang/rust-analyzer/pull/14402#issuecomment-1487257246
2023-03-29 07:11:02 +00:00
Lukas Wirth
8ea1afce28 Simplify 2023-03-28 16:32:26 +02:00
David Barsky
e5bfd7ef0a it, uh, turns out that we should be spawning for new servers. oops. 2023-03-28 09:56:01 -04:00
David Barsky
6a42d7f627 fix: allow new, subsequent rust-project.json-based workspaces to get
proc macro expansion.
2023-03-28 09:17:16 -04:00
hkalbasi
d0d4245a74 use FxHashSet instead of FxHashMap 2023-03-28 15:59:16 +03:30
hkalbasi
d5c7ec499a fix stack overflow in is_ty_uninhabited_from 2023-03-28 15:45:35 +03:30
Eclips4
0a2a50a663 Fix typo 2023-03-28 12:32:51 +03:00
bors
5bba438c9c Auto merge of #14366 - Veykril:linked-proj, r=Veykril
feat: Pop a notification prompting the user to add a Cargo.toml of unlinked file to the linkedProjects

cc https://github.com/rust-lang/rust-analyzer/issues/13226 https://github.com/rust-lang/rust-analyzer/issues/9661
2023-03-28 07:05:43 +00:00
bors
f73510560f Auto merge of #14424 - Veykril:local-trait-impls, r=Veykril
fix: Properly handle local trait impls

Before we only handled trait impls that came from the block of either the trait or the target type, we now handle them correctly by tracking the block we are currently inferring from, then walking that up to collect all block trait impls.
2023-03-28 06:36:35 +00:00
Lukas Wirth
342fd2b9f3 fix: Properly handle local trait impls 2023-03-28 08:34:29 +02:00
Daniil Kolesnichenko
be17eab08b fix(rustdoc): don't escape double hashes outside of Rust code blocks
Fixes #14376
2023-03-28 05:32:59 +07:00
Lukas Wirth
f1de133820 Canonicalize rust-project.json manifest path 2023-03-27 21:55:02 +02:00
Lukas Wirth
b03a218b57 fix: Fix proc-macro paths using incorrect CrateId's for rust-project.json workspaces 2023-03-27 17:17:09 +02:00
Lukas Wirth
c04a13cb19 Simplify 2023-03-27 17:16:45 +02:00
Lukas Wirth
ee02213e65 Handle proc macro fetching via OpQueue 2023-03-26 09:33:41 +02:00
bors
82ec4586f1 Auto merge of #14408 - Veykril:intern-block, r=Veykril
internal: Only intern blocks that declare items

We only used `BlockId` for the block defmap, so this is wasted memory. Lowering for non item declaring blocks is also cheaper now as we no longer have to fully lower a block that defines not items.
2023-03-25 19:48:04 +00:00
Lukas Wirth
675fc88afd internal: Only intern blocks that declare items 2023-03-25 20:44:12 +01:00
bors
d1c7984396 Auto merge of #14407 - Veykril:rename-fix, r=Veykril
fix: Fix renames of locals being broken in macro calls

Fixes https://github.com/rust-lang/rust-analyzer/issues/14379
2023-03-25 18:35:13 +00:00
Lukas Wirth
0daf069b0e fix: Fix renames of locals being broken in macro calls 2023-03-25 18:37:18 +01:00
Lukas Wirth
e5f24a6d7c Set proc_macros input when creating the RootDatabase 2023-03-25 18:20:42 +01:00
Lukas Wirth
607375dc20 Load proc-macros asynchronously 2023-03-25 18:06:06 +01:00
Lukas Wirth
e9fb2ffe45 Add lsp command for rebuilding proc macros 2023-03-25 16:50:31 +01:00
Lukas Wirth
d154ea88f9 Split out proc-macros from the CrateGraph 2023-03-25 16:46:44 +01:00
bors
71b23360e7 Auto merge of #14404 - Veykril:proc-macro-loading, r=Veykril
Remove client side proc-macro version check

The server already verifies versions due to ABI picking now so there shouldn't be a need for the client side check anymore
2023-03-25 14:44:53 +00:00
Lukas Wirth
3ae9bfe266 Remove client side proc-macro version check 2023-03-25 15:43:58 +01:00
bors
992a0fc074 Auto merge of #14403 - Veykril:dependencies, r=Veykril
internal: Bump Cargo.lock
2023-03-25 14:15:10 +00:00
Lukas Wirth
39e86e78c3 Bump Cargo.lock 2023-03-25 15:12:39 +01:00
bors
fc848495f4 Auto merge of #14402 - Veykril:project-json-sym-link, r=Veykril
internal: Reject symlinks in project-json

cc https://github.com/rust-lang/rust-analyzer/pull/14168
2023-03-25 13:34:10 +00:00