Commit graph

24951 commits

Author SHA1 Message Date
bors
2fdd1ac510 Auto merge of #14664 - HKalbasi:mir, r=HKalbasi
MIR episode 4

In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet).

In evaluating, it now can evaluate associated constants in traits (so now typenum's `U5::ToConst` should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in #14275. I also added a `Interpret` code lens to `Run` and `Debug` when the experimental `interpret tests` is enabled (previously it showed result in hover, which was unusable even for debugging)

Changes in unrelated files are:
* Changes substitutions of closures, now it includes parent substs ~~before~~ after `sig_ty`.
* ~~A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.~~
* Normalizing associated types in layout computing
2023-05-01 20:48:50 +00:00
hkalbasi
6312fbf521 MIR episode 4 2023-05-01 23:23:10 +03:30
bors
001607fdb4 Auto merge of #14697 - cuishuang:master, r=lnicola
fix some typos
2023-05-01 07:14:16 +00:00
cui fliter
41632fac86 fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-01 14:53:25 +08:00
bors
3a27518fee Auto merge of #14690 - HKalbasi:closure-hover, r=HKalbasi
Add hover for closure
2023-04-30 20:35:15 +00:00
hkalbasi
5df545b3f0 Add hover for closure 2023-04-30 14:31:43 +03:30
bors
7bcb4c2ef2 Auto merge of #14689 - Veykril:patch-vscode-paths, r=Veykril
fix: Force InitializeParams windows path drives to uppercase

Should fix https://github.com/rust-lang/rust-analyzer/issues/14683
cc `@jyn514`
2023-04-29 18:14:42 +00:00
Lukas Wirth
1edcefb685 fix: Force InitializeParams windows path drives to uppercase 2023-04-29 20:14:17 +02:00
bors
83cc5ef4c1 Auto merge of #14686 - matklad:matklad/angry-chain, r=Veykril
fix: don't wavy-underline iterator chains
2023-04-29 16:35:37 +00:00
Aleksey Kladov
f3de9d8f54 fix: don't wavy-underline iterator chains 2023-04-29 17:31:53 +01:00
bors
07e535b6df Auto merge of #14682 - wackbyte:grammar, r=lnicola
fix grammar
2023-04-29 06:29:11 +00:00
wackbyte
01c59812ae
fix grammar 2023-04-28 23:04:08 -04:00
bors
370b72c7dd Auto merge of #14678 - Veykril:restart-server, r=Veykril
fix: Fix restart server button trying to start instead of restart the server
2023-04-28 19:35:05 +00:00
Lukas Wirth
cf8f13b531 fix: Fix restart server button trying to start instead of restart the server 2023-04-28 21:34:31 +02:00
bors
3ad835faa9 Auto merge of #14671 - Veykril:proc-macro-srv-conf, r=Veykril
fix: Fix proc-macro-srv path config not working
2023-04-28 19:18:14 +00:00
Lukas Wirth
3b97978c49 fix: Fix proc-macro-srv path config not working 2023-04-28 21:17:18 +02:00
bors
62c81d6293 Auto merge of #14672 - whentojump:patch-1, r=lnicola
minor: fix typos
2023-04-28 10:58:13 +00:00
wtj
c533ac3573 minor: fix typos 2023-04-28 18:49:05 +08:00
bors
237ffa3997 Auto merge of #14667 - unexge:nested-types-in-unwrap-result-type, r=HKalbasi
Handle nested types in `unwrap_result_return_type` assist

Fixes https://github.com/rust-lang/rust-analyzer/issues/14496
2023-04-27 06:38:36 +00:00
unexge
a2ab7ee3bd Address code review comments 2023-04-27 03:03:13 +01:00
unexge
734fe66f71 Handle nested types in unwrap_result_return_type assist 2023-04-26 22:07:06 +01:00
bors
797c2f1dde Auto merge of #14659 - Veykril:dedup-crates, r=Veykril
Deduplicate crates when extending crate graphs

This is quadratic in runtime per deduplication attempt, but I don't think that'll be a problem for the workload here. Don't be scared of the diff, the actual diff is +42 -22, the rest is tests and test data.
Fixes https://github.com/rust-lang/rust-analyzer/issues/14476
2023-04-26 09:44:27 +00:00
Lukas Wirth
968850d7bf Deduplicate crates when extending crate graphs 2023-04-26 11:44:11 +02:00
bors
e68e47ffd8 Auto merge of #14658 - Veykril:proc-macro-ra-srv, r=Veykril
Remove proc-macro server command from the rust-analyzer binary

We dropped support for concrete proc-macro abi versions so this no longer serves any purposes.
2023-04-26 08:20:36 +00:00
Lukas Wirth
c21860bd6a Remove proc-macro server command from the rust-analyzer binary 2023-04-26 08:19:28 +02:00
bors
943d2a8a1c Auto merge of #14642 - jakhh8:master, r=Veykril
minor: Use `CargoConfig.extra_args` for fetching metadata

Fixes #14510
2023-04-25 12:46:29 +00:00
bors
59fcd00447 Auto merge of #14657 - rust-lang:revert-14475-crate-origins, r=Veykril
Revert "Handle dev-dependency cycles"

Reverts rust-lang/rust-analyzer#14475

I managed to fix the problem that causes the metric failures, but this still severely degrades IDE features in a way that makes the user experience ***worse*** than before. I am not sure how to address this, I wonder what the jetbrains plugin is doing in these cases.
2023-04-25 12:30:51 +00:00
Lukas Wirth
10d7d7304b
Revert "Handle dev-dependency cycles" 2023-04-25 14:29:26 +02:00
bors
a96bb452a7 Auto merge of #14475 - Veykril:crate-origins, r=Veykril
Handle dev-dependency cycles

cc https://github.com/rust-lang/rust-analyzer/issues/14167

This should fix cycles errors mostly (it fixes the one on rome/tools at least, but not on rustc. Though  there it might just be because of rustc workspace being rustc workspace). Unfortunately this will effectively duplicate all crates currently, since if we want to be completely correct we'd need to set the test cfg for all dev dependencies and the transitive dependencies of those, something I worry we should try to avoid.
2023-04-25 10:07:25 +00:00
Lukas Wirth
e205af259d Prefer test duped crates for ide features 2023-04-25 11:39:58 +02:00
bors
e46d7a030f Auto merge of #14651 - Veykril:workspace-vscode-fix, r=Veykril
fix: Fix vscode workspaces not working properly

Fixes https://github.com/rust-lang/rust-analyzer/issues/14571
2023-04-25 09:09:31 +00:00
Lukas Wirth
a4c7a87755 Handle dev-dependency cycles 2023-04-25 10:57:25 +02:00
Lukas Wirth
980c75bc91 Add more complex project-model test 2023-04-25 10:49:48 +02:00
Lukas Wirth
49fcd4edda fix: Fix vscode workspaces not working properly 2023-04-25 10:47:33 +02:00
bors
6f10ddc122 Auto merge of #14654 - Veykril:status-fix, r=Veykril
fix: Fix status command panicking when additional LRU caches are set up
2023-04-25 08:42:25 +00:00
Lukas Wirth
e8f5d7620f fix: Fix status command panicking when additional LRU caches are set up 2023-04-25 10:41:05 +02:00
bors
707382c21d Auto merge of #14652 - Veykril:pat2021, r=Veykril
fix: Fix pat fragment handling in 2021 edition

Fixes https://github.com/rust-lang/rust-analyzer/issues/9055

The fix isn't that great, but we are kind of forced to do it the quick and hacky way right now since std has changed the `matches` macro to make use of this now. And for a proper fix we need to track hygiene for identifiers which is a long way off anyways
2023-04-24 20:36:45 +00:00
Lukas Wirth
d1ca505525 fix: Fix pat fragment handling in 2021 edition 2023-04-24 22:21:37 +02:00
bors
0c0025f4cd Auto merge of #14647 - whentojump:patch-1, r=Veykril
fix: remove extra argument "rustc"

Two extra "rustc"s were accidentally introduced [here](33591cd3f4 (diff-53e4b6b2c1ff2465d8abd50db160753199426fd788ddcad925752e0838e28de2R156-R169)). (I guess because `cmd` is sometimes initialized with a `cargo` under the hood, sometimes `rustc`, thus error-prone?)

One of them has been fixed [here](384fa4b84a (diff-35c78d76dfccbcece2c917b1e5b9a8e0951d5e340cf579e5ce4951142e2077d3R32)). This patch fixes the other.
2023-04-24 20:10:07 +00:00
bors
15ef5f5523 Auto merge of #14641 - lowr:fix/obligation-for-value-path, r=Veykril
Register obligations during path inference

Fixes #14635

When we infer path expressions that resolve to some generic item, we need to consider their generic bounds. For example, when we resolve a path `Into::into` to `fn into<?0, ?1>` (note that `?0` is the self type of trait ref), we should register an obligation `?0: Into<?1>` or else their relationship would be lost.

Relevant part in rustc is [`add_required_obligations_with_code()`] that's called in [`instantiate_value_path()`].

[`instantiate_value_path()`]: 3462f79e94/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs (L1052)
[`add_required_obligations_with_code()`]: 3462f79e94/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs (L1411)
2023-04-24 19:56:43 +00:00
bors
65ac9f4602 Auto merge of #14646 - jsoref:patch-1, r=jsoref
Fix readme

https://github.com/rust-lang/rust-analyzer/pull/14577#discussion_r1175611012
2023-04-24 19:42:39 +00:00
Josh Soref
0600ca96b3 Fix readme
https://github.com/rust-lang/rust-analyzer/pull/14577#discussion_r1175611012
2023-04-24 15:39:00 -04:00
bors
3f21b791e9 Auto merge of #14648 - zr40:publish-nightly-vsce-pre-release, r=lnicola
Specify `--pre-release` when publishing vsce nightly

According to https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions, when publishing pre-release versions, `--pre-release` must also be passed in the publish step.

Currently the behavior with and without the flag seems to be the same, but since it's documented to be required, don't rely on this staying that way.

This flag was previously removed in #13020, so this partially reverts that change.
2023-04-24 19:29:05 +00:00
Matthijs van der Vleuten
12cf9b6788 Specify --pre-release when publishing vsce nightly
According to https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions, when publishing pre-release versions, `--pre-release` must also be passed in the publish step.

Currently the behavior with and without the flag seems to be the same, but since it's documented to be required, don't rely on this staying that way.

This flag was previously removed in #13020, so this partially reverts that change.
2023-04-24 21:02:24 +02:00
wtj
59c4cc36c4 fix: remove extra argument "rustc" 2023-04-25 02:46:09 +08:00
bors
8f06f995c5 Auto merge of #14644 - matklad:matklad/diag-adj, r=lnicola
feat: don't wavy-underline the whole for loop
2023-04-24 10:38:27 +00:00
Aleksey Kladov
774575106c feat: don't wavy-underline the whole for loop 2023-04-24 11:31:52 +01:00
jakhh8
62c9d96c67 fix 2023-04-24 10:13:29 +02:00
bors
420a038da9 Auto merge of #14513 - hecatia-elegua:alias-based-completion2, r=Veykril
doc(alias)-based completion round 2

Follow-up on #14433
We can now complete fields, functions and some use/mods.
Flyimports don't behave, I don't really have the time to understand the structure there either.
While reading the flyimport code, I removed one method only used there, the closure-tree was a bit confusing, I can revert that if you want.
2023-04-24 06:34:25 +00:00
bors
b2e6f3a9da Auto merge of #14636 - Veykril:macros, r=Veykril
internal: Remove unnecessary is_derive field from MacroCallKind::Attr
2023-04-24 06:13:18 +00:00