{"record":{"id":"7d422e7af11aeddc","repo":"GitoxideLabs/gitoxide","slug":"we-are-not-on-16-bit-systems","errorCode":null,"errorMessage":"we are not on 16 bit systems","messagePattern":"we are not on 16 bit systems","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"gix-bitmap/src/ewah.rs","lineNumber":146,"sourceCode":"                    }\n                    let bits_in_word = remaining.min(64);\n                    if bits_in_word < 64 && (word >> bits_in_word) != 0 {\n                        return None;\n                    }\n                    for bit_index in 0..bits_in_word {\n                        if word & (1 << bit_index) != 0 {\n                            f(index)?;\n                        }\n                        index += 1;\n                    }\n                }\n            }\n            Some(())\n        }\n\n        /// The amount of bits we are currently holding.\n        pub fn num_bits(&self) -> usize {\n            self.num_bits.try_into().expect(\"we are not on 16 bit systems\")\n        }\n    }\n\n    #[inline]\n    fn rlw_running_len_bits(w: &u64) -> u64 {\n        rlw_running_len(w) * 64\n    }\n\n    #[inline]\n    fn rlw_running_len(w: &u64) -> u64 {\n        (w >> 1) & RLW_LARGEST_RUNNING_COUNT\n    }\n\n    #[inline]\n    fn rlw_literal_words(w: &u64) -> u64 {\n        w >> (1 + RLW_RUNNING_BITS)\n    }\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-bitmap/src/ewah.rs#L128-L164","documentation":"`EwahBitmap::num_bits` converts an internal `u32` bit counter to `usize` with `.expect(\"we are not on 16 bit systems\")`. On platforms where `usize` is 16 bits the `try_into` fails; on all modern platforms (32/64-bit) it cannot fail.","triggerScenarios":"Calling `num_bits()` on a target with 16-bit `usize`. Normal desktop/server Rust targets (x86_64, aarch64, etc.) are unaffected.","commonSituations":"Compiling gix-bitmap for exotic embedded targets with 16-bit pointers.","solutions":["Build for a 32-bit or 64-bit target","If 16-bit support is genuinely needed, change the counter to usize and drop the conversion upstream","Avoid using gix (and this bitmap) on 16-bit platforms — it is unsupported"],"exampleFix":"// before\nself.num_bits.try_into().expect(\"we are not on 16 bit systems\")\n// after\nusize::from(self.num_bits)","handlingStrategy":"validation","validationCode":"// at build time, reject 16-bit targets\ncfg_if::cfg_if! { if #[cfg(target_pointer_width = \"16\")] { compile_error!(\"gix-bitmap requires >=32-bit usize\"); } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Target 32/64-bit platforms only","Add a compile_error! guard for pointer_width = 16 in dependent projects"],"tags":["rust","panic","platform","bitmap"],"backgroundTag":"unsupported-platform","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}