{"record":{"id":"9ef1ccc08047b56c","repo":"biomejs/biome","slug":"only-one-attribute-expected-inside-deprecated","errorCode":null,"errorMessage":"Only one attribute expected inside deprecated()","messagePattern":"Only one attribute expected inside deprecated\\(\\)","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/biome_deserialize_macros/src/deserializable_derive/struct_field_attrs.rs","lineNumber":103,"sourceCode":"                            }\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!(\n                                            \"Unexpected attribute inside deprecated(): {path_text}\"\n                                        ),\n                                    ));\n                                };\n                                Ok(())\n                            })?;","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_deserialize_macros/src/deserializable_derive/struct_field_attrs.rs#L85-L121","documentation":"Compile-time error from the #[deserializable] derive (struct_field_attrs.rs:103). The deprecated(...) attribute accepts at most one inner option; the parser stores the first message/use_instead it sees, and a second item inside the same list makes the deprecated.is_some() branch return this 'Only one attribute expected inside deprecated()' error.","triggerScenarios":"Writing both keys in one attribute: #[deserializable(deprecated(message = \"...\", use_instead = \"...\"))], or repeating a key: deprecated(message = \"a\", message = \"b\").","commonSituations":"Wanting to show both a custom message and a replacement-field suggestion in the same deprecation; merging two reviewed attribute snippets produces a list with two items.","solutions":["Keep exactly one option inside deprecated(); prefer use_instead = \"NewField\" when a replacement field exists - Biome derives the user-facing message from it","If both a custom message and a replacement are genuinely needed, check the current macro source/changeset - as of this code only one is allowed, so pick the more useful one"],"exampleFix":"// before\n#[deserializable(deprecated(message = \"Use new_field\", use_instead = \"NewField\"))]\npub old_field: bool,\n\n// after\n#[deserializable(deprecated(use_instead = \"NewField\"))]\npub old_field: bool,","handlingStrategy":"validation","validationCode":"// Rust - exactly one item inside deprecated()\n#[deserializable(deprecated(use_instead = \"NewField\"))] // not both keys at once\npub old_field: bool,","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One deprecated() attribute carries one option; combine nothing","Prefer use_instead when a replacement field exists - it drives Biome's fix suggestions","grep the crate for 'deprecated(' before merging to catch doubled keys early"],"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"}