Skip to content

Commit

Permalink
Debug assert that unevaluated consts have the right substs
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Sep 30, 2024
1 parent 4e91ced commit 9368b9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/ty/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 9368b9f

Please sign in to comment.