зеркало из https://github.com/mozilla/gecko-dev.git
a4fa8230aa
Consider the following: struct Complex<T> { something: T, #[compute(field_bound)] something_else: Generic<Self, T>, } That will generate: impl<T> ToComputedValue for Complex<T> where T: ToComputedValue, Generic<Self, T>: ToComputedValue<ComputedValue = Generic<Self, <T as ToComputedValue>::ComputedValue>>, { // ... } That last clause is obviously incorrect. map_type_params correctly maps the T, but it should know also about Self. Ideally we could just do the same as for T and do: <Self as ToComputedValue>::ComputedValue But that doesn't quite work, because we are in that implementation of the trait, and the compiler rightfully complains about we don't yet knowing the computed type. So we need to pass it explicitly, which is simple enough, if a bit annoying. Differential Revision: https://phabricator.services.mozilla.com/D83816 |
||
---|---|---|
.. | ||
Cargo.toml | ||
cg.rs | ||
lib.rs |