diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_const_eval/src/check_consts/check.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/callee.rs | 2 |
2 files changed, 4 insertions, 10 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; diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index f9a21a9bef3..481a5f3a921 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -847,7 +847,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // This can be done as soon as we convert the standard library back to // using const traits, since if we were to enforce these conditions now, // we'd fail on basically every builtin trait call (i.e. `1 + 2`). - if !self.tcx.features().effects() { + if !self.tcx.features().const_trait_impl() { return; } |
