about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/hir-def
AgeCommit message (Collapse)AuthorLines
2025-09-24Switch next-solver related rustc dependencies of r-a to crates.io onesShoyu Vanilla-4/+0
2025-09-18Merge pull request #20664 from ChayimFriedman2/coerce-nsChayim Refael Friedman-0/+19
fix: Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
2025-09-16Merge pull request #20517 from Veykril/veykril/push-wrurmtqppzusLukas Wirth-5/+5
fix: Only compute unstable paths on nightly toolchains for IDE features
2025-09-16fix: Only compute unstable paths on nightly toolchains for IDE featuresLukas Wirth-5/+5
2025-09-15Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnosticsChayim Refael Friedman-0/+19
This started from porting coercion, but ended with porting much more.
2025-09-11Merge pull request #20642 from ChayimFriedman2/wasm-safeShoyu Vanilla (Flint)-1/+1
fix: Make `#[target_feature]` always safe on WASM
2025-09-10Adopt even more custom types in the new solverChayim Refael Friedman-0/+13
A lot of simplification and fun.
2025-09-09Expand target info to include the architectureChayim Refael Friedman-1/+1
And make it easier to expand it more in the future, if needed.
2025-09-08Remove support for register_attrWilfred Hughes-22/+2
This was removed in rustc in 2022: https://github.com/rust-lang/rust/pull/101123 Closes #20525.
2025-08-25Cache trait solving across queries in the same revisionChayim Refael Friedman-2/+19
Caching trait solving can do a lot to speed. Unfortunately it also consume a huge amount of memory. Therefore, as part of the migration to the new solver Jack Huey disabled caching of trait solving (he made the query transparent). The PR proposes a middle ground: do cache trait solving, but only for the same revision. This allows us to be safe because during a revision the inputs cannot change. The result is hopefully much better performance to features that tend to do a bulk of trait solving, and also repeat the same query (e.g. inference then IDE features). There is another limitation: results are only cached in the same thread, to remove the need for synchronization which will be expensive. More measurements are required to check whether it's better to use a synchronized global cache, or maybe stay with a thread-local cache but batch multiple feature requests (highlighting, inlay hints etc.) of the same file to the same thread. Alongside the actual cache we store the revision, because we need to verify it (we can't eagerly clear caches when incrementing the revision), and also the address of the db to prevent multiple dbs from interleaving (this is mostly relevant in tests, although injected highlighting also uses a new db, therefore maybe it's better to move it to a separate thread). This "games" analysis-stats to both be way faster and use way more memory; the former is because analysis-stats doesn't increment revisions, therefore all queries share the cache and hit ratio is way too good, the latter is because analysis-stats doesn't increment revisions and therefore the cache isn't cleared. Both are not representative of a typical IDE scenario.
2025-08-17fix: Make lang items query properly filter out overwritten/excluded sysrootsShoyu Vanilla-10/+29
2025-08-13fix errors after rebaseDeadbeef-0/+4
2025-08-13Merge Trait and TraitAlias handlingDeadbeef-168/+23
2025-08-09Implement next trait solverjackh726-2/+11
2025-07-31`cargo clippy --fix`Lukas Wirth-267/+245
2025-07-23Merge pull request #20289 from ChayimFriedman2/expr-store-diags-macrosLukas Wirth-13/+2
internal: Remove `ExpressionStoreDiagnostics::MacroError`, instead recreate it from the `MacroCallId`
2025-07-23Remove `ExpressionStoreDiagnostics::MacroError`, instead recreate it from ↵Chayim Refael Friedman-13/+2
the `MacroCallId` This simplifies the code and also makes us report parse error in macros too.
2025-07-22Parse `for<'a> [const]`Chayim Refael Friedman-34/+26
And also refactor parsing of HRTB.
2025-07-21hir-def: Don't apply x86_64-specific asserts on x32John Paul Adrian Glaubitz-2/+2
This fixes the rustc build on x32 for which struct sizes differ.
2025-07-20Support `cfg_select!`Chayim Refael Friedman-0/+48
2025-07-13remove now useless `[allow(unused_lifetimes)]`Andrey Nikolaev-12/+7
2025-07-11Merge pull request #20219 from ChayimFriedman2/expr-store-memChayim Refael Friedman-223/+379
perf: Put the expression stuff in the expression store behind an `Option<Box>`
2025-07-10Merge pull request #20210 from ChayimFriedman2/naked-asm-safeShoyu Vanilla (Flint)-48/+83
fix: Inline asm fixes
2025-07-10Put the expression stuff in the expression store behind an `Option<Box>`Chayim Refael Friedman-223/+379
And leave only the type stuff without it. This is because most expression stores don't have anything but types (e.g. generics, fields, signatures) so this saves a lot of memory. This saves 58mb on `analysis-stats .`.
2025-07-09Make `global_asm!()` workChayim Refael Friedman-19/+6
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09Differentiate between `asm!()`, `global_asm!()` and `naked_asm!()`, and make ↵Chayim Refael Friedman-2/+50
only `asm!()` unsafe
2025-07-09Don't hash the `SyntaxKind` in the ast idChayim Refael Friedman-35/+35
There is no need to, it's already stored in the `kind`.
2025-07-06Always bump in the parser in `err_and_bump()`Chayim Refael Friedman-2/+40
Even when at curly braces, otherwise the parser can get stuck. This has happened in the past in #18625, but it was just worked around instead of handling the root of the problem. Now this happened again in #20171. IMO we can't let `err_and_bump()` not bump, that's too confusing and invites errors. We can (as I did) workaround the worse recovery instead.
2025-07-04Skip unnecessary `eq` work in `BodySourceMap`Lukas Wirth-11/+49
2025-07-03Fix some things with builtin derivesChayim Refael Friedman-0/+80
1. Err on unions on derive where it's required. 2. Err on `#[derive(Default)]` on enums without `#[default]` variant. 3. Don't add where bounds `T: Default` when expanding `Default` on enums (structs need that, enums not). Also, because I was annoyed by that, in minicore, add a way to filter on multiple flags in the line-filter (`// :`). This is required for the `Debug` and `Hash` derives, because the derive should be in the prelude but the trait not.
2025-07-03Bump salsaLukas Wirth-5/+5
2025-06-26Merge pull request #20100 from ShoyuVanilla/ignore-sized-hierarchyChayim Refael Friedman-0/+2
Backport new sized-hierarchy trait bounds in old ways
2025-06-26Backport new sized-hierarchy trait bounds in old waysShoyu Vanilla-0/+2
2025-06-26Bring back the firewall queryLukas Wirth-15/+21
2025-06-26Salsa idiomize `VariantFields` queryLukas Wirth-53/+123
2025-06-25Merge pull request #20088 from Veykril/push-qrslvzzlqqozLukas Wirth-33/+44
De-arc trait items query
2025-06-25De-arc trait items queryLukas Wirth-33/+44
2025-06-24Short circuit a couple hir-ty/lower queriesLukas Wirth-3/+3
2025-06-24Merge pull request #20062 from ChayimFriedman2/doctestsLukas Wirth-0/+1
minor: Don't run doctests
2025-06-24fix: Use `ROOT` hygiene for `args` inside new `format_args!` expansionShoyu Vanilla-16/+17
2025-06-23Don't run doctestsChayim Refael Friedman-0/+1
2025-06-22Minic rustc's new `format_args!` expansionShoyu Vanilla-33/+328
2025-06-19Revert "Turn `BlockId` into a `#[salsa::tracked]`"Lukas Wirth-31/+15
This reverts commit 8643a858dbaf12b37e90b603cdee64434576c229.
2025-06-15Merge pull request #20000 from tadeokondrak/lifetime-repeat-macroChayim Refael Friedman-6/+33
Allow lifetime repeats in macros: $($x)'a*
2025-06-15Use is_any_identifier in pretty_print_macro_expansionTadeo Kondrak-13/+6
2025-06-15Fix spacing for LIFETIME_IDENT near keywords and literals in test outputTadeo Kondrak-4/+12
2025-06-15Optimize private visibility resolutionLukas Wirth-39/+83
2025-06-15Optimize `pub(crate)` visibility resolutionLukas Wirth-36/+53
2025-06-15Unify assoc item visibility queriesLukas Wirth-64/+45
2025-06-15Idiomatic salsa use for extern block abi queryLukas Wirth-6/+11