Closed Bug 1536586 Opened 9 months ago Closed 9 months ago

Simplify a bit our rust bindings.

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

They are quite messy, and they have a few hacks of dubious utility.

In order to start removing specialness of bindings.rs (in order to be merged with structs.rs), I want to simplify a couple things.

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.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e02bd4f99157
Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut. r=heycam
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/368e04fcad49
followup: Remove unused #[macro_use]s.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/c7678cc8630e
followup of the followup: Remove unused #[macro_use] in 32-bit builds.
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.