]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #6909
bors[bot] [Wed, 16 Dec 2020 22:42:54 +0000 (22:42 +0000)]
Merge #6909

6909: Avoid querying attributes in item tree lowering r=jonas-schievink a=jonas-schievink

ItemTree is per-file, so there is no unique crate associated with it.
This means that it cannot know the active CfgOptions and thus couldn't
handle `cfg_attr`.

Prepare it for `cfg_attr`s by avoiding accessing attributes.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAvoid querying attributes in item tree lowering
Jonas Schievink [Wed, 16 Dec 2020 22:42:03 +0000 (23:42 +0100)]
Avoid querying attributes in item tree lowering

ItemTree is per-file, so there is no unique crate associated with it.
This means that it cannot know the active CfgOptions and thus couldn't
handle `cfg_attr`.

Prepare it for `cfg_attr`s by avoiding accessing attributes.

3 years agoMerge #6896
bors[bot] [Wed, 16 Dec 2020 17:08:03 +0000 (17:08 +0000)]
Merge #6896

6896: Node-ify lifetimes r=jonas-schievink a=Veykril

Let's see if this passes the tests 🤞

Depends on https://github.com/rust-analyzer/ungrammar/pull/15

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6897
bors[bot] [Wed, 16 Dec 2020 16:52:46 +0000 (16:52 +0000)]
Merge #6897

6897: Basic support for macros 2.0 r=jonas-schievink a=jonas-schievink

This adds support for (built-in-only) macros 2.0, and removes some hacks used for builtin derives, which are declared via macros 2.0 in libcore.

First steps for https://github.com/rust-analyzer/rust-analyzer/issues/2248.

Blocked on https://github.com/rust-analyzer/ungrammar/pull/16.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoMerge #6906
bors[bot] [Wed, 16 Dec 2020 15:07:47 +0000 (15:07 +0000)]
Merge #6906

6906: Document new permissions r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpdate docs/dev/README.md
Aleksey Kladov [Wed, 16 Dec 2020 15:07:21 +0000 (18:07 +0300)]
Update docs/dev/README.md

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDocument new permissions
Aleksey Kladov [Wed, 16 Dec 2020 15:03:15 +0000 (18:03 +0300)]
Document new permissions

3 years agoNode-ify lifetimes
Lukas Wirth [Tue, 15 Dec 2020 18:23:51 +0000 (19:23 +0100)]
Node-ify lifetimes

3 years agoUnpatch ungrammar
Jonas Schievink [Wed, 16 Dec 2020 11:54:34 +0000 (12:54 +0100)]
Unpatch ungrammar

3 years agoMerge #6861
bors[bot] [Wed, 16 Dec 2020 08:36:05 +0000 (08:36 +0000)]
Merge #6861

6861: generate default implementation for an enum from an enum variant #6860 r=matklad a=bnjjj

close #6860

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6894
bors[bot] [Wed, 16 Dec 2020 08:20:11 +0000 (08:20 +0000)]
Merge #6894

6894: Parenthesize composite if condition before inverting in invert-if assist r=matklad a=Jesse-Bakker

Fixes #6867

Co-authored-by: Jesse Bakker <github@jessebakker.com>
3 years agogenerate default implementation for an enum from an enum variant #6860
Benjamin Coenen [Tue, 15 Dec 2020 20:35:41 +0000 (21:35 +0100)]
generate default implementation for an enum from an enum variant #6860

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMake macro def krate mandatory
Jonas Schievink [Tue, 15 Dec 2020 19:33:05 +0000 (20:33 +0100)]
Make macro def krate mandatory

Refactors builtin derive support to go through proper name resolution

3 years agoBasic support for decl macros 2.0
Jonas Schievink [Tue, 15 Dec 2020 17:43:19 +0000 (18:43 +0100)]
Basic support for decl macros 2.0

3 years agoMerge #6879
bors[bot] [Tue, 15 Dec 2020 17:22:03 +0000 (17:22 +0000)]
Merge #6879

