]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #7657
bors[bot] [Tue, 16 Feb 2021 16:34:22 +0000 (16:34 +0000)]
Merge #7657

7657: utf8 r=matklad a=matklad

- Prepare for utf-8 offsets
- reduce code duplication in tests
- Make utf8 default, implement utf16 in terms of it
- Make it easy to add additional context for offset conversion
- Implement utf8 offsets

closes #7453

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agodocument offsets
Aleksey Kladov [Sun, 14 Feb 2021 15:23:16 +0000 (18:23 +0300)]
document offsets

3 years agoMerge #7696
bors[bot] [Tue, 16 Feb 2021 16:17:36 +0000 (16:17 +0000)]
Merge #7696

7696: Fix a few clippy::perf warnings r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoFix bitrotted module name
Aleksey Kladov [Fri, 12 Feb 2021 22:28:48 +0000 (01:28 +0300)]
Fix bitrotted module name

3 years agoEnable offset-encoding capability
Aleksey Kladov [Fri, 12 Feb 2021 22:26:01 +0000 (01:26 +0300)]
Enable offset-encoding capability

3 years agoImplement utf8 offsets
Aleksey Kladov [Fri, 12 Feb 2021 21:55:27 +0000 (00:55 +0300)]
Implement utf8 offsets

3 years agoMake it easy to add additional context for offset conversion
Aleksey Kladov [Fri, 12 Feb 2021 21:44:28 +0000 (00:44 +0300)]
Make it easy to add additional context for offset conversion

3 years agoMake utf8 default, implement utf16 in terms of it
Aleksey Kladov [Fri, 12 Feb 2021 19:09:53 +0000 (22:09 +0300)]
Make utf8 default, implement utf16 in terms of it

3 years agoreduce code duplication in tests
Aleksey Kladov [Fri, 12 Feb 2021 18:31:32 +0000 (21:31 +0300)]
reduce code duplication in tests

3 years agoPrepare for utf-8 offsets
Aleksey Kladov [Fri, 12 Feb 2021 18:24:10 +0000 (21:24 +0300)]
Prepare for utf-8 offsets

3 years agoFix a few clippy::perf warnings
kjeremy [Tue, 16 Feb 2021 15:55:34 +0000 (10:55 -0500)]
Fix a few clippy::perf warnings

3 years agoMerge #7695
bors[bot] [Tue, 16 Feb 2021 14:32:33 +0000 (14:32 +0000)]
Merge #7695

7695: Bump lsp-types r=matklad a=kjeremy

Nothing to see here...

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoBump lsp-types
kjeremy [Tue, 16 Feb 2021 14:21:07 +0000 (09:21 -0500)]
Bump lsp-types

3 years agoMerge #7687
bors[bot] [Tue, 16 Feb 2021 14:16:47 +0000 (14:16 +0000)]
Merge #7687

7687: Specialization for async traits r=matklad a=arnaudgolfouse

Fixes #7669.

Adapting the parser seemed to be all that was needed, but I am not very experienced with the codebase. Is this enough ?

Co-authored-by: Arnaud <arnaud.golfouse@laposte.net>
3 years agoMerge #7620
bors[bot] [Tue, 16 Feb 2021 14:01:09 +0000 (14:01 +0000)]
Merge #7620

7620: Support control flow in `extract_function` assist r=matklad a=cpud36

Support `return`ing from outer function, `break`ing and `continue`ing outer loops when extracting function.

# Example
Transforms
```rust
fn foo() -> i32 {
  let items = [1,2,3];
  let mut sum = 0;
  for &item in items {
    <|>if item == 42 {
      break;
    }<|>
    sum += item;
  }
  sum
}
```
Into
```rust
fn foo() -> i32 {
  let items = [1,2,3];
  let mut sum = 0;
  for &item in items {
    if fun_name(item) {
      break;
    }
    sum += item;
  }
  sum
}

fn fun_name(item: i32) -> bool {
  if item == 42 {
    return true;
  }
  false
}
```

