rust/compiler/rustc_hir_analysis/src
bors b869e84e58 Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk
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.

There are advantages and disadvantages to this change..

#### Advantages
- Changing a diagnostic now only recompiles the crate for that diagnostic and those crates that depend on it, rather than `rustc_error_messages` and all crates thereafter.
- This approach can be used to support first-party crates that want to supply translatable diagnostics (e.g. `rust-lang/thorin` in https://github.com/rust-lang/rust/pull/102612#discussion_r985372582, cc `@JhonnyBillM)`
- We can extend this a little so that tools built using rustc internals (like clippy or rustdoc) can add their own diagnostic resources (much more easily than those resources needing to be available to `rustc_error_messages`)

#### Disadvantages
- Crates can only refer to the diagnostic messages defined in the current crate (or those from dependencies), rather than all diagnostic messages.
- `rustc_driver` (or some other crate we create for this purpose) has to directly depend on *everything* that has error messages.
  - It already transitively depended on all these crates.

#### Pending work
- [x] I don't know how to make `rustc_codegen_gcc`'s translated diagnostics work with this approach - because `rustc_driver` can't depend on that crate and so can't get its resources to provide to the diagnostic emission. I don't really know how the alternative codegen backends are actually wired up to the compiler at all.
- [x] Update `triagebot.toml` to track the moved FTL files.

r? `@compiler-errors`
cc #100717
2023-02-22 15:14:22 +00:00
..
astconv Rollup merge of #108265 - lcnr:cg-error-msg, r=BoxyUwU 2023-02-20 14:32:56 +01:00
check Auto merge of #108138 - compiler-errors:malformed-fn-trait, r=TaKO8Ki 2023-02-21 12:59:11 +00:00
coherence Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstrieb 2023-02-17 17:42:51 +00:00
collect Convert a hard-warning about named static lifetimes into lint "unused_lifetimes" 2023-02-22 09:44:26 +08:00
impl_wf_check add predicate evaluation logic 2023-02-17 09:32:39 +00:00
outlives Add Clause::ConstArgHasType variant 2023-02-17 09:30:33 +00:00
structured_errors Copy ty::AssocItem all other the place 2023-02-15 20:22:41 +00:00
variance remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
autoderef.rs fix: use LocalDefId instead of HirId in trait res 2023-01-23 11:42:18 +00:00
bounds.rs Rework hir Bounds collection 2022-12-28 23:40:09 +00:00
check_unused.rs Use expect_{use,fn} in a couple of places 2023-01-30 05:50:37 +00:00
collect.rs Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
constrained_generic_params.rs Make visiting traits generic over the Interner 2023-02-13 10:24:49 +00:00
errors.rs errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
hir_wf_check.rs Rename folder traits' tcx method to interner 2023-02-13 10:24:51 +00:00
impl_wf_check.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
lib.rs errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
structured_errors.rs rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00