Provide help on closures capturing self causing borrow checker errors by chenyukang · Pull Request #106641 · rust-lang/rust (original) (raw)

What you can do when there's no argument is get the span for the whole call

self.foo()
---- self span
     --- method path segment span
     ----- Method span segment
---------- expression span

for function calls is the same: you use the full span and then suggest, instead of "just" "self at this place, you suggest "(self) replacing the (). Does that make sense? It looks worse, but it is more resilient.