Skip to content

Commit 2898d43

Browse files
Merge pull request #2783 from rust-lang/rustc-pull
Rustc pull update
2 parents 3c0490d + bec6b27 commit 2898d43

File tree

3 files changed

+3
-45
lines changed

3 files changed

+3
-45
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
139651428df86cf88443295542c12ea617cbb587
1+
c78a29473a68f07012904af11c92ecffa68fcc75

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

src/queries/incremental-compilation-in-detail.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn try_mark_green(tcx, current_node) -> bool {
178178

179179
> NOTE:
180180
> The actual implementation can be found in
181-
> [`compiler/rustc_query_system/src/dep_graph/graph.rs`][try_mark_green]
181+
> [`compiler/rustc_middle/src/dep_graph/graph.rs`][try_mark_green]
182182
183183
By using red-green marking we can avoid the devastating cumulative effect of
184184
having false positives during change detection. Whenever a query is executed
@@ -534,4 +534,4 @@ information.
534534

535535

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

0 commit comments

Comments
 (0)