about summary refs log tree commit diff
path: root/compiler/rustc_session/src/filesearch.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-07-29 22:17:25 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-08-03 14:20:18 +0300
commit35977b47cc80e54af8e8559231945bada6fe1c01 (patch)
tree5bcb84f995dce04ce445988f56df54bb123079b8 /compiler/rustc_session/src/filesearch.rs
parenta6043039ad3aef48e08d72a3e32545accdee427a (diff)
downloadrust-35977b47cc80e54af8e8559231945bada6fe1c01.tar.gz
rust-35977b47cc80e54af8e8559231945bada6fe1c01.zip
linker: Pass fewer search directories to the linker
Diffstat (limited to 'compiler/rustc_session/src/filesearch.rs')
-rw-r--r--compiler/rustc_session/src/filesearch.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs
index 0c3ec36fed5..63ca5fefd9f 100644
--- a/compiler/rustc_session/src/filesearch.rs
+++ b/compiler/rustc_session/src/filesearch.rs
@@ -19,6 +19,11 @@ pub struct FileSearch<'a> {
 }
 
 impl<'a> FileSearch<'a> {
+    pub fn cli_search_paths(&self) -> impl Iterator<Item = &'a SearchPath> {
+        let kind = self.kind;
+        self.cli_search_paths.iter().filter(move |sp| sp.kind.matches(kind))
+    }
+
     pub fn search_paths(&self) -> impl Iterator<Item = &'a SearchPath> {
         let kind = self.kind;
         self.cli_search_paths