Skip to content

Commit

Permalink
generic smir stable impl for Binder
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmarkmartin committed Jul 24, 2023
1 parent 8771282 commit c2158a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c2158a4

Please sign in to comment.