rust/compiler
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
..
rustc
rustc_abi
rustc_apfloat
rustc_arena
rustc_ast Use ThinVec in a few more AST types. 2023-02-21 11:51:56 +11:00
rustc_ast_lowering errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_ast_passes errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_ast_pretty
rustc_attr errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_baked_icu_data
rustc_borrowck errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_builtin_macros errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_codegen_cranelift various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_codegen_gcc various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_codegen_llvm various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_codegen_ssa various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_const_eval errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_data_structures Auto merge of #108300 - oli-obk:elsa, r=eholk 2023-02-22 08:44:30 +00:00
rustc_driver
rustc_driver_impl various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_error_codes
rustc_error_messages various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_errors various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_expand various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #108141 - spastorino:add_rpitit_queries, r=compiler-errors 2023-02-21 14:19:59 +05:30
rustc_hir_analysis Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_hir_pretty
rustc_hir_typeck Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_incremental errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_index
rustc_infer errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_interface Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_lexer
rustc_lint errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_lint_defs
rustc_llvm
rustc_log
rustc_macros errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_metadata errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_middle Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_mir_build errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_mir_dataflow errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_mir_transform Rollup merge of #108246 - saethlin:instcombine-redundant-casts, r=compiler-errors 2023-02-22 10:35:09 +01:00
rustc_monomorphize errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_parse errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_parse_format
rustc_passes errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_plugin_impl errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_privacy errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_query_impl
rustc_query_system Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_resolve Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_serialize Auto merge of #104754 - nnethercote:more-ThinVec-in-ast, r=the8472 2023-02-21 07:02:57 +00:00
rustc_session Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_smir
rustc_span
rustc_symbol_mangling errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_target
rustc_trait_selection Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obk 2023-02-22 15:14:22 +00:00
rustc_traits
rustc_transmute
rustc_ty_utils errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
rustc_type_ir