]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/rc_buffer.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / rc_buffer.rs
CommitLineData
f20569fa
XL
1#![warn(clippy::rc_buffer)]
2
3use std::cell::RefCell;
4use std::ffi::OsString;
5use std::path::PathBuf;
6use std::rc::Rc;
7
8struct 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
19fn func_bad1(_: Rc<String>) {}
20fn func_bad2(_: Rc<PathBuf>) {}
21fn func_bad3(_: Rc<Vec<u8>>) {}
22fn func_bad4(_: Rc<OsString>) {}
23// does not trigger lint
24fn func_good1(_: Rc<RefCell<String>>) {}
25
26fn main() {}