]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoFix formatting
Laurențiu Nicola [Tue, 17 Aug 2021 16:25:37 +0000 (19:25 +0300)]
Fix formatting

2 years agoproc_macro_api: make commit & date suffix of binary version optional
Florian sp1rit​ [Mon, 16 Aug 2021 11:23:53 +0000 (13:23 +0200)]
proc_macro_api: make commit & date suffix of binary version optional

Signed-off-by: Florian "sp1rit"​ <sp1ritCS@protonmail.com>
2 years agoMerge #9928
bors[bot] [Mon, 16 Aug 2021 19:26:18 +0000 (19:26 +0000)]
Merge #9928

9928: internal: Highlight function exit points on `fn` keyword r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoHighlight function exit points on `fn` keyword
Lukas Wirth [Mon, 16 Aug 2021 19:25:22 +0000 (21:25 +0200)]
Highlight function exit points on `fn` keyword

2 years agoMerge #9927
bors[bot] [Mon, 16 Aug 2021 19:04:57 +0000 (19:04 +0000)]
Merge #9927

9927: minor: Fix some clippy lints r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix some clippy lints
Laurențiu Nicola [Mon, 16 Aug 2021 19:04:26 +0000 (22:04 +0300)]
Fix some clippy lints

2 years agoMerge #9921
bors[bot] [Mon, 16 Aug 2021 16:38:44 +0000 (16:38 +0000)]
Merge #9921

9921: Only add entries to SourceToDef dynmaps when they come from the same file r=matklad a=Veykril

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

Running the test as described in the issue I do not get any eprintln output at all anymore.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agostyle
Lukas Wirth [Mon, 16 Aug 2021 16:29:16 +0000 (18:29 +0200)]
style

2 years agoMerge #9924
bors[bot] [Mon, 16 Aug 2021 16:25:57 +0000 (16:25 +0000)]
Merge #9924

9924: Fix gen debug for enums r=yoshuawuyts a=yoshuawuyts

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9914. Thanks!

r? `@Veykril`

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2 years agoimplement feedback from review
Yoshua Wuyts [Mon, 16 Aug 2021 16:23:51 +0000 (18:23 +0200)]
implement feedback from review

2 years agoFlatten SourceToDefCache structure
Lukas Wirth [Mon, 16 Aug 2021 15:55:18 +0000 (17:55 +0200)]
Flatten SourceToDefCache structure

2 years agofix debug tuple structs
Yoshua Wuyts [Mon, 16 Aug 2021 15:39:08 +0000 (17:39 +0200)]
fix debug tuple structs

2 years agoOnly add entries to SourceToDef dynmaps when they come from the same file
Lukas Wirth [Mon, 16 Aug 2021 15:07:25 +0000 (17:07 +0200)]
Only add entries to SourceToDef dynmaps when they come from the same file

2 years agoMerge #9920
bors[bot] [Mon, 16 Aug 2021 14:13:04 +0000 (14:13 +0000)]
Merge #9920

9920: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Mon, 16 Aug 2021 14:12:20 +0000 (16:12 +0200)]
Simplify

2 years agoMerge #9918
bors[bot] [Mon, 16 Aug 2021 11:46:21 +0000 (11:46 +0000)]
Merge #9918

9918: minor: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: simplify
Aleksey Kladov [Mon, 16 Aug 2021 11:45:54 +0000 (14:45 +0300)]
minor: simplify

2 years agoMerge #9917
bors[bot] [Mon, 16 Aug 2021 11:32:43 +0000 (11:32 +0000)]
Merge #9917

9917: minor: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: remove dead code
Aleksey Kladov [Mon, 16 Aug 2021 11:27:36 +0000 (14:27 +0300)]
minor: remove dead code

2 years agofix debug record structs
Yoshua Wuyts [Mon, 16 Aug 2021 10:58:06 +0000 (12:58 +0200)]
fix debug record structs

2 years agoMerge #9905
bors[bot] [Sun, 15 Aug 2021 10:26:59 +0000 (10:26 +0000)]
Merge #9905

9905: internal: optimize compile time r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: optimize compile time
Aleksey Kladov [Sun, 15 Aug 2021 10:24:37 +0000 (13:24 +0300)]
internal: optimize compile time

