Fix #9511. Export webidl enums using "pub use".

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around https://github.com/rust-lang/rust/issues/31355
This commit is contained in:
Ben 2016-02-18 11:54:47 -07:00 committed by Josh Matthews
parent 7a9dc57761
commit 2477f6a363

View file

@ -5349,8 +5349,8 @@ class CGBindingRoot(CGThing):
# Do codegen for all the typdefs
for t in typedefs:
if t.innerType.isUnion():
cgthings.extend([CGGeneric("\npub type %s = %s;\n\n" % (t.identifier.name,
"UnionTypes::" + str(t.innerType)))])
cgthings.extend([CGGeneric("\npub use dom::bindings::codegen::UnionTypes::%s as %s;\n\n" %
(t.innerType, t.identifier.name))])
else:
assert not typeNeedsRooting(t.innerType, config.getDescriptorProvider)
cgthings.extend([CGGeneric("\npub type %s = " % (t.identifier.name)),