Commit graph

23166 commits

Author SHA1 Message Date
Chayim Refael Friedman
c6ef51e550 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
David Barsky
a7234f8b3a internal: bump salsa to 0.24 2025-10-04 09:47:26 -07:00
Chayim Refael Friedman
797ba9c7cb Fix erroneous diagnostic incorrect_generics_len when there are generics on enum variant used through type alias 2025-10-03 06:54:32 +03:00
Shoyu Vanilla (Flint)
465fea70c0
Merge pull request #20720 from ChayimFriedman2/no-rustup-auto-install
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Prevent rustup from automatically installing toolchains
2025-10-02 05:15:45 +00:00
Laurențiu Nicola
9d347b0cc7
Merge pull request #20779 from rust-lang/rustc-pull
minor: Rustc pull update
2025-10-02 04:25:20 +00:00
Laurențiu Nicola
436fb5ca54 Format code 2025-10-02 07:16:40 +03:00
Laurențiu Nicola
d9cdc03c05
Merge pull request #20778 from itsjunetime/clippy_fixes
Fix small things clippy was complaining about
2025-10-02 04:10:00 +00:00
The rustc-josh-sync Cronjob Bot
ab424b7205 Merge ref '3369e82c6bc0' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 3369e82c6bc03c5cdb66f730dba6f738b74c8e1d
Filtered ref: abf6c425d3
Upstream diff: f957826bff...3369e82c6b

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-02 04:07:04 +00:00
itsjunetime
8e350c5f27
Get rid of unfulfilled expectation 2025-10-01 23:00:16 -05:00
itsjunetime
3a6e472975
Fix two small things clippy was complaining about 2025-10-01 22:41:01 -05:00
Shoyu Vanilla (Flint)
3706595ad2
Merge pull request #20770 from ChayimFriedman2/unsafe-impl-unresolved
fix: Ignore impl trait safety errors when the trait is unresolved
2025-10-02 03:29:55 +00:00
bors
abf6c425d3 Auto merge of #147210 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to a6bc4a4bbe.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-01 21:58:22 +00:00
Chayim Refael Friedman
3f6d9e293a
Merge pull request #20765 from ChayimFriedman2/infer-ns-types
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
internal: Migrate inference to next solver
2025-10-01 13:19:00 +00:00
Chayim Refael Friedman
428405da33 Prevent rustup from automatically installing toolchains
By setting RUSTUP_AUTO_INSTALL=0.
2025-09-30 19:02:10 +03:00
Chayim Refael Friedman
572e703df0 Ignore impl trait safety errors when the trait is unresolved 2025-09-30 18:48:54 +03:00
Chayim Refael Friedman
6e04e82ff0 Add regression test for another (long-standing) bug fixed by the new solver 2025-09-30 18:07:27 +03:00
Chayim Refael Friedman
e3287fc878 Impl std::error::Error for SyntaxError 2025-09-30 15:40:54 +03:00
Chayim Refael Friedman
d1288f6353 Migrate inference to next solver 2025-09-30 13:10:59 +03:00
Shoyu Vanilla (Flint)
2b2d9d8f88
Merge pull request #20745 from Oblarg/fix-negative-int-literals-in-macro-by-example
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix negative integer literals in const generics in declarative macro context
2025-09-30 05:06:47 +00:00
Oblarg
b8852fdbb3 move test per review feedback 2025-09-29 11:18:49 -04:00
Shoyu Vanilla (Flint)
062ac7a545
Merge pull request #20760 from A4-Tacks/all-any-not-attr-comp
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Add `all` `any` and `not` attribute completions
2025-09-29 08:33:17 +00:00
The rustc-josh-sync Cronjob Bot
253554e554 Merge ref 'f957826bff7a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f957826bff7a68b267ce75b1ea56352aed0cca0a
Filtered ref: 7291893f9d
Upstream diff: caccb4d036...f957826bff

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-29 04:07:50 +00:00
Jubilee Young
a805c9b464 remove explicit deref of AbiAlign for most methods
Much of the compiler calls functions on Align projected from AbiAlign.
AbiAlign impls Deref to its inner Align, so we can simplify these away.
Also, it will minimize disruption when AbiAlign is removed.

