Skip to content

rust-analyzer subtree update - #165338

Merged
rust-bors[bot] merged 43 commits into
rust-lang:mainfrom
lnicola:sync-from-ra
Nov 2, 2026
Merged

rust-bors[bot] merged 43 commits into
rust-lang:mainfrom
lnicola:sync-from-ra

Conversation

@lnicola

@lnicola lnicola commented Nov 2, 2026

Copy link
Copy Markdown
Member

Subtree update of rust-analyzer to rust-lang/rust-analyzer@0a0200f.

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

r? @ghost

ChayimFriedman2 and others added 30 commits October 12, 2026 21:29
It saves memory by being only one machine word inline and compact (no extra capacity) outline, while also being even faster if the length is commonly small because linear search is faster for small lengths.

When measuring `analysis-stats`, this saves 40mb on self, 77mb on buck2 and 142mb on omicron. It's also *faster*:  3ginstructions saved on self and buck2, and 30ginstructions on omicron (walltime is too noisy). The memory effect is also likely to appear in IDE scenarios almost as well, because a major part is def maps, and I speculate that unnamed consts also play a role (because the amount of almost-empty expression stores seem too high for real bodies).

Not all maps were changed to use this, only those that measurements show are commonly small. The threshold was at least ~95% of the maps of this kind fitting into the thin schema (that is, have at most 10 elements).

I also switched some `IndexMap`s to `HashMap`s where I believe the order does not matter.
Complete `&val` in `foo(*$0)` -> `*&val` is strange and almost useless

Example
---
```rust
struct S;
fn foo(s: S) {}
fn main() {
    let val = S;
    let valref = &S;
    let valmut = &mut S;
    foo(*$0);
}
```

**Before this PR**

```text
lc valmut &mut S [type+local]
lc valref &S [type+local]
ex valref  [type]
st S S []
st &S [type]
lc val S [local]
lc &val [type+local]
st S S []
```

**After this PR**

```text
lc valmut &mut S [type+local]
lc valref &S [type+local]
ex valref  [type]
st S S []
lc val S [local]
st S S []
```
Previously we errored when computing diagnostics on Rust
programs that contain unresolved projection types. This occurred in
LSP sessions even if users hadn't enabled term search features.

In term search, `LookupTable::find()` checks each type using
`could_unify_with_deeply()` as an equality predicate.

However, `LookupTable::insert()` calls `ty.instantiate_with_errors()`,
and deep unification uses a fresh type variable for each `{error}`
type. We end up trying to unify `<?0 as Tr>::A` with `<?1 as Tr>::A`
and we don't manage to find the type that we previously inserted.

Instead, look for the exact value in the lookup table first, and only
iterate the types with `could_unify_with_deeply()` afterwards.

Without this, we hit the `.expect("Expr not in lookup")` in
`term_search::tactics::struct_projection()`.

AI disclosure: Code partly written by GPT-5.6 Sol, commit message and
review by me. No rustc citation because AFAIK there's no term search
in rustc.
…ction-lookup-panic

fix: Panic `Expr not in lookup` due to projection types
Because we're going to also add `IdentKind::ForcedKeyword`.

And also rename `Ident::is_raw` to `Ident::kind`.
Except in the proc macro server serialization code, since that code is not in a good shape yet.
..and get the error ty from `default_types` instead.
internal: remove `InferenceResult.error_ty`
Update generated lints and target features
fix: no suggest reference after dereferences
The code comes from rustc, and there, the FIXME was referring to the
removal of `ExtractIf` in favor of `.extract_if()` -- rustc has
removed the FIXME after switching to `.extract_if()`[^1]. But it looks
like r-a has been using the correct API from the start, which makes this
FIXME moot.

[^1]: rust-lang@39f7cdb
…-lexer

feat: Upgrade rustc_lexer and handle forced keywords (`k#`)
Update generated lints and target features
This updates the rust-version file to 92ffebe.
Lex and parse emoji in lifetimes, and disallow them in the parser with a hard error. Allow emoji to start a lifetime name even if they are not XID_Start.

```
error: lifetimes cannot contain emoji
  --> $DIR/emoji-in-lifetime.rs:1:22
   |
LL | fn bad_lifetime_name<'🐛🐛🐛family👨👩👧👦>(
   |                      ^^^^^^^^^^^^^^^^^^^^^
```

Unify lifetime and identifier parsing. Use `bad_unicode_identifiers` for lifetimes.
bit-aloo and others added 13 commits November 1, 2026 14:56
internal: Use macOS 15 runners and bump deployment target
Synced from r-l/r plus another test.
fix: Fix lowering of `yield` in `async gen`
perf: Provide `ThinMap`, a map that uses `ThinVec` when the length is small
minor: Pin `unicode-{ident, properties}` crates to fix autopublish workflow
This updates the rust-version file to 4c46afa.
@rustbot

rustbot commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Nov 2, 2026
@lnicola

lnicola commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit db4785a has been tentatively approved by lnicola

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 2, 2026
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@0a0200f.

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

r? @ghost
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup of 15 pull requests

Successful merges:

 - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`)
 - #165331 (miri subtree update)
 - #165211 (Streamline function_item_references lint)
 - #165273 (Add some docs for our allocator `unstable_feature_bound`s)
 - #165279 (explicitly test the win32 symbol byte count suffix)
 - #162688 (Fix invalid suggestions and misleading notes for imports)
 - #165198 (expand the docs of `Complex<T>`)
 - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`)
 - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len})
 - #165284 (Ensure the display impl of uXX is small with optimize_for_size)
 - #165287 (Add example of implementing Allocator to its docs)
 - #165297 (Cleanup `rustdoc-html` tests)
 - #165298 (Improve diagnostics for notable-trait color arguments)
 - #165336 (Refactor `analyze_attr` to use a match)
 - #165338 (`rust-analyzer` subtree update)
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup of 15 pull requests

Successful merges:

 - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`)
 - #165331 (miri subtree update)
 - #165211 (Streamline function_item_references lint)
 - #165273 (Add some docs for our allocator `unstable_feature_bound`s)
 - #165279 (explicitly test the win32 symbol byte count suffix)
 - #162688 (Fix invalid suggestions and misleading notes for imports)
 - #165198 (expand the docs of `Complex<T>`)
 - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`)
 - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len})
 - #165284 (Ensure the display impl of uXX is small with optimize_for_size)
 - #165287 (Add example of implementing Allocator to its docs)
 - #165297 (Cleanup `rustdoc-html` tests)
 - #165298 (Improve diagnostics for notable-trait color arguments)
 - #165336 (Refactor `analyze_attr` to use a match)
 - #165338 (`rust-analyzer` subtree update)
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`)
 - #165211 (Streamline function_item_references lint)
 - #165273 (Add some docs for our allocator `unstable_feature_bound`s)
 - #165279 (explicitly test the win32 symbol byte count suffix)
 - #162688 (Fix invalid suggestions and misleading notes for imports)
 - #165198 (expand the docs of `Complex<T>`)
 - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`)
 - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len})
 - #165284 (Ensure the display impl of uXX is small with optimize_for_size)
 - #165287 (Add example of implementing Allocator to its docs)
 - #165297 (Cleanup `rustdoc-html` tests)
 - #165298 (Improve diagnostics for notable-trait color arguments)
 - #165336 (Refactor `analyze_attr` to use a match)
 - #165338 (`rust-analyzer` subtree update)
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup merge of #165338 - lnicola:sync-from-ra, r=lnicola

`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@0a0200f.

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

r? @ghost
@rust-bors
rust-bors Bot merged commit 837a0ff into rust-lang:main Nov 2, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.