-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Switch from Chalk to the next trait solver #20329
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
base: master
Are you sure you want to change the base?
Conversation
@@ -48,7 +48,8 @@ impl ToTokens for TrackedQuery { | |||
quote!(#(#options),*) | |||
}) | |||
.into_iter() | |||
.chain(self.lru.map(|lru| quote!(lru = #lru))); | |||
.chain(self.lru.map(|lru| quote!(lru = #lru))) | |||
.chain(Some(quote!(unsafe(non_update_return_type)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be changed before merge, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, if someone can point me to how to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review, I think that's what I will be able to do today.
@@ -29,20 +47,24 @@ mod infer; | |||
mod inhabitedness; | |||
mod interner; | |||
mod lower; | |||
mod lower_nextsolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all those X_nextsolver
modules supposed to replace their original before merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's pretty much impossible if we want this to land anytime soon. There is so much that relies on the non-next solver modules that goes beyond trait solving.
|
||
#[salsa::invoke(crate::drop::has_drop_glue)] | ||
#[salsa::cycle(cycle_result = crate::drop::has_drop_glue_cycle_result)] | ||
fn has_drop_glue(&self, ty: Ty, env: Arc<TraitEnvironment>) -> DropGlue; | ||
|
||
#[salsa::invoke(crate::layout_nextsolver::layout_of_adt_query)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fully qualified names everywhere (crate::X_nextsolver::X
) make the code harder to read, but I suppose we'll get rid of that once we remove the Chalk types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if there are specific places that make sense to remove them, let me know. But unfortunately a lot of them are kind of necessary.
0c5be1c
to
57c7b7d
Compare
Squashed and rebased version here: jackh726@5fa8436 Will switch this PR after a bit of review, just so people can see commits if they need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick glance
8c0dd60
to
eb38567
Compare
eb38567
to
ab8258d
Compare
93688bb
to
fbf45f7
Compare
if GLOBAL_CACHE.is_set() { | ||
GLOBAL_CACHE.with(call) | ||
} else { | ||
GLOBAL_CACHE.set(&RefCell::new(GlobalCache::default()), || GLOBAL_CACHE.with(call)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the TLS without context seems like it may cause (hard-to-debug) problems by sharing the cache across revisions, when things have changed.
At this point, opening up for general review, though I don't think this is fully ready to merge.
Some checklist (non-exhaustive) of things to do before/after merge (feel free to edit):
Before:
todo!()
s andFIXME
s and decide which are needed/useful to fix prior to mergewith_db
calls toScopedDb::set_db
(or decide on a better API)After (before stable):
After (any time):
chalk_ir
torustc_type_ir
layout_of_ty
Mixed:
allow(unused)