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