]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #7353
bors[bot] [Fri, 22 Jan 2021 15:31:47 +0000 (15:31 +0000)]
Merge #7353

7353: Add LifetimeParam and ConstParam to CompletionItemKind r=matklad a=Veykril

Adds `LifetimeParam` and `ConstParam` to `CompletionItemKind` and maps them both to `TypeParam` in the protocol conversion as there are no equivalents, so nothing really changes there.
`ConstParam` could be mapped to `Const` I guess but I'm split on whether that would be better?

Additions were solely inspired by (the single) test output for const params.

Also sorts the variants of `CompletionItemKind` and its to_proto match.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #7394
bors[bot] [Fri, 22 Jan 2021 14:58:39 +0000 (14:58 +0000)]
Merge #7394

7394: Promote marks r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoPromote marks
Aleksey Kladov [Fri, 22 Jan 2021 14:58:00 +0000 (17:58 +0300)]
Promote marks

3 years agoMerge #7374
bors[bot] [Fri, 22 Jan 2021 13:58:26 +0000 (13:58 +0000)]
Merge #7374

7374: Add step to run analysis-stats on std r=lnicola a=tweksteen

Run `analysis-stats` on `std` as part of the release workflow. Uses the `--with-deps` to also parse other crates defined in `stdlibs`. Remove the condition for exection, both analysis will be run for nightly and release builds.

Do not submit until #6956 has been fixed.

Bug: #6956

Co-authored-by: Thiébaud Weksteen <tweek@google.com>
3 years agoMerge #7386
bors[bot] [Fri, 22 Jan 2021 13:14:40 +0000 (13:14 +0000)]
Merge #7386

7386: Handle box with allocator r=flodiebold a=tweksteen

In 1.49.0, the definition of Box was modified to support an optional
Allocator[1]. Adapt the parsing of the `box` keyword to supply the
expected number of parameters to the constructor.

[1] https://github.com/rust-lang/rust/commit/f288cd2e179f600fa00c2a407206a12f6c5a91e0

Fixes: #6956
Co-authored-by: Thiébaud Weksteen <tweek@google.com>
3 years agoHandle box with allocator
Thiébaud Weksteen [Fri, 22 Jan 2021 10:17:45 +0000 (11:17 +0100)]
Handle box with allocator

In 1.49.0, the definition of Box was modified to support an optional
Allocator[1]. Adapt the parsing of the `box` keyword to supply the
expected number of parameters to the constructor.

[1] https://github.com/rust-lang/rust/commit/f288cd2e179f600fa00c2a407206a12f6c5a91e0

3 years agoMerge #7390
bors[bot] [Fri, 22 Jan 2021 12:42:55 +0000 (12:42 +0000)]
Merge #7390

7390: Style: use the right string r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #7348
bors[bot] [Fri, 22 Jan 2021 12:29:42 +0000 (12:29 +0000)]
Merge #7348

7348: Fix broken link in intra-doc r=edwin0cheng a=sasurau4

Fix #5546
The intra-doc link doesn't work fine for trait associated method.

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
3 years agoStyle: use the right string
Aleksey Kladov [Fri, 22 Jan 2021 12:26:19 +0000 (15:26 +0300)]
Style: use the right string

3 years agoMerge #7389
bors[bot] [Fri, 22 Jan 2021 12:14:23 +0000 (12:14 +0000)]
Merge #7389

7389: Remove approximate goto def r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoCleanup tests
Aleksey Kladov [Fri, 22 Jan 2021 12:13:18 +0000 (15:13 +0300)]
Cleanup tests

3 years agoRemove index based fallback for goto def
Aleksey Kladov [Fri, 22 Jan 2021 12:11:29 +0000 (15:11 +0300)]
Remove index based fallback for goto def

We are so precise that the fallback creates more confusion, when you can
goto def on an unresolved reference.

3 years agoMerge #7388
bors[bot] [Fri, 22 Jan 2021 11:52:23 +0000 (11:52 +0000)]
Merge #7388

7388: Minor fix for #7387 r=edwin0cheng a=edwin0cheng

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoUse AbsPath
Edwin Cheng [Fri, 22 Jan 2021 11:51:14 +0000 (19:51 +0800)]
Use AbsPath

3 years agoMerge #7387
bors[bot] [Fri, 22 Jan 2021 11:15:22 +0000 (11:15 +0000)]
Merge #7387

7387: Refactor build script specific data r=edwin0cheng a=edwin0cheng

