Commit Graph

18105 Commits

Author SHA1 Message Date
Lukas Wirth
fddef42e92 Only set rust-analyzer cfg for workspace members 2023-09-08 11:02:56 +02:00
Lukas Wirth
e9e2c1ae75 Update project-model test outputs 2023-09-08 10:49:15 +02:00
Lukas Wirth
853f8a21f7 Fix cfg completions not working 2023-09-08 10:49:15 +02:00
Lukas Wirth
ca6ddd8ea3 Enable rust_analyzer for cfgs when code is being analyzed by rust-analyzer 2023-09-08 10:49:12 +02:00
bors
3325622230 Auto merge of #15430 - alibektas:deunwrap/wrap_return_type_in_result, r=Veykril
minor : Deunwrap wrap_return_type_in_result

#15398 subtask 7
2023-09-08 08:24:29 +00:00
bors
47e0d07eb0 Auto merge of #15573 - alibektas:15539/into_to_from, r=Veykril
assist : `into_to_qualified_from`

fixes #15539. This assist converts an `.into()` call into an explicit fully qualified `from()` call.
2023-09-08 07:44:24 +00:00
bors
5ddad87b1a Auto merge of #15574 - alibektas:15572/false_crate_name_env, r=Veykril
minor : use crate name for `CARGO_CRATE_NAME`

fixes #15572 . Until now we used the package name as a replacement of crate name. With this PR r-a first sets all the env variables it set before and on top of those it tries to set `CARGO_CRATE_NAME` to crates name, following envvar's naming convention.
2023-09-08 07:25:34 +00:00
Ali Bektas
506a477acf Use cargo name as the CARGO_CRATE_NAME instead of package name 2023-09-08 01:41:00 +02:00
Ali Bektas
9762f764ae Add assist into_to_qualified_from
This assist converts an `.into()` call into an explicit
fully qualified from call.
2023-09-07 23:43:46 +02:00
bors
d5b6ab2fa5 Auto merge of #15571 - Veykril:mir-alloc, r=Veykril
Remove allocation on mir eval memory write
2023-09-07 17:27:57 +00:00
Lukas Wirth
cd53bd6b8e Remove allocation on mir eval memory write 2023-09-07 18:41:50 +02:00
bors
8edd81f166 Auto merge of #15568 - Veykril:upstream-rustc-ap, r=Veykril
Replace format-args parser with upstream fork

Turns out we can't bump rustc_abi right now because it got its generics removed accidentally https://github.com/rust-lang/rust/pull/107163
2023-09-07 09:52:08 +00:00
Lukas Wirth
10b0cd7047 Replace format-args parser with upstream fork 2023-09-07 11:37:59 +02:00
hkalbasi
e4c469321c Ignore enum variants in analysis stats of mir bodies 2023-09-07 01:08:47 +03:30
bors
77b359ae31 Auto merge of #15532 - SomeoneToIgnore:more-brackets-on-type-formatting, r=Veykril
On type format '(', by adding closing ')' automatically

If I understand right, `()` can surround pretty much the same `{}` can, so add another on type formatting pair for convenience: sometimes it's not that pleasant to write parenthesis in `Some(2).map(|i| (i, i+1))` cases and I would prefer r-a to do that for me.

One note: currently, b06503b6ec/crates/rust-analyzer/src/handlers/request.rs (L357) fires always.
Should we remove the assertion entirely now, since apparently things work in release despite that check?
2023-09-06 20:32:04 +00:00
bors
5906c26e85 Auto merge of #15565 - Veykril:mir, r=Veykril
Implement `write_via_move` intrinsic for mir-eval

Required for getting `write!`ing to work again. we fail with an odd type mimsatch eval error after this change though
2023-09-06 20:12:48 +00:00
Lukas Wirth
f13b184eb3 Implement write_via_move intrinsic for mir-eval 2023-09-06 21:49:16 +02:00
David Barsky
42f77f89ff internal: use current subcrate's rustfmt.toml with all rustfmt configurations 2023-09-06 15:32:38 -04:00
bors
f29867bd26 Auto merge of #15559 - Veykril:builtin-format-args, r=Veykril
Implement builtin#format_args, using rustc's format_args parser

`format_args!` now expands to `builtin#format_args(template, args...)`, the actual expansion now instead happens in lowering where we desugar this expression by using lang paths.

As a bonus, we no longer need to evaluate `format_args` as an eager macro which means less macro expansions overall -> less cache thrashing!

Fixes https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-06 17:44:33 +00:00
Lukas Wirth
96f19231d3 Fix hir pretty printing emitting trailing whitespace 2023-09-06 19:31:48 +02:00
Lukas Wirth
5046889f43 Don't allocate the format_args template string as an expression 2023-09-06 19:18:12 +02:00
Lukas Wirth
3fa0bf0dd3 Fix ide-diagnostics test fixture 2023-09-06 18:31:16 +02:00
Lukas Wirth
c0e402637e Emit builtin#format_args in builtin format_args expander 2023-09-06 18:08:20 +02:00
Lukas Wirth
5fdd1e36e3 Remove todo!()s 2023-09-06 15:30:44 +02:00
Lukas Wirth
e243a03da1 Desugar builtin#format_args 2023-09-06 15:21:41 +02:00
bors
b9a9722bda Auto merge of #15556 - gigaroby:master, r=lnicola
Update notify to 6.1.1

