title: Calling async function inside of async function results in lifetime issues
body: <p>The function <code>run_av_check</code> receives a vector filled with URLs which need to get called using reqwest. Iterating through the URLs gives me the error that the borrowed value does not live long enough. My understanding is that as long as <code>check_availability</code> is not finished for all URLs which are called in <code>run_av_check</code> using a <code>for</code> loop the <code>run_av_check</code> function is not finished, therefore the variable URLs should still exist during the runtime of all <code>check_availibility</code> calls.</p>
  <p>I have read the Tokio and Rust documentation but I am not able to find a clue how and why this behaviour occurs. Why does the error pop up and what needs to be changed to make this work, both program wise and in my way of thinking?</p>
  <pre><code>async fn check_availability(host: &amp;str) -&gt; Result&lt;reqwest::StatusCode, reqwest::Error&gt; {
      // ... building url
      match client.get(&amp;url).send().await {
          Ok(r) =&gt; Ok(r.status()),
          Err(_e) =&gt; Ok(reqwest::StatusCode::GATEWAY_TIMEOUT),
      }
  }
  
  async fn run_av_check(urls: Vec&lt;std::string::String&gt;) -&gt; Result&lt;AvResponse, AvError&gt; {
      let mut av_urls: Vec&lt;std::string::String&gt; = vec![];
      let mut s: std::string::String = &quot;&quot;.to_string();
      let mut attributes = Vec::new();
  
      for url in urls.iter() {
          attributes.push((&quot;instance&quot;, url));
          let resp = tokio::task::spawn(check_availability(url));
          // ... processing result
          let res = AvResponse {
              av_urls,
              prom_details: s,
          };
          Ok(res)
      }
  }
  </code></pre>