{"record":{"id":"a69cf6b31d10a98f","repo":"slint-ui/slint","slug":"vtable-cannot-be-mutable","errorCode":null,"errorMessage":"VTable cannot be mutable","messagePattern":"VTable cannot be mutable","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"helper_crates/vtable/macro/macro.rs","lineNumber":313,"sourceCode":"                sig_extern.inputs.push(typed_arg.clone());\n\n                // check for the vtable\n                let ptr_target = match &param.ty {\n                    Type::Ptr(TypePtr { mutability, elem, .. }) => {\n                        Some((matches!(mutability, PointerMutability::Mut(_)), elem))\n                    }\n                    Type::Reference(TypeReference { mutability, elem, .. }) => {\n                        Some((mutability.is_some(), elem))\n                    }\n                    _ => None,\n                };\n                if let Some((is_mut, elem)) = ptr_target\n                    && let Type::Path(p) = &**elem\n                    && let Some(pointer_to) = p.path.get_ident()\n                    && pointer_to == &vtable_name\n                {\n                    if is_mut {\n                        return Error::new(p.span(), \"VTable cannot be mutable\")\n                            .to_compile_error()\n                            .into();\n                    }\n                    if call_code.is_some() || !sig.inputs.is_empty() {\n                        return Error::new(p.span(), \"VTable pointer need to be the first\")\n                            .to_compile_error()\n                            .into();\n                    }\n                    call_code = Some(quote!(vtable as _,));\n                    continue;\n                }\n\n                let (is_pin, self_ty) = match is_pin(&param.ty) {\n                    Some(t) => (true, t),\n                    None => (false, &param.ty),\n                };\n\n                // check for self","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/helper_crates/vtable/macro/macro.rs#L295-L331","documentation":"Error \"VTable cannot be mutable\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at helper_crates/vtable/macro/macro.rs:313 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the 'mut' qualifier from the vtable field.","Access the vtable through an immutable reference."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}