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.
This commit is contained in:
Matthias Krüger 2024-09-11 20:04:26 +02:00 committed by GitHub
commit 678c249708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,7 +96,7 @@ pub fn from_sysroot_and_triple(sysroot: &Path, triple: &str) -> Self {
Self::new(PathKind::All, make_target_lib_path(sysroot, triple)) 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. // Get the files within the directory.
let files = match std::fs::read_dir(&dir) { let files = match std::fs::read_dir(&dir) {
Ok(files) => files Ok(files) => files