@@ -468,7 +468,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
468
468
469
469
debug ! ( "assemble_inherent_impl_probe {:?}" , impl_def_id) ;
470
470
471
- let item = match self . associated_item ( impl_def_id) {
471
+ let item = match self . impl_or_trait_item ( impl_def_id) {
472
472
Some ( m) => m,
473
473
None => {
474
474
return ;
@@ -598,7 +598,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
598
598
599
599
let tcx = self . tcx ;
600
600
for bound_trait_ref in traits:: transitive_bounds ( tcx, bounds) {
601
- let item = match self . associated_item ( bound_trait_ref. def_id ( ) ) {
601
+ let item = match self . impl_or_trait_item ( bound_trait_ref. def_id ( ) ) {
602
602
Some ( v) => v,
603
603
None => {
604
604
continue ;
@@ -1350,15 +1350,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
1350
1350
self . tcx . erase_late_bound_regions ( value)
1351
1351
}
1352
1352
1353
- /// Find item with name `item_name` defined in impl/trait `def_id`
1354
- /// and return it, or `None`, if no such item was defined there.
1355
- fn associated_item ( & self , def_id : DefId ) -> Option < ty:: AssociatedItem > {
1356
- match self . looking_for {
1357
- LookingFor :: MethodName ( item_name) => self . fcx . associated_item ( def_id, item_name) ,
1358
- _ => None ,
1359
- }
1360
- }
1361
-
1353
+ /// Find the method with the appropriate name (or return type, as the case may be).
1362
1354
fn impl_or_trait_item ( & self , def_id : DefId ) -> Option < ty:: AssociatedItem > {
1363
1355
match self . looking_for {
1364
1356
LookingFor :: MethodName ( name) => {
0 commit comments