File tree 3 files changed +7
-9
lines changed
src/test/ui/let_underscore
3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ declare_lint! {
55
55
/// of at end of scope, which is typically incorrect.
56
56
///
57
57
/// ### Example
58
- /// ```rust
58
+ /// ```compile_fail
59
59
/// use std::sync::{Arc, Mutex};
60
60
/// use std::thread;
61
61
/// let data = Arc::new(Mutex::new(0));
@@ -83,7 +83,7 @@ declare_lint! {
83
83
/// calling `std::mem::drop` on the expression is clearer and helps convey
84
84
/// intent.
85
85
pub LET_UNDERSCORE_LOCK ,
86
- Warn ,
86
+ Deny ,
87
87
"non-binding let on a synchronization lock"
88
88
}
89
89
Original file line number Diff line number Diff line change 1
- // run-pass
2
-
3
1
use std:: sync:: { Arc , Mutex } ;
4
2
5
3
fn main ( ) {
6
4
let data = Arc :: new ( Mutex :: new ( 0 ) ) ;
7
- let _ = data. lock ( ) . unwrap ( ) ; //~WARNING non-binding let on a synchronization lock
5
+ let _ = data. lock ( ) . unwrap ( ) ; //~ERROR non-binding let on a synchronization lock
8
6
}
Original file line number Diff line number Diff line change 1
- warning : non-binding let on a synchronization lock
2
- --> $DIR/let_underscore_lock.rs:7 :5
1
+ error : non-binding let on a synchronization lock
2
+ --> $DIR/let_underscore_lock.rs:5 :5
3
3
|
4
4
LL | let _ = data.lock().unwrap();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
- = note: `#[warn (let_underscore_lock)]` on by default
7
+ = note: `#[deny (let_underscore_lock)]` on by default
8
8
help: consider binding to an unused variable
9
9
|
10
10
LL | let _unused = data.lock().unwrap();
@@ -14,5 +14,5 @@ help: consider explicitly droping with `std::mem::drop`
14
14
LL | let _ = drop(...);
15
15
| ~~~~~~~~~
16
16
17
- warning: 1 warning emitted
17
+ error: aborting due to previous error
18
18
You can’t perform that action at this time.
0 commit comments