]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | #![warn(clippy::rc_buffer)] |
2 | ||
3 | use std::cell::RefCell; | |
4 | use std::ffi::OsString; | |
5 | use std::path::PathBuf; | |
6 | use std::rc::Rc; | |
7 | ||
8 | struct S { | |
9 | // triggers lint | |
10 | bad1: Rc<String>, | |
11 | bad2: Rc<PathBuf>, | |
12 | bad3: Rc<Vec<u8>>, | |
13 | bad4: Rc<OsString>, | |
14 | // does not trigger lint | |
15 | good1: Rc<RefCell<String>>, | |
16 | } | |
17 | ||
18 | // triggers lint | |
19 | fn func_bad1(_: Rc<String>) {} | |
20 | fn func_bad2(_: Rc<PathBuf>) {} | |
21 | fn func_bad3(_: Rc<Vec<u8>>) {} | |
22 | fn func_bad4(_: Rc<OsString>) {} | |
23 | // does not trigger lint | |
24 | fn func_good1(_: Rc<RefCell<String>>) {} | |
25 | ||
26 | fn main() {} |