Skip to content

Commit db647ba

Browse files
author
Daniel Smith
committed
Move existing lint into shared file
1 parent de83f44 commit db647ba

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

clippy_lints/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mod assign_ops;
158158
mod async_yields_async;
159159
mod atomic_ordering;
160160
mod attrs;
161-
mod await_holding_lock;
161+
mod await_holding_invalid;
162162
mod await_holding_refcell_ref;
163163
mod bit_mask;
164164
mod blacklisted_name;
@@ -501,7 +501,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
501501
&attrs::MISMATCHED_TARGET_OS,
502502
&attrs::UNKNOWN_CLIPPY_LINTS,
503503
&attrs::USELESS_ATTRIBUTE,
504-
&await_holding_lock::AWAIT_HOLDING_LOCK,
504+
&await_holding_invalid::AWAIT_HOLDING_LOCK,
505505
&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF,
506506
&bit_mask::BAD_BIT_MASK,
507507
&bit_mask::INEFFECTIVE_BIT_MASK,
@@ -896,7 +896,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
896896
]);
897897
// end register lints, do not remove this comment, it’s used in `update_lints`
898898

899-
store.register_late_pass(|| box await_holding_lock::AwaitHoldingLock);
899+
store.register_late_pass(|| box await_holding_invalid::AwaitHoldingLock);
900900
store.register_late_pass(|| box await_holding_refcell_ref::AwaitHoldingRefCellRef);
901901
store.register_late_pass(|| box serde_api::SerdeAPI);
902902
store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
@@ -1174,7 +1174,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11741174

11751175
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
11761176
LintId::of(&attrs::INLINE_ALWAYS),
1177-
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
1177+
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
11781178
LintId::of(&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF),
11791179
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
11801180
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
6464
group: "pedantic",
6565
desc: "Inside an async function, holding a MutexGuard while calling await",
6666
deprecation: None,
67-
module: "await_holding_lock",
67+
module: "await_holding_invalid",
6868
},
6969
Lint {
7070
name: "await_holding_refcell_ref",
File renamed without changes.

tests/ui/await_holding_lock.stderr renamed to tests/ui/await_holding_invalid.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
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.
2-
--> $DIR/await_holding_lock.rs:7:9
2+
--> $DIR/await_holding_invalid.rs:7:9
33
|
44
LL | let guard = x.lock().unwrap();
55
| ^^^^^
66
|
77
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
88
note: these are all the await points this lock is held through
9-
--> $DIR/await_holding_lock.rs:7:5
9+
--> $DIR/await_holding_invalid.rs:7:5
1010
|
1111
LL | / let guard = x.lock().unwrap();
1212
LL | | baz().await
1313
LL | | }
1414
| |_^
1515

1616
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.
17-
--> $DIR/await_holding_lock.rs:28:9
17+
--> $DIR/await_holding_invalid.rs:28:9
1818
|
1919
LL | let guard = x.lock().unwrap();
2020
| ^^^^^
2121
|
2222
note: these are all the await points this lock is held through
23-
--> $DIR/await_holding_lock.rs:28:5
23+
--> $DIR/await_holding_invalid.rs:28:5
2424
|
2525
LL | / let guard = x.lock().unwrap();
2626
LL | |
@@ -32,27 +32,27 @@ LL | | }
3232
| |_^
3333

3434
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.
35-
--> $DIR/await_holding_lock.rs:41:13
35+
--> $DIR/await_holding_invalid.rs:41:13
3636
|
3737
LL | let guard = x.lock().unwrap();
3838
| ^^^^^
3939
|
4040
note: these are all the await points this lock is held through
41-
--> $DIR/await_holding_lock.rs:41:9
41+
--> $DIR/await_holding_invalid.rs:41:9
4242
|
4343
LL | / let guard = x.lock().unwrap();
4444
LL | | baz().await
4545
LL | | };
4646
| |_____^
4747

4848
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.
49-
--> $DIR/await_holding_lock.rs:53:13
49+
--> $DIR/await_holding_invalid.rs:53:13
5050
|
5151
LL | let guard = x.lock().unwrap();
5252
| ^^^^^
5353
|
5454
note: these are all the await points this lock is held through
55-
--> $DIR/await_holding_lock.rs:53:9
55+
--> $DIR/await_holding_invalid.rs:53:9
5656
|
5757
LL | / let guard = x.lock().unwrap();
5858
LL | | baz().await

0 commit comments

Comments
 (0)