{"record":{"id":"357dafac8ac5858a","repo":"rust-lang/rust-analyzer","slug":"attempted-to-deserialize-value-that-cannot-set-pe","errorCode":null,"errorMessage":"attempted to deserialize value that cannot set `PERSIST` to false","messagePattern":"attempted to deserialize value that cannot set `PERSIST` to false","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/span/src/hygiene.rs","lineNumber":129,"sourceCode":"        const DEBUG_NAME: &'static str = \"SyntaxContextData\";\n        const REVISIONS: std::num::NonZeroUsize = std::num::NonZeroUsize::MAX;\n        const PERSIST: bool = false;\n\n        type Fields<'a> = SyntaxContextData;\n        type Struct<'a> = SyntaxContext;\n\n        fn serialize<S>(_: &Self::Fields<'_>, _: S) -> Result<S::Ok, S::Error>\n        where\n            S: zalsa_::serde::Serializer,\n        {\n            unimplemented!(\"attempted to serialize value that set `PERSIST` to false\")\n        }\n\n        fn deserialize<'de, D>(_: D) -> Result<Self::Fields<'static>, D::Error>\n        where\n            D: zalsa_::serde::Deserializer<'de>,\n        {\n            unimplemented!(\"attempted to deserialize value that cannot set `PERSIST` to false\");\n        }\n    }\n\n    impl SyntaxContext {\n        pub fn ingredient(zalsa: &zalsa_::Zalsa) -> &zalsa_struct_::IngredientImpl<Self> {\n            static CACHE: zalsa_::IngredientCache<zalsa_struct_::IngredientImpl<SyntaxContext>> =\n                zalsa_::IngredientCache::new();\n\n            // SAFETY: The ingredient at offset 0 in `JarImpl<SyntaxContext>` has type\n            // `IngredientImpl<SyntaxContext>`.\n            unsafe { CACHE.get_or_create::<zalsa_struct_::JarImpl<SyntaxContext>, 0>(zalsa) }\n        }\n    }\n    impl zalsa_::AsId for SyntaxContext {\n        fn as_id(&self) -> salsa::Id {\n            self.as_salsa_id().expect(\"`SyntaxContext::as_id()` called on a root `SyntaxContext`\")\n        }\n    }","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/rust-lang/rust-analyzer/blob/e8f7e90aa3e7b26aa9a000200f606c1078da99ec/crates/span/src/hygiene.rs#L111-L147","documentation":"The mirror `unimplemented!()` sentinel in `Configuration::deserialize` for `SyntaxContext`: since `PERSIST = false`, no serialized form of this struct should ever exist, so deserialization is never expected to be exercised. The panic fires when the deserializer is asked to materialize a `SyntaxContextData` from persisted data, which indicates the persisted stream and the current configuration disagree.","triggerScenarios":"Thrown at crates/span/src/hygiene.rs:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether a stale on-disk database (written when the type was persistent) is being opened; clear/regenerate the salsa database","Ensure no dependent struct marks `SyntaxContext` as persistable while its own configuration sets PERSIST=false","Implement a reconstructing deserializer (e.g. map all contexts to the root context) if the type must round-trip"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e8f7e90aa3e7b26aa9a000200f606c1078da99ec","analyzedAt":"2026-09-03T21:08:06.959Z","contentChangedAt":"2026-09-03T21:08:06.959Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}