aboutsummaryrefslogtreecommitdiffstats
path: root/components/style_derive/to_animated_value.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-03-03 11:31:21 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-03-13 15:08:20 +0100
commit9b24a451f6d77ecefc43a5b690930c19eb704c23 (patch)
treecc7548dd5de138b95d703cee8c2b6fb1db3b4824 /components/style_derive/to_animated_value.rs
parent35b8b95263d4f93dd791a44a7f570e2240655fd1 (diff)
downloadservo-9b24a451f6d77ecefc43a5b690930c19eb704c23.tar.gz
servo-9b24a451f6d77ecefc43a5b690930c19eb704c23.zip
style: When deriving something with an output type, map preconditions as well.
Otherwise, deriving ToComputedValue and ToAnimatedValue in structs or enums with other where clauses just doesn't work. Differential Revision: https://phabricator.services.mozilla.com/D21859
Diffstat (limited to 'components/style_derive/to_animated_value.rs')
-rw-r--r--components/style_derive/to_animated_value.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/style_derive/to_animated_value.rs b/components/style_derive/to_animated_value.rs
index b53cf9c3d41..1aba9b3327e 100644
--- a/components/style_derive/to_animated_value.rs
+++ b/components/style_derive/to_animated_value.rs
@@ -9,6 +9,12 @@ use synstructure::BindStyle;
pub fn derive(mut input: DeriveInput) -> TokenStream {
let mut where_clause = input.generics.where_clause.take();
+ cg::propagate_clauses_to_output_type(
+ &mut where_clause,
+ &input.generics,
+ parse_quote!(crate::values::animated::ToAnimatedValue),
+ parse_quote!(AnimatedValue),
+ );
for param in input.generics.type_params() {
cg::add_predicate(
&mut where_clause,