]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoAuto merge of #12732 - lnicola:bump-npm, r=lnicola
bors [Sat, 9 Jul 2022 20:26:32 +0000 (20:26 +0000)]
Auto merge of #12732 - lnicola:bump-npm, r=lnicola

Bump npm deps

23 months agoBump transitive npm deps
Laurențiu Nicola [Sat, 9 Jul 2022 20:20:06 +0000 (23:20 +0300)]
Bump transitive npm deps

23 months agoBump @vscode/test-electron
Laurențiu Nicola [Sat, 9 Jul 2022 20:17:56 +0000 (23:17 +0300)]
Bump @vscode/test-electron

23 months agoBump @types/node to 16
Laurențiu Nicola [Sat, 9 Jul 2022 20:17:12 +0000 (23:17 +0300)]
Bump @types/node to 16

23 months agoBump typescript and tslib
Laurențiu Nicola [Sat, 9 Jul 2022 20:14:17 +0000 (23:14 +0300)]
Bump typescript and tslib

23 months agoBump prettier
Laurențiu Nicola [Sat, 9 Jul 2022 20:10:39 +0000 (23:10 +0300)]
Bump prettier

23 months agoBump @typescript-eslint
Laurențiu Nicola [Sat, 9 Jul 2022 20:10:07 +0000 (23:10 +0300)]
Bump @typescript-eslint

23 months agoBump vsce
Laurențiu Nicola [Sat, 9 Jul 2022 20:08:59 +0000 (23:08 +0300)]
Bump vsce

23 months agoBump eslint
Laurențiu Nicola [Sat, 9 Jul 2022 20:07:31 +0000 (23:07 +0300)]
Bump eslint

23 months agoBump esbuild
Laurențiu Nicola [Sat, 9 Jul 2022 20:06:45 +0000 (23:06 +0300)]
Bump esbuild

23 months agoBump d3 and d3-graphviz
Laurențiu Nicola [Sat, 9 Jul 2022 20:06:06 +0000 (23:06 +0300)]
Bump d3 and d3-graphviz

23 months agoBump vscode-languageclient
Laurențiu Nicola [Sat, 9 Jul 2022 20:04:14 +0000 (23:04 +0300)]
Bump vscode-languageclient

23 months agoAuto merge of #12727 - DorianListens:dscheidt/extract-var-field-name, r=jonas-schievink
bors [Sat, 9 Jul 2022 13:08:57 +0000 (13:08 +0000)]
Auto merge of #12727 - DorianListens:dscheidt/extract-var-field-name, r=jonas-schievink

fix: Improve suggested names for extracted variables

When extracting a field expression, if RA was unable to resolve the type of the
field, we would previously fall back to using "var_name" as the variable name.

Now, when the `Expr` being extracted matches a `FieldExpr`, we can use the
`NameRef`'s ident token as a fallback option.

fixes #10035

23 months agofix: Improve suggested names for extracted variables
Dorian Scheidt [Fri, 8 Jul 2022 23:01:44 +0000 (18:01 -0500)]
fix: Improve suggested names for extracted variables

When extracting a field expression, if RA was unable to resolve the type of the
field, we would previously fall back to using "var_name" as the variable name.

Now, when the `Expr` being extracted matches a `FieldExpr`, we can use the
`NameRef`'s ident token as a fallback option.

fixes #10035

23 months agoAuto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianListens
bors [Fri, 8 Jul 2022 15:02:02 +0000 (15:02 +0000)]
Auto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianListens

fix: Extract Function misses locals used in closures

This change fixes #12705.

In `FunctionBody::analyze`, we need to search any `ClosureExpr`s we encounter
for any `NameRef`s, to ensure they aren't missed.

23 months agofix: Extract Function misses locals used in closures
Dorian Scheidt [Wed, 6 Jul 2022 23:25:05 +0000 (18:25 -0500)]
fix: Extract Function misses locals used in closures

This change fixes #12705.

In `FunctionBody::analyze`, we need to search any `ClosureExpr`s we encounter
for any `NameRef`s, to ensure they aren't missed.

23 months agoAuto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-schievink
bors [Fri, 8 Jul 2022 14:10:19 +0000 (14:10 +0000)]
Auto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-schievink

