Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a52b507

Browse files
committed
errors: disable directionality isolation markers
Fluent diagnostics can insert directionality isolation markers around interpolated variables indicating that there may be a shift from right-to-left to left-to-right text (or vice-versa). These are disabled because they are sometimes visible in the error output, but may be worth investigating in future (for example: if type names are left-to-right and the surrounding diagnostic messages are right-to-left, then these might be helpful). Signed-off-by: David Wood <david.wood@huawei.com>
1 parent 9956d4f commit a52b507

File tree

1 file changed

+9
-0
lines changed
  • compiler/rustc_error_messages/src

1 file changed

+9
-0
lines changed

compiler/rustc_error_messages/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ pub fn fluent_bundle(
111111
trace!(?locale);
112112
let mut bundle = FluentBundle::new(vec![locale]);
113113

114+
// Fluent diagnostics can insert directionality isolation markers around interpolated variables
115+
// indicating that there may be a shift from right-to-left to left-to-right text (or
116+
// vice-versa). These are disabled because they are sometimes visible in the error output, but
117+
// may be worth investigating in future (for example: if type names are left-to-right and the
118+
// surrounding diagnostic messages are right-to-left, then these might be helpful).
119+
bundle.set_use_isolating(false);
120+
114121
if let Some(requested_locale) = requested_locale {
115122
let mut sysroot = sysroot.to_path_buf();
116123
sysroot.push("share");
@@ -161,6 +168,8 @@ pub fn fallback_fluent_bundle() -> Result<Lrc<FluentBundle>, TranslationBundleEr
161168
.map_err(TranslationBundleError::from)?;
162169
trace!(?fallback_resource);
163170
let mut fallback_bundle = FluentBundle::new(vec![langid!("en-US")]);
171+
// See comment in `fluent_bundle`.
172+
fallback_bundle.set_use_isolating(false);
164173
fallback_bundle.add_resource(fallback_resource).map_err(TranslationBundleError::from)?;
165174
let fallback_bundle = Lrc::new(fallback_bundle);
166175
Ok(fallback_bundle)

0 commit comments

Comments
 (0)