Bug 2038504 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

just taking nss_prelude.rs as an example, when generated with llvm20 and llvm22:
```
--- l20.rs      Sun May 10 21:08:06 2026
+++ l22.rs      Sun May 10 21:08:10 2026
@@ -1,36 +1,13 @@                                                                                         
 /* automatically generated by rust-bindgen 0.69.4 */
                              
-pub mod SECItemType {           
-    pub type Type = ::std::os::raw::c_uint;
-    pub const siBuffer: Type = 0;
-    pub const siClearDataBuffer: Type = 1;                                                               
-    pub const siCipherDataBuffer: Type = 2;
-    pub const siDERCertBuffer: Type = 3;
-    pub const siEncodedCertBuffer: Type = 4;
-    pub const siDERNameBuffer: Type = 5;                                                                 
-    pub const siEncodedNameBuffer: Type = 6;
-    pub const siAsciiNameString: Type = 7;
-    pub const siAsciiString: Type = 8;
-    pub const siDEROID: Type = 9;       
-    pub const siUnsignedInteger: Type = 10;
-    pub const siUTCTime: Type = 11;                                                                      
-    pub const siGeneralizedTime: Type = 12;
-    pub const siVisibleString: Type = 13;
-    pub const siUTF8String: Type = 14;
-    pub const siBMPString: Type = 15;
-}                                         
 pub type SECItem = SECItemStr;
 #[repr(C)]
 #[derive(Debug, Copy, Clone)]
 pub struct SECItemStr {
-    pub type_: SECItemType::Type,
-    pub data: *mut ::std::os::raw::c_uchar,
-    pub len: ::std::os::raw::c_uint,
+    pub _address: u8,
 }
 #[test]
 fn bindgen_test_layout_SECItemStr() {
-    const UNINIT: ::std::mem::MaybeUninit<SECItemStr> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<SECItemStr>(),
         24usize,
@@ -41,48 +18,15 @@
         8usize,
         concat!("Alignment of ", stringify!(SECItemStr))
     );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(type_)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(data)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        16usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(len)
-        )
-    );
 }
 pub type SECItemArray = SECItemArrayStr;
 #[repr(C)]
 #[derive(Debug, Copy, Clone)]
 pub struct SECItemArrayStr {
-    pub items: *mut SECItem,
-    pub len: ::std::os::raw::c_uint,
+    pub _address: u8,
 }
 #[test]
 fn bindgen_test_layout_SECItemArrayStr() {
-    const UNINIT: ::std::mem::MaybeUninit<SECItemArrayStr> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<SECItemArrayStr>(),
         16usize,
@@ -92,26 +36,6 @@
         ::std::mem::align_of::<SECItemArrayStr>(),
         8usize,
         concat!("Alignment of ", stringify!(SECItemArrayStr))
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemArrayStr),
-            "::",
-            stringify!(items)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemArrayStr),
-            "::",
-            stringify!(len)
-        )
     );
 }
 pub mod _SECStatus {
```
some things are clearly missing.. and i dunno if its a missing rust-bindgen option or in the llvm build or... but that isnt causing issues with 151. i'll peruse the changelog a bit
just taking nss_prelude.rs as an example, when generated with llvm20 and llvm22, after passing the files through rustfmt for diffability:
```
--- l20.rs      Sun May 10 21:08:06 2026
+++ l22.rs      Sun May 10 21:08:10 2026
@@ -1,36 +1,13 @@                                                                                         
 /* automatically generated by rust-bindgen 0.69.4 */
                              
-pub mod SECItemType {           
-    pub type Type = ::std::os::raw::c_uint;
-    pub const siBuffer: Type = 0;
-    pub const siClearDataBuffer: Type = 1;                                                               
-    pub const siCipherDataBuffer: Type = 2;
-    pub const siDERCertBuffer: Type = 3;
-    pub const siEncodedCertBuffer: Type = 4;
-    pub const siDERNameBuffer: Type = 5;                                                                 
-    pub const siEncodedNameBuffer: Type = 6;
-    pub const siAsciiNameString: Type = 7;
-    pub const siAsciiString: Type = 8;
-    pub const siDEROID: Type = 9;       
-    pub const siUnsignedInteger: Type = 10;
-    pub const siUTCTime: Type = 11;                                                                      
-    pub const siGeneralizedTime: Type = 12;
-    pub const siVisibleString: Type = 13;
-    pub const siUTF8String: Type = 14;
-    pub const siBMPString: Type = 15;
-}                                         
 pub type SECItem = SECItemStr;
 #[repr(C)]
 #[derive(Debug, Copy, Clone)]
 pub struct SECItemStr {
-    pub type_: SECItemType::Type,
-    pub data: *mut ::std::os::raw::c_uchar,
-    pub len: ::std::os::raw::c_uint,
+    pub _address: u8,
 }
 #[test]
 fn bindgen_test_layout_SECItemStr() {
-    const UNINIT: ::std::mem::MaybeUninit<SECItemStr> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<SECItemStr>(),
         24usize,
@@ -41,48 +18,15 @@
         8usize,
         concat!("Alignment of ", stringify!(SECItemStr))
     );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(type_)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(data)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        16usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemStr),
-            "::",
-            stringify!(len)
-        )
-    );
 }
 pub type SECItemArray = SECItemArrayStr;
 #[repr(C)]
 #[derive(Debug, Copy, Clone)]
 pub struct SECItemArrayStr {
-    pub items: *mut SECItem,
-    pub len: ::std::os::raw::c_uint,
+    pub _address: u8,
 }
 #[test]
 fn bindgen_test_layout_SECItemArrayStr() {
-    const UNINIT: ::std::mem::MaybeUninit<SECItemArrayStr> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<SECItemArrayStr>(),
         16usize,
@@ -92,26 +36,6 @@
         ::std::mem::align_of::<SECItemArrayStr>(),
         8usize,
         concat!("Alignment of ", stringify!(SECItemArrayStr))
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemArrayStr),
-            "::",
-            stringify!(items)
-        )
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(SECItemArrayStr),
-            "::",
-            stringify!(len)
-        )
     );
 }
 pub mod _SECStatus {
```
some things are clearly missing.. and i dunno if its a missing rust-bindgen option or in the llvm build or... but that isnt causing issues with 151. i'll peruse the changelog a bit

Back to Bug 2038504 Comment 3