Define const_unification_error

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-03-08 01:17:28 +00:00
parent 05ac3ac575
commit b9b9994c72

View File

@ -597,6 +597,15 @@ fn compare<F>(&self, t: T, f: F) -> RelateResult<'tcx, T> where
}
}
pub fn const_unification_error<'tcx>(
a_is_expected: bool,
(a, b): (&'tcx LazyConst<'tcx>, &'tcx LazyConst<'tcx>),
) -> TypeError<'tcx> {
TypeError::ConstError(
ConstError::Mismatch(ty::relate::expected_found_bool(a_is_expected, &a, &b))
)
}
fn int_unification_error<'tcx>(a_is_expected: bool, v: (ty::IntVarValue, ty::IntVarValue))
-> TypeError<'tcx>
{