fixup! Add await_holding_invalid_type
lint
This commit is contained in:
parent
a511072c2c
commit
7e26edce65
@ -146,15 +146,20 @@ declare_clippy_lint! {
|
||||
///
|
||||
/// ```toml
|
||||
/// await-holding-invalid-types = [
|
||||
/// # You can specify a type name
|
||||
/// "CustomLockType",
|
||||
/// # You can (optionally) specify a reason
|
||||
/// { type = "OtherCustomLockType", reason = "Relies on a thread local" }
|
||||
/// ]
|
||||
/// ```
|
||||
///
|
||||
/// ```rust
|
||||
/// # async fn baz() {}
|
||||
/// struct CustomLockType;
|
||||
/// struct OtherCustomLockType;
|
||||
/// async fn foo() {
|
||||
/// let _x = CustomLockType;
|
||||
/// let _y = CustomLockType;
|
||||
/// baz().await; // Lint violation
|
||||
/// }
|
||||
/// ```
|
||||
|
@ -1,25 +1,25 @@
|
||||
error: `std::string::String` may not be held across an `await` point according to config
|
||||
error: `std::string::String` may not be held across an `await` point per `clippy.toml`
|
||||
--> $DIR/await_holding_invalid_type.rs:5:9
|
||||
|
|
||||
LL | let _x = String::from("hello");
|
||||
| ^^
|
||||
|
|
||||
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
|
||||
= note: strings are bad (according to clippy.toml)
|
||||
= note: strings are bad
|
||||
|
||||
error: `std::net::Ipv4Addr` may not be held across an `await` point according to config
|
||||
error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml`
|
||||
--> $DIR/await_holding_invalid_type.rs:10:9
|
||||
|
|
||||
LL | let _x = Ipv4Addr::new(127, 0, 0, 1);
|
||||
| ^^
|
||||
|
||||
error: `std::string::String` may not be held across an `await` point according to config
|
||||
error: `std::string::String` may not be held across an `await` point per `clippy.toml`
|
||||
--> $DIR/await_holding_invalid_type.rs:31:13
|
||||
|
|
||||
LL | let _x = String::from("hi!");
|
||||
| ^^
|
||||
|
|
||||
= note: strings are bad (according to clippy.toml)
|
||||
= note: strings are bad
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user