Commit Graph

24839 Commits

Author SHA1 Message Date
hkalbasi
d7fe4e2fa8 lower adjusts in simple index except the last one 2023-04-01 16:49:32 +03:30
bors
ffb04ae32d Auto merge of #14461 - HKalbasi:dev, r=Veykril
Use async block in async fn type inference

fix #14456

At some point we should probably go further and completely desugar async fn in hir lowering.
2023-04-01 05:19:36 +00:00
hkalbasi
8a6ca86247 Use async block in async fn type inference 2023-04-01 04:35:28 +03:30
DropDemBits
0a144f7fff
Use bind by-move to get the parent from the match 2023-03-31 17:48:59 -04:00
DropDemBits
afe3dcd3ff
Use retain_mut in CommentBlock::extract 2023-03-31 17:41:40 -04:00
DropDemBits
d689fd30bc
Remove outdated comment in sourcegen
`CommentBlock::extract` does handle blank lines in comment blocks
2023-03-31 14:43:24 -04:00
bors
853fb44a24 Auto merge of #14458 - Veykril:crate-origins, r=Veykril
Cleanup crate_graph construction
2023-03-31 13:01:20 +00:00
Lukas Wirth
b3919ea80d Cleanup crate_graph construction 2023-03-31 14:14:04 +02:00
Jonas Platte
d01a38ce3f
Address second round of review comments 2023-03-31 13:53:57 +02:00
bors
419d59f6e7 Auto merge of #14454 - Veykril:crate-origins, r=Veykril
internal: Refine CrateOrigin variants
2023-03-31 11:19:33 +00:00
Jonas Platte
0e11d507e1
Address review comment 2023-03-31 12:20:08 +02:00
Mathew Horner
3973d1aaa7
Add assist to convert nested function to closure 2023-03-31 12:16:49 +02:00
Lukas Wirth
31db1fc75f internal: Refine CrateOrigin variants 2023-03-31 10:36:13 +02:00
Lukas Wirth
af0d548b66 Fix proc-macro server spawning behavior when the server is r-a itself 2023-03-30 18:59:03 +02:00
bors
42d671fcb7 Auto merge of #14451 - Veykril:bumo-smol-str, r=Veykril
minor: Bump smol_str

Should slightly improve compile times by it now not depending on serde (rowan and syntax in turn not either)
2023-03-30 15:45:16 +00:00
Lukas Wirth
f1c5cb7e48 Bump smol_str 2023-03-30 17:44:12 +02:00
hecatia-elegua
c469936aac Address review comments part 1 2023-03-30 17:35:57 +02:00
bors
d3b129f04f Auto merge of #14444 - zapkub:runable-debug-env-is-not-passing-properly, r=Veykril
Missing runnable env on debug target

Fix bug in Rust Analyzer VSCode where runnable debugging did not pass
environment variable from configuration to child process of Cargo on binary build stage

There is a missing env passing along to `cargo` in debug target which give an in-consistent result from debug and run target

For example
```json
{
    "rust-analyzer.runnableEnv": {
        "OUT_DIR": "/test/path2"
    }
}
```

## run
![image](https://user-images.githubusercontent.com/4373581/228749503-fa55f62c-13d3-4d3c-bee6-1cfbe042bdd0.png)
## debug
compiling binary is failed. Missing env
![image](https://user-images.githubusercontent.com/4373581/228749688-3fe42efb-b5ca-41be-862d-f2d97ecab7be.png)

## debug (after fix)
![image](https://user-images.githubusercontent.com/4373581/228750057-1db60051-3465-47db-8b18-4159ec58cfdb.png)
2023-03-30 13:38:36 +00: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
bors
ef7756cb9e Auto merge of #14441 - Veykril:simplify, r=Veykril
minor: Simplify
2023-03-30 07:36:57 +00:00
Lukas Wirth
251b3a47af Simplify 2023-03-30 09:21:10 +02:00
Rungsikorn Rungsikavarnich
fb9a1dd87e Missing runnable env on debug target
Fix bug in Rust Analyzer where runnable debugging did not pass
environment variable from configuration to child process of Cargo
on binary build stage
2023-03-30 15:39:49 +09:00
bors
17e31b7d3b Auto merge of #14440 - Veykril:deref-fix, r=Veykril
fix: Handle box and raw pointers correctly in builtin_deref
2023-03-29 19:39:02 +00: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
bors
5351c21b7e Auto merge of #14435 - Veykril:index-adjustments, r=Veykril
fix: Add missing autoborrow adjustment for index expressions
2023-03-29 17:36:33 +00:00
Lukas Wirth
f1f64e92d7 Fix mutability_error::overloaded_index test 2023-03-29 18:07:25 +02:00
Ryo Yoshida
6447d485e3
Normalize type anchor type before resolving the rest of value paths 2023-03-29 23:37:01 +09:00
Ryo Yoshida
8aef04f1a7
Resolve and normalize path segments one by one in variant resolution 2023-03-29 23:32:37 +09:00
Lukas Wirth
798990bf33 fix: Add missing autoborrow adjustment for index expressions 2023-03-29 16:11:48 +02:00
hecatia-elegua
ba2b48d1b8 Fix3 2023-03-29 14:58:33 +02:00
bors
a486f34048 Auto merge of #14434 - Veykril:ty-tail-norm, r=Veykril
fix: Use struct_tail_without_normalization in Expectation::rvalue_hint
2023-03-29 12:49:24 +00:00
Lukas Wirth
bea1c71f83 Use struct_tail_without_normalization in Expectation::rvalue_hint 2023-03-29 14:49:06 +02:00
hecatia-elegua
53afac72d2 Fix2 2023-03-29 14:34:06 +02:00
hecatia-elegua
c351f6bf43 Fix 2023-03-29 14:27:20 +02:00
hecatia-elegua
0863389dd1 Add doc-alias based completion 2023-03-29 14:08:25 +02:00
Lukas Wirth
0522503f14 Thread global symbol interner through as if it was a local 2023-03-29 11:42:08 +02:00
Lukas Wirth
c4582f6d18 Fix visibilities 2023-03-29 11:32:36 +02:00
Lukas Wirth
afe52d270d Run proc-macro-srv tests on rust-lang/rust-analyzer 2023-03-29 11:20:57 +02:00
Lukas Wirth
7498ec730e Drop support for non-syroot proc macro ABIs 2023-03-29 10:57:32 +02:00