{"record":{"id":"5ad69864ebddf2d9","repo":"tracel-ai/burn","slug":"path-meta-unsupported","errorCode":null,"errorMessage":"Path meta unsupported","messagePattern":"Path meta unsupported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-derive/src/shared/attribute.rs","lineNumber":21,"sourceCode":"pub struct AttributeAnalyzer {\n    attr: Attribute,\n}\n\n#[derive(Clone)]\npub struct AttributeItem {\n    pub value: syn::Lit,\n}\n\nimpl AttributeAnalyzer {\n    pub fn new(attr: Attribute) -> Self {\n        Self { attr }\n    }\n\n    pub fn item(&self) -> AttributeItem {\n        let value = match &self.attr.meta {\n            Meta::List(val) => val.parse_args::<syn::MetaNameValue>().unwrap(),\n            Meta::NameValue(meta) => meta.clone(),\n            Meta::Path(_) => panic!(\"Path meta unsupported\"),\n        };\n\n        let lit = match value.value {\n            syn::Expr::Lit(lit) => lit.lit,\n            _ => panic!(\"Only literal is supported\"),\n        };\n\n        AttributeItem { value: lit }\n    }\n\n    pub fn has_name(&self, name: &str) -> bool {\n        Self::path_syn_name(self.attr.path()) == name\n    }\n\n    fn path_syn_name(path: &syn::Path) -> String {\n        let length = path.segments.len();\n        let mut name = String::new();\n        for (i, segment) in path.segments.iter().enumerate() {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-derive/src/shared/attribute.rs#L3-L39","documentation":"Attribute-syntax guard in the shared derive helper: `AttributeAnalyzer::item` accepts only list-style (`#[attr(key = value)]`) and name-value (`#[attr = \"x\"]`) metadata; a bare path attribute like `#[attr]` with no value reaches the `Meta::Path` arm and panics during macro expansion. The failing input is an attribute written without an `= value` part.","triggerScenarios":"Thrown at crates/burn-derive/src/shared/attribute.rs:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain literal (string, integer, bool) as the attribute value instead of an expression.","Precompute the value in source (e.g. `1_024` not `1024 * 1024` is still a literal; function calls are not).","Extend `AttributeAnalyzer` to evaluate constant expressions if dynamic values are genuinely required."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}