about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-11 20:04:26 +0200
committerGitHub <noreply@github.com>2024-09-11 20:04:26 +0200
commit678c24970815f2e8d21ef2078379f9998016d428 (patch)
tree444a33723693b7c2250721b330c6a92be6778e98
parent66727ea1a29e0075b8d40d24aa09a85c9c006e3c (diff)
parent9566163364a91678006a2b22d62d2a73a6012ff5 (diff)
downloadrust-678c24970815f2e8d21ef2078379f9998016d428.tar.gz
rust-678c24970815f2e8d21ef2078379f9998016d428.zip
Rollup merge of #130221 - vetleras:pub_search_path_new, r=chenyukang
Make SearchPath::new public

I'm writing a tool that uses `rustc_interface`, and would like to construct `SearchPath` with its `new` method.

As all three fields in `SearchPath` are public anyway, the proposed change should not change the privacy or encapsulation of the struct.
-rw-r--r--compiler/rustc_session/src/search_paths.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/search_paths.rs b/compiler/rustc_session/src/search_paths.rs
index d65b1b8b3f1..b212f6afa17 100644
--- a/compiler/rustc_session/src/search_paths.rs
+++ b/compiler/rustc_session/src/search_paths.rs
@@ -96,7 +96,7 @@ impl SearchPath {
         Self::new(PathKind::All, make_target_lib_path(sysroot, triple))
     }
 
-    fn new(kind: PathKind, dir: PathBuf) -> Self {
+    pub fn new(kind: PathKind, dir: PathBuf) -> Self {
         // Get the files within the directory.
         let files = match std::fs::read_dir(&dir) {
             Ok(files) => files