]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoBump Cargo rust-version fields to latest stable
Lukas Wirth [Mon, 7 Nov 2022 11:59:51 +0000 (12:59 +0100)]
Bump Cargo rust-version fields to latest stable

19 months agoAuto merge of #13565 - Veykril:sysroot, r=Veykril
bors [Mon, 7 Nov 2022 11:40:44 +0000 (11:40 +0000)]
Auto merge of #13565 - Veykril:sysroot, r=Veykril

Update sysroot crates

19 months agoAuto merge of #12991 - TiddoLangerak:extract-method-from-trait-into-impl-root, r...
bors [Mon, 7 Nov 2022 11:07:12 +0000 (11:07 +0000)]
Auto merge of #12991 - TiddoLangerak:extract-method-from-trait-into-impl-root, r=Veykril

Feat: extracted method from trait impl is placed in existing impl

**Before**

https://user-images.githubusercontent.com/1759192/183872883-3b0eafd2-d1dc-440e-9e66-38e3372f8b64.mp4

**After**

https://user-images.githubusercontent.com/1759192/183875769-87f34c7d-52f0-4dfc-9766-f591ee738ebb.mp4

Previously, when triggering a method extraction from within an impl trait block, then this would always create a new impl block for
the struct, even if there already is one. Now, if there is already an existing trait-less impl block, then it'll put the extracted method in there.

**Caveats**:
- It currently requires the target impl block to be non-empty. This limitation is because the current architecture takes a `node_to_insert_after` as reference for where to insert the extracted function. An empty impl block doesn't have such a reference node, since it's empty. It seems that supporting this requires a much larger and more complex change.
- This is my first contribution in rust, so apologies for any beginner mistakes.

19 months agoUpdate sysroot crates
Lukas Wirth [Mon, 7 Nov 2022 10:45:52 +0000 (11:45 +0100)]
Update sysroot crates

19 months agorustfmt
Lukas Wirth [Mon, 7 Nov 2022 10:58:57 +0000 (11:58 +0100)]
rustfmt

19 months agoAuto merge of #13566 - lnicola:therefor, r=lnicola
bors [Mon, 7 Nov 2022 10:54:38 +0000 (10:54 +0000)]
Auto merge of #13566 - lnicola:therefor, r=lnicola

minor: Fix typos

19 months agoFix typos
Laurențiu Nicola [Mon, 7 Nov 2022 10:53:33 +0000 (12:53 +0200)]
Fix typos

19 months agoAuto merge of #13547 - Veykril:line-index, r=Veykril
bors [Mon, 7 Nov 2022 10:33:13 +0000 (10:33 +0000)]
Auto merge of #13547 - Veykril:line-index, r=Veykril

internal: Optimize `apply_document_changes` a bit

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

19 months agoAuto merge of #13552 - Veykril:flycheck-process-group, r=Veykril
bors [Mon, 7 Nov 2022 10:19:32 +0000 (10:19 +0000)]
Auto merge of #13552 - Veykril:flycheck-process-group, r=Veykril

internal: Use a process group for flycheck

Should fix https://github.com/rust-lang/rust-analyzer/issues/13348

19 months agoAuto merge of #13556 - pd4d10:patch-1, r=lnicola
bors [Sat, 5 Nov 2022 17:57:31 +0000 (17:57 +0000)]
Auto merge of #13556 - pd4d10:patch-1, r=lnicola

docs: fix adoc links

Correct #13536 with adoc link syntax

19 months agodocs: fix adoc links
Rongjian Zhang [Sat, 5 Nov 2022 17:33:57 +0000 (01:33 +0800)]
docs: fix adoc links

19 months agointernal: Use a process group for flycheck
Lukas Wirth [Sat, 5 Nov 2022 15:28:04 +0000 (16:28 +0100)]
internal: Use a process group for flycheck

19 months agoAuto merge of #13550 - Veykril:issue-template, r=lnicola
bors [Sat, 5 Nov 2022 13:20:26 +0000 (13:20 +0000)]
Auto merge of #13550 - Veykril:issue-template, r=lnicola

