Skip to content

Commit ec1b20b

Browse files
committed
Auto merge of #152924 - JonathanBrouwer:rollup-vnwkCh0, r=JonathanBrouwer
Rollup of 9 pull requests Successful merges: - rust-lang/rust#146832 (Not linting irrefutable_let_patterns on let chains) - rust-lang/rust#146972 (Support importing path-segment keyword with renaming) - rust-lang/rust#152241 (For panic=unwind on Wasm targets, define __cpp_exception tag) - rust-lang/rust#152527 (Remove -Zemit-thin-lto flag) - rust-lang/rust#152769 (Do not cancel try builds after first job failure) - rust-lang/rust#152907 (Add tests for delegation generics) - rust-lang/rust#152455 (Remove the translation `-Z` options and the `Translator` type. ) - rust-lang/rust#152813 (Skip the `use_existential_projection_new_instead` field in the `Debug` impl) - rust-lang/rust#152912 (Expose Span for all DefIds in rustc_public)
2 parents 4259e6f + 1cea45d commit ec1b20b

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

src/diagnostics/translation.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -159,48 +159,6 @@ have such implementations.
159159
`set_arg` calls are handled transparently by diagnostic derives but need to be
160160
added manually when using diagnostic builder APIs.
161161

162-
### Loading
163-
164-
rustc makes a distinction between the "fallback bundle" for `en-US` that is used
165-
by default and when another locale is missing a message; and the primary fluent
166-
bundle which is requested by the user.
167-
168-
Diagnostic emitters implement the `Emitter` trait which has two functions for
169-
accessing the fallback and primary fluent bundles (`fallback_fluent_bundle` and
170-
`fluent_bundle` respectively).
171-
172-
`Emitter` also has member functions with default implementations for performing
173-
translation of a `DiagMessage` using the results of
174-
`fallback_fluent_bundle` and `fluent_bundle`.
175-
176-
All of the emitters in rustc load the fallback Fluent bundle lazily, only
177-
reading Fluent resources and parsing them when an error message is first being
178-
translated (for performance reasons - it doesn't make sense to do this if no
179-
error is being emitted). `rustc_error_messages::fallback_fluent_bundle` returns
180-
a `std::lazy::Lazy<FluentBundle>` which is provided to emitters and evaluated
181-
in the first call to `Emitter::fallback_fluent_bundle`.
182-
183-
The primary Fluent bundle (for the user's desired locale) is expected to be
184-
returned by `Emitter::fluent_bundle`. This bundle is used preferentially when
185-
translating messages, the fallback bundle is only used if the primary bundle is
186-
missing a message or not provided.
187-
188-
There are no locale bundles distributed with the compiler,
189-
but mechanisms are implemented for loading them.
190-
191-
- `-Ztranslate-additional-ftl` can be used to load a specific resource as the
192-
primary bundle for testing purposes.
193-
- `-Ztranslate-lang` can be provided a language identifier (something like
194-
`en-US`) and will load any Fluent resources found in
195-
`$sysroot/share/locale/$locale/` directory (both the user provided
196-
sysroot and any sysroot candidates).
197-
198-
Primary bundles are not currently loaded lazily and if requested will be loaded
199-
at the start of compilation regardless of whether an error occurs. Lazily
200-
loading primary bundles is possible if it can be assumed that loading a bundle
201-
won't fail. Bundle loading can fail if a requested locale is missing, Fluent
202-
files are malformed, or a message is duplicated in multiple resources.
203-
204162
[Fluent]: https://projectfluent.org
205163
[`compiler/rustc_borrowck/messages.ftl`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_borrowck/messages.ftl
206164
[`compiler/rustc_parse/messages.ftl`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_parse/messages.ftl

0 commit comments

Comments
 (0)