about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/errors.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-08-27 01:46:51 -0500
committerGitHub <noreply@github.com>2024-08-27 01:46:51 -0500
commit42cd3c60dfd1cd92e1876fcc9d8667ce5e307b4c (patch)
treef41cd88648f2dd3f297385d15a90a806e6925413 /compiler/rustc_codegen_gcc/src/errors.rs
parent427019e37ff340a38c8354a8e03580cfbc61a5e7 (diff)
parentf62b9e0179434218040f42ee58bb99c1bf27c6d7 (diff)
downloadrust-42cd3c60dfd1cd92e1876fcc9d8667ce5e307b4c.tar.gz
rust-42cd3c60dfd1cd92e1876fcc9d8667ce5e307b4c.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions