]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_target/src/lib.rs
Rollup merge of #93936 - bjorn3:simplifications2, r=cjgillot
[rust.git] / compiler / rustc_target / src / lib.rs
index 23d5d575d9447d7b97cd7cbb4ae1a42115dd18cb..b18d17c1b7d1ff7a02e81d05c405acba101824c9 100644 (file)
@@ -16,6 +16,7 @@
 #![feature(min_specialization)]
 #![feature(step_trait)]
 
+use std::iter::FromIterator;
 use std::path::{Path, PathBuf};
 
 #[macro_use]
@@ -47,12 +48,11 @@ pub trait HashStableContext {}
 /// `"lib*/rustlib/x86_64-unknown-linux-gnu"`.
 pub fn target_rustlib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
     let libdir = find_libdir(sysroot);
-    std::array::IntoIter::new([
+    PathBuf::from_iter([
         Path::new(libdir.as_ref()),
         Path::new(RUST_LIB_DIR),
         Path::new(target_triple),
     ])
-    .collect::<PathBuf>()
 }
 
 /// The name of the directory rustc expects libraries to be located.