6879: Change HasChildSource::ChildId assoc item to generic param r=matklad a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoChange HasChildSource::ChildId assoc item to generic param
Lukas Wirth [Mon, 14 Dec 2020 16:11:27 +0000 (17:11 +0100)]
Change HasChildSource::ChildId assoc item to generic param

3 years agoParenthesize composite if condition before inverting in invert-if assist
Jesse Bakker [Tue, 15 Dec 2020 15:25:57 +0000 (16:25 +0100)]
Parenthesize composite if condition before inverting in invert-if assist

3 years agoMerge #6893
bors[bot] [Tue, 15 Dec 2020 14:45:09 +0000 (14:45 +0000)]
Merge #6893

6893: Move to upstream `macro_rules!` model r=matklad a=jonas-schievink

This changes `macro_rules!` from being treated as a macro invocation to being a first-class item. It also disallows using an additional ident argument for regular macros, so `m! ident(...);` now fails to parse.

This matches upstream Rust, and makes the code somewhat simpler by removing repeated "is this a `macro_rules!` call" checks. It will also simplify allowing visibilities on macros, which is currently being proposed in https://github.com/rust-lang/rust/pull/78166.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoReject visibilities on `macro_rules!`
Jonas Schievink [Tue, 15 Dec 2020 14:37:49 +0000 (15:37 +0100)]
Reject visibilities on `macro_rules!`

3 years agoMove to upstream `macro_rules!` model
Jonas Schievink [Tue, 15 Dec 2020 14:37:37 +0000 (15:37 +0100)]
Move to upstream `macro_rules!` model

3 years agoMerge #6886
bors[bot] [Tue, 15 Dec 2020 12:41:07 +0000 (12:41 +0000)]
Merge #6886

6886: Expand statements for macros in lowering r=matklad a=edwin0cheng

Fixes #6811

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoMerge #6888
bors[bot] [Tue, 15 Dec 2020 12:34:37 +0000 (12:34 +0000)]
Merge #6888

6888: Use standard test style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoRemove obsolete comment
Edwin Cheng [Tue, 15 Dec 2020 09:25:59 +0000 (17:25 +0800)]
Remove obsolete comment

3 years agoMerge #6889
bors[bot] [Tue, 15 Dec 2020 09:15:41 +0000 (09:15 +0000)]
Merge #6889

6889: Resolve `macro-error` diagnostics on asm & llvm_asm r=matklad a=lf-

We currently stub these out as returning unit.

This fixes spurious RA `macro-error` diagnostics introduced somewhere around 0.2.400 in the following:
```rust
unsafe { asm!(""); llvm_asm!(""); }
```

I'd ideally like to write a unit test for this, but I'm not familiar with where the tests for `hir_expand` are.

Thanks to @edwin0cheng for help on resolving this issue.

Co-authored-by: lf- <lf-@users.noreply.github.com>
3 years agoResolve `macro-error` diagnostics on asm & llvm_asm
lf- [Tue, 15 Dec 2020 09:05:20 +0000 (01:05 -0800)]
Resolve `macro-error` diagnostics on asm & llvm_asm

We currently stub these out as returning unit.

This fixes spurious RA diagnostics in the following:
```rust
unsafe { asm!(""); llvm_asm!(""); }
```

3 years agoUse standard test style
Aleksey Kladov [Tue, 15 Dec 2020 08:51:40 +0000 (11:51 +0300)]
Use standard test style

3 years agoMerge #6887
bors[bot] [Tue, 15 Dec 2020 08:49:54 +0000 (08:49 +0000)]
Merge #6887

6887: Add `#` to canonical test example r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoAdd `#` to canonical test example
Aleksey Kladov [Tue, 15 Dec 2020 08:49:22 +0000 (11:49 +0300)]
Add `#` to canonical test example

