Relate impl

This commit is contained in:
Deadbeef 2021-07-24 20:11:38 +08:00
parent 3bab45d2ac
commit 779eef2dae
No known key found for this signature in database
GPG Key ID: 027DF9338862ADDD

View File

@ -214,6 +214,19 @@ impl<'tcx> Relate<'tcx> for ast::Constness {
}
}
impl<'tcx, T: Relate<'tcx>> Relate<'tcx> for ty::ConstnessAnd<T> {
fn relate<R: TypeRelation<'tcx>>(
relation: &mut R,
a: ty::ConstnessAnd<T>,
b: ty::ConstnessAnd<T>,
) -> RelateResult<'tcx, ty::ConstnessAnd<T>> {
Ok(ty::ConstnessAnd {
constness: relation.relate(a.constness, b.constness)?,
value: relation.relate(a.value, b.value)?,
})
}
}
impl<'tcx> Relate<'tcx> for ast::Unsafety {
fn relate<R: TypeRelation<'tcx>>(
relation: &mut R,