mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
220 lines
6.8 KiB
Text
220 lines
6.8 KiB
Text
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:9:13
|
|
|
|
|
LL | let guard = x.lock().unwrap();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:9:9
|
|
|
|
|
LL | / let guard = x.lock().unwrap();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::await_holding_lock)]`
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:25:13
|
|
|
|
|
LL | let guard = x.read().unwrap();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:25:9
|
|
|
|
|
LL | / let guard = x.read().unwrap();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:31:13
|
|
|
|
|
LL | let mut guard = x.write().unwrap();
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:31:9
|
|
|
|
|
LL | / let mut guard = x.write().unwrap();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:53:13
|
|
|
|
|
LL | let guard = x.lock().unwrap();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:53:9
|
|
|
|
|
LL | / let guard = x.lock().unwrap();
|
|
LL | |
|
|
LL | |
|
|
LL | | let second = baz().await;
|
|
... |
|
|
LL | | first + second + third
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:67:17
|
|
|
|
|
LL | let guard = x.lock().unwrap();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:67:13
|
|
|
|
|
LL | / let guard = x.lock().unwrap();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | };
|
|
| |_________^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:80:17
|
|
|
|
|
LL | let guard = x.lock().unwrap();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:80:13
|
|
|
|
|
LL | / let guard = x.lock().unwrap();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_________^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:93:13
|
|
|
|
|
LL | let guard = x.lock();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:93:9
|
|
|
|
|
LL | / let guard = x.lock();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:109:13
|
|
|
|
|
LL | let guard = x.read();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:109:9
|
|
|
|
|
LL | / let guard = x.read();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:115:13
|
|
|
|
|
LL | let mut guard = x.write();
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:115:9
|
|
|
|
|
LL | / let mut guard = x.write();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:137:13
|
|
|
|
|
LL | let guard = x.lock();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:137:9
|
|
|
|
|
LL | / let guard = x.lock();
|
|
LL | |
|
|
LL | |
|
|
LL | | let second = baz().await;
|
|
... |
|
|
LL | | first + second + third
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:151:17
|
|
|
|
|
LL | let guard = x.lock();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:151:13
|
|
|
|
|
LL | / let guard = x.lock();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | };
|
|
| |_________^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:164:17
|
|
|
|
|
LL | let guard = x.lock();
|
|
| ^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:164:13
|
|
|
|
|
LL | / let guard = x.lock();
|
|
LL | |
|
|
LL | | baz().await
|
|
LL | | }
|
|
| |_________^
|
|
|
|
error: this `MutexGuard` is held across an `await` point
|
|
--> $DIR/await_holding_lock.rs:185:9
|
|
|
|
|
LL | let mut guard = x.lock().unwrap();
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
|
|
note: these are all the `await` points this lock is held through
|
|
--> $DIR/await_holding_lock.rs:185:5
|
|
|
|
|
LL | / let mut guard = x.lock().unwrap();
|
|
LL | |
|
|
LL | | *guard += 1;
|
|
LL | | drop(guard);
|
|
LL | | baz().await;
|
|
LL | | }
|
|
| |_^
|
|
|
|
error: aborting due to 13 previous errors
|
|
|