File tree 1 file changed +5
-2
lines changed
compiler/rustc_error_messages/src
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,10 @@ pub fn fluent_bundle(
135
135
136
136
let fallback_locale = langid ! ( "en-US" ) ;
137
137
let requested_fallback_locale = requested_locale. as_ref ( ) == Some ( & fallback_locale) ;
138
-
138
+ trace ! ( ?requested_fallback_locale) ;
139
+ if requested_fallback_locale && additional_ftl_path. is_none ( ) {
140
+ return Ok ( None ) ;
141
+ }
139
142
// If there is only `-Z additional-ftl-path`, assume locale is "en-US", otherwise use user
140
143
// provided locale.
141
144
let locale = requested_locale. clone ( ) . unwrap_or ( fallback_locale) ;
@@ -153,7 +156,7 @@ pub fn fluent_bundle(
153
156
bundle. set_use_isolating ( with_directionality_markers) ;
154
157
155
158
// If the user requests the default locale then don't try to load anything.
156
- if !requested_fallback_locale && let Some ( requested_locale) = requested_locale {
159
+ if let Some ( requested_locale) = requested_locale {
157
160
let mut found_resources = false ;
158
161
for sysroot in user_provided_sysroot. iter_mut ( ) . chain ( sysroot_candidates. iter_mut ( ) ) {
159
162
sysroot. push ( "share" ) ;
You can’t perform that action at this time.
0 commit comments