diff options
| author | Eric Mark Martin <ericmarkmartin@gmail.com> | 2023-07-23 23:52:19 -0400 |
|---|---|---|
| committer | Eric Mark Martin <ericmarkmartin@gmail.com> | 2023-07-24 00:06:29 -0400 |
| commit | c2158a44e1674f03e839d85e05d12554ccaa813e (patch) | |
| tree | 9ad4100bafcfada871ffebc8bf99c0a00fc30473 | |
| parent | 8771282d4e7a5c4569e49d1f878fb3ba90a974d0 (diff) | |
| download | rust-c2158a44e1674f03e839d85e05d12554ccaa813e.tar.gz rust-c2158a44e1674f03e839d85e05d12554ccaa813e.zip | |
generic smir stable impl for Binder
| -rw-r--r-- | compiler/rustc_smir/src/rustc_smir/mod.rs | 10 |
1 files 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 97bde5c3c19..1b8c78fc280 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<V>; + 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() |
