about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-30 17:42:31 +0000
committerMichael Goulet <michael@errs.io>2024-11-03 18:48:24 +0000
commitace9e4c078ee91dc2e809cc563776ddadefddf44 (patch)
tree273c00f80c04f5b527ced6a6a0a7f21aedb12496 /compiler/rustc_const_eval/src
parent7028d9318fadc20e5e3058d52e44d785d31a6aaa (diff)
downloadrust-ace9e4c078ee91dc2e809cc563776ddadefddf44.tar.gz
rust-ace9e4c078ee91dc2e809cc563776ddadefddf44.zip
Gate checking ~const bounds on const_trait_impl
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/check_consts/check.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs
index 303c490d827..4583712c2c7 100644
--- a/compiler/rustc_const_eval/src/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/check_consts/check.rs
@@ -20,7 +20,6 @@ use rustc_mir_dataflow::Analysis;
 use rustc_mir_dataflow::impls::MaybeStorageLive;
 use rustc_mir_dataflow::storage::always_storage_live_locals;
 use rustc_span::{Span, Symbol, sym};
-use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
 use rustc_trait_selection::traits::{
     Obligation, ObligationCause, ObligationCauseCode, ObligationCtxt,
 };
@@ -419,13 +418,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
 
         let errors = ocx.select_all_or_error();
         if !errors.is_empty() {
-            // FIXME(effects): Soon this should be unconditionally delaying a bug.
-            if matches!(call_source, CallSource::Normal) && tcx.features().effects() {
-                tcx.dcx()
-                    .span_delayed_bug(call_span, "this should have reported a ~const error in HIR");
-            } else {
-                infcx.err_ctxt().report_fulfillment_errors(errors);
-            }
+            tcx.dcx()
+                .span_delayed_bug(call_span, "this should have reported a ~const error in HIR");
         }
     }
 }
@@ -664,7 +658,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                     // so we only error if the trait isn't const. We try to resolve the trait
                     // into the concrete method, and uses that for const stability checks.
                     // FIXME(effects) we might consider moving const stability checks to typeck as well.
-                    if tcx.features().effects() && trait_is_const {
+                    if tcx.features().const_trait_impl() && trait_is_const {
                         // This skips the check below that ensures we only call `const fn`.
                         is_trait = true;