File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
#![ warn( clippy:: rc_mutex) ]
2
- #![ allow( clippy:: boxed_local, clippy:: needless_pass_by_value) ]
3
- #![ allow( clippy:: blacklisted_name, unused_variables, dead_code) ]
2
+ #![ allow( clippy:: blacklisted_name) ]
4
3
5
4
use std:: rc:: Rc ;
6
5
use std:: sync:: Mutex ;
@@ -24,4 +23,12 @@ pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
24
23
25
24
pub fn test3 ( foo : Rc < Mutex < SubT < usize > > > ) { }
26
25
27
- fn main ( ) { }
26
+ fn main ( ) {
27
+ test1 ( Rc :: new ( Mutex :: new ( 1 ) ) ) ;
28
+ test2 ( Rc :: new ( Mutex :: new ( MyEnum :: One ) ) ) ;
29
+ test3 ( Rc :: new ( Mutex :: new ( SubT { foo : 1 } ) ) ) ;
30
+
31
+ let _my_struct = MyStruct {
32
+ foo : Rc :: new ( Mutex :: new ( 1 ) ) ,
33
+ } ;
34
+ }
Original file line number Diff line number Diff line change 1
1
error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
2
- --> $DIR/rc_mutex.rs:9 :10
2
+ --> $DIR/rc_mutex.rs:8 :10
3
3
|
4
4
LL | foo: Rc<Mutex<i32>>,
5
5
| ^^^^^^^^^^^^^^
6
6
|
7
7
= note: `-D clippy::rc-mutex` implied by `-D warnings`
8
8
9
9
error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
10
- --> $DIR/rc_mutex.rs:21 :22
10
+ --> $DIR/rc_mutex.rs:20 :22
11
11
|
12
12
LL | pub fn test1<T>(foo: Rc<Mutex<T>>) {}
13
13
| ^^^^^^^^^^^^
14
14
15
15
error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
16
- --> $DIR/rc_mutex.rs:23 :19
16
+ --> $DIR/rc_mutex.rs:22 :19
17
17
|
18
18
LL | pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
19
19
| ^^^^^^^^^^^^^^^^^
20
20
21
21
error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
22
- --> $DIR/rc_mutex.rs:25 :19
22
+ --> $DIR/rc_mutex.rs:24 :19
23
23
|
24
24
LL | pub fn test3(foo: Rc<Mutex<SubT<usize>>>) {}
25
25
| ^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments