]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge #3958
bors[bot] [Thu, 16 Apr 2020 20:21:59 +0000 (20:21 +0000)]
Merge #3958

3958: Add proc-macro related config and tests r=matklad a=edwin0cheng

This PR do the following things:

1. Add cli argument `proc-macro` for running proc-macro server.
2. Added support for proc-macro in bench and analysis-stats
3. Added typescript config for proc-macros
4. Added an heavy test for proc-macros.

To test it out:

1. run `cargo xtask install --proc-macro`
2. add `"rust-analyzer.cargo.loadOutDirsFromCheck": true"` and `"rust-analyzer.procMacro.enabled": true"` in vs code config.

[Edit] Change to use `rust-analyzer proc-macro` for running proc-macro standalone process.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoRemove ci changes
Edwin Cheng [Thu, 16 Apr 2020 20:11:49 +0000 (04:11 +0800)]
Remove ci changes

4 years agoFix extern_process args
Edwin Cheng [Thu, 16 Apr 2020 20:08:01 +0000 (04:08 +0800)]
Fix extern_process args

4 years agoMerge #3994
bors[bot] [Thu, 16 Apr 2020 19:01:30 +0000 (19:01 +0000)]
Merge #3994

3994: Don't expose SyntaxNodePtr impl details r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't expose SyntaxNodePtr impl details
Aleksey Kladov [Thu, 16 Apr 2020 17:21:18 +0000 (19:21 +0200)]
Don't expose SyntaxNodePtr impl details

4 years agoMerge #3992
bors[bot] [Thu, 16 Apr 2020 13:45:12 +0000 (13:45 +0000)]
Merge #3992

3992: cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoAdd proc-macro cli command for rust-analyzer
Edwin Cheng [Thu, 16 Apr 2020 13:13:57 +0000 (21:13 +0800)]
Add proc-macro cli command for rust-analyzer

4 years agocargo update
kjeremy [Thu, 16 Apr 2020 13:13:44 +0000 (09:13 -0400)]
cargo update

4 years agoMerge #3979
bors[bot] [Thu, 16 Apr 2020 12:57:31 +0000 (12:57 +0000)]
Merge #3979

3979: fix missing match arm false positive for enum with no variants r=flodiebold a=JoshMcguigan

fixes #3974

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
4 years agoMerge #3990
bors[bot] [Thu, 16 Apr 2020 12:50:19 +0000 (12:50 +0000)]
Merge #3990

3990: Switch to Chalk recursive solver r=matklad a=flodiebold

Before:
```
Expressions of unknown type: 5526 (3%)
Expressions of partially unknown type: 5415 (3%)
```
After:
```
Expressions of unknown type: 4600 (2%)
Expressions of partially unknown type: 4645 (2%)
```

On the other hand,
```
'./target/release/rust-analyzer analysis-stats -q . # old solver' ran
    1.24 ± 0.04 times faster than 'rust-analyzer analysis-stats -q . # new solver'
```
I think part of this just comes from the fact that we're inferring more types now; but apart from that, it should be possible to improve the performance a bunch, and I'll make looking into that a priority.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agofix false positive for enum with no variants
Josh Mcguigan [Tue, 14 Apr 2020 23:06:57 +0000 (16:06 -0700)]
fix false positive for enum with no variants

4 years agoAdd tests for proc_macro
Edwin Cheng [Sun, 12 Apr 2020 16:05:45 +0000 (00:05 +0800)]
Add tests for proc_macro

4 years agoAdd config for proc_macro
Edwin Cheng [Sun, 12 Apr 2020 16:05:33 +0000 (00:05 +0800)]
Add config for proc_macro

4 years agoAdd with-proc-macro in bench ,stats and diagnositcs
Edwin Cheng [Sun, 12 Apr 2020 10:25:31 +0000 (18:25 +0800)]
Add with-proc-macro in bench ,stats and diagnositcs

4 years agoTest for non-working proc macro server assoc types
Florian Diebold [Mon, 13 Apr 2020 09:55:34 +0000 (11:55 +0200)]
Test for non-working proc macro server assoc types