It refactors for separating logic for build script specific data.

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoRefactor build script data
Edwin Cheng [Fri, 22 Jan 2021 11:11:01 +0000 (19:11 +0800)]
Refactor build script data

3 years agoFix broken link in intra-doc
Daiki Ihara [Tue, 19 Jan 2021 15:43:06 +0000 (00:43 +0900)]
Fix broken link in intra-doc

3 years agoMerge #7384
bors[bot] [Thu, 21 Jan 2021 20:12:58 +0000 (20:12 +0000)]
Merge #7384

7384: Remove unused field r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove unused field
Jonas Schievink [Thu, 21 Jan 2021 20:12:26 +0000 (21:12 +0100)]
Remove unused field

3 years agoMerge #7383
bors[bot] [Thu, 21 Jan 2021 19:36:08 +0000 (19:36 +0000)]
Merge #7383

7383: Add test for path resolution bug r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd test for path resolution bug
Jonas Schievink [Thu, 21 Jan 2021 19:35:36 +0000 (20:35 +0100)]
Add test for path resolution bug

3 years agoMerge #7382
bors[bot] [Thu, 21 Jan 2021 19:06:43 +0000 (19:06 +0000)]
Merge #7382

7382: Cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoCargo update
kjeremy [Thu, 21 Jan 2021 19:00:42 +0000 (14:00 -0500)]
Cargo update

3 years agoMerge #7381
bors[bot] [Thu, 21 Jan 2021 18:04:58 +0000 (18:04 +0000)]
Merge #7381

7381: Revert "Make use of `block_def_map` in body lowering" r=jonas-schievink a=jonas-schievink

Reverts rust-analyzer/rust-analyzer#7380, since it broke stuff

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRevert "Make use of `block_def_map` in body lowering"
Jonas Schievink [Thu, 21 Jan 2021 18:04:31 +0000 (19:04 +0100)]
Revert "Make use of `block_def_map` in body lowering"

3 years agoMerge #7378
bors[bot] [Thu, 21 Jan 2021 17:46:44 +0000 (17:46 +0000)]
Merge #7378

7378: Include `countme` crate to count important data structures. r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #7380
bors[bot] [Thu, 21 Jan 2021 17:09:05 +0000 (17:09 +0000)]
Merge #7380

7380: Make use of `block_def_map` in body lowering r=jonas-schievink a=jonas-schievink

Removes the `local_scope` argument from `Expander` in favor of tracking the `DefMap` in use during body lowering.

For now, we still collect inner items as usual, because other code still relies on `item_scope`.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMake use of `block_def_map` in body lowering
Jonas Schievink [Thu, 21 Jan 2021 17:05:52 +0000 (18:05 +0100)]
Make use of `block_def_map` in body lowering

Removes the `local_scope` hack from `Expander` in favor of tracking the
`DefMap` in use during body lowering

3 years agoInclude `countme` crate to count important data structures.
Aleksey Kladov [Thu, 21 Jan 2021 16:04:50 +0000 (19:04 +0300)]
Include `countme` crate to count important data structures.

3 years agoMerge #7377
bors[bot] [Thu, 21 Jan 2021 16:20:17 +0000 (16:20 +0000)]
Merge #7377

7377: Remove unnecessary annotations from tests r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove unnecessary annotations from tests
Jonas Schievink [Thu, 21 Jan 2021 16:19:46 +0000 (17:19 +0100)]
Remove unnecessary annotations from tests

3 years agoMerge #7376
bors[bot] [Thu, 21 Jan 2021 15:43:53 +0000 (15:43 +0000)]
Merge #7376

7376: Add test for nameres in nested blocks r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd test for nameres in nested blocks
Jonas Schievink [Thu, 21 Jan 2021 15:42:56 +0000 (16:42 +0100)]
Add test for nameres in nested blocks

3 years agoMerge #7375
bors[bot] [Thu, 21 Jan 2021 15:28:40 +0000 (15:28 +0000)]
Merge #7375

7375: Add support for running name resolution in block expressions r=jonas-schievink a=jonas-schievink

This adds a `block_def_map` query that runs the name resolution algorithm on a block expression, and returns a `DefMap` that stores links to the parent `DefMap` (either the containing block or the crate-level `DefMap`). Blocks with no inner items return the parent's `DefMap` as-is, to avoid creating unnecessarily long `DefMap` chains.

Path resolution is updated to recurse into the parent `DefMap` after looking up a path in the original `DefMap`.

I've added a few new tests for this, but outside of those this isn't used yet.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd test that merges inner and outer names
Jonas Schievink [Thu, 21 Jan 2021 15:23:50 +0000 (16:23 +0100)]
Add test that merges inner and outer names

3 years agoFix lowering with multiple block expressions
Jonas Schievink [Thu, 21 Jan 2021 15:23:22 +0000 (16:23 +0100)]
Fix lowering with multiple block expressions

3 years agoAdd step to run analysis-stats on std
Thiébaud Weksteen [Thu, 21 Jan 2021 14:37:10 +0000 (15:37 +0100)]
Add step to run analysis-stats on std

3 years agoMerge #7372
bors[bot] [Thu, 21 Jan 2021 14:32:57 +0000 (14:32 +0000)]
Merge #7372

7372: Up lexer r=kjeremy a=kjeremy

No real changes here.

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoUp lexer
kjeremy [Thu, 21 Jan 2021 14:31:06 +0000 (09:31 -0500)]
Up lexer

3 years agoFall back to parent DefMaps when resolving paths
Jonas Schievink [Thu, 21 Jan 2021 14:24:15 +0000 (15:24 +0100)]
Fall back to parent DefMaps when resolving paths

3 years agoAdd name resolution query for block expressions
Jonas Schievink [Thu, 21 Jan 2021 14:22:17 +0000 (15:22 +0100)]
Add name resolution query for block expressions

3 years agoMerge #7371
bors[bot] [Thu, 21 Jan 2021 14:15:14 +0000 (14:15 +0000)]
Merge #7371

7371: Change directory before running rustfmt to respect rustfmt.toml r=matklad a=lnicola

Fixes #6973

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agochdir to file before rustfmt
Laurențiu Nicola [Thu, 21 Jan 2021 13:58:17 +0000 (15:58 +0200)]
chdir to file before rustfmt

3 years agoMerge #7370
bors[bot] [Thu, 21 Jan 2021 13:38:28 +0000 (13:38 +0000)]
Merge #7370

7370: fix mega bug r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix mega bug
Aleksey Kladov [Thu, 21 Jan 2021 13:37:08 +0000 (16:37 +0300)]
Fix mega bug

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Manual.20content.20is.20duplicated

3 years agoMerge #7368
bors[bot] [Thu, 21 Jan 2021 11:30:38 +0000 (11:30 +0000)]
Merge #7368

7368: Clarify enabled features and defined features in PackageData r=matklad a=edwin0cheng

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoAdded defined_features in PackageData
Edwin Cheng [Thu, 21 Jan 2021 11:12:19 +0000 (19:12 +0800)]
Added defined_features in PackageData

3 years agoMerge #7367
bors[bot] [Thu, 21 Jan 2021 08:33:25 +0000 (08:33 +0000)]
Merge #7367

7367: Bump chalk r=lnicola a=lnicola

Fixes #6945
Fixes #6812

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBump chalk
Laurențiu Nicola [Thu, 21 Jan 2021 08:29:19 +0000 (10:29 +0200)]
Bump chalk

3 years agoMerge #7366
bors[bot] [Wed, 20 Jan 2021 22:07:38 +0000 (22:07 +0000)]
Merge #7366

7366: Treat BlockExpr as a potential module origin r=jonas-schievink a=jonas-schievink

A block containing inner items acts like the root module of a crate, so it needs to be representable as a `ModuleSource` and `ModuleOrigin`.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoTreat BlockExpr as a potential module origin
Jonas Schievink [Wed, 20 Jan 2021 19:05:48 +0000 (20:05 +0100)]
Treat BlockExpr as a potential module origin

3 years agoUpdate completions test output
Lukas Wirth [Wed, 20 Jan 2021 17:46:14 +0000 (18:46 +0100)]
Update completions test output

3 years agoPartially unify SymbolKind and CompletionItemKind
Lukas Wirth [Wed, 20 Jan 2021 17:38:12 +0000 (18:38 +0100)]
Partially unify SymbolKind and CompletionItemKind

3 years agoMerge #7365
bors[bot] [Wed, 20 Jan 2021 17:35:15 +0000 (17:35 +0000)]
Merge #7365

7365: chalk 0.49.0 r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agochalk 0.49.0
kjeremy [Wed, 20 Jan 2021 17:31:03 +0000 (12:31 -0500)]
chalk 0.49.0

