From 20499b96692e35e9bcfd1d97d8bc9640c1e5d345 Mon Sep 17 00:00:00 2001 From: James Dietz Date: Wed, 14 Jun 2023 18:01:05 -0400 Subject: [PATCH] add InlineConst check --- compiler/rustc_middle/src/mir/interpret/queries.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/mir/interpret/queries.rs b/compiler/rustc_middle/src/mir/interpret/queries.rs index f53dc8cb0ec..ae32a54be3d 100644 --- a/compiler/rustc_middle/src/mir/interpret/queries.rs +++ b/compiler/rustc_middle/src/mir/interpret/queries.rs @@ -95,7 +95,10 @@ pub fn const_eval_resolve_for_typeck( // used generic parameters is a bug of evaluation, so checking for it // here does feel somewhat sensible. if !self.features().generic_const_exprs && ct.substs.has_non_region_param() { - assert!(matches!(self.def_kind(ct.def), DefKind::AnonConst)); + assert!(matches!( + self.def_kind(ct.def), + DefKind::InlineConst | DefKind::AnonConst + )); let mir_body = self.mir_for_ctfe(ct.def); if mir_body.is_polymorphic { let Some(local_def_id) = ct.def.as_local() else { return };