3 years agogenerate default implementation for an enum from an enum variant #6860
Benjamin Coenen [Tue, 15 Dec 2020 08:46:02 +0000 (09:46 +0100)]
generate default implementation for an enum from an enum variant #6860

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6875
bors[bot] [Tue, 15 Dec 2020 08:38:08 +0000 (08:38 +0000)]
Merge #6875

6875: Add find usages for enum constructors r=matklad a=sasurau4

Fix #2549 for enum

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
3 years agoMerge #6885
bors[bot] [Tue, 15 Dec 2020 07:42:27 +0000 (07:42 +0000)]
Merge #6885

6885: Add !language-configuration.json to .vscodeignore r=matklad a=bryangingechen

#6840 added a `language-configuration.json` file to `package.json`, but because `.vscodeignore` was not updated, this file was not uploaded when the extension was published, leading to constant errors in the VS Code dev tools console:
```
[Extension Host] stack trace: Error: ENOENT: no such file or directory, open '/Users/-/.vscode/extensions/matklad.rust-analyzer-0.2.416/language-configuration.json'
```

Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
3 years agoAdd regression test
Edwin Cheng [Tue, 15 Dec 2020 06:39:26 +0000 (14:39 +0800)]
Add regression test

3 years agoExpand statements for mbe in lowering
Edwin Cheng [Tue, 15 Dec 2020 06:39:15 +0000 (14:39 +0800)]
Expand statements for mbe in lowering

3 years agoadd language-configuration.json to .vscodeignore
Bryan Gin-ge Chen [Tue, 15 Dec 2020 03:05:22 +0000 (22:05 -0500)]
add language-configuration.json to .vscodeignore

3 years agoAdd find usages for enum constructors
Daiki Ihara [Mon, 14 Dec 2020 15:39:42 +0000 (00:39 +0900)]
Add find usages for enum constructors

3 years agoMerge #6874
bors[bot] [Mon, 14 Dec 2020 15:39:31 +0000 (15:39 +0000)]
Merge #6874

6874: Implement `module_path!()` r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/6747

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoImplement `module_path!()`
Jonas Schievink [Mon, 14 Dec 2020 15:38:53 +0000 (16:38 +0100)]
Implement `module_path!()`

3 years agoMerge #6862
bors[bot] [Mon, 14 Dec 2020 15:15:52 +0000 (15:15 +0000)]
Merge #6862

6862: Add LifetimeParam resolving to Semantics r=matklad a=Veykril

This is stuff required for the lifetime references/definitions PR. I pulled this out to make it easier to review as well as because there is one thing that still has to be addressed which can be found in the review comments.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6817
bors[bot] [Mon, 14 Dec 2020 15:04:47 +0000 (15:04 +0000)]
Merge #6817

6817: Replace goblin crate with object r=matklad a=lnicola

Continuation of #4385.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoAdd LifetimeParam resolving to Semantics
Lukas Wirth [Sun, 13 Dec 2020 21:13:16 +0000 (22:13 +0100)]
Add LifetimeParam resolving to Semantics

3 years agoMerge #6871
bors[bot] [Mon, 14 Dec 2020 12:06:56 +0000 (12:06 +0000)]
Merge #6871

6871: Link config source r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoLink config source
Aleksey Kladov [Mon, 14 Dec 2020 12:06:24 +0000 (15:06 +0300)]
Link config source

3 years agogenerate default implementation for an enum from an enum variant #6860
Benjamin Coenen [Sun, 13 Dec 2020 21:00:44 +0000 (22:00 +0100)]
generate default implementation for an enum from an enum variant #6860

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6858
bors[bot] [Sun, 13 Dec 2020 14:41:10 +0000 (14:41 +0000)]
Merge #6858

6858: Docs: Explain manual installation in VS Code r=lnicola a=cauthmann

same as https://github.com/rust-analyzer/rust-analyzer.github.io/pull/81 , just against the correct repository this time

