{"record":{"id":"757af445abd27f80","repo":"biomejs/biome","slug":"unexpected-attribute-meta-text","errorCode":null,"errorMessage":"Unexpected attribute: {meta_text}","messagePattern":"Unexpected attribute: (.+?)","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/biome_deserialize_macros/src/deserializable_derive/struct_field_attrs.rs","lineNumber":97,"sourceCode":"                            ..\n                        }) => {\n                            if path.is_ident(\"rename\") {\n                                opts.rename = Some(s.value())\n                            } else if path.is_ident(\"validate\") {\n                                opts.validate = Some(s.parse()?)\n                            }\n                        }\n                        Meta::List(_) if meta.path().is_ident(\"deprecated\") => {\n                            let mut deprecated = None;\n                            parse_meta_list(meta, |meta| {\n                                let Meta::NameValue(MetaNameValue {\n                                    path,\n                                    lit: Lit::Str(s),\n                                    ..\n                                }) = meta\n                                else {\n                                    let meta_text = meta.to_token_stream().to_string();\n                                    return Err(Error::new(\n                                        meta.span(),\n                                        format_args!(\"Unexpected attribute: {meta_text}\"),\n                                    ));\n                                };\n                                deprecated = if deprecated.is_some() {\n                                    return Err(Error::new(\n                                        meta.span(),\n                                        \"Only one attribute expected inside deprecated()\",\n                                    ));\n                                } else if path.is_ident(\"message\") {\n                                    Some(DeprecatedField::Message(s.value()))\n                                } else if path.is_ident(\"use_instead\") {\n                                    Some(DeprecatedField::UseInstead(s.value()))\n                                } else {\n                                    let path_text = path.to_token_stream().to_string();\n                                    return Err(Error::new(\n                                        path.span(),\n                                        format_args!(","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_deserialize_macros/src/deserializable_derive/struct_field_attrs.rs#L79-L115","documentation":"Compile-time error from the #[deserializable] derive of biome_deserialize_macros (struct_field_attrs.rs:97). Inside the deprecated(...) attribute on a struct field, every nested item must be a name-value pair with a string literal (message = \"...\" or use_instead = \"...\"). Any other shape - a bare word like deprecated(note), a nested list, or a non-string literal like deprecated(message = 5) - fails the Meta::NameValue-with-Lit::Str pattern match and produces this 'Unexpected attribute' error at the offending token span.","triggerScenarios":"Writing #[deserializable(deprecated(anything))] (bare path), #[deserializable(deprecated(message = 5))] (integer literal), or #[deserializable(deprecated(\"use bar\"))] (string literal instead of name-value) on a field of a type deriving Deserializable.","commonSituations":"Adding deprecation metadata to configuration option structs in biome_configuration or downstream crates using biome_deserialize; copy-pasting serde-style syntax (since = \"1.2\", note = \"...\") which this macro does not support inside deprecated().","solutions":["Use the two supported keys with string literals: #[deserializable(deprecated(message = \"Use `otherField` instead.\"))] or deprecated(use_instead = \"OtherField\")","If you wanted version metadata like since = \"1.2\", drop it - only message and use_instead are supported inside deprecated()","Run cargo check on the crate after editing attributes; the error points at the exact nested token span"],"exampleFix":"// before\n#[deserializable(deprecated(since = \"1.2\"))]\npub old_option: bool,\n\n// after\n#[deserializable(deprecated(use_instead = \"NewOption\"))]\npub old_option: bool,","handlingStrategy":"validation","validationCode":"// Rust - only these two shapes are valid inside deprecated()\n#[deserializable(deprecated(message = \"Use `new_field` instead.\"))]\npub old_field: bool,\n#[deserializable(deprecated(use_instead = \"NewField\"))]\npub other: bool,","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inside deprecated(...) always write key = \"string literal\"; never bare words or non-string literals","Keep a compiling reference field with deprecated(...) in the crate to copy syntax from","Run cargo check immediately after editing derive attributes so the span points at the bad token"],"tags":["rust","proc-macro","compile-time","deserializable","attributes"],"backgroundTag":"derive-macro-attribute-validation","analyzedSha":"405dedb0ff65dd29927faf587f6542e3c29db248","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}