For now, preserve usages that might resolve to PartialOrd or PartialEq,
as those have odd inference.
2025-09-28 15:02:14 -07:00
Lukas Wirth
5c0b555a65
Merge pull request #19867 from Kivooeo/unsafegate
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Allow `&raw [mut | const]` for union field
2025-09-28 11:54:24 +00:00
A4-Tacks
6bb1b88677
Add all any and not attribute completions
Example
---
`#[cfg($0)]` -> `#[cfg(any($0))]`
2025-09-28 08:42:18 +08:00
Shoyu Vanilla (Flint)
a56e57752f
Merge pull request #20748 from A4-Tacks/migrate-arith-op-prec
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate `replace_arith_op` assist to use `SyntaxEditor`
2025-09-26 09:05:59 +00:00
Shoyu Vanilla (Flint)
62809824ad
Merge pull request #20599 from A4-Tacks/bang-de-morgan
Add applicable on bang `!` for apply_demorgan
2025-09-26 08:58:07 +00:00
A4-Tacks
918d3b8175
Migrate replace_arith_op assist to use SyntaxEditor 2025-09-26 16:54:47 +08:00
Shoyu Vanilla (Flint)
6135c07683
Merge pull request #20611 from A4-Tacks/replace-arith-op-prec
Fix precedence parenthesis for replace_arith_op
2025-09-26 08:30:46 +00:00
Shoyu Vanilla (Flint)
084c1e537d
Merge pull request #20604 from A4-Tacks/cfg-attr-comp
Add cfg_attr predicate completion
2025-09-26 08:10:25 +00:00
Shoyu Vanilla (Flint)
a55e2b578c
Merge pull request #20729 from A4-Tacks/const-param-kwd
Add const parameter keyword completion
2025-09-26 07:00:52 +00:00
Shoyu Vanilla (Flint)
e81202c919
Merge pull request #20731 from A4-Tacks/expand-rest-pat-in-tuple-slice-pat
Fix expand rest pattern in tuple and slice pattern
2025-09-26 06:54:30 +00:00
A4-Tacks
6d85fd739f
Fix expand rest pattern in tuple and slice pattern
Assist: expand_tuple_rest_pattern

Fills fields by replacing rest pattern in tuple patterns.

Example
---
```
fn foo(bar: (char, i32, i32)) {
    let (ch, ..$0) = bar;
}
```
->
```
fn foo(bar: (char, i32, i32)) {
    let (ch, _1, _2) = bar;
}
```

---

Assist: expand_slice_rest_pattern

Fills fields by replacing rest pattern in slice patterns.

Example
---
```
fn foo(bar: [i32; 3]) {
    let [first, ..$0] = bar;
}
```
->
```
fn foo(bar: [i32; 3]) {
    let [first, _1, _2] = bar;
}
```
2025-09-26 14:44:05 +08:00
Shoyu Vanilla (Flint)
997f3ec544
Merge pull request #20598 from A4-Tacks/let-chain-sup-conv-to-guarded-ret
Add let-chain support for convert_to_guarded_return
2025-09-26 06:42:10 +00:00
Shoyu Vanilla (Flint)
a96d92e9e9
Merge pull request #20736 from A4-Tacks/fix-invert-if-let-chain
Fix applicable on if-let-chain for invert_if
2025-09-26 05:36:52 +00:00
Shoyu Vanilla (Flint)
750d566106
Merge pull request #20742 from A4-Tacks/unused-raw-var
Fix fixes for unused raw variables
2025-09-26 05:25:09 +00:00
Oblarg
03aabd4633 fix transcriber error in declarative macros for negative integer literal const generic params 2025-09-25 17:03:46 -04:00
Vadim Petrochenkov
26a9dacc14 resolve: Do not finalize shadowed bindings
I.e. do not mark them as used, or non-speculative loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-25 20:36:14 +03:00
A4-Tacks
3964af7bf6
Add applicable in closure for convert_to_guarded_return
Example
---
```rust
fn main() {
    let _f = || {
        bar();
        if$0 true {
            foo();

            // comment
            bar();
        }
    }
}
```
->
```rust
fn main() {
    let _f = || {
        bar();
        if false {
            return;
        }
        foo();

        // comment
        bar();
    }
}
```
2025-09-25 22:04:53 +08:00
A4-Tacks
4e3b6b38dd
Fix not applicable for if-expr in let-stmt
Example
---
```rust
fn main() {
    let _x = loop {
        if$0 let Ok(x) = Err(92) {
            foo(x);
        }
    };
}
```

**Before**:

Assist not applicable

**After**:

```rust
fn main() {
    let _x = loop {
        let Ok(x) = Err(92) else { continue };
        foo(x);
    };
}
```
2025-09-25 22:00:56 +08:00
A4-Tacks
a98da9f795
Add let-chain support for convert_to_guarded_return
- And add early expression `None` in function `Option` return

Example
---
```rust
fn main() {
    if$0 let Ok(x) = Err(92)
        && x < 30
        && let Some(y) = Some(8)
    {
        foo(x, y);
    }
}
```
->
```rust
fn main() {
    let Ok(x) = Err(92) else { return };
    if x >= 30 {
        return;
    }
    let Some(y) = Some(8) else { return };
    foo(x, y);
}
```
2025-09-25 21:04:48 +08:00
A4-Tacks
4353624cc0
Fix fixes for unused raw variables
Example
---
```
fn main() {
    let $0r#type = 2;
}
```

**Before this PR**:

```rust
fn main() {
    let _r#type = 2;
}
```

**After this PR**:

```rust
fn main() {
    let _type = 2;
}
```
2025-09-25 19:58:45 +08:00
Shoyu Vanilla (Flint)
84e87d5bba
Merge pull request #20738 from jackh726/next-trait-solver-next4
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Remove non-ns version of impl_self_ty and impl_trait
2025-09-25 10:30:54 +00:00
Shoyu Vanilla (Flint)
7ae5f2df12
Merge pull request #20735 from itsjunetime/fix_scip_salsa
fix SCIP panicking due to salsa not attaching
2025-09-25 10:30:12 +00:00
The rustc-josh-sync Cronjob Bot
f69f3a6e01 Merge ref 'caccb4d0368b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: caccb4d0368bd918ef6668af8e13834d07040417
Filtered ref: 0f345ed05d
Upstream diff: 21a19c297d...caccb4d036

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-25 04:16:26 +00:00
itsjunetime
01b2eff275
fix SCIP panicking due to salsa not attaching 2025-09-24 18:47:36 -05:00
Chayim Refael Friedman
6b133c6b1b Implement fallback properly
fallback.rs was ported straight from rustc (minus the lint parts).

This fixes the `!` regressions.
2025-09-24 20:42:06 +03:00
Chayim Refael Friedman
993db83afd
Merge pull request #20683 from regexident/inference-result-types-iter
Expose iterators over an inference result's types
2025-09-24 17:12:33 +00:00
Shoyu Vanilla
fbfb2617ad Switch next-solver related rustc dependencies of r-a to crates.io ones 2025-09-24 21:28:50 +09:00
A4-Tacks
39ef6c28eb
Fix applicable on if-let-chain for invert_if
Example
---
```rust
fn f() { i$0f x && let Some(_) = Some(1) { 1 } else { 0 } }
```

**Before this PR**:

```rust
fn f() { if !(x && let Some(_) = Some(1)) { 0 } else { 1 } }
```

**After this PR**:

Assist not applicable
2025-09-24 14:36:09 +08:00