Commit Graph

16704 Commits

Author SHA1 Message Date
bors[bot]
b5b4a1f23d
Merge #8692
8692: Fix panic caused by new Try trait definition r=flodiebold a=flodiebold

The new Try trait definition caused a query cycle for us. This adds recovery for that cycle, but also fixes the cause, which is that we went through the supertraits when resolving `<T as Trait>::Assoc`, which isn't actually necessary. I also rewrote `all_super_trait_refs` to an iterator before I realized what the actual problem was, so I kept that.

Fixes #8686.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-30 09:07:24 +00:00
bors[bot]
6ea91a419f
Merge #8695
8695: internal: fix naming polarity r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-30 08:57:17 +00:00
Aleksey Kladov
1a01a5ae19 internal: fix naming polarity
Type Constructors have *parameters*, when they are substituted with type
*arguments*, we have a type.
2021-04-30 11:55:59 +03:00
Aleksey Kladov
cb3ef552e8 internal: normalize name
All def types in hir are unsubstituted
2021-04-30 11:52:31 +03:00
Florian Diebold
c2aefd5b95 Don't look in super traits for <T as Trait>::Assoc
This isn't actually how it works, you have to specify the exact trait
that has the associated type.

Fixes #8686.
2021-04-29 20:23:02 +02:00
Florian Diebold
2d20ab7eaf Rewrite all_super_trait_refs as an iterator
Doesn't fix the bug I was trying to fix, but now that I did it anyway it
seems fine to keep.
2021-04-29 20:18:41 +02:00
Florian Diebold
b384cfcb81 Handle cycles in generic_defaults more gracefully 2021-04-29 20:00:43 +02:00
Florian Diebold
184a0d7c1e Add test for #8686 2021-04-29 20:00:21 +02:00
bors[bot]
80bee14e14
Merge #8687
8687: fix: closure unify without check ClosureId r=lnicola a=komonad

Previously, the unification of closure types is blocked by `Ty.equals_ctor` which compares the ClosureId of the closures. Here is a workaround to allow closures to unify their substitutions.

Fixes #8604.

Co-authored-by: Comonad <comonad@foxmail.com>
2021-04-29 07:45:37 +00:00
Comonad
78f1583bdd fix: closure unify without check ClosureId
closes #8604
2021-04-29 15:26:41 +08:00
bors[bot]
dce0d71b18
Merge #8685
8685: feat: parse const param defaults r=jonas-schievink a=jonas-schievink

These will probably be stabilized in a few releases, let's make sure we can at least parse them

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-29 01:09:37 +00:00
Jonas Schievink
cb8632d87c Parse const param defaults 2021-04-29 03:07:53 +02:00
bors[bot]
9d199486da
Merge #8684
8684: Correctly parse negated literals as const args r=jonas-schievink a=jonas-schievink

Previously we didn't accept `S::<-0>;`

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-29 00:28:27 +00:00
Jonas Schievink
caee3a2eeb Correctly parse negated literals as const args 2021-04-29 02:27:55 +02:00
bors[bot]
49b219b103
Merge #8683
8683: internal: ensure that client and server-side configs are not mixed up r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-28 10:13:52 +00:00
Aleksey Kladov
5c1a901035 internal: ensure that client and server-side configs are not mixed up
https://github.com/rust-lang/rust/issues/84647 would help big time here.
2021-04-28 13:13:30 +03:00
bors[bot]
fb45d2adec
Merge #8624
8624: Automatically detect rust library source file map  r=vsrs a=vsrs

This PR adds a new possible `rust-analyzer.debug.sourceFileMap` value:
```json
{
    "rust-analyzer.debug.sourceFileMap": "auto"
}
```