minor: Update github issue templates

19 months agoAuto merge of #13536 - pd4d10:patch-1, r=Veykril
bors [Sat, 5 Nov 2022 12:59:05 +0000 (12:59 +0000)]
Auto merge of #13536 - pd4d10:patch-1, r=Veykril

docs: add crates section to the manual

closes #13533

Added a section to the user manual, to make it easier for users to find the correct crate.

19 months agoAuto merge of #13435 - DropDemBits:assists-format-args-capture-pt3, r=Veykril
bors [Sat, 5 Nov 2022 12:41:23 +0000 (12:41 +0000)]
Auto merge of #13435 - DropDemBits:assists-format-args-capture-pt3, r=Veykril

Migrate assists to format args captures, part 3

Continuation of https://github.com/rust-lang/rust-analyzer/pull/13379

Migrates:

- `inline_call`
- `inline_local_variable`
- `introduce_named_lifetime`
- `merge_match_arms`
- `move_from_mod_rs`
- `move_guard`
- `move_module_to_file`
- `move_to_mod_rs`
- `number_representation`
- `qualify_method_call`
- `qualify_path`
- `raw_string`
- `remove_dbg`
- `replace_derive_with_manual_impl`
- `replace_or_with_or_else`
- `replace_turbofish_with_explicit_type`
- `unwrap_tuple`
- `wrap_return_type_in_result`

19 months agominor: Update github issue templates
Lukas Wirth [Sat, 5 Nov 2022 12:29:44 +0000 (13:29 +0100)]
minor: Update github issue templates

19 months agoAuto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril
bors [Sat, 5 Nov 2022 12:29:06 +0000 (12:29 +0000)]
Auto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril

internal: Migrate `ide_assists::utils` and `ide_assists::handlers` to use format arg captures (part 1)

This not only serves as making future migration to mutable syntax trees easier, it also finds out what needs to be migrated in the first place.

~~Aside from the first commit, subsequent commits are structured to only deal with one file/handler at a time.~~

This is the first of 3 PRs, migrating:

Utils:

- `gen_trait_fn_body`
- `render_snippet`
- `ReferenceConversion`
  - `convert_type`
  - `getter`

Handlers:

- `add_explicit_type`
- `add_return_type`
- `add_turbo_fish`
- `apply_demorgan`
- `auto_import`
- `convert_comment_block`
- `convert_integer_literal`
- `convert_into_to_from`
- `convert_iter_for_each_to_for`
- `convert_let_else_to_match`
- `convert_tuple_struct_to_named_struct`
- `convert_two_arm_bool_match_to_matches_macro`
- `destructure_tuple_binding`
- `extract_function`
- `extract_module`
- `extract_struct_from_enum_variant`
- `extract_type_alias`
- `extract_variable`
- `fix_visibility`

19 months agoAuto merge of #13549 - Veykril:search-fix, r=Veykril
bors [Sat, 5 Nov 2022 12:16:18 +0000 (12:16 +0000)]
Auto merge of #13549 - Veykril:search-fix, r=Veykril

fix: Fix reference searching only accounting substrings instead of whole identifiers

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

19 months agofix: Fix reference searching only accounting substrings instead of whole identifiers
Lukas Wirth [Sat, 5 Nov 2022 11:04:21 +0000 (12:04 +0100)]
fix: Fix reference searching only accounting substrings instead of whole identifiers

19 months agoAuto merge of #13454 - justinmmott:master, r=flodiebold
bors [Sat, 5 Nov 2022 10:05:52 +0000 (10:05 +0000)]
Auto merge of #13454 - justinmmott:master, r=flodiebold

Fixed local shadowing the caller's argument issue

fix https://github.com/rust-lang/rust-analyzer/issues/12536

19 months agoAdd tests for LineEndings::normalize
Lukas Wirth [Sat, 5 Nov 2022 10:00:17 +0000 (11:00 +0100)]
Add tests for LineEndings::normalize

