Bug 1481984 - Use function pointer rather than Fn trait object for collect_property_completion_keywords. r=emilio
authorXidorn Quan <me@upsuper.org>
Thu, 09 Aug 2018 13:49:47 +0000
changeset 485886 963ef5e31cdc4fe024160df147df40c728b74484
parent 485885 c994c033717148128951957aaf24912d8291a4e3
child 485887 59e0a0f2487f6e65225415760db9d7161132aab1
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1481984
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481984 - Use function pointer rather than Fn trait object for collect_property_completion_keywords. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D2985
servo/components/style/properties/properties.mako.rs
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -598,26 +598,27 @@ impl NonCustomPropertyId {
             % endif
             % endfor
         ];
         SUPPORTED_TYPES[self.0]
     }
 
     /// See PropertyId::collect_property_completion_keywords.
     fn collect_property_completion_keywords(&self, f: KeywordsCollectFn) {
-        const COLLECT_FUNCTIONS: [&Fn(KeywordsCollectFn);
+        fn do_nothing(_: KeywordsCollectFn) {}
+        const COLLECT_FUNCTIONS: [fn(KeywordsCollectFn);
                                   ${len(data.longhands) + len(data.shorthands)}] = [
             % for prop in data.longhands:
-                &<${prop.specified_type()} as SpecifiedValueInfo>::collect_completion_keywords,
+                <${prop.specified_type()} as SpecifiedValueInfo>::collect_completion_keywords,
             % endfor
             % for prop in data.shorthands:
             % if prop.name == "all":
-                &|_f| {}, // 'all' accepts no value other than CSS-wide keywords
+                do_nothing, // 'all' accepts no value other than CSS-wide keywords
             % else:
-                &<shorthands::${prop.ident}::Longhands as SpecifiedValueInfo>::
+                <shorthands::${prop.ident}::Longhands as SpecifiedValueInfo>::
                     collect_completion_keywords,
             % endif
             % endfor
         ];
         COLLECT_FUNCTIONS[self.0](f);
     }
 
     /// Turns this `NonCustomPropertyId` into a `PropertyId`.