![add_explicit_type_infer_type](https://user-images.githubusercontent.com/4218373/107544222-0fadf280-6bdb-11eb-9625-ed6194ba92c0.gif)

# Features

Supported variants
- break and function does not return => uses `bool` and plain if
- break and function does return => uses `Option<T>` and matches on it
- break with value and function does not return => uses `Option<T>` and if let
- break with value and function does return => uses `Result<T, U>` and matches on t
- same for `return` and `continue`(but we can't continue with value)

Assist does handle nested loops and nested items(like functions, modules, impls)

Try `expr?` operator is allowed together with `return Err(_)` and `return None`.
`return expr` is not allowed.

# Not supported
## Mixing `return` with `break` or `continue`
If we have e.g. a `return` and a `break` in the selected code, it is unclear what the produced code should look like.
We can try `Result<T, Option<U>>` or something like that, but it isn't idiomatic, nor it is established. Otherwise, implementation
is relatively simple.

## `break` with label
Not sure how to handle different labels for multiple `break`s.

[edit] implemented try `expr?`

Co-authored-by: Vladyslav Katasonov <cpud47@gmail.com>
3 years agoSpecialization for async traits
Arnaud [Mon, 15 Feb 2021 17:11:10 +0000 (18:11 +0100)]
Specialization for async traits

3 years agoMerge #7685
bors[bot] [Mon, 15 Feb 2021 14:50:49 +0000 (14:50 +0000)]
Merge #7685

7685: cargo update r=kjeremy a=kjeremy

Removes redundant redox_syscall

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo update
kjeremy [Mon, 15 Feb 2021 14:49:36 +0000 (09:49 -0500)]
cargo update

3 years agoMerge #7684
bors[bot] [Mon, 15 Feb 2021 14:22:33 +0000 (14:22 +0000)]
Merge #7684

7684: Actually fix runnable order r=lnicola a=ivan770

Changes
![image](https://user-images.githubusercontent.com/14003886/107956771-51a6b200-6fa8-11eb-91aa-f4190d6a8ccd.png)
to
![image](https://user-images.githubusercontent.com/14003886/107956926-903c6c80-6fa8-11eb-8fb9-8bf7bb1879ac.png)

Sorry for missing this one in original PR. This was an issue before https://github.com/rust-analyzer/rust-analyzer/pull/7596/commits/ee049b256a7718fb346a7172a34f0fc324b3269b, and I fixed it, yet *somehow* order got reversed (to a logical one)

Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
3 years agoActually fix runnable order
ivan770 [Mon, 15 Feb 2021 14:09:50 +0000 (16:09 +0200)]
Actually fix runnable order

3 years agoMerge #7661
bors[bot] [Sun, 14 Feb 2021 19:52:38 +0000 (19:52 +0000)]
Merge #7661

7661: Start LSP 3.17 support r=kjeremy a=kjeremy

Companion to https://github.com/gluon-lang/lsp-types/pull/199 which <strike>has not been merged yet</strike>  has been merged.

This doesn't opt into any 3.17 functionality yet.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agoStart LSP 3.17 support
Jeremy Kolb [Sat, 13 Feb 2021 18:54:39 +0000 (13:54 -0500)]
Start LSP 3.17 support

3 years agoMerge #7678
bors[bot] [Sun, 14 Feb 2021 19:28:14 +0000 (19:28 +0000)]
Merge #7678

7678: Simplify find_crlf r=matklad a=michalmuskala

This is both simpler to read and compiles to better code: https://rust.godbolt.org/z/MxKodv

Co-authored-by: Michał Muskała <michal@muskala.eu>
3 years agoSimplify find_crlf
Michał Muskała [Sun, 14 Feb 2021 19:16:42 +0000 (20:16 +0100)]
Simplify find_crlf

This is both simpler to read and compiles to better code:
https://rust.godbolt.org/z/MxKodv

3 years agoMerge #7676
bors[bot] [Sun, 14 Feb 2021 16:40:44 +0000 (16:40 +0000)]
Merge #7676

7676: Make it clear which client-side commands we use r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMake it clear which client-side commands we use
Aleksey Kladov [Sun, 14 Feb 2021 16:36:44 +0000 (19:36 +0300)]
Make it clear which client-side commands we use

3 years agoMerge #7656
bors[bot] [Sun, 14 Feb 2021 16:17:03 +0000 (16:17 +0000)]
Merge #7656

7656: Implement constructor usage search for almost all items r=matklad a=Veykril

This PR moves the filering for enum constructors to the HIR, with this unprefixed variants as well as when the enum has been renamed via use will then still show up properly.
We now walk the ast of the `NameRef` up until we find a `PathExpr`(which also handles `CallExpr` for tuple-type structs and variants already) or a `RecordExpr`. For enum search we then take the `path` out of that expression and do a resolution on it to compare it with the definition enum.
With this PR we now support searching for all constructor literals, Unit-, Tuple- and Record-Structs, Unit-, Tuple- and Record-Variants as well as Unions.

There is one shortcoming due to how the search is triggered. Unit Variants constructors can't be searched as we have no position for it to kick off the search(since a comma doesn't have to exist for the last variant).

Closes #2549 though it doesn't implement it as outlined in the issue since the reference kind was removed recently, though I believe the approach taken here is better personally.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #7643 #7663
bors[bot] [Sun, 14 Feb 2021 15:42:07 +0000 (15:42 +0000)]
Merge #7643 #7663

7643: Automatically detect the rustc-src directory (fixes #3517) r=matklad a=bnjbvr

If the configured rustcSource was not set, then try to automatically
detect a source for the sysroot rustc directory.

I wasn't sure how to do it in the case of the project.json file, though.

7663: Tolerate spaces in nix binary patching r=matklad a=CertainLach

If path to original file contains space (I.e on code insiders, where
default data directory is ~/Code - Insiders/), then there is syntax
error evaluating src arg.

Instead pass path as str, and coerce to path back in nix expression

Co-authored-by: Benjamin Bouvier <public@benj.me>
Co-authored-by: Yaroslav Bolyukin <iam@lach.pw>
3 years agoMerge #7668
bors[bot] [Sun, 14 Feb 2021 15:29:00 +0000 (15:29 +0000)]
Merge #7668

7668: Finalize rename infra rewrite r=matklad a=Veykril

This should be the final PR in regards to rewriting rename stuff, #4290.

It addresses 3 things:
- Currently renaming import aliases causes some undesired behavior(see #5198) which is why this PR causes us to just return an error if an attempt at renaming an alias is made for the time being. Though this only prevents it from happening when the alias import is renamed, so its not too helpful.
- Fixes #6898
- If we are inside a macro file simply rename the input name node as there isn't really a way to do any of the fancy shorthand renames and similar things as for that we would have to exactly know what the macro generates and what not.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't rename field record patterns directly
Lukas Wirth [Sat, 13 Feb 2021 22:35:04 +0000 (23:35 +0100)]
Don't rename field record patterns directly

3 years agoMerge #7667
bors[bot] [Sat, 13 Feb 2021 22:46:37 +0000 (22:46 +0000)]
Merge #7667

7667: strip type parameter defaults when generating impl generics r=Veykril a=jDomantas

Fixes #5666

Co-authored-by: Domantas Jadenkus <djadenkus@gmail.com>
3 years agostrip type parameter defaults when generating impl generics
Domantas Jadenkus [Sat, 13 Feb 2021 21:59:51 +0000 (23:59 +0200)]
strip type parameter defaults when generating impl generics

3 years agoMerge #7664
bors[bot] [Sat, 13 Feb 2021 21:37:35 +0000 (21:37 +0000)]
Merge #7664

7664: refactor impl generation in assists r=Veykril a=jDomantas

Follow-up to #7659: all impl generation in assists (at least what I found) is now done through `utils::{generate_impl_text, generate_trait_impl_text}`.

Co-authored-by: Domantas Jadenkus <djadenkus@gmail.com>
3 years agoMerge #7665
bors[bot] [Sat, 13 Feb 2021 21:12:49 +0000 (21:12 +0000)]
Merge #7665

7665: Don't classify attribute macros as their path unless it's a function with the proc_macro_attribute attribute r=Veykril a=Veykril

bors r+
Closes #6389

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't classify attribute macros as their path unless it's a function with the proc_ma...
Lukas Wirth [Sat, 13 Feb 2021 21:11:31 +0000 (22:11 +0100)]
Don't classify attribute macros as their path unless it's a function with the proc_macro_attribute attribute

3 years agocargo fmt
Domantas Jadenkus [Sat, 13 Feb 2021 20:51:48 +0000 (22:51 +0200)]
cargo fmt

3 years agouse generate_impl_text in replace_derive_with_manual_impl
Domantas Jadenkus [Sat, 13 Feb 2021 20:50:04 +0000 (22:50 +0200)]
use generate_impl_text in replace_derive_with_manual_impl

3 years agouse generate_impl_text in generate_impl
Domantas Jadenkus [Sat, 13 Feb 2021 20:38:52 +0000 (22:38 +0200)]
use generate_impl_text in generate_impl

3 years agoFallback to renaming input NameRef node for macros when inside macro
Lukas Wirth [Sat, 13 Feb 2021 20:41:04 +0000 (21:41 +0100)]
Fallback to renaming input NameRef node for macros when inside macro

3 years agouse generate_impl_text in generate_from_impl
Domantas Jadenkus [Sat, 13 Feb 2021 20:26:58 +0000 (22:26 +0200)]
use generate_impl_text in generate_from_impl

3 years agofix: tolerate spaces in nix binary patching
Yaroslav Bolyukin [Sat, 13 Feb 2021 20:11:00 +0000 (23:11 +0300)]
fix: tolerate spaces in nix binary patching

If path to original file contains space (I.e on code insiders, where
default data directory is ~/Code - Insiders/), then there is syntax
error evaluating src arg.

Instead pass path as str, and coerce to path back in nix expression

Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
3 years agoPrevent aliases from being renamed for now
Lukas Wirth [Sat, 13 Feb 2021 19:49:04 +0000 (20:49 +0100)]
Prevent aliases from being renamed for now

3 years agoexpose hir::Type::type_paramters
Vladyslav Katasonov [Sat, 13 Feb 2021 18:46:21 +0000 (21:46 +0300)]
expose hir::Type::type_paramters

Used to get E parameter from `Result<T, E>`

3 years agoallow try expr? with return None in extracted function
Vladyslav Katasonov [Wed, 10 Feb 2021 17:05:03 +0000 (20:05 +0300)]
allow try expr? with return None in extracted function

3 years agoallow try expr? when extacting function
Vladyslav Katasonov [Wed, 10 Feb 2021 16:26:42 +0000 (19:26 +0300)]
allow try expr? when extacting function

3 years agohandle return, break and continue when extracting function
Vladyslav Katasonov [Wed, 10 Feb 2021 02:50:03 +0000 (05:50 +0300)]
handle return, break and continue when extracting function

3 years agomigrate body span to {parent,text_range}
Vladyslav Katasonov [Tue, 9 Feb 2021 19:14:32 +0000 (22:14 +0300)]
migrate body span to {parent,text_range}

This simplifies api as we are not duplicating code from syntax crate

3 years agoMerge #7662
bors[bot] [Sat, 13 Feb 2021 18:59:52 +0000 (18:59 +0000)]
Merge #7662

7662: Group generate getter/setter assist r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoGroup generate getter/setter assist
Lukas Wirth [Sat, 13 Feb 2021 18:58:58 +0000 (19:58 +0100)]
Group generate getter/setter assist

3 years agoMerge #7596
bors[bot] [Sat, 13 Feb 2021 17:50:55 +0000 (17:50 +0000)]
Merge #7596

7596: Move CodeLens to ide crate r=ivan770 a=ivan770

Closes #7579

Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
3 years agoRemove CodeLensResolveData mention from lsp-extensions.md
ivan770 [Sat, 13 Feb 2021 17:36:29 +0000 (19:36 +0200)]
Remove CodeLensResolveData mention from lsp-extensions.md

3 years agoAllow automatically detect the rustc-src directory (fixes #3517).
Benjamin Bouvier [Thu, 11 Feb 2021 16:34:56 +0000 (17:34 +0100)]
Allow automatically detect the rustc-src directory (fixes #3517).

If the configured rustcSource is set to "discover", try to automatically
detect a source from the sysroot rustc directory.

3 years agoMake annotations tests similar to those in runnables
ivan770 [Sat, 13 Feb 2021 17:18:13 +0000 (19:18 +0200)]
Make annotations tests similar to those in runnables

3 years agoOnly use HIR when searching for enum constructors, otherwise fall back to AST
Lukas Wirth [Sat, 13 Feb 2021 16:57:14 +0000 (17:57 +0100)]
Only use HIR when searching for enum constructors, otherwise fall back to AST

3 years agoMerge #7659
bors[bot] [Sat, 13 Feb 2021 15:56:17 +0000 (15:56 +0000)]
Merge #7659

7659: Improve "Generate From impl" r=Veykril a=jDomantas

* Allows any field type. Previously it was restricted to path types, but I don't see why it couldn't apply to all other types too. (the main reason for is PR is that I'm too lazy to write out `From<&'static str>` by hand 😄)
* More correct handling for generic enums - previously it wouldn't emit generic params on the impl.
* Also accepts variants with named field.

The impl generation code got mostly copy-pasted from generate_impl assist - please tell if there's an easy way to avoid this duplication.

Co-authored-by: Domantas Jadenkus <djadenkus@gmail.com>
3 years agoImprove runnable annotations order, fix incorrect ignore detection
ivan770 [Sat, 13 Feb 2021 13:47:53 +0000 (15:47 +0200)]
Improve runnable annotations order, fix incorrect ignore detection

3 years agocargo fmt
Domantas Jadenkus [Sat, 13 Feb 2021 13:34:40 +0000 (15:34 +0200)]
cargo fmt

3 years agoAdded annotation tests
ivan770 [Sat, 13 Feb 2021 13:27:04 +0000 (15:27 +0200)]
Added annotation tests

3 years agomake it work for record-style variants
Domantas Jadenkus [Sat, 13 Feb 2021 12:57:06 +0000 (14:57 +0200)]
make it work for record-style variants

3 years agoupdate doc
Domantas Jadenkus [Sat, 13 Feb 2021 12:46:41 +0000 (14:46 +0200)]
update doc

3 years agohandle generic enums
Domantas Jadenkus [Sat, 13 Feb 2021 12:46:28 +0000 (14:46 +0200)]
handle generic enums

3 years agoallow any field type
Domantas Jadenkus [Sat, 13 Feb 2021 12:29:26 +0000 (14:29 +0200)]
allow any field type

3 years agouse Self instead of enum name
Domantas Jadenkus [Sat, 13 Feb 2021 12:27:38 +0000 (14:27 +0200)]
use Self instead of enum name

3 years agoFix incorrect references annotation
ivan770 [Sat, 13 Feb 2021 11:22:12 +0000 (13:22 +0200)]
Fix incorrect references annotation

3 years agoMoved CodeLens to ide crate
ivan770 [Sat, 13 Feb 2021 11:07:47 +0000 (13:07 +0200)]
Moved CodeLens to ide crate

3 years agoMerge #7658
bors[bot] [Sat, 13 Feb 2021 11:06:04 +0000 (11:06 +0000)]
Merge #7658

7658: Build dist-x86_64-unknown-linux-musl releases r=lnicola a=andylizi

Closes #4956.

* Artifact sample: [rust-analyzer-x86_64-unknown-linux-musl.gz](https://github.com/rust-analyzer/rust-analyzer/files/5975504/rust-analyzer-x86_64-unknown-linux-musl.gz)
* Build time: ~14m
```
$ ls -lh
-rwxr-xr-x    1 root     root       29.7M Feb 13 18:24 rust-analyzer-x86_64-unknown-linux-musl

$ ldd rust-analyzer-x86_64-unknown-linux-musl
        /lib/ld-musl-x86_64.so.1 (0x7f2751f13000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7f2750a78000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f2751f13000)

$ ./rust-analyzer-x86_64-unknown-linux-musl --version
rust-analyzer 63fcf65
```

I can do `aarch64-unknown-linux-musl` if it's also needed.

Co-authored-by: andylizi <andylizi666@gmail.com>
3 years agoBuild dist-x86_64-unknown-linux-musl releases
andylizi [Sat, 13 Feb 2021 08:39:02 +0000 (16:39 +0800)]
Build dist-x86_64-unknown-linux-musl releases

3 years agoImplement constructor usage search for almost all items
Lukas Wirth [Fri, 12 Feb 2021 20:30:55 +0000 (21:30 +0100)]
Implement constructor usage search for almost all items

For all struct kinds, unions and enums, as well as for record- and
tuple-variants but not for unit-variants, as these have no trailing
character we can anchor the search to. Functionality wise it is
implemented though.

3 years agoMerge #7655
bors[bot] [Fri, 12 Feb 2021 18:20:27 +0000 (18:20 +0000)]
Merge #7655

7655: Include a commit log summary in the changelog r=matklad a=lnicola

This version omits any direct pushes, and maybe even pull requests merged from the GitHub UI. But I think it makes writing the release notes easier.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #7358
bors[bot] [Fri, 12 Feb 2021 18:01:36 +0000 (18:01 +0000)]
Merge #7358

7358: Refactor reference searching to work with the ast  r=matklad a=Veykril

Addresses #4290

This PR is still a bit unpolished. Its main purpose for now is to discuss the direction of the changes as to whether this seems to be the right approach or not. I annotated a few parts with reviews to give a better overwiew without having to read into it too much.

Big part of the diff are test output changes in the `references` module.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUpdate references test output
Lukas Wirth [Fri, 12 Feb 2021 18:00:37 +0000 (19:00 +0100)]
Update references test output

3 years agoUse NameLike in FileReference directly as its not exported from ide anymore
Lukas Wirth [Tue, 9 Feb 2021 15:03:39 +0000 (16:03 +0100)]
Use NameLike in FileReference directly as its not exported from ide anymore

3 years agoRefactor reference searching to work with the ast
Lukas Wirth [Sun, 7 Feb 2021 17:38:12 +0000 (18:38 +0100)]
Refactor reference searching to work with the ast

3 years agoRemove unused ReferenceSearchResult functions
Lukas Wirth [Mon, 18 Jan 2021 20:41:13 +0000 (21:41 +0100)]
Remove unused ReferenceSearchResult functions

3 years agoInclude a commit log summary in the changelog
Laurențiu Nicola [Fri, 12 Feb 2021 17:52:51 +0000 (19:52 +0200)]
Include a commit log summary in the changelog

3 years agoMerge #7650
bors[bot] [Fri, 12 Feb 2021 17:16:02 +0000 (17:16 +0000)]
Merge #7650

7650: Add `find_impl_block_end` assist helper r=Veykril a=yoshuawuyts

Fixes #7605. This makes it so assists can use helpers to either append a method to the start or the end of an `impl` block. Thanks!

@Veykril if this is merged, perhaps it could be good to update the gif in https://github.com/rust-analyzer/rust-analyzer/pull/7617#issuecomment-776622135 ? -- this should fix the ordering issue when generating multiple methods.

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
3 years agoMerge #7639
bors[bot] [Fri, 12 Feb 2021 17:02:42 +0000 (17:02 +0000)]
Merge #7639

7639: Bump rust to latest stable 1.50 r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoBump rust to latest stable 1.50
kjeremy [Thu, 11 Feb 2021 15:12:20 +0000 (10:12 -0500)]
Bump rust to latest stable 1.50

3 years agoAdd `find_impl_block_end` assist helper
Yoshua Wuyts [Fri, 12 Feb 2021 10:48:43 +0000 (11:48 +0100)]
Add `find_impl_block_end` assist helper

3 years agoMerge #7652
bors[bot] [Fri, 12 Feb 2021 16:45:58 +0000 (16:45 +0000)]
Merge #7652

7652: Fix slow tests sometimes failing r=flodiebold a=flodiebold

In some situations we reloaded the workspace in the tests after having reported
to be ready. There's two fixes here:
1. Add a version to the VFS config and include that version in progress reports,
so that we don't think we're done prematurely;
2. Delay status transitions until after changes are applied. Otherwise the last
change during loading can potentially trigger a workspace reload, if it contains
interesting changes.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
3 years agoRemove pinned Rust version again
Florian Diebold [Fri, 12 Feb 2021 14:59:29 +0000 (15:59 +0100)]
Remove pinned Rust version again

3 years agoFix slow tests sometimes failing
Florian Diebold [Fri, 12 Feb 2021 14:58:29 +0000 (15:58 +0100)]
Fix slow tests sometimes failing

In some situations we reloaded the workspace in the tests after having reported
to be ready. There's two fixes here:
1. Add a version to the VFS config and include that version in progress reports,
so that we don't think we're done prematurely;
2. Delay status transitions until after changes are applied. Otherwise the last
change during loading can potentially trigger a workspace reload, if it contains
interesting changes.

3 years agoMerge #7653
bors[bot] [Fri, 12 Feb 2021 15:10:50 +0000 (15:10 +0000)]
Merge #7653

7653: Document config pattern r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDocument config pattern
Aleksey Kladov [Fri, 12 Feb 2021 15:10:16 +0000 (18:10 +0300)]
Document config pattern

3 years agoMerge #7644
bors[bot] [Fri, 12 Feb 2021 13:18:30 +0000 (13:18 +0000)]
Merge #7644

7644: Primitive completion r=jonas-schievink a=jonas-schievink

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

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #7638 #7648
bors[bot] [Fri, 12 Feb 2021 13:01:44 +0000 (13:01 +0000)]
Merge #7638 #7648

7638: libloading 0.7 r=kjeremy a=kjeremy

See https://docs.rs/libloading/0.7.0/libloading/changelog/r0_7_0/index.html

7648: fix nightly warning `legacy_derive_helpers` r=lnicola a=peddermaster2

With a recent nightly (e.g. 2021-02-10) a warning comes up. This PR reorders the attributes to fix the warning.

See https://github.com/rust-lang/rust/issues/79202

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Peter Wischer <peter.wischer@lwl.org>
3 years agofix nightly warning `legacy_derive_helpers`
Peter Wischer [Fri, 12 Feb 2021 12:46:30 +0000 (13:46 +0100)]
fix nightly warning `legacy_derive_helpers`

see https://github.com/rust-lang/rust/issues/79202

3 years agoMerge #7651
bors[bot] [Fri, 12 Feb 2021 12:06:26 +0000 (12:06 +0000)]
Merge #7651

7651: Pin Rust to 1.49.0 on CI r=jonas-schievink a=jonas-schievink

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoPin Rust to 1.49.0 on CI
Jonas Schievink [Fri, 12 Feb 2021 11:09:54 +0000 (12:09 +0100)]
Pin Rust to 1.49.0 on CI

3 years agoComplete builtin type paths
Jonas Schievink [Thu, 11 Feb 2021 18:52:46 +0000 (19:52 +0100)]
Complete builtin type paths

3 years agoWrap `BuiltinType` in code model
Jonas Schievink [Thu, 11 Feb 2021 18:52:33 +0000 (19:52 +0100)]
Wrap `BuiltinType` in code model

3 years agolibloading 0.7
kjeremy [Thu, 11 Feb 2021 15:07:49 +0000 (10:07 -0500)]
libloading 0.7

See https://docs.rs/libloading/0.7.0/libloading/changelog/r0_7_0/index.html

3 years agoMerge #7631
bors[bot] [Wed, 10 Feb 2021 17:43:06 +0000 (17:43 +0000)]
Merge #7631

7631: Add test for #1165 r=jonas-schievink a=jonas-schievink

Closes #1165

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd test for #1165
Jonas Schievink [Wed, 10 Feb 2021 17:42:35 +0000 (18:42 +0100)]
Add test for #1165

Closes #1165

3 years agoMerge #7630
bors[bot] [Wed, 10 Feb 2021 16:37:45 +0000 (16:37 +0000)]
Merge #7630

7630: Slightly expand test r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSlightly expand test
Jonas Schievink [Wed, 10 Feb 2021 16:37:15 +0000 (17:37 +0100)]
Slightly expand test

3 years agoMerge #7627
bors[bot] [Wed, 10 Feb 2021 15:59:49 +0000 (15:59 +0000)]
Merge #7627

7627: infer: update resolver when descending into block r=jonas-schievink a=jonas-schievink

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd more tests
Jonas Schievink [Wed, 10 Feb 2021 14:54:21 +0000 (15:54 +0100)]
Add more tests

3 years agoPut the old resolver back
Jonas Schievink [Wed, 10 Feb 2021 14:12:45 +0000 (15:12 +0100)]
Put the old resolver back

3 years agoUpdate fixed tests
Jonas Schievink [Wed, 10 Feb 2021 13:48:52 +0000 (14:48 +0100)]
Update fixed tests