diff --git a/compiler/rustc_error_codes/src/error_codes/E0373.md b/compiler/rustc_error_codes/src/error_codes/E0373.md index 540a88a0d95..effa597aad9 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0373.md +++ b/compiler/rustc_error_codes/src/error_codes/E0373.md @@ -54,35 +54,18 @@ about safety. This error may also be encountered while using `async` blocks: ```compile_fail,E0373,edition2018 -use std::{sync::Arc, future::Future, pin::Pin, task::{Context, Poll}}; +use std::future::Future; async fn f() { - let v = Arc::new(Vec::new()); - - let handle = spawn(async { //~ ERROR E0373 - g(Arc::clone(&v)) + let v = vec![1, 2, 3i32]; + spawn(async { //~ ERROR E0373 + println!("{:?}", v) }); - handle.await; } -fn g(v: Arc>) {} - -fn spawn(future: F) -> JoinHandle -where - F: Future + Send + 'static, - F::Output: Send + 'static, -{ +fn spawn(future: F) { unimplemented!() } - -struct JoinHandle; - -impl Future for JoinHandle { - type Output = (); - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - unimplemented!() - } -} ``` Similarly to closures, `async` blocks are not executed immediately and may