Conversation
| Ctor | ||
| for SolverDefId | ||
| ); | ||
| impl<'db> From<AdtId> for SolverDefId<'db> { |
There was a problem hiding this comment.
impl_from! doesn't work with generics unfortunately.
| let method = quote! { | ||
| #sig { | ||
| #wrapper_struct::new(self, #interned_pat) | ||
| #type_constructor new(self, #interned_pat) |
There was a problem hiding this comment.
Previously, when given the type InternedOpaqueTyId<'db> this would generate InternedOpaqueTyId<'db>::new, which is invalid syntax. Now it removes all the generics, leaving them to be inferred, producing just InternedOpaqueTyId::new. The same applies below.
|
|
||
| self.signature = parse_quote!( | ||
| fn #ident(&self, id: #interned_key) -> #interned_return_ty | ||
| fn #ident #generics(#receiver, id: #interned_key) -> #interned_return_ty |
There was a problem hiding this comment.
This &self needs the lifetime now too, hence this change.
|
I know I've asked for this, but after seeing the diff I'm not sure I prefer that 😅 |
| rustc_type_ir::solve::ExternalConstraintsData<DbInterner<'db>>; | ||
|
|
||
| interned_vec_nolifetime_salsa!(SolverDefIds, SolverDefId); | ||
| interned_vec_nolifetime_salsa!(SolverDefIds, SolverDefId<'db>); |
There was a problem hiding this comment.
Does this need more lifetime propagation too? The macro is named nolifetime but it seems to work fine despite the lifetime...
There was a problem hiding this comment.
I guess other uses of this macro already had lifetimes
There was a problem hiding this comment.
I think its about the declaration it creates, not the things it consumes
|
Would love to get the ball rolling for the lifetime changes, could you rebase this if you get the time? Happy to merge it then |
|
☔ The latest upstream changes (possibly #21804) made this pull request unmergeable. Please resolve the merge conflicts. |
|
We didn't get OP's response for some months and it's going to be pretty hard to rebase this now. Closing. |
As per the request on #20896, I removed
no_lifetimeand added a 'db to InternedOpaqueTyId. This propagated way farther than I expected, but I followed them all. The macro tweaks were the annoying part, as I had to work around the differences between declaring a type in a signature and calling a method on the type. But it all seems to work.