]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/rc_clone_in_vec_init/arc.rs
1 #![warn(clippy::rc_clone_in_vec_init)]
2 use std
::sync
::{Arc, Mutex}
;
6 fn should_warn_simple_case() {
7 let v
= vec
![Arc
::new("x".to_string()); 2];
10 fn should_warn_simple_case_with_big_indentation() {
15 let v
= vec
![Arc
::new("x".to_string()); 2];
20 fn should_warn_complex_case() {
22 std
::sync
::Arc
::new(Mutex
::new({
40 fn should_not_warn_custom_arc() {
50 let v
= vec
![Arc
::new(); 2];
53 fn should_not_warn_vec_from_elem_but_not_arc() {
54 let v
= vec
![String
::new(); 2];
57 Box
::new(std
::sync
::Arc
::new({
66 fn should_not_warn_vec_macro_but_not_from_elem() {
67 let v
= vec
![Arc
::new("x".to_string())];