Repository: rust
Issue: `[E0521]: borrowed data escapes outside of method` points to the wrong escape point
Labels: A-diagnostics,T-compiler

### Code

```Rust
struct Foo {
    bar: Option<String>,
}

impl Foo {
    async fn frobnicate(&mut self) {
        let Some(s) = self.bar.as_mut() else { return };

        tokio::spawn(async move {
            s.push('a');
        });

        // just something so that the `spawn` call is not at the end of the function, showing that a working
        // error message points to the spawn call above.
        println!();
    }
}

// It works with this definition of `spawn`:
//
// fn spawn<T: 'static>(_: T) {}

// It _also_ works with this copied signature of `tokio::spawn`:
//
// use core::future::Future;
// #[track_caller]
// pub fn spawn<T>(future: T) -> tokio::task::JoinHandle<T::Output>
// where
//     T: ::Future + Send + 'static,
//     T::Output: Send + 'static,
// {
//     todo!()
// }
```


### Current output

```plain
error[E0521]: borrowed data escapes outside of method
 --> src/lib.rs:7:23
  |
6 |     async fn frobnicate(&mut self) {
  |                         ---------
  |                         |
  |                         `self` is a reference that is only valid in the method body
  |                         let's call the lifetime of this reference `'1`
7 |         let Some(s) = self.bar.as_mut() else { return };
  |                       ^^^^^^^^^^^^^^^^^
  |                       |
  |                       `self` escapes the method body here
  |                       argument requires that `'1` must outlive `'static`

For more information about this error, try `rustc --explain E0521`.
error: could not compile `playground` (lib) due to previous error
```


### Desired output

```plain
error[E0521]: borrowed data escapes outside of method
  --> src/lib.rs:9:9
   |
6  |       async fn frobnicate(&mut self) {
   |                           ---------
   |                           |
   |                           `self` is a reference that is only valid in the method body
   |                           let's call the lifetime of this reference `'1`
...
9  | /         tokio::spawn(async move {
10 | |             s.push('a');
11 | |         });
   | |          ^
   | |          |
   | |__________`self` escapes the method body here
   |            argument requires that `'1` must outlive `'static`

For more information about this error, try `rustc --explain E0521`.
error: could not compile `playground` (lib) due to previous error
```

### Rationale and extra context

Either of the following changes cause the output to be correct again:

- It _seems_ like it's only happening with a function call across crates. Replacing `tokio::spawn` with either one of the commented-out versions of `spawn` I've added makes the output show up to correct place. One of them is a minimal function, the other one is a copy of tokio's signature of `spawn`.
- changing `bar` to be a `String` instead of `Option<String>`, and changing `let Some(s) = self.bar.as_mut() else { return };` to `let s = &mut self.bar;`

Changing let-else to if-let does not make a difference.

### Other cases

_No response_

### Anything else?

Reproduced on stable and Nightly version: 1.74.0-nightly (2023-09-11 b4e54c6e39984840a04d) via the playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=7a8d65db16da577beed9bd811577e88c

The tokio version on the playground at the time of testing was 1.32.0.