Commit graph

302927 commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
daeb54057f
Merge pull request #20520 from ChayimFriedman2/reborrow
feat: Add an option to remove reborrows from adjustment inlay hints
2025-08-26 05:48:34 +00:00
Shoyu Vanilla (Flint)
05a61993a2
Merge pull request #20537 from ChayimFriedman2/new-solver-normalize
fix: Normalize all types when finishing inference
2025-08-26 05:31:07 +00:00
Chayim Refael Friedman
69c25d1fec
Merge pull request #20423 from ShoyuVanilla/import-2024
Make import sorting order follow 2024 edition style
2025-08-25 19:19:31 +00:00
Chayim Refael Friedman
769f164179
Merge pull request #20528 from ShoyuVanilla/nightly-zscript
fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`
2025-08-25 19:12:47 +00:00
Chayim Refael Friedman
4b5bb18c57 Don't map Chalk's Normalize to next solver's NormalizesTo
`NormalizesTo` is a private predicate that should not be used outside the solver. For normalization, rustc uses `AliasRelate`, so replace with that.
2025-08-25 20:56:45 +03:00
Chayim Refael Friedman
aa49c0b8bb Normalize all types when finishing inference
The new solver does not eagerly normalize, but things after inference expect types to be normalized. rustc does the same.

Also, I'm afraid other things in r-a don't expect results of the solver to be unnormalized. We'll need to handle that.
2025-08-25 20:23:18 +03:00
Shoyu Vanilla (Flint)
781e0268ee
Merge pull request #20529 from emmanuel-ferdman/master
Fix rust-analyzer-contributors reference
2025-08-24 15:23:18 +00:00
Emmanuel Ferdman
ca42d0775a
Fix rust-analyzer-contributors reference
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-08-24 08:04:00 -07:00
Shoyu Vanilla
5ddf6846d5 fix: Masquerade as nightly cargo when invoking flycheck with -Zscript 2025-08-24 23:17:23 +09:00
Shoyu Vanilla (Flint)
80f4a79023
Merge pull request #20523 from ChayimFriedman2/opaque-generics
fix: Fix opaque generics
2025-08-24 06:59:38 +00:00
Chayim Refael Friedman
31245cabec Fix opaque generics
The parent generics were incorrectly not considered for TAIT.

I'm not convinced we should follow rustc here, also there are items (opaques) with more than 1 parent (opaque -> fn/type alias -> impl/trait) and I'm not sure we properly account for that in all places, but for now I left it as-is.

Also fix a bug where lifetimes' indices were incorrect when there is a self param (they started from 0 instead of 1).
2025-08-24 08:49:40 +03:00
Chayim Refael Friedman
d50f0c72f9
Merge pull request #20507 from A4-Tacks/suggest-return-expr
Add ReturnExpr completion suggest
2025-08-24 00:46:49 +00:00
A4-Tacks
c92af4d232
Add ReturnExpr completion suggest 2025-08-24 08:26:25 +08:00
Chayim Refael Friedman
6de4860541
Merge pull request #20512 from A4-Tacks/arith-op-not-on-selected
replace_arith_op not applicable on selected
2025-08-24 00:17:09 +00:00
A4-Tacks
5e81912dae
replace_arith_op not applicable on selected 2025-08-24 07:57:50 +08:00
Chayim Refael Friedman
4715c6d41a Add an option to remove reborrows from adjustment inlay hints
Reborrows are consecutive deref then ref. Make it the default because reborrows are mostly useless to the programmer.

Also rename `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "reborrow"` to `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "borrows"`, as it's not about reborrows but about any ref/deref and it's confusing with the new setting.
2025-08-24 02:26:37 +03:00
Chayim Refael Friedman
086eeb0fb7
Merge pull request #20513 from A4-Tacks/let-in-let-chain
Add let in let-chain completion support
2025-08-23 22:17:27 +00:00
Chayim Refael Friedman
4b077a9f49
Merge pull request #20518 from A4-Tacks/fix-else-in-in-let
Fix `else` completion in `let _ = if x {} $0`
2025-08-23 22:07:13 +00:00
Chayim Refael Friedman
a9973f6398
Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selected
convert_integer_literal not on selected
2025-08-23 22:03:17 +00:00
A4-Tacks
183fbdc89b
Fix else completion in let _ = if x {} $0 2025-08-23 17:48:30 +08:00
A4-Tacks
c9fbcdcfcd
Add let in let-chain completion support
Example
---
```rust
fn f() {
    if true && $0 {}
}
```
->
```rust
fn f() {
    if true && let $1 = $0 {}
}
```
2025-08-22 21:58:49 +08:00
A4-Tacks
3868f8ad5c
fix: convert_integer_literal not on selected
`convert_integer_literal` can only convert the first literal,
it is not reasonable to apply it when selected

Example
---

```rust
fn main() {
    $01+1$0;
}
```

**Assist old outputs**:

```
Convert 1 to 0b1
Convert 1 to 0o1
Convert 1 to 0x1
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```

**Assist this PR outputs**:

```
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```
2025-08-22 17:13:30 +08:00
Shoyu Vanilla (Flint)
cf358c09ce
Merge pull request #20506 from Veykril/veykril/push-xlytslrrylzq
Fix panic in syntax_highlighting
2025-08-22 08:14:02 +00:00
Lukas Wirth
cf478a02c7 Fix panic in syntax_highlighting 2025-08-22 09:00:25 +02:00
Chayim Refael Friedman
e90138632d
Merge pull request #20504 from ShoyuVanilla/ethereum-madness
fix: Infinite recursion while lowering assoc type bounds from supertraits
2025-08-21 20:45:29 +00:00
Shoyu Vanilla
99576aa3f7 fix: Infinite recursion while lowering assoc type bounds from supertraits 2025-08-22 05:24:33 +09:00
Chayim Refael Friedman
d51554749d
Merge pull request #20502 from ChayimFriedman2/attach-db-3
Remove unnecessary `salsa::attach()` calls
2025-08-21 20:03:59 +00:00
Chayim Refael Friedman
b5e3230f8f Remove unnecessary salsa::attach() calls 2025-08-21 22:40:58 +03:00
Chayim Refael Friedman
fa7659d572
Merge pull request #20497 from ChayimFriedman2/symbols-attach2
Attach the DB when mapping the result of `world_symbols()`
2025-08-21 05:25:40 +00:00
Chayim Refael Friedman
73d1aa9e82 Attach the DB when mapping the result of world_symbols()
We call `try_to_nav()` there.
2025-08-21 08:06:43 +03:00
Chayim Refael Friedman
ff2b1868b9
Merge pull request #20496 from ChayimFriedman2/symbols-attach
Attach the DB in symbol queries
2025-08-21 04:34:26 +00:00
Chayim Refael Friedman
4a9b73bc98 Attach the DB in symbol queries 2025-08-21 07:14:55 +03:00
Laurențiu Nicola
d8b4700b8b
Merge pull request #20483 from lumiscosity/optimize-icon
Optimize editor plugin icon
2025-08-20 04:07:10 +00:00
lumiscosity
3141739bad Optimize icon
Losslessly optimizes the icon with:

```
oxipng -o max -a -s
oxipng -o max --zopfli -a -s
```
2025-08-19 11:41:58 +02:00
Shoyu Vanilla (Flint)
51524e0900
Merge pull request #20447 from lcnr/typing-mode
user facing code should use not use `PostAnalysis`
2025-08-19 06:53:17 +00:00
lcnr
8eaa4ad7a4 user facing code should use not use PostAnalysis 2025-08-19 08:24:34 +02:00
Lukas Wirth
2ffa02265a
Merge pull request #20470 from rust-lang/veykril/push-wppxsntzqtou
Auto-attach database in `Analysis` calls
2025-08-18 08:14:07 +00:00
Lukas Wirth
b9d225b6d8 Auto-attach database in Analysis calls 2025-08-18 09:52:23 +02:00
Shoyu Vanilla (Flint)
af8988cd96
Merge pull request #20442 from ChayimFriedman2/unqualify
fix: Only import the item in "Unqualify method call" if needed
2025-08-18 06:24:35 +00:00
Shoyu Vanilla (Flint)
37a352d3ec
Merge pull request #20454 from jackh726/next-trait-solver-next
Convert some things from chalk_ir types to rustc_type_ir types
2025-08-17 16:23:17 +00:00
jackh726
3486a2c3e7 Remove fixme comment 2025-08-17 16:04:50 +00:00
jackh726
058a398f9f Add FIXME in named_associated_type_shorthand_candidates 2025-08-17 16:04:50 +00:00
jackh726
3e41e85b27 Add fixme to associated_ty_item_bounds 2025-08-17 16:04:50 +00:00
jackh726
0e2b63cd87 Update fixme 2025-08-17 16:04:50 +00:00
jackh726
5c89346171 Add new_empty_tuple 2025-08-17 16:04:50 +00:00
jackh726
e5d320fd6c Remove a bunch of stuff from chalk_db 2025-08-17 16:04:50 +00:00
jackh726
49f166029f Use impl_trait_ns in Impl::trait_ref 2025-08-17 16:04:50 +00:00
jackh726
05bc1818da Switch TraitRef in hir::TraitRef to next solver 2025-08-17 16:04:50 +00:00
jackh726
f92ca612a8 Replace layout_of_ty with layout_of_ty_ns 2025-08-17 16:04:50 +00:00
jackh726
00856fc250 Remove all_super_traits in dyn_compatibility 2025-08-17 16:04:50 +00:00