{"record":{"id":"184897aed3f2fb80","repo":"bevyengine/bevy","slug":"derive-derive-name-must-be-accompanied-by","errorCode":null,"errorMessage":"#[derive({derive_name})] must be accompanied by #[specialize(..targets)].\n Example usages: #[specialize(RenderPipeline)], #[specialize(all)]","messagePattern":"#\\[derive\\((.+?)\\)\\] must be accompanied by #\\[specialize\\(\\.\\.targets\\)\\]\\.\n Example usages: #\\[specialize\\(RenderPipeline\\)\\], #\\[specialize\\(all\\)\\]","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_render/macros/src/specializer.rs","lineNumber":204,"sourceCode":"    }\n\n    Ok(field_info)\n}\n\nfn get_specialize_targets(\n    ast: &DeriveInput,\n    derive_name: &str,\n) -> syn::Result<SpecializeImplTargets> {\n    let specialize_attr = ast.attrs.iter().find_map(|attr| {\n        if attr.path().is_ident(SPECIALIZE_ATTR_IDENT)\n            && let Meta::List(meta_list) = &attr.meta\n        {\n            return Some(meta_list);\n        }\n        None\n    });\n    let Some(specialize_meta_list) = specialize_attr else {\n        return Err(syn::Error::new(\n            Span::call_site(),\n            format!(\"#[derive({derive_name})] must be accompanied by #[specialize(..targets)].\\n Example usages: #[specialize(RenderPipeline)], #[specialize(all)]\")\n        ));\n    };\n    syn::parse::<SpecializeImplTargets>(specialize_meta_list.tokens.clone().into())\n}\n\nmacro_rules! guard {\n    ($expr: expr) => {\n        match $expr {\n            Ok(__val) => __val,\n            Err(err) => return err.to_compile_error().into(),\n        }\n    };\n}\n\npub fn impl_specializer(input: TokenStream) -> TokenStream {\n    let bevy_render_path: Path = crate::bevy_render_path();","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_render/macros/src/specializer.rs#L186-L222","documentation":"The `Specializer` (and `SpecializerKey`) derive requires a companion `#[specialize(..targets)]` attribute on the same type naming the pipelines to implement for: either `all` or a comma-separated list of target paths. If no such list attribute is found on the derive input, the macro fails with this error at the call site.","triggerScenarios":"`#[derive(Specializer)]` on a type without any `#[specialize(...)]` attribute, or with a bare `#[specialize]` that has no parenthesized list payload.","commonSituations":"Adding the derive via IDE completion without the helper attribute; renaming the attribute so it no longer matches the exact `specialize` path; deleting the attribute while cleaning up 'unused' lints.","solutions":["Add `#[specialize(all)]` or `#[specialize(SomeTargetPath)]` directly on the type carrying the derive","Write it as a list: `#[specialize(RenderPipeline)]`, not `#[specialize]`","Make sure the attribute path is exactly `specialize` (the derive only recognizes that identifier)"],"exampleFix":"// before\n#[derive(Specializer)]\nstruct MyPipeline;\n\n// after\n#[derive(Specializer)]\n#[specialize(all)]\nstruct MyPipeline;","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always add #[specialize(...)] together with #[derive(Specializer)]","Write the attribute as a list: #[specialize(all)] or #[specialize(TargetPath)]","Keep the attribute name exactly `specialize`"],"tags":["bevy","specializer","proc-macro","compile-time","missing-attribute"],"backgroundTag":"derive-missing-helper-attribute","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}