cargo llvm-lines shows that path_to_error bloats the code. I don't think
I've needed this functionality recently, seems that we've fixed most of
the serialization problems. So let's just remove it. Should be easy to
add back if we ever need it, and it does make sense to keep the
`from_json` function around.

2 years agoMerge #9902
bors[bot] [Sat, 14 Aug 2021 17:43:52 +0000 (17:43 +0000)]
Merge #9902

9902: minor: move functionality to a better place r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: move functionality to a better place
Aleksey Kladov [Sat, 14 Aug 2021 17:38:31 +0000 (20:38 +0300)]
minor: move functionality to a better place

2 years agoMerge #9901
bors[bot] [Sat, 14 Aug 2021 17:30:13 +0000 (17:30 +0000)]
Merge #9901

9901: internal: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove dead code
Aleksey Kladov [Sat, 14 Aug 2021 17:29:46 +0000 (20:29 +0300)]
internal: remove dead code

2 years agoMerge #9900
bors[bot] [Sat, 14 Aug 2021 17:17:51 +0000 (17:17 +0000)]
Merge #9900

9900: internal: remove one more usage of old editing API. r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove one more usage of old editing API.
Aleksey Kladov [Sat, 14 Aug 2021 17:17:16 +0000 (20:17 +0300)]
internal: remove one more usage of old editing API.

2 years agoMerge #9899
bors[bot] [Sat, 14 Aug 2021 17:10:04 +0000 (17:10 +0000)]
Merge #9899

9899: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sat, 14 Aug 2021 17:06:35 +0000 (19:06 +0200)]
Simplify

2 years agoMerge #9897
bors[bot] [Sat, 14 Aug 2021 16:46:19 +0000 (16:46 +0000)]
Merge #9897

9897: internal: remove old editing API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove old editing API
Aleksey Kladov [Sat, 14 Aug 2021 16:45:47 +0000 (19:45 +0300)]
internal: remove old editing API

2 years agoMerge #9896
bors[bot] [Sat, 14 Aug 2021 16:19:14 +0000 (16:19 +0000)]
Merge #9896

9896: internal: Only complete type annotations for patterns in function params r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoOnly complete type annotations for patterns in function params
Lukas Wirth [Sat, 14 Aug 2021 16:18:18 +0000 (18:18 +0200)]
Only complete type annotations for patterns in function params

2 years agoMerge #9895
bors[bot] [Sat, 14 Aug 2021 16:07:09 +0000 (16:07 +0000)]
Merge #9895

9895: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sat, 14 Aug 2021 16:02:51 +0000 (18:02 +0200)]
Simplify

2 years agoMerge #9894
bors[bot] [Sat, 14 Aug 2021 15:59:47 +0000 (15:59 +0000)]
Merge #9894

9894: internal: use standard test style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: use standard test style
Aleksey Kladov [Sat, 14 Aug 2021 15:53:21 +0000 (18:53 +0300)]
internal: use standard test style

2 years agoMerge #9893
bors[bot] [Sat, 14 Aug 2021 15:52:48 +0000 (15:52 +0000)]
Merge #9893

9893: fix: Don't use uncached syntax nodes in `generate_function` for sema lookups r=Veykril a=Veykril

Fixes the crash in the comment here https://github.com/rust-analyzer/rust-analyzer/issues/9382#issuecomment-896101298
Couldn't make out a repro test for this unfortunately
still not idea about the original issue

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't use non cache syntaxnodes in generate_function for lookups
Lukas Wirth [Sat, 14 Aug 2021 15:42:06 +0000 (17:42 +0200)]
Don't use non cache syntaxnodes in generate_function for lookups

2 years agoMerge #9892
bors[bot] [Sat, 14 Aug 2021 15:40:20 +0000 (15:40 +0000)]
Merge #9892

9892: internal: remove a remnant of old editing infra r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: make assist naming consistent
Aleksey Kladov [Sat, 14 Aug 2021 15:28:38 +0000 (18:28 +0300)]
internal: make assist naming consistent

2 years agointernal: remove a remnant of old editing infra
Aleksey Kladov [Sat, 14 Aug 2021 15:24:42 +0000 (18:24 +0300)]
internal: remove a remnant of old editing infra

