Commit Graph

27485 Commits

Author SHA1 Message Date
bors
9d9b34354d Auto merge of #16389 - davidsemakula:order-use-tree-raw-ident, r=lnicola
internal: properly order raw idents when ordering use trees

Follow up to #16352 to properly order raw identifiers.
2024-01-17 20:23:21 +00:00
davidsemakula
84a3b52a10 properly order raw idents when ordering use trees 2024-01-17 21:46:19 +03:00
bors
a19372f334 Auto merge of #16387 - lnicola:metrics-sysroot, r=Veykril
internal: Fix sysroot metadata in metrics

CC https://github.com/rust-lang/rust-analyzer/pull/16380#issuecomment-1895550254
2024-01-17 17:30:52 +00:00
Laurențiu Nicola
27b0636745 Fix sysroot metadata in metrics 2024-01-17 19:16:32 +02:00
Lukas Wirth
83591268ab minor: Make use of some new SmolStr improvements 2024-01-17 13:47:15 +01:00
bors
5b62ebc23f Auto merge of #16383 - Veykril:progress, r=Veykril
fix: Fix progress reporting getting stuck

Fixes https://github.com/rust-lang/rust-analyzer/issues/16382
2024-01-17 12:24:43 +00:00
Lukas Wirth
0bdbf497b6 fix: Fix progress reporting getting stuck 2024-01-17 13:23:00 +01:00
bors
c820980648 Auto merge of #16314 - Urhengulas:macro_rule-as-macro-name, r=Veykril
`macro_rules` as macro name

This PR makes RA parse `macro_rules! {}` (note the missing identifier) as a `MACRO_CALL` instead of `MACRO_RULES`.

Fixes #15969.
2024-01-17 12:04:14 +00:00
Johann Hemmann
76c67dd229 Fix test 2024-01-17 12:49:58 +01:00
Johann Hemmann
5916da2c29 Handle macro_rules! as MACRO_CALL
It's a call of the third token is neither IDENT or TRY
2024-01-17 12:07:17 +01:00
bors
2b02df27c5 Auto merge of #16380 - Veykril:sysroot-ci, r=Veykril
Run metadata on sysroot for CI metrics
2024-01-17 09:33:14 +00:00
bors
f4fec4ff65 Auto merge of #16378 - roife:fix/issue-15470, r=Veykril
fix: better handling of SelfParam in assist 'inline_call'

fix #15470.

The current `inline_call` directly translates `&self` into `let ref this = ...;` and `&mut self` into `let ref mut this = ...;`. However, it does not handle some complex scenarios.

This PR addresses the following transformations (assuming the receiving object is `obj`):

- `self`: `let this = obj`
- `mut self`: `let mut this = obj`
- `&self`: `let this = &obj`
- `&mut self`
  + If `obj` is `let mut obj = ...`, use a mutable reference: `let this = &mut obj`
  + If `obj` is `let obj = &mut ...;`, perform a reborrow: `let this = &mut *obj`
2024-01-17 08:43:13 +00:00
Lukas Wirth
21723cb051 Run metadata on sysroot for CI metrics 2024-01-17 09:43:04 +01:00
roife
920e99aacb test: add tests for variant kinds of SelfParam in inline_call 2024-01-17 14:19:57 +08:00
roife
d48498f360 fix: better handling of SelfParam in inline_call 2024-01-17 13:49:07 +08:00
bors
03336460fc Auto merge of #16375 - Veykril:hover-notable, r=Veykril
feat: Goto type actions for notable trait hovers

Follow up to https://github.com/rust-lang/rust-analyzer/pull/16374
2024-01-16 19:18:56 +00:00
Lukas Wirth
0a75a8c061 Notable traits for type info hovers 2024-01-16 20:15:31 +01:00
Lukas Wirth
ffeaee84af Goto type actions for notable trait hovers 2024-01-16 19:59:55 +01:00
bors
7777a81b69 Auto merge of #16374 - Veykril:hover-notable, r=Veykril
feat: Show notable trait impls on hover
2024-01-16 18:18:52 +00:00
Lukas Wirth
82e8355492 feat: Show notable trait impls on hover 2024-01-16 19:17:33 +01:00
roife
7c94c29648 fix: make let_stmts inserted in inline_call correctly indented 2024-01-16 21:42:29 +08:00
bors
e2df3f2ad6 Auto merge of #16370 - Veykril:hover-lit, r=Veykril
feat: Hover for literals showing additional value information
2024-01-16 13:30:11 +00:00
Lukas Wirth
384488c157 feat: Hover for literals showing additional value information 2024-01-16 14:28:47 +01:00
bors
e7a8d21a52 Auto merge of #16369 - Veykril:simplify, r=Veykril
minor: Simplify
2024-01-16 12:37:47 +00:00
Lukas Wirth
6584e63506 minor: Simplify 2024-01-16 13:36:07 +01:00
bors
0a8c7841e0 Auto merge of #16352 - davidsemakula:rustfmt-import-sort-algo, r=Veykril
internal: Follow rustfmt's algorithm for ordering imports when ordering and merging use trees

