aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 39409e7deaa..fd2df0799c6 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2278,7 +2278,14 @@ static NAMESPACE_OBJECT_CLASS: NamespaceObjectClass = unsafe {
return """\
static INTERFACE_OBJECT_CLASS: NonCallbackInterfaceObjectClass =
NonCallbackInterfaceObjectClass::new(
- &%(constructorBehavior)s,
+ {
+ // Intermediate `const` because as of nightly-2018-10-05,
+ // rustc is conservative in promotion to `'static` of the return values of `const fn`s:
+ // https://github.com/rust-lang/rust/issues/54846
+ // https://github.com/rust-lang/rust/pull/53851
+ const BEHAVIOR: InterfaceConstructorBehavior = %(constructorBehavior)s;
+ &BEHAVIOR
+ },
%(representation)s,
PrototypeList::ID::%(id)s,
%(depth)s);