From 34d08eeca52480e96bcac2be8dcdb777608245fc Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Tue, 23 Jun 2026 22:36:02 -0700 Subject: [PATCH] symbol_mangling: mangle UnsafeBinder via erased inner type Avoid todo! ICE when an unstable unsafe-binder type reaches v0 symbol naming. Treat the binder as transparent and mangle the inner type with regions erased, consistent with other ty queries on UnsafeBinder. Signed-off-by: Sebastien Tardif --- compiler/rustc_symbol_mangling/src/v0.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index c6624a7820559..eb4e386a71844 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -587,8 +587,14 @@ impl<'tcx> Printer<'tcx> for V0SymbolMangler<'tcx> { })?; } - // FIXME(unsafe_binder): - ty::UnsafeBinder(..) => todo!(), + // Unsafe binders are transparent for symbol identity: mangle the + // inner type with regions erased (same approach as other ty queries + // on `UnsafeBinder`). No dedicated v0 letter yet; this avoids ICE + // if an unstable unsafe-binder type reaches symbol naming. + ty::UnsafeBinder(bound_ty) => { + let inner = self.tcx.instantiate_bound_regions_with_erased((*bound_ty).into()); + inner.print(self)?; + } ty::Dynamic(predicates, r) => { self.push("D");