@@ -419,7 +419,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
419419 error_code : TypeAnnotationNeeded ,
420420 should_label_span : bool ,
421421 param_env : ty:: ParamEnv < ' tcx > ,
422- predicate : Option < ty:: Predicate < ' tcx > > ,
422+ originating_projection : Option < ty:: ProjectionPredicate < ' tcx > > ,
423423 ) -> Diag < ' a > {
424424 let arg = self . resolve_vars_if_possible ( arg) ;
425425 let arg_data = self . extract_inference_diagnostics_data ( arg, None ) ;
@@ -468,7 +468,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
468468 && let Some ( ty) = typeck_results. node_type_opt ( rcvr. hir_id )
469469 {
470470 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,
472476 ) ;
473477 }
474478
@@ -601,7 +605,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
601605 def_id,
602606 false ,
603607 param_env,
604- predicate ,
608+ originating_projection ,
605609 ) ;
606610 if paths. len ( ) > 20 || paths. is_empty ( ) {
607611 // This will show the fallback impl, so the expression will have type
@@ -680,7 +684,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
680684 def_id : DefId ,
681685 target_type : bool ,
682686 param_env : ty:: ParamEnv < ' tcx > ,
683- predicate : Option < ty:: Predicate < ' tcx > > ,
687+ originating_projection : Option < ty:: ProjectionPredicate < ' tcx > > ,
684688 ) -> Vec < String > {
685689 let tcx = self . infcx . tcx ;
686690 let mut paths = vec ! [ ] ;
@@ -703,8 +707,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
703707 let filter = if let Some ( ty:: ProjectionPredicate {
704708 projection_term : ty:: AliasTerm { def_id, .. } ,
705709 term,
706- } ) =
707- predicate. and_then ( |p| p. as_projection_clause ( ) ) . map ( |p| p. skip_binder ( ) )
710+ } ) = originating_projection
708711 && let ty:: TermKind :: Ty ( assoc_ty) = term. unpack ( )
709712 && tcx. item_name ( def_id) == sym:: Output
710713 && [
0 commit comments