Unlike version 6.0.1, this does not pull windows-sys 0.45.0 as observed in #15077.

```
$ cargo tree --target=x86_64-pc-windows-gnu --charset=ascii | grep windows-sys

|           |   `-- windows-sys v0.42.0
|   |   |   |   |   |       `-- windows-sys v0.42.0 (*)
|       `-- windows-sys v0.48.0
    |   |   `-- windows-sys v0.48.0 (*)
    |   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.42.0 (*)
```
2023-09-05 20:01:54 +00:00
Lukas Wirth
abe8f1ece4 Implement builtin#format_args, using rustc's format_args parser 2023-09-05 19:19:46 +02:00
bors
caeea45999 Auto merge of #15557 - Veykril:builtin-syntax, r=Veykril
Parse builtin# syntax and add typechecking for builtin#offset_of expression

Also removes box syntax, fixes https://github.com/rust-lang/rust-analyzer/issues/14504

cc https://github.com/rust-lang/compiler-team/issues/580 https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-05 12:10:31 +00:00
Lukas Wirth
3431d586e5 Insert builtin#asm into asm! expansion 2023-09-05 14:00:49 +02:00
Lukas Wirth
15048304e3 Implement offset_of in hir-def and hir-ty 2023-09-05 12:27:52 +02:00
Lukas Wirth
9b8eb807a3 Parse builtin# syntax 2023-09-05 10:36:35 +02:00
Roberto Bampi
4f22e1a187 Update notify to 6.1.1
Unlike version 6.0.1, this does not pull windows-sys 0.4.5 as observed in #15077.

$ cargo tree --target=x86_64-pc-windows-gnu --charset=ascii | grep windows-sys

|           |   `-- windows-sys v0.42.0
|   |   |   |   |   |       `-- windows-sys v0.42.0 (*)
|       `-- windows-sys v0.48.0
    |   |   `-- windows-sys v0.48.0 (*)
    |   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.42.0 (*)
2023-09-04 18:00:12 +02:00
bors
99686d56a8 Auto merge of #15551 - Veykril:docs, r=Veykril
Move doc comment handling into ide-db
2023-09-02 15:28:07 +00:00
Lukas Wirth
81f0108067 Remove markdown module from rust-analyzer crate 2023-09-02 17:27:52 +02:00
Lukas Wirth
8eddc64f86 Simplify 2023-09-02 17:12:57 +02:00
Lukas Wirth
b1575528c0 Move doc comment handling into ide-db 2023-09-02 16:27:26 +02:00
bors
0e002fe5c6 Auto merge of #15549 - Veykril:unwind-if-cancelled, r=Veykril
Add a few more `db.unwind_if_cancelled()` calls

Judging from a profile sent by a friend, the borrowck query took up a significant amount of time in their project which might be the cause for some unresponsiveness as nothing in the mir stack currently unwinds on cancellation
2023-09-02 12:40:44 +00:00
Lukas Wirth
0bf0563a00 Add a few more db.unwind_if_cancelled() calls 2023-09-02 14:39:19 +02:00
bors
8a29d0776f Auto merge of #15548 - Veykril:r-a-restructure, r=Veykril
Restructure some modules in rust-analyzer crate
2023-09-02 12:22:06 +00:00
Lukas Wirth
2dbc7e3e1a Restructure some modules in rust-analyzer crate 2023-09-02 14:16:04 +02:00
cui fliter
056b6b9416 remove the repetitive word
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-09-02 14:18:10 +08:00
bors
60182f7043 Auto merge of #15544 - Veykril:locks, r=Veykril
Shuffle some locking around

The main thread is still occasionally blocking on something and I am unsure what the cause might be. This will hopefully help somewhat
2023-09-01 19:55:03 +00:00
Lukas Wirth
c19390992c Reduce semantic token cache lock scopes 2023-09-01 21:54:29 +02:00
Kirill Bulatov
da786170f8 Use proper assertion in on-type formatting edits
Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
2023-09-01 21:49:51 +03:00
Kirill Bulatov
0f1cde709a On type format '(', by adding closing ')' automatically 2023-09-01 21:49:50 +03:00
Lukas Wirth
cc8b78601d Shuffle some locking around 2023-09-01 20:45:46 +02:00
bors
074c66882f Auto merge of #15543 - Veykril:less-alloc, r=Veykril
Remove some allocations in borrowck
2023-09-01 18:28:42 +00:00
Lukas Wirth
70e21dc30b Remove some allocations in borrowck 2023-09-01 19:17:57 +02:00
bors
ce650ce19d Auto merge of #15542 - Veykril:std-once, r=Veykril
Less `once_cell` more `std`
2023-09-01 16:05:24 +00:00
Lukas Wirth
c09f175d59 Less once_cell more std 2023-09-01 17:30:59 +02:00