Skip to content

Commit 9239972

Browse files
committed
Changelog #198
1 parent 0a96e56 commit 9239972

File tree

4 files changed

+109
-18
lines changed

4 files changed

+109
-18
lines changed

generated_assists.adoc

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,25 @@ fn main() {
313313
```
314314

315315

316+
[discrete]
317+
=== `bind_unused_param`
318+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bind_unused_param.rs#L12[bind_unused_param.rs]
319+
320+
Binds unused function parameter to an underscore.
321+
322+
.Before
323+
```rust
324+
fn some_function(x: i32┃) {}
325+
```
326+
327+
.After
328+
```rust
329+
fn some_function(x: i32) {
330+
let _ = x;
331+
}
332+
```
333+
334+
316335
[discrete]
317336
=== `change_visibility`
318337
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/change_visibility.rs#L13[change_visibility.rs]
@@ -332,7 +351,7 @@ pub(crate) fn frobnicate() {}
332351

333352
[discrete]
334353
=== `convert_bool_then_to_if`
335-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_then.rs#L132[convert_bool_then.rs]
354+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_then.rs#L131[convert_bool_then.rs]
336355

337356
Converts a `bool::then` method call to an equivalent if expression.
338357

@@ -811,27 +830,13 @@ Move an expression out of a format string.
811830

812831
.Before
813832
```rust
814-
macro_rules! format_args {
815-
($lit:literal $(tt:tt)*) => { 0 },
816-
}
817-
macro_rules! print {
818-
($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
819-
}
820-
821833
fn main() {
822834
print!("{var} {x + 1}┃");
823835
}
824836
```
825837

826838
.After
827839
```rust
828-
macro_rules! format_args {
829-
($lit:literal $(tt:tt)*) => { 0 },
830-
}
831-
macro_rules! print {
832-
($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
833-
}
834-
835840
fn main() {
836841
print!("{var} {}"┃, x + 1);
837842
}
@@ -2016,6 +2021,44 @@ fn foo() {
20162021
```
20172022

20182023

2024+
[discrete]
2025+
=== `into_to_qualified_from`
2026+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/into_to_qualified_from.rs#L10[into_to_qualified_from.rs]
2027+
2028+
Convert an `into` method call to a fully qualified `from` call.
2029+
2030+
.Before
2031+
```rust
2032+
//- minicore: from
2033+
struct B;
2034+
impl From<i32> for B {
2035+
fn from(a: i32) -> Self {
2036+
B
2037+
}
2038+
}
2039+
2040+
fn main() -> () {
2041+
let a = 3;
2042+
let b: B = a.in┃to();
2043+
}
2044+
```
2045+
2046+
.After
2047+
```rust
2048+
struct B;
2049+
impl From<i32> for B {
2050+
fn from(a: i32) -> Self {
2051+
B
2052+
}
2053+
}
2054+
2055+
fn main() -> () {
2056+
let a = 3;
2057+
let b: B = B::from(a);
2058+
}
2059+
```
2060+
2061+
20192062
[discrete]
20202063
=== `introduce_named_generic`
20212064
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_generic.rs#L8[introduce_named_generic.rs]

generated_diagnostic.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ This diagnostic is shown when the derive attribute has invalid input.
5656

5757

5858
=== mismatched-arg-count
59-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L8[mismatched_arg_count.rs]
59+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L35[mismatched_arg_count.rs]
60+
61+
This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.
62+
63+
64+
=== mismatched-tuple-struct-pat-arg-count
65+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L10[mismatched_arg_count.rs]
6066

6167
This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.
6268

@@ -100,7 +106,7 @@ This diagnostic is triggered on mutating an immutable variable.
100106

101107

102108
=== no-such-field
103-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/no_such_field.rs#L11[no_such_field.rs]
109+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/no_such_field.rs#L12[no_such_field.rs]
104110

105111
This diagnostic is triggered if created structure does not have field provided in record.
106112

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ image::https://user-images.githubusercontent.com/48062697/113020658-b5f98b80-917
341341

342342

343343
=== Inlay Hints
344-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L392[inlay_hints.rs]
344+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L421[inlay_hints.rs]
345345

346346
rust-analyzer shows additional information inline with the source code.
347347
Editors usually render this using read-only virtual text snippets interspersed with code.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
= Changelog #198
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:326f37ef1f53575fd38e768065b6bcfcebdce462[] +
7+
Release: release:2023-09-11[] (`v0.3.1657`)
8+
9+
== New Features
10+
11+
* pr:15578[] diagnose mismatched argument count for tuple struct patterns:
12+
+
13+
image::https://user-images.githubusercontent.com/308347/266911785-8ab15830-e25b-4a9d-8a38-15e14f91e4df.png["A screenshot showing an error on `let S(a, b) = todo!()`"]
14+
* pr:15584[] diagnose private fields in record constructor:
15+
+
16+
image::https://user-images.githubusercontent.com/308347/266912247-cd84cb65-0afc-4f4a-a972-edefc932bf2e.png["A screenshot showing an error when using a private field in a pattern"]
17+
* pr:15557[] parse `builtin#` syntax and add type checking for `builtin#offset_of`.
18+
* pr:15559[] implement `builtin#format_args`, using rustc's `format_args` parser.
19+
* pr:15532[] on-type format `(`, by adding closing `)` automatically.
20+
* pr:15573[] add "into to qualified from" assist.
21+
* pr:15524[] add "Bind unused parameter" assist.
22+
* pr:15528[] enable `cfg(rust_analyzer)` when code is being analyzed.
23+
24+
== Fixes
25+
26+
* pr:15574[] use crate name for `CARGO_CRATE_NAME`.
27+
* pr:15577[] clear native diagnostics for closed files.
28+
29+
== Internal Improvements
30+
31+
* pr:15568[] replace `format_args` parser with upstream fork.
32+
* pr:15565[] implement `write_via_move` intrinsic for MIR eval.
33+
* pr:15571[] remove allocation on MIR eval memory write.
34+
* pr:15567[] ignore enum variants in analysis stats of MIR bodies.
35+
* pr:15575[] intern projections in MIR place.
36+
* pr:15430[] de-unwrap `wrap_return_type_in_result`.
37+
* pr:15529[] do not send inlay hint refresh requests on file edits.
38+
* pr:15522[] resolve inlay hint data lazily.
39+
* pr:15586[], pr:15592[] shrink some stuff.
40+
* pr:15564[] use current folder's `rustfmt.toml` with custom configurations.
41+
* pr:15560[] when using `rust-project.json`, prefer the sysroot-defined rustc over discovery in `$PATH`.
42+
* pr:15558[] remove `rust-analyzer.discoverProjectCommand` in favor of a companion VS Code extension.

0 commit comments

Comments
 (0)