4 years agoSwitch Chalk to recursive solver
Florian Diebold [Fri, 10 Apr 2020 15:44:43 +0000 (17:44 +0200)]
Switch Chalk to recursive solver

 + various fixes related to that.

4 years agoMerge #3989
bors[bot] [Thu, 16 Apr 2020 10:50:21 +0000 (10:50 +0000)]
Merge #3989

3989: Update Chalk r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoUpdate Chalk
Florian Diebold [Thu, 16 Apr 2020 10:39:00 +0000 (12:39 +0200)]
Update Chalk

4 years agoMerge #3948
bors[bot] [Thu, 16 Apr 2020 09:35:42 +0000 (09:35 +0000)]
Merge #3948

3948: fix: inlay hints config desyncronization between the frontend and the backend r=matklad a=Veetaha

See the explanation in the issue comment:
https://github.com/rust-analyzer/rust-analyzer/issues/3924#issuecomment-612444566

Workaround-ly fixes: #3924

Co-authored-by: veetaha <veetaha2@gmail.com>
4 years agoMerge #3962
bors[bot] [Wed, 15 Apr 2020 10:11:20 +0000 (10:11 +0000)]
Merge #3962

3962: Fix parentModule shortcut conflict r=matklad a=CodeSandwich

The default parentModule shortcut conflicts with VSCode's built-in undo selection

Co-authored-by: Igor Żuk <igor.zuk@protonmail.com>
4 years agoMerge #3966 #3968
bors[bot] [Wed, 15 Apr 2020 09:29:36 +0000 (09:29 +0000)]
Merge #3966 #3968

3966: Add support for bounds on associated types in trait definitions r=matklad a=flodiebold

E.g.
```rust
trait Trait {
    type Item: SomeOtherTrait;
}
```
Note that these don't simply desugar to where clauses; as I understand it, where clauses have to be proved by the *user* of the trait, but these bounds are proved by the *implementor*. (Also, where clauses on associated types are unstable.)

(Another one from my recursive solver branch...)

3968: Remove format from syntax_bridge hot path r=matklad a=edwin0cheng

Although only around 1% speed up by running:

```
Measure-Command {start-process .\target\release\rust-analyzer "analysis-stats -q ." -NoNewWindow -wait}
```

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoMerge #3964 #3965 #3967
bors[bot] [Wed, 15 Apr 2020 09:19:46 +0000 (09:19 +0000)]
Merge #3964 #3965 #3967

3964: Nicer Chalk debug logs r=matklad a=flodiebold

I'm looking at a lot of Chalk debug logs at the moment, so here's a few changes to make them slightly nicer...

3965: Implement inline associated type bounds r=matklad a=flodiebold

Like `Iterator<Item: SomeTrait>`.

This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :)

(This is cherry-picked from my recursive solver branch, where it works better, but I did manage to write a test that works with the current Chalk solver as well...)

3967: Handle `Self::Type` in trait definitions when referring to own associated type r=matklad a=flodiebold

It was implemented for other generic parameters for the trait, but not for `Self`.

(Last one off my recursive solver branch :smile: )

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoMerge #3963
bors[bot] [Wed, 15 Apr 2020 09:08:39 +0000 (09:08 +0000)]
Merge #3963

3963: Upgrade Chalk r=matklad a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoMerge #3969
bors[bot] [Wed, 15 Apr 2020 08:55:44 +0000 (08:55 +0000)]
Merge #3969

3969: Change add_function assist to use todo!() instead of unimplemented!() r=matklad a=TimoFreiberg

In the spirit of #3935

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
4 years agoMerge #3976
bors[bot] [Wed, 15 Apr 2020 08:43:15 +0000 (08:43 +0000)]
Merge #3976

3976: Bump @types/vscode and vscode-languageclient r=matklad a=kjeremy

Brings us inline with proposed LSP 3.16.

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoMerge #3978
bors[bot] [Wed, 15 Apr 2020 08:31:18 +0000 (08:31 +0000)]
Merge #3978

