1
Fork 0
rust/compiler/rustc_session/src
Trevor Gross 42cd3c60df
Rollup merge of #129418 - petrochenkov:libsearch2, r=jieyouxu
rustc: Simplify getting sysroot library directory

It was very non-obvious that `sess.target_tlib_path`, `make_target_lib_path(...)`, and `sess.target_filesearch(...).search_paths()` result in the same sysroot library directory paths.
They are however, indeed the same, because `sess.target_tlib_path` is initialized to `make_target_lib_path(...)` on `Session` creation, and they are used interchangeably.

There are still some redundant calls to `make_target_lib_path` and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring.
Some places in the compiler even disagree on the number of sysroots - 1 (explicit `--sysroot` *or* default sysroot), 2 (explicit `--sysroot` *and* default sysroot), or an unclear number of `sysroot_candidates` every of which is considered.
The logic currently using `sess.target_tlib_path` or equivalents assumes one sysroot.
2024-08-27 01:46:51 -05:00
..
config Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
code_stats.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
config.rs Split ColorConfig off of HumanReadableErrorType 2024-08-08 14:41:33 +00:00
cstore.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
errors.rs -Zembed-source: Don't try to warn about incompatible codegen backends 2024-08-06 20:31:12 +02:00
filesearch.rs rustc: Simplify getting sysroot library directory 2024-08-22 19:57:27 +03:00
lib.rs Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
options.rs Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwco 2024-08-27 01:46:49 -05:00
output.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
parse.rs Make Span optional in BufferedEarlyLint 2024-08-07 14:08:34 +02:00
search_paths.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
session.rs Rollup merge of #129418 - petrochenkov:libsearch2, r=jieyouxu 2024-08-27 01:46:51 -05:00
utils.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
version.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00