diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-13 09:32:05 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-13 11:51:17 +0100 |
| commit | eb07fa4d3ba6f98d26930c908cbe400f5ea7d6bb (patch) | |
| tree | 55932215575f8a632742603ac5e606a1dbe861f7 /src/comp/util | |
| parent | 7f6294455963334fec69fc799442ae74ef65b35e (diff) | |
| download | rust-eb07fa4d3ba6f98d26930c908cbe400f5ea7d6bb.tar.gz rust-eb07fa4d3ba6f98d26930c908cbe400f5ea7d6bb.zip | |
Remove all remaining uses of objs from the compiler
Diffstat (limited to 'src/comp/util')
| -rw-r--r-- | src/comp/util/filesearch.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/comp/util/filesearch.rs b/src/comp/util/filesearch.rs index e030ddeed40..7aceaf1ef1a 100644 --- a/src/comp/util/filesearch.rs +++ b/src/comp/util/filesearch.rs @@ -24,33 +24,32 @@ fn pick_file(file: fs::path, path: fs::path) -> option::t<fs::path> { else { option::none } } -type filesearch = obj { +iface filesearch { fn sysroot() -> fs::path; fn lib_search_paths() -> [fs::path]; fn get_target_lib_path() -> fs::path; fn get_target_lib_file_path(file: fs::path) -> fs::path; -}; +} fn mk_filesearch(maybe_sysroot: option::t<fs::path>, target_triple: str, addl_lib_search_paths: [fs::path]) -> filesearch { - obj filesearch_impl(sysroot: fs::path, - addl_lib_search_paths: [fs::path], - target_triple: str) { - fn sysroot() -> fs::path { sysroot } + type filesearch_impl = {sysroot: fs::path, + addl_lib_search_paths: [fs::path], + target_triple: str}; + impl of filesearch for filesearch_impl { + fn sysroot() -> fs::path { self.sysroot } fn lib_search_paths() -> [fs::path] { - addl_lib_search_paths - + [make_target_lib_path(sysroot, target_triple)] + self.addl_lib_search_paths + + [make_target_lib_path(self.sysroot, self.target_triple)] + alt get_cargo_lib_path() { result::ok(p) { [p] } result::err(p) { [] } } } - fn get_target_lib_path() -> fs::path { - make_target_lib_path(sysroot, target_triple) + make_target_lib_path(self.sysroot, self.target_triple) } - fn get_target_lib_file_path(file: fs::path) -> fs::path { fs::connect(self.get_target_lib_path(), file) } @@ -58,7 +57,9 @@ fn mk_filesearch(maybe_sysroot: option::t<fs::path>, let sysroot = get_sysroot(maybe_sysroot); #debug("using sysroot = %s", sysroot); - ret filesearch_impl(sysroot, addl_lib_search_paths, target_triple); + {sysroot: sysroot, + addl_lib_search_paths: addl_lib_search_paths, + target_triple: target_triple} as filesearch } // FIXME #1001: This can't be an obj method |
