gecko-dev/servo
Emilio Cobos Álvarez a4fa8230aa Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris
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
2020-07-16 18:51:21 +00:00
..
components Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris 2020-07-16 18:51:21 +00:00
ports/geckolib Bug 1652023 - Remove unnecessary includes from PresShell.h. r=smaug 2020-07-15 13:53:02 +00:00
tests/unit Bug 1629359 - Update parking_lot to 0.10 r=kats 2020-04-12 19:14:43 +00:00
moz.build
rustfmt.toml