]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #8605
bors[bot] [Thu, 22 Apr 2021 17:35:41 +0000 (17:35 +0000)]
Merge #8605

8605: internal: Automatically categorize the changelog entries r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #8620
bors[bot] [Thu, 22 Apr 2021 15:22:43 +0000 (15:22 +0000)]
Merge #8620

8620: Remove unnecessary braces for extracted block expression r=Veykril a=brandondong

This change addresses the first bullet point of https://github.com/rust-analyzer/rust-analyzer/issues/7839.

Specifically, when extracting block expressions, remove the unneeded extra braces inside the generated function.

Co-authored-by: Brandon <brandondong604@hotmail.com>
3 years agoMerge #8621
bors[bot] [Thu, 22 Apr 2021 08:29:01 +0000 (08:29 +0000)]
Merge #8621

8621: feat: make sure nightly regressions don't break users r=lnicola a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: make sure nightly regressions don't break users
Aleksey Kladov [Thu, 22 Apr 2021 08:15:20 +0000 (11:15 +0300)]
feat: make sure nightly regressions don't break users

3 years agoRemove unnecessary braces for extracted block expression
Brandon [Wed, 21 Apr 2021 06:41:17 +0000 (23:41 -0700)]
Remove unnecessary braces for extracted block expression

3 years agoMerge #8595
bors[bot] [Wed, 21 Apr 2021 23:54:47 +0000 (23:54 +0000)]
Merge #8595

8595: Diagnostic paths support specifying `remapPrefix` r=rickvanprim a=rickvanprim

Currently VSCode Problem Matchers will resolve a path like `//foo_crate/src/main.rs` if `${workspaceFolder}/foo_crate/src/main.rs` exists.  Presumably their behavior is functionally a string concatenation that would produce `${workspaceFolder///foo_crate/src/main.rs` and repeated path separators get ignored.

This PR attempts to mimic this behavior by stripping any `Component::RootDir` from `file_name` before joining it to `workspace_root`, and then checking if the file exists.  If it does, this path is used, and if not, the behavior falls through to the existing Rust path join behavior.

Co-authored-by: James Leitch <rickvanprim@gmail.com>
3 years agoCode review feedback.
James Leitch [Wed, 21 Apr 2021 22:09:37 +0000 (15:09 -0700)]
Code review feedback.

3 years agoDiagnostic Remap Path Prefixes added.
James Leitch [Wed, 21 Apr 2021 03:03:35 +0000 (20:03 -0700)]
Diagnostic Remap Path Prefixes added.

3 years agoDiagnostic paths attempt to use VSCode's path join behavior before defaulting to...
James Leitch [Tue, 20 Apr 2021 03:18:54 +0000 (20:18 -0700)]
Diagnostic paths attempt to use VSCode's path join behavior before defaulting to Rust's path join behavior.

3 years agoMerge #8570
bors[bot] [Wed, 21 Apr 2021 21:56:54 +0000 (21:56 +0000)]
Merge #8570

8570: Flycheck tries to parse both Cargo and Rustc messages. r=rickvanprim a=rickvanprim

This change allows non-Cargo build systems to be used for Flycheck provided they call `rustc` with `--error-format=json` and emit those JSON messages to `stdout`.

Co-authored-by: James Leitch <rickvanprim@gmail.com>
3 years agoMerge #8616
bors[bot] [Wed, 21 Apr 2021 16:20:56 +0000 (16:20 +0000)]
Merge #8616

8616: minor: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBump other deps
Laurențiu Nicola [Wed, 21 Apr 2021 16:20:18 +0000 (19:20 +0300)]
Bump other deps

3 years agoBump chalk
Laurențiu Nicola [Wed, 21 Apr 2021 16:20:01 +0000 (19:20 +0300)]
Bump chalk

3 years agoBump rustc_lexer
Laurențiu Nicola [Wed, 21 Apr 2021 16:19:27 +0000 (19:19 +0300)]
Bump rustc_lexer

3 years agoMerge #8615
bors[bot] [Wed, 21 Apr 2021 16:10:55 +0000 (16:10 +0000)]
Merge #8615