Remove unnecessary unsafe from format_args expansion

23 months agoAuto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl, r=jonas-schievink
bors [Fri, 8 Jul 2022 14:01:36 +0000 (14:01 +0000)]
Auto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl, r=jonas-schievink

fix: Extract function from trait impl

This change fixes #10036, "Extract to function assist implements nonexistent
trait methods".

When we detect that the extraction is coming from within a trait impl, and that
a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`,
and create a new empty `impl` block for the newly extracted function.

23 months agoAuto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink
bors [Fri, 8 Jul 2022 13:50:20 +0000 (13:50 +0000)]
Auto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink

internal: Update remaining GitHub URLs

The old links still work, but it seems less confusing to have them point to the right repo

23 months agoUpdate remaining GitHub URLs
Jonas Schievink [Fri, 8 Jul 2022 13:44:49 +0000 (15:44 +0200)]
Update remaining GitHub URLs

23 months agoAuto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola
bors [Fri, 8 Jul 2022 05:16:43 +0000 (05:16 +0000)]
Auto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola

publish workflow: Fix names for existing crates

Attempting to publish for example ra_ap_text-edit when ra_ap_text_edit
has already been published is rejected by crates.io.

23 months agoRemove unnecessary unsafe from format_args expansion
David Lattimore [Fri, 8 Jul 2022 04:56:18 +0000 (14:56 +1000)]
Remove unnecessary unsafe from format_args expansion

23 months agopublish workflow: Fix names for existing crates
David Lattimore [Fri, 8 Jul 2022 02:58:13 +0000 (12:58 +1000)]
publish workflow: Fix names for existing crates

Attempting to publish for example ra_ap_text-edit when ra_ap_text_edit
has already been published is rejected by crates.io.

23 months agoAuto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink
bors [Wed, 6 Jul 2022 23:58:52 +0000 (23:58 +0000)]
Auto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink

Complete type param/associated type in trait generic arg per arg index

- Fix #12140
- Also fix tidy check does not work for marks in multiline

23 months agofix default type param value position
Hongxu Xu [Wed, 6 Jul 2022 23:28:55 +0000 (07:28 +0800)]
fix default type param value position

23 months agoAuto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink
bors [Wed, 6 Jul 2022 17:57:00 +0000 (17:57 +0000)]
Auto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink

internal: Use `SmallVec` to slightly shrink `ModPath` size

Saves like a megabyte on r-a itself.

23 months agoUse `SmallVec` to slightly shrink `ModPath` size
Jonas Schievink [Wed, 6 Jul 2022 17:49:05 +0000 (19:49 +0200)]
Use `SmallVec` to slightly shrink `ModPath` size

23 months agocheck arg_idx >= n_params only if arg_idx >= n_required_params
Hongxu Xu [Wed, 6 Jul 2022 16:54:46 +0000 (00:54 +0800)]
check arg_idx >= n_params only if arg_idx >= n_required_params

23 months agoHandle generic args per arg index
Hongxu Xu [Wed, 6 Jul 2022 16:43:59 +0000 (00:43 +0800)]
Handle generic args per arg index
Add more test cases for generic args

23 months agoAuto merge of #12702 - lnicola:vscode-schemes, r=lnicola
bors [Wed, 6 Jul 2022 15:57:34 +0000 (15:57 +0000)]
Auto merge of #12702 - lnicola:vscode-schemes, r=lnicola

internal: use different schemes for the custom views

Related to #12699, but doesn't fix it because we still register the providers multiple times.

23 months agoCode: use different schemes for the custom views
Laurențiu Nicola [Wed, 6 Jul 2022 15:36:42 +0000 (18:36 +0300)]
Code: use different schemes for the custom views

23 months agoShow only assoc type args in the correct arg pos
Hongxu Xu [Wed, 6 Jul 2022 14:58:27 +0000 (22:58 +0800)]
Show only assoc type args in the correct arg pos

23 months agoAuto merge of #12694 - hi-rustin:rustin-patch-bors, r=jonas-schievink
bors [Tue, 5 Jul 2022 13:51:36 +0000 (13:51 +0000)]
Auto merge of #12694 - hi-rustin:rustin-patch-bors, r=jonas-schievink

Remove useless bors.toml

It seems we do not use bors-ng anymore. So maybe this is useless.

23 months agoComplete associated type only in trait generic arg
Hongxu Xu [Tue, 5 Jul 2022 13:48:28 +0000 (21:48 +0800)]
Complete associated type only in trait generic arg
Fix tidy check does not work for marks in multiline

23 months agoFix project root assert
hi-rustin [Tue, 5 Jul 2022 13:18:00 +0000 (21:18 +0800)]
Fix project root assert

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
23 months agoRemove useless bors.toml
hi-rustin [Tue, 5 Jul 2022 13:13:34 +0000 (21:13 +0800)]
Remove useless bors.toml

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
23 months agoAuto merge of #12690 - Veykril:inert-attrs, r=Veykril
bors [Tue, 5 Jul 2022 09:55:55 +0000 (09:55 +0000)]
Auto merge of #12690 - Veykril:inert-attrs, r=Veykril

internal: Update inert attribute list

23 months agointernal: Update inert attribute list
Lukas Wirth [Tue, 5 Jul 2022 09:54:46 +0000 (11:54 +0200)]
internal: Update inert attribute list

23 months agoAuto merge of #12687 - flodiebold:override-docs, r=flodiebold
bors [Mon, 4 Jul 2022 16:59:17 +0000 (16:59 +0000)]
Auto merge of #12687 - flodiebold:override-docs, r=flodiebold

Improve documentation for `buildScripts.overrideCommand` / `checkOnSave.overrideCommand`

23 months agoAdd back restartServerOnConfigChange option
Florian Diebold [Mon, 4 Jul 2022 16:53:55 +0000 (18:53 +0200)]
Add back restartServerOnConfigChange option

23 months agoImprove documentation for buildScripts.overrideCommand / checkOnSave.overrideCommand
Florian Diebold [Mon, 4 Jul 2022 16:45:54 +0000 (18:45 +0200)]
Improve documentation for buildScripts.overrideCommand / checkOnSave.overrideCommand

23 months agoAuto merge of #12681 - lnicola:bump-deps, r=lnicola
bors [Sun, 3 Jul 2022 07:25:03 +0000 (07:25 +0000)]
Auto merge of #12681 - lnicola:bump-deps, r=lnicola

Bump deps

23 months agoBump the rest of the deps
Laurențiu Nicola [Sun, 3 Jul 2022 07:24:07 +0000 (10:24 +0300)]
Bump the rest of the deps

23 months agoBump chalk
Laurențiu Nicola [Sun, 3 Jul 2022 07:22:10 +0000 (10:22 +0300)]
Bump chalk

23 months agoBump object
Laurențiu Nicola [Sun, 3 Jul 2022 07:14:48 +0000 (10:14 +0300)]
Bump object

23 months agoBump tracing-subscriber
Laurențiu Nicola [Sun, 3 Jul 2022 07:12:58 +0000 (10:12 +0300)]
Bump tracing-subscriber

23 months agoBump arbitrary and derive_arbitrary
Laurențiu Nicola [Sun, 3 Jul 2022 07:10:45 +0000 (10:10 +0300)]
Bump arbitrary and derive_arbitrary

23 months agoBump cargo_metadata
Laurențiu Nicola [Sun, 3 Jul 2022 07:08:10 +0000 (10:08 +0300)]
Bump cargo_metadata

23 months agoBump semver
Laurențiu Nicola [Sun, 3 Jul 2022 07:03:55 +0000 (10:03 +0300)]
Bump semver

23 months agoBump indexmap
Laurențiu Nicola [Sun, 3 Jul 2022 07:02:15 +0000 (10:02 +0300)]
Bump indexmap

23 months agoBump serde_json
Laurențiu Nicola [Sun, 3 Jul 2022 07:00:07 +0000 (10:00 +0300)]
Bump serde_json

23 months agoBump serde
Laurențiu Nicola [Sun, 3 Jul 2022 07:00:01 +0000 (10:00 +0300)]
Bump serde

23 months agoBump smallvec
Laurențiu Nicola [Sun, 3 Jul 2022 06:59:10 +0000 (09:59 +0300)]
Bump smallvec

23 months agoBump pulldown-cmark-to-cmark
Laurențiu Nicola [Sun, 3 Jul 2022 06:58:13 +0000 (09:58 +0300)]
Bump pulldown-cmark-to-cmark

23 months agoBump either
Laurențiu Nicola [Sun, 3 Jul 2022 06:42:41 +0000 (09:42 +0300)]
Bump either

23 months agoBump quote
Laurențiu Nicola [Sat, 2 Jul 2022 19:29:06 +0000 (22:29 +0300)]
Bump quote

23 months agoBump anyhow
Laurențiu Nicola [Sat, 2 Jul 2022 19:27:56 +0000 (22:27 +0300)]
Bump anyhow

23 months agoBump crossbeam-channel
Laurențiu Nicola [Sat, 2 Jul 2022 19:27:24 +0000 (22:27 +0300)]
Bump crossbeam-channel

23 months agofix: Extract function from trait impl
Dorian Scheidt [Fri, 1 Jul 2022 20:44:10 +0000 (15:44 -0500)]
fix: Extract function from trait impl

This change fixes #10036, "Extract to function assist implements nonexistent
trait methods".

When we detect that the extraction is coming from within a trait impl, and that
a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`,
and create a new empty `impl` block for the newly extracted function.

