aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/build_gecko.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-03-26 13:25:42 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-03-27 14:29:25 +0100
commit02bc29a11b06de7e6de290d5c2f31fda69c8e9b4 (patch)
tree10202b6b24a070f6593c39ac503b1a0a8b3b6f25 /components/style/build_gecko.rs
parent64f19ae34db3e754dbc62288e01598700315d978 (diff)
downloadservo-02bc29a11b06de7e6de290d5c2f31fda69c8e9b4.tar.gz
servo-02bc29a11b06de7e6de290d5c2f31fda69c8e9b4.zip
style: Simplify Owned FFI types.
And make them actually sound. We're defining functions on Rust-land that get structs as arguments, but declaring them in C++ as getting pointers. This is another step in order to be able to autogenerate ServoBindings.h and remove bindings.rs altogether. We remove FooOwned in favor of Owned<Foo>, which is generated via cbindgen. It'd be good to actually mark Owned and such as MOZ_MUST_USE_TYPE, so I sent https://github.com/eqrion/cbindgen/pull/307 for that. Differential Revision: https://phabricator.services.mozilla.com/D24681
Diffstat (limited to 'components/style/build_gecko.rs')
-rw-r--r--components/style/build_gecko.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs
index 52dc5f51e24..6b536c4122b 100644
--- a/components/style/build_gecko.rs
+++ b/components/style/build_gecko.rs
@@ -258,13 +258,6 @@ mod bindings {
.collect()
}
- fn get_boxed_types() -> Vec<String> {
- get_types("ServoBoxedTypeList.h", "SERVO_BOXED_TYPE")
- .into_iter()
- .map(|(_, type_name)| type_name)
- .collect()
- }
-
struct BuilderWithConfig<'a> {
builder: Builder,
config: &'a Table,
@@ -453,22 +446,6 @@ mod bindings {
ty
));
}
- for ty in get_boxed_types().iter() {
- builder = builder
- .blacklist_type(format!("{}Owned", ty))
- .raw_line(format!(
- "pub type {0}Owned = ::gecko_bindings::sugar::ownership::Owned<{0}>;",
- ty
- ))
- .blacklist_type(format!("{}OwnedOrNull", ty))
- .raw_line(format!(
- concat!(
- "pub type {0}OwnedOrNull = ",
- "::gecko_bindings::sugar::ownership::OwnedOrNull<{0}>;"
- ),
- ty
- ));
- }
write_binding_file(builder, BINDINGS_FILE, &fixups);
}