8615: skip: Remove `ItemTree::all_inner_items` r=jonas-schievink a=jonas-schievink

It's unused.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove `ItemTree::all_inner_items`
Jonas Schievink [Wed, 21 Apr 2021 16:10:25 +0000 (18:10 +0200)]
Remove `ItemTree::all_inner_items`

3 years agoMerge #8613
bors[bot] [Wed, 21 Apr 2021 15:58:57 +0000 (15:58 +0000)]
Merge #8613

8613: skip: Add failing local items test r=jonas-schievink a=jonas-schievink

This is currently broken due to the way ItemTree stores inner items. This test serves as a reminder until this gets fixed.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd failing local items test
Jonas Schievink [Wed, 21 Apr 2021 15:57:45 +0000 (17:57 +0200)]
Add failing local items test

3 years agoMerge #8611
bors[bot] [Wed, 21 Apr 2021 14:48:03 +0000 (14:48 +0000)]
Merge #8611

8611: Add support for fill match arms of boolean values r=flodiebold a=komonad

- Add support for boolean inside tuple

closes #8593

Co-authored-by: Comonad <comonad@foxmail.com>
3 years agoAdd support for fill match arms of boolean values
Comonad [Wed, 21 Apr 2021 11:33:45 +0000 (19:33 +0800)]
Add support for fill match arms of boolean values

- Add support for boolean inside tuple

3 years agoMerge #8609
bors[bot] [Wed, 21 Apr 2021 09:12:08 +0000 (09:12 +0000)]
Merge #8609

8609: Parse outer atttributes for RecordPatField r=Veykril a=Veykril

Fixes #8608
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoParse outer atttributes for RecordPatField
Lukas Wirth [Wed, 21 Apr 2021 09:08:15 +0000 (11:08 +0200)]
Parse outer atttributes for RecordPatField

3 years agoMerge #8606
bors[bot] [Tue, 20 Apr 2021 21:25:27 +0000 (21:25 +0000)]
Merge #8606

8606: fix: no more  Registering progress handler for token rustAnalyzer/Ind… r=jonas-schievink a=matklad

…exing failed.

closes #8509

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: no more Registering progress handler for token rustAnalyzer/Indexing failed.
Aleksey Kladov [Tue, 20 Apr 2021 19:54:05 +0000 (22:54 +0300)]
fix: no more  Registering progress handler for token rustAnalyzer/Indexing failed.

3 years agoAutomatically categorize the changelog entries
Laurențiu Nicola [Mon, 29 Mar 2021 05:55:43 +0000 (08:55 +0300)]
Automatically categorize the changelog entries

3 years agoMerge #8600
bors[bot] [Tue, 20 Apr 2021 15:05:33 +0000 (15:05 +0000)]
Merge #8600

8600:  fix: no longer get stuck on windows r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: no longer get stuck on windows
Aleksey Kladov [Tue, 20 Apr 2021 13:06:20 +0000 (16:06 +0300)]
fix: no longer get stuck on windows

reading both stdout & stderr is a common gotcha, you need to drain them
concurrently to avoid deadlocks. Not sure why I didn't do the right
thing from the start. Seems like I assumed the stderr is short? That's
not the case when cargo spams `compiling xyz` messages

3 years agoMerge #8602
bors[bot] [Tue, 20 Apr 2021 14:27:08 +0000 (14:27 +0000)]
Merge #8602

8602: Fix panic in `replace_derive_with_manual_impl` r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFollow testing style guide
Jonas Schievink [Tue, 20 Apr 2021 14:26:07 +0000 (16:26 +0200)]
Follow testing style guide

3 years agoFix panic in `replace_derive_with_manual_impl`
Jonas Schievink [Tue, 20 Apr 2021 14:25:24 +0000 (16:25 +0200)]
Fix panic in `replace_derive_with_manual_impl`

3 years agoMerge #8601
bors[bot] [Tue, 20 Apr 2021 14:18:51 +0000 (14:18 +0000)]
Merge #8601