23 months agoAuto merge of #12662 - DorianListens:dscheidt/extract-function-duplicate-name, r...
bors [Sat, 2 Jul 2022 19:42:17 +0000 (19:42 +0000)]
Auto merge of #12662 - DorianListens:dscheidt/extract-function-duplicate-name, r=DorianListens

fix: Extract Function produces duplicate fn names

This change fixes #10037, in more or less the most naive fashion
possible.

We continue to start with the hardcoded default of "fun_name", and now append a
counter to the end of it if that name is already in scope.

In the future, we can probably apply more heuristics here to wind up with more
useful names by default, but for now this resolves the immediate problem.

23 months agofix: Extract Function produces duplicate fn names
Dorian Scheidt [Thu, 30 Jun 2022 17:17:19 +0000 (12:17 -0500)]
fix: Extract Function produces duplicate fn names

This change fixes issue #10037, in more or less the most naive fashion
possible.

We continue to start with the hardcoded default of "fun_name", and now append a
counter to the end of it if that name is already in scope.

In the future, we can probably apply more heuristics here to wind up with more
useful names by default, but for now this resolves the immediate problem.

23 months agoAuto merge of #12680 - lowr:fix/12428-regression, r=Veykril
bors [Sat, 2 Jul 2022 19:00:49 +0000 (19:00 +0000)]
Auto merge of #12680 - lowr:fix/12428-regression, r=Veykril

