refactor: Lower type-refs before type inference

This refactors how we deal with items in hir-def lowering.

- It now lowers all of them through an "ExpressionStore" (kind of a misnomer as this point) as their so called *Signatures.
- We now uniformly lower type AST into TypeRefs before type inference.
- Likewise, this moves macro expansion out of type inference, resulting in a single place where we do non-defmap macro expansion.
- Finally, this PR removes a lot of information from ItemTree, making the DefMap a lot less likely to be recomputed and have it only depend on actual early name resolution related information (not 100% true, we still have ADT fields in there but thats a follow up removal).
This commit is contained in:
Lukas Wirth 2025-01-25 17:20:10 +01:00
parent 588948f267
commit 1fd9520c92
127 changed files with 6733 additions and 7993 deletions

View file

@ -57,7 +57,7 @@ impl Evaluator<'_> {
return Ok(false);
}
let function_data = self.db.function_data(def);
let function_data = self.db.function_signature(def);
let attrs = self.db.attrs(def.into());
let is_intrinsic = attrs.by_key(&sym::rustc_intrinsic).exists()
// Keep this around for a bit until extern "rustc-intrinsic" abis are no longer used