mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
27 lines
596 B
Rust
27 lines
596 B
Rust
// run-rustfix
|
|
#![warn(clippy::rc_buffer)]
|
|
#![allow(dead_code, unused_imports)]
|
|
|
|
use std::ffi::OsString;
|
|
use std::path::PathBuf;
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
struct S {
|
|
// triggers lint
|
|
bad1: Arc<str>,
|
|
bad2: Arc<std::path::Path>,
|
|
bad3: Arc<[u8]>,
|
|
bad4: Arc<std::ffi::OsStr>,
|
|
// does not trigger lint
|
|
good1: Arc<Mutex<String>>,
|
|
}
|
|
|
|
// triggers lint
|
|
fn func_bad1(_: Arc<str>) {}
|
|
fn func_bad2(_: Arc<std::path::Path>) {}
|
|
fn func_bad3(_: Arc<[u8]>) {}
|
|
fn func_bad4(_: Arc<std::ffi::OsStr>) {}
|
|
// does not trigger lint
|
|
fn func_good1(_: Arc<Mutex<String>>) {}
|
|
|
|
fn main() {}
|