Commit graph

307089 commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
bfb0892525
Merge pull request #20814 from ChayimFriedman2/mir-ns
internal: Migrate MIR to next solver
2025-10-11 16:43:41 +00:00
Shoyu Vanilla (Flint)
312d31d974
Merge pull request #20788 from A4-Tacks/any-raw-string
Fix not applicable c-str and byte-str for raw_string
2025-10-11 16:40:06 +00:00
Chayim Refael Friedman
35142a6ab8 Migrate MIR to next solver 2025-10-10 17:40:15 +03:00
A4-Tacks
d1ecdca22f
Migrate raw_string assist to use SyntaxEditor 2025-10-10 19:04:48 +08:00
A4-Tacks
ddf8dd7875
Fix not applicable c-str and byte-str for raw_string
Example
---

Assist: `make_raw_string`

```rust
fn f() {
    let s = $0b"random\nstring";
}
```
->
```rust
fn f() {
    let s = br#"random
string"#;
}
```

---

Assist: `make_raw_string`

```rust
fn f() {
    let s = $0c"random\nstring";
}
```
->
```rust
fn f() {
    let s = cr#"random
string"#;
}
```

---

Assist: `add_hash`

```rust
fn f() {
    let s = $0cr"random string";
}
```
->
```rust
fn f() {
    let s = cr#"random string"#;
}
```

---

Assist: `remove_hash`

```rust
fn f() {
    let s = $0cr#"random string"#;
}
```
->
```rust
fn f() {
    let s = cr"random string";
}
```

---

Assist: `make_usual_string`

```rust
fn f() {
    let s = $0cr#"random string"#;
}
```
->
```rust
fn f() {
    let s = c"random string";
}
```
2025-10-10 19:04:48 +08:00
Shoyu Vanilla (Flint)
986bb35e75
Merge pull request #20526 from A4-Tacks/postfix-let-in-let-chain
Fix .let completion not work for let-chain
2025-10-10 10:07:31 +00:00
Shoyu Vanilla (Flint)
65920fefee
Merge pull request #20801 from ChayimFriedman2/fix-insert-use
minor: Small fixes for import insertion
2025-10-10 08:28:42 +00:00
Shoyu Vanilla (Flint)
31ffd29024
Merge pull request #20816 from A4-Tacks/add-ret-ty-adjusted
Fix closure coerced return type for add_return_type
2025-10-10 08:25:25 +00:00
Shoyu Vanilla (Flint)
d8b67b0fb6
Merge pull request #20817 from A4-Tacks/explicit-ty-param-in-let
Fix not applicable on param in let-stmt for add_explicit_type
2025-10-10 08:18:32 +00:00
Chayim Refael Friedman
7ca507dd6f
Merge pull request #20824 from A4-Tacks/empty-closure-analysis
Fix empty closure completion analysis
2025-10-10 07:10:24 +00:00
A4-Tacks
45ca9b5a4c
Fix empty closure completion analysis
Example
---
```rust
fn foo() {
    bar(|| $0);
}
fn bar(f: impl FnOnce() -> u32) {}
```

**Before this PR**:

```
ty: impl FnOnce() -> u32, name: ?
```

**After this PR**:

```
ty: u32, name: ?
```
2025-10-10 12:53:32 +08:00
Laurențiu Nicola
4ed634633c
Merge pull request #20822 from Young-Flash/update_typos_checker
minor: update typos checker version
2025-10-09 13:02:25 +00:00
Young-Flash
56cf2f21cd minor: correct typos 2025-10-09 20:07:24 +08:00
Young-Flash
c0d82ccbe9 minor: update typos checker version 2025-10-09 20:04:39 +08:00
A4-Tacks
9a64aebd61
Fix not applicable on param in let-stmt for add_explicit_type
Example
---
```rust
fn f() {
    let f: fn(i32) = |y$0| {};
}
```

**Before this PR**:

Assist not applicable

**After this PR**:

```rust
fn f() {
    let f: fn(i32) = |y: i32| {};
}
```
2025-10-09 13:23:14 +08:00
A4-Tacks
cd77365714
Fix closure coerced return type for add_return_type
Example
---
```rust
fn foo() {
    let f = ||$0 {loop {}};
    let _: fn() -> i8 = f;
}
```

