Commit Graph

25908 Commits

Author SHA1 Message Date
Ali Bektas
2a78173ff8 v2 2023-08-16 00:22:08 +02:00
Ali Bektas
94b3481808 Deunwrap generate_derive 2023-08-10 01:46:51 +02:00
bors
b78d69c795 Auto merge of #15422 - Veykril:import-sources, r=Veykril
internal: Record import source IDs

cc https://github.com/rust-lang/rust-analyzer/issues/14079
2023-08-09 15:09:15 +00:00
Lukas Wirth
63aba76735 Remove unnecessary ItemTreeId field in ImportSource 2023-08-09 17:06:52 +02:00
bors
b6ee96c3b5 Auto merge of #15423 - alibektas:deunwrap/convert_named_struct_to_tuple_struct, r=lnicola
internal : Deunwrap convert_named_struct_to_tuple_struct

Replaces `unwrap`s with `?` for the mentioned assist.
2023-08-09 14:52:09 +00:00
Ali Bektas
4e4dda5f59 Deunwrap convert_named_struct_to_tuple_struct 2023-08-09 16:40:23 +02:00
Lukas Wirth
c516dd51e9 Simplify 2023-08-09 15:54:10 +02:00
Lukas Wirth
992b928a93 Record import source IDs 2023-08-09 15:20:42 +02:00
bors
4bed01c36e Auto merge of #15421 - Veykril:workspace-loading, r=Veykril
internal: More error context when failing to invoke the rust toolchain
2023-08-09 12:10:21 +00:00
Lukas Wirth
18b24f60d0 More error context when failing to invoke the rust toolchain 2023-08-09 14:09:37 +02:00
bors
fc2f90e0e5 Auto merge of #15419 - HKalbasi:mir, r=HKalbasi
Add mir lower support for tuple destructing assignment

And some other changes in mir eval
2023-08-08 21:02:57 +00:00
hkalbasi
021802c59c Support enum in memory map patch address 2023-08-09 00:27:23 +03:30
bors
ddbbd6a7e7 Auto merge of #15417 - lowr:patch/purge-generic-arg-data-in-expr, r=HKalbasi
internal: use `Cast::cast()` instead of explicit interning

I firmly believe that we should generally use `cast()` instead of interning `GenericArgData` to construct `GenericArg` because it's less verbose and more readable.
2023-08-08 19:27:18 +00:00
bors
e13fac379e Auto merge of #15262 - adamse:master, r=HKalbasi
add check.ignore to list cargo check diagnostics to ignore (dead_code, unused_imports, ...)

fixes #14798
2023-08-08 18:49:45 +00:00
bors
6918eb6ebd Auto merge of #15416 - oxalica:fix/hover-assoc-type, r=lowr
Display fully qualified associated types correctly

Currently they are formatted in the internal `Trait<Self = Type>::Assoc` forms where `hir_ty::TypeRef` is formatted, like hover.

There is no test of `TypeRef::hir_fmt` in crate `hir-ty` (verified by replacing it with a `panic!()`), most tests are about inference and printing the real `Ty` instead of `TypeRef`. So I added the test in `ide::hover`.
2023-08-08 16:42:39 +00:00
oxalica
3bfe1d5d78
Display fully qualified associated types correctly
Currently they are formatted in the internal `Trait<Self = Type>::Assoc`
forms where `hir_ty::TypeRef` is formatted, like hover.
2023-08-09 00:04:55 +08:00
Ryo Yoshida
6aa03c5d15
Use Cast::cast() instead of interning GenericArgData 2023-08-09 00:47:29 +09:00
bors
af4ba46b40 Auto merge of #15405 - lowr:patch/doc-links-to-fields, r=Veykril
Support doc links that resolve to fields

Fixes #15331

Also removes `Resolver::resolve_module_path_in_trait_assoc_items()` and reimplements it in hir with other `Resolver` methods to decouple things a bit.
2023-08-08 14:13:27 +00:00
bors
783130bd26 Auto merge of #15250 - lowr:fix/extract-fn-no-control-flow-with-tail-expr, r=Veykril
fix: don't use control flow when extracted fn contains tail expr of original fn

Fixes #10113
Fixes #15061
2023-08-08 13:38:49 +00:00
bors
ed4e28b2db Auto merge of #15217 - Sarrus1:fix/unsafe-unwrap, r=Veykril
internal: convert unwrap to except and add a debug log

Remove an unsafe unwrap that can cause crashes if the value is a `SendError`.

This is my first PR on this repo, please let me know if there is anything I can improve or details I can provide.
2023-08-08 13:23:21 +00:00
bors
f98d654ddf Auto merge of #15350 - max-heller:issue-11756, r=Veykril
Handle `#[cfg]`s on generic parameters

Records attributes on generic parameters in the item tree and filters out generic parameters disabled by `#[cfg]`s in `generic_params_query`.

Closes #11756
2023-08-08 13:05:26 +00:00
Charles
02d5c0ac56
chore: convert unwrap to except and add a debug log 2023-08-08 14:55:56 +02:00
bors
44eeaea68b Auto merge of #15415 - Veykril:eager-parser-input, r=Veykril
fix: Fix float parser hack creating empty NameRef tokens

