about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-1/+1
2023-05-20Rollup merge of #111606 - jyn514:nightly-diagnostics, r=lcnrDylan DPC-1/+2
very minor cleanups - add `must_use` to `early_error_no_abort` this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. found this while investigating https://github.com/rust-lang/rust/issues/110090. - remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead: https://github.com/rust-lang/rust/blob/b275d2c30b6e88cc48747f349f7137076d450658/src/librustdoc/clean/utils.rs#L569-L573
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-3/+3
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-18very minor cleanupsjyn-1/+2
- add `must_use` to `early_error_no_abort` this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. - remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-3/+3
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-16Avoid `&format("...")` calls in error message code.Nicholas Nethercote-6/+6
Error message all end up passing into a function as an `impl Into<{D,Subd}iagnosticMessage>`. If an error message is creatd as `&format("...")` that means we allocate a string (in the `format!` call), then take a reference, and then clone (allocating again) the reference to produce the `{D,Subd}iagnosticMessage`, which is silly. This commit removes the leading `&` from a lot of these cases. This means the original `String` is moved into the `{D,Subd}iagnosticMessage`, avoiding the double allocations. This requires changing some function argument types from `&str` to `String` (when all arguments are `String`) or `impl Into<{D,Subd}iagnosticMessage>` (when some arguments are `String` and some are `&str`).
2023-05-13Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillotbors-0/+3
Introduce `DynSend` and `DynSync` auto trait for parallel compiler part of parallel-rustc #101566 This PR introduces `DynSend / DynSync` trait and `FromDyn / IntoDyn` structure in rustc_data_structure::marker. `FromDyn` can dynamically check data structures for thread safety when switching to parallel environments (such as calling `par_for_each_in`). This happens only when `-Z threads > 1` so it doesn't affect single-threaded mode's compile efficiency. r? `@cjgillot`
2023-05-08Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obkMichael Goulet-0/+1
Migrate `mir_transform` to translatable diagnostics cc #100717
2023-05-08Rollup merge of #105354 - BlackHoleFox:apple-deployment-printer, r=oli-obkYuki Okushi-0/+16
Add deployment-target --print flag for Apple targets This is very useful for crates that need to know what the Apple OS deployment target is for their build scripts or inside of a build environment. Right now, the defaults just get copy/pasted around the ecosystem since they've been stable for so long. But with #104385 in progress, that won't be true anymore and everything will need to move. Ideally whenever it happens again, this could be less painful as everything can ask the compiler what its default is instead. To show examples of the copy/paste proliferation, here's some crates and/or apps that do: - [cc](https://github.com/rust-lang/cc-rs/pull/708/files), Soon - [mac-notification-sys](https://github.com/h4llow3En/mac-notification-sys/pull/46/files#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42R10-R12) - [PyO3](https://github.com/PyO3/maturin/blob/ccb02d1aa1cc41e82a3572a3c8b35cace15f3e78/src/target.rs#L755-L758) - [Anki](https://github.com/ankitects/anki/blob/613b5c1034cc9943f3f68d818ae22b2e0acec877/build/runner/src/bundle/artifacts.rs#L49-L54) - [jsc-rs](https://github.com/Brooooooklyn/jsc-rs/blob/37767267568fb2de62fc441473e7d158dd980520/xtask/src/build.rs#L402-L405) ... and probably more that a simple GitHub codesearch didn't see
2023-05-06Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkinMatthias Krüger-46/+57
Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. I haven't changed clippy in case they want to make the change upstream instead of the subtree, but I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy```` Fixes https://github.com/rust-lang/rust/issues/109486.
2023-05-06correct literals for dyn thread safeSparrowLii-2/+2
2023-05-06introduce `DynSend` and `DynSync` auto traitSparrowLii-0/+3
2023-05-05Mark `ErrorGuaranteed` constructor as deprecated so people don't use itMichael Goulet-0/+1
2023-05-05Add deployment-target --print flag for Apple targetsBlackHoleFox-0/+16
2023-05-02Migrate `mir_transform` to translatable diagnosticsclubby789-0/+1
2023-05-01Make the BUG_REPORT_URL configurable by toolsjyn-46/+57
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt
2023-04-25Fix ICE on --print=... i/o errorsDavid Tolnay-40/+48
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-13Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-SimulacrumMatthias Krüger-1/+0
Stabilize IsTerminal FCP completed in https://github.com/rust-lang/rust/issues/98070 . closes: https://github.com/rust-lang/rust/issues/98070
2023-04-12Make rustdoc and rustc's help match exactlyJynn Nelson-33/+43
Before, rustdoc was missing `-C passes=list` and the "Available options" header. Making these match allows testing that they match exactly.
2023-04-10Stabilize IsTerminalJosh Triplett-1/+0
closes: https://github.com/rust-lang/rust/issues/98070
2023-04-03implement --print=all-target-specs-jsonPietro Albini-0/+11
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-23Rollup merge of #107718 - Zoxc:z-time, r=nnethercoteMatthias Krüger-5/+8
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-23rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov-1/+1
It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
2023-03-21Remove `unique` and move `VerboseTimingGuard` fields into a new structJohn Kåre Alsaker-1/+1
2023-03-21Add `-Z time-passes-format` to allow specifying a JSON output for `-Z ↵John Kåre Alsaker-5/+8
time-passes`
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-5/+3
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-06Querify early_lint_checks.Camille GILLOT-0/+1
2023-02-26refactor: statically guarantee that current error codes are documentedEzra Shaw-4/+1
2023-02-22various: translation resources from cg backendDavid Wood-2/+2
Extend `CodegenBackend` trait with a function returning the translation resources from the codegen backend, which can be added to the complete list of resources provided to the emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22errors: generate typed identifiers in each crateDavid Wood-3/+45
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-20Move the resolver into a queryOli Scherer-1/+1
2023-02-16Remove save-analysis.Nicholas Nethercote-19/+1
Most tests involving save-analysis were removed, but I kept a few where the `-Zsave-analysis` was an add-on to the main thing being tested, rather than the main thing being tested. For `x.py install`, the `rust-analysis` target has been removed. For `x.py dist`, the `rust-analysis` target has been kept in a degenerate form: it just produces a single file `reduced.json` indicating that save-analysis has been removed. This is necessary for rustup to keep working. Closes #43606.
2023-02-13Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisaMatthias Krüger-1/+2
Introduce `-Zterminal-urls` to use OSC8 for error codes Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-10Rollup merge of #107836 - chenyukang:yukang/fix-107822, r=oli-obkMatthias Krüger-1/+4
Handle properly when there is no crate attrs Fixes #107822 r? `@oli-obk`
2023-02-10add test for no input fileyukang-1/+4
2023-02-09Introduce `-Zterminal-urls` to use OSC8 for error codesEsteban Küber-1/+2
Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-09fix #107822, handle properly when there is no crate attrsyukang-1/+1
2023-02-08Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8KiMichael Goulet-14/+2
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion fixes https://github.com/rust-lang/miri/issues/2778 this was introduced in https://github.com/rust-lang/rust/pull/104645, so this PR reverts the flag-part and uses an env var instead.
2023-02-08Rollup merge of #107771 - estebank:ice-msg, r=compiler-errorsMatthias Krüger-3/+1
Tweak ICE message Modify main message to be more conversational and emit one fewer note.
2023-02-07Tweak ICE messageEsteban Küber-3/+1
Modify main message to be more conversational and emit one fewer note.
2023-02-07Replace a command line flag with an env var to allow tools to initialize the ↵Oli Scherer-14/+2
tracing loggers at their own discretion
2023-02-06Avoid locking the global context across the `after_expansion` callbackOli Scherer-5/+5
2023-02-02Rename rustc_driver to rustc_driver_implJohn Kåre Alsaker-0/+1353