diff options
| author | bors <bors@rust-lang.org> | 2021-12-05 12:53:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-05 12:53:01 +0000 |
| commit | 1597728ef5820d3ffcb9d3f0c890ef7802398751 (patch) | |
| tree | 1a86c2a2cb56d502776e6cc3936ec683efb62ffb /compiler/rustc_session/src | |
| parent | cafc4582e66c478b6b297ae85b225c788106015e (diff) | |
| parent | 27d39357b7052d96e1b3903518841d14534c38cf (diff) | |
| download | rust-1597728ef5820d3ffcb9d3f0c890ef7802398751.tar.gz rust-1597728ef5820d3ffcb9d3f0c890ef7802398751.zip | |
Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplett
Deprecate array::IntoIter::new.
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/filesearch.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index 9359a55e55a..357190178ce 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -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 diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 52a92de842f..e37d504135d 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -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] } } |
