]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge #1677
bors[bot] [Mon, 12 Aug 2019 19:43:57 +0000 (19:43 +0000)]
Merge #1677

1677: Associated types r=flodiebold a=flodiebold

This implements basic support for (fully qualified) associated type projections:
 - handle fully qualified paths like `<T as Trait>::AssocType` (basically desugaring to something like `Trait<Self=T>::AssocType`)
 - lower these to a new `Ty::Projection` enum variant
 - also introduce `Ty::UnselectedProjection` for cases like `T::AssocType` where the trait from which the type comes isn't specified, but these aren't handled further so far
 - in inference, normalize these projections using Chalk: basically, when encountering a type e.g. from a type annotation or signature, we replace these `Ty::Projection`s by type variables and add obligations to normalize the associated type

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoHandle placeholder assoc types when Chalk produces them
Florian Diebold [Sun, 11 Aug 2019 13:54:31 +0000 (15:54 +0200)]
Handle placeholder assoc types when Chalk produces them

4 years agoNormalize assoc types in more places
Florian Diebold [Sun, 11 Aug 2019 11:52:34 +0000 (13:52 +0200)]
Normalize assoc types in more places

4 years agoImprove debug logging a bit
Florian Diebold [Sat, 10 Aug 2019 10:13:39 +0000 (12:13 +0200)]
Improve debug logging a bit

4 years agoNormalize associated types during inference
Florian Diebold [Wed, 7 Aug 2019 20:06:09 +0000 (22:06 +0200)]
Normalize associated types during inference

4 years agoLower fully qualified associated type paths
Florian Diebold [Mon, 5 Aug 2019 20:42:38 +0000 (22:42 +0200)]
Lower fully qualified associated type paths

I.e. `<T as Trait>::Foo`.

4 years agoAdd representations of associated types
Florian Diebold [Mon, 5 Aug 2019 19:13:34 +0000 (21:13 +0200)]
Add representations of associated types

This adds three different representations, copied from the Chalk model:
 - `Ty::Projection` is an associated type projection written somewhere in the
   code, like `<Foo as Trait>::Bar`.
 - `Ty::UnselectedProjection` is similar, but we don't know the trait
   yet (`Foo::Bar`).
 - The above representations are normalized to their actual types during type
   inference. When that isn't possible, for example for `T::Item` inside an `fn
   foo<T: Iterator>`, the type is normalized to an application type with
   `TypeCtor::AssociatedType`.

4 years agoAdd another test for assoc type resolution
Florian Diebold [Sun, 14 Jul 2019 12:19:00 +0000 (14:19 +0200)]
Add another test for assoc type resolution

4 years agoMerge #1683
bors[bot] [Mon, 12 Aug 2019 16:22:58 +0000 (16:22 +0000)]
Merge #1683

1683: Use Source in Diagnostic r=matklad a=eupn

Closes #1681.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoUse Source in Diagnostic and implement
Evgenii P [Mon, 12 Aug 2019 16:06:08 +0000 (23:06 +0700)]
Use Source in Diagnostic and implement

4 years agoMerge #1682
bors[bot] [Mon, 12 Aug 2019 10:49:59 +0000 (10:49 +0000)]
Merge #1682

1682: Drop support for old extendSelection API r=matklad a=matklad

Emacs now handles this via native LSP request

https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f

r? @flodiebold

(Have not actually tried elisp code)

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop support for old extendSelection API
Aleksey Kladov [Mon, 12 Aug 2019 10:12:45 +0000 (13:12 +0300)]
Drop support for old extendSelection API

Emacs now handles this via native LSP request

https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f

4 years agoMerge #1667
bors[bot] [Mon, 12 Aug 2019 10:33:59 +0000 (10:33 +0000)]
Merge #1667

1667: Show backtraces in lens runnables r=matklad a=SomeoneToIgnore

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoMerge #1675
bors[bot] [Mon, 12 Aug 2019 10:23:33 +0000 (10:23 +0000)]
Merge #1675

1675: Improvements to emacs inlay hints r=matklad a=flodiebold

 - only send request if workspace is initialized (emacs-lsp doesn't seem to
   prevent sending requests before the initialized notification is sent)
 - check whether we're still in the correct buffer before sending request

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoImprovements to emacs inlay hints
Florian Diebold [Mon, 5 Aug 2019 19:15:44 +0000 (21:15 +0200)]
Improvements to emacs inlay hints

 - only send request if workspace is initialized (emacs-lsp doesn't seem to
   prevent sending requests before the initialized notification is sent)
 - check whether we're still in the correct buffer before sending request

4 years agoAlways set the runnable name
Kirill Bulatov [Fri, 9 Aug 2019 20:34:14 +0000 (23:34 +0300)]
Always set the runnable name

4 years agoExtract common logic
Kirill Bulatov [Fri, 9 Aug 2019 19:18:47 +0000 (22:18 +0300)]
Extract common logic

4 years agoShow backtraces in lens runnables
Kirill Bulatov [Thu, 8 Aug 2019 19:23:05 +0000 (22:23 +0300)]
Show backtraces in lens runnables

4 years agoMerge #1673
bors[bot] [Fri, 9 Aug 2019 10:17:47 +0000 (10:17 +0000)]
Merge #1673

1673: Move numeric names inside of `NameRef` r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMove numeric names inside of `NameRef`
Aleksey Kladov [Fri, 9 Aug 2019 10:16:47 +0000 (12:16 +0200)]
Move numeric names inside of `NameRef`

4 years agoMerge #1669
bors[bot] [Fri, 9 Aug 2019 09:21:50 +0000 (09:21 +0000)]
Merge #1669

1669: Parse tuple struct field initialization r=matklad a=eupn

Closes #1218.

This PR modifies the parser to accept the following code:
```rust
fn main() {
    struct TupleStruct(usize);
    let s = TupleStruct {
        0: 1usize,
    };

    dbg!(s.0);
}
```

<details><summary>with following AST:</summary>

```
SOURCE_FILE@[0; 118)
  FN_DEF@[0; 116)
    FN_KW@[0; 2) "fn"
    WHITESPACE@[2; 3) " "
    NAME@[3; 7)
      IDENT@[3; 7) "main"
    PARAM_LIST@[7; 9)
      L_PAREN@[7; 8) "("
      R_PAREN@[8; 9) ")"
    WHITESPACE@[9; 10) " "
    BLOCK@[10; 116)
      L_CURLY@[10; 11) "{"
      WHITESPACE@[11; 16) "\n    "
      STRUCT_DEF@[16; 42)
        STRUCT_KW@[16; 22) "struct"
        WHITESPACE@[22; 23) " "
        NAME@[23; 34)
          IDENT@[23; 34) "TupleStruct"
        POS_FIELD_DEF_LIST@[34; 41)
          L_PAREN@[34; 35) "("
          POS_FIELD_DEF@[35; 40)
            PATH_TYPE@[35; 40)
              PATH@[35; 40)
                PATH_SEGMENT@[35; 40)
                  NAME_REF@[35; 40)
                    IDENT@[35; 40) "usize"
          R_PAREN@[40; 41) ")"
        SEMI@[41; 42) ";"
      WHITESPACE@[42; 47) "\n    "
      LET_STMT@[47; 94)
        LET_KW@[47; 50) "let"
        WHITESPACE@[50; 51) " "
        BIND_PAT@[51; 52)
          NAME@[51; 52)
            IDENT@[51; 52) "s"
        WHITESPACE@[52; 53) " "
        EQ@[53; 54) "="
        WHITESPACE@[54; 55) " "
        STRUCT_LIT@[55; 93)
          PATH@[55; 66)
            PATH_SEGMENT@[55; 66)
              NAME_REF@[55; 66)
                IDENT@[55; 66) "TupleStruct"
          WHITESPACE@[66; 67) " "
          NAMED_FIELD_LIST@[67; 93)
            L_CURLY@[67; 68) "{"
            WHITESPACE@[68; 77) "\n        "
            NAMED_FIELD@[77; 86)
              NAME_REF@[77; 78)
                INT_NUMBER@[77; 78) "0"
              COLON@[78; 79) ":"
              WHITESPACE@[79; 80) " "
              LITERAL@[80; 86)
                INT_NUMBER@[80; 86) "1usize"
            COMMA@[86; 87) ","
            WHITESPACE@[87; 92) "\n    "
            R_CURLY@[92; 93) "}"
        SEMI@[93; 94) ";"
      WHITESPACE@[94; 104) "\n    \n    "
      EXPR_STMT@[104; 114)
        MACRO_CALL@[104; 113)
          PATH@[104; 107)
            PATH_SEGMENT@[104; 107)
              NAME_REF@[104; 107)
                IDENT@[104; 107) "dbg"
          EXCL@[107; 108) "!"
          TOKEN_TREE@[108; 113)
            L_PAREN@[108; 109) "("
            IDENT@[109; 110) "s"
            DOT@[110; 111) "."
            INT_NUMBER@[111; 112) "0"
            R_PAREN@[112; 113) ")"
        SEMI@[113; 114) ";"
      WHITESPACE@[114; 115) "\n"
      R_CURLY@[115; 116) "}"
  WHITESPACE@[116; 118) "\n\n"
```

</summary>

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoMake name_ref to accept numeric names optionally
Evgenii P [Fri, 9 Aug 2019 09:08:36 +0000 (16:08 +0700)]
Make name_ref to accept numeric names optionally

4 years agoParse tuple struct field initialization
Evgenii P [Fri, 9 Aug 2019 08:38:52 +0000 (15:38 +0700)]
Parse tuple struct field initialization

4 years agoMerge #1668
bors[bot] [Fri, 9 Aug 2019 08:11:26 +0000 (08:11 +0000)]
Merge #1668

1668: Reduce code duplication in lexer r=matklad a=eupn

During an investigation of a fix for #1218, I stumbled upon some code duplication in the lexer.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoChange macro to function
Evgenii P [Fri, 9 Aug 2019 08:04:13 +0000 (15:04 +0700)]
Change macro to function

4 years agorustfmt
Evgenii P [Fri, 9 Aug 2019 07:23:13 +0000 (14:23 +0700)]
rustfmt

4 years agoReduce code duplication in lexer by introducing small macro
Evgenii P [Fri, 9 Aug 2019 07:08:34 +0000 (14:08 +0700)]
Reduce code duplication in lexer by introducing small macro

4 years agoMerge #1661
bors[bot] [Thu, 8 Aug 2019 13:04:28 +0000 (13:04 +0000)]
Merge #1661

1661: Parse function parameters attributes r=matklad a=eupn

Fixes #1397. The [RFC-2565](https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md) specifies `#[attributes]` to function parameters:

```rust
fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
    // ...
}
```

This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoFix parser tests according to review
Evgenii P [Thu, 8 Aug 2019 02:12:07 +0000 (09:12 +0700)]
Fix parser tests according to review

4 years agoDeduplicate while loop break condition
Evgenii P [Thu, 8 Aug 2019 01:58:28 +0000 (08:58 +0700)]
Deduplicate while loop break condition

4 years agoMerge #1664
bors[bot] [Wed, 7 Aug 2019 19:00:38 +0000 (19:00 +0000)]
Merge #1664

1664: assoc types bounds r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoassoc types bounds
Aleksey Kladov [Wed, 7 Aug 2019 19:00:02 +0000 (21:00 +0200)]
assoc types bounds

4 years agoMerge #1663
bors[bot] [Wed, 7 Aug 2019 18:31:37 +0000 (18:31 +0000)]
Merge #1663

1663: architecture.md: update path to parser tests r=matklad a=eupn

Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>
4 years agoMerge #1662
bors[bot] [Wed, 7 Aug 2019 18:21:33 +0000 (18:21 +0000)]
Merge #1662

1662: architecture.md: "finish not Y" -> "finish node Y" r=matklad a=eupn

Is this a typo?

Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>
4 years agoFix parser to correctly consume outer attrs before ellipsis param
Evgenii P [Wed, 7 Aug 2019 17:36:19 +0000 (00:36 +0700)]
Fix parser to correctly consume outer attrs before ellipsis param

4 years agoarchitecture.md: update path to parser tests
eupn [Wed, 7 Aug 2019 17:23:10 +0000 (00:23 +0700)]
architecture.md: update path to parser tests

4 years agoarchitecture.md: "finish not Y" -> "finish node Y"
eupn [Wed, 7 Aug 2019 17:18:47 +0000 (00:18 +0700)]
architecture.md: "finish not Y" -> "finish node Y"

Is this a typo?

4 years agoFix variadic arg inline test
Evgenii P [Wed, 7 Aug 2019 16:48:21 +0000 (23:48 +0700)]
Fix variadic arg inline test

4 years agoAdd function parameters attributes
Evgenii P [Wed, 7 Aug 2019 16:42:28 +0000 (23:42 +0700)]
Add function parameters attributes

4 years agoMerge #1660
bors[bot] [Wed, 7 Aug 2019 13:16:06 +0000 (13:16 +0000)]
Merge #1660

1660: implement while let desugaring r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoimplement while let desugaring
Aleksey Kladov [Wed, 7 Aug 2019 13:14:22 +0000 (15:14 +0200)]
implement while let desugaring

4 years agorefactor if-let lowering
Aleksey Kladov [Wed, 7 Aug 2019 11:51:54 +0000 (13:51 +0200)]
refactor if-let lowering

mainly to get rid of unwraps

4 years agorefactor if lowering
Aleksey Kladov [Wed, 7 Aug 2019 10:32:32 +0000 (12:32 +0200)]
refactor if lowering

4 years agoMerge #1659
bors[bot] [Wed, 7 Aug 2019 10:25:22 +0000 (10:25 +0000)]
Merge #1659

1659: install server first r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoinstall server first
Aleksey Kladov [Wed, 7 Aug 2019 10:12:23 +0000 (12:12 +0200)]
install server first

closes #1658

4 years agoMerge #1652
bors[bot] [Tue, 6 Aug 2019 16:50:49 +0000 (16:50 +0000)]
Merge #1652

1652: Improve type hints behavior r=matklad a=SomeoneToIgnore

This PR fixed the following type hints issues:

* Restructures the `InlayKind` enum contents based on the discussion here: https://github.com/rust-analyzer/rust-analyzer/pull/1606#issuecomment-515968055
* Races described in #1639
* Caches the latest decorations received for each file to show them the next time the file is opened (instead of a new server request)

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoMerge #1657
bors[bot] [Tue, 6 Aug 2019 12:54:49 +0000 (12:54 +0000)]
Merge #1657

1657: Ignore r=matklad a=matklad

closes #1616

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agofix tests
Aleksey Kladov [Tue, 6 Aug 2019 12:41:22 +0000 (14:41 +0200)]
fix tests

4 years agoallow to exclude certain files and directories
Aleksey Kladov [Tue, 6 Aug 2019 11:34:28 +0000 (13:34 +0200)]
allow to exclude certain files and directories

4 years agopush glob errors outwards
Aleksey Kladov [Tue, 6 Aug 2019 11:27:00 +0000 (13:27 +0200)]
push glob errors outwards

4 years agorename config
Aleksey Kladov [Tue, 6 Aug 2019 11:12:58 +0000 (13:12 +0200)]
rename config

4 years agointroduce ra_vfs_glob crate
Aleksey Kladov [Tue, 6 Aug 2019 11:00:37 +0000 (13:00 +0200)]
introduce ra_vfs_glob crate

It manages exclusion rules for the vfs crate

4 years agoMerge #1656
bors[bot] [Tue, 6 Aug 2019 12:09:45 +0000 (12:09 +0000)]
Merge #1656

1656: cargo update r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agocargo update
Jeremy Kolb [Tue, 6 Aug 2019 11:56:18 +0000 (07:56 -0400)]
cargo update

4 years agoMerge #1655
bors[bot] [Tue, 6 Aug 2019 08:59:53 +0000 (08:59 +0000)]
Merge #1655

1655: cleanup imports r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agocleanup imports
Aleksey Kladov [Tue, 6 Aug 2019 08:55:59 +0000 (10:55 +0200)]
cleanup imports

4 years agocleanup
Aleksey Kladov [Tue, 6 Aug 2019 08:54:51 +0000 (10:54 +0200)]
cleanup

4 years agorename
Aleksey Kladov [Tue, 6 Aug 2019 08:50:32 +0000 (10:50 +0200)]
rename

4 years agoMerge #1654
bors[bot] [Tue, 6 Aug 2019 07:50:41 +0000 (07:50 +0000)]
Merge #1654

1654: use Conv for severity r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agouse Conv for severity
Aleksey Kladov [Tue, 6 Aug 2019 07:29:06 +0000 (09:29 +0200)]
use Conv for severity

4 years agoAvoid shared mutable state
Kirill Bulatov [Mon, 5 Aug 2019 19:31:12 +0000 (22:31 +0300)]
Avoid shared mutable state

4 years agoMerge #1648
bors[bot] [Mon, 5 Aug 2019 13:55:17 +0000 (13:55 +0000)]
Merge #1648

1648: Optimize parsing a little r=lnicola a=lnicola

This is the change from https://github.com/rust-analyzer/rust-analyzer/issues/1643#issuecomment-517979911. In the long run we should probably take a different approach, but until then this provides a decent speed-up (10.5s vs 11.5s according to `ra_cli analysis-stats`.

EDIT: Does the profiling part make sense? I'm not sure if all parsing happens before the type inference begins or it's lazy.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
4 years agoUpdate crates/ra_cli/src/analysis_stats.rs
Laurențiu Nicola [Mon, 5 Aug 2019 13:52:18 +0000 (16:52 +0300)]
Update crates/ra_cli/src/analysis_stats.rs

Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoOptimize Parser::is_composite a little
Laurențiu Nicola [Sun, 4 Aug 2019 11:06:07 +0000 (14:06 +0300)]
Optimize Parser::is_composite a little

4 years agoDisplay the parsing time in ra_cli analysis-stats
Laurențiu Nicola [Sun, 4 Aug 2019 10:49:13 +0000 (13:49 +0300)]
Display the parsing time in ra_cli analysis-stats

4 years agoCache decorations before the first change only
Kirill Bulatov [Mon, 5 Aug 2019 10:31:00 +0000 (13:31 +0300)]
Cache decorations before the first change only

4 years agoMerge #1642
bors[bot] [Mon, 5 Aug 2019 10:12:24 +0000 (10:12 +0000)]
Merge #1642

1642: Add test for #1540 r=matklad a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoUse WeakMap to avoid memory leaks
Kirill Bulatov [Mon, 5 Aug 2019 08:07:27 +0000 (11:07 +0300)]
Use WeakMap to avoid memory leaks

4 years agoStyle and test fixes
Kirill Bulatov [Sun, 4 Aug 2019 21:47:14 +0000 (00:47 +0300)]
Style and test fixes

4 years agoUse proper inlay kinds
Kirill Bulatov [Sun, 4 Aug 2019 21:28:36 +0000 (00:28 +0300)]
Use proper inlay kinds

4 years agoQuery less hints on file open
Kirill Bulatov [Sun, 4 Aug 2019 21:23:58 +0000 (00:23 +0300)]
Query less hints on file open

4 years agoMerge #1634
bors[bot] [Sun, 4 Aug 2019 09:42:17 +0000 (09:42 +0000)]
Merge #1634

1634: Implement .await completion for futures r=flodiebold a=eupn

Closes #1263 with completion for `.await` syntax for types that are implementing `std::future::Future` trait.

r? @flodiebold

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoMerge #1640
bors[bot] [Sun, 4 Aug 2019 08:12:12 +0000 (08:12 +0000)]
Merge #1640

1640: Bump deps r=matklad a=lnicola

`insta`, `unicode-xid` and others

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agoBump deps
Laurențiu Nicola [Sat, 3 Aug 2019 20:48:10 +0000 (23:48 +0300)]
Bump deps

4 years agorustfmt
Evgenii P [Sun, 4 Aug 2019 01:45:14 +0000 (08:45 +0700)]
rustfmt

4 years agoIdiomatic return
Evgenii P [Sun, 4 Aug 2019 01:08:46 +0000 (08:08 +0700)]
Idiomatic return