**Before this PR**:

```rust
fn foo() {
    let f = || -> ! {loop {}};
    let _: fn() -> i8 = f;
}
```

mismatched types error on line 3

**After this PR**:

```rust
fn foo() {
    let f = || -> i8 {loop {}};
    let _: fn() -> i8 = f;
}
```
2025-10-09 11:43:29 +08:00
Chayim Refael Friedman
c7921c6115
Merge pull request #20805 from A4-Tacks/improve-static-const-parse-error
Improve parsing error for `static` and `const`
2025-10-09 03:09:29 +00:00
A4-Tacks
fae6cdf0db
Allow generic_param_list for static items 2025-10-09 09:45:42 +08:00
Chayim Refael Friedman
ad1b9cb19a
Merge pull request #20804 from itsjunetime/run_correct_pgo_r-a
Build rust-analyzer with `--target` for install/pgo xtask
2025-10-08 23:40:31 +00:00
Chayim Refael Friedman
633b1690c5
Merge pull request #20812 from A4-Tacks/comp-trait-self-param
Add self param completions for trait assoc fn
2025-10-08 23:28:22 +00:00
Chayim Refael Friedman
0580059e43
Merge pull request #20785 from ChayimFriedman2/drop-glue
internal: Migrate drop glue handling to new solver
2025-10-08 13:24:17 +00:00
Chayim Refael Friedman
0553ec9752 Migrate drop glue handling to new solver
And:
 - Remove it from being a query (it is only used for hover, where no caching is needed, and MIR evaluation of `needs_drop()`, which is rare).
 - Fix handling of `PhantomData`.
2025-10-08 16:14:22 +03:00
A4-Tacks
e8d57e9672
Add self param completions for trait assoc fn
Example
---
```rust
trait A {
    fn foo(file_id: usize) {}
    fn new($0) {}
}
```

**Before this PR**:

```text
bn file_id: usize
kw mut
kw ref
```

**After this PR**:

```text
bn &mut self
bn &self
bn file_id: usize
bn mut self
bn self
kw mut
kw ref
```
2025-10-08 16:20:10 +08:00
Shoyu Vanilla (Flint)
4494f87960
Merge pull request #20792 from A4-Tacks/minor-fix-make-extract-ty-alias
minor: Fix using `make::ty` for extract_type_alias
2025-10-07 09:31:17 +00:00
Shoyu Vanilla (Flint)
8f312c24f5
Merge pull request #19771 from A4-Tacks/gen-blanket-trait-impl
Add ide-assist: generate blanket trait impl
2025-10-07 08:52:48 +00:00
Lukas Wirth
7e57c42024
Merge pull request #20803 from SomeoneToIgnore/nocapture
Replace `--show-output` task defaults with `--nocapture`
2025-10-07 08:27:08 +00:00
David Barsky
d20dce21ec
Merge pull request #20796 from ChayimFriedman2/bump-salsa
internal: Bump Salsa
2025-10-06 16:23:20 +00:00
Lukas Wirth
4d840b89d0
Merge pull request #20806 from Veykril/veykril/push-syzoqmtxuqyt
feat: Log flycheck stdout and stderr to files
2025-10-06 11:05:13 +00:00
Lukas Wirth
a392656b17 feat: Log flycheck stdout and stderr to files 2025-10-06 12:55:13 +02:00
A4-Tacks
7b9e26ea6c
Improve parsing error for static and const
Example
---
```rust
static C<i32>: u32 = 0;
```
->
```diff
-error 8: missing type for `const` or `static`
+error 8: `static` may not have generic parameters
```

---

```rust
const C = 0;
```
->
```diff
-error 7: missing type for `const` or `static`
+error 7: missing type for `const`
```

---

