@@ -195,19 +195,11 @@ fn main() {
195195 //~^ unnecessary_to_owned
196196 let _ = slice. to_owned ( ) . into_iter ( ) ;
197197 //~^ unnecessary_to_owned
198- let _ = [ std:: path:: PathBuf :: new ( ) ] [ ..] . to_vec ( ) . into_iter ( ) ;
199- //~^ unnecessary_to_owned
200- let _ = [ std:: path:: PathBuf :: new ( ) ] [ ..] . to_owned ( ) . into_iter ( ) ;
201- //~^ unnecessary_to_owned
202198
203199 let _ = IntoIterator :: into_iter ( slice. to_vec ( ) ) ;
204200 //~^ unnecessary_to_owned
205201 let _ = IntoIterator :: into_iter ( slice. to_owned ( ) ) ;
206202 //~^ unnecessary_to_owned
207- let _ = IntoIterator :: into_iter ( [ std:: path:: PathBuf :: new ( ) ] [ ..] . to_vec ( ) ) ;
208- //~^ unnecessary_to_owned
209- let _ = IntoIterator :: into_iter ( [ std:: path:: PathBuf :: new ( ) ] [ ..] . to_owned ( ) ) ;
210- //~^ unnecessary_to_owned
211203
212204 let _ = check_files ( & [ FileType :: Account ] ) ;
213205
@@ -317,19 +309,6 @@ fn get_file_path(_file_type: &FileType) -> Result<std::path::PathBuf, std::io::E
317309
318310fn require_string ( _: & String ) { }
319311
320- #[ clippy:: msrv = "1.35" ]
321- fn _msrv_1_35 ( ) {
322- // `copied` was stabilized in 1.36, so clippy should use `cloned`.
323- let _ = & [ "x" ] [ ..] . to_vec ( ) . into_iter ( ) ;
324- //~^ unnecessary_to_owned
325- }
326-
327- #[ clippy:: msrv = "1.36" ]
328- fn _msrv_1_36 ( ) {
329- let _ = & [ "x" ] [ ..] . to_vec ( ) . into_iter ( ) ;
330- //~^ unnecessary_to_owned
331- }
332-
333312// https://github.com/rust-lang/rust-clippy/issues/8507
334313mod issue_8507 {
335314 #![ allow( dead_code) ]
@@ -680,3 +659,18 @@ fn issue13624() -> impl IntoIterator {
680659
681660 cow. into_owned ( ) . into_iter ( )
682661}
662+
663+ mod issue_14242 {
664+ use std:: rc:: Rc ;
665+
666+ #[ derive( Copy , Clone ) ]
667+ struct Foo ;
668+
669+ fn rc_slice_provider ( ) -> Rc < [ Foo ] > {
670+ Rc :: from ( [ Foo ] )
671+ }
672+
673+ fn iterator_provider ( ) -> impl Iterator < Item = Foo > {
674+ rc_slice_provider ( ) . to_vec ( ) . into_iter ( )
675+ }
676+ }
0 commit comments