diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-09-03 12:36:33 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-12-04 19:40:33 +0100 |
| commit | 1acb44f03cd82c15c66f43abcc4b396378a0cc5d (patch) | |
| tree | 600709b4d31b26f9b0625c61ea8aeabd35a755bc /compiler/rustc_target/src | |
| parent | b34cf1a9e176e3ca525638e9075696d8467596ba (diff) | |
| download | rust-1acb44f03cd82c15c66f43abcc4b396378a0cc5d.tar.gz rust-1acb44f03cd82c15c66f43abcc4b396378a0cc5d.zip | |
Use IntoIterator for array impl everywhere.
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/lib.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index 23d5d575d94..b18d17c1b7d 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -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 @@ const RUST_LIB_DIR: &str = "rustlib"; /// `"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. diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 0d49c7f6ee8..72d9b501545 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -42,6 +42,7 @@ use rustc_serialize::json::{Json, ToJson}; use rustc_span::symbol::{sym, Symbol}; use std::collections::BTreeMap; use std::convert::TryFrom; +use std::iter::FromIterator; use std::ops::{Deref, DerefMut}; use std::path::{Path, PathBuf}; use std::str::FromStr; @@ -2173,12 +2174,11 @@ impl Target { // Additionally look in the sysroot under `lib/rustlib/<triple>/target.json` // as a fallback. let rustlib_path = crate::target_rustlib_path(&sysroot, &target_triple); - let p = std::array::IntoIter::new([ + let p = PathBuf::from_iter([ Path::new(sysroot), Path::new(&rustlib_path), Path::new("target.json"), - ]) - .collect::<PathBuf>(); + ]); if p.is_file() { return load_file(&p); } |
