Commit graph

15670 commits

Author SHA1 Message Date
bors[bot]
0c2f570151
Merge #8012
8012: xtask: replace "lint" command by a simply cargo alias r=matklad a=matthiaskrgr

This strips the run_clippy implementation out of xtask and replaces it by
a simple "cargo lint" alias which runs clippy with the corresponding flags.

Unfortunately  I could not name the alias "clippy" because that would lead to infinite recursion. 😅 

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
2021-03-14 13:10:06 +00:00
Matthias Krüger
5008e56821 xtask: replace "lint" command by a simply cargo alias
This strips the run_clippy implementation out of xtask and replaces it by
a simple "cargo lint" alias which runs clippy with the corresponding flags.

Unfortunately  I could not name the alias "clippy" because that would lead to infinite recursion.
2021-03-14 13:36:45 +01:00
bors[bot]
a8a7fa8347
Merge #8011
8011: Add no-sysroot flag for analysis-stats r=edwin0cheng a=edwin0cheng

Add `no-sysroot` flag for `rust-analyzer analysis-stats`. It is very useful for debugging propose. 

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-14 10:50:59 +00:00
Edwin Cheng
8cc0c7f420 Add no-sysroot flag for analysis-stats 2021-03-14 18:31:14 +08:00
ivan770
8a9ebe62a1
Skip ref_match on same types, remove sorting in tests 2021-03-14 12:25:37 +02:00
bors[bot]
48adf6b697
Merge #8010
8010: Attach trivia to ast::Union nodes r=Veykril a=Veykril

Closes #8007
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-14 10:13:38 +00:00
Lukas Wirth
6e6d75bbdc Attach trivia to ast::Union nodes 2021-03-14 11:11:01 +01:00
bors[bot]
ab3f584299
Merge #8006
8006: Simpify mbe bindings builder r=edwin0cheng a=edwin0cheng

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-14 03:57:58 +00:00
Edwin Cheng
7279749bbb Simpify mbe bindings builder 2021-03-14 11:54:19 +08:00
bors[bot]
7808982952
Merge #8005
8005: Make sure ill-form macro handle propely r=edwin0cheng a=edwin0cheng

Fix #7987

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-14 03:26:32 +00:00
Edwin Cheng
b3b91046dd Make sure ill-form macro handle propely 2021-03-14 11:24:55 +08:00
bors[bot]
f80e1080d3
Merge #8003
8003: Move type lowering methods to TyLoweringContext r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-13 21:45:30 +00:00
Florian Diebold
3743ede404 Move type lowering methods to TyLoweringContext 2021-03-13 22:44:36 +01:00
bors[bot]
d3ca2ab959
Merge #8002
8002: Create TraitEnvironment through a query r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-13 19:39:54 +00:00
Florian Diebold
c82d1823a1 Create TraitEnvironment through a query 2021-03-13 20:38:45 +01:00
bors[bot]
17eeb2a6d2
Merge #8001
8001: More Chalk IDs r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-13 19:08:29 +00:00
Florian Diebold
b035c314b4 Use chalk_ir::OpaqueTyId 2021-03-13 20:05:47 +01:00
Florian Diebold
1bf6b7360c Use chalk_ir::PlaceholderIndex 2021-03-13 19:47:34 +01:00
Florian Diebold
2d69eb131f Use chalk_ir::ClosureId 2021-03-13 19:27:09 +01:00
bors[bot]
be7a31fbd6
Merge #7999
7999: Handle `cfg_attr` gating multiple attributes r=jonas-schievink a=jonas-schievink

Apparently `#[cfg_attr(cfg_expr, attr1, attr2)]` is valid, so let's add support for that.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-13 17:20:16 +00:00
Jonas Schievink
1848bd0fa0 Handle cfg_attr gating multiple attributes 2021-03-13 18:18:42 +01:00
Jonas Schievink
72785fb94d Extend cfg_attr test 2021-03-13 18:18:05 +01:00
bors[bot]
6ab405f2e9
Merge #7998
7998: Use more Chalk IDs r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-13 16:58:04 +00:00
Florian Diebold
9719ce9fc7 Use chalk_ir::FnDefId 2021-03-13 17:56:48 +01:00
Florian Diebold
19664e276a Use chalk_ir::AssocTypeId 2021-03-13 17:56:48 +01:00
Florian Diebold
dfafcd926a Use chalk_ir::ForeignDefId 2021-03-13 17:56:48 +01:00
ivan770
661cc7f0c8
Added both references and original matches to tests 2021-03-13 18:31:52 +02:00
bors[bot]
d453378569
Merge #7997
7997: fix folding range kind r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-03-13 16:25:02 +00:00
Aleksey Kladov
a9c3e70443 fix folding range kind 2021-03-13 19:24:28 +03:00
ivan770
32ad929b82
Fix incorrect DerefMut test reference type 2021-03-13 17:28:05 +02:00
ivan770
3bc5d81a33
Make relevance tests display references, suggest derefs only when needed 2021-03-13 17:25:41 +02:00
bors[bot]
bcf2169e7d
Merge #7996
7996: Separate `Ty` and `TyKind` like in Chalk r=flodiebold a=flodiebold

