rust-clippy/tests/ui/rc_mutex.rs

28 lines
460 B
Rust
Raw Normal View History

2021-06-03 06:56:34 +00:00
#![warn(clippy::rc_mutex)]
#![allow(clippy::boxed_local, clippy::needless_pass_by_value)]
#![allow(clippy::blacklisted_name, unused_variables, dead_code)]
use std::rc::Rc;
use std::sync::Mutex;
2021-06-05 13:20:02 +00:00
pub struct MyStruct {
foo: Rc<Mutex<i32>>,
}
2021-06-03 06:56:34 +00:00
pub struct SubT<T> {
foo: T,
}
pub enum MyEnum {
One,
Two,
}
pub fn test1<T>(foo: Rc<Mutex<T>>) {}
pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
pub fn test3(foo: Rc<Mutex<SubT<usize>>>) {}
fn main() {}