19 months agointernal: Optimize `apply_document_changes` a bit
Lukas Wirth [Fri, 4 Nov 2022 23:27:03 +0000 (00:27 +0100)]
internal: Optimize `apply_document_changes` a bit

19 months agoAuto merge of #13541 - Veykril:dbg-cmd, r=Veykril
bors [Fri, 4 Nov 2022 23:30:48 +0000 (23:30 +0000)]
Auto merge of #13541 - Veykril:dbg-cmd, r=Veykril

Clarify what commands are debug commands in VSCode

Renders as
![image](https://user-images.githubusercontent.com/3757771/199828895-4d7691f6-5c33-405c-9842-691b32745919.png)

19 months agoMark the Memory Usage command as debug command
Lukas Wirth [Fri, 4 Nov 2022 23:30:21 +0000 (00:30 +0100)]
Mark the Memory Usage command as debug command

19 months agoAuto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril
bors [Fri, 4 Nov 2022 20:29:16 +0000 (20:29 +0000)]
Auto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril

Lower unsafety of fn pointer and fn item types

19 months agoLower unsafety of fn pointer and fn item types
Lukas Wirth [Fri, 4 Nov 2022 20:07:15 +0000 (21:07 +0100)]
Lower unsafety of fn pointer and fn item types

19 months agoAuto merge of #13544 - HKalbasi:patch-2, r=Veykril
bors [Fri, 4 Nov 2022 16:12:21 +0000 (16:12 +0000)]
Auto merge of #13544 - HKalbasi:patch-2, r=Veykril

Add rustbot features related to PR state labels

It makes rustbot add `S-waiting-on-review` to every new PR, and ``@rustbot` author` and ``@rustbot` review` commands working.

19 months agoAdd rustbot features related to PR state labels
HKalbasi [Fri, 4 Nov 2022 11:57:50 +0000 (15:27 +0330)]
Add rustbot features related to PR state labels

20 months agoClarify what commands are debug commands in VSCode
Lukas Wirth [Thu, 3 Nov 2022 20:36:14 +0000 (21:36 +0100)]
Clarify what commands are debug commands in VSCode

20 months agoAuto merge of #13456 - emilio:scip-local-symbol, r=Veykril
bors [Thu, 3 Nov 2022 13:58:36 +0000 (13:58 +0000)]
Auto merge of #13456 - emilio:scip-local-symbol, r=Veykril

scip: Generate symbols for local crates.

Consider something like:

```
// a.rs
pub struct Foo { .. } // Foo is "local 1"

fn something() {
    crate::b::Bar::new() // Bar is "local 1", but of "b.rs"
}

// b.rs
pub struct Bar { .. } // "local 1"
```

Without this there's no way to disambiguate whether "local 1" references "Bar" or "Foo".

20 months agoAuto merge of #13537 - lnicola:ovsx-fail, r=lnicola
bors [Thu, 3 Nov 2022 13:43:38 +0000 (13:43 +0000)]
Auto merge of #13537 - lnicola:ovsx-fail, r=lnicola

minor: Allow ovsx publishing to fail

20 months agoAllow ovsx publishing to fail
Laurențiu Nicola [Thu, 3 Nov 2022 13:42:55 +0000 (15:42 +0200)]
Allow ovsx publishing to fail

20 months agodocs: add crates section to the manual
Rongjian Zhang [Thu, 3 Nov 2022 05:17:03 +0000 (13:17 +0800)]
docs: add crates section to the manual

20 months agoAuto merge of #13530 - lnicola:bump-ovsx, r=lnicola
bors [Wed, 2 Nov 2022 13:11:55 +0000 (13:11 +0000)]
Auto merge of #13530 - lnicola:bump-ovsx, r=lnicola

minor: Bump ovsx

CC https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1330#note_1033611

20 months agoBump ovsx
Laurențiu Nicola [Wed, 2 Nov 2022 12:50:04 +0000 (14:50 +0200)]
Bump ovsx

20 months agoAuto merge of #13527 - unexge:use-let-else-stmt-in-convert-to-guarded-return-assist...
bors [Wed, 2 Nov 2022 11:06:54 +0000 (11:06 +0000)]
Auto merge of #13527 - unexge:use-let-else-stmt-in-convert-to-guarded-return-assist, r=jonas-schievink

Use let-else statements in `Convert to guarded return` assist

Follow up for https://github.com/rust-lang/rust-analyzer/pull/13516, addresses remaining part of https://github.com/rust-lang/rust-analyzer/issues/13254#issuecomment-1250408527

20 months agoAuto merge of #13359 - feniljain:feat-must-use-option, r=Veykril
bors [Wed, 2 Nov 2022 10:50:08 +0000 (10:50 +0000)]
Auto merge of #13359 - feniljain:feat-must-use-option, r=Veykril

feat: add config for inserting must_use in `generate_enum_as_method`

Should fix #13312

Didn't add a test because I was not sure on how to add test for a specific configuration option, tried to look for the usages for other `AssistConfig` variants but couldn't find any in `tests`. If there is a way to test this, do point me towards it.

I tried to extract the formatting string as a common `template_string` and only have if-else for that, but it didn't compile :(

Also it seems these tests are failing:

```
test config::tests::generate_config_documentation ... FAILED
test config::tests::generate_package_json_config ... FAILED
```

Can you also point me to how to correct these 😅  ( I guess there is some command to automatically generate these? )

20 months agofix: indentation after inserting `#must_use`
feniljain [Wed, 2 Nov 2022 10:39:12 +0000 (16:09 +0530)]
fix: indentation after inserting `#must_use`

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
20 months agoAuto merge of #13517 - feniljain:fix_completions, r=Veykril
bors [Wed, 2 Nov 2022 10:15:18 +0000 (10:15 +0000)]
Auto merge of #13517 - feniljain:fix_completions, r=Veykril

fix: make custom expr prefix completions to understand refs

Possible fix of #7929

While reviewing the postfix completion code I saw that while calling `add_custom_postfix_completions` we were doing it under the part where reference was not taken into consideration, but as we are only adding postfix completions with `Expr` scope ( [source](https://github.com/rust-lang/rust-analyzer/blob/ba28e19b7838e3ad4223ae82d074dc3950ef1548/crates/ide-completion/src/completions/postfix.rs#L272) )

I shifted the `add_custom_postfix_completions` call to part where references are considered

I am not sure if this is the correct fix or I am understanding the problem exactly but this small move seemed to have fixed the issue :)

20 months agoUse let-else statements in `Convert to guarded return` assist
unexge [Tue, 1 Nov 2022 23:02:10 +0000 (23:02 +0000)]
Use let-else statements in `Convert to guarded return` assist

20 months agoAuto merge of #13525 - jonas-schievink:generic-call-signature, r=jonas-schievink
bors [Tue, 1 Nov 2022 17:01:07 +0000 (17:01 +0000)]
Auto merge of #13525 - jonas-schievink:generic-call-signature, r=jonas-schievink

feat: show signature help when calling generic types implementing `FnOnce`

This queries chalk for the `FnOnce` impl of callees and takes argument and return types from there, making generic `Callable`s available to the IDE. This makes signature help work for them, and potentially allows other features to take generic callables into account in the future.

20 months agoAuto merge of #13508 - koka831:fix/13492, r=jonas-schievink
bors [Tue, 1 Nov 2022 16:38:40 +0000 (16:38 +0000)]
Auto merge of #13508 - koka831:fix/13492, r=jonas-schievink

fix: async trait method for `unnecessary_async`

Fix https://github.com/rust-lang/rust-analyzer/issues/13492

20 months agoAuto merge of #13516 - unexge:add-convert-match-to-let-else-assist, r=jonas-schievink
bors [Tue, 1 Nov 2022 16:24:15 +0000 (16:24 +0000)]
Auto merge of #13516 - unexge:add-convert-match-to-let-else-assist, r=jonas-schievink

Add `Convert match to let-else` assist

Closes https://github.com/rust-lang/rust-analyzer/issues/13254

20 months agoFix doc test
Jonas Schievink [Tue, 1 Nov 2022 16:23:32 +0000 (17:23 +0100)]
Fix doc test

20 months agoRevert "Record diverging match arms in `InferenceResult`"
Jonas Schievink [Tue, 1 Nov 2022 16:18:17 +0000 (17:18 +0100)]
Revert "Record diverging match arms in `InferenceResult`"

This reverts commit 319611b7382fc4c84170519dade68f4f558a44b1.

20 months agoImport `option` in the tests
Jonas Schievink [Tue, 1 Nov 2022 16:18:13 +0000 (17:18 +0100)]
Import `option` in the tests

20 months agoCreate `Callable`s for generic types implementing `FnOnce`
Jonas Schievink [Tue, 1 Nov 2022 15:33:59 +0000 (16:33 +0100)]
Create `Callable`s for generic types implementing `FnOnce`

20 months agoAuto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola
bors [Mon, 31 Oct 2022 15:39:20 +0000 (15:39 +0000)]
Auto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola

fix: disregard type variable expectation for if expressions

Fixes #13522

As [the comment](https://github.com/rust-lang/rust-analyzer/blob/8142d1f606dc2e52b1d2b8992671e2bd73379f28/crates/hir-ty/src/infer.rs#L1087-L1090) on `Expectation::adjust_for_branches` explains:

> If the expected type is just a type variable, then don't use an expected type. Otherwise, we might write parts of the type when checking the 'then' block which are incompatible with the 'else' branch.

Note that we already use it in match expressions. I've added tests for them too nevertheless.

20 months agofix: disregard type variable expectation for if expressions
Ryo Yoshida [Mon, 31 Oct 2022 15:15:05 +0000 (00:15 +0900)]
fix: disregard type variable expectation for if expressions

20 months agoAuto merge of #13445 - notJoon:modify-dead-links, r=lnicola
bors [Mon, 31 Oct 2022 06:55:11 +0000 (06:55 +0000)]
Auto merge of #13445 - notJoon:modify-dead-links, r=lnicola

fix) update broken links in guide.md

Hi, I Just fixed some broken links in `guide.md`.

In most cases, it is not connected by an old version (expecially `guide-2019-01`) of the link, so I made some modifications.

Thanks for your time :)

20 months agofix: make custom expr prefix completions to understand refs
feniljain [Sun, 30 Oct 2022 09:25:44 +0000 (14:55 +0530)]
fix: make custom expr prefix completions to understand refs

20 months agoUpdate auto generated tests
unexge [Sat, 29 Oct 2022 23:00:53 +0000 (00:00 +0100)]
Update auto generated tests

20 months agoAdd `Convert match to let-else` assist
unexge [Sat, 29 Oct 2022 22:45:13 +0000 (23:45 +0100)]
Add `Convert match to let-else` assist

20 months agoRecord diverging match arms in `InferenceResult`
unexge [Sat, 29 Oct 2022 22:44:34 +0000 (23:44 +0100)]
Record diverging match arms in `InferenceResult`

20 months agoSimplify the procedure
koka [Sat, 29 Oct 2022 15:57:42 +0000 (00:57 +0900)]
Simplify the procedure

fix: remove unused import

20 months agoAuto merge of #13505 - lowr:feat/gats, r=flodiebold
bors [Sat, 29 Oct 2022 08:54:14 +0000 (08:54 +0000)]
Auto merge of #13505 - lowr:feat/gats, r=flodiebold

Clean up tests and add documentation for GATs related stuff

This is a follow-up PR for #13494.

- addresses https://github.com/rust-lang/rust-analyzer/pull/13494#discussion_r1006774897
- documents the ordering constraint on `Binders` and `Substitution` (which is not really follow-up for the previous PR, but it was introduced to support GATs and I strongly feel it's worth it)

20 months agoAuto merge of #13513 - Veykril:vscode-workspace-changes, r=Veykril
bors [Fri, 28 Oct 2022 23:41:22 +0000 (23:41 +0000)]
Auto merge of #13513 - Veykril:vscode-workspace-changes, r=Veykril

Properly handle vscode workspace changes

20 months agoProperly handle vscode workspace changes
Lukas Wirth [Fri, 28 Oct 2022 23:28:32 +0000 (01:28 +0200)]
Properly handle vscode workspace changes

20 months agoAuto merge of #13512 - Veykril:startup-commands, r=Veykril
bors [Fri, 28 Oct 2022 22:51:52 +0000 (22:51 +0000)]
Auto merge of #13512 - Veykril:startup-commands, r=Veykril

Always set up VSCode commands

20 months agoAlways set up VSCode commands
Lukas Wirth [Fri, 28 Oct 2022 22:44:37 +0000 (00:44 +0200)]
Always set up VSCode commands

20 months agoAuto merge of #13510 - Veykril:status-click, r=Veykril
bors [Fri, 28 Oct 2022 21:12:27 +0000 (21:12 +0000)]
Auto merge of #13510 - Veykril:status-click, r=Veykril

feat: Clicking the status bar item stops and starts the server

20 months agofeat: Clicking the status bar item stops and starts the server
Lukas Wirth [Fri, 28 Oct 2022 21:10:10 +0000 (23:10 +0200)]
feat: Clicking the status bar item stops and starts the server

20 months agofix: async trait method for `unnecessary_async`
koka [Fri, 28 Oct 2022 16:14:44 +0000 (01:14 +0900)]
fix: async trait method for `unnecessary_async`

20 months agoDocument the ordering constraint on `Binders` and `Substitution`
Ryo Yoshida [Fri, 28 Oct 2022 12:17:16 +0000 (21:17 +0900)]
Document the ordering constraint on `Binders` and `Substitution`

20 months agoReplace expect test for GATs with `check_types`
Ryo Yoshida [Fri, 28 Oct 2022 11:33:19 +0000 (20:33 +0900)]
Replace expect test for GATs with `check_types`

20 months agoAuto merge of #13496 - rust-lang:lnicola-patch-1, r=jonas-schievink
bors [Thu, 27 Oct 2022 13:37:45 +0000 (13:37 +0000)]
Auto merge of #13496 - rust-lang:lnicola-patch-1, r=jonas-schievink

internal: Clarify feature policy

CC #13495

20 months agoClarify feature policy
Laurențiu Nicola [Thu, 27 Oct 2022 13:35:07 +0000 (16:35 +0300)]
Clarify feature policy

20 months agoAuto merge of #13494 - lowr:feat/gats, r=flodiebold
bors [Thu, 27 Oct 2022 12:37:50 +0000 (12:37 +0000)]
Auto merge of #13494 - lowr:feat/gats, r=flodiebold

feat: type inference for generic associated types

This PR implements type inference for generic associated types. Basically, this PR lowers generic arguments for associated types in valid places and creates `Substitution`s for them.

I focused on the inference for correct Rust programs, so there are cases where we *accidentally* manage to infer things that are actually invalid (which would then be reported by flycheck so I deem them non-fatal). See the following tests and FIXME notes on them: `gats_with_dyn`, `gats_with_impl_trait`.

The added tests are rather arbitrary. Let me know if there are cases I'm missing or I should add.

Closes #9673

20 months agoLower generic arguments for GATs in associated type bindings
Ryo Yoshida [Thu, 27 Oct 2022 08:11:16 +0000 (17:11 +0900)]
Lower generic arguments for GATs in associated type bindings

20 months agoCollect generic arguments in associated type bindings
Ryo Yoshida [Wed, 26 Oct 2022 13:52:04 +0000 (22:52 +0900)]
Collect generic arguments in associated type bindings

20 months agoLower generic arguments for associated types in paths
Ryo Yoshida [Wed, 26 Oct 2022 08:21:08 +0000 (17:21 +0900)]
Lower generic arguments for associated types in paths

20 months agoDisplay generic arguments for associated types
Ryo Yoshida [Thu, 27 Oct 2022 08:05:22 +0000 (17:05 +0900)]
Display generic arguments for associated types

20 months agorefactor: remove obsolete code
Ryo Yoshida [Wed, 26 Oct 2022 07:41:11 +0000 (16:41 +0900)]
refactor: remove obsolete code

20 months agoAuto merge of #13484 - lnicola:position-encoding, r=lnicola
bors [Wed, 26 Oct 2022 18:12:47 +0000 (18:12 +0000)]
Auto merge of #13484 - lnicola:position-encoding, r=lnicola

Switch to upstream `positionEncoding`

Closes #13481

This drops support for the custom extension, but that's probably fine.

Draft because it's not tested yet.

20 months agoAuto merge of #13475 - lowr:fix/lookup-impl-method-trait-ref, r=flodiebold
bors [Wed, 26 Oct 2022 12:06:26 +0000 (12:06 +0000)]
Auto merge of #13475 - lowr:fix/lookup-impl-method-trait-ref, r=flodiebold

fix: Test all generic args for trait when finding matching impl

Addresses https://github.com/rust-lang/rust-analyzer/pull/13463#issuecomment-1287816680

When finding matching impl for a trait method, we've been testing the unifiability of self type. However, there can be multiple impl of a trait for the same type with different generic arguments for the trait. This patch takes it into account and tests the unifiability of all type arguments for the trait (the first being the self type) thus enables rust-analyzer to find the correct impl even in such cases.

20 months agoTest all generic args for trait when finding matching impl
Ryo Yoshida [Tue, 25 Oct 2022 12:20:16 +0000 (21:20 +0900)]
Test all generic args for trait when finding matching impl

20 months agoPin lsp-types
Laurențiu Nicola [Tue, 25 Oct 2022 12:03:35 +0000 (15:03 +0300)]
Pin lsp-types

20 months agoSwitch to upstream positionEncoding
Laurențiu Nicola [Tue, 25 Oct 2022 11:43:26 +0000 (14:43 +0300)]
Switch to upstream positionEncoding

20 months agorefactor: remove repetitive string interpolation and doc changes
feniljain [Mon, 24 Oct 2022 15:36:32 +0000 (21:06 +0530)]
refactor: remove repetitive string interpolation and doc changes

20 months agoLet `InferenceTable::unify()` relate `Zip` values
Ryo Yoshida [Mon, 24 Oct 2022 14:28:53 +0000 (23:28 +0900)]
Let `InferenceTable::unify()` relate `Zip` values

20 months agoAuto merge of #13478 - Veykril:fix-flycheck, r=Veykril
bors [Mon, 24 Oct 2022 14:08:45 +0000 (14:08 +0000)]
Auto merge of #13478 - Veykril:fix-flycheck, r=Veykril

fix: Fix standard flycheck command not being executed in the workspace it is being invoked for

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

20 months agofix: Fix standard flycheck command not being executed in the workspace it is being...
Lukas Wirth [Mon, 24 Oct 2022 14:07:42 +0000 (16:07 +0200)]
fix: Fix standard flycheck command not being executed in the workspace it is being invoked for

20 months agoAuto merge of #13476 - Veykril:prefer-shutdown, r=Veykril
bors [Mon, 24 Oct 2022 13:08:22 +0000 (13:08 +0000)]
Auto merge of #13476 - Veykril:prefer-shutdown, r=Veykril

fix: Don't respond with an error when requesting a shutdown while starting

20 months agofix: Don't respond with an error when requesting a shutdown while starting
Lukas Wirth [Mon, 24 Oct 2022 12:56:58 +0000 (14:56 +0200)]
fix: Don't respond with an error when requesting a shutdown while starting

20 months agoRefactor: unwrap `Option` once in the beginning of closure
Ryo Yoshida [Mon, 24 Oct 2022 10:38:16 +0000 (19:38 +0900)]
Refactor: unwrap `Option` once in the beginning of closure

20 months agofeat: add config for inserting must_use in `generate_enum_as_method`
feniljain [Thu, 6 Oct 2022 18:41:02 +0000 (00:11 +0530)]
feat: add config for inserting must_use in `generate_enum_as_method`

20 months agoAuto merge of #13471 - Veykril:invoc-strategy-once, r=Veykril
bors [Sun, 23 Oct 2022 16:02:07 +0000 (16:02 +0000)]
Auto merge of #13471 - Veykril:invoc-strategy-once, r=Veykril

Handle multiple projects sharing dependency correctly in `once` strategy

20 months agoHandle multiple projects sharing dependency correctly in `once` strategy
Lukas Wirth [Sun, 23 Oct 2022 16:01:35 +0000 (18:01 +0200)]
Handle multiple projects sharing dependency correctly in `once` strategy

20 months agoAuto merge of #13466 - Veykril:invocation-location, r=Veykril
bors [Sat, 22 Oct 2022 21:52:04 +0000 (21:52 +0000)]
Auto merge of #13466 - Veykril:invocation-location, r=Veykril

Implement invocation location config

This allows setting the working directory for build-scripts on flycheck
Complements https://github.com/rust-lang/rust-analyzer/pull/13128

This will be followed up by one more PR that adds a few simple interpolation vars for `overrideCommand`, with that we should cover the needs for most build systems I believe.

20 months agoImplement invocation location config
Lukas Wirth [Sat, 22 Oct 2022 21:02:59 +0000 (23:02 +0200)]
Implement invocation location config

20 months agoide: Generate monikers for local crates.
Emilio Cobos Álvarez [Sat, 22 Oct 2022 13:10:03 +0000 (15:10 +0200)]
ide: Generate monikers for local crates.

20 months agoAuto merge of #13463 - lowr:fix/builtin-derive-with-const-generics, r=Veykril
bors [Sat, 22 Oct 2022 15:49:00 +0000 (15:49 +0000)]
Auto merge of #13463 - lowr:fix/builtin-derive-with-const-generics, r=Veykril

Support const generics for builtin derive macro

Fixes #13121

We have been treating every generic parameter as type parameter during builtin derive macro expansion. This patch adds support for const generics in such expansions.

20 months agoSupport const generics for builtin derive macro
Ryo Yoshida [Sat, 22 Oct 2022 08:49:38 +0000 (17:49 +0900)]
Support const generics for builtin derive macro

20 months agoAuto merge of #13460 - emilio:scip-cleanups, r=Veykril
bors [Sat, 22 Oct 2022 13:46:23 +0000 (13:46 +0000)]
Auto merge of #13460 - emilio:scip-cleanups, r=Veykril

scip: minor clean-ups

Avoids a couple redundant hash map lookups and so.

20 months agoAuto merge of #13461 - emilio:ide-cleanup-continue, r=Veykril
bors [Sat, 22 Oct 2022 13:29:58 +0000 (13:29 +0000)]
Auto merge of #13461 - emilio:ide-cleanup-continue, r=Veykril

ide: Remove unnecessary continue.

Just a minor clean-up I found while going through the code.

20 months agoscip: Rewrite tests to be closer to what we actually do.
Emilio Cobos Álvarez [Fri, 21 Oct 2022 20:04:43 +0000 (22:04 +0200)]
scip: Rewrite tests to be closer to what we actually do.

It's also less code.

20 months agoide: Remove unnecessary continue.
Emilio Cobos Álvarez [Sat, 22 Oct 2022 12:04:47 +0000 (14:04 +0200)]
ide: Remove unnecessary continue.

20 months agoscip: minor clean-ups
Emilio Cobos Álvarez [Sat, 22 Oct 2022 11:50:02 +0000 (13:50 +0200)]
scip: minor clean-ups

Avoids a couple redundant hash map lookups and so.

20 months agoaddressed https://github.com/rust-lang/rust-analyzer/issues/12536
Justin Mott [Fri, 21 Oct 2022 17:28:59 +0000 (13:28 -0400)]
addressed https://github.com/rust-lang/rust-analyzer/issues/12536

20 months agoAuto merge of #13453 - Veykril:disabled-commands, r=Veykril
bors [Fri, 21 Oct 2022 14:05:25 +0000 (14:05 +0000)]
Auto merge of #13453 - Veykril:disabled-commands, r=Veykril

internal: Properly handle commands in the VSCode client when the server is stopped