Skip to content

Commit 3ed69cd

Browse files
author
Daniel Smith
committed
Move existing lint into shared file
1 parent b3a427d commit 3ed69cd

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

clippy_lints/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mod assign_ops;
160160
mod async_yields_async;
161161
mod atomic_ordering;
162162
mod attrs;
163-
mod await_holding_lock;
163+
mod await_holding_invalid;
164164
mod await_holding_refcell_ref;
165165
mod bit_mask;
166166
mod blacklisted_name;
@@ -510,7 +510,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
510510
&attrs::MISMATCHED_TARGET_OS,
511511
&attrs::UNKNOWN_CLIPPY_LINTS,
512512
&attrs::USELESS_ATTRIBUTE,
513-
&await_holding_lock::AWAIT_HOLDING_LOCK,
513+
&await_holding_invalid::AWAIT_HOLDING_LOCK,
514514
&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF,
515515
&bit_mask::BAD_BIT_MASK,
516516
&bit_mask::INEFFECTIVE_BIT_MASK,
@@ -907,7 +907,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
907907
]);
908908
// end register lints, do not remove this comment, it’s used in `update_lints`
909909

910-
store.register_late_pass(|| box await_holding_lock::AwaitHoldingLock);
910+
store.register_late_pass(|| box await_holding_invalid::AwaitHoldingLock);
911911
store.register_late_pass(|| box await_holding_refcell_ref::AwaitHoldingRefCellRef);
912912
store.register_late_pass(|| box serde_api::SerdeAPI);
913913
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:
11911191

11921192
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
11931193
LintId::of(&attrs::INLINE_ALWAYS),
1194-
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
1194+
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
11951195
LintId::of(&await_holding_refcell_ref::AWAIT_HOLDING_REFCELL_REF),
11961196
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
11971197
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ vec![
6565
group: "pedantic",
6666
desc: "Inside an async function, holding a MutexGuard while calling await",
6767
deprecation: None,
68-
module: "await_holding_lock",
68+
module: "await_holding_invalid",
6969
},
7070
Lint {
7171
name: "await_holding_refcell_ref",
File renamed without changes.

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

Lines changed: 8 additions & 8 deletions
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)