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
I found this in diesel, but I expect to see it happen elsewhere.
traitHasMetadata{typeMetadata;}structSql;implHasMetadataforSql{typeMetadata = ();}traitProcess<T>:HasMetadata{fnprocess(t:T,metadata:Self::Metadata);}impl<T>Process<T>forSql/* imagine `T` has some constraints that doesn't just make this an always-applicable blanket impl */{fnprocess(t:T,metadata:Self::Metadata){}}fnprocess<T>()whereSql:Process<T>{Sql::process((),());//~^ ERROR because `<Sql as HasMetadata>::Metadata != ()`}
Basically, a crate will have a meaningful param-env like Rigid: Trait<T> which elaborates into a trivial param-env candidate like Rigid: OtherTrait. That causes <Rigid as OtherTrait>::Assoc to no longer project.
This is hard to work around, because users can't just control the elaboration of their where clauses, and the where clause they wrote (i.e. Rigid: Trait<T>) does mention params and therefore is needed in the environment.
The text was updated successfully, but these errors were encountered:
This now errors with the following error with both solver
error[E0308]: mismatched types
--> <source>:19:18
|
18 | fn process<T>() where Sql:Process<T> {
| - expected this type parameter
19 | Sql::process((),());
| ------------ ^^ expected type parameter `T`, found `()`
| |
| arguments to this function are incorrect
|
= note: expected type parameter `T`
found unit type `()`
The issue with <Rigid as OtherTrait>::Assoc has been fixed by lowering the priority of global where-clauses however. I think this issue can be closed?
I found this in diesel, but I expect to see it happen elsewhere.
Basically, a crate will have a meaningful param-env like
Rigid: Trait<T>
which elaborates into a trivial param-env candidate likeRigid: OtherTrait
. That causes<Rigid as OtherTrait>::Assoc
to no longer project.This is hard to work around, because users can't just control the elaboration of their where clauses, and the where clause they wrote (i.e.
Rigid: Trait<T>
) does mention params and therefore is needed in the environment.The text was updated successfully, but these errors were encountered: