fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1#![warn(clippy::rc_buffer)] 2#![allow(dead_code, unused_imports)] 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<str>, 12 bad2: Rc<std::path::Path>, 13 bad3: Rc<[u8]>, 14 bad4: Rc<std::ffi::OsStr>, 15 // does not trigger lint 16 good1: Rc<RefCell<String>>, 17} 18 19// triggers lint 20fn func_bad1(_: Rc<str>) {} 21fn func_bad2(_: Rc<std::path::Path>) {} 22fn func_bad3(_: Rc<[u8]>) {} 23fn func_bad4(_: Rc<std::ffi::OsStr>) {} 24// does not trigger lint 25fn func_good1(_: Rc<RefCell<String>>) {} 26 27fn main() {}