]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoAuto merge of #13581 - Veykril:unit-struct-compl, r=Veykril
bors [Tue, 8 Nov 2022 07:38:13 +0000 (07:38 +0000)]
Auto merge of #13581 - Veykril:unit-struct-compl, r=Veykril

fix: Fix item completions not working properly after unit structs and outline modules

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

20 months agofix: Fix item completions not working properly after unit structs and outline modules
Lukas Wirth [Tue, 8 Nov 2022 07:37:45 +0000 (08:37 +0100)]
fix: Fix item completions not working properly after unit structs and outline modules

20 months agoAuto merge of #13573 - Veykril:invalid-file-range, r=Veykril
bors [Mon, 7 Nov 2022 16:45:26 +0000 (16:45 +0000)]
Auto merge of #13573 - Veykril:invalid-file-range, r=Veykril

internal: error instead of panic on invalid file range

Fixes the panic in https://github.com/rust-lang/rust-analyzer/issues/13170

20 months agointernal: error instead of panic on invalid file range
Lukas Wirth [Mon, 7 Nov 2022 16:43:22 +0000 (17:43 +0100)]
internal: error instead of panic on invalid file range

20 months agoAuto merge of #13572 - Veykril:cancellable, r=Veykril
bors [Mon, 7 Nov 2022 16:22:33 +0000 (16:22 +0000)]
Auto merge of #13572 - Veykril:cancellable, r=Veykril

internal: Use Cancellable in favor of Result for clarity

20 months agointernal: Use Cancellable in favor of Result for clarity
Lukas Wirth [Mon, 7 Nov 2022 16:21:37 +0000 (17:21 +0100)]
internal: Use Cancellable in favor of Result for clarity

20 months agoAuto merge of #13571 - Veykril:unique-references, r=Veykril
bors [Mon, 7 Nov 2022 15:49:54 +0000 (15:49 +0000)]
Auto merge of #13571 - Veykril:unique-references, r=Veykril

minor: Deduplicate reference search results

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

20 months agoDeduplicate reference search results
Lukas Wirth [Mon, 7 Nov 2022 15:48:50 +0000 (16:48 +0100)]
Deduplicate reference search results

20 months agoAuto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-newlines, r=Veykril
bors [Mon, 7 Nov 2022 15:04:40 +0000 (15:04 +0000)]
Auto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-newlines, r=Veykril

Fix the length displayed for byte string literals with escaped newlines

This is a fix for the problem I reported earlier: "the length of byte strings containing escaped newlines is displayed two bytes longer when the first escaped character is a newline".

I would appreciate it if you could review the fix.
Many thanks.

Closes #13567

20 months agoAuto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
bors [Mon, 7 Nov 2022 14:52:05 +0000 (14:52 +0000)]
Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril

minor: Remove code duplication

20 months agoRemove code duplication
Lukas Wirth [Mon, 7 Nov 2022 14:49:26 +0000 (15:49 +0100)]
Remove code duplication

20 months agoAdd test code for unescaping byte strings
Noritada Kobayashi [Mon, 7 Nov 2022 14:39:02 +0000 (23:39 +0900)]
Add test code for unescaping byte strings

20 months agoAuto merge of #13545 - Veykril:adjustment-hints, r=Veykril
bors [Mon, 7 Nov 2022 14:38:59 +0000 (14:38 +0000)]
Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril

Generalize reborrow hints as adjustment hints

Like reborrow hints, these are still mainly useful for teaching/learning

![image](https://user-images.githubusercontent.com/3757771/200073606-b5cd3b95-a9ad-454d-a3c4-d4d89bf45928.png)

20 months agoAuto merge of #13569 - Veykril:rust-version, r=Veykril
bors [Mon, 7 Nov 2022 14:21:31 +0000 (14:21 +0000)]
Auto merge of #13569 - Veykril:rust-version, r=Veykril

Bump Cargo rust-version fields to latest stable

We already depend on `let ... else` now anyways

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

20 months agoClarify the intent
Noritada Kobayashi [Mon, 7 Nov 2022 13:51:29 +0000 (22:51 +0900)]
Clarify the intent

Thanks to Lukas Wirth for a suggestion.

20 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

20 months agoDon't trigger adjustment hints in all inlay hint tests
Lukas Wirth [Mon, 7 Nov 2022 11:49:52 +0000 (12:49 +0100)]
Don't trigger adjustment hints in all inlay hint tests

20 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

20 months agoFix the length displayed for byte string literals with escaped newlines
Noritada Kobayashi [Mon, 7 Nov 2022 10:25:07 +0000 (19:25 +0900)]
Fix the length displayed for byte string literals with escaped newlines

The length of byte strings containing escaped newlines is displayed two
bytes longer when the first escaped character is a newline.

This is due to a small bug in handling the first escaped newline in
string literals.

Closes #13567

20 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.

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

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

20 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

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

20 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

20 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

20 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

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

20 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

20 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

20 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.

20 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`

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

20 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`

20 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

20 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

20 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

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

20 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

20 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)

20 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

20 months agoFix up adjustment hints configurations
Lukas Wirth [Fri, 4 Nov 2022 21:59:07 +0000 (22:59 +0100)]
Fix up adjustment hints configurations

20 months agoAdd adjustment hint tests
Lukas Wirth [Fri, 4 Nov 2022 21:40:06 +0000 (22:40 +0100)]
Add adjustment hint tests

20 months agoGeneralize reborrow hints as adjustment hints
Lukas Wirth [Fri, 4 Nov 2022 16:11:15 +0000 (17:11 +0100)]
Generalize reborrow hints as adjustment hints

20 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

20 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

20 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.

20 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

21 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

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

21 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

21 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? )

21 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>
21 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 :)

21 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

21 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.

21 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

21 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

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

21 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.

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

21 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`

21 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.

21 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

21 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 :)

21 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

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

21 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

21 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`

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

fix: remove unused import

21 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)

21 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

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

21 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

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

21 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

21 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

21 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`

21 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`

21 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`

21 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

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

21 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

21 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

21 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

21 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

21 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

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

21 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.

21 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.

21 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

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

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

21 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

21 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