Skip to content

Commit 9368b9f

Browse files
Debug assert that unevaluated consts have the right substs
1 parent 4e91ced commit 9368b9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_middle/src/ty/consts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl<'tcx> Const<'tcx> {
109109

110110
#[inline]
111111
pub fn new_unevaluated(tcx: TyCtxt<'tcx>, uv: ty::UnevaluatedConst<'tcx>) -> Const<'tcx> {
112+
tcx.debug_assert_args_compatible(uv.def, uv.args);
112113
Const::new(tcx, ty::ConstKind::Unevaluated(uv))
113114
}
114115

0 commit comments

Comments
 (0)