Nicholas Nethercote
6341935a13
Remove extern crate tracing
from numerous crates.
2024-04-30 16:47:49 +10:00
Vadim Petrochenkov
ed62b57c86
linker: Remove laziness and caching from native search directory walks
...
It shouldn't be necessary for performance now.
2024-04-12 17:28:00 +03:00
Vadim Petrochenkov
4ded0b82ca
linker: Avoid some allocations in search directory iteration
2024-04-12 00:41:08 +03:00
Jubilee
86af4d25a5
Rollup merge of #116793 - WaffleLapkin:target_rules_the_backend, r=cjgillot
...
Allow targets to override default codegen backend
Implements https://github.com/rust-lang/compiler-team/issues/670 .
2024-03-11 09:29:32 -07:00
klensy
35fe26757a
windows bump to 0.52
2024-02-18 16:02:16 +03:00
Maybe Waffle
5441523f07
Refactor out a repeating pattern with get_or_default_sysroot
2024-02-15 00:09:40 +00:00
Nicholas Nethercote
c5408b6617
Remove unused FileMatch
.
2023-11-30 17:05:56 +11:00
klensy
3c03cce341
bump windows crate 0.46 -> 0.48 in workspace
2023-05-09 18:20:13 +03:00
ozkanonur
2e98368c2f
make sysroot finding compatible with multiarch systems
...
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-14 15:03:49 +03:00
Michael Goulet
bc7976eee5
Rollup merge of #109522 - bzEq:aix-current-dll-path, r=Nilstrieb
...
Implement current_dll_path for AIX
AIX doesn't feature `dladdr`, use `loadquery` instead.
`loadquery` is documented in https://www.ibm.com/docs/en/aix/7.2?topic=l-loadquery-subroutine .
2023-03-30 12:42:18 -07:00
Kai Luo
49f63eb021
Check data segment range
2023-03-28 17:54:12 +08:00
Kai Luo
82bfdc8aaa
Address comment
2023-03-28 10:50:23 +08:00
Kai Luo
5aad51098d
Avoid misalign
2023-03-24 10:25:52 +08:00
Matthias Krüger
2a39cf560f
Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholk
...
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`
This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
2023-03-23 19:55:45 +01:00
Kai Luo
6e8a8282b8
Implement current_dll_path for AIX
2023-03-23 16:50:49 +08:00
Andy Russell
bb7c373fdf
migrate compiler, bootstrap, and compiletest to windows-rs
2023-03-20 13:19:35 -04:00
John Kåre Alsaker
4f7cd3d459
Add try_canonicalize
to rustc_fs_util
and use it over fs::canonicalize
2023-03-16 21:50:23 +01:00
liushuyu
2186358e5a
compiler/rustc_session: fix sysroot detection logic ...
...
... on systems where /usr/lib contains a multi-arch structure
2023-02-28 10:02:38 -07:00
Maybe Waffle
5bf6a46032
Replace some then
s with some then_some
s
2023-02-16 15:26:03 +00:00
Maybe Waffle
8751fa1a9a
if $c:expr { Some($r:expr) } else { None }
=>> $c.then(|| $r)
2023-02-16 15:26:00 +00:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
Matthias Krüger
1da4a49912
clippy::complexity fixes
...
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
2022-12-19 00:04:28 +01:00
KaDiWa
9bc69925cb
compiler: remove unnecessary imports and qualified paths
2022-12-10 18:45:34 +01:00
Onur Özkan
71a3a48ee5
improve filesearch::get_or_default_sysroot
r=ozkanonur
...
Signed-off-by: Onur Özkan <work@onurozkan.dev>
2022-11-04 17:06:47 +03:00
Oli Scherer
ee3c835018
Always import all tracing macros for the entire crate instead of piecemeal by module
2022-09-01 14:54:27 +00:00
Jubilee Young
de66e08957
Prettify rustc_session fmt with capturing args (nfc)
2022-03-24 22:38:13 -07:00
Nicholas Nethercote
89b61ea09f
Inline and remove FileSearch::search
.
...
It has only a single callsite, and having all the code in one place will
make it possible to optimize the search.
2022-02-02 09:06:34 +11:00
Nicholas Nethercote
47b5d95db8
Remove FileMatch
.
...
It's returned from `FileSearch::search` but it's only used to print some
debug info.
2022-02-02 09:06:34 +11:00
Nicholas Nethercote
f916f3a36b
Remove rlib special-casing in FileSearch::search
.
...
This code and comment appear to be out of date.
`CrateLocator::find_library_crate` is the only caller of this function
and it handles rlib vs dylib overlap itself (see
`CrateLocator::extract_lib`) after inspecting all the files present, so
it doesn't need to see them in any particular order.
2022-02-02 09:06:34 +11:00
Mara Bos
1acb44f03c
Use IntoIterator for array impl everywhere.
2021-12-04 19:40:33 +01:00
bjorn3
58000ed0e9
Move get_tools_search_paths from FileSearch to Session
...
It only uses fields of FileSearch that are stored in Session too
2021-09-08 18:25:47 +02:00
bjorn3
a4a22f07d7
Doc comments
2021-09-08 18:25:46 +02:00
Simonas Kazlauskas
b7c5599d22
Adjust target search algorithm for rustlib path
...
With this the concerns expressed in #83800 should be addressed.
2021-05-10 19:15:19 +03:00
klensy
08b1e8004b
fix review
2021-02-25 04:21:12 +03:00
klensy
5ff1be197e
replaced some unwrap_or with unwrap_or_else
2021-02-23 23:56:04 +03:00
bors
16b805713c
Auto merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisa
...
Fix rustc sysroot in systems using CAS
Change filesearch::get_or_default_sysroot() to check if sysroot is found using env::args().next() if rustc in argv[0] is a symlink; otherwise, or if it is not found, use env::current_exe() to imply sysroot. This makes the rustc binary able to locate Rust libraries in systems using content-addressable storage (CAS).
2021-02-05 22:58:13 +00:00
Ramon de C Valle
3f679fef23
Fix rustc sysroot in systems using CAS
...
Change filesearch::get_or_default_sysroot() to check if sysroot is found
using env::args().next() if rustc in argv[0] is a symlink; otherwise, or
if it is not found, use env::current_exe() to imply sysroot. This makes
the rustc binary able to locate Rust libraries in systems using
content-addressable storage (CAS).
2021-01-27 19:27:23 -08:00
Matthias Krüger
bdc9291ed9
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
2020-12-30 13:11:52 +01:00
Jubilee Young
0e88db7db4
Dogfood {exclusive,half-open} ranges in compiler (nfc)
...
In particular, this allows us to write more explicit matches that
avoid the pitfalls of using a fully general fall-through case, yet
remain fairly ergonomic. Less logic is in guard cases, more is in
the actual exhaustive case analysis.
No functional changes.
2020-10-28 20:09:20 -07:00
est31
12187b7f86
Remove unused #[allow(...)] statements from compiler/
2020-09-26 01:25:55 +02:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00