Skip to content

Commit 5e5f7f1

Browse files
committed
Changelog #172
1 parent 7a39201 commit 5e5f7f1

File tree

5 files changed

+119
-50
lines changed

5 files changed

+119
-50
lines changed

generated_assists.adoc

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ fn main() {
811811

812812
[discrete]
813813
=== `extract_function`
814-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L38[extract_function.rs]
814+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L39[extract_function.rs]
815815

816816
Extracts selected statements and comments into new function.
817817

@@ -1724,7 +1724,7 @@ fn bar() {
17241724

17251725
[discrete]
17261726
=== `inline_local_variable`
1727-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_local_variable.rs#L19[inline_local_variable.rs]
1727+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_local_variable.rs#L18[inline_local_variable.rs]
17281728

17291729
Inlines a local variable.
17301730

@@ -2668,7 +2668,7 @@ fn compute() -> Option<i32> { None }
26682668

26692669
[discrete]
26702670
=== `replace_match_with_if_let`
2671-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L185[replace_if_let_with_match.rs]
2671+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L187[replace_if_let_with_match.rs]
26722672

26732673
Replaces a binary `match` with a wildcard pattern and no guards with an `if let` expression.
26742674

@@ -2698,52 +2698,6 @@ fn handle(action: Action) {
26982698
```
26992699

27002700

2701-
[discrete]
2702-
=== `replace_or_else_with_or`
2703-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_or_with_or_else.rs#L89[replace_or_with_or_else.rs]
2704-
2705-
Replace `unwrap_or_else` with `unwrap_or` and `ok_or_else` with `ok_or`.
2706-
2707-
.Before
2708-
```rust
2709-
fn foo() {
2710-
let a = Some(1);
2711-
a.unwra┃p_or_else(|| 2);
2712-
}
2713-
```
2714-
2715-
.After
2716-
```rust
2717-
fn foo() {
2718-
let a = Some(1);
2719-
a.unwrap_or(2);
2720-
}
2721-
```
2722-
2723-
2724-
[discrete]
2725-
=== `replace_or_with_or_else`
2726-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_or_with_or_else.rs#L12[replace_or_with_or_else.rs]
2727-
2728-
Replace `unwrap_or` with `unwrap_or_else` and `ok_or` with `ok_or_else`.
2729-
2730-
.Before
2731-
```rust
2732-
fn foo() {
2733-
let a = Some(1);
2734-
a.unwra┃p_or(2);
2735-
}
2736-
```
2737-
2738-
.After
2739-
```rust
2740-
fn foo() {
2741-
let a = Some(1);
2742-
a.unwrap_or_else(|| 2);
2743-
}
2744-
```
2745-
2746-
27472701
[discrete]
27482702
=== `replace_qualified_name_with_use`
27492703
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_qualified_name_with_use.rs#L13[replace_qualified_name_with_use.rs]
@@ -2831,6 +2785,52 @@ fn main() {
28312785
```
28322786

28332787

2788+
[discrete]
2789+
=== `replace_with_eager_method`
2790+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#L89[replace_method_eager_lazy.rs]
2791+
2792+
Replace `unwrap_or_else` with `unwrap_or` and `ok_or_else` with `ok_or`.
2793+
2794+
.Before
2795+
```rust
2796+
fn foo() {
2797+
let a = Some(1);
2798+
a.unwra┃p_or_else(|| 2);
2799+
}
2800+
```
2801+
2802+
.After
2803+
```rust
2804+
fn foo() {
2805+
let a = Some(1);
2806+
a.unwrap_or(2);
2807+
}
2808+
```
2809+
2810+
2811+
[discrete]
2812+
=== `replace_with_lazy_method`
2813+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#L9[replace_method_eager_lazy.rs]
2814+
2815+
Replace `unwrap_or` with `unwrap_or_else` and `ok_or` with `ok_or_else`.
2816+
2817+
.Before
2818+
```rust
2819+
fn foo() {
2820+
let a = Some(1);
2821+
a.unwra┃p_or(2);
2822+
}
2823+
```
2824+
2825+
.After
2826+
```rust
2827+
fn foo() {
2828+
let a = Some(1);
2829+
a.unwrap_or_else(|| 2);
2830+
}
2831+
```
2832+
2833+
28342834
[discrete]
28352835
=== `sort_items`
28362836
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/sort_items.rs#L12[sort_items.rs]

generated_config.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ cargo check --quiet --workspace --message-format=json --all-targets
7171
Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
7272
avoid checking unnecessary things.
7373
--
74+
[[rust-analyzer.cargo.extraArgs]]rust-analyzer.cargo.extraArgs (default: `[]`)::
75+
+
76+
--
77+
Extra arguments that are passed to every cargo invocation.
78+
--
7479
[[rust-analyzer.cargo.extraEnv]]rust-analyzer.cargo.extraEnv (default: `{}`)::
7580
+
7681
--

generated_diagnostic.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let a = A { a: 10 };
6464

6565

6666
=== missing-match-arm
67-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_match_arms.rs#L5[missing_match_arms.rs]
67+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_match_arms.rs#L3[missing_match_arms.rs]
6868

6969
This diagnostic is triggered if `match` block is missing one or more match arms.
7070

@@ -75,6 +75,12 @@ This diagnostic is triggered if `match` block is missing one or more match arms.
7575
This diagnostic is triggered if an operation marked as `unsafe` is used outside of an `unsafe` function or block.
7676

7777

78+
=== need-mut
79+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L7[mutability_errors.rs]
80+
81+
This diagnostic is triggered on mutating an immutable variable.
82+
83+
7884
=== no-such-field
7985
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/no_such_field.rs#L11[no_such_field.rs]
8086

@@ -174,3 +180,9 @@ but can also indicate project setup problems.
174180
If you are seeing a lot of "proc macro not expanded" warnings, you can add this option to the
175181
`rust-analyzer.diagnostics.disabled` list to prevent them from showing. Alternatively you can
176182
enable support for procedural macros (see `rust-analyzer.procMacro.attributes.enable`).
183+
184+
185+
=== unused-mut
186+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L39[mutability_errors.rs]
187+
188+
This diagnostic is triggered when a mutable variable isn't actually mutated.

generated_features.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,16 @@ Only workspace crates are included, no crates.io dependencies or sysroot crates.
967967
image::https://user-images.githubusercontent.com/48062697/113065588-068bdb80-91b1-11eb-9a78-0b4ef1e972fb.gif[]
968968

969969

970+
=== View Mir
971+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/view_mir.rs#L6[view_mir.rs]
972+
973+
|===
974+
| Editor | Action Name
975+
976+
| VS Code | **rust-analyzer: View Mir**
977+
|===
978+
979+
970980
=== Workspace Symbol
971981
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L155[symbol_index.rs]
972982

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
= Changelog #172
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:f1e51afa450ecf352c1f01fc5a5b6d10792e3779[] +
7+
Release: release:2023-03-13[] (`v0.3.1435`)
8+
9+
== New Features
10+
11+
* pr:14232[], pr:14316[] MIR episode 2, add `need-mut` and experimental `unused-mut` diagnostics:
12+
+
13+
image::https://user-images.githubusercontent.com/308347/224622684-20570ef7-e5b8-4dfc-8bdb-5c8fc53fea84.png["Screenshot showing an error when reassigning a non-mut variable"]
14+
* pr:14313[] add fancy buttons to the VS Code status message:
15+
+
16+
image::https://user-images.githubusercontent.com/3757771/224274817-a5a8cb0c-7bda-454d-9772-5f839f360b9a.png["Screenshot showing the status and Stop, Reload, Restart and Open logs options in a status bar menu"]
17+
* pr:14266[] make `replace_or_with_or_else` assists more generally applicable.
18+
* pr:14328[] allow passing extra `cargo` args when running build scripts.
19+
20+
== Fixes
21+
22+
* pr:14323[] (first contribution) fix source root de-duplication.
23+
* pr:14267[] mark unresolved field, unresolved method and expected function diagnostics as experimental.
24+
* pr:14297[] add `libcore` dependency to proc macros.
25+
* pr:14282[] load proc macros for `rustc_private` crates.
26+
* pr:14260[] tighten `replace_match_with_if_let` applicability range.
27+
* pr:14271[] don't trigger unresolved method/field diagnostics on types containing errors.
28+
* pr:14284[] highlight unresolved derives as such.
29+
* pr:14248[] show diagnostic for `}` followed by `else` in `let-else` statement.
30+
* pr:14283[] don't send error notifications for workspace failures if server status is supported.
31+
* pr:14286[] fix block defmap not looking into tail expressions for macro calls.
32+
* pr:14291[] fix handling of multiple definition bindings in `convert_match_to_let_else`.
33+
* pr:14299[] fix searching inside bodies of attributed items.
34+
* pr:14300[] watch both stdout and stderr in flycheck.
35+
* pr:14306[] fix block with no termination in or-patterns.
36+
37+
== Internal Improvements
38+
39+
* pr:14261[] reuse the resolver in `InferenceContext` instead of rebuilding it when needed.
40+
* pr:14302[] add missing queries to `per_query_memory_usage`.
41+
* pr:14311[] don't attempt to compute diagnostics in library crates.
42+
* pr:14326[] rename `match_expr` field of `hir::diagnostics::MissingMatchArms`.

0 commit comments

Comments
 (0)