]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/rc_buffer.rs
e78fb5a6d9d837012d7453c3131301120f063da2
[rustc.git] / src / tools / clippy / tests / ui / rc_buffer.rs
1 #![warn(clippy::rc_buffer)]
2 #![allow(dead_code, unused_imports)]
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() {}