]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/compare_method.rs
Auto merge of #42362 - estebank:type, r=arielb1
[rust.git] / src / librustc_typeck / check / compare_method.rs
index 7633be24477c65b48a73f8b0c30b95855d16c5c4..8b76431fd2e6519f0b2a48db04a96f1d81556cb5 100644 (file)
@@ -550,6 +550,9 @@ fn compare_self_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                            format!("expected `{}` in impl", self_descr));
             if let Some(span) = tcx.hir.span_if_local(trait_m.def_id) {
                 err.span_label(span, format!("`{}` used in trait", self_descr));
+            } else {
+                err.note_trait_signature(trait_m.name.to_string(),
+                                         trait_m.signature(&tcx));
             }
             err.emit();
             return Err(ErrorReported);
@@ -697,6 +700,9 @@ trait `{}` has {}",
                                     } else {
                                         format!("{} parameter", trait_number_args)
                                     }));
+        } else {
+            err.note_trait_signature(trait_m.name.to_string(),
+                                     trait_m.signature(&tcx));
         }
         err.span_label(impl_span,
                        format!("expected {}, found {}",