Move existing lint into shared file
This commit is contained in:
parent
b3a427d873
commit
3ed69cdb13
@ -160,7 +160,7 @@ mod assign_ops;
|
||||
mod async_yields_async;
|
||||
mod atomic_ordering;
|
||||
mod attrs;
|
||||
mod await_holding_lock;
|
||||
mod await_holding_invalid;
|
||||
mod await_holding_refcell_ref;
|
||||
mod bit_mask;
|
||||
mod blacklisted_name;
|
||||
@ -510,7 +510,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&attrs::MISMATCHED_TARGET_OS,
|
||||
&attrs::UNKNOWN_CLIPPY_LINTS,
|
||||
&attrs::USELESS_ATTRIBUTE,
|
||||
&await_holding_lock::AWAIT_HOLDING_LOCK,
|
||||
&await_holding_invalid::AWAIT_HOLDING_LOCK,
|
||||
&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF,
|
||||
&bit_mask::BAD_BIT_MASK,
|
||||
&bit_mask::INEFFECTIVE_BIT_MASK,
|
||||
@ -907,7 +907,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
]);
|
||||
// end register lints, do not remove this comment, it’s used in `update_lints`
|
||||
|
||||
store.register_late_pass(|| box await_holding_lock::AwaitHoldingLock);
|
||||
store.register_late_pass(|| box await_holding_invalid::AwaitHoldingLock);
|
||||
store.register_late_pass(|| box await_holding_refcell_ref::AwaitHoldingRefCellRef);
|
||||
store.register_late_pass(|| box serde_api::SerdeAPI);
|
||||
store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
|
||||
@ -1191,7 +1191,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
|
||||
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
|
||||
LintId::of(&attrs::INLINE_ALWAYS),
|
||||
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
|
||||
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
|
||||
LintId::of(&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF),
|
||||
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
||||
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
|
||||
|
@ -65,7 +65,7 @@ vec![
|
||||
group: "pedantic",
|
||||
desc: "Inside an async function, holding a MutexGuard while calling await",
|
||||
deprecation: None,
|
||||
module: "await_holding_lock",
|
||||
module: "await_holding_invalid",
|
||||
},
|
||||
Lint {
|
||||
name: "await_holding_refcell_ref",
|
||||
|
@ -1,12 +1,12 @@
|
||||
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await.
|
||||
--> $DIR/await_holding_lock.rs:7:9
|
||||
--> $DIR/await_holding_invalid.rs:7:9
|
||||
|
|
||||
LL | let guard = x.lock().unwrap();
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
|
||||
note: these are all the await points this lock is held through
|
||||
--> $DIR/await_holding_lock.rs:7:5
|
||||
--> $DIR/await_holding_invalid.rs:7:5
|
||||
|
|
||||
LL | / let guard = x.lock().unwrap();
|
||||
LL | | baz().await
|
||||
@ -14,13 +14,13 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await.
|
||||
--> $DIR/await_holding_lock.rs:28:9
|
||||
--> $DIR/await_holding_invalid.rs:28:9
|
||||
|
|
||||
LL | let guard = x.lock().unwrap();
|
||||
| ^^^^^
|
||||
|
|
||||
note: these are all the await points this lock is held through
|
||||
--> $DIR/await_holding_lock.rs:28:5
|
||||
--> $DIR/await_holding_invalid.rs:28:5
|
||||
|
|
||||
LL | / let guard = x.lock().unwrap();
|
||||
LL | |
|
||||
@ -32,13 +32,13 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await.
|
||||
--> $DIR/await_holding_lock.rs:41:13
|
||||
--> $DIR/await_holding_invalid.rs:41:13
|
||||
|
|
||||
LL | let guard = x.lock().unwrap();
|
||||
| ^^^^^
|
||||
|
|
||||
note: these are all the await points this lock is held through
|
||||
--> $DIR/await_holding_lock.rs:41:9
|
||||
--> $DIR/await_holding_invalid.rs:41:9
|
||||
|
|
||||
LL | / let guard = x.lock().unwrap();
|
||||
LL | | baz().await
|
||||
@ -46,13 +46,13 @@ LL | | };
|
||||
| |_____^
|
||||
|
||||
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await.
|
||||
--> $DIR/await_holding_lock.rs:53:13
|
||||
--> $DIR/await_holding_invalid.rs:53:13
|
||||
|
|
||||
LL | let guard = x.lock().unwrap();
|
||||
| ^^^^^
|
||||
|
|
||||
note: these are all the await points this lock is held through
|
||||
--> $DIR/await_holding_lock.rs:53:9
|
||||
--> $DIR/await_holding_invalid.rs:53:9
|
||||
|
|
||||
LL | / let guard = x.lock().unwrap();
|
||||
LL | | baz().await
|
Loading…
x
Reference in New Issue
Block a user