File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11#![ warn( clippy:: rc_mutex) ]
2- #![ allow( unused_imports) ]
32#![ allow( clippy:: boxed_local, clippy:: needless_pass_by_value) ]
43#![ allow( clippy:: blacklisted_name, unused_variables, dead_code) ]
54
6- use std:: cell:: RefCell ;
75use std:: rc:: Rc ;
86use std:: sync:: Mutex ;
97
10- pub struct MyStruct { }
8+ pub struct MyStruct {
9+ foo : Rc < Mutex < i32 > > ,
10+ }
1111
1212pub struct SubT < T > {
1313 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
210 --> $DIR/rc_mutex.rs:21:22
311 |
412LL | pub fn test1<T>(foo: Rc<Mutex<T>>) {}
513 | ^^^^^^^^^^^^
6- |
7- = note: `-D clippy::rc-mutex` implied by `-D warnings`
814
9- error: Found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` instead
15+ error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` instead
1016 --> $DIR/rc_mutex.rs:23:19
1117 |
1218LL | pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
1319 | ^^^^^^^^^^^^^^^^^
1420
15- error: Found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` instead
21+ error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` instead
1622 --> $DIR/rc_mutex.rs:25:19
1723 |
1824LL | pub fn test3(foo: Rc<Mutex<SubT<usize>>>) {}
1925 | ^^^^^^^^^^^^^^^^^^^^^^
2026
21- error: aborting due to 3 previous errors
27+ error: aborting due to 4 previous errors
2228
You can’t perform that action at this time.
0 commit comments