3978: insta 0.16 r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoMerge #3971
bors[bot] [Tue, 14 Apr 2020 23:35:50 +0000 (23:35 +0000)]
Merge #3971

3971: add diagnostics subcommand to rust-analyzer CLI r=JoshMcguigan a=JoshMcguigan

This PR adds a `diagnostics` subcommand to the rust-analyzer CLI. The intent is to detect all diagnostics on a workspace. It returns a non-zero status code if any error diagnostics are detected. Ideally I'd like to run this in CI against the rust analyzer project as a guard against false positives.

```
$ cargo run --release --bin rust-analyzer -- diagnostics .
```

Questions for reviewers:

1. Is this the proper way to get all diagnostics for a workspace? It seems there are at least a few ways this can be done, and I'm not sure if this is the most appropriate mechanism to do this.
2. It currently prints out the relative file path as it is collecting diagnostics, but it doesn't print the crate name. Since the file name is relative to the crate there can be repeated names, so it would be nice to print some identifier for the crate as well, but it wasn't clear to me how best to accomplish this.

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
4 years agodiagnostics cli, iterate over members
Josh Mcguigan [Tue, 14 Apr 2020 12:32:32 +0000 (05:32 -0700)]
diagnostics cli, iterate over members

4 years agoinsta 0.16
kjeremy [Tue, 14 Apr 2020 17:57:02 +0000 (13:57 -0400)]
insta 0.16

4 years agoBump @types/vscode and vscode-languageclient
kjeremy [Tue, 14 Apr 2020 14:20:16 +0000 (10:20 -0400)]
Bump @types/vscode and vscode-languageclient

4 years agocli diagnostics walk files
Josh Mcguigan [Tue, 14 Apr 2020 11:35:34 +0000 (04:35 -0700)]
cli diagnostics walk files

4 years agoadd diagnostics subcommand to rust-analyzer CLI
Josh Mcguigan [Mon, 13 Apr 2020 12:44:35 +0000 (05:44 -0700)]
add diagnostics subcommand to rust-analyzer CLI

4 years agoChange add_function assist to use todo!()
Timo Freiberg [Mon, 13 Apr 2020 20:17:06 +0000 (22:17 +0200)]
Change add_function assist to use todo!()

4 years agoMerge #3961
bors[bot] [Mon, 13 Apr 2020 18:03:12 +0000 (18:03 +0000)]
Merge #3961

3961: Fix double comma when merge imports on second line r=edwin0cheng a=IceSentry

This fixes the bug when merging imports from the second line when it already has a comma it would previously insert a comma.

There's probably a better way to check for a COMMA.

This also ends up with a weird indentation, but rust-fmt can easily deal with it so I'm not sure how to resolve that.

Closes #3832

Co-authored-by: IceSentry <c.giguere42@gmail.com>
4 years agoFix PR
IceSentry [Mon, 13 Apr 2020 17:59:30 +0000 (13:59 -0400)]
Fix PR

4 years agoRemove format from syntax_bridge hot path
Edwin Cheng [Mon, 13 Apr 2020 17:23:33 +0000 (01:23 +0800)]
Remove format from syntax_bridge hot path

4 years agoMerge #3960
bors[bot] [Mon, 13 Apr 2020 15:20:17 +0000 (15:20 +0000)]
Merge #3960

3960: ellipsis in tuple patterns r=JoshMcguigan a=JoshMcguigan

This PR lowers ellipsis in tuple patterns. It fixes a bug in the way ellipsis were previously lowered (by replacing the ellipsis with a single `Pat::Wild` no matter how many items the `..` was taking the place of).

It also uses this new information to properly handle `..` in tuple struct patterns when perform match statement exhaustiveness checks.

While this PR provides the building blocks for match statement exhaustiveness checks for tuples, there are some additional challenges there, so that is still unimplemented (unlike tuple structs).

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
4 years agohandle tuple patterns with ellipsis
Josh Mcguigan [Sun, 12 Apr 2020 15:40:09 +0000 (08:40 -0700)]
handle tuple patterns with ellipsis

4 years agoHandle `Self::Type` in trait definitions when referring to own associated type
Florian Diebold [Sun, 12 Apr 2020 10:29:03 +0000 (12:29 +0200)]
Handle `Self::Type` in trait definitions when referring to own associated type

It was implemented for other generic parameters for the trait, but not for `Self`.

4 years agoUpgrade Chalk
Florian Diebold [Fri, 10 Apr 2020 15:44:29 +0000 (17:44 +0200)]
Upgrade Chalk

4 years agoAdd support for bounds on associated types in trait definitions
Florian Diebold [Sun, 12 Apr 2020 10:28:24 +0000 (12:28 +0200)]
Add support for bounds on associated types in trait definitions

E.g.
```
trait Trait {
    type Item: SomeOtherTrait;
}
```
Note that these don't simply desugar to where clauses; as I understand it, where
clauses have to be proved by the *user* of the trait, but these bounds are proved
by the *implementor*. (Also, where clauses on associated types are unstable.)

4 years agoImplement inline associated type bounds
Florian Diebold [Fri, 10 Apr 2020 20:05:46 +0000 (22:05 +0200)]
Implement inline associated type bounds

Like `Iterator<Item: SomeTrait>`.

This is an unstable feature, but it's used in the standard library e.g. in the
definition of Flatten, so we can't get away with not implementing it :)

4 years agoNicer display of projections in Chalk logs
Florian Diebold [Mon, 13 Apr 2020 12:39:44 +0000 (14:39 +0200)]
Nicer display of projections in Chalk logs

4 years agoNicer display of closures in Chalk logs
Florian Diebold [Fri, 10 Apr 2020 20:05:31 +0000 (22:05 +0200)]
Nicer display of closures in Chalk logs

4 years agoFix parentModule shortcut conflict
Igor Żuk [Mon, 13 Apr 2020 10:13:55 +0000 (12:13 +0200)]
Fix parentModule shortcut conflict

The default parentModule shortcut conflicts with VSCode's built-in undo selection

4 years agoGeneralize test and clean up imports
IceSentry [Mon, 13 Apr 2020 01:34:01 +0000 (21:34 -0400)]
Generalize test and clean up imports

4 years agoFix double comma when merge imports on second line
IceSentry [Mon, 13 Apr 2020 01:29:14 +0000 (21:29 -0400)]
Fix double comma when merge imports on second line

This fixes the a bug when merging imports from the second line when it already has a comma it would previously insert a comma.

There's probably a better way to check for a COMMA.

This also ends up with a weird indentation, but rust-fmt can easily deal with it so I'm not sure how to resolve that.

Closes #3832

4 years agoMerge #3957
bors[bot] [Sun, 12 Apr 2020 16:37:36 +0000 (16:37 +0000)]
Merge #3957

3957: Remove more unnecessary braces r=kjeremy a=lnicola

See #3866.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agoRemove more unnecessary braces
Laurențiu Nicola [Sun, 12 Apr 2020 15:20:03 +0000 (18:20 +0300)]
Remove more unnecessary braces

4 years agoMerge #3938
bors[bot] [Sun, 12 Apr 2020 08:30:24 +0000 (08:30 +0000)]
Merge #3938

3938: fix missing match arm false positive r=flodiebold a=JoshMcguigan

This fixes #3932 by skipping the missing match arm diagnostic in the case any of the match arms don't type check properly against the match expression.

I think this is the appropriate behavior for this diagnostic, since `is_useful` relies on all match arms being well formed, and the case of a malformed match arm should probably be handled by a different diagnostic.

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
4 years agomissing match arm add test cases to demonstrate enum tuple struct with ellipsis behavior
Josh Mcguigan [Sun, 12 Apr 2020 04:20:52 +0000 (21:20 -0700)]
missing match arm add test cases to demonstrate enum tuple struct with ellipsis behavior

4 years agomissing match arms add test cases to demonstrate behavior of tuple with pattern
Josh Mcguigan [Sun, 12 Apr 2020 03:50:54 +0000 (20:50 -0700)]
missing match arms add test cases to demonstrate behavior of tuple with  pattern

4 years agoMerge #3955
bors[bot] [Sat, 11 Apr 2020 22:01:22 +0000 (22:01 +0000)]
Merge #3955

3955: Align grammar for record patterns and literals r=matklad a=matklad

The grammar now looks like this

   [name_ref :] pat

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAlign grammar for record patterns and literals
Aleksey Kladov [Sat, 11 Apr 2020 21:33:17 +0000 (23:33 +0200)]
Align grammar for record patterns and literals

The grammar now looks like this

   [name_ref :] pat

4 years agoRemove dead code
Aleksey Kladov [Sat, 11 Apr 2020 21:08:05 +0000 (23:08 +0200)]
Remove dead code

4 years agoMerge #3953
bors[bot] [Sat, 11 Apr 2020 20:58:59 +0000 (20:58 +0000)]
Merge #3953

3953: Remove #[should_panic] from call_info tests r=matklad a=kjeremy

Better fix than #3952

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoRemove #[should_panic] from call_info tests
Jeremy Kolb [Sat, 11 Apr 2020 19:47:09 +0000 (15:47 -0400)]
Remove #[should_panic] from call_info tests

4 years agoMerge #3925
bors[bot] [Sat, 11 Apr 2020 18:40:46 +0000 (18:40 +0000)]
Merge #3925

3925: Implement assist "Reorder field names" r=matklad a=geoffreycopin

This PR implements the "Reorder record fields" assist as discussed in issue #3821 .

Adding a `RecordFieldPat` variant to the `Pat` enum seemed like the easiest way to handle the `RecordPat` children as a single sequence of elements, maybe there is a better way ?

Co-authored-by: Geoffrey Copin <copin.geoffrey@gmail.com>
4 years agoGenerate doc
Geoffrey Copin [Sat, 11 Apr 2020 18:32:58 +0000 (20:32 +0200)]
Generate doc

4 years agoFix doc tests
Geoffrey Copin [Sat, 11 Apr 2020 18:32:48 +0000 (20:32 +0200)]
Fix doc tests

4 years agoAdd documentation comment
Geoffrey Copin [Sat, 11 Apr 2020 17:39:10 +0000 (19:39 +0200)]
Add documentation comment

4 years agoMerge #3951
bors[bot] [Sat, 11 Apr 2020 17:37:02 +0000 (17:37 +0000)]
Merge #3951

3951: Simplify records grammar r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove dead code
Aleksey Kladov [Sat, 11 Apr 2020 17:25:33 +0000 (19:25 +0200)]
Remove dead code

4 years agoAvoid adding a RecordFieldPat variant to the Pat enum
Geoffrey Copin [Sat, 11 Apr 2020 15:04:25 +0000 (17:04 +0200)]
Avoid adding a RecordFieldPat variant to the Pat enum

4 years agoMake records grammar more orthogonal
Aleksey Kladov [Sat, 11 Apr 2020 14:42:24 +0000 (16:42 +0200)]
Make records grammar more orthogonal

We used

  name [: expr]

grammar before, now it is

  [name :] expr

which makes things simpler

4 years agofix: inlay hints config desyncronization between the frontend and the backend
veetaha [Sat, 11 Apr 2020 15:22:13 +0000 (18:22 +0300)]
fix: inlay hints config desyncronization between the frontend and the backend

See the explanation in the issue comment:
https://github.com/rust-analyzer/rust-analyzer/issues/3924#issuecomment-612444566

4 years agoMerge #3944
bors[bot] [Sat, 11 Apr 2020 16:21:28 +0000 (16:21 +0000)]
Merge #3944

3944: Look up trait impls by self type r=matklad a=flodiebold

This speeds up inference in analysis-stats by ~30% (even more with the recursive solver).

There's a slight difference in inferred types, which I think comes from pre-existing wrong handling of error types in impls, so I think it's fine.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoLook up impls by self type
Florian Diebold [Sat, 11 Apr 2020 11:11:33 +0000 (13:11 +0200)]
Look up impls by self type

This speeds up inference in analysis-stats by ~30% (even more with the recursive
solver).

4 years agoMerge #3949
bors[bot] [Sat, 11 Apr 2020 15:55:26 +0000 (15:55 +0000)]
Merge #3949

3949: Cleanup cfg handling in items r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMake incremental nameres test harder
Aleksey Kladov [Sat, 11 Apr 2020 15:54:46 +0000 (17:54 +0200)]
Make incremental nameres test harder

4 years agoAvoid cyclic queries in name resolution when processing enums
Aleksey Kladov [Sat, 11 Apr 2020 15:52:26 +0000 (17:52 +0200)]
Avoid cyclic queries in name resolution when processing enums

4 years agoAlign naming
Aleksey Kladov [Sat, 11 Apr 2020 15:20:26 +0000 (17:20 +0200)]
Align naming

4 years agoRemove code duplication
Aleksey Kladov [Sat, 11 Apr 2020 15:18:42 +0000 (17:18 +0200)]
Remove code duplication

4 years agoUse Expander for cfg handling in structs
Aleksey Kladov [Sat, 11 Apr 2020 15:17:12 +0000 (17:17 +0200)]
Use Expander for cfg handling in structs

4 years agoUse Expander for cfg handling in impls
Aleksey Kladov [Sat, 11 Apr 2020 15:12:17 +0000 (17:12 +0200)]
Use Expander for cfg handling in impls

4 years agoPull Expander up
Aleksey Kladov [Sat, 11 Apr 2020 15:09:50 +0000 (17:09 +0200)]
Pull Expander up

4 years agoSimplify
Aleksey Kladov [Sat, 11 Apr 2020 15:00:31 +0000 (17:00 +0200)]
Simplify

4 years agomissing match arm add test for partially diverging type
Josh Mcguigan [Sat, 11 Apr 2020 14:13:47 +0000 (07:13 -0700)]
missing match arm add test for partially diverging type

4 years agomissing match arms add tests for match expression diverging
Josh Mcguigan [Sat, 11 Apr 2020 14:07:47 +0000 (07:07 -0700)]
missing match arms add tests for match expression diverging

4 years agoMerge pull request #3935 from cjhopman/todo
Aleksey Kladov [Sat, 11 Apr 2020 14:05:23 +0000 (16:05 +0200)]
Merge pull request #3935 from cjhopman/todo

Change missing impl assist to use todo!() instead of unimplemented()

4 years agoMerge #3942
bors[bot] [Sat, 11 Apr 2020 13:26:17 +0000 (13:26 +0000)]
Merge #3942

3942: vscode: fix typing bug in config r=matklad a=Veetaha

I noticed that the type of nullable properties in config is actually non-nullable
![Screenshot from 2020-04-11 15-29-45](https://user-images.githubusercontent.com/36276403/79043702-6a686d80-7c09-11ea-9ae8-f1a777c7d0f2.png)

Co-authored-by: veetaha <veetaha2@gmail.com>
4 years agoMerge #3943
bors[bot] [Sat, 11 Apr 2020 12:49:03 +0000 (12:49 +0000)]
Merge #3943

3943: vscode: fix indent r=matklad a=Veetaha

Co-authored-by: veetaha <veetaha2@gmail.com>
4 years agoMerge pull request #3910 from lnicola/fn-named-param-hint
Aleksey Kladov [Sat, 11 Apr 2020 12:48:14 +0000 (14:48 +0200)]
Merge pull request #3910 from lnicola/fn-named-param-hint

Hide parameter hints for single-argument functions with the same name

4 years agoMerge pull request #3940 from lnicola/cargo-audit
Aleksey Kladov [Sat, 11 Apr 2020 12:46:20 +0000 (14:46 +0200)]
Merge pull request #3940 from lnicola/cargo-audit

Use actions-rs/install and /audit-check for cargo-audit

4 years agovscode: fix typing bug in config
veetaha [Sat, 11 Apr 2020 12:23:07 +0000 (15:23 +0300)]
vscode: fix typing bug in config

4 years agovscode: fix indent
veetaha [Sat, 11 Apr 2020 12:36:16 +0000 (15:36 +0300)]
vscode: fix indent

4 years agoMerge #3920
bors[bot] [Sat, 11 Apr 2020 11:49:07 +0000 (11:49 +0000)]
Merge #3920

3920: Implement expand_task and list_macros in proc_macro_srv r=matklad a=edwin0cheng

This PR finish up the remain `proc_macro_srv` implementation :

1. Added dylib loading code for proc-macro crate dylib. Note that we have to add some special flags for unix loading because of a bug in old version of glibc, see https://github.com/fedochet/rust-proc-macro-panic-inside-panic-expample/issues/1 and https://github.com/rust-lang/rust/issues/60593 for details.

2. Added tests for proc-macro expansion: We use a trick here by adding `serde_derive` to dev-dependencies and calling `cargo-metadata` for searching its dylib path, and expand it in our tests.

[EDIT]
Note that this PR **DO NOT** implement the final glue code with rust-analzyer and proc-macro-srv yet.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoMerge #3939
bors[bot] [Sat, 11 Apr 2020 11:41:40 +0000 (11:41 +0000)]
Merge #3939

3939: Fix non canonicallized path from metadata r=matklad a=edwin0cheng

Crate root path obtained from cargo-metadata may contains non-canonicalized path (e.g. `/foo/../libcore/tests/lib.rs`), such that `vfs::load` will find a incorrect root.

This PR try to fix that by canonicalize it before passing to vfs.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoUse actions-rs/install and /audit-check for cargo-audit
Laurențiu Nicola [Sat, 11 Apr 2020 10:50:32 +0000 (13:50 +0300)]
Use actions-rs/install and /audit-check for cargo-audit

4 years agoRemove Option unwraping
Geoffrey Copin [Sat, 11 Apr 2020 10:58:20 +0000 (12:58 +0200)]
Remove Option unwraping

4 years agoFix non canonicallized path for crate file
Edwin Cheng [Sat, 11 Apr 2020 10:12:50 +0000 (18:12 +0800)]
Fix non canonicallized path for crate file

4 years agoImprove error handling
Edwin Cheng [Sat, 11 Apr 2020 06:53:13 +0000 (14:53 +0800)]
Improve error handling

4 years agofix match arm false positive
Josh Mcguigan [Sat, 11 Apr 2020 03:14:53 +0000 (20:14 -0700)]
fix match arm false positive

4 years agoMerge #3937
bors[bot] [Fri, 10 Apr 2020 22:29:04 +0000 (22:29 +0000)]
Merge #3937

3937: Forward compat r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoForward compat
Aleksey Kladov [Fri, 10 Apr 2020 22:27:00 +0000 (00:27 +0200)]
Forward compat

4 years agoChange missing impl assist to use todo!() instead of unimplemented()
Chris Hopman [Fri, 10 Apr 2020 20:41:11 +0000 (13:41 -0700)]
Change missing impl assist to use todo!() instead of unimplemented()

todo!() "Indicates unfinished code" (https://doc.rust-lang.org/std/macro.todo.html)

Rust documentation provides further clarification:

> The difference between unimplemented! and todo! is that while todo!
> conveys an intent of implementing the functionality later and the
> message is "not yet implemented", unimplemented! makes no such claims.

todo!() seems more appropriate for assists that insert missing impls.

4 years agoMerge #3933
bors[bot] [Fri, 10 Apr 2020 19:16:32 +0000 (19:16 +0000)]
Merge #3933

3933: Fix accidently quadratic behavior when processing include! r=matklad a=matklad

This fixes the immediate problem behind #3927. It doesn't yet fix the deeper problem with `to_node` being quadratic (hence the test is ignored), but it is a good start anyway.

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMove timeit to stdx
Aleksey Kladov [Fri, 10 Apr 2020 18:46:42 +0000 (20:46 +0200)]
Move timeit to stdx

4 years agoMerge #3931
bors[bot] [Fri, 10 Apr 2020 18:27:12 +0000 (18:27 +0000)]
Merge #3931

3931: profile queries r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoprofile queries
Aleksey Kladov [Fri, 10 Apr 2020 18:25:55 +0000 (20:25 +0200)]
profile queries