aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2020-04-15 17:54:04 +0200
committerSimon Sapin <simon.sapin@exyr.org>2020-04-15 17:54:04 +0200
commit6175a68c102218d0de18b67343ad14cfc193b18d (patch)
tree46de4cc1158fa10951b879d098bf73163025a863 /components/script/dom/bindings/codegen/CodegenRust.py
parent7f975c3d5d1a9b36a05736a7b6425b56a73ef760 (diff)
downloadservo-6175a68c102218d0de18b67343ad14cfc193b18d.tar.gz
servo-6175a68c102218d0de18b67343ad14cfc193b18d.zip
Replace a `transmute` with `.to_ne_bytes()` + constructor
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 3c9555ba659..021757a4ad1 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -3992,8 +3992,8 @@ class CGMemberJITInfo(CGThing):
protoID: PrototypeList::ID::${name} as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: ${depth} },
- _bitfield_1: unsafe {
- mem::transmute(new_jsjitinfo_bitfield_1!(
+ _bitfield_1: __BindgenBitfieldUnit::new(
+ new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::${opType} as u8,
JSJitInfo_AliasSet::${aliasSet} as u8,
JSValueType::${returnType} as u8,
@@ -4004,8 +4004,8 @@ class CGMemberJITInfo(CGThing):
${isLazilyCachedInSlot},
${isTypedMethod},
${slotIndex},
- ))
- },
+ ).to_ne_bytes()
+ ),
}
""",
opName=opName,
@@ -5988,6 +5988,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'js::error::throw_type_error',
'js::error::throw_internal_error',
'js::rust::wrappers::Call',
+ 'js::jsapi::__BindgenBitfieldUnit',
'js::jsapi::CallArgs',
'js::jsapi::CurrentGlobalOrNull',
'js::rust::wrappers::GetPropertyKeys',