@@ -35,7 +35,6 @@ use rustc_middle::mir::interpret::ErrorHandled;
35
35
use rustc_middle:: ty:: abstract_const:: NotConstEvaluatable ;
36
36
use rustc_middle:: ty:: fast_reject:: { DeepRejectCtxt , TreatParams } ;
37
37
use rustc_middle:: ty:: fold:: BottomUpFolder ;
38
- use rustc_middle:: ty:: print:: with_no_trimmed_paths;
39
38
use rustc_middle:: ty:: relate:: TypeRelation ;
40
39
use rustc_middle:: ty:: SubstsRef ;
41
40
use rustc_middle:: ty:: { self , EarlyBinder , PolyProjectionPredicate , ToPolyTraitRef , ToPredicate } ;
@@ -914,38 +913,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
914
913
let unbound_input_types =
915
914
stack. fresh_trait_pred . skip_binder ( ) . trait_ref . substs . types ( ) . any ( |ty| ty. is_fresh ( ) ) ;
916
915
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
-
949
916
if unbound_input_types
950
917
&& stack. iter ( ) . skip ( 1 ) . any ( |prev| {
951
918
stack. obligation . param_env == prev. obligation . param_env
0 commit comments