8601: Trigger "Inline variable" assist when on a use of the variable r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years ago"Inline variable" when on a use of the variable
Jonas Schievink [Tue, 20 Apr 2021 14:16:23 +0000 (16:16 +0200)]
"Inline variable" when on a use of the variable

3 years agoMerge #8598
bors[bot] [Tue, 20 Apr 2021 07:45:04 +0000 (07:45 +0000)]
Merge #8598

8598: minor: fix ugly line wrapping in the rendered manual r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: fix ugly line wrapping in the rendered manual
Aleksey Kladov [Tue, 20 Apr 2021 07:44:06 +0000 (10:44 +0300)]
minor: fix ugly line wrapping in the rendered manual

3 years agoCode review feedback.
James Leitch [Mon, 19 Apr 2021 19:26:04 +0000 (12:26 -0700)]
Code review feedback.

3 years agoMerge #8588
bors[bot] [Mon, 19 Apr 2021 18:38:34 +0000 (18:38 +0000)]
Merge #8588

8588: internal: Add guidelines for release notes PR descriptions r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agointernal: Add guidelines for release notes PR descriptions
Laurențiu Nicola [Mon, 19 Apr 2021 18:09:24 +0000 (21:09 +0300)]
internal: Add guidelines for release notes PR descriptions

3 years agoMerge #8586
bors[bot] [Mon, 19 Apr 2021 18:03:56 +0000 (18:03 +0000)]
Merge #8586

8586: Replace SyntaxRewriter usage with ted in eager::eager_macro_recur r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #8587
bors[bot] [Mon, 19 Apr 2021 17:54:34 +0000 (17:54 +0000)]
Merge #8587

8587: Fix some find_path bugs around inner items r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd autoimport test with inner items
Jonas Schievink [Mon, 19 Apr 2021 17:53:29 +0000 (19:53 +0200)]
Add autoimport test with inner items

3 years agoFix some find_path bugs around inner items
Jonas Schievink [Mon, 19 Apr 2021 17:50:11 +0000 (19:50 +0200)]
Fix some find_path bugs around inner items

3 years agoReplace SyntaxRewriter with ted in exppand_macro::expand_macro_recur
Lukas Wirth [Mon, 19 Apr 2021 17:43:26 +0000 (19:43 +0200)]
Replace SyntaxRewriter with ted in exppand_macro::expand_macro_recur

3 years agoRemove SyntaxRewriter usage in eager::eager_macro_recur
Lukas Wirth [Mon, 19 Apr 2021 17:28:41 +0000 (19:28 +0200)]
Remove SyntaxRewriter usage in eager::eager_macro_recur

3 years agoMerge #8584
bors[bot] [Mon, 19 Apr 2021 16:04:44 +0000 (16:04 +0000)]
Merge #8584

8584: internal: fix slightly broken test r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: fix slightly broken test
Aleksey Kladov [Mon, 19 Apr 2021 15:57:47 +0000 (18:57 +0300)]
internal: fix slightly broken test

3 years agoMerge #8583
bors[bot] [Mon, 19 Apr 2021 15:55:29 +0000 (15:55 +0000)]
Merge #8583

8583: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #8582
bors[bot] [Mon, 19 Apr 2021 15:47:18 +0000 (15:47 +0000)]
Merge #8582

8582: Fix typo: comparision -> comparison r=kjeremy a=stanciuadrian

Closes #8576

Co-authored-by: Adrian Stanciu <stanciu.adrian@gmail.com>
3 years agoFix typo: comparision -> comparison
Adrian Stanciu [Mon, 19 Apr 2021 15:44:38 +0000 (18:44 +0300)]
Fix typo: comparision -> comparison

3 years agoMerge #8580
bors[bot] [Mon, 19 Apr 2021 15:12:49 +0000 (15:12 +0000)]
Merge #8580

8580: Remove confusion around serverStatusNotification r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoRemove confusion around serverStatusNotification
Aleksey Kladov [Mon, 19 Apr 2021 15:10:33 +0000 (18:10 +0300)]
Remove confusion around serverStatusNotification

3 years agoSimplify
Lukas Wirth [Mon, 19 Apr 2021 15:11:30 +0000 (17:11 +0200)]
Simplify

