@@ -419,7 +419,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
419
419
error_code : TypeAnnotationNeeded ,
420
420
should_label_span : bool ,
421
421
param_env : ty:: ParamEnv < ' tcx > ,
422
- predicate : Option < ty:: Predicate < ' tcx > > ,
422
+ originating_projection : Option < ty:: ProjectionPredicate < ' tcx > > ,
423
423
) -> Diag < ' a > {
424
424
let arg = self . resolve_vars_if_possible ( arg) ;
425
425
let arg_data = self . extract_inference_diagnostics_data ( arg, None ) ;
@@ -468,7 +468,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
468
468
&& let Some ( ty) = typeck_results. node_type_opt ( rcvr. hir_id )
469
469
{
470
470
paths = self . get_fully_qualified_path_suggestions_from_impls (
471
- ty, def_id, true , param_env, predicate,
471
+ ty,
472
+ def_id,
473
+ true ,
474
+ param_env,
475
+ originating_projection,
472
476
) ;
473
477
}
474
478
@@ -601,7 +605,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
601
605
def_id,
602
606
false ,
603
607
param_env,
604
- predicate ,
608
+ originating_projection ,
605
609
) ;
606
610
if paths. len ( ) > 20 || paths. is_empty ( ) {
607
611
// This will show the fallback impl, so the expression will have type
@@ -680,7 +684,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
680
684
def_id : DefId ,
681
685
target_type : bool ,
682
686
param_env : ty:: ParamEnv < ' tcx > ,
683
- predicate : Option < ty:: Predicate < ' tcx > > ,
687
+ originating_projection : Option < ty:: ProjectionPredicate < ' tcx > > ,
684
688
) -> Vec < String > {
685
689
let tcx = self . infcx . tcx ;
686
690
let mut paths = vec ! [ ] ;
@@ -703,8 +707,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
703
707
let filter = if let Some ( ty:: ProjectionPredicate {
704
708
projection_term : ty:: AliasTerm { def_id, .. } ,
705
709
term,
706
- } ) =
707
- predicate. and_then ( |p| p. as_projection_clause ( ) ) . map ( |p| p. skip_binder ( ) )
710
+ } ) = originating_projection
708
711
&& let ty:: TermKind :: Ty ( assoc_ty) = term. unpack ( )
709
712
&& tcx. item_name ( def_id) == sym:: Output
710
713
&& [
0 commit comments