diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs')
-rw-r--r-- | vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs index db7a40fcd..af1c73051 100644 --- a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs +++ b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs @@ -1,41 +1,24 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name REGIONAL_INDICATOR_REV --reverse --classes --minimize --anchored --premultiply --state-size 1 src/unicode/fsm/ \p{gcb=Regional_Indicator} +// regex-cli generate serialize dense dfa --minimize --start-kind anchored --reverse --no-captures --shrink --rustfmt --safe REGIONAL_INDICATOR_REV src/unicode/fsm/ \p{gcb=Regional_Indicator} // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static REGIONAL_INDICATOR_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{ + dfa::dense::DFA, + util::{lazy::Lazy, wire::AlignAs}, +}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("regional_indicator_rev.bigendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static REGIONAL_INDICATOR_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("regional_indicator_rev.littleendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); +pub static REGIONAL_INDICATOR_REV: Lazy<DFA<&'static [u32]>> = + Lazy::new(|| { + static ALIGNED: &AlignAs<[u8], u32> = &AlignAs { + _align: [], + #[cfg(target_endian = "big")] + bytes: *include_bytes!("regional_indicator_rev.bigendian.dfa"), + #[cfg(target_endian = "little")] + bytes: *include_bytes!("regional_indicator_rev.littleendian.dfa"), + }; + let (dfa, _) = DFA::from_bytes(&ALIGNED.bytes) + .expect("serialized DFA should be valid"); + dfa + }); |