3 years agoMerge #8579
bors[bot] [Mon, 19 Apr 2021 14:56:39 +0000 (14:56 +0000)]
Merge #8579

8579: Fix spec bug r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix spec bug
Aleksey Kladov [Mon, 19 Apr 2021 14:55:51 +0000 (17:55 +0300)]
Fix spec bug

3 years agoMerge #8578
bors[bot] [Mon, 19 Apr 2021 14:37:54 +0000 (14:37 +0000)]
Merge #8578

8578: fix: false positive about inner attrs in docs r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: false positive about inner attrs in docs
Aleksey Kladov [Mon, 19 Apr 2021 14:11:49 +0000 (17:11 +0300)]
fix: false positive about inner attrs in docs

closes #8541

3 years agoMerge #8577
bors[bot] [Mon, 19 Apr 2021 13:51:57 +0000 (13:51 +0000)]
Merge #8577

8577: Support crates/module roots in external_docs r=Veykril a=Veykril

Fixes #8575
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSupport crates/module roots in external_docs
Lukas Wirth [Mon, 19 Apr 2021 13:50:04 +0000 (15:50 +0200)]
Support crates/module roots in external_docs

3 years agoMerge #8502
bors[bot] [Mon, 19 Apr 2021 13:18:21 +0000 (13:18 +0000)]
Merge #8502

8502: internal: document review requesting etiquette r=matklad a=matklad

* don't feel obliged to quickly review every PR assigned to you
* so that other folks can notify you about interesting PRs without
  thinking to much about creating additional work for you

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

8524: Fix extract function with partial block selection r=matklad a=brandondong

**Reproduction:**
```rust
fn foo() {
    let n = 1;
    let mut v = $0n * n;$0
    v += 1;
}
```
1. Select the snippet ($0) and use the "Extract into function" assist.
2. Extracted function is incorrect and does not compile:
```rust
fn foo() {
    let n = 1;
    let mut v = fun_name(n);
    v += 1;
}

fn fun_name(n: i32) {}
```
3. Omitting the ending semicolon from the selection fixes the extracted function:
```rust
fn fun_name(n: i32) -> i32 {
    n * n
}
```

**Cause:**
- When `extraction_target` uses a block extraction (semicolon case) instead of an expression extraction (no semicolon case), the user selection is directly used as the TextRange.
- However, the existing function extraction logic for blocks requires that the TextRange spans from start to end of complete statements to work correctly.
- For example:
```rust
fn foo() {
    let m = 2;
    let n = 1;
    let mut v = m $0* n;
    let mut w = 3;$0
    v += 1;
    w += 1;
}
```
produces
```rust
fn foo() {
    let m = 2;
    let n = 1;
    let mut v = m let mut w = fun_name(n);
    v += 1;
    w += 1;
}

fn fun_name(n: i32) -> i32 {
    let mut w = 3;
    w
}
```
- The user selected TextRange is directly replaced by the function call which is now in the middle of another statement. The extracted function body only contains statements that were fully covered by the TextRange and so the `* n` code is deleted. The logic for calculating variable usage and outlived variables for the function parameters and return type respectively search within the TextRange and so do not include `m` or `v`.

**Fix:**
- Only extract full statements when using block extraction. If a user selected part of a statement, extract that full statement.

8527: Switch introduce_named_lifetime assist to use mutable syntax tree  r=matklad a=iDawer

This extends `GenericParamsOwnerEdit` trait with `get_or_create_generic_param_list` method

Co-authored-by: Brandon <brandondong604@hotmail.com>
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoUpdate docs/dev/README.md
Aleksey Kladov [Tue, 13 Apr 2021 11:53:02 +0000 (14:53 +0300)]
Update docs/dev/README.md

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
3 years agointernal: document review requesting etiquette
Aleksey Kladov [Tue, 13 Apr 2021 11:13:50 +0000 (14:13 +0300)]
internal: document review requesting etiquette

* don't feel obliged to quickly review every PR assigned to you
* so that other folks can notify you about interesting PRs without
  thinking to much about creating additional work for you