4 years agoEmploy early return pattern more
Evgenii P [Sun, 4 Aug 2019 01:03:17 +0000 (08:03 +0700)]
Employ early return pattern more

4 years agosource_binder.rs: fix order of imports
Evgenii P [Sun, 4 Aug 2019 00:56:29 +0000 (07:56 +0700)]
source_binder.rs: fix order of imports

4 years agoAdd test for #1540
Jeremy Kolb [Sat, 3 Aug 2019 22:01:48 +0000 (18:01 -0400)]
Add test for #1540

4 years agoMerge #1638
bors[bot] [Sat, 3 Aug 2019 20:07:07 +0000 (20:07 +0000)]
Merge #1638

1638: Avoid cloning a TtToken in SubtreeTokenSource::mk_token r=matklad a=lnicola

According to `perf record`, this function is the hottest one while running `ra_cli analysis-stats`:

Before:

```
6.05%  ra_cli  ra_cli        <ra_mbe::subtree_source::SubtreeTokenSource as ra_parser::TokenSource>::lookahead_nth
5.56%  ra_cli  ra_cli        <rowan::green::GreenNode as core::hash::Hash>::hash
4.16%  ra_cli  libc-2.29.so  _int_malloc
3.93%  ra_cli  ra_cli        ra_mbe::subtree_source::SubtreeTokenSource::get

Database loaded, 255 roots, 231.676882ms
Crates in this dir: 27
Total modules found: 282
Total declarations: 9642
Total functions: 3287
Total expressions: 64616
Expressions of unknown type: 9111 (14%)
Expressions of partially unknown type: 3417 (5%)
Analysis: 24.012797561s, 0b allocated 0b resident
target/release/ra_cli analysis-stats  24.60s user 0.56s system 100% cpu 25.125 total
```

After:

```
5.85%  ra_cli  ra_cli        <rowan::green::GreenNode as core::hash::Hash>::hash
4.55%  ra_cli  libc-2.29.so  _int_malloc
4.31%  ra_cli  ra_cli        ra_parser::parser::Parser::nth
3.61%  ra_cli  ra_cli        <ra_syntax::parsing::text_token_source::TextTokenSource as ra_parser::TokenSource>::lookahead_nth
3.54%  ra_cli  ra_cli        ra_syntax::syntax_node::SyntaxTreeBuilder::finish_node
3.46%  ra_cli  libc-2.29.so  _int_free
3.12%  ra_cli  libc-2.29.so  malloc
2.76%  ra_cli  ra_cli        ra_parser::event::process
2.68%  ra_cli  ra_cli        alloc::sync::Arc<T>::drop_slow
2.50%  ra_cli  ra_cli        ra_mbe::subtree_source::SubtreeTokenSource::get
2.31%  ra_cli  ra_cli        <smol_str::SmolStr as core::hash::Hash>::hash
2.04%  ra_cli  libc-2.29.so  __memmove_avx_unaligned_erms
1.92%  ra_cli  ra_cli        <ra_mbe::subtree_source::SubtreeTokenSource as ra_parser::TokenSource>::lookahead_nth

Database loaded, 255 roots, 236.176803ms
Crates in this dir: 27
Total modules found: 282
Total declarations: 9642
Total functions: 3287
Total expressions: 64620
Expressions of unknown type: 9107 (14%)
Expressions of partially unknown type: 3425 (5%)
Analysis: 22.562328486s, 0b allocated 0b resident
target/release/ra_cli analysis-stats  23.12s user 0.57s system 100% cpu 23.659 total
```

r? @edwin0cheng, @matklad

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agoReturn a Ref from SubtreeTokenSource::get
Laurențiu Nicola [Sat, 3 Aug 2019 19:49:47 +0000 (22:49 +0300)]
Return a Ref from SubtreeTokenSource::get

4 years agoMerge #1630
bors[bot] [Sat, 3 Aug 2019 19:25:30 +0000 (19:25 +0000)]
Merge #1630

1630: Removes `*/` from block doc comments r=matklad a=kjeremy

