Commit graph

27406 commits

Author SHA1 Message Date
bors
e9d3565cd1 Auto merge of #16502 - davidsemakula:unnecessary-else-diagnostic, r=Veykril
feat: Add "unnecessary else" diagnostic and fix

Fixes #9457
2024-02-08 14:25:00 +00:00
bors
82674e21be Auto merge of #16454 - Veykril:break-return-postfix, r=Veykril
feat: Add break and return postfix keyword completions
2024-02-08 14:09:04 +00:00
Lukas Wirth
ddddc9c0e2 Update test outputs 2024-02-08 14:57:21 +01:00
bors
ddf26113fc Auto merge of #16462 - Veykril:proc-error, r=Veykril
Better error message for when proc-macros have not yet been built

Closes https://github.com/rust-lang/rust-analyzer/issues/16331
2024-02-08 13:56:58 +00:00
Lukas Wirth
15bffe25bd feat: Add break and return postfix keyword completions 2024-02-08 14:56:10 +01:00
Lukas Wirth
545382db25 Fix warnings 2024-02-08 14:54:52 +01:00
Lukas Wirth
91dab4d720 Better error message for when proc-macros have not yet been built 2024-02-08 14:53:12 +01:00
Lukas Wirth
4bf6b160a9 Fix incorrect range uses in missing_fields quick fixes 2024-02-08 14:53:11 +01:00
bors
6655960186 Auto merge of #16134 - tvallotton:master, r=Veykril
fix: waker_getters tracking issue from 87021 for 96992.

I was directed to make the fix here by this comment https://github.com/rust-lang/rust/pull/118960#issuecomment-1857888974.
2024-02-08 10:28:45 +00:00
bors
5c80ad05ae Auto merge of #16124 - ohno418:call-expr-missing-arg, r=Veykril
fix: Recover from missing argument in call expressions

