Skip to content

Commit b9b9994

Browse files
varkoryodaldevoid
andcommitted
Define const_unification_error
Co-Authored-By: Gabriel Smith <[email protected]>
1 parent 05ac3ac commit b9b9994

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/infer/combine.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@ impl<'tcx, T:Clone + PartialEq> RelateResultCompare<'tcx, T> for RelateResult<'t
597597
}
598598
}
599599

600+
pub fn const_unification_error<'tcx>(
601+
a_is_expected: bool,
602+
(a, b): (&'tcx LazyConst<'tcx>, &'tcx LazyConst<'tcx>),
603+
) -> TypeError<'tcx> {
604+
TypeError::ConstError(
605+
ConstError::Mismatch(ty::relate::expected_found_bool(a_is_expected, &a, &b))
606+
)
607+
}
608+
600609
fn int_unification_error<'tcx>(a_is_expected: bool, v: (ty::IntVarValue, ty::IntVarValue))
601610
-> TypeError<'tcx>
602611
{

0 commit comments

Comments
 (0)