about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
AgeCommit message (Collapse)AuthorLines
2025-09-19fixes for numerous clippy warningsMarijn Schouten-12/+11
2025-09-15Make llvm_enzyme a regular cargo featurebjorn3-0/+1
This makes it clearer that it is set by the build system rather than by the rustc that compiles the current rustc. It also avoids bootstrap needing to pass --check-cfg llvm_enzyme to rustc.
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-09-04Rollup merge of #146112 - scrabsha:push-utkysktvulto, r=WaffleLapkinStuart Cook-2/+2
don't uppercase error messages
2025-09-03don't uppercase error messagesSasha Pourcelot-2/+2
a more general version of https://github.com/rust-lang/rust/pull/146080. after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase. (i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_) i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry. in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-09-02Revert introduction of `[workspace.dependencies]`.Nicholas Nethercote-3/+3
This was done in #145740 and #145947. It is causing problems for people using r-a on anything that uses the rustc-dev rustup package, e.g. Miri, clippy. This repository has lots of submodules and subtrees and various different projects are carved out of pieces of it. It seems like `[workspace.dependencies]` will just be more trouble than it's worth.
2025-08-28Add `serde_json` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-08-28Add `libc` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-08-27Add `tracing` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-07-31Tidy up `Cargo.toml` files.Nicholas Nethercote-1/+1
- Add some missing `tidy-alphabetical-*` markers. - Remove some unnecessary blank lines.
2025-07-18Rollup merge of #143719 - xizheyin:142812-1, r=jieyouxuMatthias Krüger-0/+46
Emit warning when there is no space between `-o` and arg Closes rust-lang/rust#142812 `getopt` doesn't seem to have an API to check this, so we have to check the args manually. r? compiler
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-07-14rename `stable_mir` to `rustc_public`, and `rustc_smir` to `rustc_public_bridge`Makai-2/+2
2025-07-11Avoid building C++ for rustc_llvm with --compile-time-depsbjorn3-0/+1
This saves about 30s.
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-20Rollup merge of #142650 - camsteffen:refactor-translator, r=petrochenkovTrevor Gross-3/+7
Refactor Translator My main motivation was to simplify the usage of `SilentEmitter` for users like rustfmt. A few refactoring opportunities arose along the way. * Replace `Translate` trait with `Translator` struct * Replace `Emitter: Translate` with `Emitter::translator` * Split `SilentEmitter` into `FatalOnlyEmitter` and `SilentEmitter`
2025-06-20Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obkTrevor Gross-1/+5
Reduce uses of `hir_crate`. I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely. The second commit is a drive-by cleanup. It can be pulled into its own PR. r? ````@oli-obk````
2025-06-19Extract Translator structCameron Steffen-3/+7
2025-06-18Reduce uses of `hir_crate`.Camille GILLOT-1/+5
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-06-01Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhprattJacob Pratt-1/+0
Stabilize feature `result_flattening` Stabilizes the `Result::flatten` method ## Implementations - [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140 - [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692 - [x] Update stabilization attribute macros (this PR) ## Stabilization process - [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung`` - [x] FCP (haven't found any, is it applicable here?) - [ ] Close issue rust-lang/rust#70142
2025-05-17compiler & tools: bump windows crate to dedupe versionsklensy-1/+1
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-06Rollup merge of #140532 - celinval:chores-smir-ra, r=oli-obkStuart Cook-2/+2
Fix RustAnalyzer discovery of rustc's `stable_mir` crate This fixes issues with RustAnalyzer not finding `stable_mir` crate since RA discovery traverses the dependency graph of `rustc_driver` crate. This change also aligns with the long term architecture plan for these crates, since we are moving towards having stable_mir depend on rustc_smir and not the other way around. See [this doc](https://hackmd.io/jBRkZLqAQL2EVgwIIeNMHg) for more details. I believe a similar function will come handy eventually for `stable_mir` users, but I'm keeping it as part of `rustc_internal` since its current format initializes the StableMir context and requires `TyCtxt`. Finally, I added the `rustc_internal` module re-export under a feature since the APIs from this module shall not be stabilized.
2025-05-04Initial support for dynamically linked cratesBryanskiy-2/+5
2025-04-30Change rustc_driver dependency on stable_mir crateCelina G. Val-2/+2
This fixes issues with RustAnalyzer not finding stable_mir crate. It is also part of the long term architecture plan for these crates, since we are moving towards having stable_mir depend on rustc_smir and not the other way around. I believe this is an utility function that will come handy eventually for stable_mir users, but I'm keeping it as part of rustc_internal since it initializes the StableMir context and requires `TyCtxt`. Finally, I added the rustc_internal crate under a feature since the APIs from this module shall not be stabilized.
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-11/+4
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-11/+4
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