{"record":{"id":"473c5582c2bc521c","repo":"rust-lang/rust","slug":"fixme-unsafe-binder","errorCode":null,"errorMessage":"FIXME(unsafe_binder)","messagePattern":"FIXME\\(unsafe_binder\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_const_eval/src/interpret/validity.rs","lineNumber":951,"sourceCode":"                    // pointer handling in `deref_pointer`.\n                    if matches!(scalar, Scalar::Int(..)) {\n                        self.ecx.clear_provenance(value)?;\n                    }\n                    self.add_data_range_place(value);\n                }\n                interp_ok(true)\n            }\n            ty::Never => {\n                throw_validation_failure!(\n                    self.path,\n                    format!(\"encountered a value of the never type `!`\")\n                )\n            }\n            ty::Foreign(..) | ty::FnDef(..) => {\n                // Nothing to check.\n                interp_ok(true)\n            }\n            ty::UnsafeBinder(_) => unimplemented!(\"FIXME(unsafe_binder)\"),\n            // The above should be all the primitive types. The rest is compound, we\n            // check them by visiting their fields/variants.\n            ty::Adt(..)\n            | ty::Tuple(..)\n            | ty::Array(..)\n            | ty::Slice(..)\n            | ty::Str\n            | ty::Dynamic(..)\n            | ty::Closure(..)\n            | ty::Pat(..)\n            | ty::CoroutineClosure(..)\n            | ty::Coroutine(..) => interp_ok(false),\n            // Some types only occur during typechecking, they have no layout.\n            // We should not see them here and we could not check them anyway.\n            ty::Error(_)\n            | ty::Infer(..)\n            | ty::Placeholder(..)\n            | ty::Bound(..)","sourceCodeStart":933,"sourceCodeEnd":969,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_const_eval/src/interpret/validity.rs#L933-L969","documentation":"An `unimplemented!(\"FIXME(unsafe_binder)\")` ICE in the const-eval interpreter's value validator (`validity.rs`). When the validator walks a value whose type is `ty::UnsafeBinder`, it has no validation logic yet and panics. `UnsafeBinder` is an unstable in-progress language feature, so the const-eval path is explicitly marked unfinished.","triggerScenarios":"Const-evaluating or validating a constant (e.g. `const` item, array length, static initializer) whose type contains an `UnsafeBinder` (e.g. via the `unsafe binder` nightly feature's `Wrap<'a>`/binder types). The validity visitor reaches the `ty::UnsafeBinder(_)` arm at validity.rs:951.","commonSituations":"Experimenting with the unstable `unsafe binder` (`#![feature(unsafe_binder)]`) feature in const context — declaring a const whose type is or contains an unsafe binder, or running Miri/validation on such a value.","solutions":["Do not use `unsafe binder` types in `const`/`static` initializers or other const-evaluated contexts; move them to runtime code.","Disable the `unsafe_binder` feature gate for the affected crate.","Update to a newer nightly where the FIXME is resolved; otherwise track the upstream issue."],"exampleFix":"// before (unsafe binder in const -> ICE)\n#![feature(unsafe_binder)]\nconst C: unsafe<'a> Wrap<'a, u8> = ...;\n\n// after — keep unsafe binder out of const context\n#![feature(unsafe_binder)]\nfn make() -> unsafe<'a> Wrap<'a, u8> { ... }","handlingStrategy":"validation","validationCode":"# Reject unsafe binder usage in const context before compiling\nif rg -q 'feature(unsafe_binder)' src/ && rg -n 'const [A-Z_0-9]+:.*unsafe' src/; then\n  echo \"avoid: unsafe binder in const initializer triggers FIXME(unsafe_binder) in const-eval\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep `unsafe binder` types out of `const`/`static` initializers.","Treat `unsafe_binder` as runtime-only until the FIXME is resolved.","Gate the feature behind a runtime-only module."],"tags":["rustc","const-eval","unsafe-binder","nightly","ice","compiler-internal","unfinished-feature"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}