Example
---
```rust
macro_rules! foo {
($($x:$0)*) => ();
}
```
**Completion items**:
```text
ba block
ba expr
ba expr_2021
ba ident
ba item
ba lifetime
ba literal
ba meta
ba pat
ba pat_param
ba path
ba stmt
ba tt
ba ty
ba vis
```
It sees them as regular impls; the details are abstracted. It's beautiful for the IDE layer, and less beautiful for `hir`, so this is a big change.
Some small differences still exist:
- We show builtin derives impl (to the IDE layer) as if they have had no generic parameters. It is possible to show the parameters, but that means also having to handle fake impls in `TypeParam` etc., and the benefit is questionable.
- Getting the fn *def* type of a method of a builtin derive impl is not supported, as there is no real `FunctionId`, therefore no `CallableDefId`. The trait method is returned instead. Note: getting the fn *ptr* type of the method is supported well.
- Builtin derive impls and their methods do not fully support `HasSource`, because, well, they have no source (at least, not in the form of `ast::Impl` and `ast::Fn`). To support them, we use the derive's `TextRange` where possible, and the trait method's source when not.
It's important to note that the def map still records the `MacroCallId`. I have doubts over this, as this means it's very easy to create the queries we don't want to create, but it does make things more convenient. In particular, a nicety of this setup is that even "Expand macro recursively" works (it creates the macro input/output query, but given that they will only be created when the user invokes the command, that does not seem to be a problem).
And remove it when needed, the opposite of what was previously, where we stored without a tuple and tupled for the solver (because it requires that).
Because this is what rustc does, and generally, the closer we follow rustc, the easier our lives become.
The weird name `signature_unclosure()` also comes from rustc.
Rollup of 3 pull requests
Successful merges:
- rust-lang/rust#150141 (Misc cleanups from reading some borrowck code)
- rust-lang/rust#150297 (Fix compile issue in Vita libstd)
- rust-lang/rust#150341 (Fix some divergences with the cg_clif subtree)
r? `@ghost`
`@rustbot` modify labels: rollup
Fix some divergences with the cg_clif subtree
For some reason git-subtree incorrectly synced those changes.
r? `@ghost`
`@rustbot` label +A-codegen +A-cranelift +T-compiler
Fix compile issue in Vita libstd
Unfortunately it looks like the Vita libc does not support
the "utimensat" function, which is needed for setting file times.
To fix the build, this commit marks Vita as unsupported for the
function that sets the file times.