Skip to content

Commit d45feb3

Browse files
committed
Auto merge of #102304 - lcnr:coherence-cleanup, r=compiler-errors
remove outdated coherence hack we have a more precise detection for downstream conflicts in candidate assembly: the `is_knowable` check in `candidate_from_obligation_no_cache`. r? types cc `@nikomatsakis`
2 parents 1bb8d27 + 932f930 commit d45feb3

File tree

1 file changed

+0
-33
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+0
-33
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/select/mod.rs

-33
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use rustc_middle::mir::interpret::ErrorHandled;
3535
use rustc_middle::ty::abstract_const::NotConstEvaluatable;
3636
use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams};
3737
use rustc_middle::ty::fold::BottomUpFolder;
38-
use rustc_middle::ty::print::with_no_trimmed_paths;
3938
use rustc_middle::ty::relate::TypeRelation;
4039
use rustc_middle::ty::SubstsRef;
4140
use rustc_middle::ty::{self, EarlyBinder, PolyProjectionPredicate, ToPolyTraitRef, ToPredicate};
@@ -914,38 +913,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
914913
let unbound_input_types =
915914
stack.fresh_trait_pred.skip_binder().trait_ref.substs.types().any(|ty| ty.is_fresh());
916915

917-
if stack.obligation.polarity() != ty::ImplPolarity::Negative {
918-
// This check was an imperfect workaround for a bug in the old
919-
// intercrate mode; it should be removed when that goes away.
920-
if unbound_input_types && self.intercrate {
921-
debug!("evaluate_stack --> unbound argument, intercrate --> ambiguous",);
922-
// Heuristics: show the diagnostics when there are no candidates in crate.
923-
if self.intercrate_ambiguity_causes.is_some() {
924-
debug!("evaluate_stack: intercrate_ambiguity_causes is some");
925-
if let Ok(candidate_set) = self.assemble_candidates(stack) {
926-
if !candidate_set.ambiguous && candidate_set.vec.is_empty() {
927-
let trait_ref = stack.obligation.predicate.skip_binder().trait_ref;
928-
let self_ty = trait_ref.self_ty();
929-
let cause = with_no_trimmed_paths!({
930-
IntercrateAmbiguityCause::DownstreamCrate {
931-
trait_desc: trait_ref.print_only_trait_path().to_string(),
932-
self_desc: if self_ty.has_concrete_skeleton() {
933-
Some(self_ty.to_string())
934-
} else {
935-
None
936-
},
937-
}
938-
});
939-
940-
debug!(?cause, "evaluate_stack: pushing cause");
941-
self.intercrate_ambiguity_causes.as_mut().unwrap().insert(cause);
942-
}
943-
}
944-
}
945-
return Ok(EvaluatedToAmbig);
946-
}
947-
}
948-
949916
if unbound_input_types
950917
&& stack.iter().skip(1).any(|prev| {
951918
stack.obligation.param_env == prev.obligation.param_env

0 commit comments

Comments
 (0)