1
Fork 0

introduce DynSend and DynSync auto trait

This commit is contained in:
SparrowLii 2023-03-03 10:14:57 +08:00
parent 963e5c0eff
commit b9746ce039
26 changed files with 558 additions and 115 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::Lrc;
use rustc_data_structures::sync::{IntoDyn, Lrc};
use rustc_error_messages::fluent_bundle::resolver::errors::{ReferenceKind, ResolverError};
use rustc_error_messages::langid;
use rustc_error_messages::DiagnosticMessage;
@ -27,10 +27,12 @@ fn make_dummy(ftl: &'static str) -> Dummy {
let langid_en = langid!("en-US");
#[cfg(parallel_compiler)]
let mut bundle = FluentBundle::new_concurrent(vec![langid_en]);
let mut bundle: FluentBundle =
IntoDyn(crate::fluent_bundle::bundle::FluentBundle::new_concurrent(vec![langid_en]));
#[cfg(not(parallel_compiler))]
let mut bundle = FluentBundle::new(vec![langid_en]);
let mut bundle: FluentBundle =
IntoDyn(crate::fluent_bundle::bundle::FluentBundle::new(vec![langid_en]));
bundle.add_resource(resource).expect("Failed to add FTL resources to the bundle.");