Commit Graph

32 Commits

Author SHA1 Message Date
David Tolnay 2dbb24125c Fix ICE on --print=... i/o errors 2023-04-25 08:17:18 -07:00
Camille GILLOT e92e20c99c Remove WithOptconstParam. 2023-04-20 17:48:32 +00:00
Nilstrieb 6ac6af557f Add rustc_fluent_macro to decouple fluent from rustc_macros
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-18 18:56:22 +00:00
Matthias Krüger 83a66fa676 Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-Simulacrum
Stabilize IsTerminal

FCP completed in https://github.com/rust-lang/rust/issues/98070 .

closes: https://github.com/rust-lang/rust/issues/98070
2023-04-13 11:21:00 +02:00
Jynn Nelson aeaca567cb Make rustdoc and rustc's help match exactly
Before, rustdoc was missing `-C passes=list` and the "Available options"
header.

Making these match allows testing that they match exactly.
2023-04-12 05:27:26 -05:00
Josh Triplett 4c930d9e46 Stabilize IsTerminal
closes: https://github.com/rust-lang/rust/issues/98070
2023-04-10 17:24:23 +09:00
Pietro Albini c7fe5be4d6 implement --print=all-target-specs-json 2023-04-03 09:24:14 +02:00
Trevor Gross 2560c0f9d5 Stabilize a portion of 'once_cell'
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-29 18:04:44 -04:00
Matthias Krüger e62a99c353 Rollup merge of #107718 - Zoxc:z-time, r=nnethercote
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-23 19:55:43 +01:00
Vadim Petrochenkov 568f00f235 rustc_interface: Add a new query pre_configure
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-23 14:22:48 +04:00
John Kåre Alsaker 6050a83fa0 Remove unique and move VerboseTimingGuard fields into a new struct 2023-03-21 18:41:45 +01:00
John Kåre Alsaker 79462b9f6a Add -Z time-passes-format to allow specifying a JSON output for -Z time-passes 2023-03-21 18:18:25 +01:00
Andy Russell 9c12b92ecb migrate compiler, bootstrap, and compiletest to windows-rs 2023-03-20 13:19:35 -04:00
est31 a82d31d2da Simplify message paths
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-11 22:51:57 +01:00
Camille GILLOT 8eb75c4dbc Querify early_lint_checks. 2023-03-06 11:26:29 +00:00
Ezra Shaw 6c5dbccd13 refactor: statically guarantee that current error codes are documented 2023-02-26 20:12:36 +13:00
David Wood 3ab4592e23 various: translation resources from cg backend
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-22 09:15:54 +00:00
David Wood 197a027ef0 errors: generate typed identifiers in each crate
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-22 09:15:53 +00:00
Oli Scherer b6b3fe4470 Move the resolver into a query 2023-02-20 15:28:59 +00:00
Nicholas Nethercote 92f115df2a Remove save-analysis.
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-16 15:14:45 +11:00
Matthias Krüger 6f641b3a92 Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisa
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-13 11:34:57 +01:00
Matthias Krüger 9b9b2aa5fc Rollup merge of #107836 - chenyukang:yukang/fix-107822, r=oli-obk
Handle properly when there is no crate attrs

Fixes #107822

r? `@oli-obk`
2023-02-10 15:28:47 +01:00
yukang c685e6e6a0 add test for no input file 2023-02-10 08:02:56 +00:00
Esteban Küber 5c93e5aa28 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-09 14:52:54 +00:00
yukang 4fdd0fb90f fix #107822, handle properly when there is no crate attrs 2023-02-09 09:11:25 +00:00
Michael Goulet 7168cd1f45 Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8Ki
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-08 20:01:25 -08:00
Matthias Krüger ddbeac0fca Rollup merge of #107771 - estebank:ice-msg, r=compiler-errors
Tweak ICE message

Modify main message to be more conversational and emit one fewer note.
2023-02-08 07:13:27 +01:00
Esteban Küber d4ea9ed252 Tweak ICE message
Modify main message to be more conversational and emit one fewer note.
2023-02-07 19:17:24 +00:00
Oli Scherer e2e2ed29cb Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion 2023-02-07 16:33:03 +00:00
Oli Scherer e1dd4182ea Avoid locking the global context across the after_expansion callback 2023-02-06 21:11:03 +00:00
John Kåre Alsaker 8004ea53df Add a new rustc_driver dylib to rexport rustc_driver_impl 2023-02-02 07:34:41 +01:00
John Kåre Alsaker fe9182bb47 Rename rustc_driver to rustc_driver_impl 2023-02-02 07:12:10 +01:00