@@ -1288,7 +1288,13 @@ impl<'self> LookupContext<'self> {
1288
1288
fn report_candidate ( & self , idx : uint , origin : & method_origin ) {
1289
1289
match * origin {
1290
1290
method_static( impl_did) => {
1291
- self . report_static_candidate ( idx, impl_did)
1291
+ // If it is an instantiated default method, use the original
1292
+ // default method for error reporting.
1293
+ let did = match provided_source ( self . tcx ( ) , impl_did) {
1294
+ None => impl_did,
1295
+ Some ( did) => did
1296
+ } ;
1297
+ self . report_static_candidate ( idx, did)
1292
1298
}
1293
1299
method_param( ref mp) => {
1294
1300
self . report_param_candidate ( idx, ( * mp) . trait_id )
@@ -1302,7 +1308,8 @@ impl<'self> LookupContext<'self> {
1302
1308
fn report_static_candidate ( & self , idx : uint , did : DefId ) {
1303
1309
let span = if did. crate == ast:: LOCAL_CRATE {
1304
1310
match self . tcx ( ) . items . find ( & did. node ) {
1305
- Some ( & ast_map:: node_method( m, _, _) ) => m. span ,
1311
+ Some ( & ast_map:: node_method( m, _, _) )
1312
+ | Some ( & ast_map:: node_trait_method( @ast:: provided( m) , _, _) ) => m. span ,
1306
1313
_ => fail2 ! ( "report_static_candidate: bad item {:?}" , did)
1307
1314
}
1308
1315
} else {
0 commit comments