3 years agoMerge #7364
bors[bot] [Wed, 20 Jan 2021 17:18:44 +0000 (17:18 +0000)]
Merge #7364

7364: DefMap: hide remaining crate-visible fields r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoDefMap: hide remaining crate-visible fields
Jonas Schievink [Wed, 20 Jan 2021 17:17:48 +0000 (18:17 +0100)]
DefMap: hide remaining crate-visible fields

3 years agoMerge #7359
bors[bot] [Wed, 20 Jan 2021 16:09:22 +0000 (16:09 +0000)]
Merge #7359

7359: ItemTree: store a mapping from blocks to inner items r=jonas-schievink a=jonas-schievink

To do name resolution within block expressions, we need to know which inner items are located inside each block expression. This adds such a mapping to `ItemTree`, replacing the previous one, which was seemingly unused other than to access all the inner items.

This also assigns `AstId`s to block expressions, which is needed to store the mapping in salsa.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #7361
bors[bot] [Wed, 20 Jan 2021 14:55:53 +0000 (14:55 +0000)]
Merge #7361

7361: bump serde r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoMerge #7360
bors[bot] [Wed, 20 Jan 2021 14:44:49 +0000 (14:44 +0000)]
Merge #7360

7360: Make public DefMap fields private r=jonas-schievink a=jonas-schievink

This gives us more freedom to change the implementation for name resolution within block expressions.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agobump serde
kjeremy [Wed, 20 Jan 2021 14:44:48 +0000 (09:44 -0500)]
bump serde

3 years agoMake public DefMap fields private
Jonas Schievink [Wed, 20 Jan 2021 14:41:18 +0000 (15:41 +0100)]
Make public DefMap fields private

3 years agoMove SymbolKind to ide_db
Lukas Wirth [Wed, 20 Jan 2021 14:25:34 +0000 (15:25 +0100)]
Move SymbolKind to ide_db

3 years agoCreate a mapping from blocks to inner items
Jonas Schievink [Wed, 20 Jan 2021 13:49:04 +0000 (14:49 +0100)]
Create a mapping from blocks to inner items

3 years agoMerge #7350
bors[bot] [Wed, 20 Jan 2021 12:28:10 +0000 (12:28 +0000)]
Merge #7350

7350: Update pico-args r=matklad a=kjeremy

Should maintain existing behavior

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoMerge #7357
bors[bot] [Wed, 20 Jan 2021 11:49:59 +0000 (11:49 +0000)]
Merge #7357

7357: Dont show runnables from nested mods r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoAvoid intermediate collections
Aleksey Kladov [Wed, 20 Jan 2021 11:47:42 +0000 (14:47 +0300)]
Avoid intermediate collections

3 years agoDon't show runnable suggestions for other files
Aleksey Kladov [Wed, 20 Jan 2021 11:30:50 +0000 (14:30 +0300)]
Don't show runnable suggestions for other files

It't be actually great to have these once we have run anything dialog,
but for run the thing at point it makes sense to show a limited set.

3 years agoMerge #7355
bors[bot] [Wed, 20 Jan 2021 11:08:00 +0000 (11:08 +0000)]
Merge #7355

7355: :arrow_up: rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: rowan
Aleksey Kladov [Wed, 20 Jan 2021 11:04:53 +0000 (14:04 +0300)]
:arrow_up: rowan

It now stores text inline with tokens

3 years ago.
Aleksey Kladov [Tue, 19 Jan 2021 22:56:11 +0000 (01:56 +0300)]
.

3 years agoAdd LifetimeParam and ConstParam to CompletionItemKind
Lukas Wirth [Tue, 19 Jan 2021 19:21:56 +0000 (20:21 +0100)]
Add LifetimeParam and ConstParam to CompletionItemKind

3 years agoMerge #7352
bors[bot] [Tue, 19 Jan 2021 19:19:24 +0000 (19:19 +0000)]
Merge #7352

7352: :arrow_up: rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: rowan
Aleksey Kladov [Tue, 19 Jan 2021 19:11:42 +0000 (22:11 +0300)]
:arrow_up: rowan

3 years agoMerge #7351
bors[bot] [Tue, 19 Jan 2021 19:07:33 +0000 (19:07 +0000)]
Merge #7351

7351: Show const params in completions r=Veykril a=Veykril

bors r+
![image](https://user-images.githubusercontent.com/3757771/105080872-bba76680-5a91-11eb-91cd-0910da4c8312.png)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoShow const params in completions
Lukas Wirth [Tue, 19 Jan 2021 19:01:49 +0000 (20:01 +0100)]
Show const params in completions

3 years agoRecord `FileAstId`s for block expressiosn
Jonas Schievink [Tue, 19 Jan 2021 18:49:19 +0000 (19:49 +0100)]
Record `FileAstId`s for block expressiosn

Every block expression may contain inner items, so we need to be able
to refer to any block expression and use it as a salsa key.

3 years agoUpdate pico-args
kjeremy [Tue, 19 Jan 2021 16:56:45 +0000 (11:56 -0500)]
Update pico-args

Should maintains existing behavior

3 years agoMerge #7347
bors[bot] [Tue, 19 Jan 2021 11:28:58 +0000 (11:28 +0000)]
Merge #7347

7347: Reduce TokenMap size r=edwin0cheng a=edwin0cheng

Reduces HygieneFrameQuery's memory usage by to another 10 MB.

cc #7331

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoReduce TokenMap size
Edwin Cheng [Tue, 19 Jan 2021 11:26:53 +0000 (19:26 +0800)]
Reduce TokenMap size

3 years agoMerge #7321
bors[bot] [Tue, 19 Jan 2021 09:27:45 +0000 (09:27 +0000)]
Merge #7321

7321: Support runnables in macros r=matklad a=edwin0cheng

fixes  #4771

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoMerge #7346
bors[bot] [Tue, 19 Jan 2021 09:05:53 +0000 (09:05 +0000)]
Merge #7346

7346: :arrow_up: rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: rowan
Aleksey Kladov [Tue, 19 Jan 2021 09:05:27 +0000 (12:05 +0300)]
:arrow_up: rowan

3 years agoSupport runnables in macros
Edwin Cheng [Tue, 19 Jan 2021 08:58:11 +0000 (16:58 +0800)]
Support runnables in macros

3 years agoMerge #7342
bors[bot] [Tue, 19 Jan 2021 01:33:49 +0000 (01:33 +0000)]
Merge #7342

7342: Show deprecated completions for deprecated traits r=kjeremy a=SomeoneToIgnore

TIL that there are two kinds of deprecation tags and a few details about String methods.

<img width="472" alt="Screenshot 2021-01-19 at 01 11 38" src="https://user-images.githubusercontent.com/2690773/104970200-569d3380-59f3-11eb-9ee3-627b3c8a5c9d.png">

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoMerge #7341
bors[bot] [Mon, 18 Jan 2021 23:19:53 +0000 (23:19 +0000)]
Merge #7341

7341: Fix warnings when running `cargo doc --document-private-items` r=Veykril a=jyn514

These were the warnings previously:

<details>

```
warning: could not parse code block as Rust code
   --> crates/stdx/src/lib.rs:137:9
    |
137 |   ///     ∀ x in slice[..idx]:  pred(x)
    |  _________^
138 | | ///  && ∀ x in slice[idx..]: !pred(x)
    | |____^
    |
    = note: error from rustc: unknown start of token: \u{2200}

warning: 1 warning emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted
```

</details>

This does *not* fix the following warning, because it is actually rust
code and rustdoc is being over eager:

```
warning: Rust code block is empty
  --> crates/parser/src/grammar.rs:16:5
   |
16 |   //! ```
   |  _____^
17 | | //! // test function_with_zero_parameters
18 | | //! // fn foo() {}
19 | | //! ```
   | |_______^
   |
help: mark blocks that do not contain Rust code as text
   |
16 | //! ```text
   |     ^^^^^^^
```

https://github.com/rust-lang/rust/pull/79816 should make this
configurable so the warning can be `allow`ed.

Co-authored-by: Joshua Nelson <jyn514@gmail.com>
3 years agoShow deprecated completions for deprecated traits
Kirill Bulatov [Mon, 18 Jan 2021 23:08:59 +0000 (01:08 +0200)]
Show deprecated completions for deprecated traits

3 years agoConsider rustc_deprecated attr when checking for deprecation
Kirill Bulatov [Mon, 18 Jan 2021 22:02:59 +0000 (00:02 +0200)]
Consider rustc_deprecated attr when checking for deprecation

3 years agoFix warnings when running `cargo doc --document-private-items`
Joshua Nelson [Mon, 18 Jan 2021 21:44:40 +0000 (16:44 -0500)]
Fix warnings when running `cargo doc --document-private-items`

These were the warnings previously:

```
warning: could not parse code block as Rust code
   --> crates/stdx/src/lib.rs:137:9
    |
137 |   ///     ∀ x in slice[..idx]:  pred(x)
    |  _________^
138 | | ///  && ∀ x in slice[idx..]: !pred(x)
    | |____^
    |
    = note: error from rustc: unknown start of token: \u{2200}

warning: 1 warning emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted
```

This does *not* fix the following warning, because it is actually rust
code and rustdoc is being over eager:

```
warning: Rust code block is empty
  --> crates/parser/src/grammar.rs:16:5
   |
16 |   //! ```
   |  _____^
17 | | //! // test function_with_zero_parameters
18 | | //! // fn foo() {}
19 | | //! ```
   | |_______^
   |
help: mark blocks that do not contain Rust code as text
   |
16 | //! ```text
   |     ^^^^^^^
```

https://github.com/rust-lang/rust/pull/79816 should make this
configurable so the warning can be `allow`ed.

3 years agoMerge #7340
bors[bot] [Mon, 18 Jan 2021 20:25:26 +0000 (20:25 +0000)]
Merge #7340

7340: Remove obsolete RangeInfo usage in references r=Veykril a=Veykril

Didn't even realize these were only here for renaming as well!

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #7336
bors[bot] [Mon, 18 Jan 2021 20:12:11 +0000 (20:12 +0000)]
Merge #7336

7336: Rename `CrateDefMap` to `DefMap` r=matklad a=jonas-schievink

I propose handling local items by computing a `DefMap` for every block expression, using the regular (early) name resolution algorithm. The result of that will be a `DefMap` that has a reference to the parent `DefMap`, which is either the one computed for the containing block expression, or the crate's root `DefMap`. Name resolution will fall back to a name in the parent `DefMap` if it cannot be resolved in the inner block.

The `DefMap`s computed for block expressions will go through a separate query that can be garbage-collected much more aggressively, since these `DefMap`s should be cheap to compute and are never part of a crate's public API.

The first step towards that is to make `CrateDefMap` not specific to crates anymore, hence this rename (if this plans sounds reasonable).

cc https://github.com/rust-analyzer/rust-analyzer/issues/7325 and https://github.com/rust-analyzer/rust-analyzer/issues/1165

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove obsolete RangeInfo usage in references
Lukas Wirth [Mon, 18 Jan 2021 20:10:01 +0000 (21:10 +0100)]
Remove obsolete RangeInfo usage in references

3 years agoMerge #7339
bors[bot] [Mon, 18 Jan 2021 19:54:40 +0000 (19:54 +0000)]
Merge #7339

7339: Delete optional arg for inline attr and add doc alias attr completion r=lnicola a=bnjjj

close #7167

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoDelete optional arg for inline attr and add doc alias attr completion #7167
Benjamin Coenen [Mon, 18 Jan 2021 19:49:59 +0000 (20:49 +0100)]
Delete optional arg for inline attr and add doc alias attr completion #7167

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #7297 #7338
bors[bot] [Mon, 18 Jan 2021 19:40:11 +0000 (19:40 +0000)]
Merge #7297 #7338

7297: Propose trait associated items and autoimport traits on completion r=matklad a=SomeoneToIgnore

![trait_imports](https://user-images.githubusercontent.com/2690773/104819998-6faeb480-583a-11eb-8b45-b7351b51b90e.gif)

Closes #7248

7338: Parse `impl const Trait` r=Veykril a=Veykril

Closes #7313

bors r+

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSmall token fix
Kirill Bulatov [Mon, 18 Jan 2021 19:20:02 +0000 (21:20 +0200)]
Small token fix

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #7337
bors[bot] [Mon, 18 Jan 2021 19:29:09 +0000 (19:29 +0000)]
Merge #7337

7337: Remove obsolete RangeInfo usage in rename r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRemove obsolete RangeInfo usage in rename
Lukas Wirth [Mon, 18 Jan 2021 19:25:40 +0000 (20:25 +0100)]
Remove obsolete RangeInfo usage in rename

3 years agoRename `CrateDefMap` to `DefMap`
Jonas Schievink [Mon, 18 Jan 2021 19:18:05 +0000 (20:18 +0100)]
Rename `CrateDefMap` to `DefMap`

3 years agoParse `impl const Trait`
Lukas Wirth [Mon, 18 Jan 2021 18:50:13 +0000 (19:50 +0100)]
Parse `impl const Trait`