]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #8398
bors[bot] [Tue, 11 May 2021 19:01:39 +0000 (19:01 +0000)]
Merge #8398

8398: Fix inference with conditionally compiled tails r=flodiebold a=DJMcNab

Fixes #8378

Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
3 years agoMerge #8801
bors[bot] [Tue, 11 May 2021 18:02:31 +0000 (18:02 +0000)]
Merge #8801

8801: feat: Allow viewing the crate graph in a webview r=jonas-schievink a=jonas-schievink

This uses `dot` to render the crate graph as an SVD file, and displays it in a VS Code panel. For simple crate graphs, it works quite well:

![screenshot-2021-05-11-16:19:32](https://user-images.githubusercontent.com/1786438/117831361-c4a48980-b274-11eb-9276-240cdf6919aa.png)

Unfortunately, on rust-analyzer itself (and most medium-sized dependency graphs), `dot` runs for around a minute and then produces this mess:

![screenshot-2021-05-11-16:41:37](https://user-images.githubusercontent.com/1786438/117834831-c754ae00-b277-11eb-850b-138495dbeba8.png)

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoBetter node label/shapes
Jonas Schievink [Tue, 11 May 2021 17:50:01 +0000 (19:50 +0200)]
Better node label/shapes

3 years agoMerge #8796
bors[bot] [Tue, 11 May 2021 17:47:45 +0000 (17:47 +0000)]
Merge #8796

8796: internal: rewrite `#[derive]` removal to be based on AST (take 2) r=jonas-schievink a=jonas-schievink

Second attempt of https://github.com/rust-analyzer/rust-analyzer/pull/8443, this uses syntactical attribute offsets in `hir_expand`, and changes `attr.rs` to make those easy to derive.

This will make it easy to add similar attribute removal for attribute macros, unblocking them.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoOnly include workspace crates
Jonas Schievink [Tue, 11 May 2021 17:17:43 +0000 (19:17 +0200)]
Only include workspace crates

3 years agoDocument viewCrateGraph request
Jonas Schievink [Tue, 11 May 2021 14:45:51 +0000 (16:45 +0200)]
Document viewCrateGraph request

3 years agoUpdate crates/ide/src/view_crate_graph.rs
Jonas Schievink [Tue, 11 May 2021 14:42:27 +0000 (16:42 +0200)]
Update crates/ide/src/view_crate_graph.rs

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
3 years agoDistinguish crates with identical name
Jonas Schievink [Tue, 11 May 2021 14:36:00 +0000 (16:36 +0200)]
Distinguish crates with identical name

3 years agoAllow viewing the crate graph in a webview
Jonas Schievink [Tue, 11 May 2021 14:15:31 +0000 (16:15 +0200)]
Allow viewing the crate graph in a webview

3 years agoMerge #8800
bors[bot] [Tue, 11 May 2021 13:14:55 +0000 (13:14 +0000)]
Merge #8800

8800: feat: Make "pull assignments up" assist work in more cases r=Jesse-Bakker a=Jesse-Bakker

Fixes #8771

Co-authored-by: Jesse Bakker <github@jessebakker.com>
3 years agoMake "pull assignments up" assist work in more cases
Jesse Bakker [Tue, 11 May 2021 12:22:51 +0000 (14:22 +0200)]
Make "pull assignments up" assist work in more cases

3 years agoMerge #8798
bors[bot] [Tue, 11 May 2021 10:07:25 +0000 (10:07 +0000)]
Merge #8798

8798: internal: use modern resolever r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: use modern resolever
Aleksey Kladov [Tue, 11 May 2021 10:06:35 +0000 (13:06 +0300)]
internal: use modern resolever

I don't think this affects us, but better to stick to modern
practicies.

3 years agoRewrite `#[derive]` removal to be based on AST
Jonas Schievink [Mon, 10 May 2021 20:54:17 +0000 (22:54 +0200)]
Rewrite `#[derive]` removal to be based on AST

3 years agoMerge #8794
bors[bot] [Mon, 10 May 2021 20:10:59 +0000 (20:10 +0000)]
Merge #8794

8794: Give MergeBehaviour variants better names r=Veykril a=Veykril

I never really liked the variant names I gave this enum from the beginning and then I found out about rustfmt's `imports_granularity` config:

> imports_granularity
>
> How imports should be grouped into use statements. Imports will be merged or split to the configured level of granularity.
>
>     Default value: Preserve
>     Possible values: Preserve, Crate, Module, Item
>     Stable: No

I personally prefer using `crate` over `full` and `module` over last, they seem more descriptive. Keeping these similar between tooling also seems like a good plus point to me.

We might even wanna take over the entire enum at some point if we have a `format/cleanup imports` assists in the future which would probably want to also have the `preserve` and `item` options.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUpdate docs
Lukas Wirth [Mon, 10 May 2021 19:33:01 +0000 (21:33 +0200)]
Update docs

3 years agoRewrite `attr.rs` to allow using syntax-based indices
Jonas Schievink [Mon, 10 May 2021 19:50:42 +0000 (21:50 +0200)]
Rewrite `attr.rs` to allow using syntax-based indices

3 years agoGive MergeBehaviour variants better names
Lukas Wirth [Mon, 10 May 2021 19:03:50 +0000 (21:03 +0200)]
Give MergeBehaviour variants better names

3 years agoMerge #8793
bors[bot] [Mon, 10 May 2021 18:08:26 +0000 (18:08 +0000)]
Merge #8793

8793: Corrected 2 typos on line 83 r=Veykril a=mixio

Co-authored-by: mixio <38652479+mixio@users.noreply.github.com>
3 years agoCorrected 2 typos on line 83
mixio [Mon, 10 May 2021 18:05:32 +0000 (20:05 +0200)]
Corrected 2 typos on line 83

3 years agoMove `AttrId` back into `hir_def`
Jonas Schievink [Mon, 10 May 2021 14:35:06 +0000 (16:35 +0200)]
Move `AttrId` back into `hir_def`

3 years agoMerge #8791
bors[bot] [Mon, 10 May 2021 13:21:33 +0000 (13:21 +0000)]
Merge #8791

8791: feat: auto-indent use tree lists r=jonas-schievink a=jonas-schievink

![Peek 2021-05-10 15-20](https://user-images.githubusercontent.com/1786438/117665627-53e16c80-b1a3-11eb-8906-1b88b394367b.gif)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agofeat: auto-indent use tree lists
Jonas Schievink [Mon, 10 May 2021 13:10:56 +0000 (15:10 +0200)]
feat: auto-indent use tree lists

3 years agoMerge #8790
bors[bot] [Mon, 10 May 2021 12:44:17 +0000 (12:44 +0000)]
Merge #8790

8790: fix: fix manual rendering r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: fix manual rendering
Aleksey Kladov [Mon, 10 May 2021 12:43:01 +0000 (15:43 +0300)]
fix: fix manual rendering

We add `// see the other repo` comments before headers (==). This one isn't a header, but a closing of the example block.

3 years agoMerge #8789
bors[bot] [Mon, 10 May 2021 12:26:52 +0000 (12:26 +0000)]
Merge #8789

8789: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agosimplify
Aleksey Kladov [Mon, 10 May 2021 12:25:56 +0000 (15:25 +0300)]
simplify

3 years agoMerge #8784
bors[bot] [Sun, 9 May 2021 20:17:37 +0000 (20:17 +0000)]
Merge #8784

8784: feat: auto-insert `}` when typing `{` in use item r=jonas-schievink a=jonas-schievink

![Peek 2021-05-09 22-14](https://user-images.githubusercontent.com/1786438/117585742-45983f80-b114-11eb-80fc-d44f480fd012.gif)

cc https://github.com/rust-analyzer/rust-analyzer/issues/8636

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agofeat: auto-insert `}` when typing `{` in use item
Jonas Schievink [Sun, 9 May 2021 20:12:58 +0000 (22:12 +0200)]
feat: auto-insert `}` when typing `{` in use item

3 years agoMerge #8783
bors[bot] [Sun, 9 May 2021 16:56:02 +0000 (16:56 +0000)]
Merge #8783

8783: internal: introduce `ast::make::ext` module with common shortcuts r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: introduce `ast::make::ext` module with common shortcuts
Aleksey Kladov [Sun, 9 May 2021 16:51:06 +0000 (19:51 +0300)]
internal: introduce `ast::make::ext` module with common shortcuts

There's a tension between keeping a well-architectured minimal
orthogonal set of constructs, and providing convenience functions.
Relieve this pressure by introducing an dedicated module for
non-orthogonal shortcuts.

This is inspired by the django.shortcuts module which serves a similar
purpose architecturally.

3 years agoMerge #8782
bors[bot] [Sun, 9 May 2021 16:23:03 +0000 (16:23 +0000)]
Merge #8782

8782: internal: fix make API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: fix make API
Aleksey Kladov [Sun, 9 May 2021 16:11:42 +0000 (19:11 +0300)]
internal: fix make API

3 years agoMerge #8781
bors[bot] [Sun, 9 May 2021 15:55:42 +0000 (15:55 +0000)]
Merge #8781

8781: internal: rewrite **Repalce impl Trait** assist to mutable syntax trees r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: rewrite **Repalce impl Trait** assist to mutable syntax trees
Aleksey Kladov [Sun, 9 May 2021 15:20:37 +0000 (18:20 +0300)]
internal: rewrite **Repalce impl Trait** assist to mutable syntax trees

3 years agocleanups
Aleksey Kladov [Sun, 9 May 2021 14:59:52 +0000 (17:59 +0300)]
cleanups

3 years agocleanups
Aleksey Kladov [Sun, 9 May 2021 14:58:03 +0000 (17:58 +0300)]
cleanups

3 years agominor: fix test style
Aleksey Kladov [Sun, 9 May 2021 14:41:25 +0000 (17:41 +0300)]
minor: fix test style

3 years agofix: join lines doesn't add space before closing quote
Aleksey Kladov [Sun, 9 May 2021 14:17:28 +0000 (17:17 +0300)]
fix: join lines doesn't add space before closing quote

3 years agoMerge #8776
bors[bot] [Sun, 9 May 2021 14:40:49 +0000 (14:40 +0000)]
Merge #8776

8776: fix: fix unnecessary recomputations due to macros r=jonas-schievink a=jonas-schievink

This computes a macro's fragment kind eagerly (when the calling file is still available in parsed form) and stores it in the `MacroCallLoc`. This means that during expansion we no longer have to reparse the file containing the macro call, avoiding the unnecessary salsa dependencies (https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349).

Marking as draft until I manage to find a test for this problem, since for some reason `typing_inside_a_function_should_not_invalidate_expansions` does not catch this (which might indicate that I misunderstand the problem).

I've manually confirmed that this fixes the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349:

```
    7ms - parse_query @ FileId(179)
   12ms - SourceBinder::to_module_def
       12ms - crate_def_map:wait
            5ms - item_tree_query (1 calls)
            7ms - ???
```

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoTest that none of the macros are reparsed
Jonas Schievink [Sun, 9 May 2021 14:04:34 +0000 (16:04 +0200)]
Test that none of the macros are reparsed

3 years agoMerge #8779
bors[bot] [Sun, 9 May 2021 14:19:39 +0000 (14:19 +0000)]
Merge #8779

8779: fix: join lines doesn't add space before closing quote r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: join lines doesn't add space before closing quote
Aleksey Kladov [Sun, 9 May 2021 14:17:28 +0000 (17:17 +0300)]
fix: join lines doesn't add space before closing quote

3 years agoMerge #8777
bors[bot] [Sun, 9 May 2021 12:01:35 +0000 (12:01 +0000)]
Merge #8777

8777: Escape characters in builtin macros correctly r=edwin0cheng a=edwin0cheng

Fixes #8749

It is the same bug in #8560 but in our `quote!` macro.

Because the "\" are adding exponentially in #8749 case, so the text is eat up all the memory.

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoEscape characters in builtin macros correctly
Edwin Cheng [Sun, 9 May 2021 11:57:29 +0000 (19:57 +0800)]
Escape characters in builtin macros correctly

3 years agoMerge #8774
bors[bot] [Sun, 9 May 2021 10:33:31 +0000 (10:33 +0000)]
Merge #8774

8774: feat: Honor `.cargo/config.toml` r=matklad a=Veykril

![f1Gup1aiAn](https://user-images.githubusercontent.com/3757771/117545448-1dcaae00-b026-11eb-977a-0f35a5e3f2e0.gif)

Implements `cargo/.config` build target and cfg access by using unstable cargo options:

- `cargo config get` to read the target triple out of the config to pass to `cargo metadata` --filter-platform
- `cargo rustc --print` to read out the `rustc_cfgs`, this causes us to honor `rustflags` and the like.

If those commands fail, due to not having a nightly toolchain present for example, they will fall back to invoking rustc directly as we currently do.

I personally think it should be fine to use these unstable options as they are unlikely to change(even if they did it shouldn't be a problem due to the fallback) and don't burden the user if they do not have a nightly toolchain at hand since we fall back to the previous behaviour.

cc #8741
Closes #6604, Closes #5904, Closes #8430, Closes #8480

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoPrecompute macro fragment kind
Jonas Schievink [Sat, 8 May 2021 23:36:06 +0000 (01:36 +0200)]
Precompute macro fragment kind

3 years agoMerge #8773
bors[bot] [Sat, 8 May 2021 22:09:03 +0000 (22:09 +0000)]
Merge #8773

8773: fix: Correctly support SelfType when searching for usages r=Veykril a=Veykril

Fixes #7443

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUse RUSTC_BOOTSTRAP=1 instead of +nightly when discovering rust_cfgs throughs cargo
Lukas Wirth [Sat, 8 May 2021 22:07:04 +0000 (00:07 +0200)]
Use RUSTC_BOOTSTRAP=1 instead of +nightly when discovering rust_cfgs throughs cargo

3 years agoDon't handle Self as a usage for TraitDefs
Lukas Wirth [Sat, 8 May 2021 21:30:19 +0000 (23:30 +0200)]
Don't handle Self as a usage for TraitDefs

3 years agoMerge #8775
bors[bot] [Sat, 8 May 2021 21:14:47 +0000 (21:14 +0000)]
Merge #8775

8775: Add `=` to pattern recovery r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd `=` to pattern recovery
Lukas Wirth [Sat, 8 May 2021 21:14:08 +0000 (23:14 +0200)]
Add `=` to pattern recovery

3 years agoFix builtintype def_to_ty
Lukas Wirth [Sat, 8 May 2021 20:43:26 +0000 (22:43 +0200)]
Fix builtintype def_to_ty

3 years agoCorrectly support SelfType when searching for usages
Lukas Wirth [Sat, 8 May 2021 20:34:55 +0000 (22:34 +0200)]
Correctly support SelfType when searching for usages

3 years agoMerge #8772
bors[bot] [Sat, 8 May 2021 20:29:03 +0000 (20:29 +0000)]
Merge #8772

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

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: remove dead code
Aleksey Kladov [Sat, 8 May 2021 20:28:36 +0000 (23:28 +0300)]
minor: remove dead code

3 years agoMerge #8770
bors[bot] [Sat, 8 May 2021 20:20:09 +0000 (20:20 +0000)]
Merge #8770

8770: feat: add "mentoring instructions" test for pull up assist r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: add "mentoring instructions" test for pull up assist
Aleksey Kladov [Sat, 8 May 2021 20:19:08 +0000 (23:19 +0300)]
feat: add "mentoring instructions" test for pull up assist

3 years agointernal: pull_assignment_up uses mutable trees
Aleksey Kladov [Sat, 8 May 2021 20:09:36 +0000 (23:09 +0300)]
internal: pull_assignment_up uses mutable trees

3 years agominor: add missing test
Aleksey Kladov [Sat, 8 May 2021 17:40:07 +0000 (20:40 +0300)]
minor: add missing test

3 years agoMerge #8769
bors[bot] [Sat, 8 May 2021 17:03:58 +0000 (17:03 +0000)]
Merge #8769

8769: internal: removed dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agodead code
Aleksey Kladov [Sat, 8 May 2021 16:54:03 +0000 (19:54 +0300)]
dead code

3 years agoDisable more incremental
Aleksey Kladov [Sat, 8 May 2021 16:57:18 +0000 (19:57 +0300)]
Disable more incremental

3 years agoMerge #8768
bors[bot] [Sat, 8 May 2021 16:51:09 +0000 (16:51 +0000)]
Merge #8768

8768: internal: remove one more usage of SyntaxRewriter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDiscover rustc_cfg through unstable cargo options
Lukas Wirth [Sat, 8 May 2021 16:17:18 +0000 (18:17 +0200)]
Discover rustc_cfg through unstable cargo options

3 years agointernal: remove one more usage of SyntaxRewriter
Aleksey Kladov [Sat, 8 May 2021 12:42:17 +0000 (15:42 +0300)]
internal: remove one more usage of SyntaxRewriter

3 years agoMerge #8765
bors[bot] [Sat, 8 May 2021 11:47:40 +0000 (11:47 +0000)]
Merge #8765

8765: internal: remove one more syntax rewriter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: remove one more syntax rewriter
Aleksey Kladov [Sat, 8 May 2021 11:38:56 +0000 (14:38 +0300)]
internal: remove one more syntax rewriter

3 years agoMerge #8764
bors[bot] [Sat, 8 May 2021 11:14:24 +0000 (11:14 +0000)]
Merge #8764

8764: internal: add rust-analyzer version to panic context r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: add rust-analyzer version to panic context
Aleksey Kladov [Sat, 8 May 2021 11:03:12 +0000 (14:03 +0300)]
internal: add rust-analyzer version to panic context

3 years agoMerge #8763
bors[bot] [Sat, 8 May 2021 10:49:00 +0000 (10:49 +0000)]
Merge #8763

8763: feat: make troubleshooting a top-level section r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: make troubleshooting a top-level section
Aleksey Kladov [Sat, 8 May 2021 10:48:25 +0000 (13:48 +0300)]
feat: make troubleshooting a top-level section

3 years agoMerge #8762
bors[bot] [Sat, 8 May 2021 10:37:01 +0000 (10:37 +0000)]
Merge #8762

8762: internal: disable broken incremental builds 😿 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: disable broken incremental builds 😿
Aleksey Kladov [Sat, 8 May 2021 10:36:06 +0000 (13:36 +0300)]
internal: disable broken incremental builds 😿

3 years agoMerge #8761
bors[bot] [Sat, 8 May 2021 10:19:05 +0000 (10:19 +0000)]
Merge #8761

8761: feat: friendlier trouble shooting guide r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: friendlier trouble shooting guide
Aleksey Kladov [Sat, 8 May 2021 10:18:25 +0000 (13:18 +0300)]
feat: friendlier trouble shooting guide

3 years agoMerge #8760
bors[bot] [Sat, 8 May 2021 09:20:57 +0000 (09:20 +0000)]
Merge #8760

8760: :arrow_up: package-lock.json r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: package-lock.json
Aleksey Kladov [Sat, 8 May 2021 09:20:06 +0000 (12:20 +0300)]
:arrow_up: package-lock.json

3 years agoMerge #8759
bors[bot] [Sat, 8 May 2021 06:04:09 +0000 (06:04 +0000)]
Merge #8759

8759: docs: Add Kate installation section r=matklad a=meven

Replaces https://github.com/rust-analyzer/rust-analyzer.github.io/pull/111#issuecomment-834797031

Co-authored-by: Méven Car <meven29@gmail.com>
3 years agodocs: Add Kate installation section
Méven Car [Sat, 8 May 2021 05:33:24 +0000 (07:33 +0200)]
docs: Add Kate installation section

3 years agoMerge #8755
bors[bot] [Fri, 7 May 2021 21:27:20 +0000 (21:27 +0000)]
Merge #8755

8755: fix: direct people to the right repository r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: direct people to the right repository
Aleksey Kladov [Fri, 7 May 2021 21:19:01 +0000 (00:19 +0300)]
fix: direct people to the right repository

3 years agoMerge #8753
bors[bot] [Fri, 7 May 2021 20:50:47 +0000 (20:50 +0000)]
Merge #8753

8753: internal: expose cfg attrs from hir::Crate r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: expose cfg attrs from hir::Crate
Aleksey Kladov [Fri, 7 May 2021 20:35:43 +0000 (23:35 +0300)]
internal: expose cfg attrs from hir::Crate

3 years agoMerge #8752
bors[bot] [Fri, 7 May 2021 19:47:09 +0000 (19:47 +0000)]
Merge #8752

8752: Switch from jemalloc to tikv-jemalloc r=matklad a=djrenren

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

No idea if we're still interested in this but it was a simple change so here's the PR.

Co-authored-by: John Renner <john@jrenner.net>
3 years agoUse package renaming so source doesn't say tikv
John Renner [Fri, 7 May 2021 19:41:07 +0000 (12:41 -0700)]
Use package renaming so source doesn't say tikv

3 years agoSwitch from jemalloc to tikv-jemalloc
John Renner [Fri, 7 May 2021 19:17:37 +0000 (12:17 -0700)]
Switch from jemalloc to tikv-jemalloc

3 years agoMerge #8751
bors[bot] [Fri, 7 May 2021 18:47:05 +0000 (18:47 +0000)]
Merge #8751

8751: minor: standard snippet r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: standard snippet
Aleksey Kladov [Fri, 7 May 2021 18:46:25 +0000 (21:46 +0300)]
minor: standard snippet

3 years agoMerge #8748
bors[bot] [Fri, 7 May 2021 15:33:08 +0000 (15:33 +0000)]
Merge #8748

8748: fix: use raw idents in `make::{name, name_ref}` when used with a keyword r=jonas-schievink a=jonas-schievink

fixes https://github.com/rust-analyzer/rust-analyzer/issues/8680

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agofix: use raw idents in `make::name{_ref}` with keywords
Jonas Schievink [Fri, 7 May 2021 13:35:02 +0000 (15:35 +0200)]
fix: use raw idents in `make::name{_ref}` with keywords

3 years agoMerge #8745
bors[bot] [Thu, 6 May 2021 22:28:35 +0000 (22:28 +0000)]
Merge #8745

8745: Support goto_type_definition for types r=matklad a=Veykril

I'm unsure if the approach of lowering an `ast::Type` to a `hir::Type` is a good idea, it seems fine to me at least.
Fixes #2882

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoMerge #8280
bors[bot] [Thu, 6 May 2021 22:19:52 +0000 (22:19 +0000)]
Merge #8280

8280: Borrow text of immutable syntax node r=iDawer a=iDawer

In https://github.com/rust-analyzer/rowan/pull/101 `rowan::SyntaxNode::green` returns `Cow<'_, GreenNodeData>`. It returns borrow of green node of immutable syntax tree node.
Using this we can return borrowed text from `ast::Name::text`.

~~However now it allocates in case of mutable syntax trees.~~ (see next comment)

The idea comes from https://github.com/rust-analyzer/rowan/pull/100#issuecomment-809330325

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoMerge #8746
bors[bot] [Thu, 6 May 2021 21:53:05 +0000 (21:53 +0000)]
Merge #8746

8746: Don't store call-site text offsets in hygiene info r=matklad a=jonas-schievink

This threads a lot more database references around in order to avoid storing a bare `TextOffset` in the hygiene info. This `TextOffset` made hygiene info and `ItemTree`s more volatile than they should be, leading to excessive recomputation of `ItemTree`s.

The incremental test added in https://github.com/rust-analyzer/rust-analyzer/pull/8721 is now passing with these changes.

closes https://github.com/rust-analyzer/rust-analyzer/pull/8721

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoReuse database in LowerCtx
Jonas Schievink [Thu, 6 May 2021 21:23:50 +0000 (23:23 +0200)]
Reuse database in LowerCtx

3 years agoUpdate crates/hir_def/src/nameres/tests/incremental.rs
Aleksey Kladov [Tue, 4 May 2021 14:12:35 +0000 (17:12 +0300)]
Update crates/hir_def/src/nameres/tests/incremental.rs

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agointernal: add failing incremental test
Aleksey Kladov [Tue, 4 May 2021 12:31:23 +0000 (15:31 +0300)]
internal: add failing incremental test

3 years agoDon't store call-site text offsets in hygiene info
Jonas Schievink [Thu, 6 May 2021 17:59:54 +0000 (19:59 +0200)]
Don't store call-site text offsets in hygiene info

3 years agoMerge #8718
bors[bot] [Thu, 6 May 2021 17:29:30 +0000 (17:29 +0000)]
Merge #8718

8718: 1.52.0 r=SomeoneToIgnore a=matklad

A lot of APIs we use in this release!

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoSmall macro fix
Kirill Bulatov [Thu, 6 May 2021 17:12:30 +0000 (20:12 +0300)]
Small macro fix