about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Koropoff <bkoropoff@gmail.com>2014-10-03 22:35:16 -0700
committerBrian Koropoff <bkoropoff@gmail.com>2014-10-03 22:36:54 -0700
commit4c166abbbb4e11f9464f97a468fcd34dbc3d2fb5 (patch)
tree3d410bc7c247d115f2ed909e23da261c3d246a79 /src
parent908c9e6a1b94674eee2727edb25dda58727a03b7 (diff)
downloadrust-4c166abbbb4e11f9464f97a468fcd34dbc3d2fb5.tar.gz
rust-4c166abbbb4e11f9464f97a468fcd34dbc3d2fb5.zip
Handle provided trait methods when giving inference error suggestions
This fixes an ICE.  Closes issue #17758
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/typeck/infer/error_reporting.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/librustc/middle/typeck/infer/error_reporting.rs b/src/librustc/middle/typeck/infer/error_reporting.rs
index 8ff5b3c9024..2a8a695b63e 100644
--- a/src/librustc/middle/typeck/infer/error_reporting.rs
+++ b/src/librustc/middle/typeck/infer/error_reporting.rs
@@ -869,6 +869,19 @@ impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx> {
                         ast::TypeImplItem(_) => None,
                     }
                 },
+                ast_map::NodeTraitItem(ref item) => {
+                    match **item {
+                        ast::ProvidedMethod(ref m) => {
+                            Some((m.pe_fn_decl(),
+                                  m.pe_generics(),
+                                  m.pe_fn_style(),
+                                  m.pe_ident(),
+                                  Some(&m.pe_explicit_self().node),
+                                  m.span))
+                        }
+                        _ => None
+                    }
+                }
                 _ => None
             },
             None => None