Rollup merge of #102133 - b-naber:use-valtrees-in-fast-reject, r=lcnr

Use valtrees for comparison

r? `@lcnr`
This commit is contained in:
Matthias Krüger 2022-09-22 21:34:54 +02:00 committed by GitHub
commit aa384834d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,14 +384,7 @@ pub fn consts_may_unify(self, obligation_ct: ty::Const<'_>, impl_ct: ty::Const<'
// they might unify with any value.
ty::ConstKind::Unevaluated(_) | ty::ConstKind::Error(_) => true,
ty::ConstKind::Value(obl) => match k {
ty::ConstKind::Value(imp) => {
// FIXME(valtrees): Once we have valtrees, we can just
// compare them directly here.
match (obl.try_to_scalar_int(), imp.try_to_scalar_int()) {
(Some(obl), Some(imp)) => obl == imp,
_ => true,
}
}
ty::ConstKind::Value(imp) => obl == imp,
_ => true,
},