Skip to content

Commit 20499b9

Browse files
committed
add InlineConst check
1 parent 0b475c7 commit 20499b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_middle/src/mir/interpret/queries.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ impl<'tcx> TyCtxt<'tcx> {
9595
// used generic parameters is a bug of evaluation, so checking for it
9696
// here does feel somewhat sensible.
9797
if !self.features().generic_const_exprs && ct.substs.has_non_region_param() {
98-
assert!(matches!(self.def_kind(ct.def), DefKind::AnonConst));
98+
assert!(matches!(
99+
self.def_kind(ct.def),
100+
DefKind::InlineConst | DefKind::AnonConst
101+
));
99102
let mir_body = self.mir_for_ctfe(ct.def);
100103
if mir_body.is_polymorphic {
101104
let Some(local_def_id) = ct.def.as_local() else { return };

0 commit comments

Comments
 (0)