```rust
static C = 0;
```
->
```diff
-error 8: missing type for `const` or `static`
+error 8: missing type for `static`
```
2025-10-06 12:48:38 +08:00
itsjunetime
4808fd4c98
Build rust-analyzer with specific target for install/pgo xtask 2025-10-05 18:24:19 -05:00
Kirill Bulatov
c4073c5ae3 Replace --show-output with --nocapture
The former does not show any output before the test is finished, which prevents long-running/stuck tests from showing any useful information.
2025-10-05 22:28:00 +03:00
Chayim Refael Friedman
15cb465ad6
Merge pull request #20802 from ChayimFriedman2/regression20662
minor: Add regression test for need-mut diagnostic
2025-10-05 19:06:18 +00:00
Chayim Refael Friedman
c7a6a799f0 Add regression test for need-mut diagnostic 2025-10-05 21:57:22 +03:00
Chayim Refael Friedman
a958b84ea4 Fix merging of import granularity setting with the granularity we infer
Previously it was wrong for some combinations.
2025-10-05 17:47:11 +03:00
Chayim Refael Friedman
c13b87752a Deprecate preserve import granularity option
It didn't do anything (behaved like `item`), as with `enforceGranularity = false` (which is the default), the style of the current file is always preferred, regardless of the setting.

We could make it fail when the setting is `preserve` and the current file's style could not be detected, but that makes little sense.

It is a bit weird that the default is `crate` but `preserve` falls back to `item`, however that was the previous behavior.
2025-10-05 15:19:52 +03:00
Chayim Refael Friedman
6fa86b7a88
Merge pull request #20799 from senekor/senekor/tpoptnlrxzyy
docs: Mention editor-independent configuration
2025-10-05 11:51:30 +00:00
Remo Senekowitsch
a4d51da309
docs: Mention editor-independent configuration 2025-10-05 13:41:28 +02:00
Chayim Refael Friedman
d1ab4e63dd
Merge pull request #20797 from A4-Tacks/fixed-fixme-tuple-field-infer
minor: Remove FIXME for test_tuple_field_inference
2025-10-05 07:49:48 +00:00
A4-Tacks
22c1eb85f8
minor: Remove FIXME for test_tuple_field_inference
This seems to have been fixed
2025-10-05 15:35:30 +08:00
Chayim Refael Friedman
41dd2b69a6 Switch to home-made db attaching infrastructure
Instead of using Salsa's, as we can no longer can a `dyn HirDatabase` from the `dyn salsa::Database` Salsa provides.
2025-10-05 09:55:50 +03:00
Chayim Refael Friedman
995ba5f3b7
Merge pull request #20795 from A4-Tacks/parse-edition-extract-expr-format-str
minor: Fix CURRENT_FIXME for extract_expressions_from_format_string
2025-10-05 06:53:17 +00:00
Chayim Refael Friedman
fcf7795d58
Merge pull request #20793 from A4-Tacks/diag-paren-missing-unsafe
Fix missing parentheses for missing_unsafe
2025-10-05 06:52:31 +00:00
A4-Tacks
c7ed41ebd0
Fix parentheses for missing_unsafe
I seem unable to use `Expr::needs_parens*` to complete it

Example
---
```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    STATIC_MUT$0 * 2
}
```

**Before this PR**:

```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    unsafe { STATIC_MUT } * 2
}
```

**After this PR**:

```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    (unsafe { STATIC_MUT }) * 2
}
```
2025-10-05 14:02:49 +08:00
A4-Tacks
b74760a664
minor: Fix CURRENT_FIXME for extract_expressions_from_format_string 2025-10-05 13:54:07 +08:00
Chayim Refael Friedman
b2dd71918b
Merge pull request #20794 from itsjunetime/dedup_dedup
Deduplicate sort+dedup calls
2025-10-04 18:11:26 +00:00
itsjunetime
c7d00075d9
Deduplicate sort+dedup calls 2025-10-04 13:00:09 -05:00
Chayim Refael Friedman
6ce82d488d
Merge pull request #20777 from itsjunetime/no_panic_analysis_stats
Fix panic when using analysis-stats
2025-10-04 17:39:23 +00:00
itsjunetime
82e2c67452
Move salsa attach to end before call to run_ide_things 2025-10-04 12:30:15 -05:00
David Barsky
3350c27d91 internal: bump salsa to 0.24 2025-10-04 09:47:26 -07:00