correct literals for dyn thread safe

This commit is contained in:
SparrowLii
2023-04-07 21:20:26 +08:00
parent 9f8ab2a8d3
commit 089a38880b
11 changed files with 48 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ use crate::error::{TranslateError, TranslateErrorKind};
use crate::fluent_bundle::*;
use crate::translation::Translate;
use crate::FluentBundle;
use rustc_data_structures::sync::{IntoDyn, Lrc};
use rustc_data_structures::sync::{IntoDynSyncSend, Lrc};
use rustc_error_messages::fluent_bundle::resolver::errors::{ReferenceKind, ResolverError};
use rustc_error_messages::langid;
use rustc_error_messages::DiagnosticMessage;
@@ -28,11 +28,13 @@ fn make_dummy(ftl: &'static str) -> Dummy {
#[cfg(parallel_compiler)]
let mut bundle: FluentBundle =
IntoDyn(crate::fluent_bundle::bundle::FluentBundle::new_concurrent(vec![langid_en]));
IntoDynSyncSend(crate::fluent_bundle::bundle::FluentBundle::new_concurrent(vec![
langid_en,
]));
#[cfg(not(parallel_compiler))]
let mut bundle: FluentBundle =
IntoDyn(crate::fluent_bundle::bundle::FluentBundle::new(vec![langid_en]));
IntoDynSyncSend(crate::fluent_bundle::bundle::FluentBundle::new(vec![langid_en]));
bundle.add_resource(resource).expect("Failed to add FTL resources to the bundle.");