style: Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut.

This reduces a lot the boilerplate that's needed in order to add simple binding
functions.

This starts using &Foo and Option<&Foo> instead, and as a result we need to
remove the servo_function_signatures test, which is a bit unfortunate.

I think it's worth though, this causes problems on some platforms (see bug
1534844), and messing up the functions signature is not something that I've ever
seen (other than bug 1308234, which already had all the FooBorrowed mess which
I'm removing).

Also, cbindgen understands references and Option<&Foo>, so it will be the way to
go in the future.

After this patch we can also remove HasSimpleFFI, but I've kept it for now since
I still use it in a few places, and this patch is quite big on its own.

Differential Revision: https://phabricator.services.mozilla.com/D24092
This commit is contained in:
Emilio Cobos Álvarez 2019-03-21 17:00:27 +00:00
parent d4635f1d12
commit 14b176019c
9 changed files with 68 additions and 150 deletions

View file

@ -77,7 +77,7 @@ where
#[cfg(feature = "gecko")]
unsafe impl HasFFI for AuthorStyles<crate::gecko::data::GeckoStyleSheet> {
type FFIType = crate::gecko_bindings::bindings::RawServoAuthorStyles;
type FFIType = crate::gecko_bindings::structs::RawServoAuthorStyles;
}
#[cfg(feature = "gecko")]
unsafe impl HasSimpleFFI for AuthorStyles<crate::gecko::data::GeckoStyleSheet> {}