aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-07-08 15:25:49 +0200
committerMs2ger <Ms2ger@gmail.com>2016-07-12 13:06:53 +0200
commit28630f5487b5f12fd93215f1fa87169227c72a8f (patch)
tree10b137a17222a891e993ee50336f18013550b38a /components/script/dom/bindings/codegen
parente99054f7313fbb7e364da69f6275410660527e08 (diff)
downloadservo-28630f5487b5f12fd93215f1fa87169227c72a8f.tar.gz
servo-28630f5487b5f12fd93215f1fa87169227c72a8f.zip
Make DefineDOMInterface and ConstructorEnabled unsafe functions.
Diffstat (limited to 'components/script/dom/bindings/codegen')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 0da49a5ef06..3a955b4c6dd 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2241,7 +2241,8 @@ class CGConstructorEnabled(CGAbstractMethod):
CGAbstractMethod.__init__(self, descriptor,
'ConstructorEnabled', 'bool',
[Argument("*mut JSContext", "aCx"),
- Argument("HandleObject", "aObj")])
+ Argument("HandleObject", "aObj")],
+ unsafe_fn=True)
def definition_body(self):
body = CGList([], "\n")
@@ -2809,7 +2810,8 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
Argument('*mut JSContext', 'cx'),
Argument('HandleObject', 'global'),
]
- CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface', 'void', args, pub=True)
+ CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface',
+ 'void', args, pub=True, unsafe_fn=True)
def define(self):
return CGAbstractMethod.define(self)
@@ -6250,10 +6252,10 @@ class GlobalGenRoots():
pairs.append((ctor.identifier.name, binding))
pairs.sort(key=operator.itemgetter(0))
mappings = [
- CGGeneric('b"%s" => codegen::Bindings::%s::DefineDOMInterface as fn(_, _),' % pair)
+ CGGeneric('b"%s" => codegen::Bindings::%s::DefineDOMInterface as unsafe fn(_, _),' % pair)
for pair in pairs
]
- mapType = "phf::Map<&'static [u8], fn(*mut JSContext, HandleObject)>"
+ mapType = "phf::Map<&'static [u8], unsafe fn(*mut JSContext, HandleObject)>"
phf = CGWrapper(
CGIndenter(CGList(mappings, "\n")),
pre="pub static MAP: %s = phf_map! {\n" % mapType,