From 78fba8511ea8f7211dd7959e1bf61b7f3a691d30 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 17 Aug 2024 08:29:36 +0000 Subject: [PATCH 01/12] Fix diagnostics to invalid metavar exprs Suggesting to remove the entire thing makes no sense, especially not as MachineApplicable. --- compiler/rustc_expand/src/mbe/metavar_expr.rs | 7 +------ tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_expand/src/mbe/metavar_expr.rs b/compiler/rustc_expand/src/mbe/metavar_expr.rs index c4ba98f581e49..225e872b21cc5 100644 --- a/compiler/rustc_expand/src/mbe/metavar_expr.rs +++ b/compiler/rustc_expand/src/mbe/metavar_expr.rs @@ -98,12 +98,7 @@ impl MetaVarExpr { _ => { let err_msg = "unrecognized meta-variable expression"; let mut err = psess.dcx().struct_span_err(ident.span, err_msg); - err.span_suggestion( - ident.span, - "supported expressions are count, ignore, index and len", - "", - Applicability::MachineApplicable, - ); + err.help("supported expressions are count, ignore, index and len"); return Err(err); } }; diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr index 2c44ad2e0a4ad..0fb992f681998 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr @@ -188,7 +188,9 @@ error: unrecognized meta-variable expression --> $DIR/syntax-errors.rs:140:33 | LL | ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } }; - | ^^^^^^^^^^^^^^ help: supported expressions are count, ignore, index and len + | ^^^^^^^^^^^^^^ + | + = help: supported expressions are count, ignore, index and len error: expected identifier or string literal --> $DIR/syntax-errors.rs:118:33 From 1a09dd49e71f885b68dfa2d4063aa6c7816b70c3 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 17 Aug 2024 08:45:31 +0000 Subject: [PATCH 02/12] Fix typo in meta-var expr diagnostics --- compiler/rustc_expand/src/mbe/metavar_expr.rs | 2 +- tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs | 2 +- tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_expand/src/mbe/metavar_expr.rs b/compiler/rustc_expand/src/mbe/metavar_expr.rs index 225e872b21cc5..4a84670c0b1d9 100644 --- a/compiler/rustc_expand/src/mbe/metavar_expr.rs +++ b/compiler/rustc_expand/src/mbe/metavar_expr.rs @@ -192,7 +192,7 @@ fn parse_depth<'psess>( { Ok(n_usize) } else { - let msg = "only unsuffixes integer literals are supported in meta-variable expressions"; + let msg = "only unsuffixed integer literals are supported in meta-variable expressions"; Err(psess.dcx().struct_span_err(span, msg)) } } diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs index 1eda5f5bb6bc3..683c49e0aa1a4 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs @@ -103,7 +103,7 @@ macro_rules! metavar_token_without_ident { macro_rules! metavar_with_literal_suffix { ( $( $i:ident ),* ) => { ${ index(1u32) } }; - //~^ ERROR only unsuffixes integer literals are supported in meta-variable expressions + //~^ ERROR only unsuffixed integer literals are supported in meta-variable expressions //~| ERROR expected expression, found `$` } diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr index 0fb992f681998..8ffda50523584 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr @@ -160,7 +160,7 @@ error: meta-variables within meta-variable expressions must be referenced using LL | ( $( $i:ident ),* ) => { ${ ignore() } }; | ^^^^^^ -error: only unsuffixes integer literals are supported in meta-variable expressions +error: only unsuffixed integer literals are supported in meta-variable expressions --> $DIR/syntax-errors.rs:105:33 | LL | ( $( $i:ident ),* ) => { ${ index(1u32) } }; From 3ae0ae92e8c028a12b979b1763aeb9f898c558f7 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 14 Apr 2024 11:46:44 +0000 Subject: [PATCH 03/12] rustc_expand: add FIXMEs for translation --- compiler/rustc_expand/src/errors.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index 0fdccb0891899..a844449f4c9d2 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -166,6 +166,7 @@ pub(crate) struct FeatureRemoved<'a> { #[derive(Subdiagnostic)] #[note(expand_reason)] pub(crate) struct FeatureRemovedReason<'a> { + // FIXME: make this translatable pub reason: &'a str, } @@ -297,6 +298,7 @@ pub(crate) struct IncompleteParse<'a> { pub(crate) struct RemoveNodeNotSupported { #[primary_span] pub span: Span, + // FIXME: make this translatable pub descr: &'static str, } From da547b728c885f047fb7022922a5b570ed901b67 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 18 Aug 2024 15:16:34 +0000 Subject: [PATCH 04/12] Factor out ICU4X list formatter creation --- compiler/rustc_error_messages/src/lib.rs | 156 +++++++++++++---------- 1 file changed, 88 insertions(+), 68 deletions(-) diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index e84d7be45d7a0..0f18e34a27607 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -20,6 +20,7 @@ pub use fluent_bundle::types::FluentType; use fluent_bundle::FluentResource; pub use fluent_bundle::{self, FluentArgs, FluentError, FluentValue}; use fluent_syntax::parser::ParserError; +use icu_list::ListFormatter; use icu_provider_adapters::fallback::{LocaleFallbackProvider, LocaleFallbacker}; #[cfg(parallel_compiler)] use intl_memoizer::concurrent::IntlLangMemoizer; @@ -529,85 +530,104 @@ fn icu_locale_from_unic_langid(lang: LanguageIdentifier) -> Option>) -> FluentValue<'_> { - // Fluent requires 'static value here for its AnyEq usages. - #[derive(Clone, PartialEq, Debug)] - struct FluentStrListSepByAnd(Vec); +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +enum Separator { + And, +} - impl FluentType for FluentStrListSepByAnd { - fn duplicate(&self) -> Box { - Box::new(self.clone()) +impl Separator { + fn list_formatter( + &self, + data_provider: &LocaleFallbackProvider, + locale: icu_locid::Locale, + ) -> ListFormatter { + match self { + Separator::And => icu_list::ListFormatter::try_new_and_with_length_with_any_provider( + &data_provider, + &locale.into(), + icu_list::ListLength::Wide, + ), } + .expect("Failed to create list formatter") + } +} - fn as_string(&self, intls: &intl_memoizer::IntlLangMemoizer) -> Cow<'static, str> { - let result = intls - .with_try_get::((), |list_formatter| { - list_formatter.format_to_string(self.0.iter()) - }) - .unwrap(); - Cow::Owned(result) - } +#[derive(Clone, PartialEq, Debug)] +struct FluentStrListSepBy { + sep: Separator, + items: Vec, +} - #[cfg(not(parallel_compiler))] - fn as_string_threadsafe( - &self, - _intls: &intl_memoizer::concurrent::IntlLangMemoizer, - ) -> Cow<'static, str> { - unreachable!("`as_string_threadsafe` is not used in non-parallel rustc") - } +impl FluentType for FluentStrListSepBy { + fn duplicate(&self) -> Box { + Box::new(self.clone()) + } - #[cfg(parallel_compiler)] - fn as_string_threadsafe( - &self, - intls: &intl_memoizer::concurrent::IntlLangMemoizer, - ) -> Cow<'static, str> { - let result = intls - .with_try_get::((), |list_formatter| { - list_formatter.format_to_string(self.0.iter()) - }) - .unwrap(); - Cow::Owned(result) - } + fn as_string(&self, intls: &intl_memoizer::IntlLangMemoizer) -> Cow<'static, str> { + let result = intls + .with_try_get::(self.sep, |list_formatter| { + list_formatter.format_to_string(self.items.iter()) + }) + .unwrap(); + Cow::Owned(result) + } + + #[cfg(not(parallel_compiler))] + fn as_string_threadsafe( + &self, + _intls: &intl_memoizer::concurrent::IntlLangMemoizer, + ) -> Cow<'static, str> { + unreachable!("`as_string_threadsafe` is not used in non-parallel rustc") + } + + #[cfg(parallel_compiler)] + fn as_string_threadsafe( + &self, + intls: &intl_memoizer::concurrent::IntlLangMemoizer, + ) -> Cow<'static, str> { + let result = intls + .with_try_get::(self.sep, |list_formatter| { + list_formatter.format_to_string(self.items.iter()) + }) + .unwrap(); + Cow::Owned(result) } +} - struct MemoizableListFormatter(icu_list::ListFormatter); +struct MemoizableListFormatter(icu_list::ListFormatter); - impl std::ops::Deref for MemoizableListFormatter { - type Target = icu_list::ListFormatter; - fn deref(&self) -> &Self::Target { - &self.0 - } +impl std::ops::Deref for MemoizableListFormatter { + type Target = icu_list::ListFormatter; + fn deref(&self) -> &Self::Target { + &self.0 } +} - impl intl_memoizer::Memoizable for MemoizableListFormatter { - type Args = (); - type Error = (); - - fn construct(lang: LanguageIdentifier, _args: Self::Args) -> Result - where - Self: Sized, - { - let baked_data_provider = rustc_baked_icu_data::baked_data_provider(); - let locale_fallbacker = - LocaleFallbacker::try_new_with_any_provider(&baked_data_provider) - .expect("Failed to create fallback provider"); - let data_provider = - LocaleFallbackProvider::new_with_fallbacker(baked_data_provider, locale_fallbacker); - let locale = icu_locale_from_unic_langid(lang) - .unwrap_or_else(|| rustc_baked_icu_data::supported_locales::EN); - let list_formatter = - icu_list::ListFormatter::try_new_and_with_length_with_any_provider( - &data_provider, - &locale.into(), - icu_list::ListLength::Wide, - ) - .expect("Failed to create list formatter"); - - Ok(MemoizableListFormatter(list_formatter)) - } +impl intl_memoizer::Memoizable for MemoizableListFormatter { + type Args = Separator; + type Error = (); + + fn construct(lang: LanguageIdentifier, separator: Separator) -> Result + where + Self: Sized, + { + let baked_data_provider = rustc_baked_icu_data::baked_data_provider(); + let locale_fallbacker = LocaleFallbacker::try_new_with_any_provider(&baked_data_provider) + .expect("Failed to create fallback provider"); + let data_provider = + LocaleFallbackProvider::new_with_fallbacker(baked_data_provider, locale_fallbacker); + let locale = icu_locale_from_unic_langid(lang) + .unwrap_or_else(|| rustc_baked_icu_data::supported_locales::EN); + + let list_formatter = separator.list_formatter(&data_provider, locale); + + Ok(MemoizableListFormatter(list_formatter)) } +} - let l = l.into_iter().map(|x| x.into_owned()).collect(); +pub fn fluent_value_from_str_list_sep_by_and(l: Vec>) -> FluentValue<'_> { + // Fluent requires 'static value here for its AnyEq usages. + let items = l.into_iter().map(|x| x.into_owned()).collect(); - FluentValue::Custom(Box::new(FluentStrListSepByAnd(l))) + FluentValue::Custom(Box::new(FluentStrListSepBy { sep: Separator::And, items })) } From 0a7d3da99c2277932a0ae93f1daa999d0c06398d Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 19 Aug 2024 13:01:08 +0000 Subject: [PATCH 05/12] rustc_baked_icu_data: regenerate Using: - icu4x-datagen 1.5.0 - CLDR 45.0.0 - icuexport icu4x/2024-05-16/75.x The "pub use __impliterable*" lines in macros.rs need to be removed manually to avoid unused reexport errors. --- .../rustc_baked_icu_data/src/data/macros.rs | 11 ++-- .../macros/fallback_likelysubtags_v1.data.rs | 40 -------------- .../macros/fallback_likelysubtags_v1.rs.data | 55 +++++++++++++++++++ ...v1.data.rs => fallback_parents_v1.rs.data} | 23 ++++++-- ...a.rs => fallback_supplement_co_v1.rs.data} | 23 ++++++-- ...ist_and_v1.data.rs => list_and_v1.rs.data} | 25 +++++++-- compiler/rustc_baked_icu_data/src/data/mod.rs | 4 +- compiler/rustc_baked_icu_data/src/lib.rs | 9 +-- 8 files changed, 126 insertions(+), 64 deletions(-) delete mode 100644 compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.data.rs create mode 100644 compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.rs.data rename compiler/rustc_baked_icu_data/src/data/macros/{fallback_parents_v1.data.rs => fallback_parents_v1.rs.data} (54%) rename compiler/rustc_baked_icu_data/src/data/macros/{fallback_supplement_co_v1.data.rs => fallback_supplement_co_v1.rs.data} (52%) rename compiler/rustc_baked_icu_data/src/data/macros/{list_and_v1.data.rs => list_and_v1.rs.data} (91%) diff --git a/compiler/rustc_baked_icu_data/src/data/macros.rs b/compiler/rustc_baked_icu_data/src/data/macros.rs index bee309f9b8117..e543e71482152 100644 --- a/compiler/rustc_baked_icu_data/src/data/macros.rs +++ b/compiler/rustc_baked_icu_data/src/data/macros.rs @@ -14,33 +14,34 @@ #[macro_export] macro_rules! __make_provider { ($ name : ty) => { - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl $name { #[doc(hidden)] #[allow(dead_code)] pub const MUST_USE_MAKE_PROVIDER_MACRO: () = (); } + icu_provider::impl_data_provider_never_marker!($name); }; } #[doc(inline)] pub use __make_provider as make_provider; #[macro_use] -#[path = "macros/fallback_likelysubtags_v1.data.rs"] +#[path = "macros/fallback_likelysubtags_v1.rs.data"] mod fallback_likelysubtags_v1; #[doc(inline)] pub use __impl_fallback_likelysubtags_v1 as impl_fallback_likelysubtags_v1; #[macro_use] -#[path = "macros/fallback_parents_v1.data.rs"] +#[path = "macros/fallback_parents_v1.rs.data"] mod fallback_parents_v1; #[doc(inline)] pub use __impl_fallback_parents_v1 as impl_fallback_parents_v1; #[macro_use] -#[path = "macros/fallback_supplement_co_v1.data.rs"] +#[path = "macros/fallback_supplement_co_v1.rs.data"] mod fallback_supplement_co_v1; #[doc(inline)] pub use __impl_fallback_supplement_co_v1 as impl_fallback_supplement_co_v1; #[macro_use] -#[path = "macros/list_and_v1.data.rs"] +#[path = "macros/list_and_v1.rs.data"] mod list_and_v1; #[doc(inline)] pub use __impl_list_and_v1 as impl_list_and_v1; diff --git a/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.data.rs b/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.data.rs deleted file mode 100644 index 1adb58743f727..0000000000000 --- a/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.data.rs +++ /dev/null @@ -1,40 +0,0 @@ -// @generated -/// Implement `DataProvider` on the given struct using the data -/// hardcoded in this file. This allows the struct to be used with -/// `icu`'s `_unstable` constructors. -#[doc(hidden)] -#[macro_export] -macro_rules! __impl_fallback_likelysubtags_v1 { - ($ provider : ty) => { - #[clippy::msrv = "1.66"] - const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; - #[clippy::msrv = "1.66"] - impl $provider { - #[doc(hidden)] - pub const SINGLETON_FALLBACK_LIKELYSUBTAGS_V1: &'static ::Yokeable = &icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1 { - l2s: unsafe { - #[allow(unused_unsafe)] - zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"am\0ar\0as\0be\0bg\0bgcbhobn\0brxchrcv\0doiel\0fa\0gu\0he\0hi\0hy\0ja\0ka\0kk\0km\0kn\0ko\0kokks\0ky\0lo\0maimk\0ml\0mn\0mnimr\0my\0ne\0or\0pa\0ps\0rajru\0sa\0satsd\0si\0sr\0ta\0te\0tg\0th\0ti\0tt\0uk\0ur\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"EthiArabBengCyrlCyrlDevaDevaBengDevaCherCyrlDevaGrekArabGujrHebrDevaArmnJpanGeorCyrlKhmrKndaKoreDevaArabCyrlLaooDevaCyrlMlymCyrlBengDevaMymrDevaOryaGuruArabDevaCyrlDevaOlckArabSinhCyrlTamlTeluCyrlThaiEthiCyrlCyrlArabHantHans") }) - }, - lr2s: unsafe { - #[allow(unused_unsafe)] - zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0ha\0kk\0ky\0mn\0ms\0pa\0sd\0sr\0tg\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x03\0\0\0\x05\0\0\0\t\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x0F\0\0\0\x13\0\0\0\x14\0\0\0\x16\0\0\0\x17\0\0\0&\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IQ\0IR\0RU\0CM\0SD\0AF\0CN\0IR\0MN\0CN\0TR\0CN\0CC\0PK\0IN\0ME\0RO\0RU\0TR\0PK\0AF\0CN\0CN\0AU\0BN\0GB\0GF\0HK\0ID\0MO\0PA\0PF\0PH\0SR\0TH\0TW\0US\0VN\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabArabCyrlArabArabArabArabArabArabArabLatnMongArabArabDevaLatnLatnLatnLatnArabArabCyrlHansHantHantHantHantHantHantHantHantHantHantHantHantHantHantHant") }) - }, - l2r: unsafe { - #[allow(unused_unsafe)] - zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"af\0am\0ar\0as\0astaz\0be\0bg\0bgcbhobn\0br\0brxbs\0ca\0cebchrcs\0cv\0cy\0da\0de\0doidsbel\0en\0es\0et\0eu\0fa\0ff\0fi\0filfo\0fr\0ga\0gd\0gl\0gu\0ha\0he\0hi\0hr\0hsbhu\0hy\0ia\0id\0ig\0is\0it\0ja\0jv\0ka\0keakgpkk\0km\0kn\0ko\0kokks\0ky\0lo\0lt\0lv\0maimi\0mk\0ml\0mn\0mnimr\0ms\0my\0ne\0nl\0nn\0no\0or\0pa\0pcmpl\0ps\0pt\0qu\0rajrm\0ro\0ru\0sa\0satsc\0sd\0si\0sk\0sl\0so\0sq\0sr\0su\0sv\0sw\0ta\0te\0tg\0th\0ti\0tk\0to\0tr\0tt\0uk\0ur\0uz\0vi\0wo\0xh\0yo\0yrlyuezh\0zu\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ZA\0ET\0EG\0IN\0ES\0AZ\0BY\0BG\0IN\0IN\0BD\0FR\0IN\0BA\0ES\0PH\0US\0CZ\0RU\0GB\0DK\0DE\0IN\0DE\0GR\0US\0ES\0EE\0ES\0IR\0SN\0FI\0PH\0FO\0FR\0IE\0GB\0ES\0IN\0NG\0IL\0IN\0HR\0DE\0HU\0AM\x00001ID\0NG\0IS\0IT\0JP\0ID\0GE\0CV\0BR\0KZ\0KH\0IN\0KR\0IN\0IN\0KG\0LA\0LT\0LV\0IN\0NZ\0MK\0IN\0MN\0IN\0IN\0MY\0MM\0NP\0NL\0NO\0NO\0IN\0IN\0NG\0PL\0AF\0BR\0PE\0IN\0CH\0RO\0RU\0IN\0IN\0IT\0PK\0LK\0SK\0SI\0SO\0AL\0RS\0ID\0SE\0TZ\0IN\0IN\0TJ\0TH\0ET\0TM\0TO\0TR\0RU\0UA\0PK\0UZ\0VN\0SN\0ZA\0NG\0BR\0HK\0CN\0ZA\0") }) - }, - ls2r: unsafe { - #[allow(unused_unsafe)] - zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0en\0ff\0kk\0ky\0mn\0pa\0sd\0tg\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x11\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabShawAdlmArabArabLatnMongArabDevaKhojSindArabArabHansBopoHanbHant") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IR\0GB\0GN\0CN\0CN\0TR\0CN\0PK\0IN\0IN\0IN\0PK\0AF\0CN\0TW\0TW\0TW\0") }) - }, - }; - } - #[clippy::msrv = "1.66"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { - if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_LIKELYSUBTAGS_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(::KEY, req)) } - } - } - }; -} diff --git a/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.rs.data b/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.rs.data new file mode 100644 index 0000000000000..0266a372a7be5 --- /dev/null +++ b/compiler/rustc_baked_icu_data/src/data/macros/fallback_likelysubtags_v1.rs.data @@ -0,0 +1,55 @@ +// @generated +/// Implement `DataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `icu`'s `_unstable` constructors. +#[doc(hidden)] +#[macro_export] +macro_rules! __impl_fallback_likelysubtags_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; + #[clippy::msrv = "1.67"] + impl $provider { + #[doc(hidden)] + pub const SINGLETON_FALLBACK_LIKELYSUBTAGS_V1: &'static ::Yokeable = &icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1 { + l2s: unsafe { + #[allow(unused_unsafe)] + zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"am\0ar\0as\0be\0bg\0bgcbhobn\0brxchrcswcv\0doiel\0fa\0gu\0he\0hi\0hy\0ja\0ka\0kk\0km\0kn\0ko\0kokks\0ky\0lo\0maimk\0ml\0mn\0mnimr\0my\0ne\0nqoor\0pa\0ps\0rajru\0sa\0sahsatsd\0si\0sr\0syrta\0te\0tg\0th\0ti\0tt\0ug\0uk\0ur\0xnryuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"EthiArabBengCyrlCyrlDevaDevaBengDevaCherCansCyrlDevaGrekArabGujrHebrDevaArmnJpanGeorCyrlKhmrKndaKoreDevaArabCyrlLaooDevaCyrlMlymCyrlBengDevaMymrDevaNkooOryaGuruArabDevaCyrlDevaCyrlOlckArabSinhCyrlSyrcTamlTeluCyrlThaiEthiCyrlArabCyrlArabDevaHantHans") }) + }, + lr2s: unsafe { + #[allow(unused_unsafe)] + zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0ha\0kk\0ku\0ky\0mn\0ms\0pa\0sd\0sr\0tg\0ug\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x03\0\0\0\x05\0\0\0\t\0\0\0\n\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x0F\0\0\0\x10\0\0\0\x14\0\0\0\x15\0\0\0\x17\0\0\0\x19\0\0\0\x1A\0\0\0)\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IQ\0IR\0RU\0CM\0SD\0AF\0CN\0IR\0MN\0LB\0CN\0TR\0CN\0CC\0PK\0IN\0ME\0RO\0RU\0TR\0PK\0KZ\0MN\0AF\0CN\0CN\0AU\0BN\0GB\0GF\0HK\0ID\0MO\0PA\0PF\0PH\0SR\0TH\0TW\0US\0VN\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabArabCyrlArabArabArabArabArabArabArabArabLatnMongArabArabDevaLatnLatnLatnLatnArabCyrlCyrlArabCyrlHansHantHantHantHantHantHantHantHantHantHantHantHantHantHantHant") }) + }, + l2r: unsafe { + #[allow(unused_unsafe)] + zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"af\0am\0ar\0as\0astaz\0be\0bg\0bgcbhoblobn\0br\0brxbs\0ca\0cebchrcs\0cswcv\0cy\0da\0de\0doidsbel\0en\0eo\0es\0et\0eu\0fa\0ff\0fi\0filfo\0fr\0fy\0ga\0gd\0gl\0gu\0ha\0he\0hi\0hr\0hsbhu\0hy\0ia\0id\0ie\0ig\0is\0it\0ja\0jv\0ka\0keakgpkk\0km\0kn\0ko\0kokks\0ku\0kxvky\0lb\0lijlmolo\0lt\0lv\0maimi\0mk\0ml\0mn\0mnimr\0ms\0mt\0my\0ndsne\0nl\0nn\0no\0nqooc\0or\0pa\0pcmpl\0prgps\0pt\0qu\0rajrm\0ro\0ru\0sa\0sahsatsc\0sd\0si\0sk\0sl\0so\0sq\0sr\0su\0sv\0sw\0syrszlta\0te\0tg\0th\0ti\0tk\0to\0tr\0tt\0ug\0uk\0ur\0uz\0vecvi\0vmwwo\0xh\0xnryo\0yrlyueza\0zh\0zu\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ZA\0ET\0EG\0IN\0ES\0AZ\0BY\0BG\0IN\0IN\0BJ\0BD\0FR\0IN\0BA\0ES\0PH\0US\0CZ\0CA\0RU\0GB\0DK\0DE\0IN\0DE\0GR\0US\x00001ES\0EE\0ES\0IR\0SN\0FI\0PH\0FO\0FR\0NL\0IE\0GB\0ES\0IN\0NG\0IL\0IN\0HR\0DE\0HU\0AM\x00001ID\0EE\0NG\0IS\0IT\0JP\0ID\0GE\0CV\0BR\0KZ\0KH\0IN\0KR\0IN\0IN\0TR\0IN\0KG\0LU\0IT\0IT\0LA\0LT\0LV\0IN\0NZ\0MK\0IN\0MN\0IN\0IN\0MY\0MT\0MM\0DE\0NP\0NL\0NO\0NO\0GN\0FR\0IN\0IN\0NG\0PL\0PL\0AF\0BR\0PE\0IN\0CH\0RO\0RU\0IN\0RU\0IN\0IT\0PK\0LK\0SK\0SI\0SO\0AL\0RS\0ID\0SE\0TZ\0IQ\0PL\0IN\0IN\0TJ\0TH\0ET\0TM\0TO\0TR\0RU\0CN\0UA\0PK\0UZ\0IT\0VN\0MZ\0SN\0ZA\0IN\0NG\0BR\0HK\0CN\0CN\0ZA\0") }) + }, + ls2r: unsafe { + #[allow(unused_unsafe)] + zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0en\0ff\0kk\0ku\0ky\0mn\0pa\0sd\0tg\0ug\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x06\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\r\0\0\0\x0E\0\0\0\x0F\0\0\0\x10\0\0\0\x11\0\0\0\x14\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabShawAdlmArabArabYeziArabLatnMongArabDevaKhojSindArabCyrlArabHansBopoHanbHant") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IR\0GB\0GN\0CN\0IQ\0GE\0CN\0TR\0CN\0PK\0IN\0IN\0IN\0PK\0KZ\0AF\0CN\0TW\0TW\0TW\0") }) + }, + }; + } + #[clippy::msrv = "1.67"] + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_LIKELYSUBTAGS_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(::KEY, req)) } + } + } + }; +} +/// Implement `IterableDataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `DatagenDriver` for this key. +#[doc(hidden)] +#[macro_export] +macro_rules! __impliterable_fallback_likelysubtags_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + impl icu_provider::datagen::IterableDataProvider for $provider { + fn supported_locales(&self) -> Result, icu_provider::DataError> { + Ok([icu_provider::DataLocale::default()].into()) + } + } + }; +} diff --git a/compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.data.rs b/compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.rs.data similarity index 54% rename from compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.data.rs rename to compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.rs.data index 6f8d6590b0857..2cad9a49e4f11 100644 --- a/compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.data.rs +++ b/compiler/rustc_baked_icu_data/src/data/macros/fallback_parents_v1.rs.data @@ -6,19 +6,19 @@ #[macro_export] macro_rules! __impl_fallback_parents_v1 { ($ provider : ty) => { - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl $provider { #[doc(hidden)] pub const SINGLETON_FALLBACK_PARENTS_V1: &'static ::Yokeable = &icu_locid_transform::provider::LocaleFallbackParentsV1 { parents: unsafe { #[allow(unused_unsafe)] - zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x84\0\0\0\0\0\x06\0\x0B\0\x10\0\x15\0\x1A\0\x1F\0$\0)\0.\x003\08\0=\0B\0G\0L\0Q\0V\0[\0`\0e\0j\0o\0t\0y\0~\0\x83\0\x88\0\x8D\0\x92\0\x97\0\x9C\0\xA1\0\xA6\0\xAB\0\xB0\0\xB5\0\xBA\0\xBF\0\xC4\0\xC9\0\xCE\0\xD3\0\xD8\0\xDD\0\xE2\0\xE7\0\xEC\0\xF1\0\xF6\0\xFB\0\0\x01\x05\x01\n\x01\x0F\x01\x14\x01\x19\x01\x1E\x01#\x01(\x01-\x012\x017\x01<\x01A\x01F\x01K\x01P\x01U\x01Z\x01_\x01d\x01i\x01n\x01s\x01x\x01}\x01\x82\x01\x87\x01\x8C\x01\x91\x01\x96\x01\x9B\x01\xA0\x01\xA5\x01\xAA\x01\xAF\x01\xB4\x01\xB9\x01\xBE\x01\xC3\x01\xC8\x01\xCD\x01\xD2\x01\xD7\x01\xDC\x01\xE1\x01\xE6\x01\xEB\x01\xF0\x01\xF5\x01\xFA\x01\xFF\x01\x04\x02\t\x02\x0E\x02\x13\x02\x18\x02\x1D\x02\"\x02'\x02,\x021\x026\x02;\x02@\x02G\x02I\x02K\x02M\x02R\x02W\x02\\\x02a\x02f\x02k\x02p\x02u\x02z\x02\x7F\x02\x84\x02\x89\x02en-150en-AGen-AIen-ATen-AUen-BBen-BEen-BMen-BSen-BWen-BZen-CCen-CHen-CKen-CMen-CXen-CYen-DEen-DGen-DKen-DMen-ERen-FIen-FJen-FKen-FMen-GBen-GDen-GGen-GHen-GIen-GMen-GYen-HKen-IEen-ILen-IMen-INen-IOen-JEen-JMen-KEen-KIen-KNen-KYen-LCen-LRen-LSen-MGen-MOen-MSen-MTen-MUen-MVen-MWen-MYen-NAen-NFen-NGen-NLen-NRen-NUen-NZen-PGen-PKen-PNen-PWen-RWen-SBen-SCen-SDen-SEen-SGen-SHen-SIen-SLen-SSen-SXen-SZen-TCen-TKen-TOen-TTen-TVen-TZen-UGen-VCen-VGen-VUen-WSen-ZAen-ZMen-ZWes-ARes-BOes-BRes-BZes-CLes-COes-CRes-CUes-DOes-ECes-GTes-HNes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEhi-Latnhtnbnnno-NOpt-AOpt-CHpt-CVpt-FRpt-GQpt-GWpt-LUpt-MOpt-MZpt-STpt-TLzh-Hant-MO") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419en\0\0\0\0\0\0\x01IN\0fr\0\0\0\0\0\0\x01HT\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0zh\0\x01Hant\x01HK\0") }) + zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x86\0\0\0\0\0\x06\0\x0B\0\x10\0\x15\0\x1A\0\x1F\0$\0)\0.\x003\08\0=\0B\0G\0L\0Q\0V\0[\0`\0e\0j\0o\0t\0y\0~\0\x83\0\x88\0\x8D\0\x92\0\x97\0\x9C\0\xA1\0\xA6\0\xAB\0\xB0\0\xB5\0\xBA\0\xBF\0\xC4\0\xC9\0\xCE\0\xD3\0\xD8\0\xDD\0\xE2\0\xE7\0\xEC\0\xF1\0\xF6\0\xFB\0\0\x01\x05\x01\n\x01\x0F\x01\x14\x01\x19\x01\x1E\x01#\x01(\x01-\x012\x017\x01<\x01A\x01F\x01K\x01P\x01U\x01Z\x01_\x01d\x01i\x01n\x01s\x01x\x01}\x01\x82\x01\x87\x01\x8C\x01\x91\x01\x96\x01\x9B\x01\xA0\x01\xA5\x01\xAA\x01\xAF\x01\xB4\x01\xB9\x01\xBE\x01\xC3\x01\xC8\x01\xCD\x01\xD2\x01\xD7\x01\xDC\x01\xE1\x01\xE6\x01\xEB\x01\xF0\x01\xF5\x01\xFA\x01\xFF\x01\x04\x02\t\x02\x0E\x02\x13\x02\x18\x02\x1D\x02\"\x02'\x02,\x021\x026\x02;\x02@\x02E\x02J\x02Q\x02S\x02U\x02W\x02\\\x02a\x02f\x02k\x02p\x02u\x02z\x02\x7F\x02\x84\x02\x89\x02\x8E\x02\x93\x02en-150en-AGen-AIen-ATen-AUen-BBen-BEen-BMen-BSen-BWen-BZen-CCen-CHen-CKen-CMen-CXen-CYen-DEen-DGen-DKen-DMen-ERen-FIen-FJen-FKen-FMen-GBen-GDen-GGen-GHen-GIen-GMen-GYen-HKen-IDen-IEen-ILen-IMen-INen-IOen-JEen-JMen-KEen-KIen-KNen-KYen-LCen-LRen-LSen-MGen-MOen-MSen-MTen-MUen-MVen-MWen-MYen-NAen-NFen-NGen-NLen-NRen-NUen-NZen-PGen-PKen-PNen-PWen-RWen-SBen-SCen-SDen-SEen-SGen-SHen-SIen-SLen-SSen-SXen-SZen-TCen-TKen-TOen-TTen-TVen-TZen-UGen-VCen-VGen-VUen-WSen-ZAen-ZMen-ZWes-ARes-BOes-BRes-BZes-CLes-COes-CRes-CUes-DOes-ECes-GTes-HNes-JPes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEhi-Latnhtnbnnno-NOpt-AOpt-CHpt-CVpt-FRpt-GQpt-GWpt-LUpt-MOpt-MZpt-STpt-TLzh-Hant-MO") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419en\0\0\0\0\0\0\x01IN\0fr\0\0\0\0\0\0\x01HT\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0zh\0\x01Hant\x01HK\0") }) }, }; } - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl icu_provider::DataProvider for $provider { fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_PARENTS_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(::KEY, req)) } @@ -26,3 +26,18 @@ macro_rules! __impl_fallback_parents_v1 { } }; } +/// Implement `IterableDataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `DatagenDriver` for this key. +#[doc(hidden)] +#[macro_export] +macro_rules! __impliterable_fallback_parents_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + impl icu_provider::datagen::IterableDataProvider for $provider { + fn supported_locales(&self) -> Result, icu_provider::DataError> { + Ok([icu_provider::DataLocale::default()].into()) + } + } + }; +} diff --git a/compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.data.rs b/compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.rs.data similarity index 52% rename from compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.data.rs rename to compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.rs.data index 02eec37ee09ff..af0684f923085 100644 --- a/compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.data.rs +++ b/compiler/rustc_baked_icu_data/src/data/macros/fallback_supplement_co_v1.rs.data @@ -6,15 +6,15 @@ #[macro_export] macro_rules! __impl_fallback_supplement_co_v1 { ($ provider : ty) => { - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl $provider { #[doc(hidden)] pub const SINGLETON_FALLBACK_SUPPLEMENT_CO_V1: &'static ::Yokeable = &icu_locid_transform::provider::LocaleFallbackSupplementV1 { parents: unsafe { #[allow(unused_unsafe)] - zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x01\0\0\0\0\0yue") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"zh\0\x01Hant\0\0\0\0") }) + zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x1D\0\0\0\0\0\x07\0\x0E\0\x15\0\x1C\0#\0*\x001\08\0?\0F\0M\0T\0[\0b\0i\0p\0z\0\x81\0\x88\0\x8F\0\x96\0\x9D\0\xA4\0\xA7\0\xAD\0\xB5\0\xC0\0\xC8\0az-Arabaz-Cyrlbs-Cyrlen-Dsrten-Shawff-Adlmff-Arabha-Arabhi-Latnkk-Arabku-Arabky-Arabky-Latnml-Arabmn-Mongpa-Arabsr-Cyrl-MEsr-Latnug-Cyrluz-Arabuz-Cyrlwo-Arabyo-Arabyueyue-CNyue-Hansyue-Hans-CNyue-Hantzh-Hant") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0\0\0\0\0\0\0\0\0\0az\0\0\0\0\0\0\0\0\0\0bs\0\0\0\0\0\0\0\0\0\0en\0\0\0\0\0\0\0\0\0\0en\0\0\0\0\0\0\0\0\0\0ff\0\0\0\0\0\0\0\0\0\0ff\0\0\0\0\0\0\0\0\0\0ha\0\0\0\0\0\0\0\0\0\0hi\0\0\0\0\0\0\0\0\0\0kk\0\0\0\0\0\0\0\0\0\0ku\0\0\0\0\0\0\0\0\0\0ky\0\0\0\0\0\0\0\0\0\0ky\0\0\0\0\0\0\0\0\0\0ml\0\0\0\0\0\0\0\0\0\0mn\0\0\0\0\0\0\0\0\0\0pa\0\0\0\0\0\0\0\0\0\0sr\0\0\0\0\0\0\x01ME\0sr\0\0\0\0\0\0\0\0\0\0ug\0\0\0\0\0\0\0\0\0\0uz\0\0\0\0\0\0\0\0\0\0uz\0\0\0\0\0\0\0\0\0\0wo\0\0\0\0\0\0\0\0\0\0yo\0\0\0\0\0\0\0\0\0\0zh\0\x01Hant\0\0\0\0zh\0\x01Hans\0\0\0\0zh\0\x01Hans\0\0\0\0zh\0\x01Hans\0\0\0\0zh\0\x01Hant\0\0\0\0zh\0\0\0\0\0\0\0\0\0\0") }) }, unicode_extension_defaults: unsafe { #[allow(unused_unsafe)] @@ -22,7 +22,7 @@ macro_rules! __impl_fallback_supplement_co_v1 { }, }; } - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl icu_provider::DataProvider for $provider { fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_SUPPLEMENT_CO_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(::KEY, req)) } @@ -30,3 +30,18 @@ macro_rules! __impl_fallback_supplement_co_v1 { } }; } +/// Implement `IterableDataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `DatagenDriver` for this key. +#[doc(hidden)] +#[macro_export] +macro_rules! __impliterable_fallback_supplement_co_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + impl icu_provider::datagen::IterableDataProvider for $provider { + fn supported_locales(&self) -> Result, icu_provider::DataError> { + Ok([icu_provider::DataLocale::default()].into()) + } + } + }; +} diff --git a/compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.data.rs b/compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.rs.data similarity index 91% rename from compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.data.rs rename to compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.rs.data index 186f706cdb285..b1373c8a3a05b 100644 --- a/compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.data.rs +++ b/compiler/rustc_baked_icu_data/src/data/macros/list_and_v1.rs.data @@ -6,9 +6,9 @@ #[macro_export] macro_rules! __impl_list_and_v1 { ($ provider : ty) => { - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl icu_provider::DataProvider for $provider { fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { static EN_001: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" and ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" and ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" and ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" and ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }]); @@ -25,11 +25,26 @@ macro_rules! __impl_list_and_v1 { static JA: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }]); static ZH_HK: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("及", 3u8), special_case: None }]); static ZH: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }]); - static ZH_HANT: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }]); - static VALUES: [&::Yokeable; 215usize] = [&EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_IN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &HI_LATN, &IT, &IT, &IT, &IT, &JA, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &RU, &RU, &RU, &RU, &RU, &RU, &TR, &TR, &UND, &ZH, &ZH_HK, &ZH, &ZH, &ZH, &ZH_HANT, &ZH_HK, &ZH]; - static KEYS: [&str; 215usize] = ["en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MV", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "hi-Latn", "it", "it-CH", "it-SM", "it-VA", "ja", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "tr", "tr-CY", "und", "zh", "zh-HK", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-MO", "zh-SG"]; + static ZH_HANT: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("和", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }]); + static VALUES: [&::Yokeable; 216usize] = [&EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_IN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &HI_LATN, &IT, &IT, &IT, &IT, &JA, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &PT, &RU, &RU, &RU, &RU, &RU, &RU, &TR, &TR, &UND, &ZH, &ZH_HK, &ZH, &ZH, &ZH, &ZH_HANT, &ZH_HK, &ZH]; + static KEYS: [&str; 216usize] = ["en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-ID", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MV", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "hi-Latn", "it", "it-CH", "it-SM", "it-VA", "ja", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "tr", "tr-CY", "und", "zh", "zh-HK", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-MO", "zh-SG"]; if let Ok(payload) = KEYS.binary_search_by(|k| req.locale.strict_cmp(k.as_bytes()).reverse()).map(|i| *unsafe { VALUES.get_unchecked(i) }) { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(payload)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::MissingLocale.with_req(::KEY, req)) } } } }; } +/// Implement `IterableDataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `DatagenDriver` for this key. +#[doc(hidden)] +#[macro_export] +macro_rules! __impliterable_list_and_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + impl icu_provider::datagen::IterableDataProvider for $provider { + fn supported_locales(&self) -> Result, icu_provider::DataError> { + Ok(["en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-ID", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MV", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "hi-Latn", "it", "it-CH", "it-SM", "it-VA", "ja", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "tr", "tr-CY", "und", "zh", "zh-HK", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-MO", "zh-SG"].into_iter().map(|s| ::from_str(s).unwrap()).collect()) + } + } + }; +} diff --git a/compiler/rustc_baked_icu_data/src/data/mod.rs b/compiler/rustc_baked_icu_data/src/data/mod.rs index 465689f0cb8d7..e6385f34fc909 100644 --- a/compiler/rustc_baked_icu_data/src/data/mod.rs +++ b/compiler/rustc_baked_icu_data/src/data/mod.rs @@ -12,7 +12,7 @@ macro_rules! impl_data_provider { #[allow(unused_macros)] macro_rules! impl_any_provider { ($ provider : ty) => { - #[clippy::msrv = "1.66"] + #[clippy::msrv = "1.67"] impl icu_provider::AnyProvider for $provider { fn load_any(&self, key: icu_provider::DataKey, req: icu_provider::DataRequest) -> Result { match key.hashed() { @@ -26,6 +26,6 @@ macro_rules! impl_any_provider { } }; } -#[clippy::msrv = "1.66"] +#[clippy::msrv = "1.67"] pub struct BakedDataProvider; impl_data_provider!(BakedDataProvider); diff --git a/compiler/rustc_baked_icu_data/src/lib.rs b/compiler/rustc_baked_icu_data/src/lib.rs index f86a9db61c600..ade153fbccabf 100644 --- a/compiler/rustc_baked_icu_data/src/lib.rs +++ b/compiler/rustc_baked_icu_data/src/lib.rs @@ -14,10 +14,11 @@ //! To regenerate the data, run this command: //! //! ```text -//! icu4x-datagen -W --pretty --fingerprint --use-separate-crates \ -//! --format mod -l en es fr it ja pt ru tr zh zh-Hans zh-Hant \ -//! -k list/and@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \ -//! --cldr-tag latest --icuexport-tag latest -o src/data +//! icu4x-datagen -W --pretty --fingerprint --use-separate-crates --format mod \ +//! -l en es fr it ja pt ru tr zh zh-Hans zh-Hant \ +//! -k list/and@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \ +//! --cldr-tag latest --icuexport-tag latest \ +//! -o src/data //! ``` // tidy-alphabetical-start From bbb37592c059c8f5e4c841767d5f2d3ee2b0396e Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 18 Aug 2024 15:19:57 +0000 Subject: [PATCH 06/12] Add StrListSepByOr --- .../rustc_baked_icu_data/src/data/macros.rs | 5 +++ .../src/data/macros/list_or_v1.rs.data | 45 +++++++++++++++++++ compiler/rustc_baked_icu_data/src/data/mod.rs | 2 + compiler/rustc_baked_icu_data/src/lib.rs | 2 +- compiler/rustc_error_messages/src/lib.rs | 13 ++++++ compiler/rustc_errors/src/diagnostic.rs | 6 ++- 6 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 compiler/rustc_baked_icu_data/src/data/macros/list_or_v1.rs.data diff --git a/compiler/rustc_baked_icu_data/src/data/macros.rs b/compiler/rustc_baked_icu_data/src/data/macros.rs index e543e71482152..668e7c5e94b42 100644 --- a/compiler/rustc_baked_icu_data/src/data/macros.rs +++ b/compiler/rustc_baked_icu_data/src/data/macros.rs @@ -45,3 +45,8 @@ pub use __impl_fallback_supplement_co_v1 as impl_fallback_supplement_co_v1; mod list_and_v1; #[doc(inline)] pub use __impl_list_and_v1 as impl_list_and_v1; +#[macro_use] +#[path = "macros/list_or_v1.rs.data"] +mod list_or_v1; +#[doc(inline)] +pub use __impl_list_or_v1 as impl_list_or_v1; diff --git a/compiler/rustc_baked_icu_data/src/data/macros/list_or_v1.rs.data b/compiler/rustc_baked_icu_data/src/data/macros/list_or_v1.rs.data new file mode 100644 index 0000000000000..fd06fb0d02c76 --- /dev/null +++ b/compiler/rustc_baked_icu_data/src/data/macros/list_or_v1.rs.data @@ -0,0 +1,45 @@ +// @generated +/// Implement `DataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `icu`'s `_unstable` constructors. +#[doc(hidden)] +#[macro_export] +macro_rules! __impl_list_or_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; + #[clippy::msrv = "1.67"] + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + static IT: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: None }]); + static ES: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" o ", 3u8), special_case: Some(icu_list::provider::SpecialCasePattern { condition: unsafe { icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(if cfg!(target_endian = "little") { b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&M\x02\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:\0\0\0" } else { b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x17\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x03\x04\x05\x06\x07\x08\t\t\t\t\t\t\n\x0B\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x12\x12\x12\x12\x12\x12\x13\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x15\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x16\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x17\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x19\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1A\x1B\x1B\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1C\x1D\x1E\x1F !\"\"#$$$%&&&&&&&&&&&\0\0\x02M\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x02\x80\x07\x0B\0\0/\x02\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x07\0\x08\x08\n\n\r\r\x0F\x0F\x11\x11\x13\x13\0\0>\x02\0\0|\0\0\0g\0\0\0|\0\0\0g\0\0\0|\0\0\0\0\0\0\0\0\x03\0\x0F\x0F\x13\x13\0\0|\0\0\0|\0\0\0\0\0\0\0\0\x02\0\0&\0\0\x12\0\0\0\x12\0\0\0\0\x14\0\0\0\x01\x01\x02\x02\x03\x03\x04\x04\x05\x05\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E\x1E\x1F\x1F !!\"\"##$$%%\0\0|\0\0\0\x06\x01\0\0|\0\0\0!\x01\0\0|\0\0\0x\x01\0\0|\0\0\0\x87\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xC3\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x04\0\0\x06\x07\x0B\x0C&\0\0\x12\0\0\0#\0\0\0\x12\0\0\0\x12\0\0\0\0\x0E\0\0\x02\x04\x04\x06\x06\x07\x0B\x0C\x14\x1C\x1C\x1D\x1D\x1E !!\"\"##$$%%\0\0|\0\0\0|\0\0\0|\0\0\0!\x01\0\0|\0\0\0\x96\x01\0\0\xA5\x01\0\0\xB4\x01\0\0\xD8\x01\0\0\xB4\x01\0\0\xE7\x01\0\0\xF6\x01\0\0\x05\x02\0\0\x12\0\0\0\0\x02\0\x07\x0B\0\0\x87\x01\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0/\x02\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0|\0\0\0\0\0\0\0\0\x02\0\x18\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\x96\x01\0\0\0\0\0\0\0\x03\0\x15\x15\x16\x1A\0\0\x14\x02\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x15\x17\0\0\x96\x01\0\0\0\0\0\0\0\x02\0\x17\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x1A\0\0\xB4\x01\0\0\0\0\0\0\0\x02\0\x15\x16\0\0\xB4\x01\0\0\0\0\0\0\0\x04\0\x15\x18\x19\x19\x1A\x1A\0\0|\0\0\0\x06\x01\0\0|\0\0\0\0\0\0\0\0\x02\0\x07\x0B\0\0\x8B\0\0\0\0\0\0\0\0\x02\0\x08\x08\0\0\x8B\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0\0\0\0:\0\0\0\t\0\0\0\x12\0\0\0#\0\0\0\0\0\0\0\0\0\0\0:\0\0\0:" }) }, pattern: icu_list::provider::ListJoinerPattern::from_parts(" u ", 3u8) }) }]); + static EN_001: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }]); + static FR: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" ou ", 4u8), special_case: None }]); + static TR: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" veya ", 6u8), special_case: None }]); + static HI_LATN: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" yaa ", 5u8), special_case: None }]); + static RU: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" или ", 8u8), special_case: None }]); + static EN: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", or ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", or ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(", or ", 5u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts(" or ", 4u8), special_case: None }]); + static JA: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、または", 12u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("または", 9u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、または", 12u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("または", 9u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、または", 12u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("または", 9u8), special_case: None }]); + static ZH: ::Yokeable = icu_list::provider::ListFormatterPatternsV1([icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("、", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }, icu_list::provider::ConditionalListJoinerPattern { default: icu_list::provider::ListJoinerPattern::from_parts("或", 3u8), special_case: None }]); + static VALUES: [&::Yokeable; 216usize] = [&EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN, &EN_001, &EN_001, &EN_001, &EN_001, &EN_001, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &ES, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &HI_LATN, &IT, &IT, &IT, &IT, &JA, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &FR, &RU, &RU, &RU, &RU, &RU, &RU, &TR, &TR, &EN, &ZH, &ZH, &ZH, &ZH, &ZH, &ZH, &ZH, &ZH]; + static KEYS: [&str; 216usize] = ["en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-ID", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MV", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "hi-Latn", "it", "it-CH", "it-SM", "it-VA", "ja", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "tr", "tr-CY", "und", "zh", "zh-HK", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-MO", "zh-SG"]; + if let Ok(payload) = KEYS.binary_search_by(|k| req.locale.strict_cmp(k.as_bytes()).reverse()).map(|i| *unsafe { VALUES.get_unchecked(i) }) { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(payload)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::MissingLocale.with_req(::KEY, req)) } + } + } + }; +} +/// Implement `IterableDataProvider` on the given struct using the data +/// hardcoded in this file. This allows the struct to be used with +/// `DatagenDriver` for this key. +#[doc(hidden)] +#[macro_export] +macro_rules! __impliterable_list_or_v1 { + ($ provider : ty) => { + #[clippy::msrv = "1.67"] + impl icu_provider::datagen::IterableDataProvider for $provider { + fn supported_locales(&self) -> Result, icu_provider::DataError> { + Ok(["en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-ID", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MV", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "hi-Latn", "it", "it-CH", "it-SM", "it-VA", "ja", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "tr", "tr-CY", "und", "zh", "zh-HK", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-MO", "zh-SG"].into_iter().map(|s| ::from_str(s).unwrap()).collect()) + } + } + }; +} diff --git a/compiler/rustc_baked_icu_data/src/data/mod.rs b/compiler/rustc_baked_icu_data/src/data/mod.rs index e6385f34fc909..193658a4ea2ca 100644 --- a/compiler/rustc_baked_icu_data/src/data/mod.rs +++ b/compiler/rustc_baked_icu_data/src/data/mod.rs @@ -7,6 +7,7 @@ macro_rules! impl_data_provider { impl_fallback_parents_v1!($provider); impl_fallback_supplement_co_v1!($provider); impl_list_and_v1!($provider); + impl_list_or_v1!($provider); }; } #[allow(unused_macros)] @@ -20,6 +21,7 @@ macro_rules! impl_any_provider { h if h == ::KEY.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::KEY.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::KEY.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::KEY.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MissingDataKey.with_req(key, req)), } } diff --git a/compiler/rustc_baked_icu_data/src/lib.rs b/compiler/rustc_baked_icu_data/src/lib.rs index ade153fbccabf..6fb42fc299e12 100644 --- a/compiler/rustc_baked_icu_data/src/lib.rs +++ b/compiler/rustc_baked_icu_data/src/lib.rs @@ -16,7 +16,7 @@ //! ```text //! icu4x-datagen -W --pretty --fingerprint --use-separate-crates --format mod \ //! -l en es fr it ja pt ru tr zh zh-Hans zh-Hant \ -//! -k list/and@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \ +//! -k list/and@1 list/or@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \ //! --cldr-tag latest --icuexport-tag latest \ //! -o src/data //! ``` diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 0f18e34a27607..38633b1b63f89 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -533,6 +533,7 @@ fn icu_locale_from_unic_langid(lang: LanguageIdentifier) -> Option icu_list::ListFormatter::try_new_or_with_length_with_any_provider( + &data_provider, + &locale.into(), + icu_list::ListLength::Wide, + ), } .expect("Failed to create list formatter") } @@ -631,3 +637,10 @@ pub fn fluent_value_from_str_list_sep_by_and(l: Vec>) -> FluentValu FluentValue::Custom(Box::new(FluentStrListSepBy { sep: Separator::And, items })) } + +pub fn fluent_value_from_str_list_sep_by_or(l: Vec>) -> FluentValue<'_> { + // Fluent requires 'static value here for its AnyEq usages. + let items = l.into_iter().map(|x| x.into_owned()).collect(); + + FluentValue::Custom(Box::new(FluentStrListSepBy { sep: Separator::Or, items })) +} diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 7a4d8dba179a2..402443df60056 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -7,7 +7,9 @@ use std::panic; use std::thread::panicking; use rustc_data_structures::fx::FxIndexMap; -use rustc_error_messages::{fluent_value_from_str_list_sep_by_and, FluentValue}; +use rustc_error_messages::{ + fluent_value_from_str_list_sep_by_and, fluent_value_from_str_list_sep_by_or, FluentValue, +}; use rustc_lint_defs::Applicability; use rustc_macros::{Decodable, Encodable}; use rustc_span::source_map::Spanned; @@ -44,6 +46,7 @@ pub enum DiagArgValue { // to strings in `into_diag_arg` and stored using the `Str` variant. Number(i32), StrListSepByAnd(Vec>), + StrListSepByOr(Vec>), } pub type DiagArgMap = FxIndexMap; @@ -167,6 +170,7 @@ impl Into> for DiagArgValue { DiagArgValue::Str(s) => From::from(s), DiagArgValue::Number(n) => From::from(n), DiagArgValue::StrListSepByAnd(l) => fluent_value_from_str_list_sep_by_and(l), + DiagArgValue::StrListSepByOr(l) => fluent_value_from_str_list_sep_by_or(l), } } } From 7ff2696295d33ae414dae94d63baf967ea28f6ed Mon Sep 17 00:00:00 2001 From: Xiretza Date: Thu, 11 Apr 2024 19:45:57 +0000 Subject: [PATCH 07/12] rustc_session: turn feature gate subdiagnostic into struct --- compiler/rustc_session/src/errors.rs | 46 +++++++++++++++------------- compiler/rustc_session/src/parse.rs | 38 +++++++++++++---------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 462e2a97c33da..e839fa091ea42 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -26,6 +26,16 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for FeatureGateError { } } +#[derive(Subdiagnostic)] +pub struct FeatureGateSubdiagnostic { + #[subdiagnostic] + pub(crate) issue: Option, + #[subdiagnostic] + pub(crate) enable_feature: Option, + #[subdiagnostic] + pub(crate) upgrade_compiler: Option, +} + #[derive(Subdiagnostic)] #[note(session_feature_diagnostic_for_issue)] pub(crate) struct FeatureDiagnosticForIssue { @@ -51,27 +61,21 @@ impl SuggestUpgradeCompiler { } #[derive(Subdiagnostic)] -#[help(session_feature_diagnostic_help)] -pub(crate) struct FeatureDiagnosticHelp { - pub(crate) feature: Symbol, -} - -#[derive(Subdiagnostic)] -#[suggestion( - session_feature_diagnostic_suggestion, - applicability = "maybe-incorrect", - code = "#![feature({feature})]\n" -)] -pub struct FeatureDiagnosticSuggestion { - pub feature: Symbol, - #[primary_span] - pub span: Span, -} - -#[derive(Subdiagnostic)] -#[help(session_cli_feature_diagnostic_help)] -pub(crate) struct CliFeatureDiagnosticHelp { - pub(crate) feature: Symbol, +pub(crate) enum EnableFeatureSubdiagnostic { + #[help(session_feature_diagnostic_help)] + AddAttrHelp { feature: Symbol }, + #[suggestion( + session_feature_diagnostic_suggestion, + applicability = "maybe-incorrect", + code = "#![feature({feature})]\n" + )] + AddAttrSuggestion { + feature: Symbol, + #[primary_span] + span: Span, + }, + #[help(session_cli_feature_diagnostic_help)] + AddCliHelp { feature: Symbol }, } #[derive(Diagnostic)] diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index d6c58e9d1be1c..5915316a11a13 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -20,8 +20,8 @@ use rustc_span::{Span, Symbol}; use crate::config::{Cfg, CheckCfg}; use crate::errors::{ - CliFeatureDiagnosticHelp, FeatureDiagnosticForIssue, FeatureDiagnosticHelp, - FeatureDiagnosticSuggestion, FeatureGateError, SuggestUpgradeCompiler, + EnableFeatureSubdiagnostic, FeatureDiagnosticForIssue, FeatureGateError, + FeatureGateSubdiagnostic, SuggestUpgradeCompiler, }; use crate::lint::builtin::UNSTABLE_SYNTAX_PRE_EXPANSION; use crate::lint::{BufferedEarlyLint, BuiltinLintDiag, Lint, LintId}; @@ -177,26 +177,32 @@ pub fn add_feature_diagnostics_for_issue( feature_from_cli: bool, inject_span: Option, ) { - if let Some(n) = find_feature_issue(feature, issue) { - err.subdiagnostic(FeatureDiagnosticForIssue { n }); - } + let issue = find_feature_issue(feature, issue).map(|n| FeatureDiagnosticForIssue { n }); // #23973: do not suggest `#![feature(...)]` if we are in beta/stable - if sess.psess.unstable_features.is_nightly_build() { - if feature_from_cli { - err.subdiagnostic(CliFeatureDiagnosticHelp { feature }); + let (enable_feature, upgrade_compiler) = if sess.psess.unstable_features.is_nightly_build() { + let enable_feature = if feature_from_cli { + EnableFeatureSubdiagnostic::AddCliHelp { feature } } else if let Some(span) = inject_span { - err.subdiagnostic(FeatureDiagnosticSuggestion { feature, span }); + EnableFeatureSubdiagnostic::AddAttrSuggestion { feature, span } } else { - err.subdiagnostic(FeatureDiagnosticHelp { feature }); - } + EnableFeatureSubdiagnostic::AddAttrHelp { feature } + }; - if sess.opts.unstable_opts.ui_testing { - err.subdiagnostic(SuggestUpgradeCompiler::ui_testing()); + let upgrade_compiler = if sess.opts.unstable_opts.ui_testing { + Some(SuggestUpgradeCompiler::ui_testing()) } else if let Some(suggestion) = SuggestUpgradeCompiler::new() { - err.subdiagnostic(suggestion); - } - } + Some(suggestion) + } else { + None + }; + + (Some(enable_feature), upgrade_compiler) + } else { + (None, None) + }; + + err.subdiagnostic(FeatureGateSubdiagnostic { issue, upgrade_compiler, enable_feature }); } /// Info about a parsing session. From 332ebed4fc652b2d883dd307edee427b3709e0ce Mon Sep 17 00:00:00 2001 From: Xiretza Date: Thu, 11 Apr 2024 20:12:13 +0000 Subject: [PATCH 08/12] Expose FeatureGateSubdiagnostic struct instead of applying it opaquely --- compiler/rustc_ast_lowering/src/errors.rs | 5 +++ compiler/rustc_ast_lowering/src/lib.rs | 38 ++++++++++---------- compiler/rustc_hir_analysis/src/check/mod.rs | 24 ++++++------- compiler/rustc_hir_analysis/src/errors.rs | 3 ++ compiler/rustc_lint/src/levels.rs | 5 ++- compiler/rustc_lint/src/lints.rs | 5 ++- compiler/rustc_session/src/errors.rs | 6 +++- compiler/rustc_session/src/parse.rs | 34 ++++++++---------- compiler/rustc_session/src/session.rs | 6 ++-- 9 files changed, 65 insertions(+), 61 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/errors.rs b/compiler/rustc_ast_lowering/src/errors.rs index 6b39c2d39556c..ba8e0896e2b6c 100644 --- a/compiler/rustc_ast_lowering/src/errors.rs +++ b/compiler/rustc_ast_lowering/src/errors.rs @@ -1,6 +1,7 @@ use rustc_errors::codes::*; use rustc_errors::{Diag, DiagArgFromDisplay, EmissionGuarantee, SubdiagMessageOp, Subdiagnostic}; use rustc_macros::{Diagnostic, Subdiagnostic}; +use rustc_session::errors::FeatureGateSubdiagnostic; use rustc_span::symbol::Ident; use rustc_span::{Span, Symbol}; @@ -386,12 +387,16 @@ pub(crate) enum BadReturnTypeNotation { #[primary_span] #[suggestion(code = "()", applicability = "maybe-incorrect")] span: Span, + #[subdiagnostic] + subdiag: Option, }, #[diag(ast_lowering_bad_return_type_notation_output)] Output { #[primary_span] #[suggestion(code = "", applicability = "maybe-incorrect")] span: Span, + #[subdiagnostic] + subdiag: Option, }, #[diag(ast_lowering_bad_return_type_notation_needs_dots)] NeedsDots { diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index efd3ae336afb8..d776f277645e8 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -62,7 +62,7 @@ use rustc_index::{Idx, IndexSlice, IndexVec}; use rustc_macros::extension; use rustc_middle::span_bug; use rustc_middle::ty::{ResolverAstLowering, TyCtxt}; -use rustc_session::parse::{add_feature_diagnostics, feature_err}; +use rustc_session::parse::{feature_err, get_feature_diagnostics}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{DesugaringKind, Span, DUMMY_SP}; use smallvec::{smallvec, SmallVec}; @@ -1008,29 +1008,29 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { if let Some(first_char) = constraint.ident.as_str().chars().next() && first_char.is_ascii_lowercase() { - let mut err = if !data.inputs.is_empty() { - self.dcx().create_err(errors::BadReturnTypeNotation::Inputs { + let subdiag = if !self.tcx.features().return_type_notation + && self.tcx.sess.is_nightly_build() + { + Some(get_feature_diagnostics(&self.tcx.sess, sym::return_type_notation)) + } else { + None + }; + + let err = if !data.inputs.is_empty() { + errors::BadReturnTypeNotation::Inputs { span: data.inputs_span, - }) + subdiag, + } } else if let FnRetTy::Ty(ty) = &data.output { - self.dcx().create_err(errors::BadReturnTypeNotation::Output { + errors::BadReturnTypeNotation::Output { span: data.inputs_span.shrink_to_hi().to(ty.span), - }) + subdiag, + } } else { - self.dcx().create_err(errors::BadReturnTypeNotation::NeedsDots { - span: data.inputs_span, - }) + errors::BadReturnTypeNotation::NeedsDots { span: data.inputs_span } }; - if !self.tcx.features().return_type_notation - && self.tcx.sess.is_nightly_build() - { - add_feature_diagnostics( - &mut err, - &self.tcx.sess, - sym::return_type_notation, - ); - } - err.emit(); + self.dcx().create_err(err).emit(); + GenericArgsCtor { args: Default::default(), constraints: &[], diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs index dbdad2eb41d84..ad19df32fc34b 100644 --- a/compiler/rustc_hir_analysis/src/check/mod.rs +++ b/compiler/rustc_hir_analysis/src/check/mod.rs @@ -310,20 +310,10 @@ fn default_body_is_unstable( None => none_note = true, }; - let mut err = tcx.dcx().create_err(errors::MissingTraitItemUnstable { - span: impl_span, - some_note, - none_note, - missing_item_name, - feature, - reason: reason_str, - }); - let inject_span = item_did .as_local() .and_then(|id| tcx.crate_level_attribute_injection_span(tcx.local_def_id_to_hir_id(id))); - rustc_session::parse::add_feature_diagnostics_for_issue( - &mut err, + let subdiag = rustc_session::parse::get_feature_diagnostics_for_issue( &tcx.sess, feature, rustc_feature::GateIssue::Library(issue), @@ -331,7 +321,17 @@ fn default_body_is_unstable( inject_span, ); - err.emit(); + tcx.dcx() + .create_err(errors::MissingTraitItemUnstable { + span: impl_span, + some_note, + none_note, + missing_item_name, + feature, + reason: reason_str, + subdiag, + }) + .emit(); } /// Re-sugar `ty::GenericPredicates` in a way suitable to be used in structured suggestions. diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index 39df18ff658cd..17b7989876843 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -6,6 +6,7 @@ use rustc_errors::{ }; use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; use rustc_middle::ty::Ty; +use rustc_session::errors::FeatureGateSubdiagnostic; use rustc_span::symbol::Ident; use rustc_span::{Span, Symbol}; @@ -987,6 +988,8 @@ pub(crate) struct MissingTraitItemUnstable { pub some_note: bool, #[note(hir_analysis_none_note)] pub none_note: bool, + #[subdiagnostic] + pub subdiag: FeatureGateSubdiagnostic, pub missing_item_name: Symbol, pub feature: Symbol, pub reason: String, diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 65289de980e13..4e7a95cf859ed 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -875,14 +875,13 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> { lint.primary_message(fluent::lint_unknown_gated_lint); lint.arg("name", lint_id.lint.name_lower()); lint.note(fluent::lint_note); - rustc_session::parse::add_feature_diagnostics_for_issue( - lint, + lint.subdiagnostic(rustc_session::parse::get_feature_diagnostics_for_issue( &self.sess, feature, GateIssue::Language, lint_from_cli, None, - ); + )); }); } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index e49b102cb391c..f197b0c7262f9 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -242,11 +242,10 @@ impl<'a> LintDiagnostic<'a, ()> for BuiltinUngatedAsyncFnTrackCaller<'_> { fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) { diag.primary_message(fluent::lint_ungated_async_fn_track_caller); diag.span_label(self.label, fluent::lint_label); - rustc_session::parse::add_feature_diagnostics( - diag, + diag.subdiagnostic(rustc_session::parse::get_feature_diagnostics( self.session, sym::async_fn_track_caller, - ); + )); } } diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index e839fa091ea42..f18adf2b82aac 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -14,15 +14,19 @@ use rustc_target::spec::{SplitDebuginfo, StackProtector, TargetTriple}; use crate::config::CrateType; use crate::parse::ParseSess; +// FIXME: factor into separate structs to avoid dynamic DiagMessage field pub(crate) struct FeatureGateError { pub(crate) span: MultiSpan, pub(crate) explain: DiagMessage, + pub(crate) subdiag: FeatureGateSubdiagnostic, } impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for FeatureGateError { #[track_caller] fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> { - Diag::new(dcx, level, self.explain).with_span(self.span).with_code(E0658) + let mut diag = Diag::new(dcx, level, self.explain).with_span(self.span).with_code(E0658); + diag.subdiagnostic(self.subdiag); + diag } } diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 5915316a11a13..cd3a5a8008dba 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -9,8 +9,8 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet}; use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc}; use rustc_errors::emitter::{stderr_destination, HumanEmitter, SilentEmitter}; use rustc_errors::{ - fallback_fluent_bundle, ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, - EmissionGuarantee, MultiSpan, StashKey, + fallback_fluent_bundle, ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, MultiSpan, + StashKey, }; use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures}; use rustc_span::edition::Edition; @@ -111,9 +111,9 @@ pub fn feature_err_issue( } } - let mut err = sess.dcx().create_err(FeatureGateError { span, explain: explain.into() }); - add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false, None); - err + let subdiag = get_feature_diagnostics_for_issue(sess, feature, issue, false, None); + + sess.dcx().create_err(FeatureGateError { span, explain: explain.into(), subdiag }) } /// Construct a future incompatibility diagnostic for a feature gate. @@ -141,7 +141,7 @@ pub fn feature_warn_issue( explain: &'static str, ) { let mut err = sess.dcx().struct_span_warn(span, explain); - add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false, None); + err.subdiagnostic(get_feature_diagnostics_for_issue(sess, feature, issue, false, None)); // Decorate this as a future-incompatibility lint as in rustc_middle::lint::lint_level let lint = UNSTABLE_SYNTAX_PRE_EXPANSION; @@ -154,29 +154,23 @@ pub fn feature_warn_issue( err.stash(span, StashKey::EarlySyntaxWarning); } -/// Adds the diagnostics for a feature to an existing error. -pub fn add_feature_diagnostics( - err: &mut Diag<'_, G>, - sess: &Session, - feature: Symbol, -) { - add_feature_diagnostics_for_issue(err, sess, feature, GateIssue::Language, false, None); +/// Returns the subdiagnostics for a feature gate error. +pub fn get_feature_diagnostics(sess: &Session, feature: Symbol) -> FeatureGateSubdiagnostic { + get_feature_diagnostics_for_issue(sess, feature, GateIssue::Language, false, None) } -/// Adds the diagnostics for a feature to an existing error. +/// Returns the subdiagnostics for a feature gate error. /// /// This variant allows you to control whether it is a library or language feature. /// Almost always, you want to use this for a language feature. If so, prefer -/// `add_feature_diagnostics`. -#[allow(rustc::diagnostic_outside_of_impl)] // FIXME -pub fn add_feature_diagnostics_for_issue( - err: &mut Diag<'_, G>, +/// [`get_feature_diagnostics`]. +pub fn get_feature_diagnostics_for_issue( sess: &Session, feature: Symbol, issue: GateIssue, feature_from_cli: bool, inject_span: Option, -) { +) -> FeatureGateSubdiagnostic { let issue = find_feature_issue(feature, issue).map(|n| FeatureDiagnosticForIssue { n }); // #23973: do not suggest `#![feature(...)]` if we are in beta/stable @@ -202,7 +196,7 @@ pub fn add_feature_diagnostics_for_issue( (None, None) }; - err.subdiagnostic(FeatureGateSubdiagnostic { issue, upgrade_compiler, enable_feature }); + FeatureGateSubdiagnostic { issue, upgrade_compiler, enable_feature } } /// Info about a parsing session. diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 387ae1b78c480..5b1a0148a68c0 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -41,7 +41,7 @@ use crate::config::{ InstrumentCoverage, OptLevel, OutFileName, OutputType, RemapPathScopeComponents, SwitchWithOptPath, }; -use crate::parse::{add_feature_diagnostics, ParseSess}; +use crate::parse::{get_feature_diagnostics, ParseSess}; use crate::search_paths::{PathKind, SearchPath}; use crate::{errors, filesearch, lint}; @@ -300,13 +300,13 @@ impl Session { } #[track_caller] + #[allow(rustc::diagnostic_outside_of_impl)] pub fn create_feature_err<'a>(&'a self, err: impl Diagnostic<'a>, feature: Symbol) -> Diag<'a> { let mut err = self.dcx().create_err(err); if err.code.is_none() { - #[allow(rustc::diagnostic_outside_of_impl)] err.code(E0658); } - add_feature_diagnostics(&mut err, self, feature); + err.subdiagnostic(get_feature_diagnostics(self, feature)); err } From 9d9ad485a84ab80d216c2fafdbc30903c452d3ee Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 17 Aug 2024 09:02:10 +0000 Subject: [PATCH 09/12] impl IntoDiagArg for TokenTree --- compiler/rustc_errors/src/diagnostic_impls.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index 9e3bc3e60b12f..27816785175e3 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -230,6 +230,12 @@ impl IntoDiagArg for ast::token::TokenKind { } } +impl IntoDiagArg for ast::tokenstream::TokenTree { + fn into_diag_arg(self) -> DiagArgValue { + DiagArgValue::Str(Cow::Owned(pprust::tt_to_string(&self))) + } +} + impl IntoDiagArg for FloatTy { fn into_diag_arg(self) -> DiagArgValue { DiagArgValue::Str(Cow::Borrowed(self.name_str())) From bce7c46660187c7efef1652ee86f3ef15623b2bb Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 19 Aug 2024 14:29:52 +0000 Subject: [PATCH 10/12] impl IntoDiagArg for NonterminalKind --- compiler/rustc_errors/src/diagnostic_impls.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index 27816785175e3..91f9187df57a4 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -5,6 +5,7 @@ use std::num::ParseIntError; use std::path::{Path, PathBuf}; use std::process::ExitStatus; +use rustc_ast::token::NonterminalKind; use rustc_ast_pretty::pprust; use rustc_macros::Subdiagnostic; use rustc_span::edition::Edition; @@ -304,6 +305,12 @@ impl IntoDiagArg for hir::def::Namespace { } } +impl IntoDiagArg for NonterminalKind { + fn into_diag_arg(self) -> DiagArgValue { + DiagArgValue::Str(Cow::from(self.to_string())) + } +} + #[derive(Clone)] pub struct DiagSymbolList(Vec); From e7c1fd3c8af286d6395515c1866e8162e0a193a3 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Thu, 11 Apr 2024 19:43:46 +0000 Subject: [PATCH 11/12] Make more diagnostics in rustc_expand translatable --- compiler/rustc_expand/messages.ftl | 6 +++++ compiler/rustc_expand/src/errors.rs | 37 +++++++++++++++++++++++++++++ compiler/rustc_expand/src/expand.rs | 36 ++++++++++++---------------- 3 files changed, 58 insertions(+), 21 deletions(-) diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl index 766d96e268f04..3bb1b5dea41c6 100644 --- a/compiler/rustc_expand/messages.ftl +++ b/compiler/rustc_expand/messages.ftl @@ -27,6 +27,12 @@ expand_collapse_debuginfo_illegal = expand_count_repetition_misplaced = `count` can not be placed inside the inner-most repetition +expand_custom_attribute_cannot_be_applied = + custom attributes cannot be applied to {$kind -> + [statement] statements + *[expression] expressions + } + expand_custom_attribute_panicked = custom attribute panicked .help = message: {$message} diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index a844449f4c9d2..de6330228e2c8 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -2,7 +2,9 @@ use std::borrow::Cow; use rustc_ast::ast; use rustc_errors::codes::*; +use rustc_errors::IntoDiagArg; use rustc_macros::{Diagnostic, Subdiagnostic}; +use rustc_session::errors::FeatureGateSubdiagnostic; use rustc_session::Limit; use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; use rustc_span::{Span, Symbol}; @@ -485,3 +487,38 @@ pub(crate) struct ProcMacroBackCompat { pub crate_name: String, pub fixed_version: String, } + +pub(crate) enum StatementOrExpression { + Statement, + Expression, +} + +impl IntoDiagArg for StatementOrExpression { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { + let s = match self { + StatementOrExpression::Statement => "statement", + StatementOrExpression::Expression => "expression", + }; + + rustc_errors::DiagArgValue::Str(s.into()) + } +} + +#[derive(Diagnostic)] +#[diag(expand_custom_attribute_cannot_be_applied, code = E0658)] +pub(crate) struct CustomAttributesForbidden { + #[primary_span] + pub span: Span, + #[subdiagnostic] + pub subdiag: FeatureGateSubdiagnostic, + pub kind: StatementOrExpression, +} + +#[derive(Diagnostic)] +#[diag(expand_non_inline_modules_in_proc_macro_input_are_unstable, code = E0658)] +pub(crate) struct NonInlineModuleInProcMacroUnstable { + #[primary_span] + pub span: Span, + #[subdiagnostic] + pub subdiag: FeatureGateSubdiagnostic, +} diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index 0d56a005f159e..0e5aa94819b1b 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -25,7 +25,7 @@ use rustc_parse::parser::{ use rustc_parse::validate_attr; use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS}; use rustc_session::lint::BuiltinLintDiag; -use rustc_session::parse::feature_err; +use rustc_session::parse::get_feature_diagnostics; use rustc_session::{Limit, Session}; use rustc_span::hygiene::SyntaxContext; use rustc_span::symbol::{sym, Ident}; @@ -35,11 +35,11 @@ use smallvec::SmallVec; use crate::base::*; use crate::config::StripUnconfigured; use crate::errors::{ - EmptyDelegationMac, GlobDelegationOutsideImpls, GlobDelegationTraitlessQpath, IncompleteParse, - RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported, UnsupportedKeyValue, - WrongFragmentKind, + CustomAttributesForbidden, EmptyDelegationMac, GlobDelegationOutsideImpls, + GlobDelegationTraitlessQpath, IncompleteParse, NonInlineModuleInProcMacroUnstable, + RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported, StatementOrExpression, + UnsupportedKeyValue, WrongFragmentKind, }; -use crate::fluent_generated; use crate::mbe::diagnostics::annotate_err_with_kind; use crate::module::{mod_dir_path, parse_external_mod, DirOwnership, ParsedExternalMod}; use crate::placeholders::{placeholder, PlaceholderExpander}; @@ -841,7 +841,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> { }) } - #[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable fn gate_proc_macro_attr_item(&self, span: Span, item: &Annotatable) { let kind = match item { Annotatable::Item(_) @@ -854,9 +853,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> { if stmt.is_item() { return; } - "statements" + StatementOrExpression::Statement } - Annotatable::Expr(_) => "expressions", + Annotatable::Expr(_) => StatementOrExpression::Expression, Annotatable::Arm(..) | Annotatable::ExprField(..) | Annotatable::PatField(..) @@ -868,13 +867,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> { if self.cx.ecfg.features.proc_macro_hygiene { return; } - feature_err( - &self.cx.sess, - sym::proc_macro_hygiene, + self.cx.dcx().emit_err(CustomAttributesForbidden { span, - format!("custom attributes cannot be applied to {kind}"), - ) - .emit(); + subdiag: get_feature_diagnostics(&self.cx.sess, sym::proc_macro_hygiene), + kind, + }); } fn gate_proc_macro_input(&self, annotatable: &Annotatable) { @@ -888,13 +885,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> { ItemKind::Mod(_, mod_kind) if !matches!(mod_kind, ModKind::Loaded(_, Inline::Yes, _)) => { - feature_err( - self.sess, - sym::proc_macro_hygiene, - item.span, - fluent_generated::expand_non_inline_modules_in_proc_macro_input_are_unstable, - ) - .emit(); + self.sess.dcx().emit_err(NonInlineModuleInProcMacroUnstable { + span: item.span, + subdiag: get_feature_diagnostics(self.sess, sym::proc_macro_hygiene), + }); } _ => {} } From bd98f08d6fdfbb4a881d761aae446250d20c5efb Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 14 Apr 2024 11:38:27 +0000 Subject: [PATCH 12/12] rustc_expand: make mbe translatable --- compiler/rustc_expand/messages.ftl | 115 +++++- compiler/rustc_expand/src/errors.rs | 345 +++++++++++++++++- compiler/rustc_expand/src/lib.rs | 2 - compiler/rustc_expand/src/mbe.rs | 2 + compiler/rustc_expand/src/mbe/diagnostics.rs | 84 ++--- compiler/rustc_expand/src/mbe/macro_check.rs | 13 +- compiler/rustc_expand/src/mbe/macro_parser.rs | 87 +++-- compiler/rustc_expand/src/mbe/macro_rules.rs | 135 +++---- compiler/rustc_expand/src/mbe/metavar_expr.rs | 74 ++-- compiler/rustc_expand/src/mbe/quoted.rs | 84 ++--- compiler/rustc_expand/src/mbe/transcribe.rs | 75 ++-- .../unused-macro-with-follow-violation.stderr | 2 +- tests/ui/macros/macro-follow.stderr | 170 ++++----- .../macros/macro-followed-by-seq-bad.stderr | 4 +- .../macros/macro-input-future-proofing.stderr | 18 +- ...-pat-pattern-followed-by-or-in-2021.stderr | 6 +- ...acro-pat2021-pattern-followed-by-or.stderr | 6 +- .../syntax-errors.stderr | 4 +- tests/ui/macros/same-sequence-span.stderr | 8 +- .../type/pattern_types/macros.active.stderr | 2 +- .../ui/type/pattern_types/macros.gated.stderr | 2 +- 21 files changed, 831 insertions(+), 407 deletions(-) diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl index 3bb1b5dea41c6..de4a1653ce82d 100644 --- a/compiler/rustc_expand/messages.ftl +++ b/compiler/rustc_expand/messages.ftl @@ -24,9 +24,17 @@ expand_cannot_be_name_of_macro = expand_collapse_debuginfo_illegal = illegal value for attribute #[collapse_debuginfo(no|external|yes)] +expand_concat_generated_invalid_ident = `{"${concat(..)}"}` is not generating a valid identifier + +expand_concat_raw_ident = `{"${concat(..)}"}` currently does not support raw identifiers + +expand_concat_too_few_args = `concat` must have at least two elements + expand_count_repetition_misplaced = `count` can not be placed inside the inner-most repetition +expand_count_with_comma_no_index = `count` followed by a comma must have an associated index indicating its depth + expand_custom_attribute_cannot_be_applied = custom attributes cannot be applied to {$kind -> [statement] statements @@ -37,6 +45,13 @@ expand_custom_attribute_panicked = custom attribute panicked .help = message: {$message} +expand_doc_comments_ignored_in_matcher_position = doc comments are ignored in matcher position + +expand_dollar_or_metavar_in_lhs = unexpected token: {$token} + .note = `$$` and meta-variable expressions are not allowed inside macro parameter definitions + +expand_duplicate_binding_name = duplicated bind name: {$bind} + expand_duplicate_matcher_binding = duplicate matcher binding .label = duplicate binding .label2 = previous binding @@ -44,15 +59,23 @@ expand_duplicate_matcher_binding = duplicate matcher binding expand_empty_delegation_mac = empty {$kind} delegation is not supported +expand_expected_comma = expected comma + +expand_expected_identifier = expected identifier, found `{$found}` + expand_expected_paren_or_brace = expected `(` or `{"{"}`, found `{$token}` +expand_expected_repetition_operator = expected one of: `*`, `+`, or `?` + expand_explain_doc_comment_inner = inner doc comments expand to `#![doc = "..."]`, which is what this macro attempted to match expand_explain_doc_comment_outer = outer doc comments expand to `#[doc = "..."]`, which is what this macro attempted to match +expand_expr_2021_unstable = fragment specifier `expr_2021` is unstable + expand_expr_repeat_no_syntax_vars = attempted to repeat an expression containing no syntax variables matched as repeating at this depth @@ -86,9 +109,30 @@ expand_invalid_cfg_no_parens = `cfg` is not followed by parentheses expand_invalid_cfg_no_predicate = `cfg` predicate is not specified expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal +expand_invalid_concat_arg_type = metavariables of {"`${concat(..)}`"} must be of type `ident`, `literal` or `tt` + .note = currently only string literals are supported + +expand_invalid_follow = `${$name}:{$kind}` {$only_option -> + [true] is + *[false] may be + } followed by `{$next}`, which is not allowed for `{$kind}` fragments + .label = not allowed after `{$kind}` fragments + .suggestion = try a `pat_param` fragment specifier instead + .note = {$num_possible -> + [one] only {$possible} is allowed after `{$kind}` fragments + *[other] allowed there are: {$possible} + } + expand_invalid_fragment_specifier = invalid fragment specifier `{$fragment}` - .help = {$help} + .help_expr_2021 = fragment specifier `expr_2021` requires Rust 2021 or later + +expand_label_conflicting_repetition = conflicting repetition + +expand_label_error_while_parsing_argument = while parsing argument for this `{$kind}` macro fragment + +expand_label_expected_repetition = expected repetition +expand_label_previous_declaration = previous declaration expand_macro_body_stability = macros cannot have body stability attributes @@ -102,19 +146,51 @@ expand_macro_const_stability = expand_macro_expands_to_match_arm = macros cannot expand to match arms +expand_macro_rhs_must_be_delimited = macro rhs must be delimited + expand_malformed_feature_attribute = malformed `feature` attribute input .expected = expected just one word -expand_meta_var_dif_seq_matchers = {$msg} +expand_match_failure_missing_tokens = missing tokens in macro arguments +expand_match_failure_unexpected_token = no rules expected this token in macro call + +expand_meta_var_dif_seq_matchers = + meta-variable `{$var1_id}` repeats {$var1_len} {$var1_len -> + [one] time + *[count] times + }, but `{$var2_id}` repeats {$var2_len} {$var2_len -> + [one] time + *[count] times + } + +expand_meta_var_expr_concat_unstable = the `concat` meta-variable expression is unstable + +expand_meta_var_expr_depth_not_literal = meta-variable expression depth must be a literal + +expand_meta_var_expr_depth_suffixed = only unsuffixed integer literals are supported in meta-variable expressions + +expand_meta_var_expr_expected_identifier = expected identifier, found `{$found}` + .suggestion = try removing `{$found}` + +expand_meta_var_expr_needs_parens = meta-variable expression parameter must be wrapped in parentheses + +expand_meta_var_expr_out_of_bounds = {$max -> + [0] meta-variable expression `{$ty}` with depth parameter must be called inside of a macro repetition + *[other] depth parameter of meta-variable expression `{$ty}` must be less than {$max} + } + +expand_meta_var_expr_unexpected_token = unexpected token: {$tt} + .note = meta-variable expression must not have trailing tokens expand_meta_var_expr_unrecognized_var = variable `{$key}` is not recognized in meta-variable expression +expand_meta_var_expr_unstable = meta-variable expressions are unstable + expand_missing_fragment_specifier = missing fragment specifier .note = fragment specifiers must be specified in the 2024 edition .suggestion_add_fragspec = try adding a specifier here - .valid = {$valid} expand_module_circular = circular modules: {$modules} @@ -132,9 +208,22 @@ expand_module_multiple_candidates = file for module `{$name}` found at both "{$default_path}" and "{$secondary_path}" .help = delete or rename one of them to remove the ambiguity +expand_multiple_parsing_options = + local ambiguity when calling macro `{$macro_name}`: multiple parsing options: built-in NTs {$nts}{$n -> + [0] . + [one] {""} or {$n} other option + *[other] {""} or {$n} other options + } + +expand_multiple_successful_parses = ambiguity: multiple successful parses + +expand_multiple_transparency_attrs = multiple macro transparency attributes + expand_must_repeat_once = this must repeat at least once +expand_nested_meta_var_expr_without_dollar = meta-variables within meta-variable expressions must be referenced using a dollar sign + expand_non_inline_modules_in_proc_macro_input_are_unstable = non-inline modules in proc macro input are unstable @@ -144,6 +233,10 @@ expand_not_a_meta_item = expand_only_one_word = must only be one word +expand_parse_failure_expected_token = expected `{$expected}`, found `{$found}` +expand_parse_failure_unexpected_eof = unexpected end of macro invocation +expand_parse_failure_unexpected_token = no rules expected the token `{$found}` + expand_proc_macro_back_compat = using an old version of `{$crate_name}` .note = older versions of the `{$crate_name}` crate no longer compile; please update to `{$crate_name}` v{$fixed_version}, or switch to one of the `{$crate_name}` alternatives @@ -158,6 +251,8 @@ expand_proc_macro_panicked = proc macro panicked .help = message: {$message} +expand_question_mark_with_separator = the `?` macro repetition operator does not take a separator + expand_recursion_limit_reached = recursion limit reached while expanding `{$descr}` .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) @@ -168,14 +263,28 @@ expand_remove_expr_not_supported = expand_remove_node_not_supported = removing {$descr} is not supported in this position +expand_repetition_matches_empty_token_tree = repetition matches empty token tree + expand_resolve_relative_path = cannot resolve relative path in non-file source `{$path}` expand_trace_macro = trace_macro +expand_unbalanced_delims_around_matcher = invalid macro matcher; matchers must be contained in balanced delimiters + +expand_unknown_macro_transparency = unknown macro transparency: `{$value}` + +expand_unrecognized_meta_var_expr = unrecognized meta-variable expression + .help = supported expressions are count, ignore, index and len + +expand_unsupported_concat_elem = expected identifier or string literal + expand_unsupported_key_value = key-value macro attributes are not supported +expand_valid_fragment_names_2021 = valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` +expand_valid_fragment_names_other = valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis` + expand_var_still_repeating = variable `{$ident}` is still repeating at this depth diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index de6330228e2c8..46d03d16558d2 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -1,8 +1,10 @@ use std::borrow::Cow; use rustc_ast::ast; +use rustc_ast::token::{NonterminalKind, Token}; +use rustc_ast::tokenstream::TokenTree; use rustc_errors::codes::*; -use rustc_errors::IntoDiagArg; +use rustc_errors::{DiagArgValue, IntoDiagArg, MultiSpan}; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_session::errors::FeatureGateSubdiagnostic; use rustc_session::Limit; @@ -51,7 +53,10 @@ pub(crate) struct VarStillRepeating { pub(crate) struct MetaVarsDifSeqMatchers { #[primary_span] pub span: Span, - pub msg: String, + pub var1_id: String, + pub var1_len: usize, + pub var2_id: String, + pub var2_len: usize, } #[derive(Diagnostic)] @@ -421,10 +426,17 @@ pub(crate) struct DuplicateMatcherBinding { pub prev: Span, } +#[derive(Subdiagnostic)] +pub(crate) enum InvalidFragmentSpecifierValidNames { + #[help(expand_valid_fragment_names_2021)] + Edition2021, + #[help(expand_valid_fragment_names_other)] + Other, +} + #[derive(Diagnostic)] #[diag(expand_missing_fragment_specifier)] #[note] -#[help(expand_valid)] pub(crate) struct MissingFragmentSpecifier { #[primary_span] pub span: Span, @@ -435,17 +447,20 @@ pub(crate) struct MissingFragmentSpecifier { applicability = "maybe-incorrect" )] pub add_span: Span, - pub valid: &'static str, + #[subdiagnostic] + pub valid: InvalidFragmentSpecifierValidNames, } #[derive(Diagnostic)] #[diag(expand_invalid_fragment_specifier)] -#[help] pub(crate) struct InvalidFragmentSpecifier { #[primary_span] pub span: Span, + #[help(expand_help_expr_2021)] + pub help_expr_2021: bool, + #[subdiagnostic] + pub help_valid_names: InvalidFragmentSpecifierValidNames, pub fragment: Ident, - pub help: String, } #[derive(Diagnostic)] @@ -522,3 +537,321 @@ pub(crate) struct NonInlineModuleInProcMacroUnstable { #[subdiagnostic] pub subdiag: FeatureGateSubdiagnostic, } + +#[derive(Subdiagnostic)] +#[label(expand_label_error_while_parsing_argument)] +pub(crate) struct NoteParseErrorInMacroArgument { + #[primary_span] + pub span: Span, + pub kind: NonterminalKind, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_needs_parens)] +pub(crate) struct MetaVarExprParamNeedsParens { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_unsupported_concat_elem)] +pub(crate) struct UnsupportedConcatElem { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_concat_raw_ident)] +pub(crate) struct ConcatRawIdent { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_expected_comma)] +pub(crate) struct ExpectedComma { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_concat_too_few_args)] +pub(crate) struct ConcatTooFewArgs { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_unrecognized_meta_var_expr)] +#[help] +pub(crate) struct UnrecognizedMetaVarExpr { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_count_with_comma_no_index)] +pub(crate) struct CountWithCommaNoIndex { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_nested_meta_var_expr_without_dollar)] +pub(crate) struct NestedMetaVarExprWithoutDollar { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_depth_not_literal)] +pub(crate) struct MetaVarExprDepthNotLiteral { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_depth_suffixed)] +pub(crate) struct MetaVarExprDepthSuffixed { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_unexpected_token)] +pub(crate) struct MetaVarExprUnexpectedToken { + #[primary_span] + #[note] + pub span: Span, + pub tt: TokenTree, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_expected_identifier)] +pub(crate) struct MetaVarExprExpectedIdentifier { + #[primary_span] + #[suggestion(code = "", applicability = "maybe-incorrect")] + pub span: Span, + pub found: Token, +} + +#[derive(Diagnostic)] +#[diag(expand_expected_identifier)] +pub(crate) struct ExpectedIdentifier { + #[primary_span] + pub span: Span, + pub found: Token, +} + +#[derive(Diagnostic)] +#[diag(expand_question_mark_with_separator)] +pub(crate) struct QuestionMarkWithSeparator { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_expected_repetition_operator)] +pub(crate) struct ExpectedRepetitionOperator { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_dollar_or_metavar_in_lhs)] +pub(crate) struct DollarOrMetavarInLhs { + #[primary_span] + #[note] + pub span: Span, + pub token: Token, +} + +#[derive(Diagnostic)] +#[diag(expand_meta_var_expr_out_of_bounds)] +pub(crate) struct MetaVarExprOutOfBounds { + #[primary_span] + pub span: Span, + pub ty: String, + pub max: usize, +} + +#[derive(Diagnostic)] +#[diag(expand_concat_generated_invalid_ident)] +pub(crate) struct ConcatGeneratedInvalidIdent { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_invalid_concat_arg_type)] +#[note] +pub(crate) struct InvalidConcatArgType { + #[primary_span] + pub span: Span, +} + +#[derive(Subdiagnostic)] +pub(crate) enum MatchFailureLabel { + #[label(expand_match_failure_missing_tokens)] + MissingTokens(#[primary_span] Span), + #[label(expand_match_failure_unexpected_token)] + UnexpectedToken(#[primary_span] Span), +} + +#[derive(Subdiagnostic)] +pub(crate) enum ExplainDocComment { + #[label(expand_explain_doc_comment_inner)] + Inner { + #[primary_span] + span: Span, + }, + #[label(expand_explain_doc_comment_outer)] + Outer { + #[primary_span] + span: Span, + }, +} + +#[derive(Subdiagnostic)] +pub(crate) struct ParseFailureSubdiags { + #[subdiagnostic] + pub failure_label: MatchFailureLabel, + #[subdiagnostic] + pub doc_comment: Option, +} + +#[derive(Diagnostic)] +pub(crate) enum ParseFailure { + #[diag(expand_parse_failure_expected_token)] + ExpectedToken { + #[primary_span] + span: Span, + expected: Token, + found: Token, + #[subdiagnostic] + subdiags: ParseFailureSubdiags, + }, + #[diag(expand_parse_failure_unexpected_eof)] + UnexpectedEof { + #[primary_span] + span: Span, + #[subdiagnostic] + subdiags: ParseFailureSubdiags, + }, + #[diag(expand_parse_failure_unexpected_token)] + UnexpectedToken { + #[primary_span] + span: Span, + found: Token, + #[subdiagnostic] + subdiags: ParseFailureSubdiags, + }, +} + +#[derive(Diagnostic)] +#[diag(expand_unknown_macro_transparency)] +pub(crate) struct UnknownMacroTransparency { + #[primary_span] + pub span: Span, + pub value: Symbol, +} + +#[derive(Diagnostic)] +#[diag(expand_multiple_transparency_attrs)] +pub(crate) struct MultipleTransparencyAttrs { + #[primary_span] + pub spans: MultiSpan, +} + +#[derive(Diagnostic)] +#[diag(expand_unbalanced_delims_around_matcher)] +pub(crate) struct UnbalancedDelimsAroundMatcher { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_doc_comments_ignored_in_matcher_position)] +pub(crate) struct DocCommentsIgnoredInMatcherPosition { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_repetition_matches_empty_token_tree)] +pub(crate) struct RepetitionMatchesEmptyTokenTree { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_macro_rhs_must_be_delimited)] +pub(crate) struct MacroRhsMustBeDelimited { + #[primary_span] + pub span: Span, +} + +#[derive(Subdiagnostic)] +#[suggestion(expand_suggestion, code = "{suggestion}", applicability = "maybe-incorrect")] +pub(crate) struct InvalidFollowSuggestion { + #[primary_span] + pub span: Span, + pub suggestion: String, +} + +#[derive(Subdiagnostic)] +#[note(expand_note)] +pub(crate) struct InvalidFollowNote { + pub num_possible: usize, + pub possible: DiagArgValue, +} + +#[derive(Diagnostic)] +#[diag(expand_invalid_follow)] +pub(crate) struct InvalidFollow { + #[primary_span] + #[label] + pub span: Span, + pub name: Ident, + pub kind: NonterminalKind, + pub next: String, + pub only_option: bool, + + #[subdiagnostic] + pub suggestion: Option, + #[subdiagnostic] + pub note_allowed: Option, +} + +// FIXME: unify this with MissingFragmentSpecifier +#[derive(Diagnostic)] +#[diag(expand_missing_fragment_specifier)] +pub(crate) struct MissingFragmentSpecifierThin { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_multiple_successful_parses)] +pub(crate) struct MultipleSuccessfulParses { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(expand_duplicate_binding_name)] +pub(crate) struct DuplicateBindingName { + #[primary_span] + pub span: Span, + pub bind: Ident, +} + +#[derive(Diagnostic)] +#[diag(expand_multiple_parsing_options)] +pub(crate) struct MultipleParsingOptions { + #[primary_span] + pub span: Span, + pub macro_name: Ident, + pub n: usize, + pub nts: DiagArgValue, +} diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 777044e3f33bf..4cfe2668f304e 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -20,8 +20,6 @@ extern crate proc_macro as pm; mod build; mod errors; -// FIXME(Nilstrieb) Translate macro_rules diagnostics -#[allow(rustc::untranslatable_diagnostic)] mod mbe; mod placeholders; mod proc_macro_server; diff --git a/compiler/rustc_expand/src/mbe.rs b/compiler/rustc_expand/src/mbe.rs index 08d4a03945489..8b0683394c018 100644 --- a/compiler/rustc_expand/src/mbe.rs +++ b/compiler/rustc_expand/src/mbe.rs @@ -3,6 +3,8 @@ //! why we call this module `mbe`. For external documentation, prefer the //! official terminology: "declarative macros". +// FIXME(Noratrieb) Translate diagnostics +#[allow(rustc::untranslatable_diagnostic)] pub(crate) mod diagnostics; pub(crate) mod macro_rules; diff --git a/compiler/rustc_expand/src/mbe/diagnostics.rs b/compiler/rustc_expand/src/mbe/diagnostics.rs index 5778f6616227a..1ac558a005bd0 100644 --- a/compiler/rustc_expand/src/mbe/diagnostics.rs +++ b/compiler/rustc_expand/src/mbe/diagnostics.rs @@ -2,9 +2,7 @@ use std::borrow::Cow; use rustc_ast::token::{self, Token, TokenKind}; use rustc_ast::tokenstream::TokenStream; -use rustc_ast_pretty::pprust; use rustc_errors::{Applicability, Diag, DiagCtxtHandle, DiagMessage}; -use rustc_macros::Subdiagnostic; use rustc_parse::parser::{Parser, Recovery}; use rustc_session::parse::ParseSess; use rustc_span::source_map::SourceMap; @@ -12,7 +10,8 @@ use rustc_span::symbol::Ident; use rustc_span::{ErrorGuaranteed, Span}; use tracing::debug; -use super::macro_rules::{parser_from_cx, NoopTracker}; +use super::macro_rules::{parser_from_cx, MatchFailureReason, NoopTracker}; +use crate::errors::{self, ParseFailureSubdiags}; use crate::expand::{parse_ast_fragment, AstFragmentKind}; use crate::mbe::macro_parser::ParseResult::*; use crate::mbe::macro_parser::{MatcherLoc, NamedParseResult, TtParser}; @@ -53,14 +52,17 @@ pub(super) fn failed_to_match_macro( let span = token.span.substitute_dummy(sp); - let mut err = psess.dcx().struct_span_err(span, parse_failure_msg(&token, None)); - err.span_label(span, label); + let mut err = psess.dcx().create_err(parse_failure_err( + span, + psess.source_map(), + label, + token.clone(), + None, + )); if !def_span.is_dummy() && !psess.source_map().is_imported(def_span) { err.span_label(psess.source_map().guess_head_span(def_span), "when calling this macro"); } - annotate_doc_comment(&mut err, psess.source_map(), span); - if let Some(span) = remaining_matcher.span() { err.span_note(span, format!("while trying to match {remaining_matcher}")); } else { @@ -118,7 +120,7 @@ struct CollectTrackerAndEmitter<'dcx, 'matcher> { struct BestFailure { token: Token, position_in_tokenstream: u32, - msg: &'static str, + msg: MatchFailureReason, remaining_matcher: MatcherLoc, } @@ -129,9 +131,9 @@ impl BestFailure { } impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'matcher> { - type Failure = (Token, u32, &'static str); + type Failure = (Token, u32, MatchFailureReason); - fn build_failure(tok: Token, position: u32, msg: &'static str) -> Self::Failure { + fn build_failure(tok: Token, position: u32, msg: MatchFailureReason) -> Self::Failure { (tok, position, msg) } @@ -164,7 +166,7 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match self.best_failure = Some(BestFailure { token: token.clone(), position_in_tokenstream: *approx_position, - msg, + msg: *msg, remaining_matcher: self .remaining_matcher .expect("must have collected matcher already") @@ -174,7 +176,7 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match } Error(err_sp, msg) => { let span = err_sp.substitute_dummy(self.root_span); - let guar = self.dcx.span_err(span, msg.clone()); + let guar = msg.emit_err(self.dcx, span); self.result = Some((span, guar)); } ErrorReported(guar) => self.result = Some((self.root_span, *guar)), @@ -209,9 +211,9 @@ impl<'matcher> FailureForwarder<'matcher> { } impl<'matcher> Tracker<'matcher> for FailureForwarder<'matcher> { - type Failure = (Token, u32, &'static str); + type Failure = (Token, u32, MatchFailureReason); - fn build_failure(tok: Token, position: u32, msg: &'static str) -> Self::Failure { + fn build_failure(tok: Token, position: u32, msg: MatchFailureReason) -> Self::Failure { (tok, position, msg) } @@ -308,45 +310,35 @@ pub(crate) fn annotate_err_with_kind(err: &mut Diag<'_>, kind: AstFragmentKind, }; } -#[derive(Subdiagnostic)] -enum ExplainDocComment { - #[label(expand_explain_doc_comment_inner)] - Inner { - #[primary_span] - span: Span, - }, - #[label(expand_explain_doc_comment_outer)] - Outer { - #[primary_span] - span: Span, - }, -} - -pub(super) fn annotate_doc_comment(err: &mut Diag<'_>, sm: &SourceMap, span: Span) { - if let Ok(src) = sm.span_to_snippet(span) { +/// Generates an appropriate parsing failure message. For EOF, this is "unexpected end...". For +/// other tokens, this is "unexpected token...". +pub(super) fn parse_failure_err( + span: Span, + sm: &SourceMap, + reason: MatchFailureReason, + tok: Token, + expected_token: Option, +) -> errors::ParseFailure { + let failure_label = reason.into_label(span); + let doc_comment = if let Ok(src) = sm.span_to_snippet(span) { if src.starts_with("///") || src.starts_with("/**") { - err.subdiagnostic(ExplainDocComment::Outer { span }); + Some(errors::ExplainDocComment::Outer { span }) } else if src.starts_with("//!") || src.starts_with("/*!") { - err.subdiagnostic(ExplainDocComment::Inner { span }); + Some(errors::ExplainDocComment::Inner { span }) + } else { + None } - } -} + } else { + None + }; + let subdiags = ParseFailureSubdiags { failure_label, doc_comment }; -/// Generates an appropriate parsing failure message. For EOF, this is "unexpected end...". For -/// other tokens, this is "unexpected token...". -pub(super) fn parse_failure_msg(tok: &Token, expected_token: Option<&Token>) -> Cow<'static, str> { if let Some(expected_token) = expected_token { - Cow::from(format!( - "expected `{}`, found `{}`", - pprust::token_to_string(expected_token), - pprust::token_to_string(tok), - )) + errors::ParseFailure::ExpectedToken { span, expected: expected_token, found: tok, subdiags } } else { match tok.kind { - token::Eof => Cow::from("unexpected end of macro invocation"), - _ => { - Cow::from(format!("no rules expected the token `{}`", pprust::token_to_string(tok))) - } + token::Eof => errors::ParseFailure::UnexpectedEof { span, subdiags }, + _ => errors::ParseFailure::UnexpectedToken { span, found: tok, subdiags }, } } } diff --git a/compiler/rustc_expand/src/mbe/macro_check.rs b/compiler/rustc_expand/src/mbe/macro_check.rs index 68eeba6f415d5..de98608fab942 100644 --- a/compiler/rustc_expand/src/mbe/macro_check.rs +++ b/compiler/rustc_expand/src/mbe/macro_check.rs @@ -119,9 +119,8 @@ use rustc_span::symbol::{kw, MacroRulesNormalizedIdent}; use rustc_span::{ErrorGuaranteed, Span}; use smallvec::SmallVec; -use super::quoted::VALID_FRAGMENT_NAMES_MSG_2021; -use crate::errors; use crate::mbe::{KleeneToken, TokenTree}; +use crate::{errors, fluent_generated as fluent}; /// Stack represented as linked list. /// @@ -254,7 +253,7 @@ fn check_binders( if let Some(prev_info) = binders.get(&name) { // 1. The meta-variable is already bound in the current LHS: This is an error. let mut span = MultiSpan::from_span(span); - span.push_span_label(prev_info.span, "previous declaration"); + span.push_span_label(prev_info.span, fluent::expand_label_previous_declaration); buffer_lint(psess, span, node_id, BuiltinLintDiag::DuplicateMatcherBinding); } else if get_binder_info(macros, binders, name).is_none() { // 2. The meta-variable is free: This is a binder. @@ -274,7 +273,7 @@ fn check_binders( psess.dcx().emit_err(errors::MissingFragmentSpecifier { span, add_span: span.shrink_to_hi(), - valid: VALID_FRAGMENT_NAMES_MSG_2021, + valid: errors::InvalidFragmentSpecifierValidNames::Edition2021, }); } else { psess.buffer_lint( @@ -638,15 +637,15 @@ fn ops_is_prefix( for (i, binder) in binder_ops.iter().enumerate() { if i >= occurrence_ops.len() { let mut span = MultiSpan::from_span(span); - span.push_span_label(binder.span, "expected repetition"); + span.push_span_label(binder.span, fluent::expand_label_expected_repetition); buffer_lint(psess, span, node_id, BuiltinLintDiag::MetaVariableStillRepeating(name)); return; } let occurrence = &occurrence_ops[i]; if occurrence.op != binder.op { let mut span = MultiSpan::from_span(span); - span.push_span_label(binder.span, "expected repetition"); - span.push_span_label(occurrence.span, "conflicting repetition"); + span.push_span_label(binder.span, fluent::expand_label_expected_repetition); + span.push_span_label(occurrence.span, fluent::expand_label_conflicting_repetition); buffer_lint(psess, span, node_id, BuiltinLintDiag::MetaVariableWrongOperator); return; } diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs index 501a2417fcf31..739edc11aa49d 100644 --- a/compiler/rustc_expand/src/mbe/macro_parser.rs +++ b/compiler/rustc_expand/src/mbe/macro_parser.rs @@ -78,14 +78,15 @@ use std::rc::Rc; use rustc_ast::token::{self, DocComment, NonterminalKind, Token}; use rustc_ast_pretty::pprust; use rustc_data_structures::fx::FxHashMap; -use rustc_errors::ErrorGuaranteed; -use rustc_lint_defs::pluralize; +use rustc_errors::{DiagArgValue, DiagCtxtHandle, ErrorGuaranteed}; use rustc_parse::parser::{ParseNtResult, Parser}; use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; use rustc_span::Span; pub(crate) use NamedMatch::*; pub(crate) use ParseResult::*; +use super::macro_rules::MatchFailureReason; +use crate::errors; use crate::mbe::macro_rules::Tracker; use crate::mbe::{KleeneOp, TokenTree}; @@ -305,6 +306,43 @@ enum EofMatcherPositions { Multiple, } +#[derive(Debug, Clone)] +pub(crate) enum ErrorMessage { + MissingFragmentSpecifier, + MultipleSuccessfulParses, + // FIXME: check if this can ever be reached + DuplicateBindingName(Ident), + MultipleParsingOptions { macro_name: Ident, n: usize, nts: Vec<(NonterminalKind, Ident)> }, +} + +impl ErrorMessage { + pub(crate) fn emit_err(&self, dcx: DiagCtxtHandle<'_>, span: Span) -> ErrorGuaranteed { + match self { + ErrorMessage::MissingFragmentSpecifier => { + dcx.emit_err(errors::MissingFragmentSpecifierThin { span }) + } + ErrorMessage::MultipleSuccessfulParses => { + dcx.emit_err(errors::MultipleSuccessfulParses { span }) + } + ErrorMessage::DuplicateBindingName(bind) => { + dcx.emit_err(errors::DuplicateBindingName { span, bind: bind.clone() }) + } + ErrorMessage::MultipleParsingOptions { macro_name, n, nts } => { + dcx.emit_err(errors::MultipleParsingOptions { + span, + macro_name: macro_name.clone(), + n: *n, + nts: DiagArgValue::StrListSepByOr( + nts.into_iter() + .map(|(kind, bind)| format!("{kind} ('{bind}')").into()) + .collect(), + ), + }) + } + } + } +} + /// Represents the possible results of an attempted parse. pub(crate) enum ParseResult { /// Parsed successfully. @@ -314,7 +352,7 @@ pub(crate) enum ParseResult { /// The usize is the approximate position of the token in the input token stream. Failure(F), /// Fatal error (malformed macro?). Abort compilation. - Error(rustc_span::Span, String), + Error(rustc_span::Span, ErrorMessage), ErrorReported(ErrorGuaranteed), } @@ -564,7 +602,7 @@ impl TtParser { } else { // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used. // Both this check and the one in `nameize` are necessary, surprisingly. - return Some(Error(span, "missing fragment specifier".to_string())); + return Some(Error(span, ErrorMessage::MissingFragmentSpecifier)); } } MatcherLoc::Eof => { @@ -593,7 +631,7 @@ impl TtParser { self.nameize(matcher, matches) } EofMatcherPositions::Multiple => { - Error(token.span, "ambiguity: multiple successful parses".to_string()) + Error(token.span, ErrorMessage::MultipleSuccessfulParses) } EofMatcherPositions::None => Failure(T::build_failure( Token::new( @@ -601,7 +639,7 @@ impl TtParser { if token.span.is_dummy() { token.span } else { token.span.shrink_to_hi() }, ), approx_position, - "missing tokens in macro arguments", + MatchFailureReason::MissingTokens, )), }) } else { @@ -652,7 +690,7 @@ impl TtParser { return Failure(T::build_failure( parser.token.clone(), parser.approx_token_stream_pos(), - "no rules expected this token in macro call", + MatchFailureReason::UnexpectedToken, )); } @@ -678,15 +716,12 @@ impl TtParser { // We use the span of the metavariable declaration to determine any // edition-specific matching behavior for non-terminals. let nt = match parser.to_mut().parse_nonterminal(kind) { - Err(err) => { - let guarantee = err.with_span_label( + Err(mut err) => { + err.subdiagnostic(errors::NoteParseErrorInMacroArgument { span, - format!( - "while parsing argument for this `{kind}` macro fragment" - ), - ) - .emit(); - return ErrorReported(guarantee); + kind, + }); + return ErrorReported(err.emit()); } Ok(nt) => nt, }; @@ -718,23 +753,19 @@ impl TtParser { .iter() .map(|mp| match &matcher[mp.idx] { MatcherLoc::MetaVarDecl { bind, kind: Some(kind), .. } => { - format!("{kind} ('{bind}')") + (kind.clone(), bind.clone()) } _ => unreachable!(), }) - .collect::>() - .join(" or "); + .collect(); Error( token_span, - format!( - "local ambiguity when calling macro `{}`: multiple parsing options: {}", - self.macro_name, - match self.next_mps.len() { - 0 => format!("built-in NTs {nts}."), - n => format!("built-in NTs {nts} or {n} other option{s}.", s = pluralize!(n)), - } - ), + ErrorMessage::MultipleParsingOptions { + macro_name: self.macro_name, + n: self.next_mps.len(), + nts, + }, ) } @@ -752,13 +783,13 @@ impl TtParser { match ret_val.entry(MacroRulesNormalizedIdent::new(bind)) { Vacant(spot) => spot.insert(res.next().unwrap()), Occupied(..) => { - return Error(span, format!("duplicated bind name: {bind}")); + return Error(span, ErrorMessage::DuplicateBindingName(bind)); } }; } else { // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used. // Both this check and the one in `parse_tt_inner` are necessary, surprisingly. - return Error(span, "missing fragment specifier".to_string()); + return Error(span, ErrorMessage::MissingFragmentSpecifier); } } } diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 256713ef73000..6f05a3776823a 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -12,7 +12,7 @@ use rustc_ast::{NodeId, DUMMY_NODE_ID}; use rustc_ast_pretty::pprust; use rustc_attr::{self as attr, TransparencyError}; use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; -use rustc_errors::{Applicability, ErrorGuaranteed}; +use rustc_errors::ErrorGuaranteed; use rustc_feature::Features; use rustc_lint_defs::builtin::{ RUST_2021_INCOMPATIBLE_OR_PATTERNS, SEMICOLON_IN_EXPRESSIONS_FROM_MACROS, @@ -33,9 +33,10 @@ use crate::base::{ DummyResult, ExpandResult, ExtCtxt, MacResult, MacroExpanderResult, SyntaxExtension, SyntaxExtensionKind, TTMacroExpander, }; +use crate::errors::{self, InvalidFollowNote, MatchFailureLabel}; use crate::expand::{ensure_complete_parse, parse_ast_fragment, AstFragment, AstFragmentKind}; use crate::mbe; -use crate::mbe::diagnostics::{annotate_doc_comment, parse_failure_msg}; +use crate::mbe::diagnostics::parse_failure_err; use crate::mbe::macro_check; use crate::mbe::macro_parser::NamedMatch::*; use crate::mbe::macro_parser::{Error, ErrorReported, Failure, MatcherLoc, Success, TtParser}; @@ -147,6 +148,21 @@ fn trace_macros_note(cx_expansions: &mut FxIndexMap>, sp: Span cx_expansions.entry(sp).or_default().push(message); } +#[derive(Debug, Copy, Clone)] +pub(super) enum MatchFailureReason { + MissingTokens, + UnexpectedToken, +} + +impl MatchFailureReason { + pub(super) fn into_label(self, sp: Span) -> MatchFailureLabel { + match self { + MatchFailureReason::MissingTokens => MatchFailureLabel::MissingTokens(sp), + MatchFailureReason::UnexpectedToken => MatchFailureLabel::UnexpectedToken(sp), + } + } +} + pub(super) trait Tracker<'matcher> { /// The contents of `ParseResult::Failure`. type Failure; @@ -154,7 +170,7 @@ pub(super) trait Tracker<'matcher> { /// Arm failed to match. If the token is `token::Eof`, it indicates an unexpected /// end of macro invocation. Otherwise, it indicates that no rules expected the given token. /// The usize is the approximate position of the token in the input token stream. - fn build_failure(tok: Token, position: u32, msg: &'static str) -> Self::Failure; + fn build_failure(tok: Token, position: u32, msg: MatchFailureReason) -> Self::Failure; /// This is called before trying to match next MatcherLoc on the current token. fn before_match_loc(&mut self, _parser: &TtParser, _matcher: &'matcher MatcherLoc) {} @@ -183,7 +199,7 @@ pub(super) struct NoopTracker; impl<'matcher> Tracker<'matcher> for NoopTracker { type Failure = (); - fn build_failure(_tok: Token, _position: u32, _msg: &'static str) -> Self::Failure {} + fn build_failure(_tok: Token, _position: u32, _msg: MatchFailureReason) -> Self::Failure {} fn description() -> &'static str { "none" @@ -465,17 +481,20 @@ pub fn compile_declarative_macro( unreachable!("matcher returned something other than Failure after retry"); }; - let s = parse_failure_msg(&token, track.get_expected_token()); let sp = token.span.substitute_dummy(def.span); - let mut err = sess.dcx().struct_span_err(sp, s); - err.span_label(sp, msg); - annotate_doc_comment(&mut err, sess.source_map(), sp); + let err = sess.dcx().create_err(parse_failure_err( + sp, + sess.source_map(), + msg, + token, + track.get_expected_token().cloned(), + )); let guar = err.emit(); return dummy_syn_ext(guar); } Error(sp, msg) => { - let guar = sess.dcx().span_err(sp.substitute_dummy(def.span), msg); - return dummy_syn_ext(guar); + let span = sp.substitute_dummy(def.span); + return dummy_syn_ext(msg.emit_err(sess.dcx(), span)); } ErrorReported(guar) => { return dummy_syn_ext(guar); @@ -554,10 +573,12 @@ pub fn compile_declarative_macro( let (transparency, transparency_error) = attr::find_transparency(&def.attrs, macro_rules); match transparency_error { Some(TransparencyError::UnknownTransparency(value, span)) => { - dcx.span_err(span, format!("unknown macro transparency: `{value}`")); + dcx.emit_err(errors::UnknownMacroTransparency { span, value }); } Some(TransparencyError::MultipleTransparencyAttrs(old_span, new_span)) => { - dcx.span_err(vec![old_span, new_span], "multiple macro transparency attributes"); + dcx.emit_err(errors::MultipleTransparencyAttrs { + spans: vec![old_span, new_span].into(), + }); } None => {} } @@ -622,8 +643,7 @@ fn check_lhs_nt_follows( if let mbe::TokenTree::Delimited(.., delimited) = lhs { check_matcher(sess, def, &delimited.tts) } else { - let msg = "invalid macro matcher; matchers must be contained in balanced delimiters"; - Err(sess.dcx().span_err(lhs.span(), msg)) + Err(sess.dcx().emit_err(errors::UnbalancedDelimsAroundMatcher { span: lhs.span() })) } } @@ -646,7 +666,7 @@ fn is_empty_token_tree(sess: &Session, seq: &mbe::SequenceRepetition) -> bool { iter.next(); } let span = t.span.to(now.span); - sess.dcx().span_note(span, "doc comments are ignored in matcher position"); + sess.dcx().emit_note(errors::DocCommentsIgnoredInMatcherPosition { span }); } mbe::TokenTree::Sequence(_, sub_seq) if (sub_seq.kleene.op == mbe::KleeneOp::ZeroOrMore @@ -671,8 +691,9 @@ fn check_lhs_no_empty_seq(sess: &Session, tts: &[mbe::TokenTree]) -> Result<(), TokenTree::Delimited(.., del) => check_lhs_no_empty_seq(sess, &del.tts)?, TokenTree::Sequence(span, seq) => { if is_empty_token_tree(sess, seq) { - let sp = span.entire(); - let guar = sess.dcx().span_err(sp, "repetition matches empty token tree"); + let span = span.entire(); + let guar = + sess.dcx().emit_err(errors::RepetitionMatchesEmptyTokenTree { span }); return Err(guar); } check_lhs_no_empty_seq(sess, &seq.tts)? @@ -686,7 +707,7 @@ fn check_lhs_no_empty_seq(sess: &Session, tts: &[mbe::TokenTree]) -> Result<(), fn check_rhs(sess: &Session, rhs: &mbe::TokenTree) -> Result<(), ErrorGuaranteed> { match *rhs { mbe::TokenTree::Delimited(..) => Ok(()), - _ => Err(sess.dcx().span_err(rhs.span(), "macro rhs must be delimited")), + _ => Err(sess.dcx().emit_err(errors::MacroRhsMustBeDelimited { span: rhs.span() })), } } @@ -1173,61 +1194,41 @@ fn check_matcher_core<'tt>( match is_in_follow(next_token, kind) { IsInFollow::Yes => {} IsInFollow::No(possible) => { - let may_be = if last.tokens.len() == 1 && suffix_first.tokens.len() == 1 - { - "is" - } else { - "may be" - }; + let only_option = + last.tokens.len() == 1 && suffix_first.tokens.len() == 1; - let sp = next_token.span(); - let mut err = sess.dcx().struct_span_err( - sp, - format!( - "`${name}:{frag}` {may_be} followed by `{next}`, which \ - is not allowed for `{frag}` fragments", - name = name, - frag = kind, - next = quoted_tt_to_string(next_token), - may_be = may_be - ), - ); - err.span_label(sp, format!("not allowed after `{kind}` fragments")); - - if kind == NonterminalKind::Pat(PatWithOr) + let suggestion = if kind == NonterminalKind::Pat(PatWithOr) && sess.psess.edition.at_least_rust_2021() && next_token.is_token(&BinOp(token::BinOpToken::Or)) { - let suggestion = quoted_tt_to_string(&TokenTree::MetaVarDecl( - span, - name, - Some(NonterminalKind::Pat(PatParam { inferred: false })), - )); - err.span_suggestion( + Some(errors::InvalidFollowSuggestion { span, - "try a `pat_param` fragment specifier instead", - suggestion, - Applicability::MaybeIncorrect, - ); - } + suggestion: quoted_tt_to_string(&TokenTree::MetaVarDecl( + span, + name, + Some(NonterminalKind::Pat(PatParam { inferred: false })), + )), + }) + } else { + None + }; - let msg = "allowed there are: "; - match possible { - &[] => {} - &[t] => { - err.note(format!( - "only {t} is allowed after `{kind}` fragments", - )); - } - ts => { - err.note(format!( - "{}{} or {}", - msg, - ts[..ts.len() - 1].to_vec().join(", "), - ts[ts.len() - 1], - )); - } - } + let note_allowed = (possible.len() != 0).then(|| InvalidFollowNote { + num_possible: possible.len(), + possible: rustc_errors::DiagArgValue::StrListSepByOr( + possible.into_iter().copied().map(Cow::Borrowed).collect(), + ), + }); + + let err = sess.dcx().create_err(errors::InvalidFollow { + span: next_token.span(), + name, + kind, + next: quoted_tt_to_string(next_token), + only_option, + suggestion, + note_allowed, + }); errored = Err(err.emit()); } } diff --git a/compiler/rustc_expand/src/mbe/metavar_expr.rs b/compiler/rustc_expand/src/mbe/metavar_expr.rs index 4a84670c0b1d9..350aff02f117b 100644 --- a/compiler/rustc_expand/src/mbe/metavar_expr.rs +++ b/compiler/rustc_expand/src/mbe/metavar_expr.rs @@ -1,15 +1,13 @@ use rustc_ast::token::{self, Delimiter, IdentIsRaw, Lit, Token, TokenKind}; use rustc_ast::tokenstream::{RefTokenTreeCursor, TokenStream, TokenTree}; use rustc_ast::{LitIntType, LitKind}; -use rustc_ast_pretty::pprust; -use rustc_errors::{Applicability, PResult}; +use rustc_errors::PResult; use rustc_macros::{Decodable, Encodable}; use rustc_session::parse::ParseSess; use rustc_span::symbol::Ident; use rustc_span::{Span, Symbol}; -pub(crate) const RAW_IDENT_ERR: &str = "`${concat(..)}` currently does not support raw identifiers"; -pub(crate) const UNSUPPORTED_CONCAT_ELEM_ERR: &str = "expected identifier or string literal"; +use crate::errors; /// A meta-variable expression, for expansions based on properties of meta-variables. #[derive(Debug, PartialEq, Encodable, Decodable)] @@ -42,8 +40,9 @@ impl MetaVarExpr { let mut tts = input.trees(); let ident = parse_ident(&mut tts, psess, outer_span)?; let Some(TokenTree::Delimited(.., Delimiter::Parenthesis, args)) = tts.next() else { - let msg = "meta-variable expression parameter must be wrapped in parentheses"; - return Err(psess.dcx().struct_span_err(ident.span, msg)); + return Err(psess + .dcx() + .create_err(errors::MetaVarExprParamNeedsParens { span: ident.span })); }; check_trailing_token(&mut tts, psess)?; let mut iter = args.trees(); @@ -66,9 +65,9 @@ impl MetaVarExpr { match parse_ident_from_token(psess, token) { Err(err) => { err.cancel(); - return Err(psess - .dcx() - .struct_span_err(token.span, UNSUPPORTED_CONCAT_ELEM_ERR)); + return Err(psess.dcx().create_err( + errors::UnsupportedConcatElem { span: token.span }, + )); } Ok(elem) => MetaVarExprConcatElem::Ident(elem), } @@ -78,13 +77,15 @@ impl MetaVarExpr { break; } if !try_eat_comma(&mut iter) { - return Err(psess.dcx().struct_span_err(outer_span, "expected comma")); + return Err(psess + .dcx() + .create_err(errors::ExpectedComma { span: outer_span })); } } if result.len() < 2 { return Err(psess .dcx() - .struct_span_err(ident.span, "`concat` must have at least two elements")); + .create_err(errors::ConcatTooFewArgs { span: ident.span })); } MetaVarExpr::Concat(result.into()) } @@ -96,10 +97,9 @@ impl MetaVarExpr { "index" => MetaVarExpr::Index(parse_depth(&mut iter, psess, ident.span)?), "len" => MetaVarExpr::Len(parse_depth(&mut iter, psess, ident.span)?), _ => { - let err_msg = "unrecognized meta-variable expression"; - let mut err = psess.dcx().struct_span_err(ident.span, err_msg); - err.help("supported expressions are count, ignore, index and len"); - return Err(err); + return Err(psess + .dcx() + .create_err(errors::UnrecognizedMetaVarExpr { span: ident.span })); } }; check_trailing_token(&mut iter, psess)?; @@ -142,11 +142,9 @@ fn check_trailing_token<'psess>( psess: &'psess ParseSess, ) -> PResult<'psess, ()> { if let Some(tt) = iter.next() { - let mut diag = psess + Err(psess .dcx() - .struct_span_err(tt.span(), format!("unexpected token: {}", pprust::tt_to_string(tt))); - diag.span_note(tt.span(), "meta-variable expression must not have trailing tokens"); - Err(diag) + .create_err(errors::MetaVarExprUnexpectedToken { span: tt.span(), tt: tt.clone() })) } else { Ok(()) } @@ -162,10 +160,7 @@ fn parse_count<'psess>( let ident = parse_ident(iter, psess, span)?; let depth = if try_eat_comma(iter) { if iter.look_ahead(0).is_none() { - return Err(psess.dcx().struct_span_err( - span, - "`count` followed by a comma must have an associated index indicating its depth", - )); + return Err(psess.dcx().create_err(errors::CountWithCommaNoIndex { span })); } parse_depth(iter, psess, span)? } else { @@ -182,9 +177,7 @@ fn parse_depth<'psess>( ) -> PResult<'psess, usize> { let Some(tt) = iter.next() else { return Ok(0) }; let TokenTree::Token(Token { kind: TokenKind::Literal(lit), .. }, _) = tt else { - return Err(psess - .dcx() - .struct_span_err(span, "meta-variable expression depth must be a literal")); + return Err(psess.dcx().create_err(errors::MetaVarExprDepthNotLiteral { span })); }; if let Ok(lit_kind) = LitKind::from_token_lit(*lit) && let LitKind::Int(n_u128, LitIntType::Unsuffixed) = lit_kind @@ -192,8 +185,7 @@ fn parse_depth<'psess>( { Ok(n_usize) } else { - let msg = "only unsuffixed integer literals are supported in meta-variable expressions"; - Err(psess.dcx().struct_span_err(span, msg)) + Err(psess.dcx().create_err(errors::MetaVarExprDepthSuffixed { span })) } } @@ -213,21 +205,14 @@ fn parse_ident_from_token<'psess>( ) -> PResult<'psess, Ident> { if let Some((elem, is_raw)) = token.ident() { if let IdentIsRaw::Yes = is_raw { - return Err(psess.dcx().struct_span_err(elem.span, RAW_IDENT_ERR)); + return Err(psess.dcx().create_err(errors::ConcatRawIdent { span: elem.span })); } return Ok(elem); } - let token_str = pprust::token_to_string(token); - let mut err = psess - .dcx() - .struct_span_err(token.span, format!("expected identifier, found `{token_str}`")); - err.span_suggestion( - token.span, - format!("try removing `{token_str}`"), - "", - Applicability::MaybeIncorrect, - ); - Err(err) + Err(psess.dcx().create_err(errors::MetaVarExprExpectedIdentifier { + span: token.span, + found: token.clone(), + })) } fn parse_token<'psess, 't>( @@ -236,10 +221,10 @@ fn parse_token<'psess, 't>( fallback_span: Span, ) -> PResult<'psess, &'t Token> { let Some(tt) = iter.next() else { - return Err(psess.dcx().struct_span_err(fallback_span, UNSUPPORTED_CONCAT_ELEM_ERR)); + return Err(psess.dcx().create_err(errors::UnsupportedConcatElem { span: fallback_span })); }; let TokenTree::Token(token, _) = tt else { - return Err(psess.dcx().struct_span_err(tt.span(), UNSUPPORTED_CONCAT_ELEM_ERR)); + return Err(psess.dcx().create_err(errors::UnsupportedConcatElem { span: tt.span() })); }; Ok(token) } @@ -274,8 +259,5 @@ fn eat_dollar<'psess>( let _ = iter.next(); return Ok(()); } - Err(psess.dcx().struct_span_err( - span, - "meta-variables within meta-variable expressions must be referenced using a dollar sign", - )) + Err(psess.dcx().create_err(errors::NestedMetaVarExprWithoutDollar { span })) } diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs index 5df0aebfe57bd..a75a9d6645870 100644 --- a/compiler/rustc_expand/src/mbe/quoted.rs +++ b/compiler/rustc_expand/src/mbe/quoted.rs @@ -9,16 +9,9 @@ use rustc_span::edition::Edition; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::Span; -use crate::errors; use crate::mbe::macro_parser::count_metavar_decls; use crate::mbe::{Delimited, KleeneOp, KleeneToken, MetaVarExpr, SequenceRepetition, TokenTree}; - -const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \ - `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, \ - `item` and `vis`"; -pub(crate) const VALID_FRAGMENT_NAMES_MSG_2021: &str = "valid fragment specifiers are \ - `ident`, `block`, `stmt`, `expr`, `expr_2021`, `pat`, `ty`, `lifetime`, `literal`, `path`, \ - `meta`, `tt`, `item` and `vis`"; +use crate::{errors, fluent_generated as fluent}; /// Takes a `tokenstream::TokenStream` and returns a `Vec`. Specifically, this /// takes a generic `TokenStream`, such as is used in the rest of the compiler, and returns a @@ -92,26 +85,31 @@ pub(super) fn parse( }; let kind = NonterminalKind::from_symbol(fragment.name, edition) .unwrap_or_else(|| { - let help = match fragment.name { - sym::expr_2021 => { - format!( - "fragment specifier `expr_2021` \ - requires Rust 2021 or later\n\ - {VALID_FRAGMENT_NAMES_MSG}" - ) - } + let (help_expr_2021, help_valid_names) = match fragment.name { + sym::expr_2021 => ( + true, + errors::InvalidFragmentSpecifierValidNames::Other, + ), _ if edition().at_least_rust_2021() && features.expr_fragment_specifier_2024 => - { - VALID_FRAGMENT_NAMES_MSG_2021.into() - } - _ => VALID_FRAGMENT_NAMES_MSG.into(), + ( + false, + errors::InvalidFragmentSpecifierValidNames::Edition2021, + ), + _ => ( + false, + errors::InvalidFragmentSpecifierValidNames::Other, + ) + }; - sess.dcx().emit_err(errors::InvalidFragmentSpecifier { - span, - fragment, - help, - }); + sess.dcx().emit_err( + errors::InvalidFragmentSpecifier { + span, + fragment, + help_expr_2021, + help_valid_names, + }, + ); NonterminalKind::Ident }); if kind == NonterminalKind::Expr(Expr2021 { inferred: false }) @@ -121,7 +119,7 @@ pub(super) fn parse( sess, sym::expr_fragment_specifier_2024, span, - "fragment specifier `expr_2021` is unstable", + fluent::expand_expr_2021_unstable, ) .emit(); } @@ -152,15 +150,20 @@ pub(super) fn parse( /// Asks for the `macro_metavar_expr` feature if it is not already declared fn maybe_emit_macro_metavar_expr_feature(features: &Features, sess: &Session, span: Span) { if !features.macro_metavar_expr { - let msg = "meta-variable expressions are unstable"; - feature_err(sess, sym::macro_metavar_expr, span, msg).emit(); + feature_err(sess, sym::macro_metavar_expr, span, fluent::expand_meta_var_expr_unstable) + .emit(); } } fn maybe_emit_macro_metavar_expr_concat_feature(features: &Features, sess: &Session, span: Span) { if !features.macro_metavar_expr_concat { - let msg = "the `concat` meta-variable expression is unstable"; - feature_err(sess, sym::macro_metavar_expr_concat, span, msg).emit(); + feature_err( + sess, + sym::macro_metavar_expr_concat, + span, + fluent::expand_meta_var_expr_concat_unstable, + ) + .emit(); } } @@ -299,9 +302,10 @@ fn parse_tree<'a>( // `tree` is followed by some other token. This is an error. Some(tokenstream::TokenTree::Token(token, _)) => { - let msg = - format!("expected identifier, found `{}`", pprust::token_to_string(token),); - sess.dcx().span_err(token.span, msg); + sess.dcx().emit_err(errors::ExpectedIdentifier { + span: token.span, + found: token.clone(), + }); TokenTree::MetaVar(token.span, Ident::empty()) } @@ -382,10 +386,7 @@ fn parse_sep_and_kleene_op<'a>( // #2 is the `?` Kleene op, which does not take a separator (error) Ok(Ok((KleeneOp::ZeroOrOne, span))) => { // Error! - sess.dcx().span_err( - token.span, - "the `?` macro repetition operator does not take a separator", - ); + sess.dcx().emit_err(errors::QuestionMarkWithSeparator { span: token.span }); // Return a dummy return (None, KleeneToken::new(KleeneOp::ZeroOrMore, span)); @@ -403,7 +404,7 @@ fn parse_sep_and_kleene_op<'a>( }; // If we ever get to this point, we have experienced an "unexpected token" error - sess.dcx().span_err(span, "expected one of: `*`, `+`, or `?`"); + sess.dcx().emit_err(errors::ExpectedRepetitionOperator { span }); // Return a dummy (None, KleeneToken::new(KleeneOp::ZeroOrMore, span)) @@ -413,10 +414,5 @@ fn parse_sep_and_kleene_op<'a>( // // For example, `macro_rules! foo { ( ${len()} ) => {} }` fn span_dollar_dollar_or_metavar_in_the_lhs_err(sess: &Session, token: &Token) { - sess.dcx() - .span_err(token.span, format!("unexpected token: {}", pprust::token_to_string(token))); - sess.dcx().span_note( - token.span, - "`$$` and meta-variable expressions are not allowed inside macro parameter definitions", - ); + sess.dcx().emit_err(errors::DollarOrMetavarInLhs { span: token.span, token: token.clone() }); } diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index 2bd78d347368a..e979ba0c206ed 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -5,7 +5,7 @@ use rustc_ast::token::{self, Delimiter, IdentIsRaw, Lit, LitKind, Nonterminal, T use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; use rustc_ast::ExprKind; use rustc_data_structures::fx::FxHashMap; -use rustc_errors::{pluralize, Diag, DiagCtxtHandle, PResult}; +use rustc_errors::{Diag, DiagCtxtHandle, PResult}; use rustc_parse::lexer::nfc_normalize; use rustc_parse::parser::ParseNtResult; use rustc_session::parse::{ParseSess, SymbolGallery}; @@ -15,12 +15,12 @@ use rustc_span::{with_metavar_spans, Span, Symbol, SyntaxContext}; use smallvec::{smallvec, SmallVec}; use crate::errors::{ - CountRepetitionMisplaced, MetaVarExprUnrecognizedVar, MetaVarsDifSeqMatchers, MustRepeatOnce, - NoSyntaxVarsExprRepeat, VarStillRepeating, + self, CountRepetitionMisplaced, MetaVarExprUnrecognizedVar, MetaVarsDifSeqMatchers, + MustRepeatOnce, NoSyntaxVarsExprRepeat, VarStillRepeating, }; use crate::mbe::macro_parser::NamedMatch; use crate::mbe::macro_parser::NamedMatch::*; -use crate::mbe::metavar_expr::{MetaVarExprConcatElem, RAW_IDENT_ERR}; +use crate::mbe::metavar_expr::MetaVarExprConcatElem; use crate::mbe::{self, KleeneOp, MetaVarExpr}; // A Marker adds the given mark to the syntax context. @@ -211,14 +211,18 @@ pub(super) fn transcribe<'a>( return Err(dcx.create_err(NoSyntaxVarsExprRepeat { span: seq.span() })); } - LockstepIterSize::Contradiction(msg) => { + LockstepIterSize::Contradiction { var1_id, var1_len, var2_id, var2_len } => { // FIXME: this really ought to be caught at macro definition time... It // happens when two meta-variables are used in the same repetition in a // sequence, but they come from different sequence matchers and repeat // different amounts. - return Err( - dcx.create_err(MetaVarsDifSeqMatchers { span: seq.span(), msg }) - ); + return Err(dcx.create_err(MetaVarsDifSeqMatchers { + span: seq.span(), + var1_id, + var1_len, + var2_id, + var2_len, + })); } LockstepIterSize::Constraint(len, _) => { @@ -485,7 +489,7 @@ enum LockstepIterSize { Constraint(usize, MacroRulesNormalizedIdent), /// Two `Constraint`s on the same sequence had different lengths. This is an error. - Contradiction(String), + Contradiction { var1_id: String, var1_len: usize, var2_id: String, var2_len: usize }, } impl LockstepIterSize { @@ -496,23 +500,17 @@ impl LockstepIterSize { fn with(self, other: LockstepIterSize) -> LockstepIterSize { match self { LockstepIterSize::Unconstrained => other, - LockstepIterSize::Contradiction(_) => self, + LockstepIterSize::Contradiction { .. } => self, LockstepIterSize::Constraint(l_len, l_id) => match other { LockstepIterSize::Unconstrained => self, - LockstepIterSize::Contradiction(_) => other, + LockstepIterSize::Contradiction { .. } => other, LockstepIterSize::Constraint(r_len, _) if l_len == r_len => self, - LockstepIterSize::Constraint(r_len, r_id) => { - let msg = format!( - "meta-variable `{}` repeats {} time{}, but `{}` repeats {} time{}", - l_id, - l_len, - pluralize!(l_len), - r_id, - r_len, - pluralize!(r_len), - ); - LockstepIterSize::Contradiction(msg) - } + LockstepIterSize::Constraint(r_len, r_id) => LockstepIterSize::Contradiction { + var1_id: l_id.to_string(), + var1_len: l_len, + var2_id: r_id.to_string(), + var2_len: r_len, + }, }, } } @@ -656,18 +654,7 @@ where /// Used by meta-variable expressions when an user input is out of the actual declared bounds. For /// example, index(999999) in an repetition of only three elements. fn out_of_bounds_err<'a>(dcx: DiagCtxtHandle<'a>, max: usize, span: Span, ty: &str) -> Diag<'a> { - let msg = if max == 0 { - format!( - "meta-variable expression `{ty}` with depth parameter \ - must be called inside of a macro repetition" - ) - } else { - format!( - "depth parameter of meta-variable expression `{ty}` \ - must be less than {max}" - ) - }; - dcx.struct_span_err(span, msg) + dcx.create_err(errors::MetaVarExprOutOfBounds { span, ty: ty.to_string(), max }) } fn transcribe_metavar_expr<'a>( @@ -715,10 +702,9 @@ fn transcribe_metavar_expr<'a>( let symbol = nfc_normalize(&concatenated); let concatenated_span = visited_span(); if !rustc_lexer::is_ident(symbol.as_str()) { - return Err(dcx.struct_span_err( - concatenated_span, - "`${concat(..)}` is not generating a valid identifier", - )); + return Err( + dcx.create_err(errors::ConcatGeneratedInvalidIdent { span: concatenated_span }) + ); } symbol_gallery.insert(symbol, concatenated_span); // The current implementation marks the span as coming from the macro regardless of @@ -773,7 +759,7 @@ fn extract_symbol_from_pnr<'a>( match pnr { ParseNtResult::Ident(nt_ident, is_raw) => { if let IdentIsRaw::Yes = is_raw { - Err(dcx.struct_span_err(span_err, RAW_IDENT_ERR)) + Err(dcx.create_err(errors::ConcatRawIdent { span: span_err })) } else { Ok(nt_ident.name) } @@ -783,7 +769,7 @@ fn extract_symbol_from_pnr<'a>( _, )) => { if let IdentIsRaw::Yes = is_raw { - Err(dcx.struct_span_err(span_err, RAW_IDENT_ERR)) + Err(dcx.create_err(errors::ConcatRawIdent { span: span_err })) } else { Ok(*symbol) } @@ -802,11 +788,6 @@ fn extract_symbol_from_pnr<'a>( { Ok(*symbol) } - _ => Err(dcx - .struct_err( - "metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`", - ) - .with_note("currently only string literals are supported") - .with_span(span_err)), + _ => Err(dcx.create_err(errors::InvalidConcatArgType { span: span_err })), } } diff --git a/tests/ui/lint/unused/unused-macro-with-follow-violation.stderr b/tests/ui/lint/unused/unused-macro-with-follow-violation.stderr index a8a41e081294a..e25fcfb9aa0a5 100644 --- a/tests/ui/lint/unused/unused-macro-with-follow-violation.stderr +++ b/tests/ui/lint/unused/unused-macro-with-follow-violation.stderr @@ -4,7 +4,7 @@ error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments LL | ($e:expr +) => () | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: aborting due to 1 previous error diff --git a/tests/ui/macros/macro-follow.stderr b/tests/ui/macros/macro-follow.stderr index 61ae79d235ee5..ccd3c4c45185d 100644 --- a/tests/ui/macros/macro-follow.stderr +++ b/tests/ui/macros/macro-follow.stderr @@ -4,7 +4,7 @@ error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments LL | ($p:pat ()) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:9:13 @@ -12,7 +12,7 @@ error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments LL | ($p:pat []) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:10:13 @@ -20,7 +20,7 @@ error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments LL | ($p:pat {}) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `:`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:11:13 @@ -28,7 +28,7 @@ error: `$p:pat` is followed by `:`, which is not allowed for `pat` fragments LL | ($p:pat :) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `>`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:12:13 @@ -36,7 +36,7 @@ error: `$p:pat` is followed by `>`, which is not allowed for `pat` fragments LL | ($p:pat >) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `+`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:13:13 @@ -44,7 +44,7 @@ error: `$p:pat` is followed by `+`, which is not allowed for `pat` fragments LL | ($p:pat +) => {}; | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `ident`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:14:13 @@ -52,7 +52,7 @@ error: `$p:pat` is followed by `ident`, which is not allowed for `pat` fragments LL | ($p:pat ident) => {}; | ^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$q:pat`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:15:13 @@ -60,7 +60,7 @@ error: `$p:pat` is followed by `$q:pat`, which is not allowed for `pat` fragment LL | ($p:pat $q:pat) => {}; | ^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$e:expr`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:16:13 @@ -68,7 +68,7 @@ error: `$p:pat` is followed by `$e:expr`, which is not allowed for `pat` fragmen LL | ($p:pat $e:expr) => {}; | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$t:ty`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:17:13 @@ -76,7 +76,7 @@ error: `$p:pat` is followed by `$t:ty`, which is not allowed for `pat` fragments LL | ($p:pat $t:ty) => {}; | ^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$s:stmt`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:18:13 @@ -84,7 +84,7 @@ error: `$p:pat` is followed by `$s:stmt`, which is not allowed for `pat` fragmen LL | ($p:pat $s:stmt) => {}; | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$q:path`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:19:13 @@ -92,7 +92,7 @@ error: `$p:pat` is followed by `$q:path`, which is not allowed for `pat` fragmen LL | ($p:pat $q:path) => {}; | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$b:block`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:20:13 @@ -100,7 +100,7 @@ error: `$p:pat` is followed by `$b:block`, which is not allowed for `pat` fragme LL | ($p:pat $b:block) => {}; | ^^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$i:ident`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:21:13 @@ -108,7 +108,7 @@ error: `$p:pat` is followed by `$i:ident`, which is not allowed for `pat` fragme LL | ($p:pat $i:ident) => {}; | ^^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$t:tt`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:22:13 @@ -116,7 +116,7 @@ error: `$p:pat` is followed by `$t:tt`, which is not allowed for `pat` fragments LL | ($p:pat $t:tt) => {}; | ^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$i:item`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:23:13 @@ -124,7 +124,7 @@ error: `$p:pat` is followed by `$i:item`, which is not allowed for `pat` fragmen LL | ($p:pat $i:item) => {}; | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$p:pat` is followed by `$m:meta`, which is not allowed for `pat` fragments --> $DIR/macro-follow.rs:24:13 @@ -132,7 +132,7 @@ error: `$p:pat` is followed by `$m:meta`, which is not allowed for `pat` fragmen LL | ($p:pat $m:meta) => {}; | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:28:14 @@ -140,7 +140,7 @@ error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments LL | ($e:expr ()) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:29:14 @@ -148,7 +148,7 @@ error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments LL | ($e:expr []) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:30:14 @@ -156,7 +156,7 @@ error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments LL | ($e:expr {}) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:31:14 @@ -164,7 +164,7 @@ error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments LL | ($e:expr =) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:32:14 @@ -172,7 +172,7 @@ error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments LL | ($e:expr |) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:33:14 @@ -180,7 +180,7 @@ error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments LL | ($e:expr :) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:34:14 @@ -188,7 +188,7 @@ error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments LL | ($e:expr >) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:35:14 @@ -196,7 +196,7 @@ error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments LL | ($e:expr +) => {}; | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:36:14 @@ -204,7 +204,7 @@ error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragmen LL | ($e:expr ident) => {}; | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:37:14 @@ -212,7 +212,7 @@ error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments LL | ($e:expr if) => {}; | ^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:38:14 @@ -220,7 +220,7 @@ error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments LL | ($e:expr in) => {}; | ^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:39:14 @@ -228,7 +228,7 @@ error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragme LL | ($e:expr $p:pat) => {}; | ^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$f:expr`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:40:14 @@ -236,7 +236,7 @@ error: `$e:expr` is followed by `$f:expr`, which is not allowed for `expr` fragm LL | ($e:expr $f:expr) => {}; | ^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:41:14 @@ -244,7 +244,7 @@ error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragmen LL | ($e:expr $t:ty) => {}; | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:42:14 @@ -252,7 +252,7 @@ error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragm LL | ($e:expr $s:stmt) => {}; | ^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:43:14 @@ -260,7 +260,7 @@ error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragm LL | ($e:expr $p:path) => {}; | ^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:44:14 @@ -268,7 +268,7 @@ error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` frag LL | ($e:expr $b:block) => {}; | ^^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:45:14 @@ -276,7 +276,7 @@ error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` frag LL | ($e:expr $i:ident) => {}; | ^^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:46:14 @@ -284,7 +284,7 @@ error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragmen LL | ($e:expr $t:tt) => {}; | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:47:14 @@ -292,7 +292,7 @@ error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragm LL | ($e:expr $i:item) => {}; | ^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragments --> $DIR/macro-follow.rs:48:14 @@ -300,7 +300,7 @@ error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragm LL | ($e:expr $m:meta) => {}; | ^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:53:12 @@ -308,7 +308,7 @@ error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments LL | ($t:ty ()) => {}; | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:55:12 @@ -316,7 +316,7 @@ error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments LL | ($t:ty +) => {}; | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:56:12 @@ -324,7 +324,7 @@ error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments LL | ($t:ty ident) => {}; | ^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:57:12 @@ -332,7 +332,7 @@ error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments LL | ($t:ty if) => {}; | ^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:58:12 @@ -340,7 +340,7 @@ error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments LL | ($t:ty $p:pat) => {}; | ^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:59:12 @@ -348,7 +348,7 @@ error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments LL | ($t:ty $e:expr) => {}; | ^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$r:ty`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:60:12 @@ -356,7 +356,7 @@ error: `$t:ty` is followed by `$r:ty`, which is not allowed for `ty` fragments LL | ($t:ty $r:ty) => {}; | ^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:61:12 @@ -364,7 +364,7 @@ error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments LL | ($t:ty $s:stmt) => {}; | ^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:62:12 @@ -372,7 +372,7 @@ error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments LL | ($t:ty $p:path) => {}; | ^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:64:12 @@ -380,7 +380,7 @@ error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragment LL | ($t:ty $i:ident) => {}; | ^^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$r:tt`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:65:12 @@ -388,7 +388,7 @@ error: `$t:ty` is followed by `$r:tt`, which is not allowed for `ty` fragments LL | ($t:ty $r:tt) => {}; | ^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:66:12 @@ -396,7 +396,7 @@ error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments LL | ($t:ty $i:item) => {}; | ^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments --> $DIR/macro-follow.rs:67:12 @@ -404,7 +404,7 @@ error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments LL | ($t:ty $m:meta) => {}; | ^^^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:71:14 @@ -412,7 +412,7 @@ error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments LL | ($s:stmt ()) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:72:14 @@ -420,7 +420,7 @@ error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments LL | ($s:stmt []) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:73:14 @@ -428,7 +428,7 @@ error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments LL | ($s:stmt {}) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:74:14 @@ -436,7 +436,7 @@ error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments LL | ($s:stmt =) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:75:14 @@ -444,7 +444,7 @@ error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments LL | ($s:stmt |) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:76:14 @@ -452,7 +452,7 @@ error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments LL | ($s:stmt :) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:77:14 @@ -460,7 +460,7 @@ error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments LL | ($s:stmt >) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:78:14 @@ -468,7 +468,7 @@ error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments LL | ($s:stmt +) => {}; | ^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:79:14 @@ -476,7 +476,7 @@ error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragmen LL | ($s:stmt ident) => {}; | ^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:80:14 @@ -484,7 +484,7 @@ error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments LL | ($s:stmt if) => {}; | ^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:81:14 @@ -492,7 +492,7 @@ error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments LL | ($s:stmt in) => {}; | ^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:82:14 @@ -500,7 +500,7 @@ error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragme LL | ($s:stmt $p:pat) => {}; | ^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:83:14 @@ -508,7 +508,7 @@ error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragm LL | ($s:stmt $e:expr) => {}; | ^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:84:14 @@ -516,7 +516,7 @@ error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragmen LL | ($s:stmt $t:ty) => {}; | ^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$t:stmt`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:85:14 @@ -524,7 +524,7 @@ error: `$s:stmt` is followed by `$t:stmt`, which is not allowed for `stmt` fragm LL | ($s:stmt $t:stmt) => {}; | ^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:86:14 @@ -532,7 +532,7 @@ error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragm LL | ($s:stmt $p:path) => {}; | ^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:87:14 @@ -540,7 +540,7 @@ error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` frag LL | ($s:stmt $b:block) => {}; | ^^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:88:14 @@ -548,7 +548,7 @@ error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` frag LL | ($s:stmt $i:ident) => {}; | ^^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:89:14 @@ -556,7 +556,7 @@ error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragmen LL | ($s:stmt $t:tt) => {}; | ^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:90:14 @@ -564,7 +564,7 @@ error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragm LL | ($s:stmt $i:item) => {}; | ^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragments --> $DIR/macro-follow.rs:91:14 @@ -572,7 +572,7 @@ error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragm LL | ($s:stmt $m:meta) => {}; | ^^^^^^^ not allowed after `stmt` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$p:path` is followed by `(`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:95:14 @@ -580,7 +580,7 @@ error: `$p:path` is followed by `(`, which is not allowed for `path` fragments LL | ($p:path ()) => {}; | ^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `+`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:97:14 @@ -588,7 +588,7 @@ error: `$p:path` is followed by `+`, which is not allowed for `path` fragments LL | ($p:path +) => {}; | ^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `ident`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:98:14 @@ -596,7 +596,7 @@ error: `$p:path` is followed by `ident`, which is not allowed for `path` fragmen LL | ($p:path ident) => {}; | ^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `if`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:99:14 @@ -604,7 +604,7 @@ error: `$p:path` is followed by `if`, which is not allowed for `path` fragments LL | ($p:path if) => {}; | ^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$q:pat`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:100:14 @@ -612,7 +612,7 @@ error: `$p:path` is followed by `$q:pat`, which is not allowed for `path` fragme LL | ($p:path $q:pat) => {}; | ^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:101:14 @@ -620,7 +620,7 @@ error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragm LL | ($p:path $e:expr) => {}; | ^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:102:14 @@ -628,7 +628,7 @@ error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragmen LL | ($p:path $t:ty) => {}; | ^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:103:14 @@ -636,7 +636,7 @@ error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragm LL | ($p:path $s:stmt) => {}; | ^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$q:path`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:104:14 @@ -644,7 +644,7 @@ error: `$p:path` is followed by `$q:path`, which is not allowed for `path` fragm LL | ($p:path $q:path) => {}; | ^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:106:14 @@ -652,7 +652,7 @@ error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` frag LL | ($p:path $i:ident) => {}; | ^^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:107:14 @@ -660,7 +660,7 @@ error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragmen LL | ($p:path $t:tt) => {}; | ^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:108:14 @@ -668,7 +668,7 @@ error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragm LL | ($p:path $i:item) => {}; | ^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragments --> $DIR/macro-follow.rs:109:14 @@ -676,7 +676,7 @@ error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragm LL | ($p:path $m:meta) => {}; | ^^^^^^^ not allowed after `path` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: aborting due to 85 previous errors diff --git a/tests/ui/macros/macro-followed-by-seq-bad.stderr b/tests/ui/macros/macro-followed-by-seq-bad.stderr index 7097979aeddf3..d6e11bc7a3eed 100644 --- a/tests/ui/macros/macro-followed-by-seq-bad.stderr +++ b/tests/ui/macros/macro-followed-by-seq-bad.stderr @@ -4,7 +4,7 @@ error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragmen LL | ( $a:expr $($b:tt)* ) => { }; | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$a:ty` is followed by `$b:tt`, which is not allowed for `ty` fragments --> $DIR/macro-followed-by-seq-bad.rs:8:13 @@ -12,7 +12,7 @@ error: `$a:ty` is followed by `$b:tt`, which is not allowed for `ty` fragments LL | ( $a:ty $($b:tt)* ) => { }; | ^^^^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro-input-future-proofing.stderr b/tests/ui/macros/macro-input-future-proofing.stderr index 542486927dfd1..7c4f6159bb09c 100644 --- a/tests/ui/macros/macro-input-future-proofing.stderr +++ b/tests/ui/macros/macro-input-future-proofing.stderr @@ -4,7 +4,7 @@ error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments LL | ($ty:ty <) => (); | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments --> $DIR/macro-input-future-proofing.rs:5:13 @@ -12,7 +12,7 @@ error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments LL | ($ty:ty < foo ,) => (); | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$pa:pat` is followed by `>`, which is not allowed for `pat` fragments --> $DIR/macro-input-future-proofing.rs:11:14 @@ -20,7 +20,7 @@ error: `$pa:pat` is followed by `>`, which is not allowed for `pat` fragments LL | ($pa:pat >) => (); | ^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$pa:pat` is followed by `$pb:pat`, which is not allowed for `pat` fragments --> $DIR/macro-input-future-proofing.rs:13:14 @@ -28,7 +28,7 @@ error: `$pa:pat` is followed by `$pb:pat`, which is not allowed for `pat` fragme LL | ($pa:pat $pb:pat $ty:ty ,) => (); | ^^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$pb:pat` is followed by `$ty:ty`, which is not allowed for `pat` fragments --> $DIR/macro-input-future-proofing.rs:13:22 @@ -36,7 +36,7 @@ error: `$pb:pat` is followed by `$ty:ty`, which is not allowed for `pat` fragmen LL | ($pa:pat $pb:pat $ty:ty ,) => (); | ^^^^^^ not allowed after `pat` fragments | - = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, or `in` error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments --> $DIR/macro-input-future-proofing.rs:16:17 @@ -44,7 +44,7 @@ error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments LL | ($($ty:ty)* -) => (); | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$b:ty` is followed by `-`, which is not allowed for `ty` fragments --> $DIR/macro-input-future-proofing.rs:17:23 @@ -52,7 +52,7 @@ error: `$b:ty` is followed by `-`, which is not allowed for `ty` fragments LL | ($($a:ty, $b:ty)* -) => (); | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments --> $DIR/macro-input-future-proofing.rs:18:15 @@ -60,7 +60,7 @@ error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments LL | ($($ty:ty)-+) => (); | ^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments --> $DIR/macro-input-future-proofing.rs:19:21 @@ -68,7 +68,7 @@ error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragmen LL | ( $($a:expr)* $($b:tt)* ) => { }; | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: aborting due to 9 previous errors diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr index a06487be3d601..378dae941cc62 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr @@ -6,7 +6,7 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | | | help: try a `pat_param` fragment specifier instead: `$x:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:32 @@ -16,7 +16,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | | | help: try a `pat_param` fragment specifier instead: `$x:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:7:36 @@ -26,7 +26,7 @@ LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | | | help: try a `pat_param` fragment specifier instead: `$pat:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: aborting due to 3 previous errors diff --git a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr index c3754dde080a3..89ef252576f14 100644 --- a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr +++ b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr @@ -6,7 +6,7 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | | | help: try a `pat_param` fragment specifier instead: `$x:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat2021-pattern-followed-by-or.rs:7:28 @@ -16,7 +16,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | | | help: try a `pat_param` fragment specifier instead: `$x:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat2021-pattern-followed-by-or.rs:9:35 @@ -26,7 +26,7 @@ LL | ( $expr:expr , $( $( $pat:pat)|+ => $expr_arm:pat),+ ) => { | | | help: try a `pat_param` fragment specifier instead: `$pat:pat_param` | - = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + = note: allowed there are: `=>`, `,`, `=`, `if`, or `in` error: aborting due to 3 previous errors diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr index 8ffda50523584..64cc692222963 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr @@ -3,7 +3,7 @@ error: unexpected token: $ | LL | ( $$ $a:ident ) => { | ^ - + | note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions --> $DIR/syntax-errors.rs:50:8 | @@ -141,7 +141,7 @@ error: unexpected token: { | LL | ( ${ len() } ) => { | ^^^^^^^^^ - + | note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions --> $DIR/syntax-errors.rs:92:8 | diff --git a/tests/ui/macros/same-sequence-span.stderr b/tests/ui/macros/same-sequence-span.stderr index 3242a32e2f4dd..f08a3fa47e3fa 100644 --- a/tests/ui/macros/same-sequence-span.stderr +++ b/tests/ui/macros/same-sequence-span.stderr @@ -4,7 +4,7 @@ error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fra LL | (1 $x:expr $($y:tt,)* | ^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:15:18 @@ -12,7 +12,7 @@ error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragmen LL | $(= $z:tt)* | ^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:19:1 @@ -26,7 +26,7 @@ LL | proc_macro_sequence::make_foo!(); | _in this macro invocation | | | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` = note: this error originates in the macro `proc_macro_sequence::make_foo` (in Nightly builds, run with -Z macro-backtrace for more info) error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments @@ -35,7 +35,7 @@ error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragmen LL | proc_macro_sequence::make_foo!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not allowed after `expr` fragments | - = note: allowed there are: `=>`, `,` or `;` + = note: allowed there are: `=>`, `,`, or `;` = note: this error originates in the macro `proc_macro_sequence::make_foo` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/tests/ui/type/pattern_types/macros.active.stderr b/tests/ui/type/pattern_types/macros.active.stderr index 002e944fe2ef3..fd524e73dda26 100644 --- a/tests/ui/type/pattern_types/macros.active.stderr +++ b/tests/ui/type/pattern_types/macros.active.stderr @@ -4,7 +4,7 @@ error: `$t:ty` is followed by `is`, which is not allowed for `ty` fragments LL | ($t:ty is $p:pat) => {}; | ^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: aborting due to 1 previous error diff --git a/tests/ui/type/pattern_types/macros.gated.stderr b/tests/ui/type/pattern_types/macros.gated.stderr index 002e944fe2ef3..fd524e73dda26 100644 --- a/tests/ui/type/pattern_types/macros.gated.stderr +++ b/tests/ui/type/pattern_types/macros.gated.stderr @@ -4,7 +4,7 @@ error: `$t:ty` is followed by `is`, which is not allowed for `ty` fragments LL | ($t:ty is $p:pat) => {}; | ^^ not allowed after `ty` fragments | - = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` + = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as`, or `where` error: aborting due to 1 previous error