]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/rc_buffer.rs
bump version to 1.82.0+dfsg1-1~bpo12+pve2
[rustc.git] / src / tools / clippy / tests / ui / rc_buffer.rs
CommitLineData
f20569fa 1#![warn(clippy::rc_buffer)]
923072b8 2#![allow(dead_code, unused_imports)]
f20569fa
XL
3
4use std::cell::RefCell;
5use std::ffi::OsString;
6use std::path::PathBuf;
7use std::rc::Rc;
8
9struct 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
20fn func_bad1(_: Rc<String>) {}
21fn func_bad2(_: Rc<PathBuf>) {}
22fn func_bad3(_: Rc<Vec<u8>>) {}
23fn func_bad4(_: Rc<OsString>) {}
24// does not trigger lint
25fn func_good1(_: Rc<RefCell<String>>) {}
26
27fn main() {}