Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplett
Deprecate array::IntoIter::new.
This commit is contained in:
commit
1597728ef5
25 changed files with 69 additions and 99 deletions
|
@ -4,6 +4,7 @@ pub use self::FileMatch::*;
|
|||
|
||||
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 @@ impl<'a> FileSearch<'a> {
|
|||
|
||||
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
|
||||
|
|
|
@ -792,12 +792,11 @@ impl Session {
|
|||
/// Returns a list of directories where target-specific tool binaries are located.
|
||||
pub fn get_tools_search_paths(&self, self_contained: bool) -> Vec<PathBuf> {
|
||||
let rustlib_path = rustc_target::target_rustlib_path(&self.sysroot, &config::host_triple());
|
||||
let p = std::array::IntoIter::new([
|
||||
let p = PathBuf::from_iter([
|
||||
Path::new(&self.sysroot),
|
||||
Path::new(&rustlib_path),
|
||||
Path::new("bin"),
|
||||
])
|
||||
.collect::<PathBuf>();
|
||||
]);
|
||||
if self_contained { vec![p.clone(), p.join("self-contained")] } else { vec![p] }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue