{"record":{"id":"f4bf6746b69f90d7","repo":"rust-lang/rust","slug":"unsafe-binders-are-not-implemented-yet","errorCode":null,"errorMessage":"unsafe binders are not implemented yet","messagePattern":"unsafe binders are not implemented yet","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/tools/clippy/clippy_lints/src/utils/author.rs","lineNumber":718,"sourceCode":"                    self.expr(field!(field.expr));\n                });\n                base.if_some(|e| self.expr(e));\n            },\n            ExprKind::ConstBlock(_) => kind!(\"ConstBlock(_)\"),\n            ExprKind::Repeat(value, length) => {\n                bind!(self, value, length);\n                kind!(\"Repeat({value}, {length})\");\n                self.expr(value);\n                self.const_arg(length);\n            },\n            ExprKind::Err(_) => kind!(\"Err(_)\"),\n            ExprKind::DropTemps(expr) => {\n                bind!(self, expr);\n                kind!(\"DropTemps({expr})\");\n                self.expr(expr);\n            },\n            ExprKind::UnsafeBinderCast(..) => {\n                unimplemented!(\"unsafe binders are not implemented yet\");\n            },\n        }\n    }\n\n    fn block(&self, block: &Binding<&hir::Block<'_>>) {\n        self.slice(field!(block.stmts), |stmt| self.stmt(stmt));\n        self.option(field!(block.expr), \"trailing_expr\", |expr| {\n            self.expr(expr);\n        });\n    }\n\n    fn body(&self, body_id: &Binding<hir::BodyId>) {\n        let expr = self.cx.tcx.hir_body(body_id.value).value;\n        bind!(self, expr);\n        chain!(self, \"{expr} = &cx.tcx.hir_body({body_id}).value\");\n        self.expr(expr);\n    }\n","sourceCodeStart":700,"sourceCodeEnd":736,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/clippy/clippy_lints/src/utils/author.rs#L700-L736","documentation":"Clippy's author lint (clippy_lints::utils::author) prints Rust patterns that mirror the AST a lint author wants to match. It walks HIR expressions but has no handling for ExprKind::UnsafeBinderCast (the unstable unsafe_binders cast node), so it panics with unimplemented!(\"unsafe binders are not implemented yet\") at author.rs:718.","triggerScenarios":"Running clippy with the author lint (-A clippy::author or CLIPPY_AUTHOR=...) on code that contains an unsafe binder cast expression (#![feature(unsafe_binders)] using the wrap/unwrap cast syntax).","commonSituations":"Lint authors experimenting with unsafe_binders code while using the author lint to learn the AST shape; running clippy author over a crate that enables the unstable feature.","solutions":["Do not run the author lint on code containing UnsafeBinderCast expressions.","Remove/comment out the unsafe binder cast before invoking CLIPPY_AUTHOR.","Isolate the snippet you want to learn about and author-lint only that part without the binder cast.","Upstream an author.rs branch that emits the UnsafeBinderCast pattern."],"exampleFix":"// before\n#![feature(unsafe_binders)]\n$ CLIPPY_AUTHOR=1 cargo clippy   // hits UnsafeBinderCast -> panic\n\n// after: drop the binder cast before author-linting\nlet v: &T = unsafe { value }; // ordinary expression, then author-lint","handlingStrategy":"validation","validationCode":"// Do not run the author lint on code with UnsafeBinderCast nodes.\n// Strip the #![feature(unsafe_binders)] cast expressions before CLIPPY_AUTHOR=1.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not author-lint code that uses unsafe binders.","Isolate snippets for the author lint away from binder casts.","Upstream the missing author.rs branch."],"tags":["clippy","author-lint","unsafe-binders","nightly","tooling"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}