]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11867
bors[bot] [Fri, 1 Apr 2022 10:18:15 +0000 (10:18 +0000)]
Merge #11867

11867: create generate is, as, try_into group r=Veykril a=jakevossen5

Fixes #11636

In `generate_enum_projection_method.rs`, the changes to the function are from `cargo fmt`, I made the same change as I did in `generate_enum_is_method.rs`.

Co-authored-by: Jake Vossen <jake@vossen.dev>
2 years agocreate generate is, as, try_into group
Jake Vossen [Fri, 1 Apr 2022 03:19:45 +0000 (21:19 -0600)]
create generate is, as, try_into group

2 years agoAdd test against line number underflow
Felix Maurer [Thu, 31 Mar 2022 21:37:23 +0000 (23:37 +0200)]
Add test against line number underflow

2 years agoPrevent underflow when converting line numbers
Felix Maurer [Thu, 31 Mar 2022 21:00:48 +0000 (23:00 +0200)]
Prevent underflow when converting line numbers

Previously, when line numbers of Rust spans were converted to LSP
ranges, they could underflow resulting in very large line numbers. As
an underflow is always wrong, prevent it and use 0 instead.

2 years agoFix: Select correct insert position for disabled group import
Jonas Bushart [Thu, 31 Mar 2022 18:15:01 +0000 (18:15 +0000)]
Fix: Select correct insert position for disabled group import