fix regressions on assignment expressions

This is a follow-up PR on #12428. I'm not sure if this is everything I overlooked, so if there are more things that are not right, we may want to revert #12428.

This should also fix the increase of the type mismatches and the unknown types in diesel in the [metrics](https://rust-analyzer.github.io/metrics/?start=2022-06-23&end=2022-07-01) introduced by #12428.

The regressions are:

- some coercions don't work in the ordinary (i.e. non-destructuring) assignments

    In order for coercions on ADT fields instantiations to work, lhs type has to be known before inferring rhs. #12428 changed the inference order, making rhs inferred before lhs, breaking the coercion, so I restored the original inference mechanism for the ordinary assignments.

    Note that this kind of coercion doesn't happen in destructuring assigments, because when they are desugared, the struct expression is first assigned to a temporary, which is then assigned to the assignee, which is not coercion site anymore.

- type mismatches on individual identifiers are not reported

23 months agofix: report type mismatch on identifier in destructuring assignments
Ryo Yoshida [Sat, 2 Jul 2022 17:31:07 +0000 (02:31 +0900)]
fix: report type mismatch on identifier in destructuring assignments

23 months agofix: infer lhs first on ordinary assignment expressions
Ryo Yoshida [Sat, 2 Jul 2022 16:57:23 +0000 (01:57 +0900)]
fix: infer lhs first on ordinary assignment expressions

23 months agoAuto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykril
bors [Sat, 2 Jul 2022 17:18:24 +0000 (17:18 +0000)]
Auto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykril

fix: complete enum variants as patterns in pattern path

close #12593

23 months agoAuto merge of #12679 - a-kenji:fix-typos-hir, r=lnicola
bors [Sat, 2 Jul 2022 15:28:29 +0000 (15:28 +0000)]
Auto merge of #12679 - a-kenji:fix-typos-hir, r=lnicola

fix: typos in hir-ty

23 months agofix: typos in hir-ty
a-kenji [Sat, 2 Jul 2022 15:19:06 +0000 (17:19 +0200)]
fix: typos in hir-ty

23 months agoAuto merge of #12678 - Veykril:flyimport, r=Veykril
bors [Sat, 2 Jul 2022 14:20:36 +0000 (14:20 +0000)]
Auto merge of #12678 - Veykril:flyimport, r=Veykril

fix: Trigger flyimport completions in item lists again

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

23 months agofix: Trigger flyimport completions in item lists again
Lukas Wirth [Sat, 2 Jul 2022 14:15:13 +0000 (16:15 +0200)]
fix: Trigger flyimport completions in item lists again

23 months agofix: escape for enum variant
yue4u [Sat, 2 Jul 2022 14:17:29 +0000 (23:17 +0900)]
fix: escape for enum variant

23 months agofix: variants rendering in pattern path
yue4u [Sat, 25 Jun 2022 18:33:19 +0000 (03:33 +0900)]
fix: variants rendering in pattern path

23 months agoAuto merge of #12671 - flodiebold:test-for-12669, r=flodiebold
bors [Fri, 1 Jul 2022 17:00:23 +0000 (17:00 +0000)]
Auto merge of #12671 - flodiebold:test-for-12669, r=flodiebold

Add tests for #12669

23 months agoFix case of ignored/broken proc macro
Florian Diebold [Fri, 1 Jul 2022 16:45:09 +0000 (18:45 +0200)]
Fix case of ignored/broken proc macro

23 months agoAdd tests for #12669
Florian Diebold [Fri, 1 Jul 2022 14:32:54 +0000 (16:32 +0200)]
Add tests for #12669

2 years agoAuto merge of #12636 - xuhongxu96:fix-12148, r=Veykril
bors [Fri, 1 Jul 2022 14:55:51 +0000 (14:55 +0000)]
Auto merge of #12636 - xuhongxu96:fix-12148, r=Veykril

complete raw identifier with "r#" prefix

Fix #12148

Escape Names and Paths used in `insert_text`/`insert_snippet` while rendering the completion items.

2 years agoAuto merge of #12668 - Veykril:mac-source-map, r=Veykril
bors [Fri, 1 Jul 2022 14:46:48 +0000 (14:46 +0000)]
Auto merge of #12668 - Veykril:mac-source-map, r=Veykril

fix: Simplify macro statement expansion handling

I only meant to fix https://github.com/rust-lang/rust-analyzer/issues/12644 but that somehow turned into a rewrite of the statement handling ... at least this fixes a few more issues in the IDE layer now

2 years agoAuto merge of #12670 - Veykril:assoc-attrs, r=Veykril
bors [Fri, 1 Jul 2022 14:36:56 +0000 (14:36 +0000)]
Auto merge of #12670 - Veykril:assoc-attrs, r=Veykril

fix: Fix attribute macros on assoc items being discarded with disabled proc macros

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

2 years agoFix blocks not considering stmt without semi as tails
Lukas Wirth [Fri, 1 Jul 2022 13:52:52 +0000 (15:52 +0200)]
Fix blocks not considering stmt without semi as tails

2 years agofix: Fix attribute macros on assoc items being discarded with disabled proc macros
Lukas Wirth [Fri, 1 Jul 2022 14:21:21 +0000 (16:21 +0200)]
fix: Fix attribute macros on assoc items being discarded with disabled proc macros

2 years agoFix Expr::MacroStmts using wrong scopes
Lukas Wirth [Fri, 1 Jul 2022 13:34:29 +0000 (15:34 +0200)]
Fix Expr::MacroStmts using wrong scopes

2 years agoUpdate hir-ty test outputs
Lukas Wirth [Fri, 1 Jul 2022 13:04:58 +0000 (15:04 +0200)]
Update hir-ty test outputs

2 years agofix: Simplify macro statement expansion handling
Lukas Wirth [Fri, 1 Jul 2022 12:43:57 +0000 (14:43 +0200)]
fix: Simplify macro statement expansion handling

2 years agoAuto merge of #12650 - lowr:fix/12591, r=lnicola
bors [Fri, 1 Jul 2022 08:32:04 +0000 (08:32 +0000)]
Auto merge of #12650 - lowr:fix/12591, r=lnicola

fix: improve whitespace insertion in pretty printer

Fixes #12591

The `=>` token in the macro_rules! should be parsed as one fat arrow, but it ["requires a lot of changes in r-a"](https://github.com/rust-analyzer/ungrammar/commit/143cc528b11290bf2463de1fb5a97a15f9b2ed44), so I left it for the larger refactoring in the future and put a FIXME note.

2 years agoAuto merge of #12660 - Veykril:flycheck, r=Veykril
bors [Fri, 1 Jul 2022 08:11:51 +0000 (08:11 +0000)]
Auto merge of #12660 - Veykril:flycheck, r=Veykril

fix: Fix flycheck sending cancel progress with no running process

Fixes #12659

2 years agofix: Fix flycheck sending cancel progress with no running process
Lukas Wirth [Thu, 30 Jun 2022 20:58:57 +0000 (22:58 +0200)]
fix: Fix flycheck sending cancel progress with no running process

2 years agoAuto merge of #12655 - ChayimFriedman2:debug-bench-filter-bin-target, r=flodiebold
bors [Thu, 30 Jun 2022 15:01:42 +0000 (15:01 +0000)]
Auto merge of #12655 - ChayimFriedman2:debug-bench-filter-bin-target, r=flodiebold

Ignore the `bin` artifact for `bench` targets

Just like `test`.

Fixes #12645.

I don't know how to test that.

2 years agoAuto merge of #12634 - iDawer:match-check.witnesses, r=flodiebold
bors [Thu, 30 Jun 2022 14:51:58 +0000 (14:51 +0000)]
Auto merge of #12634 - iDawer:match-check.witnesses, r=flodiebold

feat: Show witnesses of non-exhaustiveness in `missing-match-arm` diagnostic

Shamelessly copied from rustc. Thus reporting format is same.

This extends public api  `hir::diagnostics::MissingMatchArms` with `uncovered_patterns: String` field. It does not expose data for implementing a quick fix yet.

-----
Worth to note: current implementation does not give a comprehensive list of missing patterns. Also mentioned in [paper](http://moscova.inria.fr/~maranget/papers/warn/warn.pdf):

> One may think that algorithm I should make an additional effort to provide more
> non-matching values, by systematically computing recursive calls on specialized
> matrices when possible, and by returning a list of all pattern vectors returned by
> recursive calls. We can first observe that it is not possible in general to supply the
> users with all non-matching values, since the signature of integers is (potentially)
> infinite.

2 years agoAdd static assertions for some unreachble paths
iDawer [Thu, 30 Jun 2022 13:36:05 +0000 (18:36 +0500)]
Add static assertions for some unreachble paths

2 years agoCorrect wording
iDawer [Thu, 30 Jun 2022 12:19:03 +0000 (17:19 +0500)]
Correct wording

2 years agoAuto merge of #12626 - CuriousCorrelation:fix/empty-reasons, r=flodiebold
bors [Thu, 30 Jun 2022 10:19:21 +0000 (10:19 +0000)]
Auto merge of #12626 - CuriousCorrelation:fix/empty-reasons, r=flodiebold

fix: trailing ':' on empty inactive reasons

## Description
Fixes trailing ':' even when there is no explanation. e.g.
``` sh
code is inactive due to #[cfg] directives:
```
## Issue
Fixes: #12615
2 years agoAuto merge of #12428 - lowr:experimental/destructuring-assignment, r=flodiebold
bors [Thu, 30 Jun 2022 09:14:12 +0000 (09:14 +0000)]
Auto merge of #12428 - lowr:experimental/destructuring-assignment, r=flodiebold

feat: implement destructuring assignment

This is an attempt to implement destructuring assignments, or more specifically, type inference for [assignee expressions](https://doc.rust-lang.org/reference/expressions.html#place-expressions-and-value-expressions).

I'm not sure if this is the right approach, so I don't even expect this to be merged (hence the branch name :wink:) but rather want to propose one direction we could choose. I don't mind getting merged if this is good enough though!

Some notes on the implementation choices:

- Assignee expressions are **not** desugared on HIR level unlike rustc, but are inferred directly along with other expressions. This matches the processing of other syntaxes that are desugared in rustc but not in r-a. I find this reasonable because r-a only needs to infer types and it's easier to relate AST nodes and HIR nodes, so I followed it.
- Assignee expressions obviously resemble patterns, so type inference for each kind of pattern and its corresponding assignee expressions share a significant amount of logic. I tried to reuse the type inference functions for patterns by introducing `PatLike` trait which generalizes assignee expressions and patterns.
  - This is not the most elegant solution I suspect (and I really don't like the name of the trait!), but it's cleaner and the change is smaller than other ways I experimented, like making the functions generic without such trait, or making them take `Either<ExprId, PatId>` in place of `PatId`.

in case this is merged:
Closes #11532
Closes #11839
Closes #12322

2 years agoIgnore the `bin` artifact for `bench` targets
Chayim Refael Friedman [Wed, 29 Jun 2022 11:16:55 +0000 (14:16 +0300)]
Ignore the `bin` artifact for `bench` targets

Just like `test`.

2 years agoAuto merge of #12652 - lnicola:openvsx, r=lnicola
bors [Tue, 28 Jun 2022 19:18:50 +0000 (19:18 +0000)]
Auto merge of #12652 - lnicola:openvsx, r=lnicola

internal: Try to publish releases to OpenVSX

2 years agofix: improve whitespace insertion in pretty printer
Ryo Yoshida [Tue, 28 Jun 2022 11:40:22 +0000 (20:40 +0900)]
fix: improve whitespace insertion in pretty printer

2 years agoAuto merge of #12648 - flodiebold:proc-macro-errors-again, r=flodiebold
bors [Tue, 28 Jun 2022 08:44:13 +0000 (08:44 +0000)]
Auto merge of #12648 - flodiebold:proc-macro-errors-again, r=flodiebold

fix: Report proc macro errors in expressions correctly as well

They didn't have a krate before, resulting in the generic "proc macro not found" error.

Also improve error messages a bit more.

2 years agofix: Report proc macro errors in expressions correctly as well
Florian Diebold [Tue, 28 Jun 2022 08:41:10 +0000 (10:41 +0200)]
fix: Report proc macro errors in expressions correctly as well

They didn't have a krate before, resulting in the generic "proc macro
not found" error.

Also improve error messages a bit more.

2 years agoAuto merge of #12643 - Veykril:macro-compl, r=Veykril
bors [Mon, 27 Jun 2022 12:40:46 +0000 (12:40 +0000)]
Auto merge of #12643 - Veykril:macro-compl, r=Veykril

fix: Fix completions for locals not working properly inside macro calls

2 years agofix: Fix completions for locals not working properly inside macro calls
Lukas Wirth [Mon, 27 Jun 2022 12:39:44 +0000 (14:39 +0200)]
fix: Fix completions for locals not working properly inside macro calls

2 years agoAuto merge of #12635 - antogilbert:tgt_feat, r=Veykril
bors [Mon, 27 Jun 2022 12:28:36 +0000 (12:28 +0000)]
Auto merge of #12635 - antogilbert:tgt_feat, r=Veykril

Correct target_feature completion

I changed the `target_feature` to match the description given in #12616.

2 years agoAuto merge of #12642 - weirdsmiley:master, r=Veykril
bors [Mon, 27 Jun 2022 12:16:06 +0000 (12:16 +0000)]
Auto merge of #12642 - weirdsmiley:master, r=Veykril

fix: deduplicate cfg completions

cfg completions are duplicated if they are set with multiple values.
This patch deduplicates them.

fixes: [#12623](https://github.com/rust-lang/rust-analyzer/issues/12623)