From c2158a44e1674f03e839d85e05d12554ccaa813e Mon Sep 17 00:00:00 2001 From: Eric Mark Martin Date: Sun, 23 Jul 2023 23:52:19 -0400 Subject: [PATCH] generic smir stable impl for Binder --- compiler/rustc_smir/src/rustc_smir/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_smir/src/rustc_smir/mod.rs b/compiler/rustc_smir/src/rustc_smir/mod.rs index 97bde5c3c1919..1b8c78fc2801e 100644 --- a/compiler/rustc_smir/src/rustc_smir/mod.rs +++ b/compiler/rustc_smir/src/rustc_smir/mod.rs @@ -525,13 +525,17 @@ impl<'tcx> Stable<'tcx> for ty::GenericArgs<'tcx> { } } -impl<'tcx> Stable<'tcx> for ty::PolyFnSig<'tcx> { - type T = stable_mir::ty::PolyFnSig; +impl<'tcx, S, V> Stable<'tcx> for ty::Binder<'tcx, S> +where + S: Stable<'tcx, T = V>, +{ + type T = stable_mir::ty::Binder; + fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T { use stable_mir::ty::Binder; Binder { - value: self.skip_binder().stable(tables), + value: self.as_ref().skip_binder().stable(tables), bound_vars: self .bound_vars() .iter()