{"record":{"id":"7c95f39c3382cc84","repo":"emilk/egui","slug":"id-must-be-non-zero","errorCode":null,"errorMessage":"Id must be non-zero.","messagePattern":"Id must be non-zero\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/egui/src/id.rs","lineNumber":152,"sourceCode":"        let id = self.hash_with_salt(salt);\n\n        #[cfg(debug_assertions)]\n        id_source::insert_child(id, self, &salt);\n\n        id\n    }\n\n    fn hash_with_salt(self, salt: IdSalt) -> Self {\n        use core::hash::{BuildHasher as _, Hasher as _};\n        let mut hasher = ahash::RandomState::with_seeds(1, 2, 3, 4).build_hasher();\n        hasher.write_u64(self.value());\n        hasher.write_u64(salt.value());\n        Self::from_hash(hasher.finish())\n    }\n\n    /// Short and readable summary\n    pub fn short_debug_format(&self) -> String {\n        format!(\"{:04X}\", self.value() as u16)\n    }\n\n    /// The inner value of the [`Id`].\n    ///\n    /// This is a high-entropy hash, or [`Self::NULL`].\n    #[inline(always)]\n    pub fn value(&self) -> u64 {\n        self.0.get()\n    }\n\n    pub fn accesskit_id(&self) -> accesskit::NodeId {\n        self.value().into()\n    }\n\n    /// Create a new [`Id`] from a high-entropy value. No hashing is done.\n    ///\n    /// This can be useful if you have an [`Id`] that was converted to some other type\n    /// (e.g. accesskit::NodeId) and you want to convert it back to an [`Id`].","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/emilk/egui/blob/8fb03c9ae9a6bf1ffa602dfba51ed575f2655975/crates/egui/src/id.rs#L134-L170","documentation":"Error \"Id must be non-zero.\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/egui/src/id.rs:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not construct an Id from the value 0: use Id::new with a non-zero hash source instead of from_high_entropy_bits(0)."],"exampleFix":"let id = egui::Id::new(\"my_widget\"); // safe, non-zero","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8fb03c9ae9a6bf1ffa602dfba51ed575f2655975","analyzedAt":"2026-08-19T12:39:57.743Z","contentChangedAt":"2026-08-19T12:39:57.743Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}