Updates use tree ordering and merging utilities to follow rustfmt's algorithm for ordering imports.
The [rustfmt implementation](6356fca675/src/imports.rs) was used as reference.
2024-01-16 11:23:03 +00:00
bors
63c4e6993f Auto merge of #16367 - Veykril:value-ty, r=Veykril
fix: Make `value_ty` query fallible
2024-01-16 11:11:31 +00:00
Lukas Wirth
8f4f5a6cce fix: Make value_ty query fallible 2024-01-16 12:09:40 +01:00
davidsemakula
1f91c487a2 move is_upper_snake_case to stdx 2024-01-16 13:37:22 +03:00
davidsemakula
5b2a2bc3fb remove unnecessary ref patterns 2024-01-16 13:26:49 +03:00
bors
2d5ce888de Auto merge of #16366 - Veykril:transp-queries, r=Veykril
internal: Make data queries transparent over their diagnostics variant

And a few other QoL things
2024-01-16 10:09:05 +00:00
Lukas Wirth
35e05e07fb Bump smol_str 2024-01-16 11:07:45 +01:00
Lukas Wirth
f675b5ead8 Don't early exit on panics in rustc_tests command 2024-01-16 11:05:50 +01:00
Lukas Wirth
54f2111f69 internal: Make data queries transparent over their diagnostics variant 2024-01-16 10:47:54 +01:00
Lukas Wirth
90a1b484f7 Render AstIds in item-tree view 2024-01-16 10:47:28 +01:00
Lukas Wirth
cf905cff76 Put layout comment to the top of hovers 2024-01-16 10:46:53 +01:00
Lukas Wirth
659d4f91e4 Impl fmt::Display for Span 2024-01-16 10:46:09 +01:00
bors
c9afd41219 Auto merge of #15636 - 9999years:show-which-roots-are-scanned, r=Veykril
Show which roots are being scanned in progress messages

This changes the `Roots Scanned` message to include the directory being scanned.

Before: `Roots Scanned 206/210 (98%)`
After: `Roots Scanned 206/210: .direnv (98%)`

This makes it a lot easier to tell that `rust-analyzer` isn't crashed, it's just trying to scan a huge directory.

See: #12613
2024-01-16 09:44:56 +00:00
Lukas Wirth
398150827f Rename Message::Progress::file field to dir 2024-01-16 10:43:33 +01:00
bors
87e609aa9c Auto merge of #15868 - wasd96040501:fix/symlink2, r=Veykril
fix: failed to infer OUT_DIR when workspace root contains symlink

fix #15867
2024-01-16 09:23:54 +00:00
bors
18abb126a3 Auto merge of #16350 - roife:neon-support-for-line-index, r=Veykril
internal: Speedup line index calculation via NEON for aarch64

This commit provides SIMD acceleration (via NEON) for `line-index` library on aarch64 architecture, which improves performance for Apple Silicon users (and potentially for future aarch64-based chips).

The algorithm used here follows the same process as the original implementation using SSE2. Most of the vector instructions in SSE2 have corresponding parts in neon. The only issue is that there is no corresponding instruction for `_mm_movemask_epi8` in neon. To address this problem, I referred to the article at https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon.
2024-01-16 09:12:10 +00:00
bors
5df53c9612 Auto merge of #16351 - Veykril:eager-enum-variant, r=Veykril
internal: Eagerly lower enum variants in CrateDefMap construction
2024-01-16 08:39:13 +00:00
bors
4de8954c45 Auto merge of #16196 - mohe2015:rename-generator-to-coroutine, r=Veykril
Rename generator to coroutine

Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html)

This makes it much easier to test code with the nightly compiler.
2024-01-16 08:25:07 +00:00
bors
b9fd12b9ac Auto merge of #16364 - lnicola:sync-from-rust, r=lnicola
internal: sync from downstream
2024-01-16 06:50:07 +00:00
Laurențiu Nicola
a2aee95ce3 Merge remote-tracking branch 'upstream/master' into sync-from-rust 2024-01-16 08:48:23 +02:00
Laurențiu Nicola
ff7151362b Merge branch 'master' into sync-from-rust 2024-01-16 08:48:08 +02:00
Moritz Hedtke
fe35447617 fix: rename generator to coroutine also in dependencies
Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html)
2024-01-15 12:24:48 +01:00
Moritz Hedtke
f937673ce2 fix: rename generator to coroutine
Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html)
2024-01-15 12:24:47 +01:00
Moritz Hedtke
a356172f92 internal: re-generate lints.rs 2024-01-15 12:24:47 +01:00
Lukas Wirth
180e9b2bbf Cleanup 2024-01-15 12:22:51 +01:00