Previously, when parsing an argument list with a missing argument (e.g., `(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected token (at the second comma in the example), resulting in an incorrect parse tree.

This commit improves error handling in such cases, ensuring a more accurate parse tree is built.

---

Fixes https://github.com/rust-lang/rust-analyzer/issues/15683.
2024-02-08 10:16:36 +00:00
Lukas Wirth
974e69b0c5 Recover from missing slots in delimited parsing 2024-02-08 11:14:37 +01:00
Yutaro Ohno
e865d45904 fix: Recover from missing argument in call expressions
Previously, when parsing an argument list with a missing argument (e.g.,
`(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected
token (at the second comma in the example), resulting in an incorrect
parse tree.

This commit improves error handling in such cases, ensuring a more
accurate parse tree is built.
2024-02-08 10:54:04 +01:00
bors
ae89522928 Auto merge of #16510 - Veykril:single-package-check, r=Veykril
feat: Allow cargo check to run on only the current package

cc https://github.com/rust-lang/rust-analyzer/pull/13336, https://github.com/rust-lang/rust-analyzer/issues/12882
2024-02-08 09:43:16 +00:00
Lukas Wirth
0258f60cfe feat: Allow cargo check to run on only the current package 2024-02-08 10:40:42 +01:00
bors
bcc8a09a0d Auto merge of #16509 - Veykril:hover-tuple-struct, r=Veykril
fix: Fix tuple structs not rendering visibility in their fields

Fixes https://github.com/rust-lang/rust-analyzer/issues/16508
2024-02-08 09:06:53 +00:00
Lukas Wirth
81ea48a573 fix: Fix tuple structs not rendering visibility in their fields 2024-02-08 10:05:28 +01:00
bors
c48f145535 Auto merge of #16507 - clubby789:remove-ffi_returns_twice, r=lnicola
Remove `ffi_returns_twice` references

This feature has just been [removed](https://github.com/rust-lang/rust/pull/120502)
2024-02-07 19:47:45 +00:00
clubby789
79e4111442 Remove ffi_returns_twice references 2024-02-07 19:42:07 +00:00
bors
ca44e1ee9f Auto merge of #16506 - lnicola:bump-paths-filter, r=lnicola
minor: bump `paths-filter`

Fixes a Node version warning.
2024-02-07 17:26:44 +00:00
Laurențiu Nicola
aa9bc01824 Bump paths-filter 2024-02-07 19:24:35 +02:00
bors
8628352214 Auto merge of #16505 - Veykril:unit-salsa, r=Veykril
Optimize input queries that take no arguments

There is no point in having a hashmap and extra lock for this, it is always only a single value. This might speed up some things by a tiny bit for our crate graph query.
2024-02-07 17:08:48 +00:00
Lukas Wirth
97cd68097a Optimize input queries that take no arguments 2024-02-07 18:04:02 +01:00
bors
2d2ddd318b Auto merge of #16503 - Veykril:salsa, r=Veykril
Move salsa fork in-tree

No one else is supposed to rely on it anyways, this makes it easier to edit.
2024-02-07 16:20:53 +00:00
Lukas Wirth
3688064ff5 Clippy 2024-02-07 17:08:38 +01:00
Lukas Wirth
731b159f10 Remove dev-dependency diff 2024-02-07 16:34:21 +01:00
Lukas Wirth
e339c65a1a Remove dev-dependency insta 2024-02-07 16:30:20 +01:00
Lukas Wirth
def5a1d0c4 unreachable-pub 2024-02-07 16:30:13 +01:00
Lukas Wirth
bc5823d5bb Bump salsa dev-deps 2024-02-07 16:30:07 +01:00
Lukas Wirth
0a6197df97 rustfmt 2024-02-07 16:30:00 +01:00
Lukas Wirth
159a03ad7b Move salsa fork in-tree 2024-02-07 16:29:46 +01:00
davidsemakula
d7a03022f7 handle divergence in child if expr for unnecessary else diagnostic fix 2024-02-06 19:00:10 +03:00
davidsemakula
62cc4f9c46 add unnecessary else diagnostic 2024-02-06 19:00:10 +03:00
bors
1974e7490d Auto merge of #16501 - lnicola:lete-snippet-docs, r=lnicola
minor: Add `lete` to postfix completion list
2024-02-06 11:15:27 +00:00
Laurențiu Nicola
2c4152847a Add lete to postfix completion list 2024-02-06 13:13:51 +02:00
bors
0dd62c0d59 Auto merge of #16500 - lnicola:clippy-windows, r=lnicola
internal: run Clippy on Windows

CC https://github.com/rust-lang/rust-analyzer/pull/16413#issuecomment-1927592897

![image](https://github.com/rust-lang/rust-analyzer/assets/308347/3bb4c06b-6388-4b1e-81f5-f0c2fbc3302c)
2024-02-06 10:08:45 +00:00
Laurențiu Nicola
32f0a2fc39 Run Clippy on Windows 2024-02-06 11:22:26 +02:00
bors
6671d3c9a3 Auto merge of #16499 - Nadrieril:update-pat-ana, r=lnicola
internal: Update rustc_pattern_analysis dependency

Just bumping the dependency, as I've been making API changes over on the rustc side. More API changes incoming in the coming weeks.

One benefit of this: we no longer abort in the `DeconstructedPat: Debug` impl, which means we can use `tracing` to investigate issues.
2024-02-06 07:04:33 +00:00
bors
64411a4ea3 Auto merge of #16496 - matthiaskrgr:c, r=lnicola
minor: remove clones
2024-02-06 06:47:13 +00:00
Nadrieril
d2d4119d24 Don't need an arena for types anymore 2024-02-06 05:09:30 +01:00
Nadrieril
ba7b12e062 Update rustc_pattern_analysis dependency 2024-02-06 05:08:19 +01:00
Nadrieril
c2d21242aa Tweak variant_id_for_adt 2024-02-06 05:01:05 +01:00
Matthias Krüger
ac9d1a03a7 remove clones 2024-02-05 23:15:47 +01:00
bors
66cec4d11a Auto merge of #16470 - Veykril:clippy-disallow, r=lnicola
internal: Lint debug prints and disallowed types with clippy
2024-02-05 17:20:43 +00:00
bors
cb37fcc616 Auto merge of #16493 - Young-Flash:method_call_parser, r=Veykril
fix: emit parser error for missing argument list

close https://github.com/rust-lang/rust-analyzer/issues/16362
2024-02-05 13:03:03 +00:00
Young-Flash
864c3d5880 test: add method_call_missing_argument_list error test 2024-02-05 17:54:09 +08:00
Young-Flash
c495e3f00f fix: emit parser error for missing argument list 2024-02-05 17:54:09 +08:00
bors
7fb639ffc1 Auto merge of #16482 - GnomedDev:boxed-subtree, r=lnicola
Swap Subtree::token_trees from Vec to boxed slice

Performs one of the optimizations suggested in #16325, but a little bit more. Boxed slices guarantee `shrink_to_fit` aswell as saving a pointer width as no capacity has to be stored.

Most of the diff is:
- Changing `vec![]` to `Box::new([])`
- Changing initialize -> fill into fill -> into_boxed_slice
- Working around the lack of an owned iterator or automatic iteration over a `Box<[T]>`

I would like to use my own crate, [small-fixed-array](https://lib.rs/small-fixed-array), although I understand if it isn't mature enough for this. If I'm given the go ahead, I can rework this PR to use it instead.
2024-02-05 09:14:06 +00:00
bors
3e47532dd4 Auto merge of #16474 - davidbarsky:david/import-on-the-fly-improvements, r=lnicola
internal: even more `tracing`

As part of profiling completions, I added some additional spans and moved `TyBuilder::subst_for_def` closer to its usage site (the latter had a small impact on completion performance. Thanks for the tip, Lukas!)
2024-02-05 09:01:58 +00:00
bors
081cf026b8 Auto merge of #16480 - GnomedDev:remove-unused-visit_ids, r=lnicola
Remove unused Subtree::visit_ids function

Completely unused, nothing else even shows up when searching for `visit_ids`.
2024-02-05 08:49:39 +00:00
bors
06737ec7ff Auto merge of #16492 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
2024-02-05 08:35:11 +00:00