Also known as E0747 and E0107.
And by the way, rewrite how we lower generic arguments and deduplicate it between paths and method calls. The new version is taken almost straight from rustc.
This commit also changes the binders of `generic_defaults()`, to only include the binders of the arguments up to (and not including) the current argument. This make it easier to handle it in the rewritten lowering of generic args. It's also how rustc does it.
Now that they're const it's no longer needed.
Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
And make more queries non-interned.
Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
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).
In the body source map, we record each macro call with the `ExprOrPatId` it resolved to, so to lookup the `ExprId` of some node, we don't need to expand it!
We miss one place: associated type bindings aka. `impl Trait<Type(..): Send>`, but we also miss it for Fn-style parenthesizes error so I left it out for now.
A new syntax node `ast::VariantDef` has been introduced to map between the HIR node and the AST.
The files have been updated with `cargo test -p xtask`.
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it.
We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).