From 7dbc821f654fe6bc6f40c58b93f159ce84dac16a Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Tue, 23 Jun 2026 22:23:53 -0700 Subject: [PATCH] const_eval: treat UnsafeBinder as compound in validity checks Replace todo!() with interp_ok(false) so the validator visits the inner value like other non-primitive types (Adt/Closure/Coroutine/etc.). Part of #567 Signed-off-by: Sebastien Tardif --- compiler/rustc_const_eval/src/interpret/validity.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 224337e68cfbf..aac1dfa4a3cb8 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -995,7 +995,9 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { // Nothing to check. interp_ok(true) } - ty::UnsafeBinder(_) => todo!("FIXME(unsafe_binder)"), + // Unsafe binders are compound: validate the inner value (same as other + // non-primitive types that are not layout-less). + ty::UnsafeBinder(_) => interp_ok(false), // The above should be all the primitive types. The rest is compound, we // check them by visiting their fields/variants. ty::Adt(..)