Co-authored-by: Christian Authmann <8371862+cauthmann@users.noreply.github.com>
3 years agoDocs: Explain manual installation in VS Code
Christian Authmann [Sun, 13 Dec 2020 14:21:11 +0000 (15:21 +0100)]
Docs: Explain manual installation in VS Code

3 years agoMerge #6840
bors[bot] [Sun, 13 Dec 2020 14:20:11 +0000 (14:20 +0000)]
Merge #6840

6840: Add a language configuration file for VS Code r=matklad a=dustypomerleau

There has been recent discussion in #6451 and #6682 about the need to include angle brackets in auto-close and auto-surround functionality. This PR will accomplish that, but only for users of VS Code, as it uses the VS Code-specific `language-configuration.json` to get the job done. Since there are a large number of VS Code users in the Rust Analyzer cohort, it may be reasonable to fix the issue for them, while waiting on a more comprehensive solution in the language server. In addition to the usual brackets, I've added auto-closing of block comments. I avoided autoclosing single quotes, given that lifetimes are more common than chars.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoMerge #6856
bors[bot] [Sun, 13 Dec 2020 13:54:39 +0000 (13:54 +0000)]
Merge #6856

6856: Add test for #6852 r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoAdd test for #6852
Florian Diebold [Sun, 13 Dec 2020 13:52:45 +0000 (14:52 +0100)]
Add test for #6852

3 years agoMerge #6855
bors[bot] [Sun, 13 Dec 2020 13:18:41 +0000 (13:18 +0000)]
Merge #6855

6855: Change recommendation when source can't be loaded from sysroot r=matklad a=flodiebold

Since we just tried running `rustup component add`, it doesn't make sense to me to recommend trying that again. If we're reaching this case, it's probably more likely that rustc was installed via package manager, in which case the source should be installed the same way (e.g. if you install the rust-src package on Ubuntu it will install a symlink in the right place to make our sysroot
detection work, and IMO we should get other distributors to do the same if they aren't already).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoReplace goblin crate with object
Laurențiu Nicola [Fri, 11 Dec 2020 12:53:22 +0000 (14:53 +0200)]
Replace goblin crate with object

3 years agoChange recommendation when source can't be loaded from sysroot
Florian Diebold [Sun, 13 Dec 2020 12:01:55 +0000 (13:01 +0100)]
Change recommendation when source can't be loaded from sysroot

Since we just tried running `rustup component add`, it doesn't make sense to me
to recommend trying that again. If we're reaching this case, it's probably more
likely that rustc was installed via package manager, in which case the source
should be installed the same way (e.g. if you install the rust-src package on
Ubuntu it will install a symlink in the right place to make our sysroot
detection work).

3 years agoMerge #6852
bors[bot] [Sun, 13 Dec 2020 11:34:43 +0000 (11:34 +0000)]
Merge #6852

6852: Ignore lifetime params in substitutions r=matklad a=Veykril