I did not make it the default because it uses two shell calls (`rustc --print sysroot` and `rustc -V -v`). First one can be slow (https://github.com/rust-lang/rustup/issues/783)

Fixes #8619

Co-authored-by: vsrs <vit@conrlab.com>
2021-04-27 20:41:35 +00:00
bors[bot]
e2b87735cc
Merge #8629 #8657
8629: Allow pressing | to surround closure arguments in VSCode r=matklad a=Smittyvb

This makes pressing <kbd>|</kbd> while some text is selected surround that text with pipes. This is useful when writing closures. 

In this demo, I press <kbd>|</kbd> to easily surround some text (`predicate`) with pipe characters to create a closure. Before, this would have replaced `predicate` with just `|`.

![](https://user-images.githubusercontent.com/10530973/115778847-3c257e00-a385-11eb-8c80-e0db970747db.gif)

(I am getting failures when I do `cargo test` even on `master` locally (due to #8585 I think), but GH Actions is fine with this)

8657: npm update r=matklad a=kjeremy



Co-authored-by: Smittyvb <me@smitop.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-27 13:22:09 +00:00
bors[bot]
86b5084917
Merge #8679
8679: fix: don't show error message for a valid notification r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-27 13:10:22 +00:00
Aleksey Kladov
f45c1ffc5b fix: don't show error message for a valid notification
Closes #6782, #6772
2021-04-27 16:09:59 +03:00
bors[bot]
ef7253c6df
Merge #8677
8677: Return ServerNotInitialized according to the spec r=kjeremy a=kjeremy

According to the spec we should return ServerNotInitialized if the server is waiting for an initialize request and something else comes in.
Upgrading to lsp-server 0.5.1 will do this and retry until the initialize request comes in.

Fixes #8581

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-27 11:51:03 +00:00
Jeremy Kolb
36c20dc23d Return ServerNotInitialized according to the spec
According to the spec we should return ServerNotInitialized if the server is waiting for an initialize request and something else comes in.
Upgrading to lsp-server 0.5.1 will do this and retry until the initialize request comes in.

Fixes #8581
2021-04-27 07:47:06 -04:00
bors[bot]
4af50de0ab
Merge #8617
8617: Add option to opt out of smaller font size for inlay hints. r=SomeoneToIgnore a=jmederosalvarado

As requested on issue #6883 this PR provides an option for users to opt out of the smaller font size for inlay hints. Part of #6883.

Co-authored-by: Jorge Mederos Alvarado <jmederosalvarado@gmail.com>
2021-04-27 08:31:35 +00:00
Jorge Mederos Alvarado
0230f22d2a Fix how and when old inlay hint decorations are disposed 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
c4dba4077f Add config options 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
9e5ef0ce72 Add option to opt out from smaller inlay hints font size 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
a2ba0f4846 add option to package.json 2021-04-26 20:29:54 -04:00
bors[bot]
c5364ffde1
Merge #8671
8671: minor: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 16:31:19 +00:00
Aleksey Kladov
f06e4b8e74 minor: simplify 2021-04-26 19:30:50 +03:00
bors[bot]
7e10df9df9
Merge #8670
8670: fix: make error message in the status bar more useful r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 16:18:02 +00:00
Aleksey Kladov
363cef5c0e fix: make error message in the status bar more useful
At the moment,the popup is just a bazillion of Cargo's "Compiling this\nCompiling that",
which is not that useful.

--quiet still displays error, which is what we needc
2021-04-26 19:16:07 +03:00
bors[bot]
6cd669e880
Merge #8668
8668: Use more cross-platform utc `date` argument r=matklad a=SomeoneToIgnore

Part of https://github.com/rust-analyzer/rust-analyzer/issues/8571

```
$ docker run -it --rm ubuntu:20.04 bash
root@7393d1e7bbad:/# date -u +%Y-%m-%d
2021-04-26
```

```
$ date -u +%Y-%m-%d
2021-04-26

$ uname -a
Darwin alaptop.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
```

Some of the places where I've change this do not really require it (since macos bin would have failed with `--iso` param also), but I've changed them for consistency.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2021-04-26 14:17:05 +00:00
Kirill Bulatov
c24bdab97e Use -u instead of --utc date flag 2021-04-26 17:12:13 +03:00
bors[bot]
eee50b6921
Merge #8666
8666: fix: correct version string on windows and mac r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 12:27:35 +00:00
Aleksey Kladov
4f9640ff39 fix: add date to the version string on Mac
It doesn't support `--iso`
2021-04-26 15:20:15 +03:00
Aleksey Kladov
869ec5f97a fix: dont' misundentify nightly as stable in --version on Mac&Win
We used to set `--nightly` in CI, and only for linux. Let's detect this
in xtask instead.
2021-04-26 15:17:02 +03:00
bors[bot]
691c96e36a
Merge #8661
8661: internal: make normal release after a poin release less annoying r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 10:49:40 +00:00
Aleksey Kladov
26dfb6b9d0
Update xtask/src/release.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-04-26 13:49:19 +03:00
Aleksey Kladov
1745207a08
Update xtask/src/release.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-04-26 13:49:14 +03:00
Aleksey Kladov
7bb9c147c0 internal: make normal release after a poin release less annoying 2021-04-26 13:41:34 +03:00
bors[bot]
3209ddacd5
Merge #8660
8660: Added `mutable` semantic token modifier for `&mut self` methods r=Veykril a=1c3t3a

This closes #8644.

Co-authored-by: Bastian Kersting <bastian@cmbt.de>
2021-04-26 09:39:15 +00:00
Bastian Kersting
421cf9a1bd Fixed formatting 2021-04-26 11:37:28 +02:00
Bastian Kersting
336b81abd7 Added mutable semantic token modifier for &mut self methods 2021-04-26 09:24:18 +02:00
bors[bot]
617535393b
Merge #8658
8658: Check more carefully for cases where a rename can't be done r=Veykril a=dzhu

Attempting to rename an element of a tuple field would previously replace the type with the new name, which doesn't make sense; now it fails instead.

The check is done in both `prepare_rename` and `rename` so that the case is caught before the user is prompted for a new name. Some other existing failure cases are also now additionally checked in `prepare_rename`.

Closes: #8592

(I threw in some doc edits for a relevant type; of course, I can remove those if the policy here is to be strict about scope of changes within a PR.)

Co-authored-by: Danny Zhu <dzhu@dzhu.us>
2021-04-25 21:18:57 +00:00
Danny Zhu
09fc5e1dd7 Check more carefully for cases where a rename can't be done
Attempting to rename an element of a tuple field would previously
replace the type with the new name, which doesn't make sense; now it
fails instead.

The check is done in both `prepare_rename` and `rename` so that the case
is caught before the user is prompted for a new name. Some other
existing failure cases are also now additionally checked in
`prepare_rename`.
2021-04-25 14:08:56 -07:00
Jeremy Kolb
1c927650f7 npm update 2021-04-25 16:16:01 -04:00
bors[bot]
d8578bf9bf
Merge #8656
8656: Update deps r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-25 19:44:47 +00:00
Jeremy Kolb
321aa9eb92 Update deps 2021-04-25 15:43:42 -04:00
bors[bot]
1b4defd240
Merge #8647
8647: internal: Split out merge_imports module from helpers::insert_use r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-24 11:39:50 +00:00
Lukas Wirth
050c69c19d Split out merge_imports module from helpers::insert_use 2021-04-24 13:31:43 +02:00