diff options
| author | SparrowLii <liyuan179@huawei.com> | 2023-03-03 10:14:57 +0800 |
|---|---|---|
| committer | SparrowLii <liyuan179@huawei.com> | 2023-05-06 09:34:18 +0800 |
| commit | b9746ce03901fc39707c8c2d0405caf5384b4e97 (patch) | |
| tree | 64ccb0f53279ed73da3b25f09d55029c9ae81323 /compiler/rustc_error_messages | |
| parent | 963e5c0eff171160238dc2a2c0ba7a1912fada67 (diff) | |
introduce `DynSend` and `DynSync` auto trait
Diffstat (limited to 'compiler/rustc_error_messages')
| -rw-r--r-- | compiler/rustc_error_messages/src/lib.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 6c3f677ab8e..2b7c8dc5f3d 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -11,7 +11,7 @@ extern crate tracing; use fluent_bundle::FluentResource; use fluent_syntax::parser::ParserError; use icu_provider_adapters::fallback::{LocaleFallbackProvider, LocaleFallbacker}; -use rustc_data_structures::sync::Lrc; +use rustc_data_structures::sync::{IntoDyn, Lrc}; use rustc_fluent_macro::fluent_messages; use rustc_macros::{Decodable, Encodable}; use rustc_span::Span; @@ -37,16 +37,17 @@ pub use unic_langid::{langid, LanguageIdentifier}; fluent_messages! { "../messages.ftl" } -pub type FluentBundle = fluent_bundle::bundle::FluentBundle<FluentResource, IntlLangMemoizer>; +pub type FluentBundle = + IntoDyn<fluent_bundle::bundle::FluentBundle<FluentResource, IntlLangMemoizer>>; -#[cfg(parallel_compiler)] +#[cfg(not(parallel_compiler))] fn new_bundle(locales: Vec<LanguageIdentifier>) -> FluentBundle { - FluentBundle::new_concurrent(locales) + IntoDyn(fluent_bundle::bundle::FluentBundle::new(locales)) } -#[cfg(not(parallel_compiler))] +#[cfg(parallel_compiler)] fn new_bundle(locales: Vec<LanguageIdentifier>) -> FluentBundle { - FluentBundle::new(locales) + IntoDyn(fluent_bundle::bundle::FluentBundle::new_concurrent(locales)) } #[derive(Debug)] |
