about summary refs log tree commit diff
path: root/compiler/rustc_session/src/output.rs
AgeCommit message (Collapse)AuthorLines
2025-05-04Initial support for dynamically linked cratesBryanskiy-1/+7
2025-04-15Auto merge of #138906 - thaliaarchi:unsupported-test-exe, r=bjorn3bors-0/+7
Reject test executables when not supported by target Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables. See https://github.com/rust-lang/rust/issues/138047
2025-03-24Reject test executables when not supported by targetThalia Archibald-0/+7
Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables.
2025-03-25rustc_session: Add a helper function for obtaining staticlib prefix and suffixVadim Petrochenkov-1/+1
2025-02-15Reject macro calls inside of `#![crate_name]`León Orell Valerian Liehr-53/+3
2025-02-15Clean up rustc_session::output::{find,validate}_crate_nameLeón Orell Valerian Liehr-42/+51
2024-12-20Reduce the amount of explicit FatalError.raise()bjorn3-9/+6
Instead use dcx.abort_if_error() or guar.raise_fatal() instead. These guarantee that an error actually happened previously and thus we don't silently abort.
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-11-28Replace `Symbol::intern` calls with preinterned symbolsclubby789-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-5/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-03-13Make incremental sessions identity no longer depend on the crate names ↵John Kåre Alsaker-2/+63
provided by source code
2024-02-22Replace unnecessary `abort_if_errors`.Nicholas Nethercote-1/+2
Replace `abort_if_errors` calls that are certain to abort -- because we emit an error immediately beforehand -- with `FatalErro.raise()`.
2023-12-24Remove more `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-5/+5
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-11-30Update a comment.Nicholas Nethercote-1/+1
Save analysis was removed a while ago.
2023-10-13Format all the let chains in compilerMichael Goulet-2/+6
2023-09-03Make `.rmeta` file in `dep-info` have correct name (`lib` prefix)Martin Nordholts-17/+2
Since `filename_for_metadata()` and `OutputFilenames::path(OutputType::Metadata)` had different logic for the name of the metadata file, the `.d` file contained a file name different from the actual name used. Share the logic to fix the out-of-sync name. Closes 68839.
2023-07-26Add help for crate arg when crate name is invalidyukang-2/+11
2023-06-06Write to stdout if `-` is given as output fileJing Peng-15/+28
If `-o -` or `--emit KIND=-` is provided, output will be written to stdout instead. Binary output (`obj`, `llvm-bc`, `link` and `metadata`) being written this way will result in an error unless stdout is not a tty. Multiple output types going to stdout will trigger an error too, as they will all be mixded together.
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-2/+2
2023-01-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-2/+2
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-2/+2
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-2/+2
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-14/+15
2022-09-10translations(rustc_session): migrate output.rsLuis Cardoso-24/+11
2022-03-24Use a let-chain in _session::output (nfc)Jubilee Young-15/+9
2022-03-24Prettify rustc_session fmt with capturing args (nfc)Jubilee Young-9/+7
2022-03-16rustc_error: make ErrorReported impossible to constructmark-1/+1
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-1/+1
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-1/+1
2021-12-14fix clippy::single_char_pattern perf findingsMatthias Krüger-1/+1
2021-05-28Use command line metadata path if providedJeremy Fitzhardinge-0/+5
If the command-line has `--emit metadata=some/path/libfoo.rmeta` then use that. Closes #85356
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-10/+8
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-10-30Fix even more clippy warningsJoshua Nelson-4/+2
2020-10-15Replace target.target with target and target.ptr_width with target.pointer_widthest31-17/+9
Preparation for a subsequent change that replaces rustc_target::config::Config with its wrapped Target. On its own, this commit breaks the build. I don't like making build-breaking commits, but in this instance I believe that it makes review easier, as the "real" changes of this PR can be seen much more easily. Result of running: find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \; find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \; find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \; ./x.py fmt
2020-08-30mv compiler to compiler/mark-0/+217