]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_session/src/filesearch.rs
Rollup merge of #93542 - GuillaumeGomez:lifetime-elision, r=oli-obk
[rust.git] / compiler / rustc_session / src / filesearch.rs
index 9359a55e55a9c74845c6a539f30abb43b3016056..357190178ce014a01041fcbe685bb5c470c6515e 100644 (file)
@@ -4,6 +4,7 @@
 
 use std::env;
 use std::fs;
+use std::iter::FromIterator;
 use std::path::{Path, PathBuf};
 
 use crate::search_paths::{PathKind, SearchPath, SearchPathFile};
@@ -91,8 +92,7 @@ pub fn search_path_dirs(&self) -> Vec<PathBuf> {
 
 pub fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
     let rustlib_path = rustc_target::target_rustlib_path(sysroot, target_triple);
-    std::array::IntoIter::new([sysroot, Path::new(&rustlib_path), Path::new("lib")])
-        .collect::<PathBuf>()
+    PathBuf::from_iter([sysroot, Path::new(&rustlib_path), Path::new("lib")])
 }
 
 /// This function checks if sysroot is found using env::args().next(), and if it