aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen <ben@tycheon.ca>2016-02-18 11:54:47 -0700
committerJosh Matthews <josh@joshmatthews.net>2016-03-23 12:49:34 -0400
commit2477f6a3630815b0de0e3af1ff463286d44ad83d (patch)
tree2e9631d013b9cb3d636f4332cc4acfe545eae1f8
parent7a9dc577617b442ff0fe07eaa683207234c519ee (diff)
downloadservo-2477f6a3630815b0de0e3af1ff463286d44ad83d.tar.gz
servo-2477f6a3630815b0de0e3af1ff463286d44ad83d.zip
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
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 4468bb13b6b..3dac77be733 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -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)),