Fixes https://github.com/rust-lang/rust-analyzer/issues/15403
2023-08-08 12:46:32 +00:00
Lukas Wirth
cba39f8553 fix: Fix float parser hack creating empty NameRef tokens 2023-08-08 14:44:33 +02:00
Adam Sandberg Ericsson
9cb1f45e6f add check.ignore to list cargo check diagnostics to ignore (dead_code, unused_imports, ...)
fixes #14798
2023-08-08 14:28:35 +02:00
hkalbasi
31c30933cf Support closure in clone shim 2023-08-08 01:49:34 +03:30
bors
d9e9ca2981 Auto merge of #15409 - lnicola:sync-from-rust, r=lnicola
minor: Sync from downstream
2023-08-07 12:16:59 +00:00
Laurențiu Nicola
0c00198d45 Merge branch 'master' into sync-from-rust 2023-08-07 15:15:59 +03:00
Laurențiu Nicola
aa55ce9567 Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-ra 2023-08-07 12:03:15 +03:00
hkalbasi
b96e4f2f4a Add mir lower support for tuple destructing assignment 2023-08-07 02:12:35 +03:30
bors
baee6b338b Auto merge of #15406 - lowr:fix/panic-missing-impl-self-ty, r=lnicola
Don't provide `generate_default_from_new` when impl self ty is missing

Also don't provide the assist when the `Default` trait can't be found.

Part of #15398
2023-08-06 18:30:09 +00:00
Ryo Yoshida
582917453b
Don't provide generate_default_from_new when impl self ty is missing
Also don't provide the assist when the `Default` trait can't be found.
2023-08-07 03:23:41 +09:00
Ryo Yoshida
0c433c23b1
Support doc links that resolve to fields 2023-08-07 00:59:35 +09:00
hkalbasi
9b636e2326 Support libc::getenv in mir interpreter 2023-08-06 01:46:29 +03:30
bors
70fa270637 Auto merge of #15401 - Veykril:disabled-proc-macro, r=Veykril
internal: Turn unresolved proc macro expansions into missing expressions

Reduces the amount of type related errors one gets when proc macro expansion is disabled.
2023-08-05 18:01:46 +00:00
Lukas Wirth
042be329a7 Turn unresolved proc macro expansions into missing expressions 2023-08-05 20:00:37 +02:00
bors
5e1394eb37 Auto merge of #15397 - lnicola:fallible-generate-delegate-trait, r=lnicola
fix: Remove unwraps from "Generate delegate trait"

Fixes #15388

This is untested and purely mechanical, maybe some of those `unwrap`s actually made sense, but it probably doesn't hurt to avoid them.
2023-08-05 16:24:49 +00:00
Laurențiu Nicola
622b18e579 Remove unwraps from Generate delegate trait 2023-08-05 19:23:56 +03:00
bors
eed86c0d98 Auto merge of #15392 - Wilfred:stopped_color, r=lnicola
Use the warning color when rust-analyzer is stopped

If the rust-analyzer server isn't running, we can't do much. Treat this state as a warning color, so it's more obvious.
2023-08-05 12:20:39 +00:00
Max Heller
50db877bfa optimization and #[cfg] filtering for function generic params 2023-08-05 08:00:39 -04:00
bors
27e2eea54f Auto merge of #15393 - Wilfred:full_moniker_param, r=Veykril
SCIP: Qualify parameters by the containing function

SCIP requires symbols to be unique, but multiple functions may have a parameter with the same name. Qualify parameters according to the containing function.
2023-08-05 08:33:05 +00:00
Wilfred Hughes
edabffbd5a SCIP: Qualify parameters by the containing function
SCIP requires symbols to be unique, but multiple functions may have a
parameter with the same name. Qualify parameters according to the
containing function.
2023-08-04 16:38:31 -07:00
bors
86b6b6f705 Auto merge of #15391 - Wilfred:default_click_action, r=Veykril
Set the default status bar action to openLogs

Previously, clicking 'rust-analyzer' would stop the server entirely. This was easy to do accidentally, and then the user has to wait for the server to start up again.
2023-08-04 20:05:01 +00:00
Wilfred Hughes
253d68459d Use the warning color when rust-analyzer is stopped
If the rust-analyzer server isn't running, we can't do much. Treat
this state as a warning color, so it's more obvious.
2023-08-04 11:07:22 -07:00
Wilfred Hughes
1e76b11a20 Set the default status bar action to openLogs
Previously, clicking 'rust-analyzer' would stop the server
entirely. This was easy to do accidentally, and then the user has to
wait for the server to start up again.
2023-08-04 11:03:41 -07:00
bors
c59bd2dc3f Auto merge of #15390 - HKalbasi:mir, r=HKalbasi
Improve mir interpreter performance by caching
2023-08-04 13:17:34 +00:00
hkalbasi
cc5664c5a2 Add rustc comment into while desugaring 2023-08-04 16:35:13 +03:30
hkalbasi
3115d6988f Improve mir interpreter performance by caching 2023-08-04 16:05:54 +03:30
bors
e37ec7262c Auto merge of #15373 - tadeokondrak:desugar-while-to-loop, r=HKalbasi
internal: Desugar while to loop and break

I was reading through rust-analyzer's code and was wondering why this wasn't desugared into a loop.
2023-08-04 07:26:18 +00:00
bors
d398ad3326 Auto merge of #15380 - HKalbasi:mir, r=HKalbasi
Fix unsized struct problems in mir eval
2023-08-02 14:28:41 +00:00