{"record":{"id":"d325cbb2fd43d65d","repo":"swc-project/swc","slug":"unknown-ast-node-option","errorCode":null,"errorMessage":"unknown ast_node option","messagePattern":"unknown ast_node option","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/ast_node/src/ast_node_macro.rs","lineNumber":24,"sourceCode":"\n#[derive(Clone)]\npub struct Args {\n    pub ty: Literal,\n    pub no_partial_eq: bool,\n}\n\nimpl Parse for Args {\n    fn parse(i: ParseStream<'_>) -> syn::Result<Self> {\n        let ty = i.parse()?;\n        let mut no_partial_eq = false;\n\n        if i.parse::<Option<Token![,]>>()?.is_some() {\n            let option: Ident = i.parse()?;\n\n            if option == \"no_partial_eq\" {\n                no_partial_eq = true;\n            } else {\n                return Err(Error::new(option.span(), \"unknown ast_node option\"));\n            }\n        }\n\n        if !i.is_empty() {\n            return Err(i.error(\"unexpected ast_node arguments\"));\n        }\n\n        Ok(Args { ty, no_partial_eq })\n    }\n}\n\npub fn expand_struct(args: Args, i: DeriveInput) -> Vec<ItemImpl> {\n    let mut items = Vec::new();\n    let generics = i.generics.clone();\n    // let item_ident = Ident::new(\"Item\", i.ident.span());\n\n    {\n        let ty = &i.ident;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/ast_node/src/ast_node_macro.rs#L6-L42","documentation":"The #[ast_node] attribute macro's Args parser accepts only the `no_partial_eq` option after the type; any other identifier makes the proc macro return this syn::Error at the option's span, failing compilation of the annotated item.","triggerScenarios":"Thrown at crates/ast_node/src/ast_node_macro.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only the supported `no_partial_eq` option in the #[ast_node] invocation","Fix the typo in the attribute name","Extend Args::parse if a genuinely new option is required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}