{"record":{"id":"7ce1c0e6d86c1a9b","repo":"embassy-rs/embassy","slug":"not-implemented-7ce1c0","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/can/fd/message_ram/common.rs","lineNumber":131,"sourceCode":"            0b11 => FilterType::FilterDisabled,\n            _ => unreachable!(),\n        }\n    }\n}\n\n#[doc = \"Reader of field `(E|S)FEC`\"]\npub type ESFEC_R = generic::R<u8, FilterElementConfig>;\nimpl ESFEC_R {\n    pub fn to_filter_element_config(&self) -> FilterElementConfig {\n        match self.bits() {\n            0b000 => FilterElementConfig::DisableFilterElement,\n            0b001 => FilterElementConfig::StoreInFifo0,\n            0b010 => FilterElementConfig::StoreInFifo1,\n            0b011 => FilterElementConfig::Reject,\n            0b100 => FilterElementConfig::SetPriority,\n            0b101 => FilterElementConfig::SetPriorityAndStoreInFifo0,\n            0b110 => FilterElementConfig::SetPriorityAndStoreInFifo1,\n            _ => unimplemented!(),\n        }\n    }\n}\n","sourceCodeStart":113,"sourceCodeEnd":135,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/can/fd/message_ram/common.rs#L113-L135","documentation":"to_filter_element_config decodes the M_CAN filter's F0 event/action bits into a FilterElementConfig; the reserved/invalid encodings (0b000 and 0b111) fall through to unimplemented!. A message RAM filter element containing a reserved configuration value panics when decoded.","triggerScenarios":"Reading a filter element from the FDCAN message RAM whose SFEC/EFEC field holds 0b000 (disable) or 0b111 (reserved) instead of the handled 0b001..0b110 values.","commonSituations":"Reading raw/uninitialized message RAM cells as filter elements, or manually crafted filter words with reserved action codes.","solutions":["Only create filter elements with the supported action encodings (store fifo0/1, reject, priority variants)","Initialize/zero message RAM filters so disabled filters are never decoded","Change the fallthrough to return Option/Result or map 0b000 to a Disabled variant","Validate filter configuration before writing it into message RAM"],"exampleFix":"// before\nlet cfg = element.to_filter_element_config(); // panics on 0b000/0b111\n// after\nlet cfg = match raw_action {\n    0b000 => FilterElementConfig::Disabled,\n    other => element.to_filter_element_config_for(other),\n};","handlingStrategy":"type-guard","validationCode":"fn is_valid_action(bits: u8) -> bool { (0b001..=0b110).contains(&bits) }","typeGuard":"fn decode_filter_config(bits: u8) -> Option<FilterElementConfig> { matches!(bits, 0b001..=0b110).then(|| /* decode */) }","tryCatchPattern":"// treat decode as fallible in caller code; assume panic otherwise","preventionTips":["Only write supported SFEC/EFEC values into message RAM filters","Clear/initialize filter elements to a supported disabled representation if possible","Never decode raw uninitialized message RAM cells"],"tags":["rust","embedded","stm32","can","fdcan","enum-decode"],"backgroundTag":"unsupported-enum-value","analyzedSha":"463a07b963419a1bfe61d5d597c44acb810afb8b","analyzedAt":"2026-09-10T13:38:26.660Z","contentChangedAt":"2026-09-10T13:38:26.660Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}