@@ -104,6 +104,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
104
104
self_ty,
105
105
call_expr_id,
106
106
ProbeScope :: TraitsInScope ,
107
+ None ,
107
108
) {
108
109
Ok ( pick) => {
109
110
pick. maybe_emit_unstable_name_collision_hint (
@@ -188,7 +189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
188
189
ProbeScope :: TraitsInScope
189
190
} ;
190
191
191
- let pick = self . lookup_probe ( segment. ident , self_ty, call_expr, scope) ?;
192
+ let pick = self . lookup_probe ( segment. ident , self_ty, call_expr, self_expr , scope) ?;
192
193
193
194
self . lint_edition_dependent_dot_call (
194
195
self_ty, segment, span, call_expr, self_expr, & pick, args,
@@ -215,6 +216,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
215
216
segment. ident ,
216
217
trait_type,
217
218
call_expr,
219
+ self_expr,
218
220
ProbeScope :: TraitsInScope ,
219
221
) {
220
222
Ok ( ref new_pick) if pick. differs_from ( new_pick) => {
@@ -283,6 +285,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
283
285
method_name : Ident ,
284
286
self_ty : Ty < ' tcx > ,
285
287
call_expr : & hir:: Expr < ' _ > ,
288
+ self_expr : & hir:: Expr < ' _ > ,
286
289
scope : ProbeScope ,
287
290
) -> probe:: PickResult < ' tcx > {
288
291
let pick = self . probe_for_name (
@@ -293,7 +296,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
293
296
self_ty,
294
297
call_expr. hir_id ,
295
298
scope,
299
+ Some ( self_expr. span ) ,
296
300
) ?;
301
+
297
302
pick. maybe_emit_unstable_name_collision_hint ( self . tcx , method_name. span , call_expr. hir_id ) ;
298
303
Ok ( pick)
299
304
}
@@ -314,6 +319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
314
319
self_ty,
315
320
call_expr. hir_id ,
316
321
scope,
322
+ None ,
317
323
) ?;
318
324
Ok ( pick)
319
325
}
@@ -533,6 +539,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
533
539
self_ty,
534
540
expr_id,
535
541
ProbeScope :: TraitsInScope ,
542
+ Some ( self_ty_span) ,
536
543
) ;
537
544
let pick = match ( pick, struct_variant) {
538
545
// Fall back to a resolution that will produce an error later.
0 commit comments