summary refs log tree commit diff
path: root/compiler/rustc_session
AgeCommit message (Collapse)AuthorLines
2023-04-27make sysroot finding compatible with multiarch systemsozkanonur-17/+18
Signed-off-by: ozkanonur <work@onurozkan.dev> (cherry picked from commit 2e98368c2f1a4cbefa3c8f43f550a7fc1831636e)
2023-04-13Implement `Copy` for `LocationDetail`Maybe Waffle-1/+1
2023-04-10Rollup merge of #110124 - Nilstrieb:📎-told-me-so, r=compiler-errorsDylan DPC-10/+11
Some clippy fixes in the compiler Best reviewed commit-by-commit 📎.
2023-04-09Fix some clippy::complexityNilstrieb-10/+11
2023-04-09Migrate `sess.opts.tests` uses to `sess.is_test_crate()`blyxyas-1/+1
2023-04-09Add little `is_test_crate` functionblyxyas-0/+5
2023-04-05Auto merge of #108905 - ferrocene:pa-compiletest-ignore, r=ehussbors-3/+16
Validate `ignore` and `only` compiletest directive, and add human-readable ignore reasons This PR adds strict validation for the `ignore` and `only` compiletest directives, failing if an unknown value is provided to them. Doing so uncovered 79 tests in `tests/ui` that had invalid directives, so this PR also fixes them. Finally, this PR adds human-readable ignore reasons when tests are ignored due to `ignore` or `only` directives, like *"only executed when the architecture is aarch64"* or *"ignored when the operative system is windows"*. This was the original reason why I started working on this PR and #108659, as we need both of them for Ferrocene. The PR is a draft because the code is extremely inefficient: it calls `rustc --print=cfg --target $target` for every rustc target (to gather the list of allowed ignore values), which on my system takes between 4s and 5s, and performs a lot of allocations of constant values. I'll fix both of them in the coming days. r? `@ehuss`
2023-04-05Auto merge of #109117 - oli-obk:locks, r=michaelwoeristerbors-13/+13
Avoid a few locks We can use atomics or datastructures tuned for specific access patterns instead of locks. This may be an improvement for parallel rustc, but it's mostly a cleanup making various datastructures only usable in the way they are used right now (append data, never mutate), instead of having a general purpose lock.
2023-04-04Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoeristerbors-27/+21
Extend -Cdebuginfo with new options and named aliases This is a rebase of https://github.com/rust-lang/rust/pull/83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979 Closes https://github.com/rust-lang/rust/pull/109311. Helps with https://github.com/rust-lang/rust/pull/104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix https://github.com/rust-lang/rust/issues/60020 Fix https://github.com/rust-lang/rust/issues/64405
2023-04-04Use new iteration helpers instead of manually rolling themOli Scherer-4/+1
2023-04-04Replace another lock with an append-only vecOli Scherer-2/+2
2023-04-04Remove a lock in favor of an AppendOnlyVecOli Scherer-7/+10
2023-04-04Add a usize-indexed append-only-vecOli Scherer-2/+2
2023-04-04Replace a lock with an atomicOli Scherer-3/+3
2023-04-03implement --print=all-target-specs-jsonPietro Albini-3/+16
2023-04-01use and_then/flat_map for map().flatten()Matthias Krüger-1/+1
2023-03-31Preserve, clarify, and extend debug informationJulia Tatz-27/+21
`-Cdebuginfo=1` was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for line tables only was added. Additionally an option for line info directives only was added, which is well needed for some targets. The debug info options should now behave the same as clang's debug info options.
2023-03-30Rollup merge of #109522 - bzEq:aix-current-dll-path, r=NilstriebMichael Goulet-0/+44
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-29Stabilize a portion of 'once_cell'Trevor Gross-1/+1
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-28Check data segment rangeKai Luo-6/+5
2023-03-28Address commentKai Luo-5/+11
2023-03-24Avoid misalignKai Luo-3/+8
2023-03-23Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholkMatthias Krüger-3/+5
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-23Rollup merge of #107718 - Zoxc:z-time, r=nnethercoteMatthias Krüger-1/+23
Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes` This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
2023-03-23Implement current_dll_path for AIXKai Luo-0/+34
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-37/+3
2023-03-21Remove `unique` and move `VerboseTimingGuard` fields into a new structJohn KÃ¥re Alsaker-2/+2
2023-03-21Add `-Z time-passes-format` to allow specifying a JSON output for `-Z ↵John Kåre Alsaker-3/+25
time-passes`
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-24/+31
2023-03-19The name of NativeLib will be presentedyukang-3/+13
2023-03-16Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`John KÃ¥re Alsaker-3/+5
2023-03-16Gate fmt args flattening behind -Zflatten-format-args.Mara Bos-0/+3
2023-03-12Auto merge of #108794 - nnethercote:avoid-unnecessary-hashing, r=cjgillotbors-0/+39
Avoid unnecessary hashing I noticed some stable hashing being done in a non-incremental build. It turns out that some of this is necessary to compute the crate hash, but some of it is not. Removing the unnecessary hashing is a perf win. r? `@cjgillot`
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-09Honor current target when checking conditional compilation valuesUrgau-3/+4
This is fixed by simply using the currently registered target in the current session. We need to use it because of target json that are not by design included in the rustc list of targets.
2023-03-08Rollup merge of #108873 - WaffleLapkin:cmp, r=cjgillotMatthias Krüger-9/+3
Simplify `sort_by` calls small cleanup
2023-03-08Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholkbors-5/+5
Do not implement HashStable for HashSet (MCP 533) This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order. The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-0/+39
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-03-07Simplify `sort_by` callsMaybe Waffle-9/+3
2023-03-04Rollup merge of #108405 - Nilstrieb:lazy-crate-name-optimization-fuel, ↵Dylan DPC-3/+7
r=WaffleLapkin Lazily compute crate name for consider_optimizing The extra query is unnecessary in the common case of not having fuel.
2023-03-03Rollup merge of #108694 - est31:backticks_matchmaking_comments, r=NilstriebMatthias Krüger-1/+1
Match unmatched backticks in compiler/ comments r? ``@Nilstrieb`` as per [advice](https://github.com/rust-lang/rust/pull/108685#issuecomment-1453018499)
2023-03-03Match end user facing unmatched backticks in compiler/est31-2/+2
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-03-01Add unstable option new_rpitit to be used for new RPITIT lowering systemSantiago Pastorino-0/+3
2023-03-01Use FxIndexSet instead of FxHashSet for asm_target_features query.Michael Woerister-5/+5
2023-02-28compiler/rustc_session: fix sysroot detection logic ...liushuyu-1/+11
... on systems where /usr/lib contains a multi-arch structure
2023-02-25Rollup merge of #107675 - jsgf:link-directives, r=davidtwcoMichael Goulet-0/+2
Implement -Zlink-directives=yes/no `-Zlink-directives=no` will ignored `#[link]` directives while compiling a crate, so nothing is emitted into the crate's metadata. The assumption is that the build system already knows about the crate's native dependencies and can provide them at link time without these directives. This is another way to address issue # #70093, which is currently addressed by `-Zlink-native-libraries` (implemented in #70095). The latter is implemented at link time, which has the effect of ignoring `#[link]` in *every* crate. This makes it a very large hammer as it requires all native dependencies to be known to the build system to be at all usable, including those in sysroot libraries. I think this means its effectively unused, and definitely under-used. Being able to control this on a crate-by-crate basis should make it much easier to apply when needed. I'm not sure if we need both mechanisms, but we can decide that later. cc `@pcwalton` `@cramertj`
2023-02-23Lazily compute crate name for consider_optimizingNilstrieb-3/+7
The extra query is unnecessary in the common case of not having fuel.
2023-02-22link-directives: clarify usage messageJeremy Fitzhardinge-1/+1
2023-02-22Implement -Zlink-directives=yes/noJeremy Fitzhardinge-0/+2
`-Zlink-directives=no` will ignored `#[link]` directives while compiling a crate, so nothing is emitted into the crate's metadata. The assumption is that the build system already knows about the crate's native dependencies and can provide them at link time without these directives. This is another way to address issue # #70093, which is currently addressed by `-Zlink-native-libraries` (implemented in #70095). The latter is implemented at link time, which has the effect of ignoring `#[link]` in *every* crate. This makes it a very large hammer as it requires all native dependencies to be known to the build system to be at all usable, including those in sysroot libraries. I think this means its effectively unused, and definitely under-used. Being able to control this on a crate-by-crate basis should make it much easier to apply when needed. I'm not sure if we need both mechanisms, but we can decide that later.