You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[WIP] resolve: Feed the `opt_def_kind` query immediately on `DefId` creation
... for most `DefId`s.
Right now the def kind query requires building HIR for no good reason, in this PR I'm trying to change that.
In two cases the `DefKind` is not known early enough.
- Choosing between `DefKind::Closure` and `DefKind::Coroutine` requires analyzing (expanded) closure body, which cannot be done in def collector.
I think `DefKind::Coroutine` should be merged into `DefKind::Closure`, it's more useful to have all `DefKind`s early in resolver (perhaps even merge them with `DefPathData`s) than to make this specific distinction.
- `opt_def_kind` should report `None` instead of `Some(DefKind::AnonConst)` for some specific subset of anonymous constants not know in def collector, otherwise code in other parts of the compiler panics. I'll try to get rid of this oddity in a separate PR.
Submitting this in a WIP state for preliminary benchmarking.
0 commit comments