Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b869e84

Browse files
committedFeb 22, 2023
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 #102612 (comment), 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
2 parents 3b4d6e0 + 2625518 commit b869e84

File tree

156 files changed

+1739
-1407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1739
-1407
lines changed
 

‎Cargo.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,26 +3930,47 @@ version = "0.0.0"
39303930
dependencies = [
39313931
"libc",
39323932
"rustc_ast",
3933+
"rustc_ast_lowering",
3934+
"rustc_ast_passes",
39333935
"rustc_ast_pretty",
3936+
"rustc_attr",
3937+
"rustc_borrowck",
3938+
"rustc_builtin_macros",
39343939
"rustc_codegen_ssa",
3940+
"rustc_const_eval",
39353941
"rustc_data_structures",
39363942
"rustc_error_codes",
3943+
"rustc_error_messages",
39373944
"rustc_errors",
3945+
"rustc_expand",
39383946
"rustc_feature",
39393947
"rustc_hir",
39403948
"rustc_hir_analysis",
39413949
"rustc_hir_pretty",
3950+
"rustc_hir_typeck",
3951+
"rustc_incremental",
3952+
"rustc_infer",
39423953
"rustc_interface",
39433954
"rustc_lint",
39443955
"rustc_log",
39453956
"rustc_macros",
39463957
"rustc_metadata",
39473958
"rustc_middle",
3959+
"rustc_mir_build",
3960+
"rustc_mir_dataflow",
3961+
"rustc_monomorphize",
39483962
"rustc_parse",
3963+
"rustc_passes",
39493964
"rustc_plugin_impl",
3965+
"rustc_privacy",
3966+
"rustc_query_system",
3967+
"rustc_resolve",
39503968
"rustc_session",
39513969
"rustc_span",
3970+
"rustc_symbol_mangling",
39523971
"rustc_target",
3972+
"rustc_trait_selection",
3973+
"rustc_ty_utils",
39533974
"serde_json",
39543975
"tracing",
39553976
"winapi",

0 commit comments

Comments
 (0)