#![warn(clippy::all)] #![allow(clippy::boxed_local, clippy::disallowed_names)] pub struct MyStruct; pub struct SubT { foo: T, } mod outer_box { use crate::{MyStruct, SubT}; use std::boxed::Box; use std::rc::Rc; use std::sync::Arc; pub fn box_test6(foo: Box>) {} pub fn box_test7(foo: Box>) {} pub fn box_test8() -> Box>> { unimplemented!(); } pub fn box_test9(foo: Box>) -> Box>> { unimplemented!(); } } mod outer_rc { use crate::{MyStruct, SubT}; use std::boxed::Box; use std::rc::Rc; use std::sync::Arc; pub fn rc_test5(a: Rc>) {} pub fn rc_test7(a: Rc>) {} pub fn rc_test8() -> Rc>> { unimplemented!(); } pub fn rc_test9(foo: Rc>) -> Rc>> { unimplemented!(); } } mod outer_arc { use crate::{MyStruct, SubT}; use std::boxed::Box; use std::rc::Rc; use std::sync::Arc; pub fn arc_test5(a: Arc>) {} pub fn arc_test6(a: Arc>) {} pub fn arc_test8() -> Arc>> { unimplemented!(); } pub fn arc_test9(foo: Arc>) -> Arc>> { unimplemented!(); } } // https://github.com/rust-lang/rust-clippy/issues/7487 mod box_dyn { use std::boxed::Box; use std::rc::Rc; use std::sync::Arc; pub trait T {} struct S { a: Box>, b: Rc>, c: Arc>, } pub fn test_box(_: Box>) {} pub fn test_rc(_: Rc>) {} pub fn test_arc(_: Arc>) {} pub fn test_rc_box(_: Rc>>) {} } // https://github.com/rust-lang/rust-clippy/issues/8604 mod box_fat_ptr { use std::boxed::Box; use std::path::Path; use std::rc::Rc; use std::sync::Arc; pub struct DynSized { foo: [usize], } struct S { a: Box>, b: Rc>, c: Arc>, e: Box>, f: Box>, g: Box>, } pub fn test_box_str(_: Box>) {} pub fn test_rc_str(_: Rc>) {} pub fn test_arc_str(_: Arc>) {} pub fn test_box_slice(_: Box>) {} pub fn test_box_path(_: Box>) {} pub fn test_box_custom(_: Box>) {} pub fn test_rc_box_str(_: Rc>>) {} pub fn test_rc_box_slice(_: Rc>>) {} pub fn test_rc_box_path(_: Rc>>) {} pub fn test_rc_box_custom(_: Rc>>) {} } fn main() {}