Commit Graph

25598 Commits

Author SHA1 Message Date
AmrDeveloper
3fb6a3be82 Remove un needed extra handling for remove self with braces 2023-07-05 17:38:58 +02:00
AmrDeveloper
ce0239bd6a Disable remove unnecessary braces diagnotics for self imports 2023-07-05 16:34:04 +02:00
bors
0dd2c0d8d3 Auto merge of #15209 - Veykril:ast-id, r=Veykril
internal: Stronger typing for AstId and AstIdMap
2023-07-04 07:17:09 +00:00
Lukas Wirth
8886d707b8 Stronger typing for AstId and AstIdMap 2023-07-04 09:16:15 +02:00
bors
45272efec5 Auto merge of #14990 - HKalbasi:diagnostic-map, r=HKalbasi
Map our diagnostics to rustc and clippy's ones

And control their severity by lint attributes `#[allow]`, `#[deny]` and ... .

It doesn't work with proc macros and I would like to fix that before merge but I don't know how to do it.
2023-07-03 18:58:47 +00:00
bors
daba334611 Auto merge of #15206 - Veykril:let-else-fmt, r=Veykril
internal: Format let-else

As nightly finally got support for it I went ahead and formatted r-a with the latest nightly, then with the latest stable (in case other stuff changed)
2023-07-03 18:41:59 +00:00
Lukas Wirth
69cd3c30ac Format let-else 2023-07-03 20:34:09 +02:00
bors
b9101895d2 Auto merge of #15205 - Veykril:load-cargo, r=Veykril
Split out project loading capabilities from rust-analyzer crate

External tools currently depend on the entire lsp infra for no good reason so let's lift that out so those tools have something better to depend on
2023-07-03 15:46:09 +00:00
Lukas Wirth
28fcd1bdd7 Split out project loading capabilities from rust-analyzer crate 2023-07-03 17:40:31 +02:00
bors
2d83bc5bce Auto merge of #15149 - Veykril:line-index-perf, r=Veykril
internal: Speedup line index calculation via SSE2
2023-07-03 15:11:51 +00:00
bors
5703346523 Auto merge of #15118 - alexkirsz:alexkirsz/resolve-deref-raw, r=Veykril
Follow raw pointers in autoderef chain when resolving methods with custom receiver

Fixes #15083

I believe this stopped working after e797479651
2023-07-03 14:55:08 +00:00
Lukas Wirth
97748b0fc6 Speedup line index calculation via SSE2 2023-07-03 16:46:28 +02:00
bors
691600a885 Auto merge of #15181 - lowr:patch/import-map-purge-unused, r=Veykril
Clean up `ImportMap`

There are several things in `hir_def::import_map` that are never used. This PR removes them and restructures the code. Namely:

- Removes `Query::name_only`, because it's *always* true.
  - Because of this, we never took advantage of storing items' full path. This PR removes `ImportPath` and changes `ImportInfo` to only store items' name, which should reduce the memory consumption to some extent.
- Removes `SearchMode::Contains` for `Query` because it's never used.
- Merges `Query::assoc_items_only` and `Query::exclude_import_kinds` into `Query::assoc_mode`, because the latter is never used besides filtering associated items out.

Best reviewed one commit at a time. I made sure each commit passes full test suite. I can squash the first three commits if needed.
2023-07-03 14:37:55 +00:00
bors
6d616a4fc2 Auto merge of #15204 - Veykril:analysis-stats-ide, r=Veykril
internal: Add analysis-stats flag to trigger some IDE features

Closes https://github.com/rust-lang/rust-analyzer/issues/15131

Running this on r-a showed an 86mb memory increase, but that was without running it on the deps, will try that later when I don't need to use my pc.
2023-07-03 14:05:14 +00:00
Lukas Wirth
e52027861e Add analysis-stats flag to trigger some IDE features 2023-07-03 16:04:08 +02:00
bors
82ef6991d7 Auto merge of #15203 - Veykril:proc-macro-expand, r=Veykril
Shuffle some proc_macro_expand query things around

Removes some unnecessary extra work we are doing in proc-macro expansion, and more importantly `Arc` the result of the proc_macro_expand query, that way we can reuse the instance for the `macro_expand` query's result
2023-07-03 13:07:26 +00:00
Lukas Wirth
bdc3d0f551 Shuffle some proc_macro_expand query things around 2023-07-03 15:05:25 +02:00
bors
8094e05c0f Auto merge of #15202 - Veykril:builtin-derive-diags, r=Veykril
internal: Don't diagnose builtin derives
2023-07-03 12:24:36 +00:00
Lukas Wirth
321e570d92 Don't diagnose builtin derives 2023-07-03 14:23:36 +02:00
bors
e175595985 Auto merge of #15186 - matklad:panic, r=HKalbasi
feat: don't add panics to error jump list by default

To re-enable this, use

    "rust-analyzer.runnables.problemMatcher": [
        "$rustc",
        "$rust-panic"
    ],

setting.

closes: #14977
2023-07-03 02:40:35 +00:00
bors
ff485b63bf Auto merge of #15199 - lowr:patch/revert-15125, r=lowr
Revert "Support `#[rustc_coinductive]`"

Reverts #15125, addresses https://github.com/rust-lang/rust-analyzer/pull/15125#issuecomment-1615517893

I'll add the support again once I figure out the problem.
2023-07-02 20:27:18 +00:00
Ryo Yoshida
6086ced61d Revert "Support #[rustc_coinductive]"
This reverts commit d026479ba6.
2023-07-03 05:06:55 +09:00
bors
9bdc9aaceb Auto merge of #15195 - davidlattimore:proc-macro-test-no-version, r=HKalbasi
Don't specify proc-macro-test version

proc-macro-test is only used as a dev-dependency and isn't published to crates.io, so a version doesn't make sense. Having a version also breaks automatic publishing.
2023-07-02 09:23:06 +00:00
David Lattimore
0810827b97 Don't specify proc-macro-test version
proc-macro-test is only used as a dev-dependency and isn't published to
crates.io, so a version doesn't make sense. Having a version also breaks
automatic publishing.
2023-07-02 19:06:20 +10:00
bors
f5f0c48ac3 Auto merge of #15194 - HKalbasi:mir, r=HKalbasi
Fix layout of simd types and respect align in mir interpreter
2023-07-01 21:13:08 +00:00
hkalbasi
6f7452882a Fix layout of simd types and respect align in mir interpreter 2023-07-02 00:42:33 +03:30
bors
3d3f325a4e Auto merge of #15189 - HKalbasi:mir, r=HKalbasi
Fix overflow checking in shift operator
2023-07-01 13:47:41 +00:00
hkalbasi
15a0da6f30 Fix overflow checking in shift operator 2023-07-01 17:16:56 +03:30
Alex Kladov
832a64e290 feat: don't add panics to error jump list by default
To re-enable this, use

    "rust-analyzer.runnables.problemMatcher": [
        "$rustc",
        "$rust-panic"
    ],

setting.

closes: #14977
2023-06-30 22:23:13 +01:00
bors
46cd8b8495 Auto merge of #15185 - HKalbasi:mir, r=HKalbasi
Bump chalk

This fixes some issues, but I didn't add fix #num for them since 1. I don't know all of them and 2. we may want to add test for them.
2023-06-30 20:12:06 +00:00
hkalbasi
bb85a980e0 Bump chalk 2023-06-30 23:36:47 +03:30
bors
0841a84935 Auto merge of #15184 - HKalbasi:mir, r=HKalbasi
Disable mir interpreter for targets with different pointer size from host

fix #15182
2023-06-30 17:53:11 +00:00
hkalbasi
45828cdb54 Disable mir interpreter for targets with different pointer size from host 2023-06-30 21:21:52 +03:30
bors
76bcd9946a Auto merge of #15169 - lowr:patch/impl-header-anon-lifetime, r=HKalbasi
Use anonymous lifetime where possible

Because anonymous lifetimes are *super* cool.

More seriously, I believe anonymous lifetimes, especially those in impl headers, reduce cognitive load to a certain extent because they usually signify that they are not relevant in the signature of the methods within (or that we can apply the usual lifetime elision rules even if they are relevant).
2023-06-30 16:57:20 +00:00
Ryo Yoshida
5db0e1a346
Restructure ImportMap collection 2023-07-01 00:18:23 +09:00
Ryo Yoshida
2b106648a7
Only store item name instead of full path 2023-07-01 00:17:57 +09:00
bors
7a3991a544 Auto merge of #15180 - alibektas:15176, r=Veykril
Purge of unwraps

Removes unnecessary unwraps that I have overlooked in #15101 ( fixes #15176 )
2023-06-30 14:46:49 +00:00
Ryo Yoshida
860628af7c
Remove SearchMode:Contains
Also micro-optimizes fuzzy search.
2023-06-30 23:37:23 +09:00
Ryo Yoshida
8cd4e9f7ec
Merge assoc_items_only and exclude_import_kinds into assoc_mode 2023-06-30 23:37:10 +09:00
Ryo Yoshida
97b725e269
Remove name_only from import map query 2023-06-30 23:35:55 +09:00
Ali Bektas
cfbeb66a63 Purge of unwrap version 2 2023-06-30 16:31:20 +02:00
Ali Bektas
72aeaef5f3 Purge of unwraps 2023-06-30 15:47:17 +02:00
bors
f96442aa90 Auto merge of #15177 - rust-lang:Veykril-patch-1, r=Veykril
Fix panic in `handle_code_action`

🤞 that CI is happy with this, edited this via github
2023-06-30 06:56:21 +00:00
Lukas Wirth
7e7f401a81
Fix panic in handle_code_action 2023-06-30 08:42:46 +02:00
Lukas Wirth
60d046f567
Fix panic in handle_code_action 2023-06-30 08:38:44 +02:00
bors
d597369253 Auto merge of #15175 - lnicola:cross-env, r=Veykril
internal: Drop `cross-env` npm dep
2023-06-30 06:35:09 +00:00
Laurențiu Nicola
477a75d671 Drop cross-env npm dep 2023-06-30 09:20:02 +03:00
bors
40b2a68381 Auto merge of #15174 - tetsuharuohzeki:switch-to-use-vscode-vcse, r=Veykril
editor/code: Switch to `@vscode/vsce`

This follows up https://github.com/rust-lang/rust-analyzer/pull/15151

`vsce` was renamed to ``@vscode/vsce`.` We should switch to it now.

- https://code.visualstudio.com/updates/v1_74#_extension-authoring
- https://www.npmjs.com/package/`@vscode/vsce`
2023-06-30 05:48:47 +00:00
Tetsuharu Ohzeki
0500b1d5f8 editor/code: Switch to @vscode/vsce
`vsce` was renamed to `@vscode/vsce`.
We should switch to it now.

- https://code.visualstudio.com/updates/v1_74#_extension-authoring
- https://www.npmjs.com/package/@vscode/vsce
2023-06-30 09:55:43 +09:00
bors
769c80dc62 Auto merge of #15173 - HKalbasi:mir, r=HKalbasi
Fix data layout of reference to nested unsized structs
2023-06-29 20:25:42 +00:00