diff options
| author | lcnr <rust@lcnr.de> | 2024-10-29 17:07:32 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2024-10-29 17:07:32 +0100 |
| commit | 524a22e79057f2db0053bd002262fa88ea1a9947 (patch) | |
| tree | a3f23d245a38904456baac45acc650d933c19007 | |
| parent | 4f3a73a42c5571e9985ad18a00b8a9decdd53281 (diff) | |
| download | rust-524a22e79057f2db0053bd002262fa88ea1a9947.tar.gz rust-524a22e79057f2db0053bd002262fa88ea1a9947.zip | |
rebase
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/effects.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs index bd8c04b7655..60b3357810a 100644 --- a/compiler/rustc_trait_selection/src/traits/effects.rs +++ b/compiler/rustc_trait_selection/src/traits/effects.rs @@ -1,8 +1,9 @@ use rustc_hir as hir; use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferCtxt}; use rustc_infer::traits::{ImplSource, Obligation, PredicateObligation}; +use rustc_middle::span_bug; use rustc_middle::ty::fast_reject::DeepRejectCtxt; -use rustc_middle::{span_bug, ty}; +use rustc_middle::ty::{self, TypingMode}; use rustc_type_ir::solve::NoSolution; use thin_vec::ThinVec; @@ -19,7 +20,7 @@ pub fn evaluate_host_effect_obligation<'tcx>( selcx: &mut SelectionContext<'_, 'tcx>, obligation: &HostEffectObligation<'tcx>, ) -> Result<ThinVec<PredicateObligation<'tcx>>, EvaluationFailure> { - if selcx.infcx.intercrate { + if matches!(selcx.infcx.typing_mode(obligation.param_env), TypingMode::Coherence) { span_bug!( obligation.cause.span, "should not select host obligation in old solver in intercrate mode" |