The trailing `/` was annoying me on hover.

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoMerge #1637
bors[bot] [Sat, 3 Aug 2019 19:15:02 +0000 (19:15 +0000)]
Merge #1637

1637: Resolve out of line modules inside inline module with attribute path r=matklad a=andreevlex

Fixed #1510
Fixed #1529

Co-authored-by: Alexander Andreev <andreevlex.as@gmail.com>
4 years agoAvoid cloning a TtToken in SubtreeTokenSource::mk_token
Laurențiu Nicola [Sat, 3 Aug 2019 18:11:58 +0000 (21:11 +0300)]
Avoid cloning a TtToken in SubtreeTokenSource::mk_token

4 years agoResolve out of line modules inside inline module with attribute path
Alexander Andreev [Sat, 3 Aug 2019 16:44:59 +0000 (19:44 +0300)]
Resolve out of line modules inside inline module with attribute path

Fixed #1510
Fixed #1529

4 years agoUse std::future::Future trait from stdlib
Evgenii P [Sat, 3 Aug 2019 10:07:20 +0000 (17:07 +0700)]
Use std::future::Future trait from stdlib

4 years agodo fixup: remove unused imports in complete_dot.rs
Evgenii P [Fri, 2 Aug 2019 19:48:36 +0000 (02:48 +0700)]
do fixup: remove unused imports in complete_dot.rs

4 years agodo fixup: remove unused import
Evgenii P [Fri, 2 Aug 2019 19:46:00 +0000 (02:46 +0700)]
do fixup: remove unused import

4 years agoChange postfix completion to keyword completion
Evgenii P [Fri, 2 Aug 2019 19:40:59 +0000 (02:40 +0700)]
Change postfix completion to keyword completion

4 years agoMerge #1633
bors[bot] [Fri, 2 Aug 2019 18:58:11 +0000 (18:58 +0000)]
Merge #1633

1633: Update rls URL r=flodiebold a=tomhennigan

Docs folder was removed in rust-lang/compiler-team@dbe0ee74e911693841a16727caab756ab4d0b9ab.

Co-authored-by: Tom Hennigan <tomhennigan@google.com>
4 years agoRelax trait solving more for completion
Evgenii P [Fri, 2 Aug 2019 18:56:27 +0000 (01:56 +0700)]
Relax trait solving more for completion

4 years agoUse future lang item instead of hardcoded std::future::Future
Evgenii P [Fri, 2 Aug 2019 18:53:51 +0000 (01:53 +0700)]
Use future lang item instead of hardcoded std::future::Future

4 years agorustfmt
Evgenii P [Fri, 2 Aug 2019 18:16:20 +0000 (01:16 +0700)]
rustfmt

4 years agoImplement completion for the .await syntax
Evgenii P [Fri, 2 Aug 2019 18:15:43 +0000 (01:15 +0700)]
Implement completion for the .await syntax

4 years agoFix rls URL.
Tom Hennigan [Fri, 2 Aug 2019 14:19:19 +0000 (15:19 +0100)]
Fix rls URL.

Docs folder was removed in rust-lang/compiler-team@dbe0ee74e911693841a16727caab756ab4d0b9ab.

4 years agoUnconditionally trim the end of comments
kjeremy [Wed, 31 Jul 2019 17:59:14 +0000 (13:59 -0400)]
Unconditionally trim the end of comments

4 years agoMerge #1631
bors[bot] [Wed, 31 Jul 2019 15:54:46 +0000 (15:54 +0000)]
Merge #1631

1631: Remove test comment r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoremove-comment
kjeremy [Wed, 31 Jul 2019 15:53:47 +0000 (11:53 -0400)]
remove-comment

4 years agoRemoves `*/` in block doc comments
kjeremy [Wed, 31 Jul 2019 15:43:00 +0000 (11:43 -0400)]
Removes `*/` in block doc comments

4 years agoMerge #1629
bors[bot] [Wed, 31 Jul 2019 14:48:42 +0000 (14:48 +0000)]
Merge #1629

1629: Add explicit newline preserving tests r=matklad a=kjeremy

I didn't see anything that explicitly called this out so added tests.

Co-authored-by: kjeremy <kjeremy@gmail.com>