mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 09:23:31 +00:00
Deduplicate target and host filesearch I was looking into preprocessing the search directories somehow, so that both host and target don't have to scan them. However, it would be a bit annoying, because they don't share the tlib path. But then I noticed that the code already used `Arc` for `SearchPath`, which was essentially the same optimization, which made sense before https://github.com/rust-lang/rust/pull/158823. But after that PR, it doesn't make sense to put `SearchPath` into `Arc`, because it doesn't really do anything, and the complex logic moved into `FileSearch`. So this PR puts that under `Arc`, to avoid doing duplicated work in the common case, where `host == target`. r? petrochenkov