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