Debug assert that unevaluated consts have the right substs

This commit is contained in:
Michael Goulet 2024-09-30 00:34:58 -04:00
parent 4e91cedaed
commit 9368b9f57e

View File

@ -109,6 +109,7 @@ impl<'tcx> Const<'tcx> {
#[inline] #[inline]
pub fn new_unevaluated(tcx: TyCtxt<'tcx>, uv: ty::UnevaluatedConst<'tcx>) -> Const<'tcx> { pub fn new_unevaluated(tcx: TyCtxt<'tcx>, uv: ty::UnevaluatedConst<'tcx>) -> Const<'tcx> {
tcx.debug_assert_args_compatible(uv.def, uv.args);
Const::new(tcx, ty::ConstKind::Unevaluated(uv)) Const::new(tcx, ty::ConstKind::Unevaluated(uv))
} }