diff options
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 5 | ||||
-rw-r--r-- | components/script/dom/bindings/interface.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 74dff1cce9f..7a463e6dd7b 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1908,9 +1908,10 @@ class CGInterfaceObjectJSClass(CGThing): "depth": self.descriptor.prototypeDepth } return """\ -static InterfaceObjectClass: NonCallbackInterfaceObjectClass = +static InterfaceObjectClass: NonCallbackInterfaceObjectClass = unsafe { NonCallbackInterfaceObjectClass::new(%(constructor)s, %(representation)s, - PrototypeList::ID::%(id)s, %(depth)s); + PrototypeList::ID::%(id)s, %(depth)s) +}; """ % args diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs index 7db3c6e17c4..668a87daa8f 100644 --- a/components/script/dom/bindings/interface.rs +++ b/components/script/dom/bindings/interface.rs @@ -114,7 +114,7 @@ unsafe impl Sync for NonCallbackInterfaceObjectClass {} impl NonCallbackInterfaceObjectClass { /// Create a new `NonCallbackInterfaceObjectClass` structure. - pub const fn new( + pub const unsafe fn new( constructor: ConstructorClassHook, string_rep: &'static [u8], proto_id: PrototypeList::ID, |