Commit Graph

323389 Commits

Author SHA1 Message Date
dependabot[bot] e933b8d123 Bump thin-vec from 0.2.14 to 0.2.16
Bumps [thin-vec](https://github.com/mozilla/thin-vec) from 0.2.14 to 0.2.16.
- [Changelog](https://github.com/mozilla/thin-vec/blob/main/RELEASES.md)
- [Commits](https://github.com/mozilla/thin-vec/compare/v0.2.14...v0.2.16)

---
updated-dependencies:
- dependency-name: thin-vec
  dependency-version: 0.2.16
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-15 19:26:41 +00:00
Chayim Refael Friedman 9bf0d062c6 Merge pull request #22049 from Shourya742/2026-04-15-move-syntax-factory-inside-syntax-editor
Move syntax factory inside syntax editor
2026-04-15 19:09:18 +00:00
bit-aloo 4445220800 Adapt changes to assist so that we no longer use mutable editor 2026-04-16 00:17:47 +05:30
bit-aloo 567d676388 introduce interior mutability to SyntaxEditor to let go of &mut usage 2026-04-16 00:04:49 +05:30
Chayim Refael Friedman 491e8453b1 Merge pull request #22048 from ChayimFriedman2/upgrade-rustc
internal: Upgrade rustc crates
2026-04-15 14:07:49 +00:00
Chayim Refael Friedman 9a32199f92 Separate between normal evaluated consts and type-system consts
Type system consts (consts that participate in the type system, e.g. const generic params) have special properties: they must have strict equality independent of the user. For example, unions are not possible there. Therefore they are stored as a `ValTree`, a very simple representation that is good, mostly, for comparing things.

General consts can be anything (almost) - arbitrary bytes, even uninit bytes. They are stored like all consts previously were (in the type-system's `Const`), with bytes memory, in a new type called `Allocation` (named borrowed from rustc, although it isn't exactly accurate because in r-a it can represent multiple allocations).

The trigger for this change was a new requirement from rustc_type_ir, that type-system `Const` will be able to represent as a `ValTree`.
2026-04-15 16:57:38 +03:00
Chayim Refael Friedman 982643abd9 Update solver types as required by the upgrade 2026-04-15 16:45:29 +03:00
Chayim Refael Friedman c9440c593d Add support for scalable vectors repr
As it is now supported by rustc_abi.
2026-04-15 16:43:03 +03:00
Chayim Refael Friedman ddc5e11770 Upgrade rustc crates 2026-04-15 16:43:03 +03:00
Lukas Wirth 722296ffd6 Merge pull request #22044 from ChayimFriedman2/internal-features
feat: Do not complete unstable items that use an internal feature
2026-04-15 13:42:25 +00:00
Lukas Wirth 53b20e4965 Merge pull request #22032 from ChayimFriedman2/assoc-types-yet-again
fix: Allow ambiguity in assoc type shorthand if they resolve to the same assoc type, between supertraits this time
2026-04-15 13:39:11 +00:00
Lukas Wirth 99ec949f5e Merge pull request #22046 from yPin9/2026-04-15-parse-type-const
parse `type const` items
2026-04-15 13:38:39 +00:00
Chayim Refael Friedman 067f4c6ce2 Merge pull request #22050 from ChayimFriedman2/make-asyncs-closures
internal: Represent lowered coroutines with closures
2026-04-15 13:15:08 +00:00
Chayim Refael Friedman 6f703399c9 Represent lowered coroutines with closures
This is how rustc does it, because they're similar in many ways, and most importantly: they share (or will share, not yet) capture analysis.

Also:
 - Copy closure inference from rustc again, this time really precisely.
 - Have separate ID types for coroutine closures and normal closures, for better type safety.
 - Validate, when constructing interned closures/coroutines/coroutine closures and `cfg(debug_assertions)`, that the `ExprId` is of an expr of the correct kind.
2026-04-15 16:05:03 +03:00
bit-aloo 15b3b408fd Remove all occurance of explicit SyntaxFactory::with_mapping, and update all the occurances to use make via SyntaxEditor 2026-04-15 12:16:30 +05:30
bit-aloo a6f0e7872a fix constructor mapping which were incorrect 2026-04-15 12:13:45 +05:30
bit-aloo 6615cd9679 move SyntaxFactory inside SyntaxEditor 2026-04-15 12:12:31 +05:30
ypp e95ac9eb1f parse type const items
Adds parser support for the unstable `type const` syntax from the
`min_generic_const_args` feature, e.g. `type const FOO: i32 = 2;`.

Closes rust-lang/rust-analyzer#22038.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 00:18:51 +08:00
Chayim Refael Friedman 3347cb8b4c Do not complete unstable items that use an internal feature
Unless the feature is enabled (and we're on nightly).

We can choose to not complete any unstable item if its feature is not enabled. However people may first type the thing then insert the feature. Only doing that for internal features is a good middle ground: normal people don't want their completion list polluted by `std::intrinsics` (even if they use nightly), and std people still get their completion if the feature is enabled (and realistically, it will be).
2026-04-14 17:23:42 +03:00
Chayim Refael Friedman 41b0052872 Merge pull request #22042 from Shourya742/2026-04-14-replace-make-with-syntaxFactory
Replace make with syntax factory in expand_glob_import
2026-04-14 13:33:26 +00:00
bit-aloo 7a56ebd961 replace make with syntax_factory definitions 2026-04-14 18:53:16 +05:30
bit-aloo 862febff7b add use tree list method to syntaxFactory constructor 2026-04-14 18:52:42 +05:30
Chayim Refael Friedman 6d6b7d0e8c Merge pull request #22036 from Shourya742/2026-04-14-remove-set-path
Replace set path usage with set_path_with_editor
2026-04-14 13:20:26 +00:00
Chayim Refael Friedman 15e4438c8b Merge pull request #21487 from A4-Tacks/extract-var-in-macro
feat: Support extract variable in macro call
2026-04-14 13:12:24 +00:00
bit-aloo e32773b39c rename set_path_with_editor to set_path 2026-04-14 18:38:36 +05:30
bit-aloo 9919b15988 migrate destructure_tuple_binding and convert_let_else_to_match to use set_pat_with_editor 2026-04-14 18:38:36 +05:30
bit-aloo 533f183e0f remove set_pat from edit_in_place and move set_pat_with_editor in edit 2026-04-14 18:38:35 +05:30
Chayim Refael Friedman edc1212a78 Merge pull request #22037 from Shourya742/2026-04-14-remove-set-visibility
Remove set visibility method
2026-04-14 12:57:45 +00:00
Chayim Refael Friedman 0d2aff0f19 Merge pull request #22039 from Shourya742/2026-04-14-replace-make-with-syntaxFactory-in-generate-blanket-trait-impl
Replace make with syntax factory in generate blanket trait impl
2026-04-14 12:54:23 +00:00
Chayim Refael Friedman e89525568c Merge pull request #22041 from Shourya742/2026-04-14-remove-generic-params-owner-edit
Remove generic params owner edit
2026-04-14 12:53:02 +00:00
A4-Tacks f74767b8d2 Add some fixme comments 2026-04-14 18:34:50 +08:00
A4-Tacks c6b54969ef Support extract variable in macro call
Implement based first and last token mappings

Example
---
```rust
macro_rules! foo {
    (= $($t:tt)*) => { $($t)* };
}

fn main() {
    let x = foo!(= $02 + 3$0 + 4);
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
macro_rules! foo {
    (= $($t:tt)*) => { $($t)* };
}

fn main() {
    let $0var_name = 2+3;
    let x = foo!(= var_name + 4);
}
```
2026-04-14 18:06:42 +08:00
bit-aloo b1034b0361 update derive_macro 2026-04-14 15:02:32 +05:30
bit-aloo 4958d7703c remove generic params owner edit trait 2026-04-14 14:56:56 +05:30
bit-aloo 6c84b2b178 migrate generate blanket trait impl from make to SyntaxFactory 2026-04-14 14:13:01 +05:30
bit-aloo 42c6a7b269 add type_bound_text in constructor 2026-04-14 14:11:53 +05:30
bit-aloo d5146d345e remove set visibility method of HasVisibility 2026-04-14 13:31:41 +05:30
Chayim Refael Friedman 0f4f33b1d4 Allow ambiguity in assoc type shorthand if they resolve to the same assoc type, between supertraits this time 2026-04-14 07:00:36 +03:00
Chayim Refael Friedman 9d0eb3f9eb Merge pull request #22035 from ChayimFriedman2/hangy-test
minor: Ignore a hangy test
2026-04-14 03:48:13 +00:00
Chayim Refael Friedman 69716009f7 Ignore a hangy test 2026-04-14 06:37:50 +03:00
Chayim Refael Friedman 7bfecf641c Merge pull request #22033 from ChayimFriedman2/simplification
minor: Minor simplification
2026-04-14 01:11:37 +00:00
Chayim Refael Friedman 2fc3961758 Minor simplification 2026-04-14 02:40:51 +03:00
Chayim Refael Friedman 164395b08d Merge pull request #21835 from mehmet-ylcnky/feat/raw-ptr-mutability-api
feat: add is_mutable_raw_ptr and as_raw_ptr to hir::Type
2026-04-13 21:25:21 +00:00
mehmet-yalcinkaya_volvo 536ce324d0 feat: add is_mutable_raw_ptr and as_raw_ptr to hir::Type 2026-04-14 00:16:21 +03:00
A4-Tacks 3536b19027 Merge pull request #21999 from A4-Tacks/refmatch-kwdprefix-quickfix
fix: Fix ref_match position when keyword prefix
2026-04-13 19:01:48 +00:00
A4-Tacks 063763fb49 fix: Fix ref_match position when keyword prefix
This is a quick fix, please review if there is a regression

Example
---
```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in$0)
}
```

**Before this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in&dent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@67",
..
```

**After this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(&indent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@65",
..
```
2026-04-14 02:52:10 +08:00
Chayim Refael Friedman 2b6088bea2 Merge pull request #22019 from rust-lang/ci/gen-lints
Update generated lints
2026-04-13 18:27:53 +00:00
Chayim Refael Friedman 51f8800ae1 Merge pull request #22018 from A4-Tacks/vsc-suggest-string
fix: enable vscode suggest in strings
2026-04-13 18:27:21 +00:00
A4-Tacks a91c488cf2 Merge pull request #22003 from Amit5601/fix/hidden-enum-clean
fix: complete variants of hidden enums through public aliases
2026-04-13 18:25:28 +00:00
Chayim Refael Friedman 5b573d889e Merge pull request #22030 from Wilfred/pre-mir-relocation-test
fix: MIR evaluation of sized &T with recursive const fn
2026-04-13 18:00:12 +00:00