The logic for importing with and without `group_imports` differed
significantly when no previous group existed. This lead to the problem
of using the wrong position when importing inside a module (#11585) or
when inner attributes are involved.
The existing code for grouped imports is better and takes these things
into account.

This PR changes the flow to use the pre-existing code for adding a new
import group even for the non-grouped import settings.
Some coverage markers are updated and the `group` is removed, since they
are now invoked in both cases (grouping and no grouping).

Tests are updated and two tests (empty module and inner attribute) are
added.

Fixes #11585

2 years agoMerge #11863
bors[bot] [Thu, 31 Mar 2022 14:04:38 +0000 (14:04 +0000)]
Merge #11863

11863: fix: allow varargs in any param position r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/3578 and aligns us with the Rust reference.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRemove parser restriction on varargs positioning
Jonas Schievink [Thu, 31 Mar 2022 14:03:27 +0000 (16:03 +0200)]
Remove parser restriction on varargs positioning

2 years agoMerge #11827
bors[bot] [Thu, 31 Mar 2022 13:01:10 +0000 (13:01 +0000)]
Merge #11827

11827: internal: Enforce Invariant that Resolver always contains a ModuleScope r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #11861
bors[bot] [Thu, 31 Mar 2022 12:52:11 +0000 (12:52 +0000)]
Merge #11861

11861: internal: Add "view file text" command to debug sync issues r=jonas-schievink a=jonas-schievink

I saw a file sync bug the other day but didn't know how to further debug it. This command might give a clue as to what's wrong and help debug issues like https://github.com/rust-analyzer/rust-analyzer/issues/4829.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoAdd "view file text" command to debug sync issues
Jonas Schievink [Thu, 31 Mar 2022 12:50:33 +0000 (14:50 +0200)]
Add "view file text" command to debug sync issues

2 years agointernal: Enforce Resolver to always have a module scope
Lukas Wirth [Thu, 31 Mar 2022 09:12:08 +0000 (11:12 +0200)]
internal: Enforce Resolver to always have a module scope

2 years agoFix formatting
Aleksei Trifonov [Wed, 30 Mar 2022 23:59:15 +0000 (02:59 +0300)]
Fix formatting

2 years agoLower postfix suggestions in completions list
Aleksei Trifonov [Wed, 30 Mar 2022 23:27:33 +0000 (02:27 +0300)]
Lower postfix suggestions in completions list

2 years agointernal: Refactor FamousDefs builtin crate search
Lukas Wirth [Sat, 26 Mar 2022 20:22:35 +0000 (21:22 +0100)]
internal: Refactor FamousDefs builtin crate search

2 years agoMerge #11852
bors[bot] [Wed, 30 Mar 2022 13:48:50 +0000 (13:48 +0000)]
Merge #11852

11852: Type mismatch when last expression is noreturn asm r=lnicola a=weirdsmiley

When last expression in a function body is noreturn asm, then analyzer
complains about the type mismatch by highlighting entire body. This
fixes it by introducing loop {} in the expanded code.

Fixes: [#11820](https://github.com/rust-analyzer/rust-analyzer/issues/11820)
Co-authored-by: Manas <manas18244@iiitd.ac.in>
2 years agoType mismatch when last expression is noreturn asm
Manas [Wed, 30 Mar 2022 13:32:27 +0000 (19:02 +0530)]
Type mismatch when last expression is noreturn asm

When last expression in a function body is noreturn asm, then analyzer
complains about the type mismatch by highlighting entire body. This
fixes it by introducing loop {} in the expanded code.

2 years agoMerge #11849
bors[bot] [Wed, 30 Mar 2022 11:52:50 +0000 (11:52 +0000)]
Merge #11849

11849: docs(auto_import): change by_self -> self and by_crate -> crate r=Veykril a=gibfahn

---

#### Commits _(oldest to newest)_

6b38c2d75 docs(auto_import): change by_self -> self and by_crate -> crate

Keep things consistent with the package.json , which uses `self` and
`crate` instead of `by_self` and `by_crate`. Both names are in fact
allowed as aliases, but we should be consistent so that people reading
the docs and using a schema do not see red squiggles.

<br/>

Co-authored-by: Gibson Fahnestock <gibfahn@gmail.com>
2 years agodocs(auto_import): change by_self -> self and by_crate -> crate
Gibson Fahnestock [Wed, 30 Mar 2022 10:45:14 +0000 (11:45 +0100)]
docs(auto_import): change by_self -> self and by_crate -> crate

Keep things consistent with the package.json , which uses `self` and
`crate` instead of `by_self` and `by_crate`. Both names are in fact
allowed as aliases, but we should be consistent so that people reading
the docs and using a schema do not see red squiggles.

2 years agoMerge #11844
bors[bot] [Tue, 29 Mar 2022 19:58:14 +0000 (19:58 +0000)]
Merge #11844

11844: Fix divergence detection for bare match arms r=flodiebold a=flodiebold

Fixes #11814 and #11837.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoFix divergence detection for bare match arms
Florian Diebold [Tue, 29 Mar 2022 19:55:34 +0000 (21:55 +0200)]
Fix divergence detection for bare match arms

Fixes #11814 and #11837.

2 years agoMerge #11842
bors[bot] [Tue, 29 Mar 2022 16:10:20 +0000 (16:10 +0000)]
Merge #11842

11842: Fix duplicate type mismatches with blocks r=flodiebold a=flodiebold

E.g. when there's a type mismatch on the return value of a function. To fix this, we have to return the expected type as the type of the block when there's a mismatch. That meant some IDE code that expected otherwise had to be adapted, in particular the "add return type" assist. For the "wrap in Ok/Some" quickfix, this sadly means it usually can't be applied in all branches of an if expression at the same time anymore, because there's a type mismatch for each branch that has the wrong type.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoFix duplicate type mismatches with blocks
Florian Diebold [Tue, 29 Mar 2022 15:51:11 +0000 (17:51 +0200)]
Fix duplicate type mismatches with blocks

E.g. when there's a type mismatch on the return value of a function. To
fix this, we have to return the expected type as the type of the block
when there's a mismatch. That meant some IDE code that expected
otherwise had to be adapted, in particular the "add return type" assist.
For the "wrap in Ok/Some" quickfix, this sadly means it usually can't be applied
in all branches of an if expression at the same time anymore, because
there's a type mismatch for each branch that has the wrong type.

2 years agoMerge #11840
bors[bot] [Tue, 29 Mar 2022 10:55:17 +0000 (10:55 +0000)]
Merge #11840

11840: Fix another const generic panic r=flodiebold a=HKalbasi

fix #11835

If I change `dyn` to `impl` in the test, it will infer the type as `IntoIterator::Item<impl Iterator<Item = [Ar<u8, 7>; 9]> + ?Sized>` instead of `[Ar<u8, 7>; 9]`. Maybe it needs some action?

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agofix regression_11688_3
hkalbasi [Tue, 29 Mar 2022 06:33:55 +0000 (11:03 +0430)]
fix regression_11688_3

2 years agoMerge #11833
bors[bot] [Sun, 27 Mar 2022 17:22:02 +0000 (17:22 +0000)]
Merge #11833

11833: internal: Move mismatched arg count diagnostic to inference r=flodiebold a=flodiebold

This means we only need to handle legacy const generics in one place, and it fits there especially since there will be more diagnostics coming.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoRemove legacy_const_generics_indices from CallableSig
Florian Diebold [Sun, 27 Mar 2022 17:12:00 +0000 (19:12 +0200)]
Remove legacy_const_generics_indices from CallableSig

I want to remove CallableSig anyway, and it's not needed anymore.

2 years agoMove mismatched-arg-count diagnostic to inference
Florian Diebold [Sun, 27 Mar 2022 17:10:31 +0000 (19:10 +0200)]
Move mismatched-arg-count diagnostic to inference

2 years agoMerge #11832
bors[bot] [Sun, 27 Mar 2022 13:46:35 +0000 (13:46 +0000)]
Merge #11832

11832: Fix typo in the style documentation r=lnicola a=Therzok

Was going through the documentation itself and found this typo just waiting to be fixed

Co-authored-by: Marius Ungureanu <therzok@gmail.com>
2 years agoFix typo in the style documentation
Marius Ungureanu [Sun, 27 Mar 2022 12:23:33 +0000 (15:23 +0300)]
Fix typo in the style documentation

Was going through the documentation itself and found this typo just waiting to be fixed

2 years agoMerge #11831
bors[bot] [Sun, 27 Mar 2022 10:52:27 +0000 (10:52 +0000)]
Merge #11831

11831: fix: Disable ref_match for qualified paths as well r=flodiebold a=flodiebold

I.e. don't suggest `Foo::&foo()`.

CC #8058.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agofix: Disable ref_match for qualified paths as well
Florian Diebold [Sun, 27 Mar 2022 10:50:16 +0000 (12:50 +0200)]
fix: Disable ref_match for qualified paths as well

I.e. don't suggest `Foo::&foo()`.

CC #8058.

2 years agoMerge #11829
bors[bot] [Sun, 27 Mar 2022 07:12:06 +0000 (07:12 +0000)]
Merge #11829

11829: minor: Bump chalk r=lnicola a=lnicola

Pulls in https://github.com/rust-lang/chalk/pull/759.

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump chalk
Laurențiu Nicola [Sun, 27 Mar 2022 07:11:02 +0000 (10:11 +0300)]
Bump chalk

2 years agoMerge #11825
bors[bot] [Sat, 26 Mar 2022 18:49:41 +0000 (18:49 +0000)]
Merge #11825

11825: fix: Don't complete `Drop::drop` for qualified paths r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #11826
bors[bot] [Sat, 26 Mar 2022 18:40:39 +0000 (18:40 +0000)]
Merge #11826

11826: Revert "Emit #[must_use] in Generate new assist" r=lnicola a=lnicola

CC https://github.com/rust-analyzer/rust-analyzer/pull/11737#issuecomment-1079740305

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRevert "Emit #[must_use] in Generate new assist"
Laurențiu Nicola [Sat, 26 Mar 2022 18:39:36 +0000 (20:39 +0200)]
Revert "Emit #[must_use] in Generate new assist"

This reverts commit 7e05e10495cd0f83cbcba2e7d881b616998cf7dc.

2 years agoSort runnable test results to make them deterministic
Lukas Wirth [Sat, 26 Mar 2022 18:38:20 +0000 (19:38 +0100)]
Sort runnable test results to make them deterministic

2 years agofix: Don't complete Drop::drop for qualified paths
Lukas Wirth [Sat, 26 Mar 2022 17:46:49 +0000 (18:46 +0100)]
fix: Don't complete Drop::drop for qualified paths

2 years agoSimplify
Lukas Wirth [Wed, 23 Mar 2022 17:09:53 +0000 (18:09 +0100)]
Simplify

2 years agoMerge #11793
bors[bot] [Fri, 25 Mar 2022 22:46:15 +0000 (22:46 +0000)]
Merge #11793

11793: LSIF: consolidate references into a single edge where possible. r=Veykril a=khuey

Co-authored-by: Kyle Huey <khuey@kylehuey.com>
2 years agoBump npm deps
Laurențiu Nicola [Fri, 25 Mar 2022 18:25:37 +0000 (20:25 +0200)]
Bump npm deps

2 years agoMerge #11817
bors[bot] [Fri, 25 Mar 2022 15:26:10 +0000 (15:26 +0000)]
Merge #11817

11817: minor: fix comment r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoMerge #11809
bors[bot] [Fri, 25 Mar 2022 15:11:56 +0000 (15:11 +0000)]
Merge #11809

11809: feat: disable experimental diagnostics by default r=jonas-schievink a=jonas-schievink

Now that we diagnose type mismatches, we have another diagnostic that can potentially produce false positives, so let's disable experimental diagnostics by default.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agofix comment
Jonas Schievink [Fri, 25 Mar 2022 14:30:52 +0000 (15:30 +0100)]
fix comment

2 years agoMerge #11810
bors[bot] [Thu, 24 Mar 2022 17:27:18 +0000 (17:27 +0000)]
Merge #11810

11810: internal: rename the 1.47 proc macro ABI to 1.48 r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9898.

We don't support 1.47, so rename it to reflect that.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRename the 1.47 ABI to 1.48
Jonas Schievink [Thu, 24 Mar 2022 17:26:10 +0000 (18:26 +0100)]
Rename the 1.47 ABI to 1.48

2 years agoDisable experimental diagnostics by default
Jonas Schievink [Thu, 24 Mar 2022 15:57:50 +0000 (16:57 +0100)]
Disable experimental diagnostics by default

2 years agoMerge #11772
bors[bot] [Thu, 24 Mar 2022 09:42:09 +0000 (09:42 +0000)]
Merge #11772

11772: Support constants in const eval r=HKalbasi a=HKalbasi

This PR enables evaluating things like this:
```rust
const X: usize = 2;
const Y: usize = 3 + X; // = 5
```
My target was nalgebra's `U5`, `U22`, ... which are defined as `type U5 = Const<{ SomeType5::SOME_ASSOC_CONST }>` but I didn't find out how to find the `ConstId` of the implementation of the trait, not the trait itself (possibly related to #4558 ? We can find associated type alias, so maybe this is doable already) So it doesn't help for nalgebra currently, but it is useful anyway.

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agouse pat_id instead of name in const eval stack
hkalbasi [Thu, 24 Mar 2022 09:06:37 +0000 (13:36 +0430)]
use pat_id instead of name in const eval stack

2 years agoorganize const eval tests
hkalbasi [Thu, 24 Mar 2022 08:36:27 +0000 (13:06 +0430)]
organize const eval tests

2 years agoSupport constants in const eval
hkalbasi [Sun, 20 Mar 2022 13:45:28 +0000 (17:15 +0330)]
Support constants in const eval

2 years agoMerge #11806
bors[bot] [Wed, 23 Mar 2022 22:45:44 +0000 (22:45 +0000)]
Merge #11806

11806: fix: Fix async block type inference using containing function return type r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11804
Should fix https://github.com/rust-analyzer/rust-analyzer/issues/11798#issuecomment-1076880521

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix async block type inference using containing function return type
Lukas Wirth [Wed, 23 Mar 2022 22:39:35 +0000 (23:39 +0100)]
fix: Fix async block type inference using containing function return type

2 years agoMerge #11802
bors[bot] [Wed, 23 Mar 2022 20:58:45 +0000 (20:58 +0000)]
Merge #11802

11802: fix: add stubs to make proc macros work that use the `SourceFile` API r=jonas-schievink a=jonas-schievink

Helps with the rocket 0.4 macros, at least on some Rust versions.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11264

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoMerge #11805
bors[bot] [Wed, 23 Mar 2022 20:20:09 +0000 (20:20 +0000)]
Merge #11805

11805: fix: Don't try to resolve methods on unknown types r=Veykril a=flodiebold

Fixes #10454, and some type mismatches.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoFix filter_map in minicore
Florian Diebold [Wed, 23 Mar 2022 18:47:11 +0000 (19:47 +0100)]
Fix filter_map in minicore

2 years agoAdjust value in syntax highlighting benchmark
Florian Diebold [Wed, 23 Mar 2022 18:28:01 +0000 (19:28 +0100)]
Adjust value in syntax highlighting benchmark

2 years agoDon't try to resolve methods on unknown types
Florian Diebold [Wed, 23 Mar 2022 18:18:12 +0000 (19:18 +0100)]
Don't try to resolve methods on unknown types

Fixes #10454, and some type mismatches.

2 years agoStub out `SourceFile` related proc macro functions
Jonas Schievink [Wed, 23 Mar 2022 15:11:05 +0000 (16:11 +0100)]
Stub out `SourceFile` related proc macro functions

2 years agoMerge #11801
bors[bot] [Wed, 23 Mar 2022 14:11:42 +0000 (14:11 +0000)]
Merge #11801

11801: fix: avoid returning `None` from `Span::join` to fix some proc macros r=jonas-schievink a=jonas-schievink

Some proc macros, notably rocket, `.unwrap()` the result of `Span::join` (and correctly so, it should never be `None`). We don't have a proper implementation of that API, so we always returned `None`. This changes our stub impl to return the first span instead.

Does not fully fix rocket's macros, they need other stuff to work too.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoReturn the first span from `Span::join`
Jonas Schievink [Wed, 23 Mar 2022 14:09:39 +0000 (15:09 +0100)]
Return the first span from `Span::join`

2 years agoMerge #11800
bors[bot] [Wed, 23 Mar 2022 13:34:49 +0000 (13:34 +0000)]
Merge #11800

11800: fix: fix `#[macro_use]` no longer importing non-`macro_rules!` macros r=jonas-schievink a=jonas-schievink

https://github.com/rust-analyzer/rust-analyzer/pull/11663 introduced a regression tracked in https://github.com/rust-analyzer/rust-analyzer/issues/11781, this fixes it.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11781

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agofix: properly import all types of macros with #[macro_use] again
Jonas Schievink [Wed, 23 Mar 2022 13:30:04 +0000 (14:30 +0100)]
fix: properly import all types of macros with #[macro_use] again

2 years agoMerge #11799
bors[bot] [Wed, 23 Mar 2022 12:55:48 +0000 (12:55 +0000)]
Merge #11799

11799: minor: Fix typo in `abi_1_57/mod.rs` comment r=lnicola a=WaffleLapkin

Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2 years agoFix typo in `abi_1_57/mod.rs` comment
Waffle Maybe [Wed, 23 Mar 2022 12:48:25 +0000 (16:48 +0400)]
Fix typo in `abi_1_57/mod.rs` comment

2 years agoMerge #11797
bors[bot] [Wed, 23 Mar 2022 11:23:07 +0000 (11:23 +0000)]
Merge #11797

11797: fix: fix "unwrap on a `None` value" in proc macros built with Rust 1.57.0 r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/10570

cc https://github.com/rust-analyzer/rust-analyzer/pull/10769#issuecomment-1076251859

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoIntroduce new fixed proc macro ABI for 1.57.0
Jonas Schievink [Wed, 23 Mar 2022 11:20:00 +0000 (12:20 +0100)]
Introduce new fixed proc macro ABI for 1.57.0

2 years agoMerge #11791
bors[bot] [Wed, 23 Mar 2022 00:36:11 +0000 (00:36 +0000)]
Merge #11791

11791: fix: some fixes and improvements to signature help r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agominor: Remove sponsors from readme files
Lukas Wirth [Tue, 22 Mar 2022 21:47:15 +0000 (22:47 +0100)]
minor: Remove sponsors from readme files

2 years agoMerge #11795
bors[bot] [Tue, 22 Mar 2022 21:44:06 +0000 (21:44 +0000)]
Merge #11795

11795: fix: Correctly suggest auto importing traits from aliases r=Veykril a=unexge

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11506

Co-authored-by: unexge <unexge@gmail.com>
2 years agofix: Correctly suggest auto importing traits from aliases
unexge [Tue, 22 Mar 2022 21:30:29 +0000 (22:30 +0100)]
fix: Correctly suggest auto importing traits from aliases

2 years agoMerge #11792
bors[bot] [Tue, 22 Mar 2022 21:00:24 +0000 (21:00 +0000)]
Merge #11792

11792: minor: Bump dependencies r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoPreserve order when grouping references.
Kyle Huey [Tue, 22 Mar 2022 19:38:59 +0000 (12:38 -0700)]
Preserve order when grouping references.

2 years agoLSIF: consolidate references into a single edge where possible.
Kyle Huey [Tue, 22 Mar 2022 19:00:20 +0000 (12:00 -0700)]
LSIF: consolidate references into a single edge where possible.

2 years agominor: Bump dependencies
Lukas Wirth [Tue, 22 Mar 2022 16:36:41 +0000 (17:36 +0100)]
minor: Bump dependencies

2 years agosignature help: skip lifetimes when non-lifetime arguments are present
Jonas Schievink [Tue, 22 Mar 2022 15:44:27 +0000 (16:44 +0100)]
signature help: skip lifetimes when non-lifetime arguments are present

2 years agoMerge #11789
bors[bot] [Tue, 22 Mar 2022 15:31:45 +0000 (15:31 +0000)]
Merge #11789

11789: fix: Fix lifetime elision hint configuration key r=Veykril a=Veykril

This is inconsistent with the other configuration keys unfortunately, but this is an issue of how we structured them here in general.

I feel like we'll have to do a proper pass over all the configs, check them for consistency and then write down some documentation of how our configs should be laid out, then apply fixes to the inconsistencies all at once which will entail breaking some user configurations unfortunately since we won't be able to do proper fallback handling for some of these.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11778

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix lifetime elision hint configuration key
Lukas Wirth [Tue, 22 Mar 2022 15:27:59 +0000 (16:27 +0100)]
fix: Fix lifetime elision hint configuration key

2 years agoMerge #11788
bors[bot] [Tue, 22 Mar 2022 15:17:50 +0000 (15:17 +0000)]
Merge #11788

11788: internal: Improve `find_path` and extern prelude handling r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoTrigger call info when completing generic type
Jonas Schievink [Tue, 22 Mar 2022 15:10:17 +0000 (16:10 +0100)]
Trigger call info when completing generic type

Closes #11763

2 years agoAvoid signature help inside multiline expressions
Jonas Schievink [Tue, 22 Mar 2022 15:05:24 +0000 (16:05 +0100)]
Avoid signature help inside multiline expressions

Fixes #11768

2 years agoMerge #11786
bors[bot] [Tue, 22 Mar 2022 14:58:17 +0000 (14:58 +0000)]
Merge #11786

11786: fix: fill_match_arms doesn't add wildcard pat for local enums r=Veykril a=OleStrohm

Fix #11783

This adds similar logic to non_exhaustive as is currently on doc(hidden)

Co-authored-by: Ole Strohm <strohm99@gmail.com>
2 years agointernal: Improve `find_path` and extern prelude handling
Lukas Wirth [Tue, 22 Mar 2022 14:54:46 +0000 (15:54 +0100)]
internal: Improve `find_path` and extern prelude handling

2 years agoImprove readability of signature help tests
Jonas Schievink [Tue, 22 Mar 2022 14:03:19 +0000 (15:03 +0100)]
Improve readability of signature help tests

2 years agoapplied rustfmt
Ole Strohm [Tue, 22 Mar 2022 11:10:48 +0000 (11:10 +0000)]
applied rustfmt

2 years agofix: fill_match_arms doesn't add wildcard pat for local enums
Ole Strohm [Tue, 22 Mar 2022 10:56:20 +0000 (10:56 +0000)]
fix: fill_match_arms doesn't add wildcard pat for local enums

2 years agoMerge #11780
bors[bot] [Tue, 22 Mar 2022 10:40:23 +0000 (10:40 +0000)]
Merge #11780

11780: feat: Add type mismatch diagnostic r=flodiebold a=flodiebold

This adds a proper diagnostic for type mismatches, turning "Add reference here", "Missing Ok or Some" and "Remove this semicolon" into quickfixes for this single diagnostic.
The diagnostic is marked as experimental when it does not have one of these quickfixes, so it can be turned off with `rust-analyzer.diagnostics.enableExperimental` (or specifically with `rust-analyzer.diagnostics.disabled` of course, the ID is `type-mismatch`).
There will still be some false positives, but I think there shouldn't be too many especially when the Chalk fix lands, and it's still experimental anyway :slightly_smiling_face:
This also fixes type checking for `rustc_legacy_const_generics` just to avoid some errors in tests.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoMerge #11785
bors[bot] [Mon, 21 Mar 2022 23:33:58 +0000 (23:33 +0000)]
Merge #11785

11785: fix: Fix tuple- and record struct completions not working with existing braces r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix tuple- and record struct completions not working with existing braces
Lukas Wirth [Mon, 21 Mar 2022 20:45:29 +0000 (21:45 +0100)]
fix: Fix tuple- and record struct completions not working with existing braces

2 years agoMerge #11782
bors[bot] [Mon, 21 Mar 2022 18:42:24 +0000 (18:42 +0000)]
Merge #11782

11782: fix: Fix flyimport showing functions in pattern position r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix flyimport showing functions in pattern position
Lukas Wirth [Mon, 21 Mar 2022 18:41:39 +0000 (19:41 +0100)]
fix: Fix flyimport showing functions in pattern position

2 years agoClean up commented-out lines
Florian Diebold [Mon, 21 Mar 2022 18:16:58 +0000 (19:16 +0100)]
Clean up commented-out lines

2 years agoFix unreachable_pub
Florian Diebold [Mon, 21 Mar 2022 17:54:20 +0000 (18:54 +0100)]
Fix unreachable_pub

2 years agoFix expect
Florian Diebold [Mon, 21 Mar 2022 16:00:03 +0000 (17:00 +0100)]
Fix expect

2 years agoAdd a FIXME
Florian Diebold [Mon, 21 Mar 2022 15:49:01 +0000 (16:49 +0100)]
Add a FIXME

2 years agoImplement type checking for legacy_const_generics
Florian Diebold [Mon, 21 Mar 2022 15:43:19 +0000 (16:43 +0100)]
Implement type checking for legacy_const_generics

2 years agoCleanups
Florian Diebold [Sun, 20 Mar 2022 23:08:12 +0000 (00:08 +0100)]
Cleanups

2 years agoRemove old diagnostics
Florian Diebold [Sun, 20 Mar 2022 23:05:52 +0000 (00:05 +0100)]
Remove old diagnostics

2 years agoAdd 'remove this semicolon'
Florian Diebold [Sun, 20 Mar 2022 23:04:15 +0000 (00:04 +0100)]
Add 'remove this semicolon'

2 years agoAdd "add missing Ok/Some" fix
Florian Diebold [Sun, 20 Mar 2022 18:20:16 +0000 (19:20 +0100)]
Add "add missing Ok/Some" fix