-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make SemanticsScope non-generic #5153
Conversation
Right, you are spot on @lnicola! I originally tried making Semantics non-generic, but didn't. I don't exactly remember why, it might be that either:
If it's the latter, we can have generic |
I'm not sure if |
The following setup should work without breaking the API: pub struct Semantics<'db, DB>{
db: &'db DB
imp: SemanticsImpl<'a>
}
struct SemanticsImpl<'a> {
db: &'db dyn HirDatabase
s2d_cache: RefCell<SourceToDefCache>,
cache: RefCell<FxHashMap<SyntaxNode, HirFileId>>,
} |
What about the change in this PR? Do you think it's not a good idea? |
Argh, I assumed this is an issue and not a PR. Gotta go make some pu erh I guess... |
bors r+ This totally makes sense, but we need to do the rest as well! |
One issue is that some places seem to require |
Build succeeded:
|
Adding upcasts should be fine! |
Ugh, after a while |
This slightly reduces the build times:
(compare to #1987 (comment))