[`hir_ty::utils::Generics`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/utils.rs#L153) currently only assumes type parameters but not lifetime parameters and therefor creates incorrect index and length calculations, this PR just makes the use sites ignore LifetimeGenerics for now.

This fixes the panic at least locally for me for `analysis-stats`. Funnily enough this panic prevented me from using reference search for the `args` field to fix this problem.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoIgnore lifetime params in substitutions
Lukas Wirth [Sun, 13 Dec 2020 10:34:44 +0000 (11:34 +0100)]
Ignore lifetime params in substitutions

3 years agoadd a language configuration for VS Code
Dusty Pomerleau [Sat, 12 Dec 2020 00:31:00 +0000 (11:31 +1100)]
add a language configuration for VS Code

3 years agoMerge #6845
bors[bot] [Sat, 12 Dec 2020 18:06:36 +0000 (18:06 +0000)]
Merge #6845

6845: Don't HirDisplay unknown types when displaying for source r=Veykril a=Veykril

Was wondering why the add missing impl assist didn't do anything here:
![Code_JCA1Qo0V9P](https://user-images.githubusercontent.com/3757771/101990300-7af44a80-3ca6-11eb-8431-e5eb4de4e78c.png)
Turns out me forgetting to set the Index::Idx type in the trait causes RA to panic due to it trying to to create an unparsable type in the `make` module.
Now we get this instead which imo is definitely better to have.
![Code_MUFPJUCULY](https://user-images.githubusercontent.com/3757771/101990347-c9094e00-3ca6-11eb-9c6a-146bddf64b7c.png)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't HirDisplay unknown types when displaying for source
Lukas Wirth [Sat, 12 Dec 2020 17:18:19 +0000 (18:18 +0100)]
Don't HirDisplay unknown types when displaying for source

3 years agoMerge #6846
bors[bot] [Sat, 12 Dec 2020 17:29:20 +0000 (17:29 +0000)]
Merge #6846

6846: Remove some redundant allocations r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agoRemove some redundant allocations
Jeremy Kolb [Sat, 12 Dec 2020 17:27:09 +0000 (12:27 -0500)]
Remove some redundant allocations

3 years agoMerge #6818
bors[bot] [Sat, 12 Dec 2020 14:35:38 +0000 (14:35 +0000)]
Merge #6818

6818: Add Lifetimes to the HIR r=matklad a=Veykril

This doesn't handle resolve yet as I don't know yet how that will be used. I'll get to that once I start moving the lifetime reference PR to the hir.

This also adds a new `hir` name type for lifetimes and labels, `hir::LifetimeName`.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6841
bors[bot] [Sat, 12 Dec 2020 14:29:12 +0000 (14:29 +0000)]
Merge #6841

6841: Added "Remove this semicolon" test r=matklad a=ivan770

Closes https://github.com/rust-analyzer/rust-analyzer/pull/6769#discussion_r540150066

Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
3 years agoAdded remove this semicolon test
ivan770 [Sat, 12 Dec 2020 11:50:11 +0000 (13:50 +0200)]
Added remove this semicolon test

3 years agoMerge #6839
bors[bot] [Sat, 12 Dec 2020 10:18:16 +0000 (10:18 +0000)]
Merge #6839

6839: Infer labeled blocks r=flodiebold a=Veykril

The test should cover all the interesting cases I believe(main part of it is copied from the loop label break test above it).

The test is indented to stay consistent with the rest of the tests in the file, I can dedent all the tests in the file in a follow up PR if desired.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd Lifetimes to the HIR
Lukas Wirth [Fri, 11 Dec 2020 12:49:32 +0000 (13:49 +0100)]
Add Lifetimes to the HIR

3 years agoInfer labeled blocks
Lukas Wirth [Fri, 11 Dec 2020 23:03:36 +0000 (00:03 +0100)]
Infer labeled blocks

3 years agoMerge #6813
bors[bot] [Fri, 11 Dec 2020 22:17:40 +0000 (22:17 +0000)]
Merge #6813

6813: negative sign matching in mbe matching for literal r=edwin0cheng a=edwin0cheng

Fix #6292

r @jonas-schievink

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoAdd missing arg for eat_char
Edwin Cheng [Fri, 11 Dec 2020 22:14:11 +0000 (06:14 +0800)]
Add missing arg for eat_char

3 years agoMerge #6838
bors[bot] [Fri, 11 Dec 2020 22:07:11 +0000 (22:07 +0000)]
Merge #6838

6838: cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo update
kjeremy [Fri, 11 Dec 2020 22:00:25 +0000 (17:00 -0500)]
cargo update

3 years agoMerge #6836
bors[bot] [Fri, 11 Dec 2020 20:32:11 +0000 (20:32 +0000)]
Merge #6836

6836: Use Attrs::docs in NavigationTarget instead of DocCommentsOwner r=kjeremy a=Veykril

That should be the last place where the AST comment machinery is referred to.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUse Attrs::docs in NavigationTarget instead of DocCommentsOwner
Lukas Wirth [Fri, 11 Dec 2020 20:19:58 +0000 (21:19 +0100)]
Use Attrs::docs in NavigationTarget instead of DocCommentsOwner

3 years agoMerge #6834
bors[bot] [Fri, 11 Dec 2020 19:57:08 +0000 (19:57 +0000)]
Merge #6834

6834: Use Attrs::docs in runnables instead of DocCommentsOwner r=kjeremy a=Veykril

I figured that we should probably move as much of the doc usage to the HIR as possible hence this PR. If we should keep this AST-based feel free to close.

This change does have the nice(but not really useful as I doubt anyones gonna write doc tests like these) side effect that these two doc string snippets allow being run now.
![image](https://user-images.githubusercontent.com/3757771/101945607-bf241400-3bee-11eb-96ce-ccae80028b1f.png)
![image](https://user-images.githubusercontent.com/3757771/101946375-2e9a0380-3bef-11eb-9950-e35168fdd048.png)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUse Attrs::docs in runnables instead of DocCommentsOwner
Lukas Wirth [Fri, 11 Dec 2020 19:11:03 +0000 (20:11 +0100)]
Use Attrs::docs in runnables instead of DocCommentsOwner

3 years agoMerge #6832
bors[bot] [Fri, 11 Dec 2020 18:12:42 +0000 (18:12 +0000)]
Merge #6832

6832: Add upstream commit to builtin_attr.rs r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd upstream commit to builtin_attr.rs
Jonas Schievink [Fri, 11 Dec 2020 18:12:06 +0000 (19:12 +0100)]
Add upstream commit to builtin_attr.rs

3 years agoMerge #6819
bors[bot] [Fri, 11 Dec 2020 18:03:09 +0000 (18:03 +0000)]
Merge #6819

6819: Add builtin attributes for use in nameres r=jonas-schievink a=jonas-schievink

These are not yet used, but have to go through nameres later in order to support procedural macro attributes

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #6830
bors[bot] [Fri, 11 Dec 2020 17:25:16 +0000 (17:25 +0000)]
Merge #6830

6830: Avoid panic when collecting memory metrics r=jonas-schievink a=jonas-schievink

This is getting hit during metrics collection.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agometrics: go back to `cmd!`
Jonas Schievink [Fri, 11 Dec 2020 17:24:42 +0000 (18:24 +0100)]
metrics: go back to `cmd!`

3 years agoMove print_memory_usage to cli.rs
Jonas Schievink [Fri, 11 Dec 2020 17:24:27 +0000 (18:24 +0100)]
Move print_memory_usage to cli.rs

3 years agoAvoid panic when collecting memory metrics
Jonas Schievink [Fri, 11 Dec 2020 17:18:27 +0000 (18:18 +0100)]
Avoid panic when collecting memory metrics

3 years agoMerge #6829
bors[bot] [Fri, 11 Dec 2020 16:56:30 +0000 (16:56 +0000)]
Merge #6829

6829: Fix typo leading to metrics loss r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix typo leading to metrics loss
Jonas Schievink [Fri, 11 Dec 2020 16:55:52 +0000 (17:55 +0100)]
Fix typo leading to metrics loss

3 years agoMerge #6828
bors[bot] [Fri, 11 Dec 2020 16:31:13 +0000 (16:31 +0000)]
Merge #6828

6828: Metrics debugging r=jonas-schievink a=jonas-schievink

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoCapture memory usage metrics
Jonas Schievink [Fri, 11 Dec 2020 16:30:32 +0000 (17:30 +0100)]
Capture memory usage metrics

3 years agoMerge #6827
bors[bot] [Fri, 11 Dec 2020 15:51:13 +0000 (15:51 +0000)]
Merge #6827

6827: Revert "Fix memory usage metrics" r=jonas-schievink a=jonas-schievink

Reverts rust-analyzer/rust-analyzer#6825

It broke metrics entirely. Will debug this later, unless someone else gets to it first.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRevert "Fix memory usage metrics"
Jonas Schievink [Fri, 11 Dec 2020 15:50:17 +0000 (16:50 +0100)]
Revert "Fix memory usage metrics"

3 years agoMerge #6824
bors[bot] [Fri, 11 Dec 2020 15:02:57 +0000 (15:02 +0000)]
Merge #6824

6824: Don't highlight parent nodes of comments on hover r=kjeremy a=Veykril

Fixes #6815

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't highlight parent nodes of comments on hover
Lukas Wirth [Fri, 11 Dec 2020 14:46:47 +0000 (15:46 +0100)]
Don't highlight parent nodes of comments on hover

3 years agoMerge #6825
bors[bot] [Fri, 11 Dec 2020 14:48:27 +0000 (14:48 +0000)]
Merge #6825

6825: Fix memory usage metrics r=jonas-schievink a=jonas-schievink

Let's see if this fixes https://github.com/rust-analyzer/rust-analyzer/issues/6808

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix memory usage metrics
Jonas Schievink [Fri, 11 Dec 2020 14:47:40 +0000 (15:47 +0100)]
Fix memory usage metrics

3 years agoMerge #6821
bors[bot] [Fri, 11 Dec 2020 14:08:22 +0000 (14:08 +0000)]
Merge #6821

6821: Improve code structure r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoImprove code structure
Aleksey Kladov [Fri, 11 Dec 2020 13:50:47 +0000 (16:50 +0300)]
Improve code structure

Make sure that there's only one entry point, analyze, remove awkard
analyzer2 name

3 years agoAdd builtin attributes for use in nameres
Jonas Schievink [Fri, 11 Dec 2020 13:04:33 +0000 (14:04 +0100)]
Add builtin attributes for use in nameres

3 years agoMerge #6816
bors[bot] [Fri, 11 Dec 2020 12:46:47 +0000 (12:46 +0000)]
Merge #6816

6816: Use natural trait ordering in derive completion r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUse natural trait ordering in derive completion
Aleksey Kladov [Fri, 11 Dec 2020 12:41:53 +0000 (15:41 +0300)]
Use natural trait ordering in derive completion

derive(Clone, Copy) reads better than derive(Copy, Clone).

However, we preserve the reverse ordering in the lookup text for
sorting purposes. That way, it's convenient to type just `Ord` to
derive everything.

3 years agonegative sign matching in mbe matching for literal
Edwin Cheng [Fri, 11 Dec 2020 09:59:04 +0000 (17:59 +0800)]
negative sign matching in mbe matching for literal

3 years agoMerge #6807
bors[bot] [Thu, 10 Dec 2020 18:30:11 +0000 (18:30 +0000)]
Merge #6807

6807: Replicate Cargo environment variables r=jonas-schievink a=jonas-schievink

These might be relied on by procedural macros, and can also be accessed via `env!`.

Required for fixing https://github.com/rust-analyzer/rust-analyzer/issues/6696. We do not yet propagate these to any proc macros though.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUse itertools
Jonas Schievink [Thu, 10 Dec 2020 18:29:11 +0000 (19:29 +0100)]
Use itertools

3 years agoMerge #6804
bors[bot] [Thu, 10 Dec 2020 18:14:17 +0000 (18:14 +0000)]
Merge #6804

6804: Bump the macro token limit r=jonas-schievink a=jonas-schievink

Should fix https://github.com/rust-analyzer/rust-analyzer/issues/6504

Not entirely sure what the previous limit was based on, but it looks like it does get hit in practice.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoReplicate Cargo environment variables
Jonas Schievink [Thu, 10 Dec 2020 17:51:39 +0000 (18:51 +0100)]
Replicate Cargo environment variables

3 years agoMerge #6806
bors[bot] [Thu, 10 Dec 2020 17:32:21 +0000 (17:32 +0000)]
Merge #6806

6806: Improve docs for building from source r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>