Currently `Ty` just wraps `TyKind`, but this allows us to change most
places to already use `intern` / `interned`.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-13 15:18:38 +00:00
Florian Diebold
6c32bbf3ca Separate Ty and TyKind like in Chalk
Currently `Ty` just wraps `TyKind`, but this allows us to change most
places to already use `intern` / `interned`.
2021-03-13 16:17:15 +01:00
bors[bot]
7accf6bc37
Merge #7799
7799: Related tests r=matklad a=vsrs

![tests](https://user-images.githubusercontent.com/62505555/109397453-a9013680-7947-11eb-8b11-ac03079f7645.gif)
This adds an ability to look for tests for the item under the cursor: function, constant, data type, etc

The LSP part is bound to change. But the feature itself already works and I'm looking for a feedback :)



Co-authored-by: vsrs <vit@conrlab.com>
2021-03-13 13:50:35 +00:00
ivan770
75cb441fba
Simplify call site and deref completion test 2021-03-13 15:32:37 +02:00
bors[bot]
9674490b45
Merge #7981
7981: Allow applying De Morgan's law to multiple terms at once r=matklad a=shepmaster



Co-authored-by: Jake Goulding <jake.goulding@gmail.com>
2021-03-13 13:31:55 +00:00
bors[bot]
ceffcf8a11
Merge #7984
7984: Improve version display r=matklad a=lnicola

Maybe closes #7854

The version string for unreleased builds looks like this now:

```
$ rust-analyzer --version
rust-analyzer 2021-03-08-159-gc0459c535
```

Release builds should only have the tag name (`2021-03-15`).

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-03-13 13:22:25 +00:00
bors[bot]
fe4a94fff3
Merge #7994
7994: Speed up mbe matching in heavy recursive cases r=edwin0cheng a=edwin0cheng

In some cases (e.g.  #4186), mbe matching is very slow due to a lot of copy and allocation for bindings, this PR try to solve this problem by introduce a semi "link-list" approach for bindings building.

I used this [test case](https://github.com/weiznich/minimal_example_for_rust_81262) (for `features(32-column-tables)`) to run following command to benchmark:
```
time rust-analyzer analysis-stats  --load-output-dirs ./ 
```

Before this PR : 2 mins
After this PR: 3 seconds.

However, for 64-column-tables cases, we still need 4 mins to complete. 

I will try to investigate in the following weeks.

bors r+




Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-13 13:04:45 +00:00
Edwin Cheng
9117148f42 Add bindings builder for speed up matching 2021-03-13 20:52:36 +08:00
ivan770
d064ed5f63
Count derefs as matched types if possible 2021-03-13 14:34:11 +02:00
Edwin Cheng
f1350dd93c add expand log 2021-03-13 20:14:21 +08:00
bors[bot]
88f78bdb9b
Merge #7991
7991: Simplify hir_def TestDB r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-13 01:25:33 +00:00
Jonas Schievink
2b5ea5c730 Simplify hir_def TestDB 2021-03-13 02:24:53 +01:00
bors[bot]
5368e2c103
Merge #7989
7989: Remove `ItemTree::source` r=jonas-schievink a=jonas-schievink

`HasSource` should be used instead

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-12 22:55:02 +00:00
Jonas Schievink
8447f101ac Remove ItemTree::source
`HasSource` should be used instead
2021-03-12 23:54:29 +01:00
bors[bot]
437527b226
Merge #7986
7986: Simplify a bit r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-03-12 19:52:07 +00:00
Florian Diebold
784636f1c1 Simplify a bit 2021-03-12 20:51:29 +01:00
bors[bot]
05814e542f
Merge #7985
7985: Use Chalk Environment more directly r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2021-03-12 19:41:23 +00:00
Florian Diebold
ec70387a4c Use Chalk Environment more directly 2021-03-12 19:12:17 +01:00
Laurențiu Nicola
88ef0541a5 Improve version display 2021-03-12 19:49:00 +02:00