Skip to content

Commit 2477f6a

Browse files
Tycheonjdm
authored andcommitted
Fix servo#9511. Export webidl enums using "pub use".
Change typedef codegen to export the underlying enum itself, rather than an alias. Works around rust-lang/rust#31355
1 parent 7a9dc57 commit 2477f6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/script/dom/bindings/codegen/CodegenRust.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5349,8 +5349,8 @@ def __init__(self, config, prefix, webIDLFile):
53495349
# Do codegen for all the typdefs
53505350
for t in typedefs:
53515351
if t.innerType.isUnion():
5352-
cgthings.extend([CGGeneric("\npub type %s = %s;\n\n" % (t.identifier.name,
5353-
"UnionTypes::" + str(t.innerType)))])
5352+
cgthings.extend([CGGeneric("\npub use dom::bindings::codegen::UnionTypes::%s as %s;\n\n" %
5353+
(t.innerType, t.identifier.name))])
53545354
else:
53555355
assert not typeNeedsRooting(t.innerType, config.getDescriptorProvider)
53565356
cgthings.extend([CGGeneric("\npub type %s = " % (t.identifier.name)),

0 commit comments

Comments
 (0)