BTW, things slowed down a bit here for a few reasons, but I wanted to give a few updates.
1. Part of the reason for the slowdown is that (on the wg-traits side) we were looking against rustc-chalk integration. I still think though we should be pursuing the RLS 2.0 integration. A lot of the hard problems though will be the same in both cases.
2. That said, I spent a fair amount of time refactoring chalk to enable "query-ification" and I plan to open some PRs for that soon. It's not all the way done but at least the path is becoming clear.
I've actually been working on preparing for Chalk integration on the rust-analyzer side (see also rust-analyzer#1120), so I hope we'll be ready to do it once the Chalk queryfication is done :)
@Florian Diebold great! I was planning on creating a doodle today to find a time to discuss the queries and setup in more depth. Maybe you can talk about what you've been doing as well so we can line them up.
And/or feel free to leave some notes here now :)
One thing that became clear btw, when @Sunjay Varma and I were looking, is that the notion of "current crate" does not want to completely go away
I think the way this will map to rust-analyzer is that there needs to be a distinct "trait solver" for each crate -- this is because each crate operates with a different set of impls
basically, I think the rust-analyzer has no notion of current crate, and that's fine, but chalk does, and so rust analyzer will always talk to chalk with a current crate in mind
hm yeah, that's true
That makes total sense, yeah. Question: would solvers for different crates share any data?
For example, each crate depends on std, so each solver has to know about all of std's impls. If we naively duplicate the impls per solver, we'll have O(N^2) situation
I've been wondering about that. I'm not sure the answer.
I think initially they would share minimal state, but we might be able to increase it.
That said, my hope would be that we aren't (e.g.) type-checking other crates that often :)
So it may not be a big issue in practice
We'd at least be type-checking all the crates in the workspace, which may already be a few... but we'll see :)