Commit Graph

19497 Commits

Author SHA1 Message Date
Jonas Schievink
0cd24c14c5 Only add proc_macro to prelude in proc-macro crates 2021-10-04 18:22:39 +02:00
bors[bot]
5bdae82947
Merge #10456
10456: fix: Avoid cycle when lowering predicates for associated item lookup r=flodiebold a=jonas-schievink

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

(the salsa bug persists, but this lets us avoid it by fixing the underlying bug)

This reimplements the rustc logic in b27661eb33/compiler/rustc_typeck/src/collect.rs (L556): When resolving an associated type `T::Item`, we've previously lowered all predicates that could affect `T`, but we actually have to look only at those predicates whose traits define an associated type of the right name.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-04 15:58:06 +00:00
longfangsong
4d1a4dc0d6 Add generate_constant assist 2021-10-04 23:53:32 +08:00
Lukas Wirth
88f213eadd Initial implementation of custom postfix snippets 2021-10-04 17:49:21 +02:00
bors[bot]
cf1ea9d0b9
Merge #10457
10457: internal: remove support for pre-1.47 sysroots r=lnicola a=lnicola

This changed in 1.47 (about a year ago), so it should be pretty safe to remove.

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-04 15:44:19 +00:00
Jonas Schievink
3aa37d7f80 Avoid cycle when lowering predicates for associated item lookup 2021-10-04 17:39:55 +02:00
Laurențiu Nicola
a683c08729 Remove support for old-style sysroot 2021-10-04 18:36:56 +03:00
bors[bot]
9724ca7af1
Merge #10451
10451: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-04 13:18:21 +00:00
Lukas Wirth
7faa35cbbd Simplify 2021-10-04 15:16:13 +02:00
bors[bot]
6ee351535b
Merge #10449
10449: make Some(1..) parsed r=lnicola a=XFFXFF

fixes https://github.com/rust-analyzer/rust-analyzer/issues/9066  
[rustc_ty_utils/src/ty.rs](d7795d302a/compiler/rustc_ty_utils/src/ty.rs (L524))

Co-authored-by: zhoufan <1247714429@qq.com>
2021-10-04 09:47:03 +00:00
zhoufan
a248f39cb4 make Some(1..) parsed 2021-10-04 17:33:48 +08:00
Eric Sampson
5df6259996 tweak variable names. 2021-10-04 02:42:13 -05:00
Eric Sampson
99dd8066d9 need to update some generated files. 2021-10-04 02:30:46 -05:00
Eric Sampson
a0bb31587e Add enum variant references CodeLens. 2021-10-04 02:18:31 -05:00
bors[bot]
4b7675fcc3
Merge #10442
10442: fix: Limit depth to 1 when searching for `Cargo.toml` r=matklad a=lnicola

...and add `rust-project.json`.

More or less fixes #7268

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-03 14:58:28 +00:00
Laurențiu Nicola
f5c9204ff2 Limit depth to 1 when searching for Cargo.toml 2021-10-03 17:58:03 +03:00
bors[bot]
10eaa5a0af
Merge #10441
10441: feat: Hide type inlay hints for constructors r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/3022
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 13:35:47 +00:00
Lukas Wirth
a31bc668f5 Hide generic constructors if appropriate 2021-10-03 15:35:26 +02:00
Aramis Razzaghipour
eff195852d
Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
Lukas Wirth
992b4648d9 feat: Hide type inlay hints for constructors 2021-10-03 14:53:18 +02:00
Aramis Razzaghipour
55c0b86cde
Add semicolons for consistency
`clippy::semicolon_if_nothing_returned`
2021-10-03 23:39:43 +11:00
bors[bot]
e28aa1928b
Merge #10439
10439: fix: fix insert_use incorrectly merging glob imports r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6800
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 12:19:02 +00:00
Lukas Wirth
5b0c91d118 fix: fix insert_use incorrectly merging glob imports 2021-10-03 14:06:44 +02:00
Lukas Wirth
e684235329 Move module private logic down 2021-10-03 13:52:40 +02:00
bors[bot]
ebe6c38a44
Merge #10438
10438: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 11:06:06 +00:00
Lukas Wirth
0943c4be8b minor: Simplify 2021-10-03 13:05:42 +02:00
bors[bot]
0618a6f184
Merge #10436
10436: fix: await insertion with try_expr during extract_function r=Veykril a=feniljain

Fixing  #10333

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
2021-10-03 10:07:58 +00:00
vi_mi
61643513b6 fix: await insertion with try_expr during extract_function 2021-10-03 09:41:21 +00:00
bors[bot]
13ec077b91
Merge #10437
10437: fix: Fix extract_variable not allowing to extract macro calls r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6866
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 09:10:33 +00:00
Lukas Wirth
a359a1f2e3 Fix extract_variable not allowing to extract macro calls 2021-10-03 11:09:49 +02:00
zhoufan
116c7aef7f move outer_attrs call before the match 2021-10-03 09:22:02 +08:00
bors[bot]
60c5449120
Merge #10431
10431: internal: cleanup mbe a bit r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 17:39:06 +00:00
Aleksey Kladov
4e352275d1 minor: simplify 2021-10-02 20:38:39 +03:00
Aleksey Kladov
613609cc5e minor: cleanup 2021-10-02 20:38:39 +03:00
Aleksey Kladov
77bf761203 internal: move code to where it's used and reduce visibility 2021-10-02 20:38:39 +03:00
bors[bot]
e504f8ae8d
Merge #10430
10430: fix: Fix rename trying to edit the same range multiple times for certain macro inputs r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10324
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-02 16:51:55 +00:00
Lukas Wirth
86e5406539 Fix rename trying to edit the same range multiple times 2021-10-02 18:50:21 +02:00
bors[bot]
c88277f676
Merge #10421
10421: minor: Bump npm non-dev deps r=lnicola a=lnicola

Fixes #10407

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-02 16:43:24 +00:00
bors[bot]
5faf07d082
Merge #10429
10429: internal: remove deprecated method r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 16:34:03 +00:00
Aleksey Kladov
7dbf24fc7a minor: dead code 2021-10-02 15:42:10 +03:00
Aleksey Kladov
d5c5b7cd12 internal: remove deprecated method 2021-10-02 15:28:55 +03:00
Aleksey Kladov
9c74a5b2c0 minor: reduce duplication 2021-10-02 15:24:32 +03:00
bors[bot]
745fd9903c
Merge #10428
10428: minor: regen r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 12:20:45 +00:00
Aleksey Kladov
f04f8ddb0d minor: regen 2021-10-02 15:20:16 +03:00
Aleksey Kladov
f3a1ff786f minor: generated code readability 2021-10-02 15:20:03 +03:00
bors[bot]
a6e6f9c58b
Merge #10427
10427: minor r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 10:21:07 +00:00
Aleksey Kladov
393f80e036 minor 2021-10-02 13:20:45 +03:00
bors[bot]
5ff551d86f
Merge #10426
10426: internal: use naming that matches intended use-case r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 10:06:24 +00:00
Aleksey Kladov
12103b16de internal: untangle usages of ReferenceCategory somewhat
Not everything that can be read or write is a reference, let's try to
use more precise types.
2021-10-02 13:02:06 +03:00
bors[bot]
c1fa583781
Merge #10425
10425: fix: remove semicolon diagnostics only highlights the semi r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 09:54:33 +00:00