Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fd06a76
Update the rustc-dev-guide
JonathanBrouwer Feb 10, 2026
507d3ed
Remove last remnants of `rustc_query_system`.
nnethercote Feb 13, 2026
69a1403
Rollup merge of #152703 - nnethercote:rm-rustc_query_system, r=Zalathar
Zalathar Feb 17, 2026
5f93dd3
Rollup merge of #152206 - tshepang:misc, r=davidtwco
Zalathar Feb 17, 2026
72b3a15
Rollup merge of #152664 - Embers-of-the-Fire:fix-152601, r=GuillaumeG…
Zalathar Feb 17, 2026
b466fa9
Rollup merge of #152698 - Zalathar:zforce, r=jieyouxu
Zalathar Feb 17, 2026
7f660f1
Rollup merge of #152727 - lcnr:method-ambig-err-taint, r=jackh726
Zalathar Feb 17, 2026
dec53fb
Rollup merge of #152728 - Ozzy1423:default-lib, r=JonathanBrouwer
Zalathar Feb 17, 2026
553bb9b
Auto merge of #152739 - Zalathar:rollup-8qaJ8F2, r=Zalathar
bors Feb 17, 2026
7325d04
Auto merge of #152717 - zetanumbers:fix-152375, r=JonathanBrouwer,pet…
bors Feb 17, 2026
a040923
Auto merge of #152738 - workingjubilee:revert-unsound-ice-patch, r=ma…
bors Feb 17, 2026
3c9ec03
Auto merge of #152677 - ehuss:bootstrap-json-target-spec, r=davidtwco…
bors Feb 17, 2026
4673fcf
Auto merge of #141295 - Kivooeo:if-let-guard-stable, r=fee1-dead,est31
bors Feb 18, 2026
3a2f267
Auto merge of #148034 - dianqk:matchbr-copy, r=cjgillot
bors Feb 19, 2026
abde238
Auto merge of #149375 - oli-obk:const_typeck, r=fee1-dead
bors Feb 19, 2026
4259e6f
Auto merge of #152689 - scottmcm:also-simplify-of-sized-val-alt, r=cj…
bors Feb 19, 2026
889d946
Rollup merge of #152241 - hoodmane:wasm-unwind-link-cpp-exception, r=…
JonathanBrouwer Feb 20, 2026
e4c54a4
Rollup merge of #152769 - Kobzol:try-builds-fail-fast, r=marcoieni
JonathanBrouwer Feb 20, 2026
d9e464c
Rollup merge of #152455 - JonathanBrouwer:remove_translation, r=jdons…
JonathanBrouwer Feb 20, 2026
347901e
Rollup merge of #152813 - makai410:debug-impl, r=lqd
JonathanBrouwer Feb 20, 2026
1cea45d
Rollup merge of #152912 - HKalbasi:rustc_public_def_span, r=makai410
JonathanBrouwer Feb 20, 2026
ec1b20b
Auto merge of #152924 - JonathanBrouwer:rollup-vnwkCh0, r=JonathanBro…
bors Feb 21, 2026
abf99a6
Auto merge of #152624 - camsteffen:symbols-audit, r=petrochenkov
bors Feb 21, 2026
047f502
Auto merge of #152896 - weihanglo:update-cargo, r=weihanglo
bors Feb 21, 2026
2f61036
Auto merge of #152737 - scottmcm:box_new_uninit_layout, r=RalfJung
bors Feb 22, 2026
c574809
Prepare for merging from rust-lang/rust
invalid-email-address Feb 23, 2026
bec6b27
Merge ref 'c78a29473a68' from rust-lang/rust
invalid-email-address Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
139651428df86cf88443295542c12ea617cbb587
c78a29473a68f07012904af11c92ecffa68fcc75
42 changes: 0 additions & 42 deletions src/diagnostics/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,48 +159,6 @@ have such implementations.
`set_arg` calls are handled transparently by diagnostic derives but need to be
added manually when using diagnostic builder APIs.

### Loading

rustc makes a distinction between the "fallback bundle" for `en-US` that is used
by default and when another locale is missing a message; and the primary fluent
bundle which is requested by the user.

Diagnostic emitters implement the `Emitter` trait which has two functions for
accessing the fallback and primary fluent bundles (`fallback_fluent_bundle` and
`fluent_bundle` respectively).

`Emitter` also has member functions with default implementations for performing
translation of a `DiagMessage` using the results of
`fallback_fluent_bundle` and `fluent_bundle`.

All of the emitters in rustc load the fallback Fluent bundle lazily, only
reading Fluent resources and parsing them when an error message is first being
translated (for performance reasons - it doesn't make sense to do this if no
error is being emitted). `rustc_error_messages::fallback_fluent_bundle` returns
a `std::lazy::Lazy<FluentBundle>` which is provided to emitters and evaluated
in the first call to `Emitter::fallback_fluent_bundle`.

The primary Fluent bundle (for the user's desired locale) is expected to be
returned by `Emitter::fluent_bundle`. This bundle is used preferentially when
translating messages, the fallback bundle is only used if the primary bundle is
missing a message or not provided.

There are no locale bundles distributed with the compiler,
but mechanisms are implemented for loading them.

- `-Ztranslate-additional-ftl` can be used to load a specific resource as the
primary bundle for testing purposes.
- `-Ztranslate-lang` can be provided a language identifier (something like
`en-US`) and will load any Fluent resources found in
`$sysroot/share/locale/$locale/` directory (both the user provided
sysroot and any sysroot candidates).

Primary bundles are not currently loaded lazily and if requested will be loaded
at the start of compilation regardless of whether an error occurs. Lazily
loading primary bundles is possible if it can be assumed that loading a bundle
won't fail. Bundle loading can fail if a requested locale is missing, Fluent
files are malformed, or a message is duplicated in multiple resources.

[Fluent]: https://projectfluent.org
[`compiler/rustc_borrowck/messages.ftl`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_borrowck/messages.ftl
[`compiler/rustc_parse/messages.ftl`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_parse/messages.ftl
Expand Down
4 changes: 2 additions & 2 deletions src/queries/incremental-compilation-in-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fn try_mark_green(tcx, current_node) -> bool {

> NOTE:
> The actual implementation can be found in
> [`compiler/rustc_query_system/src/dep_graph/graph.rs`][try_mark_green]
> [`compiler/rustc_middle/src/dep_graph/graph.rs`][try_mark_green]

By using red-green marking we can avoid the devastating cumulative effect of
having false positives during change detection. Whenever a query is executed
Expand Down Expand Up @@ -534,4 +534,4 @@ information.


[query-model]: ./query-evaluation-model-in-detail.html
[try_mark_green]: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_query_system/dep_graph/graph.rs.html
[try_mark_green]: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/dep_graph/graph.rs.html
Loading