2 years agoMerge #9890
bors[bot] [Sat, 14 Aug 2021 15:11:17 +0000 (15:11 +0000)]
Merge #9890

9890: internal: refactor binary operator handling r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: merge hir::BinaryOp and ast::BinOp
Aleksey Kladov [Sat, 14 Aug 2021 15:08:31 +0000 (18:08 +0300)]
internal: merge hir::BinaryOp and ast::BinOp

2 years agointernal: prepare to merge hir::BinaryOp and ast::BinOp
Aleksey Kladov [Sat, 14 Aug 2021 14:07:51 +0000 (17:07 +0300)]
internal: prepare to merge hir::BinaryOp and ast::BinOp

2 years agointernal: make naming consistent
Aleksey Kladov [Sat, 14 Aug 2021 14:01:28 +0000 (17:01 +0300)]
internal: make naming consistent

2 years agointernal: prepare a dedicated module for all operators
Aleksey Kladov [Sat, 14 Aug 2021 13:58:46 +0000 (16:58 +0300)]
internal: prepare a dedicated module for all operators

2 years agoMerge #9889
bors[bot] [Sat, 14 Aug 2021 13:41:00 +0000 (13:41 +0000)]
Merge #9889

9889: Update manual.adoc: added juCi++ section r=lnicola a=eidheim

Co-authored-by: Ole Christian Eidheim <eidheim@gmail.com>
2 years agointernal: make invert binary op more robust
Aleksey Kladov [Sat, 14 Aug 2021 13:40:00 +0000 (16:40 +0300)]
internal: make invert binary op more robust

Previously, we only inverted comparison operators (< and the like) if
the type implemented Ord. This doesn't make sense: if `<` works, then
`>=` will work as well!

Extra semantic checks greatly reduce robustness and predictability of
the assist, it's better to keep things simple.

2 years agoUpdate manual.adoc: added juCi++ section
Ole Christian Eidheim [Sat, 14 Aug 2021 10:47:58 +0000 (12:47 +0200)]
Update manual.adoc: added juCi++ section

2 years agoMerge #9882
bors[bot] [Sat, 14 Aug 2021 07:39:46 +0000 (07:39 +0000)]
Merge #9882

9882: fix: Don't call deprecated `compile` regex method r=lnicola a=lnicola

Fixes #9872

It looks like `compile` expects to be called like `RegExp.compile("foo", "m")`, so calling `.compile()` on an existing regex replaces it with an empty one.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #9886
bors[bot] [Fri, 13 Aug 2021 22:12:58 +0000 (22:12 +0000)]
Merge #9886

9886: feat: type inference for if-let guards r=jonas-schievink a=jonas-schievink

This turned out fairly simple

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agofeat: type inference for if-let guards
Jonas Schievink [Fri, 13 Aug 2021 22:09:30 +0000 (00:09 +0200)]
feat: type inference for if-let guards

2 years agoMerge #9884
bors[bot] [Fri, 13 Aug 2021 15:24:35 +0000 (15:24 +0000)]
Merge #9884

9884: cargo update r=kjeremy a=kjeremy

Remove paste-impl and proc-macro-hack.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2 years agocargo update
Jeremy Kolb [Fri, 13 Aug 2021 15:08:24 +0000 (11:08 -0400)]
cargo update

2 years agoMerge #9871
bors[bot] [Fri, 13 Aug 2021 11:19:16 +0000 (11:19 +0000)]
Merge #9871

9871: Jump to generated func r=mahdi-frms a=rylev

Worked on this with `@yoshuawuyts.`

We thought we ran into an issue with the `generate_function` assist where the code was not being generated in a certain situations. However, it wasn't actually a bug just a very confusing implementation where the cursor is not moved to the newly generated function. This happened when the return type was successfully inferred (and not unit). The function would be generated, but selection would not be changed.

This can be very confusing: If the function is generated somewhat far from where the assist is being invoked, the user never sees that the code was generated (nor are they given the chance to actually implement the function body).

This PR makes it so that the cursor is _always_ moved to somewhere in the newly generated function. In addition, if we can infer unit as the type, then we do not still generate `-> ()` as the return type. Instead, we simply omit the return type.

This means the selection will move to either one of two places:
* A generated `-> ()` return type when we cannot successfully infer the return type.
* The `todo!()` body when we can successfully infer the return type.

Co-authored-by: Ryan Levick <me@ryanlevick.com>
2 years agoDon't call deprecated compile regex method
Laurențiu Nicola [Fri, 13 Aug 2021 11:16:33 +0000 (14:16 +0300)]
Don't call deprecated compile regex method

2 years agoAdd documentation on how whether a generated return type should be focused or not
Ryan Levick [Fri, 13 Aug 2021 09:44:29 +0000 (11:44 +0200)]
Add documentation on how whether a generated return type should be focused or not

2 years agoMerge #9879
bors[bot] [Thu, 12 Aug 2021 22:28:04 +0000 (22:28 +0000)]
Merge #9879

9879: feat: Support `if let` match guards r=jonas-schievink a=jonas-schievink

Adds support for parsing and computing bindings for `if let` match guards (https://github.com/rust-lang/rust/issues/51114). Type inference support is still missing, but shouldn't be hard to add in a follow-up PR.

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoSupport `if let` match guards
Jonas Schievink [Thu, 12 Aug 2021 22:21:42 +0000 (00:21 +0200)]
Support `if let` match guards

2 years agoMerge #9874
bors[bot] [Thu, 12 Aug 2021 19:45:06 +0000 (19:45 +0000)]
Merge #9874

9874: fix: Always add implicit `proc_macro` dependency r=jonas-schievink a=jonas-schievink

Even crates that don't set `proc-macro = true` are allowed to depend on `proc_macro` (just none of the APIs work when called outside of a proc macro).

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoAlways add implicit `proc_macro` dependency
Jonas Schievink [Thu, 12 Aug 2021 19:42:14 +0000 (21:42 +0200)]
Always add implicit `proc_macro` dependency

2 years agoMerge #9807
bors[bot] [Thu, 12 Aug 2021 17:55:29 +0000 (17:55 +0000)]
Merge #9807

9807: Implicit `Sized` bounds r=iDawer a=iDawer

This should close #8984

`hir_ty`:
- Type parameters, associated types and `impl Trait` are `Sized` by deafault except `Self` in a trait.
- Implicit `Sized` bound is added to end of predicate list. It does not check if such bound is present already. Also it does not track the bound is implicit.
- Allowed ambiguous unsize coercion if Chalk returns definite guidance.
- Allowed ambiguous autoderef if Chalk returns definite guidance.

`hir_def`:
- `ItemTree` pretty printing shows `?Sized` bounds.

`HirDisplay`:
- `impl Trait` with weird bounds rendered correctly.
- `Sized`/`?Sized` bounds are not shown if they are default.

### Perf
`./target/rust-analyzer-baseline_8a843113 -q analysis-stats --memory-usage .`
```
Database loaded:     1.63s, 287minstr, 91mb
  crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection:     26.80s, 73ginstr, 338mb
  exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 174
Inference:           50.28s, 116ginstr, 516mb
Total:               77.08s, 189ginstr, 855mb
```

`./target/rust-analyzer-sized-fixed_ambig_coercion-de074fe6 -q analysis-stats --memory-usage .`
```
Database loaded:     1.63s, 287minstr, 91mb
  crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection:     26.95s, 73ginstr, 338mb
  exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 166
Inference:           96.39s, 234ginstr, 543mb
Total:               123.33s, 307ginstr, 881mb
```

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agoClean up
Dawer [Thu, 12 Aug 2021 14:31:00 +0000 (19:31 +0500)]
Clean up

2 years agoFactor out return type handling for both function and method
Ryan Levick [Thu, 12 Aug 2021 14:05:32 +0000 (16:05 +0200)]
Factor out return type handling for both function and method

2 years agoAlways fall back to focusing on generated function body
Ryan Levick [Thu, 12 Aug 2021 12:56:39 +0000 (14:56 +0200)]
Always fall back to focusing on generated function body

2 years agoMerge #9869
bors[bot] [Thu, 12 Aug 2021 12:11:09 +0000 (12:11 +0000)]
Merge #9869

9869: Use term "method" on label for generating method impl r=Veykril a=rylev

When showing the user the `generate_function` assist, use the term "method" when generating a method instead of the term "function" (which is correct but maybe not the most appropriate in that context).

Co-authored-by: Ryan Levick <me@ryanlevick.com>
2 years agoUse term on label for generating method impl
Ryan Levick [Thu, 12 Aug 2021 11:59:08 +0000 (13:59 +0200)]
Use term  on label for generating method impl

2 years agoMerge #9863
bors[bot] [Thu, 12 Aug 2021 10:18:02 +0000 (10:18 +0000)]
Merge #9863

9863: feat: Generate default trait fn impl when generating `PartialEq` r=yoshuawuyts a=yoshuawuyts

Implements a default trait function body when generating the `PartialEq` trait for a type. Thanks!

r? `@veykril`

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2 years agoadd `make::ext::path_from_idents`
Yoshua Wuyts [Thu, 12 Aug 2021 10:17:09 +0000 (12:17 +0200)]
add `make::ext::path_from_idents`

2 years agoimplement feedback from review
Yoshua Wuyts [Thu, 12 Aug 2021 09:50:01 +0000 (11:50 +0200)]
implement feedback from review

2 years agorm remaining todo comment
Yoshua Wuyts [Wed, 11 Aug 2021 21:30:00 +0000 (23:30 +0200)]
rm remaining todo comment

2 years agoimprove codegen
Yoshua Wuyts [Wed, 11 Aug 2021 18:33:13 +0000 (20:33 +0200)]
improve codegen

2 years agofinishing touches
Yoshua Wuyts [Wed, 11 Aug 2021 18:04:05 +0000 (20:04 +0200)]
finishing touches

2 years agogen partialeq for tuple enums
Yoshua Wuyts [Wed, 11 Aug 2021 18:01:19 +0000 (20:01 +0200)]
gen partialeq for tuple enums

2 years agodedup PartialEq for Record enums
Yoshua Wuyts [Wed, 11 Aug 2021 17:40:47 +0000 (19:40 +0200)]
dedup PartialEq for Record enums

2 years agoAccept ambiguous unsize coercion only if it has definite guidance.
Dawer [Wed, 11 Aug 2021 17:09:32 +0000 (22:09 +0500)]
Accept ambiguous unsize coercion only if it has definite guidance.

2 years agoMerge #9862
bors[bot] [Wed, 11 Aug 2021 16:13:29 +0000 (16:13 +0000)]
Merge #9862

9862: internal: Fill out expected type for functional update syntax completion r=Veykril a=Veykril

Last part of https://github.com/rust-analyzer/rust-analyzer/issues/9839
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFill out expected type for functional update syntax completion
Lukas Wirth [Wed, 11 Aug 2021 16:05:39 +0000 (18:05 +0200)]
Fill out expected type for functional update syntax completion

2 years agoMerge #9861
bors[bot] [Wed, 11 Aug 2021 15:53:09 +0000 (15:53 +0000)]
Merge #9861

9861: fix: `extract_variable` handles selection ranges better r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoextract_variable handles selection ranges better
Lukas Wirth [Wed, 11 Aug 2021 15:52:09 +0000 (17:52 +0200)]
extract_variable handles selection ranges better

2 years agogen PartialEq for Record enums
Yoshua Wuyts [Wed, 11 Aug 2021 15:15:12 +0000 (17:15 +0200)]
gen PartialEq for Record enums

Co-Authored-By: Ryan Levick <rylev@users.noreply.github.com>
2 years agoMerge #9860
bors[bot] [Wed, 11 Aug 2021 15:10:26 +0000 (15:10 +0000)]
Merge #9860

9860: fix: Fix extract_function tagging params as mut unnecessarily r=Veykril a=Veykril

Fixes #9822
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix extract_function tagging params as mut unnecessarily
Lukas Wirth [Wed, 11 Aug 2021 15:09:51 +0000 (17:09 +0200)]
Fix extract_function tagging params as mut unnecessarily

2 years agoMerge #9856
bors[bot] [Wed, 11 Aug 2021 11:53:25 +0000 (11:53 +0000)]
Merge #9856

9856: Show type actions on ranged type hover r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoShow type actions on ranged type hover
Lukas Wirth [Wed, 11 Aug 2021 11:39:36 +0000 (13:39 +0200)]
Show type actions on ranged type hover

2 years agoMerge #9854
bors[bot] [Wed, 11 Aug 2021 11:17:06 +0000 (11:17 +0000)]
Merge #9854

9854: internal: document that ascription is preferred to a turbo fish r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: document that ascription is preferred to a turbo fish
Aleksey Kladov [Wed, 11 Aug 2021 11:16:15 +0000 (14:16 +0300)]
internal: document that ascription is preferred to a turbo fish

2 years agoMerge #9836
bors[bot] [Wed, 11 Aug 2021 09:54:09 +0000 (09:54 +0000)]
Merge #9836

9836: Refactor: quick clean-up of iteration idioms in the `vfs` crate r=matklad a=Some-Dood

This PR cleans up some of the iteration idioms used in the `vfs` crate. Most of the changes simply converted `for` loops into their `std::iter::Iterator`-method counterpart. Other changes required some inversion of logic to accommodate for better short-circuiting. Overall, there should be no behavioral changes. If there are any stylistic issues, I will gladly adhere to them and adjust the PR accordingly. Thanks!

Co-authored-by: Basti Ortiz <39114273+Some-Dood@users.noreply.github.com>
2 years agoMerge #9828
bors[bot] [Wed, 11 Aug 2021 08:30:53 +0000 (08:30 +0000)]
Merge #9828

9828: Remove dependency on the system graphviz when rendering crate graph r=lnicola a=p32blo

This PR removes the need for having `graphviz` installed on the user system by using the `d3-graphviz` npm package.

The responsibility of rendering the svg output is moved to the extension while the rust side only handles the generation of the dot file.

This change also brings the following additional features:
- Allow zooming the view
- Ctrl+click to reset the zoom
- Adjust the color scheme to dark themes
- Works on any platform without installing graphviz locally

---

I’m not sure if this fits what you had in mind for the crates graph feature but I decided to submit it anyway to see if this is useful to anyone else.

A potential downside might be that it increases the extension size ( haven’t checked) but this feature already required the installation of graphviz on the user side, so the cost is just moved explicitly to the extension.

Feel free to make any suggestion or comments.

Co-authored-by: André Oliveira <p32blo@gmail.com>
2 years agowip enum record/tuple generation
Yoshua Wuyts [Tue, 10 Aug 2021 20:08:14 +0000 (22:08 +0200)]
wip enum record/tuple generation

2 years agogen PartialEq for basic enums
Yoshua Wuyts [Tue, 10 Aug 2021 19:05:23 +0000 (21:05 +0200)]
gen PartialEq for basic enums

2 years agogen PartialEq for structs
Yoshua Wuyts [Tue, 10 Aug 2021 17:49:06 +0000 (19:49 +0200)]
gen PartialEq for structs

2 years agoadd partial_eq gen tests
Yoshua Wuyts [Tue, 10 Aug 2021 17:48:50 +0000 (19:48 +0200)]
add partial_eq gen tests

2 years agoadd make::expr_op
Yoshua Wuyts [Tue, 10 Aug 2021 17:48:32 +0000 (19:48 +0200)]
add make::expr_op

2 years agoMerge #9849
bors[bot] [Tue, 10 Aug 2021 15:05:04 +0000 (15:05 +0000)]
Merge #9849

9849: internal: Refine functional update completion some more r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/9839
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRefine functional update completion some more
Lukas Wirth [Tue, 10 Aug 2021 15:03:38 +0000 (17:03 +0200)]
Refine functional update completion some more

2 years agoFix: revert strange usage of `?` operator
Basti Ortiz [Tue, 10 Aug 2021 14:44:15 +0000 (22:44 +0800)]
Fix: revert strange usage of `?` operator

2 years agoFix: prefer the usage of `for` loops over `fold`
Basti Ortiz [Tue, 10 Aug 2021 14:40:04 +0000 (22:40 +0800)]
Fix: prefer the usage of `for` loops over `fold`