@@ -195,19 +195,11 @@ fn main() {
195
195
//~^ unnecessary_to_owned
196
196
let _ = slice. to_owned ( ) . into_iter ( ) ;
197
197
//~^ 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
202
198
203
199
let _ = IntoIterator :: into_iter ( slice. to_vec ( ) ) ;
204
200
//~^ unnecessary_to_owned
205
201
let _ = IntoIterator :: into_iter ( slice. to_owned ( ) ) ;
206
202
//~^ 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
211
203
212
204
let _ = check_files ( & [ FileType :: Account ] ) ;
213
205
@@ -317,19 +309,6 @@ fn get_file_path(_file_type: &FileType) -> Result<std::path::PathBuf, std::io::E
317
309
318
310
fn require_string ( _: & String ) { }
319
311
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
-
333
312
// https://github.com/rust-lang/rust-clippy/issues/8507
334
313
mod issue_8507 {
335
314
#![ allow( dead_code) ]
@@ -680,3 +659,18 @@ fn issue13624() -> impl IntoIterator {
680
659
681
660
cow. into_owned ( ) . into_iter ( )
682
661
}
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