{"record":{"id":"ef662cfc06121f33","repo":"diesel-rs/diesel","slug":"unsupported-binary-operator-for-auto-type-binary","errorCode":null,"errorMessage":"unsupported binary operator for auto_type: {binary_expression.op:?}","messagePattern":"unsupported binary operator for auto_type: (.+?)","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"dsl_auto_type/src/auto_type/expression_type_inference.rs","lineNumber":342,"sourceCode":"                    | syn::BinOp::Lt(_)\n                    | syn::BinOp::Le(_)\n                    | syn::BinOp::Ne(_)\n                    | syn::BinOp::Ge(_)\n                    | syn::BinOp::Gt(_) => return Ok(parse_quote!(bool)),\n                    syn::BinOp::AddAssign(_)\n                    | syn::BinOp::SubAssign(_)\n                    | syn::BinOp::MulAssign(_)\n                    | syn::BinOp::DivAssign(_)\n                    | syn::BinOp::RemAssign(_)\n                    | syn::BinOp::BitXorAssign(_)\n                    | syn::BinOp::BitAndAssign(_)\n                    | syn::BinOp::BitOrAssign(_)\n                    | syn::BinOp::ShlAssign(_)\n                    | syn::BinOp::ShrAssign(_) => return Ok(parse_quote!(())),\n                    _ => {\n                        // This is here because the `BinOp` enum is marked as #[non_exhaustive],\n                        // but in effect we really support all the variants\n                        return Err(syn::Error::new(\n                            op_span,\n                            format_args!(\n                                \"unsupported binary operator for auto_type: {:?}\",\n                                binary_expression.op\n                            ),\n                        ));\n                    }\n                };\n                let trait_name_ident = syn::Ident::new(trait_name, op_span);\n                let left_type = self.infer_expression_type(&binary_expression.left, None);\n                let right_type = self.infer_expression_type(&binary_expression.right, None);\n                parse_quote!(<#left_type as ::core::ops::#trait_name_ident<#right_type>>::Output)\n            }\n            (_, None) => {\n                return Err(syn::Error::new(\n                    expr.span(),\n                    \"unsupported expression for auto_type, please provide a type hint\",\n                ));","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/dsl_auto_type/src/auto_type/expression_type_inference.rs#L324-L360","documentation":"auto_type does not implement type inference for this binary operator. The offending input is the operator used in the expression; supported operators are limited to comparison and arithmetic forms with known result types.","triggerScenarios":"Thrown at dsl_auto_type/src/auto_type/expression_type_inference.rs:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the expression using a supported operator","Add an explicit type annotation for the result","Move the operation into a custom expression wrapper"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6fa6ed01b24b24248ab2a611698d0a7c6a2e9120","analyzedAt":"2026-09-07T01:50:13.074Z","contentChangedAt":"2026-09-07T01:50:13.074Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}