From 9368b9f57e7e3a82b5becdfd17a1eeb606e6fd5f Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 30 Sep 2024 00:34:58 -0400 Subject: [PATCH] Debug assert that unevaluated consts have the right substs --- compiler/rustc_middle/src/ty/consts.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index 73d0acf95f4..ebc6cac3c42 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -109,6 +109,7 @@ impl<'tcx> Const<'tcx> { #[inline] 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)) }