3 years agoMerge #8462
bors[bot] [Mon, 19 Apr 2021 13:01:30 +0000 (13:01 +0000)]
Merge #8462

8462: Expand macros at type position r=jonas-schievink a=cynecx

Co-authored-by: cynecx <me@cynecx.net>
3 years agoMerge #8574
bors[bot] [Mon, 19 Apr 2021 11:39:45 +0000 (11:39 +0000)]
Merge #8574

8574: Check for rust doc code attributes like rustdoc does r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoCheck for rust doc code attributes like rustdoc does
Lukas Wirth [Mon, 19 Apr 2021 11:20:37 +0000 (13:20 +0200)]
Check for rust doc code attributes like rustdoc does

3 years agoMerge #8565
bors[bot] [Mon, 19 Apr 2021 11:32:22 +0000 (11:32 +0000)]
Merge #8565

8565: Fill match arms assist: add remaining arms for tuple of enums r=iDawer a=iDawer

Fix for #8493

However, the assist is still flaky and does not use `hir_ty::diagnostics::match_check`

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoUnindent test according to the style guide.
Dawer [Mon, 19 Apr 2021 11:24:09 +0000 (16:24 +0500)]
Unindent test according to the style guide.

3 years agoDon't require all doc fences to be valid for identifying rust code
Lukas Wirth [Mon, 19 Apr 2021 09:41:45 +0000 (11:41 +0200)]
Don't require all doc fences to be valid for identifying rust code

3 years agoMerge #8540
bors[bot] [Mon, 19 Apr 2021 07:57:40 +0000 (07:57 +0000)]
Merge #8540

8540: Prevent being able to rename items that are not part of the workspace r=Veykril a=Veykril

This change causes renames that happen on items coming from crates outside the workspace to fail. I believe this should be the right approach, but usage of cargo's workspace might not be entirely correct for preventing these kinds of refactoring from touching things they shouldn't. I'm not entirely sure?

cc #6623, this is one of the bigger footguns when it comes to refactoring, especially in combination with import aliases people tend to rename items coming from a crates dependency which this prevents.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #8572
bors[bot] [Mon, 19 Apr 2021 06:09:48 +0000 (06:09 +0000)]
Merge #8572

8572: minor: update bug report template r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoUpdate bug report template
Laurențiu Nicola [Mon, 19 Apr 2021 06:06:04 +0000 (09:06 +0300)]
Update bug report template

3 years agoMerge #8467
bors[bot] [Mon, 19 Apr 2021 04:54:04 +0000 (04:54 +0000)]
Merge #8467

8467: Adds impl Deref assist r=jhgg a=jhgg

This PR adds a new `generate_deref` assist that automatically generates a deref impl for a given struct field.

Check out this gif:

![2021-04-11_00-33-33](https://user-images.githubusercontent.com/5489149/114296006-b38e1000-9a5d-11eb-9112-807c01b8fd0a.gif)

--

I have a few Q's:
 - [x] Should I write more tests, if so, what precisely should I test for?
 - [x] I have an inline question on line 65, can someone provide guidance? :)
 - [x] I can implement this for `ast::TupleField` too. But should it be a separate assist fn, or should I try and jam both into the `generate_deref`?
 - [x] I want to follow this up with an assist on `impl $0Deref for T {` which would automatically generate a `DerefMut` impl that mirrors the Deref as well, however, I could probably use some pointers on how to do that, since I'll have to reach into the ast of `fn deref` to grab the field that it's referencing for the `DerefMut` impl.

Co-authored-by: jake <jh@discordapp.com>
3 years agoimplement field stuff too
jake [Mon, 19 Apr 2021 04:51:17 +0000 (21:51 -0700)]
implement field stuff too

3 years agoFlycheck tries to parse both Cargo and Rustc messages.
James Leitch [Sun, 18 Apr 2021 23:36:29 +0000 (16:36 -0700)]
Flycheck tries to parse both Cargo and Rustc messages.

3 years agoMerge #8569
bors[bot] [Sun, 18 Apr 2021 23:08:44 +0000 (23:08 +0000)]
Merge #8569

