about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-09-19fixes for numerous clippy warningsMarijn Schouten-11/+10
2025-09-12Add --print target-spec-json-schemaNoratrieb-0/+4
This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.
2025-09-09Strip frontmatter in fewer placesLeón Orell Valerian Liehr-3/+9
2025-07-16Emit warning when there is no space between `-o` and confusing argxizheyin-0/+46
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-30Rollup merge of #143019 - danielframpton:codegen-backend-parse, r=bjorn3Matthias Krüger-1/+3
Ensure -V --verbose processes both codegen_backend and codegen-backend
2025-06-30Ensure -V --verbose processes both codegen_backend and codegen-backendDaniel Frampton-1/+3
2025-06-24rustc_session: Add a structure for keeping both explicit and default sysrootsVadim Petrochenkov-5/+5
Also avoid creating and cloning sysroot unnecessarily.
2025-06-19Extract Translator structCameron Steffen-3/+7
2025-06-15Rollup merge of #141769 - bjorn3:codegen_metadata_module_rework, ↵León Orell Valerian Liehr-21/+28
r=workingjubilee,saethlin Move metadata object generation for dylibs to the linker code This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time. Prerequisite of https://github.com/rust-lang/rust/issues/96708.
2025-06-12Add documentation for init_logger_with_additional_layerStypox-1/+6
2025-06-11Use closure to allow passing custom tracing layersStypox-5/+7
The previous method, where a layer would be passed directly, required to pass a "no-op" layer when no custom layer was needed. This should have in theory worked, however having a no-op layer seems to change the way the tracing lib applies filters internally, leading to some debug!() being printed despite them being out of the minimum level for the filters. Note however that this behavior was very inconsistent, and e.g. some debug!() would get printed and some others wouldn't, for no apparent reason.
2025-06-11Allow initializing logger with additional tracing LayerStypox-0/+11
2025-06-03Only borrow EncodedMetadata in codegen_cratebjorn3-21/+28
And move passing it to the linker to the driver code.
2025-05-16Removed feature flag from `compiler/rustc_driver_impl`Ryan van Polen-1/+0
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-05-06added error handle for error code > 9999Kivooeo-0/+1
2025-05-04Initial support for dynamically linked cratesBryanskiy-2/+5
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-14Auto merge of #124141 - ↵bors-1/+0
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-12Rollup merge of #139315 - clubby789:deranged-bump, r=Mark-SimulacrumChris Denton-10/+3
Switch `time` to `jiff` for time formatting in ICE dumps Due to https://github.com/jhpratt/deranged/issues/21, Clippy, R-A and Miri currently fail to build if we bump to 0.4.1, pulled in via `time`. ~~Add some specific type annotations so we don't have to just pin it.~~ ~~I can open 3 PRs to the tool repos if preferred, but I thought it might be easier to do this than to pin the transitive dep and go back and remove it once the changes are synced back.~~
2025-04-11Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-deadStuart Cook-0/+1
Allow drivers to supply a list of extra symbols to intern Allows adding new symbols as `const`s in external drivers, desirable in Clippy so we can use them in patterns to replace code like https://github.com/rust-lang/rust/blob/75530e9f72a1990ed2305e16fd51d02f47048f12/src/tools/clippy/clippy_lints/src/casts/cast_ptr_alignment.rs#L66 The Clippy change adds a couple symbols as a demo, the exact `clippy_utils` API and replacing other usages can be done on the Clippy side to minimise sync conflicts --- try-job: aarch64-gnu
2025-04-10Allow drivers to supply a list of extra symbols to internAlex Macleod-0/+1
2025-04-08fix "still mutable" ice while metrics are enabledJane Losare-Lusby-4/+4
2025-04-06Auto merge of #138947 - madsmtm:refactor-apple-versions, r=Noratriebbors-3/+2
Refactor Apple version handling in the compiler Move various Apple version handling code in the compiler out `rustc_codegen_ssa` and into a place where it can be accessed by `rustc_attr_parsing`, which I found to be necessary when doing https://github.com/rust-lang/rust/pull/136867. Thought I'd split it out to make it easier to land, and to make further changes like https://github.com/rust-lang/rust/pull/131477 have fewer conflicts / PR dependencies. There should be no functional changes in this PR. `@rustbot` label O-apple r? rust-lang/compiler
2025-04-05Switch `time` to `jiff` for time formatting in ICE dumpsclubby789-10/+3
2025-04-05Rollup merge of #138950 - yaahc:svh-metrics-name, r=bjorn3Stuart Cook-8/+5
replace extra_filename with strict version hash in metrics file names Should resolve the potential issue of overwriting metrics from the same crate when compiled with different features or flags. r? `````@estebank````` try-job: test-various
2025-04-04refactor: Move env parsing of deployment target to rustc_sessionMads Marquart-3/+2
2025-04-04refactor: Move Apple OSVersion (back) to rustc_targetMads Marquart-1/+1
Also convert OSVersion into a proper struct for better type-safety.
2025-04-04Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkinMatthias Krüger-1/+1
Rename `is_like_osx` to `is_like_darwin` Replace `is_like_osx` with `is_like_darwin`, which more closely describes reality (OS X is the pre-2016 name for macOS, and is by now quite outdated; Darwin is the overall name for the OS underlying Apple's macOS, iOS, etc.). ``@rustbot`` label O-apple r? compiler
2025-04-03Remove `LintExpectationId` from `Level` variantsOli Scherer-1/+1
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
2025-04-01replace extra_filename with strict version hash in metrics file namesJane Losare-Lusby-8/+5
2025-04-01Add unstable `--print=crate-root-lint-levels`Urgau-0/+28
2025-03-25Rename `is_like_osx` to `is_like_darwin`Mads Marquart-1/+1
2025-03-23Implement `supported-crate-types` print requestJieyou Xu-2/+12
As an unstable print request.
2025-03-21Move some calls to before calling codegen_cratebjorn3-1/+7
`--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
2025-03-21Move make_input callbjorn3-12/+7
2025-03-20Use `-Wunused_crate_dependencies` for compiler crates.Nicholas Nethercote-0/+8
It's very useful. There are some false positives involving integration tests in `rustc_pattern_analysis` and `rustc_serialize`. There is also a false positive involving `rustc_driver_impl`'s `rustc_randomized_layouts` feature. And I removed a `rustc_span` mention in a doc comment in `rustc_log` because it wasn't integral to the comment but caused a dev-dependency.
2025-03-17Auto merge of #138566 - yotamofek:pr/strip-prefix, r=nnethercotebors-2/+1
Use `strip_{prefix|suffix}` instead of `{starts|ends}_with`+indexing Randomly scratching an itch 😁
2025-03-17Use `strip_{prefix|suffix}` instead of `{starts|ends}_with`+indexingYotam Ofek-2/+1
2025-03-16Rename `PrintKind::{AllTargetSpecs,TargetSpec}` to ↵Jieyou Xu-2/+2
`{AllTargetSpecsJson,TargetSpecJson}` To correspond to their actual print request names, `target-spec-json` and `all-target-specs-json`, and for consistency with other print name <-> print kind mappings.
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-1/+0
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-0/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-07Increase recursion_limit in numerous crates.Nicholas Nethercote-0/+1
This is temporarily needed for `x doc compiler` to work. They can be removed once the `Nonterminal` is removed (#124141).
2025-02-15Reject macro calls inside of `#![crate_name]`León Orell Valerian Liehr-5/+5
2025-02-11compiler: compare and hash ExternAbi like its stringJubilee Young-2/+1
Directly map each ExternAbi variant to its string and back again. This has a few advantages: - By making the ABIs compare equal to their strings, we can easily lexicographically sort them and use that sorted slice at runtime. - We no longer need a workaround to make sure the hashes remain stable, as they already naturally are (by being the hashes of unique strings). - The compiler can carry around less &str wide pointers
2025-02-09compiler: remove rustc_target::spec::abi reexportsJubilee Young-1/+1
2025-02-06Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errorsMatthias Krüger-1/+1
Couple of minor cleanups to the diagnostic infrastructure