gecko-dev/xpcom/idl-parser
Valentin Gosu d16b0d8318 Bug 1552176 - Generate rust methods from cenum idl r=nika
This patch changes the xpidl parser to generate the rust trait code for
methods that take or return a cenum value.
Previously this would return an error, which means that adding a method
that uses cenums to an existing interface could cause rust code that
implements that interface to fail to build.

The generated methods take or return u8/u16/u32 depending on the width of the
enum. While this is not optimal (the parameter could contain values that are
not actually part of the enum), this is similar to what we do for nsLoadFlags.
In the future it would be nice to generate code that actually checks the
values are present in the enum, and to use a typedef instead of a plain
unsigned int.

Differential Revision: https://phabricator.services.mozilla.com/D51838

--HG--
extra : moz-landing-system : lando
2020-01-07 19:35:02 +00:00
..
xpidl Bug 1552176 - Generate rust methods from cenum idl r=nika 2020-01-07 19:35:02 +00:00
setup.py Bug 1562642 - add missing license in xpcom/ r=froydnj 2019-11-11 21:44:32 +00:00