8569: Support inherent impls in unnamed consts r=jonas-schievink a=jonas-schievink

It turns out that some proc. macros not only generate *trait* impls wrapped in `const _: () = { ... };`, but inherent impls too. Even though it is questionable whether *custom derives* should produce non-trait impls, this is useful for procedural attribute macros once we support them.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoCollect inherent impls in unnamed consts
Jonas Schievink [Sun, 18 Apr 2021 23:06:26 +0000 (01:06 +0200)]
Collect inherent impls in unnamed consts

3 years agoFix visibility of items in block modules
Jonas Schievink [Sun, 18 Apr 2021 23:06:04 +0000 (01:06 +0200)]
Fix visibility of items in block modules

3 years agoBetter visualise control flow for change_annotation_support"
Lukas Wirth [Sun, 18 Apr 2021 22:14:21 +0000 (00:14 +0200)]
Better visualise control flow for change_annotation_support"

3 years agohir_ty: cleanups and extend infinitely_recursive_macro_type test
cynecx [Sun, 18 Apr 2021 18:18:48 +0000 (20:18 +0200)]
hir_ty: cleanups and extend infinitely_recursive_macro_type  test

3 years agohir_ty: keep body::Expander in TyLoweringContext
cynecx [Sun, 18 Apr 2021 17:56:13 +0000 (19:56 +0200)]
hir_ty: keep body::Expander in TyLoweringContext

3 years agoMerge #8564
bors[bot] [Sun, 18 Apr 2021 16:44:14 +0000 (16:44 +0000)]
Merge #8564

8564: Expand `global_asm!` to nothing r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoExpand `global_asm!` to nothing
Jonas Schievink [Sun, 18 Apr 2021 16:43:45 +0000 (18:43 +0200)]
Expand `global_asm!` to nothing

3 years agohir_def: various cleanups
cynecx [Sun, 18 Apr 2021 16:35:45 +0000 (18:35 +0200)]
hir_def: various cleanups

3 years agoReturn to the status quo in #8129
Dawer [Sun, 18 Apr 2021 15:17:30 +0000 (20:17 +0500)]
Return to the status quo in #8129

3 years agoPrevent adding useless match arms
Dawer [Sun, 18 Apr 2021 11:43:12 +0000 (16:43 +0500)]
Prevent adding useless match arms

3 years agoUpdate lsp-extensions docs
Lukas Wirth [Sun, 18 Apr 2021 10:50:44 +0000 (12:50 +0200)]
Update lsp-extensions docs

3 years agoPrevent being able to rename items that are not part of the workspace
Lukas Wirth [Fri, 16 Apr 2021 15:31:47 +0000 (17:31 +0200)]
Prevent being able to rename items that are not part of the workspace

3 years agoMerge #8561
bors[bot] [Sun, 18 Apr 2021 09:57:43 +0000 (09:57 +0000)]
Merge #8561

8561: Accept `E<error_number>` notation in doctests r=Veykril a=ChayimFriedman2

````
```compile_fail,E0000
```
````

The code was stolen from rustdoc at https://github.com/rust-lang/rust/blob/392ba2ba1a7d6c542d2459fb8133bebf62a4a423/src/librustdoc/html/markdown.rs#L866-L867

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
3 years agoAccept `E<error_number>` notation in doctests
Chayim Refael Friedman [Sun, 18 Apr 2021 02:09:20 +0000 (05:09 +0300)]
Accept `E<error_number>` notation in doctests

```compile_fail,E0000
```

The code was stolen from rustdoc at https://github.com/rust-lang/rust/blob/392ba2ba1a7d6c542d2459fb8133bebf62a4a423/src/librustdoc/html/markdown.rs#L866-L867

3 years agoMerge #8560
bors[bot] [Sun, 18 Apr 2021 02:14:27 +0000 (02:14 +0000)]
Merge #8560

8560: Escape characters in doc comments in macros correctly r=jonas-schievink a=ChayimFriedman2

Previously they were escaped twice, both by `.escape_default()` and the debug view of strings (`{:?}`). This leads to things like newlines or tabs in documentation comments being `\\n`, but we unescape literals only once, ending up with `\n`.

This was hard to spot because CMark unescaped them (at least for `'` and `"`), but it did not do so in code blocks.

This also was the root cause of #7781. This issue was solved by using `.escape_debug()` instead of `.escape_default()`, but the real issue remained.
We can bring the `.escape_default()` back by now, however I didn't do it because it is probably slower than `.escape_debug()` (more work to do), and also in order to change the code the least.

Example (the keyword and primitive docs are `include!()`d at https://doc.rust-lang.org/src/std/lib.rs.html#570-578, and thus originate from macro):

Before:
![image](https://user-images.githubusercontent.com/24700207/115130096-40544300-9ff5-11eb-847b-969e7034e8a4.png)

After:
![image](https://user-images.githubusercontent.com/24700207/115130143-9cb76280-9ff5-11eb-9281-323746089440.png)

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
3 years agoEscape characters in doc comments in macros correctly
Chayim Refael Friedman [Sun, 18 Apr 2021 00:16:38 +0000 (03:16 +0300)]
Escape characters in doc comments in macros correctly

Previously they were escaped twice, both by `.escape_default()` and the debug view of strings (`{:?}`). This leads to things like newlines or tabs in documentation comments being `\\n`, but we unescape literals only once, ending up with `\n`.

This was hard to spot because CMark unescaped them (at least for `'` and `"`), but it did not do so in code blocks.

This also was the root cause of #7781. This issue was solved by using `.escape_debug()` instead of `.escape_default()`, but the real issue remained.
We can bring the `.escape_default()` back by now, however I didn't do it because it is probably slower than `.escape_debug()` (more work to do), and also in order to change the code the least.

3 years agoMerge #8559
bors[bot] [Sat, 17 Apr 2021 19:37:59 +0000 (19:37 +0000)]
Merge #8559

8559: Add some more error messages to fixture failure cases r=Veykril a=Veykril

Follow up for #8557
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd some more error messages to fixture failure cases
Lukas Wirth [Sat, 17 Apr 2021 19:34:14 +0000 (21:34 +0200)]
Add some more error messages to fixture failure cases

3 years agohir_def: refactor expand_macro_type and cleanups
cynecx [Sat, 17 Apr 2021 15:38:38 +0000 (17:38 +0200)]
hir_def: refactor expand_macro_type and cleanups

3 years agoMerge #8557
bors[bot] [Sat, 17 Apr 2021 14:51:42 +0000 (14:51 +0000)]
Merge #8557

8557: Add an error message to fixture errors r=Veykril a=yoshuawuyts

Improve the error message when folks forget to add an `$0` in one of the fixtures. Figuring this one out was 20 minutes down the drain for me, so figured I might as well make sure nobody else has to go through the same thing in the future. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
3 years agoAdd an error message to fixture errors
Yoshua Wuyts [Sat, 17 Apr 2021 14:39:03 +0000 (16:39 +0200)]
Add an error message to fixture errors

3 years agohir_def: ignore ast::Type in file_item_tree query
cynecx [Wed, 14 Apr 2021 00:36:05 +0000 (02:36 +0200)]
hir_def: ignore ast::Type in file_item_tree query

3 years agohir_ty: deal with TypeRef::Macro in HirFormatter
cynecx [Mon, 12 Apr 2021 14:24:48 +0000 (16:24 +0200)]
hir_ty: deal with TypeRef::Macro in HirFormatter

3 years agohir_ty: Expand macros at type position
cynecx [Sat, 10 Apr 2021 15:49:12 +0000 (17:49 +0200)]
hir_ty: Expand macros at type position

3 years agoTest fill-match-arms assist: partial with wildcards
Dawer [Sat, 17 Apr 2021 10:20:29 +0000 (15:20 +0500)]
Test fill-match-arms assist: partial with wildcards

3 years agoMerge #8551
bors[bot] [Sat, 17 Apr 2021 08:00:52 +0000 (08:00 +0000)]
Merge #8551

8551: nail rowan version down r=lnicola a=drahnr

The different pre versions include breaking changes, which cause build failures for the users.

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>