]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
Rollup merge of #105837 - compiler-errors:issue-105728, r=estebank
[rust.git] / compiler / rustc_trait_selection / src / traits / const_evaluatable.rs
index 7cc0999478a3eddf3aeff66d0c868647ba38cf9d..f8efe9bfa9f827b3d98c2544ebb544d73849e339 100644 (file)
@@ -30,7 +30,7 @@ pub fn is_const_evaluatable<'tcx>(
     span: Span,
 ) -> Result<(), NotConstEvaluatable> {
     let tcx = infcx.tcx;
-    match unexpanded_ct.kind() {
+    match tcx.expand_abstract_consts(unexpanded_ct).kind() {
         ty::ConstKind::Unevaluated(_) | ty::ConstKind::Expr(_) => (),
         ty::ConstKind::Param(_)
         | ty::ConstKind::Bound(_, _)
@@ -138,10 +138,10 @@ pub fn is_const_evaluatable<'tcx>(
                 } else if uv.has_non_region_param() {
                     NotConstEvaluatable::MentionsParam
                 } else {
-                    let guar = infcx.tcx.sess.delay_span_bug(
-                        span,
-                        format!("Missing value for constant, but no error reported?"),
-                    );
+                    let guar = infcx
+                        .tcx
+                        .sess
+                        .delay_span_bug(span, "Missing value for constant, but no error reported?");
                     NotConstEvaluatable::Error(guar)
                 };