├── .gitignore ├── rush.png ├── vendor ├── memchr │ ├── rustfmt.toml │ ├── COPYING │ ├── src │ │ ├── tests │ │ │ └── miri.rs │ │ ├── naive.rs │ │ ├── c.rs │ │ └── x86 │ │ │ └── sse42.rs │ ├── LICENSE-MIT │ ├── UNLICENSE │ ├── Cargo.toml │ ├── .cargo-checksum.json │ └── build.rs ├── regex │ ├── rustfmt.toml │ ├── tests │ │ ├── misc.rs │ │ ├── word_boundary_unicode.rs │ │ ├── suffix_reverse.rs │ │ ├── shortest_match.rs │ │ ├── word_boundary_ascii.rs │ │ ├── flags.rs │ │ ├── api_str.rs │ │ ├── test_nfa.rs │ │ ├── macros_bytes.rs │ │ ├── test_nfa_utf8bytes.rs │ │ ├── test_nfa_bytes.rs │ │ ├── test_backtrack.rs │ │ ├── test_backtrack_bytes.rs │ │ ├── macros_str.rs │ │ ├── test_backtrack_utf8bytes.rs │ │ ├── set.rs │ │ ├── test_crates_regex.rs │ │ ├── test_default_bytes.rs │ │ ├── noparse.rs │ │ └── searcher.rs │ ├── examples │ │ ├── regexdna-output.txt │ │ ├── shootout-regex-dna-replace.rs │ │ ├── shootout-regex-dna-single.rs │ │ ├── shootout-regex-dna.rs │ │ ├── shootout-regex-dna-bytes.rs │ │ └── shootout-regex-dna-single-cheat.rs │ ├── src │ │ ├── find_byte.rs │ │ ├── testdata │ │ │ ├── README │ │ │ ├── LICENSE │ │ │ └── nullsubexpr.dat │ │ ├── literal │ │ │ └── mod.rs │ │ ├── pattern.rs │ │ ├── sparse.rs │ │ └── error.rs │ ├── test │ └── LICENSE-MIT ├── aho-corasick │ ├── rustfmt.toml │ ├── COPYING │ ├── LICENSE-MIT │ ├── UNLICENSE │ ├── Cargo.toml │ ├── src │ │ └── packed │ │ │ └── teddy │ │ │ └── mod.rs │ └── .cargo-checksum.json ├── libc │ ├── src │ │ ├── hermit │ │ │ ├── aarch64.rs │ │ │ ├── x86_64.rs │ │ │ └── mod.rs │ │ ├── unix │ │ │ ├── hermit │ │ │ │ ├── aarch64.rs │ │ │ │ └── x86_64.rs │ │ │ ├── haiku │ │ │ │ ├── b32.rs │ │ │ │ └── b64.rs │ │ │ ├── align.rs │ │ │ ├── no_align.rs │ │ │ ├── uclibc │ │ │ │ ├── mips │ │ │ │ │ ├── mips64 │ │ │ │ │ │ ├── no_align.rs │ │ │ │ │ │ └── align.rs │ │ │ │ │ └── mips32 │ │ │ │ │ │ ├── no_align.rs │ │ │ │ │ │ └── align.rs │ │ │ │ ├── x86_64 │ │ │ │ │ ├── other.rs │ │ │ │ │ ├── l4re.rs │ │ │ │ │ └── no_align.rs │ │ │ │ ├── arm │ │ │ │ │ ├── no_align.rs │ │ │ │ │ └── align.rs │ │ │ │ └── no_align.rs │ │ │ ├── bsd │ │ │ │ ├── apple │ │ │ │ │ ├── b32 │ │ │ │ │ │ └── align.rs │ │ │ │ │ └── b64 │ │ │ │ │ │ └── align.rs │ │ │ │ ├── freebsdlike │ │ │ │ │ ├── freebsd │ │ │ │ │ │ ├── x86_64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── freebsd11 │ │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ │ ├── freebsd12 │ │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ │ ├── x86.rs │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ │ └── arm.rs │ │ │ │ │ └── dragonfly │ │ │ │ │ │ └── errno.rs │ │ │ │ └── netbsdlike │ │ │ │ │ ├── openbsd │ │ │ │ │ ├── sparc64.rs │ │ │ │ │ ├── x86.rs │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ └── x86_64.rs │ │ │ │ │ └── netbsd │ │ │ │ │ ├── sparc64.rs │ │ │ │ │ ├── x86.rs │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ ├── arm.rs │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ └── x86_64.rs │ │ │ ├── linux_like │ │ │ │ ├── android │ │ │ │ │ ├── b32 │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ └── b64 │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ └── align.rs │ │ │ │ ├── linux │ │ │ │ │ ├── gnu │ │ │ │ │ │ ├── b32 │ │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── sparc │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ ├── b64 │ │ │ │ │ │ │ ├── mips64 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── x86_64 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── powerpc64 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ ├── sparc64 │ │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── no_align.rs │ │ │ │ │ │ └── align.rs │ │ │ │ │ └── musl │ │ │ │ │ │ ├── b32 │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ ├── x86 │ │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ └── b64 │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ └── align.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ └── align.rs │ │ │ │ └── emscripten │ │ │ │ │ ├── no_align.rs │ │ │ │ │ └── align.rs │ │ │ ├── newlib │ │ │ │ ├── aarch64 │ │ │ │ │ └── mod.rs │ │ │ │ ├── arm │ │ │ │ │ └── mod.rs │ │ │ │ ├── no_align.rs │ │ │ │ └── align.rs │ │ │ └── solarish │ │ │ │ └── compat.rs │ │ ├── cloudabi │ │ │ ├── arm.rs │ │ │ ├── x86.rs │ │ │ ├── x86_64.rs │ │ │ └── aarch64.rs │ │ ├── vxworks │ │ │ ├── aarch64.rs │ │ │ ├── arm.rs │ │ │ ├── powerpc.rs │ │ │ ├── x86.rs │ │ │ ├── x86_64.rs │ │ │ └── powerpc64.rs │ │ ├── windows │ │ │ ├── msvc.rs │ │ │ └── gnu │ │ │ │ ├── align.rs │ │ │ │ └── mod.rs │ │ ├── fixed_width_ints.rs │ │ ├── sgx.rs │ │ ├── switch.rs │ │ └── fuchsia │ │ │ └── aarch64.rs │ ├── rustfmt.toml │ ├── tests │ │ └── const_fn.rs │ ├── LICENSE-MIT │ └── Cargo.toml ├── byteorder │ ├── COPYING │ ├── .cargo-checksum.json │ ├── LICENSE-MIT │ ├── UNLICENSE │ ├── Cargo.toml │ ├── README.md │ └── build.rs ├── regex-syntax │ ├── src │ │ ├── either.rs │ │ └── unicode_tables │ │ │ ├── perl_space.rs │ │ │ ├── mod.rs │ │ │ └── perl_decimal.rs │ ├── test │ ├── LICENSE-MIT │ ├── Cargo.toml │ └── benches │ │ └── bench.rs ├── lazy_static │ ├── tests │ │ └── no_std.rs │ ├── .cargo-checksum.json │ ├── src │ │ ├── core_lazy.rs │ │ └── inline_lazy.rs │ ├── LICENSE-MIT │ ├── Cargo.toml │ └── README.md ├── once_cell │ ├── examples │ │ ├── reentrant_init_deadlocks.rs │ │ ├── bench.rs │ │ ├── lazy_static.rs │ │ ├── test_synchronization.rs │ │ ├── bench_acquire.rs │ │ ├── bench_vs_lazy_static.rs │ │ └── regex.rs │ ├── LICENSE-MIT │ ├── .cargo-checksum.json │ ├── Cargo.toml │ └── README.md └── thread_local │ ├── benches │ └── thread_local.rs │ ├── .cargo-checksum.json │ ├── Cargo.toml │ ├── LICENSE-MIT │ ├── README.md │ └── src │ ├── thread_id.rs │ └── unreachable.rs ├── .cargo └── config ├── aarch64.nix ├── Cargo.toml ├── README.md ├── src ├── ixy82599 │ └── LICENSE ├── header.rs ├── main.rs ├── lib.rs └── basic_apps.rs ├── default.nix └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /rush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneia/rush/HEAD/rush.png -------------------------------------------------------------------------------- /vendor/memchr/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 79 2 | use_small_heuristics = "max" 3 | -------------------------------------------------------------------------------- /vendor/regex/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 79 2 | use_small_heuristics = "max" 3 | -------------------------------------------------------------------------------- /vendor/aho-corasick/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 79 2 | use_small_heuristics = "max" 3 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/hermit/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/hermit/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | -------------------------------------------------------------------------------- /vendor/libc/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 79 2 | comment_width = 79 3 | error_on_line_overflow = true -------------------------------------------------------------------------------- /vendor/libc/src/unix/haiku/b32.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type time_t = i32; 4 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/haiku/b64.rs: -------------------------------------------------------------------------------- 1 | pub type c_ulong = u64; 2 | pub type c_long = i64; 3 | pub type time_t = i64; 4 | -------------------------------------------------------------------------------- /.cargo/config: -------------------------------------------------------------------------------- 1 | [source.crates-io] 2 | replace-with = "vendored-sources" 3 | 4 | [source.vendored-sources] 5 | directory = "vendor" 6 | -------------------------------------------------------------------------------- /vendor/libc/src/cloudabi/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/cloudabi/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = i32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/cloudabi/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type wchar_t = i32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/powerpc.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/cloudabi/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type wchar_t = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | #[repr(align(4))] 3 | pub struct in6_addr { 4 | pub s6_addr: [u8; 16], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct in6_addr { 3 | pub s6_addr: [u8; 16], 4 | __align: [u32; 0], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/byteorder/COPYING: -------------------------------------------------------------------------------- 1 | This project is dual-licensed under the Unlicense and MIT licenses. 2 | 3 | You may use this code under the terms of either license. 4 | -------------------------------------------------------------------------------- /vendor/memchr/COPYING: -------------------------------------------------------------------------------- 1 | This project is dual-licensed under the Unlicense and MIT licenses. 2 | 3 | You may use this code under the terms of either license. 4 | -------------------------------------------------------------------------------- /vendor/aho-corasick/COPYING: -------------------------------------------------------------------------------- 1 | This project is dual-licensed under the Unlicense and MIT licenses. 2 | 3 | You may use this code under the terms of either license. 4 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/mips/mips64/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | __size: [::c_char; 32], 5 | __align: [::c_long; 0], 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b32/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 6] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: (i64, i64) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/x86_64/other.rs: -------------------------------------------------------------------------------- 1 | // Thestyle checker discourages the use of #[cfg], so this has to go into a 2 | // separate module 3 | pub type pthread_t = ::c_ulong; 4 | 5 | pub const PTHREAD_STACK_MIN: usize = 16384; 6 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | 5 | #[doc(hidden)] 6 | pub const _ALIGNBYTES: usize = 0xf; 7 | 8 | pub const _MAX_PAGE_SHIFT: u32 = 13; 9 | -------------------------------------------------------------------------------- /vendor/regex/tests/misc.rs: -------------------------------------------------------------------------------- 1 | mat!(prefix_literal_match, r"^abc", r"abc", Some((0, 3))); 2 | mat!(prefix_literal_nomatch, r"^abc", r"zabc", None); 3 | mat!(one_literal_edge, r"abc", r"xxxxxab", None); 4 | matiter!(terminates, r"a$", r"a", (0, 1)); 5 | -------------------------------------------------------------------------------- /aarch64.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? , source ? ./., version ? "dev", crossSystem ? null }: 2 | 3 | import ./default.nix { 4 | crossSystem = (import pkgs {}).lib.systems.examples.aarch64-multiplatform; 5 | source = source; 6 | version = version; 7 | } 8 | -------------------------------------------------------------------------------- /vendor/regex-syntax/src/either.rs: -------------------------------------------------------------------------------- 1 | /// A simple binary sum type. 2 | /// 3 | /// This is occasionally useful in an ad hoc fashion. 4 | #[derive(Clone, Debug, Eq, PartialEq)] 5 | pub enum Either { 6 | Left(Left), 7 | Right(Right), 8 | } 9 | -------------------------------------------------------------------------------- /vendor/libc/tests/const_fn.rs: -------------------------------------------------------------------------------- 1 | #![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty 2 | 3 | #[cfg(target_os = "linux")] 4 | const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; 5 | //^ if CMSG_SPACE is not const, this will fail to compile 6 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | #[doc(hidden)] 8 | pub const _ALIGNBYTES: usize = 0xf; 9 | -------------------------------------------------------------------------------- /vendor/regex/tests/word_boundary_unicode.rs: -------------------------------------------------------------------------------- 1 | // Unicode word boundaries know about Unicode characters. 2 | // For ASCII word boundaries, the tests are precisely inverted. 3 | matiter!(unicode1, r"\bx\b", "áxβ"); 4 | matiter!(unicode2, r"\Bx\B", "áxβ", (2, 3)); 5 | 6 | matiter!(ascii1, r"(?-u:\b)x(?-u:\b)", "áxβ", (2, 3)); 7 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rush" 3 | version = "0.1.0" 4 | authors = ["Max Rottenkolber "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | regex = "1" 11 | once_cell = "1.3.1" 12 | libc = "0.2" 13 | byteorder = "1" 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/arm/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/mips/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | __size: [::c_char; 32], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/mips/mips32/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/regex/examples/regexdna-output.txt: -------------------------------------------------------------------------------- 1 | agggtaaa|tttaccct 0 2 | [cgt]gggtaaa|tttaccc[acg] 3 3 | a[act]ggtaaa|tttacc[agt]t 9 4 | ag[act]gtaaa|tttac[agt]ct 8 5 | agg[act]taaa|ttta[agt]cct 10 6 | aggg[acg]aaa|ttt[cgt]ccct 3 7 | agggt[cgt]aa|tt[acg]accct 4 8 | agggta[cgt]a|t[acg]taccct 3 9 | agggtaa[cgt]|[acg]ttaccct 5 10 | 11 | 101745 12 | 100000 13 | 133640 14 | -------------------------------------------------------------------------------- /vendor/regex/tests/suffix_reverse.rs: -------------------------------------------------------------------------------- 1 | mat!(t01, r".*abcd", r"abcd", Some((0, 4))); 2 | mat!(t02, r".*(?:abcd)+", r"abcd", Some((0, 4))); 3 | mat!(t03, r".*(?:abcd)+", r"abcdabcd", Some((0, 8))); 4 | mat!(t04, r".*(?:abcd)+", r"abcdxabcd", Some((0, 9))); 5 | mat!(t05, r".*x(?:abcd)+", r"abcdxabcd", Some((0, 9))); 6 | mat!(t06, r"[^abcd]*x(?:abcd)+", r"abcdxabcd", Some((4, 9))); 7 | -------------------------------------------------------------------------------- /vendor/lazy_static/tests/no_std.rs: -------------------------------------------------------------------------------- 1 | #![cfg(feature="spin_no_std")] 2 | 3 | #![no_std] 4 | 5 | #[macro_use] 6 | extern crate lazy_static; 7 | 8 | lazy_static! { 9 | /// Documentation! 10 | pub static ref NUMBER: u32 = times_two(3); 11 | } 12 | 13 | fn times_two(n: u32) -> u32 { 14 | n * 2 15 | } 16 | 17 | #[test] 18 | fn test_basic() { 19 | assert_eq!(*NUMBER, 6); 20 | } 21 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs: -------------------------------------------------------------------------------- 1 | // DragonFlyBSD's __error function is declared with "static inline", so it must 2 | // be implemented in the libc crate, as a pointer to a static thread_local. 3 | f! { 4 | pub fn __error() -> *mut ::c_int { 5 | &mut errno 6 | } 7 | } 8 | 9 | extern "C" { 10 | #[thread_local] 11 | pub static mut errno: ::c_int; 12 | } 13 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/reentrant_init_deadlocks.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let cell = once_cell::sync::OnceCell::::new(); 3 | cell.get_or_init(|| { 4 | cell.get_or_init(|| 1); 5 | 2 6 | }); 7 | } 8 | 9 | /// Dummy test to make it seem hang when compiled as `--test` 10 | /// See https://github.com/matklad/once_cell/issues/79 11 | #[test] 12 | fn dummy_test() { 13 | std::thread::sleep(std::time::Duration::from_secs(4)); 14 | } 15 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/arm/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/mips/mips32/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | cfg_if! { 8 | if #[cfg(libc_const_size_of)] { 9 | #[doc(hidden)] 10 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 11 | } else { 12 | #[doc(hidden)] 13 | pub const _ALIGNBYTES: usize = 4 - 1; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 4 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = u8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 8 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/regex-syntax/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a convenience script for running a broad swath of the syntax tests. 4 | echo "===== DEFAULT FEATURES ===" 5 | cargo test 6 | 7 | features=( 8 | unicode 9 | unicode-age 10 | unicode-bool 11 | unicode-case 12 | unicode-gencat 13 | unicode-perl 14 | unicode-script 15 | unicode-segment 16 | ) 17 | for f in "${features[@]}"; do 18 | echo "===== FEATURE: $f ===" 19 | cargo test --no-default-features --features "$f" 20 | done 21 | -------------------------------------------------------------------------------- /vendor/regex/tests/shortest_match.rs: -------------------------------------------------------------------------------- 1 | macro_rules! shortmat { 2 | ($name:ident, $re:expr, $text:expr, $shortest_match:expr) => { 3 | #[test] 4 | fn $name() { 5 | let text = text!($text); 6 | let re = regex!($re); 7 | assert_eq!($shortest_match, re.shortest_match(text)); 8 | } 9 | }; 10 | } 11 | 12 | shortmat!(t01, r"a+", r"aa", Some(1)); 13 | // Test that the reverse suffix optimization gets it right. 14 | shortmat!(t02, r".*(?:abcd)+", r"abcdabcd", Some(4)); 15 | -------------------------------------------------------------------------------- /vendor/regex/tests/word_boundary_ascii.rs: -------------------------------------------------------------------------------- 1 | // ASCII word boundaries are completely oblivious to Unicode characters. 2 | // For Unicode word boundaries, the tests are precisely inverted. 3 | matiter!(ascii1, r"(?-u:\b)x(?-u:\b)", "áxβ", (2, 3)); 4 | matiter!(ascii2, r"(?-u:\B)x(?-u:\B)", "áxβ"); 5 | matiter!(ascii3, r"(?-u:\B)", "0\u{7EF5E}", (2, 2), (3, 3), (4, 4), (5, 5)); 6 | 7 | // We still get Unicode word boundaries by default in byte regexes. 8 | matiter!(unicode1, r"\bx\b", "áxβ"); 9 | matiter!(unicode2, r"\Bx\B", "áxβ", (2, 3)); 10 | -------------------------------------------------------------------------------- /vendor/thread_local/benches/thread_local.rs: -------------------------------------------------------------------------------- 1 | #![feature(test)] 2 | 3 | extern crate thread_local; 4 | extern crate test; 5 | 6 | use thread_local::{ThreadLocal, CachedThreadLocal}; 7 | 8 | #[bench] 9 | fn thread_local(b: &mut test::Bencher) { 10 | let local = ThreadLocal::new(); 11 | b.iter(|| { let _: &i32 = local.get_or(|| Box::new(0)); }); 12 | } 13 | 14 | #[bench] 15 | fn cached_thread_local(b: &mut test::Bencher) { 16 | let local = CachedThreadLocal::new(); 17 | b.iter(|| { let _: &i32 = local.get_or(|| Box::new(0)); }); 18 | } 19 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/msvc.rs: -------------------------------------------------------------------------------- 1 | pub const L_tmpnam: ::c_uint = 260; 2 | pub const TMP_MAX: ::c_uint = 0x7fff_ffff; 3 | 4 | // POSIX Supplement (from errno.h) 5 | // This particular error code is only currently available in msvc toolchain 6 | pub const EOTHER: ::c_int = 131; 7 | 8 | extern "C" { 9 | #[link_name = "_stricmp"] 10 | pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; 11 | #[link_name = "_strnicmp"] 12 | pub fn strnicmp( 13 | s1: *const ::c_char, 14 | s2: *const ::c_char, 15 | n: ::size_t, 16 | ) -> ::c_int; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/regex/examples/shootout-regex-dna-replace.rs: -------------------------------------------------------------------------------- 1 | extern crate regex; 2 | 3 | use std::io::{self, Read}; 4 | 5 | macro_rules! regex { 6 | ($re:expr) => {{ 7 | use regex::internal::ExecBuilder; 8 | ExecBuilder::new($re).build().unwrap().into_regex() 9 | }}; 10 | } 11 | 12 | fn main() { 13 | let mut seq = String::with_capacity(50 * (1 << 20)); 14 | io::stdin().read_to_string(&mut seq).unwrap(); 15 | let ilen = seq.len(); 16 | 17 | seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); 18 | println!("original: {}, replaced: {}", ilen, seq.len()); 19 | } 20 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/gnu/align.rs: -------------------------------------------------------------------------------- 1 | cfg_if! { 2 | if #[cfg(target_pointer_width = "64")] { 3 | s_no_extra_traits! { 4 | #[allow(missing_debug_implementations)] 5 | #[repr(align(16))] 6 | pub struct max_align_t { 7 | priv_: [f64; 4] 8 | } 9 | } 10 | } else if #[cfg(target_pointer_width = "32")] { 11 | s_no_extra_traits! { 12 | #[allow(missing_debug_implementations)] 13 | #[repr(align(16))] 14 | pub struct max_align_t { 15 | priv_: [i64; 6] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/gnu/mod.rs: -------------------------------------------------------------------------------- 1 | pub const L_tmpnam: ::c_uint = 14; 2 | pub const TMP_MAX: ::c_uint = 0x7fff; 3 | 4 | // stdio file descriptor numbers 5 | pub const STDIN_FILENO: ::c_int = 0; 6 | pub const STDOUT_FILENO: ::c_int = 1; 7 | pub const STDERR_FILENO: ::c_int = 2; 8 | 9 | extern "C" { 10 | pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; 11 | pub fn strncasecmp( 12 | s1: *const ::c_char, 13 | s2: *const ::c_char, 14 | n: ::size_t, 15 | ) -> ::c_int; 16 | } 17 | 18 | cfg_if! { 19 | if #[cfg(libc_align)] { 20 | mod align; 21 | pub use self::align::*; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type time_t = i64; 5 | pub type suseconds_t = i64; 6 | 7 | // should be pub(crate), but that requires Rust 1.18.0 8 | cfg_if! { 9 | if #[cfg(libc_const_size_of)] { 10 | #[doc(hidden)] 11 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 12 | } else { 13 | #[doc(hidden)] 14 | pub const _ALIGNBYTES: usize = 8 - 1; 15 | } 16 | } 17 | pub const MAP_32BIT: ::c_int = 0x00080000; 18 | 19 | cfg_if! { 20 | if #[cfg(libc_align)] { 21 | mod align; 22 | pub use self::align::*; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | pub type c_char = u8; 6 | pub type __cpu_simple_lock_nv_t = ::c_int; 7 | 8 | // should be pub(crate), but that requires Rust 1.18.0 9 | cfg_if! { 10 | if #[cfg(libc_const_size_of)] { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; 13 | } else { 14 | #[doc(hidden)] 15 | pub const _ALIGNBYTES: usize = 8 - 1; 16 | } 17 | } 18 | 19 | pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; 20 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 21 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 22 | -------------------------------------------------------------------------------- /vendor/regex/src/find_byte.rs: -------------------------------------------------------------------------------- 1 | /// Searches for the given needle in the given haystack. 2 | /// 3 | /// If the perf-literal feature is enabled, then this uses the super optimized 4 | /// memchr crate. Otherwise, it uses the naive byte-at-a-time implementation. 5 | pub fn find_byte(needle: u8, haystack: &[u8]) -> Option { 6 | #[cfg(not(feature = "perf-literal"))] 7 | fn imp(needle: u8, haystack: &[u8]) -> Option { 8 | haystack.iter().position(|&b| b == needle) 9 | } 10 | 11 | #[cfg(feature = "perf-literal")] 12 | fn imp(needle: u8, haystack: &[u8]) -> Option { 13 | use memchr::memchr; 14 | memchr(needle, haystack) 15 | } 16 | 17 | imp(needle, haystack) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/regex-syntax/src/unicode_tables/perl_space.rs: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: 2 | // 3 | // ucd-generate property-bool ucd-13.0.0 --chars --include whitespace 4 | // 5 | // ucd-generate 0.2.7 is available on crates.io. 6 | 7 | pub const BY_NAME: &'static [(&'static str, &'static [(char, char)])] = 8 | &[("White_Space", WHITE_SPACE)]; 9 | 10 | pub const WHITE_SPACE: &'static [(char, char)] = &[ 11 | ('\t', '\r'), 12 | (' ', ' '), 13 | ('\u{85}', '\u{85}'), 14 | ('\u{a0}', '\u{a0}'), 15 | ('\u{1680}', '\u{1680}'), 16 | ('\u{2000}', '\u{200a}'), 17 | ('\u{2028}', '\u{2029}'), 18 | ('\u{202f}', '\u{202f}'), 19 | ('\u{205f}', '\u{205f}'), 20 | ('\u{3000}', '\u{3000}'), 21 | ]; 22 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | pub type c_char = u8; 6 | pub type __cpu_simple_lock_nv_t = ::c_int; 7 | 8 | // should be pub(crate), but that requires Rust 1.18.0 9 | cfg_if! { 10 | if #[cfg(libc_const_size_of)] { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; 13 | } else { 14 | #[doc(hidden)] 15 | pub const _ALIGNBYTES: usize = 8 - 1; 16 | } 17 | } 18 | 19 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 20 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 21 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; 22 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; 23 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | pub type c_char = u8; 6 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 7 | 8 | // should be pub(crate), but that requires Rust 1.18.0 9 | cfg_if! { 10 | if #[cfg(libc_const_size_of)] { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 13 | } else { 14 | #[doc(hidden)] 15 | pub const _ALIGNBYTES: usize = 4 - 1; 16 | } 17 | } 18 | 19 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0; 20 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1; 21 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2; 22 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3; 23 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | pub type c_char = i8; 6 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 7 | 8 | // should be pub(crate), but that requires Rust 1.18.0 9 | cfg_if! { 10 | if #[cfg(libc_const_size_of)] { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 13 | } else { 14 | #[doc(hidden)] 15 | pub const _ALIGNBYTES: usize = 8 - 1; 16 | } 17 | } 18 | 19 | pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; 20 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 21 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 22 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; 23 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; 24 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | pub type c_char = i8; 6 | 7 | // should be pub(crate), but that requires Rust 1.18.0 8 | cfg_if! { 9 | if #[cfg(libc_const_size_of)] { 10 | #[doc(hidden)] 11 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 12 | } else { 13 | #[doc(hidden)] 14 | pub const _ALIGNBYTES: usize = 8 - 1; 15 | } 16 | } 17 | 18 | pub const _MAX_PAGE_SHIFT: u32 = 12; 19 | 20 | pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; 21 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 22 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 23 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; 24 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; 25 | -------------------------------------------------------------------------------- /vendor/regex/src/testdata/README: -------------------------------------------------------------------------------- 1 | Test data was taken from the Go distribution, which was in turn taken from the 2 | testregex test suite: 3 | 4 | http://www2.research.att.com/~astopen/testregex/testregex.html 5 | 6 | The LICENSE in this directory corresponds to the LICENSE that the data was 7 | released under. 8 | 9 | The tests themselves were modified for RE2/Go. A couple were modified further 10 | by me (Andrew Gallant) (only in repetition.dat) so that RE2/Go would pass them. 11 | (Yes, it seems like RE2/Go includes failing test cases.) This may or may not 12 | have been a bad idea, but I think being consistent with an established Regex 13 | library is worth something. 14 | 15 | Note that these files are read by 'scripts/regex-match-tests.py' and turned 16 | into Rust tests found in 'regex_macros/tests/matches.rs'. 17 | 18 | -------------------------------------------------------------------------------- /vendor/lazy_static/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"05e37a4e63dc4a495998bb5133252a51d671c4e99061a6342089ed6eab43978a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"e2effacb5bbd7c01523f9a9e4a6a59c0f9b8698753b210fec5742408498197df","src/core_lazy.rs":"6b9fb6a4f553058e240756125b6b9ca43a83ed1fb72964343038ea0ea2e1af10","src/inline_lazy.rs":"f6184afbca4b477616f270790edc180263be806aa92ef0a9de681b4aac9e88c4","src/lib.rs":"99096a5d3089c0d86646f0805d1455befe2cb09683704af29c5c9d99ecab2683","tests/no_std.rs":"d68b149ee51ef5ae2b2906c0c94f5a9812d3b02811b13365c5a35e2ef90d25cf","tests/test.rs":"b3f7d805375dc5af7a2aa4b869944ad2ab4fc982b35ad718ea58f6914dc0a698"},"package":"e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"} -------------------------------------------------------------------------------- /vendor/thread_local/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"a08d3007cec7ad1a83afad57980965ece5457089404f6f5d41eacc8143386d69","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"ab6f09e96c06e37ee3df492562a07c1c3548dd5abf73301f8215a5dcedcccc84","benches/thread_local.rs":"cc8bde81ed6206525feff209598caf1e01e89a83bf21d8b7ccc0dadc8b89d815","src/cached.rs":"089286aa7bcde7c92b1ee7381b74f8c30049c0d80a85c1babdbac69b2e210396","src/lib.rs":"a67d7bf8c7c3bd869ea297cf1d158db8c9c4bbf7ae1e23d9028cfc3a7554e235","src/thread_id.rs":"0962c130061939557aa272115e4420fbbc63b6bd306783a456a8ffcbf304a447","src/unreachable.rs":"830d44988f86f4fc6c3c4dd7e9e4e7d0f2cb9c5b024c360b5f7ceae365983367"},"package":"d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"} -------------------------------------------------------------------------------- /vendor/memchr/src/tests/miri.rs: -------------------------------------------------------------------------------- 1 | // Simple tests using MIRI 2 | 3 | use crate::{memchr, memchr2, memchr3, memrchr, memrchr2, memrchr3}; 4 | 5 | #[test] 6 | fn test_with_miri() { 7 | assert_eq!(memchr(b'a', b"abcda"), Some(0)); 8 | assert_eq!(memchr(b'z', b"abcda"), None); 9 | assert_eq!(memchr2(b'a', b'z', b"abcda"), Some(0)); 10 | assert_eq!(memchr2(b'z', b'y', b"abcda"), None); 11 | assert_eq!(memchr3(b'a', b'z', b'b', b"abcda"), Some(0)); 12 | assert_eq!(memchr3(b'z', b'y', b'x', b"abcda"), None); 13 | assert_eq!(memrchr(b'a', b"abcda"), Some(4)); 14 | assert_eq!(memrchr(b'z', b"abcda"), None); 15 | assert_eq!(memrchr2(b'a', b'z', b"abcda"), Some(4)); 16 | assert_eq!(memrchr2(b'z', b'y', b"abcda"), None); 17 | assert_eq!(memrchr3(b'a', b'z', b'b', b"abcda"), Some(4)); 18 | assert_eq!(memrchr3(b'z', b'y', b'x', b"abcda"), None); 19 | } 20 | -------------------------------------------------------------------------------- /vendor/memchr/src/naive.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | pub fn memchr(n1: u8, haystack: &[u8]) -> Option { 4 | haystack.iter().position(|&b| b == n1) 5 | } 6 | 7 | pub fn memchr2(n1: u8, n2: u8, haystack: &[u8]) -> Option { 8 | haystack.iter().position(|&b| b == n1 || b == n2) 9 | } 10 | 11 | pub fn memchr3(n1: u8, n2: u8, n3: u8, haystack: &[u8]) -> Option { 12 | haystack.iter().position(|&b| b == n1 || b == n2 || b == n3) 13 | } 14 | 15 | pub fn memrchr(n1: u8, haystack: &[u8]) -> Option { 16 | haystack.iter().rposition(|&b| b == n1) 17 | } 18 | 19 | pub fn memrchr2(n1: u8, n2: u8, haystack: &[u8]) -> Option { 20 | haystack.iter().rposition(|&b| b == n1 || b == n2) 21 | } 22 | 23 | pub fn memrchr3(n1: u8, n2: u8, n3: u8, haystack: &[u8]) -> Option { 24 | haystack.iter().rposition(|&b| b == n1 || b == n2 || b == n3) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/byteorder/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"CHANGELOG.md":"51f0eb3b6139fc1a908d41a7b3cba7d58d684700986b3518f82e5af254c39e8e","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"fb8b84be3b93b1aa065558cf9f8a867e1fc0f9bda8323d686ece79bbcfe50868","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"b2dd89866b56f619661b90e8b3b7d3f741b0a8d5710e229df86843ae0881284f","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"80e43e07f34bc6d3ebe4f37cea79ba02cafce6cf30b737a1db65de55f2c38ca5","build.rs":"9671089eb30f52975911effd1fa0b30a0ab14473f44a315af0bafd6701dda6da","src/io.rs":"8f22d1b0e01fa4ce9c7c5cd727dbc40ca35c22d9c82fe8d324d9d83d37cdcc4a","src/lib.rs":"c43331d25d0d12e150b64137d6f180ae46a8c41124a374e4f62d2867482bd3d8"},"package":"08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"} -------------------------------------------------------------------------------- /vendor/libc/src/fixed_width_ints.rs: -------------------------------------------------------------------------------- 1 | //! This module contains type aliases for C's fixed-width integer types . 2 | //! 3 | //! These aliases are deprecated: use the Rust types instead. 4 | 5 | #[deprecated(since = "0.2.55", note = "Use i8 instead.")] 6 | pub type int8_t = i8; 7 | #[deprecated(since = "0.2.55", note = "Use i16 instead.")] 8 | pub type int16_t = i16; 9 | #[deprecated(since = "0.2.55", note = "Use i32 instead.")] 10 | pub type int32_t = i32; 11 | #[deprecated(since = "0.2.55", note = "Use i64 instead.")] 12 | pub type int64_t = i64; 13 | #[deprecated(since = "0.2.55", note = "Use u8 instead.")] 14 | pub type uint8_t = u8; 15 | #[deprecated(since = "0.2.55", note = "Use u16 instead.")] 16 | pub type uint16_t = u16; 17 | #[deprecated(since = "0.2.55", note = "Use u32 instead.")] 18 | pub type uint32_t = u32; 19 | #[deprecated(since = "0.2.55", note = "Use u64 instead.")] 20 | pub type uint64_t = u64; 21 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/aarch64/mod.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | 4 | pub type c_long = i64; 5 | pub type c_ulong = u64; 6 | 7 | s! { 8 | pub struct sockaddr { 9 | pub sa_len: u8, 10 | pub sa_family: ::sa_family_t, 11 | pub sa_data: [::c_char; 14], 12 | } 13 | 14 | pub struct sockaddr_in6 { 15 | pub sin6_len: u8, 16 | pub sin6_family: ::sa_family_t, 17 | pub sin6_port: ::in_port_t, 18 | pub sin6_flowinfo: u32, 19 | pub sin6_addr: ::in6_addr, 20 | pub sin6_scope_id: u32, 21 | } 22 | 23 | pub struct sockaddr_in { 24 | pub sin_len: u8, 25 | pub sin_family: ::sa_family_t, 26 | pub sin_port: ::in_port_t, 27 | pub sin_addr: ::in_addr, 28 | pub sin_zero: [::c_char; 8], 29 | } 30 | } 31 | 32 | pub const POLLOUT: ::c_short = 0x4; 33 | pub const POLLHUP: ::c_short = 0x10; 34 | -------------------------------------------------------------------------------- /vendor/regex/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a convenience script for running a broad swath of tests across 4 | # features. We don't test the complete space, since the complete space is quite 5 | # large. Hopefully once we migrate the test suite to better infrastructure 6 | # (like regex-automata), we'll be able to test more of the space. 7 | echo "===== DEFAULT FEATURES ===" 8 | cargo test 9 | 10 | echo "===== DOC TESTS ===" 11 | cargo test --doc 12 | 13 | features=( 14 | "std" 15 | "std unicode" 16 | "std unicode-perl" 17 | "std perf" 18 | "std perf-cache" 19 | "std perf-dfa" 20 | "std perf-inline" 21 | "std perf-literal" 22 | ) 23 | for f in "${features[@]}"; do 24 | echo "===== FEATURE: $f (default) ===" 25 | cargo test --test default --no-default-features --features "$f" 26 | echo "===== FEATURE: $f (default-bytes) ===" 27 | cargo test --test default-bytes --no-default-features --features "$f" 28 | done 29 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/arm/mod.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | 4 | pub type c_long = i32; 5 | pub type c_ulong = u32; 6 | 7 | s! { 8 | pub struct sockaddr { 9 | pub sa_family: ::sa_family_t, 10 | pub sa_data: [::c_char; 14], 11 | } 12 | 13 | pub struct sockaddr_in6 { 14 | pub sin6_family: ::sa_family_t, 15 | pub sin6_port: ::in_port_t, 16 | pub sin6_flowinfo: u32, 17 | pub sin6_addr: ::in6_addr, 18 | pub sin6_scope_id: u32, 19 | } 20 | 21 | pub struct sockaddr_in { 22 | pub sin_family: ::sa_family_t, 23 | pub sin_port: ::in_port_t, 24 | pub sin_addr: ::in_addr, 25 | pub sin_zero: [u8; 8], 26 | } 27 | 28 | pub struct sockaddr_storage { 29 | pub ss_family: ::sa_family_t, 30 | pub __ss_padding: [u8; 26], 31 | } 32 | } 33 | 34 | pub const POLLOUT: ::c_short = 0x10; 35 | pub const POLLHUP: ::c_short = 0x4; 36 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/solarish/compat.rs: -------------------------------------------------------------------------------- 1 | // Common functions that are unfortunately missing on illumos and 2 | // Solaris, but often needed by other crates. 3 | 4 | use unix::solarish::*; 5 | 6 | pub unsafe fn cfmakeraw(termios: *mut ::termios) { 7 | let mut t = *termios as ::termios; 8 | t.c_iflag &= !(IMAXBEL 9 | | IGNBRK 10 | | BRKINT 11 | | PARMRK 12 | | ISTRIP 13 | | INLCR 14 | | IGNCR 15 | | ICRNL 16 | | IXON); 17 | t.c_oflag &= !OPOST; 18 | t.c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); 19 | t.c_cflag &= !(CSIZE | PARENB); 20 | t.c_cflag |= CS8; 21 | } 22 | 23 | pub unsafe fn cfsetspeed( 24 | termios: *mut ::termios, 25 | speed: ::speed_t, 26 | ) -> ::c_int { 27 | // Neither of these functions on illumos or Solaris actually ever 28 | // return an error 29 | ::cfsetispeed(termios, speed); 30 | ::cfsetospeed(termios, speed); 31 | 0 32 | } 33 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/bench.rs: -------------------------------------------------------------------------------- 1 | use std::mem::size_of; 2 | 3 | use once_cell::sync::OnceCell; 4 | 5 | const N_THREADS: usize = 32; 6 | const N_ROUNDS: usize = 100_000_000; 7 | 8 | static CELL: OnceCell = OnceCell::new(); 9 | 10 | fn main() { 11 | let start = std::time::Instant::now(); 12 | let threads = 13 | (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); 14 | for thread in threads { 15 | thread.join().unwrap(); 16 | } 17 | println!("{:?}", start.elapsed()); 18 | println!("size_of::>() = {:?}", size_of::>()); 19 | println!("size_of::>() = {:?}", size_of::>()); 20 | println!("size_of::>() = {:?}", size_of::>()); 21 | } 22 | 23 | fn thread_main(i: usize) { 24 | for _ in 0..N_ROUNDS { 25 | let &value = CELL.get_or_init(|| i); 26 | assert!(value < N_THREADS) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/lazy_static/src/core_lazy.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2016 lazy-static.rs Developers 2 | // 3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be 6 | // copied, modified, or distributed except according to those terms. 7 | 8 | extern crate spin; 9 | 10 | use self::spin::Once; 11 | 12 | pub struct Lazy(Once); 13 | 14 | impl Lazy { 15 | pub const INIT: Self = Lazy(Once::INIT); 16 | 17 | #[inline(always)] 18 | pub fn get(&'static self, builder: F) -> &T 19 | where F: FnOnce() -> T 20 | { 21 | self.0.call_once(builder) 22 | } 23 | } 24 | 25 | #[macro_export] 26 | #[doc(hidden)] 27 | macro_rules! __lazy_static_create { 28 | ($NAME:ident, $T:ty) => { 29 | static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_mode: ::mode_t, 7 | pub st_nlink: ::nlink_t, 8 | pub st_uid: ::uid_t, 9 | pub st_gid: ::gid_t, 10 | pub st_rdev: ::dev_t, 11 | pub st_atime: ::time_t, 12 | pub st_atime_nsec: ::c_long, 13 | pub st_mtime: ::time_t, 14 | pub st_mtime_nsec: ::c_long, 15 | pub st_ctime: ::time_t, 16 | pub st_ctime_nsec: ::c_long, 17 | pub st_size: ::off_t, 18 | pub st_blocks: ::blkcnt_t, 19 | pub st_blksize: ::blksize_t, 20 | pub st_flags: ::fflags_t, 21 | pub st_gen: u32, 22 | pub st_lspare: i32, 23 | pub st_birthtime: ::time_t, 24 | pub st_birthtime_nsec: ::c_long, 25 | } 26 | 27 | impl ::Copy for ::stat {} 28 | impl ::Clone for ::stat { 29 | fn clone(&self) -> ::stat { 30 | *self 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Rush](rush.png) 2 | 3 | # Rush: a simple, fast software networking toolkit written in Rust 4 | 5 | Rush is a simple but fast toolkit for writing high-performance networking 6 | applications in userspace using Rust. 7 | 8 | Rush uses [kernel-bypass networking](https://github.com/lukego/blog/issues/13) 9 | and [simple, efficient data structures](https://github.com/lukego/blog/issues/11) 10 | to help you get the most out of your hardware. 11 | 12 | Rush is [Snabb](https://github.com/snabbco/snabb/) written in Rust. It doesn’t 13 | have all the bells and whistles of its big sibling Snabb, but it’s lean and 14 | just as fast! 15 | 16 | ## Uses in the Wild 17 | 18 | Rush was used to build [Synthetic Network](https://www.daily.co/blog/using-docker-and-userspace-networking-to-simulate-real-world-networks/), 19 | a tool for simulating realistic network conditions to containerized 20 | applications. 21 | 22 | 23 | ## Screencast 24 | 25 | **[Screencast on porting Snabb to Rust](https://mr.gy/screen/rush/)** 26 | -------------------------------------------------------------------------------- /vendor/regex/tests/flags.rs: -------------------------------------------------------------------------------- 1 | mat!(match_flag_case, "(?-u)(?i)abc", "ABC", Some((0, 3))); 2 | mat!(match_flag_weird_case, "(?-u)(?i)a(?-i)bc", "Abc", Some((0, 3))); 3 | mat!(match_flag_weird_case_not, "(?-u)(?i)a(?-i)bc", "ABC", None); 4 | mat!(match_flag_case_dotnl, "(?-u)(?is)a(?u:.)", "A\n", Some((0, 2))); 5 | mat!( 6 | match_flag_case_dotnl_toggle, 7 | "(?-u)(?is)a(?u:.)(?-is)a(?u:.)", 8 | "A\nab", 9 | Some((0, 4)) 10 | ); 11 | mat!( 12 | match_flag_case_dotnl_toggle_not, 13 | "(?-u)(?is)a(?u:.)(?-is)a(?u:.)", 14 | "A\na\n", 15 | None 16 | ); 17 | mat!( 18 | match_flag_case_dotnl_toggle_ok, 19 | "(?-u)(?is)a(?u:.)(?-is:a(?u:.))?", 20 | "A\na\n", 21 | Some((0, 2)) 22 | ); 23 | mat!( 24 | match_flag_multi, 25 | r"(?-u)(?m)(?:^\d+$\n?)+", 26 | "123\n456\n789", 27 | Some((0, 11)) 28 | ); 29 | mat!(match_flag_ungreedy, "(?U)a+", "aa", Some((0, 1))); 30 | mat!(match_flag_ungreedy_greedy, "(?U)a+?", "aa", Some((0, 2))); 31 | mat!(match_flag_ungreedy_noop, "(?U)(?-U)a+", "aa", Some((0, 2))); 32 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_nlink: ::nlink_t, 7 | pub st_mode: ::mode_t, 8 | st_padding0: i16, 9 | pub st_uid: ::uid_t, 10 | pub st_gid: ::gid_t, 11 | st_padding1: i32, 12 | pub st_rdev: ::dev_t, 13 | pub st_atime: ::time_t, 14 | pub st_atime_nsec: ::c_long, 15 | pub st_mtime: ::time_t, 16 | pub st_mtime_nsec: ::c_long, 17 | pub st_ctime: ::time_t, 18 | pub st_ctime_nsec: ::c_long, 19 | pub st_birthtime: ::time_t, 20 | pub st_birthtime_nsec: ::c_long, 21 | pub st_size: ::off_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_blksize: ::blksize_t, 24 | pub st_flags: ::fflags_t, 25 | pub st_gen: u64, 26 | pub st_spare: [u64; 10], 27 | } 28 | 29 | impl ::Copy for ::stat {} 30 | impl ::Clone for ::stat { 31 | fn clone(&self) -> ::stat { 32 | *self 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/once_cell/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/thread_local/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "thread_local" 15 | version = "1.0.1" 16 | authors = ["Amanieu d'Antras "] 17 | description = "Per-object thread-local storage" 18 | documentation = "https://amanieu.github.io/thread_local-rs/thread_local/index.html" 19 | readme = "README.md" 20 | keywords = ["thread_local", "concurrent", "thread"] 21 | license = "Apache-2.0/MIT" 22 | repository = "https://github.com/Amanieu/thread_local-rs" 23 | [dependencies.lazy_static] 24 | version = "1.0" 25 | [badges.travis-ci] 26 | repository = "Amanieu/thread_local-rs" 27 | -------------------------------------------------------------------------------- /src/ixy82599/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 ixy-languages 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/memchr/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/aho-corasick/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/byteorder/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/libc/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/regex/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/lazy_static/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/regex-syntax/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/thread_local/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/lazy_static.rs: -------------------------------------------------------------------------------- 1 | extern crate once_cell; 2 | 3 | use once_cell::sync::{Lazy, OnceCell}; 4 | use std::collections::HashMap; 5 | 6 | static HASHMAP: Lazy> = Lazy::new(|| { 7 | let mut m = HashMap::new(); 8 | m.insert(0, "foo"); 9 | m.insert(1, "bar"); 10 | m.insert(2, "baz"); 11 | m 12 | }); 13 | 14 | // Same, but completely without macros 15 | fn hashmap() -> &'static HashMap { 16 | static INSTANCE: OnceCell> = OnceCell::new(); 17 | INSTANCE.get_or_init(|| { 18 | let mut m = HashMap::new(); 19 | m.insert(0, "foo"); 20 | m.insert(1, "bar"); 21 | m.insert(2, "baz"); 22 | m 23 | }) 24 | } 25 | 26 | fn main() { 27 | // First access to `HASHMAP` initializes it 28 | println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); 29 | 30 | // Any further access to `HASHMAP` just returns the computed value 31 | println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap()); 32 | 33 | // The same works for function-style: 34 | assert_eq!(hashmap().get(&0), Some(&"foo")); 35 | assert_eq!(hashmap().get(&0), Some(&"bar")); 36 | } 37 | -------------------------------------------------------------------------------- /vendor/regex/src/testdata/LICENSE: -------------------------------------------------------------------------------- 1 | The following license covers testregex.c and all associated test data. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of THIS SOFTWARE FILE (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, 6 | copy, modify, merge, publish, distribute, and/or sell copies of the 7 | Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following disclaimer: 9 | 10 | THIS SOFTWARE IS PROVIDED BY AT&T ``AS IS'' AND ANY EXPRESS OR IMPLIED 11 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 13 | IN NO EVENT SHALL AT&T BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 20 | -------------------------------------------------------------------------------- /vendor/regex/tests/api_str.rs: -------------------------------------------------------------------------------- 1 | // These tests don't really make sense with the bytes API, so we only test them 2 | // on the Unicode API. 3 | 4 | #[test] 5 | fn empty_match_unicode_find_iter() { 6 | // Tests that we still yield byte ranges at valid UTF-8 sequence boundaries 7 | // even when we're susceptible to empty width matches. 8 | let re = regex!(r".*?"); 9 | assert_eq!( 10 | vec![(0, 0), (3, 3), (4, 4), (7, 7), (8, 8)], 11 | findall!(re, "Ⅰ1Ⅱ2") 12 | ); 13 | } 14 | 15 | #[test] 16 | fn empty_match_unicode_captures_iter() { 17 | // Same as empty_match_unicode_find_iter, but tests capture iteration. 18 | let re = regex!(r".*?"); 19 | let ms: Vec<_> = re 20 | .captures_iter(text!("Ⅰ1Ⅱ2")) 21 | .map(|c| c.get(0).unwrap()) 22 | .map(|m| (m.start(), m.end())) 23 | .collect(); 24 | assert_eq!(vec![(0, 0), (3, 3), (4, 4), (7, 7), (8, 8)], ms); 25 | } 26 | 27 | #[test] 28 | fn match_as_str() { 29 | let re = regex!(r"fo+"); 30 | let caps = re.captures("barfoobar").unwrap(); 31 | assert_eq!(caps.get(0).map(|m| m.as_str()), Some("foo")); 32 | assert_eq!(caps.get(0).map(From::from), Some("foo")); 33 | assert_eq!(caps.get(0).map(Into::into), Some("foo")); 34 | } 35 | -------------------------------------------------------------------------------- /vendor/regex-syntax/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "regex-syntax" 15 | version = "0.6.17" 16 | authors = ["The Rust Project Developers"] 17 | description = "A regular expression parser." 18 | homepage = "https://github.com/rust-lang/regex" 19 | documentation = "https://docs.rs/regex-syntax" 20 | license = "MIT/Apache-2.0" 21 | repository = "https://github.com/rust-lang/regex" 22 | 23 | [features] 24 | default = ["unicode"] 25 | unicode = ["unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] 26 | unicode-age = [] 27 | unicode-bool = [] 28 | unicode-case = [] 29 | unicode-gencat = [] 30 | unicode-perl = [] 31 | unicode-script = [] 32 | unicode-segment = [] 33 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_nfa.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(feature = "pattern", feature(pattern))] 2 | 3 | extern crate rand; 4 | extern crate regex; 5 | 6 | macro_rules! regex_new { 7 | ($re:expr) => {{ 8 | use regex::internal::ExecBuilder; 9 | ExecBuilder::new($re).nfa().build().map(|e| e.into_regex()) 10 | }}; 11 | } 12 | 13 | macro_rules! regex { 14 | ($re:expr) => { 15 | regex_new!($re).unwrap() 16 | }; 17 | } 18 | 19 | macro_rules! regex_set_new { 20 | ($re:expr) => {{ 21 | use regex::internal::ExecBuilder; 22 | ExecBuilder::new_many($re).nfa().build().map(|e| e.into_regex_set()) 23 | }}; 24 | } 25 | 26 | macro_rules! regex_set { 27 | ($res:expr) => { 28 | regex_set_new!($res).unwrap() 29 | }; 30 | } 31 | 32 | // Must come before other module definitions. 33 | include!("macros_str.rs"); 34 | include!("macros.rs"); 35 | 36 | mod api; 37 | mod api_str; 38 | mod crazy; 39 | mod flags; 40 | mod fowler; 41 | mod multiline; 42 | mod noparse; 43 | mod regression; 44 | mod replace; 45 | mod searcher; 46 | mod set; 47 | mod suffix_reverse; 48 | #[cfg(feature = "unicode")] 49 | mod unicode; 50 | #[cfg(feature = "unicode-perl")] 51 | mod word_boundary; 52 | #[cfg(feature = "unicode-perl")] 53 | mod word_boundary_unicode; 54 | -------------------------------------------------------------------------------- /vendor/byteorder/UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /vendor/memchr/UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /vendor/memchr/src/c.rs: -------------------------------------------------------------------------------- 1 | // This module defines safe wrappers around memchr (POSIX) and memrchr (GNU 2 | // extension). 3 | 4 | #![allow(dead_code)] 5 | 6 | extern crate libc; 7 | 8 | use self::libc::{c_int, c_void, size_t}; 9 | 10 | pub fn memchr(needle: u8, haystack: &[u8]) -> Option { 11 | let p = unsafe { 12 | libc::memchr( 13 | haystack.as_ptr() as *const c_void, 14 | needle as c_int, 15 | haystack.len() as size_t, 16 | ) 17 | }; 18 | if p.is_null() { 19 | None 20 | } else { 21 | Some(p as usize - (haystack.as_ptr() as usize)) 22 | } 23 | } 24 | 25 | // memrchr is a GNU extension. We know it's available on Linux, so start there. 26 | #[cfg(target_os = "linux")] 27 | pub fn memrchr(needle: u8, haystack: &[u8]) -> Option { 28 | // GNU's memrchr() will - unlike memchr() - error if haystack is empty. 29 | if haystack.is_empty() { 30 | return None; 31 | } 32 | let p = unsafe { 33 | libc::memrchr( 34 | haystack.as_ptr() as *const c_void, 35 | needle as c_int, 36 | haystack.len() as size_t, 37 | ) 38 | }; 39 | if p.is_null() { 40 | None 41 | } else { 42 | Some(p as usize - (haystack.as_ptr() as usize)) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/aho-corasick/UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /vendor/regex/tests/macros_bytes.rs: -------------------------------------------------------------------------------- 1 | // Macros for use in writing tests generic over &str/&[u8]. 2 | macro_rules! text { ($text:expr) => { $text.as_bytes() } } 3 | macro_rules! t { ($re:expr) => { text!($re) } } 4 | macro_rules! match_text { ($text:expr) => { $text.as_bytes() } } 5 | macro_rules! use_ { ($($path: tt)*) => { use regex::bytes::$($path)*; } } 6 | macro_rules! empty_vec { () => { >::new() } } 7 | 8 | macro_rules! bytes { ($text:expr) => { $text } } 9 | 10 | macro_rules! no_expand { 11 | ($text:expr) => {{ 12 | use regex::bytes::NoExpand; 13 | NoExpand(text!($text)) 14 | }} 15 | } 16 | 17 | macro_rules! show { 18 | ($text:expr) => {{ 19 | use std::ascii::escape_default; 20 | let mut s = vec![]; 21 | for &b in bytes!($text) { 22 | s.extend(escape_default(b)); 23 | } 24 | String::from_utf8(s).unwrap() 25 | }} 26 | } 27 | 28 | macro_rules! expand { 29 | ($name:ident, $re:expr, $text:expr, $expand:expr, $expected:expr) => { 30 | #[test] 31 | fn $name() { 32 | let re = regex!($re); 33 | let cap = re.captures(t!($text)).unwrap(); 34 | 35 | let mut got = vec![]; 36 | cap.expand(t!($expand), &mut got); 37 | assert_eq!(show!(t!($expected)), show!(&*got)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/header.rs: -------------------------------------------------------------------------------- 1 | use super::lib; 2 | 3 | use std::mem; 4 | use std::slice; 5 | 6 | // PROTOCOL HEADERS 7 | // 8 | // Synthesizing and parsing network protocol headers. 9 | // 10 | // Header - generic header box (can point to a head allocated object or 11 | // into arbitrary memory) 12 | // new() -> Header - create a new heap allocated header of type T 13 | // from_mem(&mut [u8]) -> Header - cast byte slice into a Header 14 | // size_of() -> usize - return byte size of header of type T 15 | // Header.copy(&mut [u8]) - copy header into a byte slice 16 | 17 | pub struct Header { 18 | pub ptr: *mut T, 19 | _backing: Option> 20 | } 21 | 22 | pub fn new() -> Header { 23 | let mut h = Box::new(T::default()); 24 | Header { ptr: &mut *h, _backing: Some(h) } 25 | } 26 | 27 | pub fn from_mem(ptr: &mut [u8]) -> Header { 28 | assert!(ptr.len() >= mem::size_of::()); 29 | Header { ptr: ptr as *mut [u8] as *mut T, _backing: None } 30 | } 31 | 32 | pub fn size_of() -> usize { mem::size_of::() } 33 | 34 | impl Header { 35 | 36 | pub fn copy(&self, dst: &mut [u8]) { 37 | let s = unsafe { 38 | slice::from_raw_parts(self.ptr as *const u8, size_of::()) 39 | }; 40 | lib::copy(dst, s, size_of::()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type time_t = i32; 5 | pub type suseconds_t = i32; 6 | 7 | s! { 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | pub st_atime: ::time_t, 17 | pub st_atime_nsec: ::c_long, 18 | pub st_mtime: ::time_t, 19 | pub st_mtime_nsec: ::c_long, 20 | pub st_ctime: ::time_t, 21 | pub st_ctime_nsec: ::c_long, 22 | pub st_size: ::off_t, 23 | pub st_blocks: ::blkcnt_t, 24 | pub st_blksize: ::blksize_t, 25 | pub st_flags: ::fflags_t, 26 | pub st_gen: u32, 27 | pub st_lspare: i32, 28 | pub st_birthtime: ::time_t, 29 | pub st_birthtime_nsec: ::c_long, 30 | __unused: [u8; 8], 31 | } 32 | } 33 | 34 | // should be pub(crate), but that requires Rust 1.18.0 35 | cfg_if! { 36 | if #[cfg(libc_const_size_of)] { 37 | #[doc(hidden)] 38 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 39 | } else { 40 | #[doc(hidden)] 41 | pub const _ALIGNBYTES: usize = 8 - 1; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_nfa_utf8bytes.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(feature = "pattern", feature(pattern))] 2 | 3 | extern crate rand; 4 | extern crate regex; 5 | 6 | macro_rules! regex_new { 7 | ($re:expr) => {{ 8 | use regex::internal::ExecBuilder; 9 | ExecBuilder::new($re).nfa().bytes(true).build().map(|e| e.into_regex()) 10 | }}; 11 | } 12 | 13 | macro_rules! regex { 14 | ($re:expr) => { 15 | regex_new!($re).unwrap() 16 | }; 17 | } 18 | 19 | macro_rules! regex_set_new { 20 | ($re:expr) => {{ 21 | use regex::internal::ExecBuilder; 22 | ExecBuilder::new_many($re) 23 | .nfa() 24 | .bytes(true) 25 | .build() 26 | .map(|e| e.into_regex_set()) 27 | }}; 28 | } 29 | 30 | macro_rules! regex_set { 31 | ($res:expr) => { 32 | regex_set_new!($res).unwrap() 33 | }; 34 | } 35 | 36 | // Must come before other module definitions. 37 | include!("macros_str.rs"); 38 | include!("macros.rs"); 39 | 40 | mod api; 41 | mod api_str; 42 | mod crazy; 43 | mod flags; 44 | mod fowler; 45 | mod multiline; 46 | mod noparse; 47 | mod regression; 48 | mod replace; 49 | mod searcher; 50 | mod set; 51 | mod suffix_reverse; 52 | #[cfg(feature = "unicode")] 53 | mod unicode; 54 | #[cfg(feature = "unicode-perl")] 55 | mod word_boundary; 56 | #[cfg(feature = "unicode-perl")] 57 | mod word_boundary_unicode; 58 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_nfa_bytes.rs: -------------------------------------------------------------------------------- 1 | extern crate rand; 2 | extern crate regex; 3 | 4 | macro_rules! regex_new { 5 | ($re:expr) => {{ 6 | use regex::internal::ExecBuilder; 7 | ExecBuilder::new($re) 8 | .nfa() 9 | .only_utf8(false) 10 | .build() 11 | .map(|e| e.into_byte_regex()) 12 | }}; 13 | } 14 | 15 | macro_rules! regex { 16 | ($re:expr) => { 17 | regex_new!($re).unwrap() 18 | }; 19 | } 20 | 21 | macro_rules! regex_set_new { 22 | ($re:expr) => {{ 23 | use regex::internal::ExecBuilder; 24 | ExecBuilder::new_many($re) 25 | .nfa() 26 | .only_utf8(false) 27 | .build() 28 | .map(|e| e.into_byte_regex_set()) 29 | }}; 30 | } 31 | 32 | macro_rules! regex_set { 33 | ($res:expr) => { 34 | regex_set_new!($res).unwrap() 35 | }; 36 | } 37 | 38 | // Must come before other module definitions. 39 | include!("macros_bytes.rs"); 40 | include!("macros.rs"); 41 | 42 | mod api; 43 | mod bytes; 44 | mod crazy; 45 | mod flags; 46 | mod fowler; 47 | mod multiline; 48 | mod noparse; 49 | mod regression; 50 | mod replace; 51 | mod set; 52 | mod suffix_reverse; 53 | #[cfg(feature = "unicode")] 54 | mod unicode; 55 | #[cfg(feature = "unicode-perl")] 56 | mod word_boundary; 57 | #[cfg(feature = "unicode-perl")] 58 | mod word_boundary_unicode; 59 | -------------------------------------------------------------------------------- /vendor/regex/src/literal/mod.rs: -------------------------------------------------------------------------------- 1 | pub use self::imp::*; 2 | 3 | #[cfg(feature = "perf-literal")] 4 | mod imp; 5 | 6 | #[allow(missing_docs)] 7 | #[cfg(not(feature = "perf-literal"))] 8 | mod imp { 9 | use syntax::hir::literal::Literals; 10 | 11 | #[derive(Clone, Debug)] 12 | pub struct LiteralSearcher(()); 13 | 14 | impl LiteralSearcher { 15 | pub fn empty() -> Self { 16 | LiteralSearcher(()) 17 | } 18 | 19 | pub fn prefixes(_: Literals) -> Self { 20 | LiteralSearcher(()) 21 | } 22 | 23 | pub fn suffixes(_: Literals) -> Self { 24 | LiteralSearcher(()) 25 | } 26 | 27 | pub fn complete(&self) -> bool { 28 | false 29 | } 30 | 31 | pub fn find(&self, _: &[u8]) -> Option<(usize, usize)> { 32 | unreachable!() 33 | } 34 | 35 | pub fn find_start(&self, _: &[u8]) -> Option<(usize, usize)> { 36 | unreachable!() 37 | } 38 | 39 | pub fn find_end(&self, _: &[u8]) -> Option<(usize, usize)> { 40 | unreachable!() 41 | } 42 | 43 | pub fn is_empty(&self) -> bool { 44 | true 45 | } 46 | 47 | pub fn len(&self) -> usize { 48 | 0 49 | } 50 | 51 | pub fn approximate_size(&self) -> usize { 52 | 0 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type time_t = i64; 5 | pub type suseconds_t = i64; 6 | 7 | s! { 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | pub st_atime: ::time_t, 17 | pub st_atime_nsec: ::c_long, 18 | pub st_mtime: ::time_t, 19 | pub st_mtime_nsec: ::c_long, 20 | pub st_ctime: ::time_t, 21 | pub st_ctime_nsec: ::c_long, 22 | pub st_size: ::off_t, 23 | pub st_blocks: ::blkcnt_t, 24 | pub st_blksize: ::blksize_t, 25 | pub st_flags: ::fflags_t, 26 | pub st_gen: u32, 27 | pub st_lspare: i32, 28 | pub st_birthtime: ::time_t, 29 | pub st_birthtime_nsec: ::c_long, 30 | } 31 | } 32 | 33 | // should be pub(crate), but that requires Rust 1.18.0 34 | cfg_if! { 35 | if #[cfg(libc_const_size_of)] { 36 | #[doc(hidden)] 37 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; 38 | } else { 39 | #[doc(hidden)] 40 | pub const _ALIGNBYTES: usize = 8 - 1; 41 | } 42 | } 43 | 44 | pub const MAP_32BIT: ::c_int = 0x00080000; 45 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type time_t = i64; 5 | pub type suseconds_t = i64; 6 | 7 | s! { 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | pub st_atime: ::time_t, 17 | pub st_atime_nsec: ::c_long, 18 | pub st_mtime: ::time_t, 19 | pub st_mtime_nsec: ::c_long, 20 | pub st_ctime: ::time_t, 21 | pub st_ctime_nsec: ::c_long, 22 | pub st_size: ::off_t, 23 | pub st_blocks: ::blkcnt_t, 24 | pub st_blksize: ::blksize_t, 25 | pub st_flags: ::fflags_t, 26 | pub st_gen: u32, 27 | pub st_lspare: i32, 28 | pub st_birthtime: ::time_t, 29 | pub st_birthtime_nsec: ::c_long, 30 | } 31 | } 32 | 33 | // should be pub(crate), but that requires Rust 1.18.0 34 | cfg_if! { 35 | if #[cfg(libc_const_size_of)] { 36 | #[doc(hidden)] 37 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 38 | } else { 39 | #[doc(hidden)] 40 | pub const _ALIGNBYTES: usize = 8 - 1; 41 | } 42 | } 43 | 44 | pub const MAP_32BIT: ::c_int = 0x00080000; 45 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/test_synchronization.rs: -------------------------------------------------------------------------------- 1 | /// Test if the OnceCell properly synchronizes. 2 | /// Needs to be run in release mode. 3 | /// 4 | /// We create a `Vec` with `N_ROUNDS` of `OnceCell`s. All threads will walk the `Vec`, and race to 5 | /// be the first one to initialize a cell. 6 | /// Every thread adds the results of the cells it sees to an accumulator, which is compared at the 7 | /// end. 8 | /// All threads should end up with the same result. 9 | 10 | use once_cell::sync::OnceCell; 11 | 12 | const N_THREADS: usize = 32; 13 | const N_ROUNDS: usize = 1_000_000; 14 | 15 | static CELLS: OnceCell>> = OnceCell::new(); 16 | static RESULT: OnceCell = OnceCell::new(); 17 | 18 | fn main() { 19 | let start = std::time::Instant::now(); 20 | CELLS.get_or_init(|| vec![OnceCell::new(); N_ROUNDS]); 21 | let threads = 22 | (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); 23 | for thread in threads { 24 | thread.join().unwrap(); 25 | } 26 | println!("{:?}", start.elapsed()); 27 | println!("No races detected"); 28 | } 29 | 30 | fn thread_main(i: usize) { 31 | let cells = CELLS.get().unwrap(); 32 | let mut accum = 0; 33 | for cell in cells.iter() { 34 | let &value = cell.get_or_init(|| i); 35 | accum += value; 36 | } 37 | assert_eq!(RESULT.get_or_init(|| accum), &accum); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_backtrack.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(feature = "pattern", feature(pattern))] 2 | 3 | extern crate rand; 4 | extern crate regex; 5 | 6 | macro_rules! regex_new { 7 | ($re:expr) => {{ 8 | use regex::internal::ExecBuilder; 9 | ExecBuilder::new($re) 10 | .bounded_backtracking() 11 | .build() 12 | .map(|e| e.into_regex()) 13 | }}; 14 | } 15 | 16 | macro_rules! regex { 17 | ($re:expr) => { 18 | regex_new!($re).unwrap() 19 | }; 20 | } 21 | 22 | macro_rules! regex_set_new { 23 | ($re:expr) => {{ 24 | use regex::internal::ExecBuilder; 25 | ExecBuilder::new_many($re) 26 | .bounded_backtracking() 27 | .build() 28 | .map(|e| e.into_regex_set()) 29 | }}; 30 | } 31 | 32 | macro_rules! regex_set { 33 | ($res:expr) => { 34 | regex_set_new!($res).unwrap() 35 | }; 36 | } 37 | 38 | // Must come before other module definitions. 39 | include!("macros_str.rs"); 40 | include!("macros.rs"); 41 | 42 | mod api; 43 | mod api_str; 44 | mod crazy; 45 | mod flags; 46 | mod fowler; 47 | mod multiline; 48 | mod noparse; 49 | mod regression; 50 | mod replace; 51 | mod searcher; 52 | mod set; 53 | mod suffix_reverse; 54 | #[cfg(feature = "unicode")] 55 | mod unicode; 56 | #[cfg(feature = "unicode-perl")] 57 | mod word_boundary; 58 | #[cfg(feature = "unicode-perl")] 59 | mod word_boundary_unicode; 60 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_backtrack_bytes.rs: -------------------------------------------------------------------------------- 1 | extern crate rand; 2 | extern crate regex; 3 | 4 | macro_rules! regex_new { 5 | ($re:expr) => {{ 6 | use regex::internal::ExecBuilder; 7 | ExecBuilder::new($re) 8 | .bounded_backtracking() 9 | .only_utf8(false) 10 | .build() 11 | .map(|e| e.into_byte_regex()) 12 | }}; 13 | } 14 | 15 | macro_rules! regex { 16 | ($re:expr) => { 17 | regex_new!($re).unwrap() 18 | }; 19 | } 20 | 21 | macro_rules! regex_set_new { 22 | ($re:expr) => {{ 23 | use regex::internal::ExecBuilder; 24 | ExecBuilder::new_many($re) 25 | .bounded_backtracking() 26 | .only_utf8(false) 27 | .build() 28 | .map(|e| e.into_byte_regex_set()) 29 | }}; 30 | } 31 | 32 | macro_rules! regex_set { 33 | ($res:expr) => { 34 | regex_set_new!($res).unwrap() 35 | }; 36 | } 37 | 38 | // Must come before other module definitions. 39 | include!("macros_bytes.rs"); 40 | include!("macros.rs"); 41 | 42 | mod api; 43 | mod bytes; 44 | mod crazy; 45 | mod flags; 46 | mod fowler; 47 | mod multiline; 48 | mod noparse; 49 | mod regression; 50 | mod replace; 51 | mod set; 52 | mod suffix_reverse; 53 | #[cfg(feature = "unicode")] 54 | mod unicode; 55 | #[cfg(feature = "unicode-perl")] 56 | mod word_boundary; 57 | #[cfg(feature = "unicode-perl")] 58 | mod word_boundary_ascii; 59 | -------------------------------------------------------------------------------- /vendor/libc/src/sgx.rs: -------------------------------------------------------------------------------- 1 | //! SGX C types definition 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type c_char = i8; 23 | pub type c_long = i64; 24 | pub type c_ulong = u64; 25 | 26 | pub const INT_MIN: c_int = -2147483648; 27 | pub const INT_MAX: c_int = 2147483647; 28 | 29 | cfg_if! { 30 | if #[cfg(libc_core_cvoid)] { 31 | pub use ::ffi::c_void; 32 | } else { 33 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 34 | // enable more optimization opportunities around it recognizing things 35 | // like malloc/free. 36 | #[repr(u8)] 37 | #[allow(missing_copy_implementations)] 38 | #[allow(missing_debug_implementations)] 39 | pub enum c_void { 40 | // Two dummy variants so the #[repr] attribute can be used. 41 | #[doc(hidden)] 42 | __variant1, 43 | #[doc(hidden)] 44 | __variant2, 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/regex/tests/macros_str.rs: -------------------------------------------------------------------------------- 1 | // Macros for use in writing tests generic over &str/&[u8]. 2 | macro_rules! text { ($text:expr) => { $text } } 3 | macro_rules! t { ($text:expr) => { text!($text) } } 4 | macro_rules! match_text { ($text:expr) => { $text.as_str() } } 5 | macro_rules! use_ { ($($path: tt)*) => { use regex::$($path)*; } } 6 | macro_rules! empty_vec { () => { >::new() } } 7 | 8 | macro_rules! no_expand { 9 | ($text:expr) => {{ 10 | use regex::NoExpand; 11 | NoExpand(text!($text)) 12 | }} 13 | } 14 | 15 | macro_rules! show { ($text:expr) => { $text } } 16 | 17 | // N.B. The expansion API for &str and &[u8] APIs differs slightly for now, 18 | // but they should be unified in 1.0. Then we can move this macro back into 19 | // tests/api.rs where it is used. ---AG 20 | macro_rules! expand { 21 | ($name:ident, $re:expr, $text:expr, $expand:expr, $expected:expr) => { 22 | #[test] 23 | fn $name() { 24 | let re = regex!($re); 25 | let cap = re.captures(t!($text)).unwrap(); 26 | 27 | let mut got = String::new(); 28 | cap.expand(t!($expand), &mut got); 29 | assert_eq!(show!(t!($expected)), show!(&*got)); 30 | } 31 | } 32 | } 33 | 34 | #[cfg(feature = "pattern")] 35 | macro_rules! searcher_expr { ($e:expr) => ($e) } 36 | #[cfg(not(feature = "pattern"))] 37 | macro_rules! searcher_expr { ($e:expr) => ({}) } 38 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | # Run like this: 2 | # nix-build /path/to/this/directory 3 | # ... build products will be in ./result 4 | 5 | # Cross-compile via 6 | # https://github.com/mozilla/nixpkgs-mozilla/issues/91#issuecomment-464483970 7 | 8 | { pkgs ? , source ? ./., version ? "dev", crossSystem ? null }: 9 | 10 | let 11 | moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); 12 | nixpkgs = import pkgs { overlays = [ moz_overlay ]; inherit crossSystem; }; 13 | targets = [ nixpkgs.stdenv.targetPlatform.config ]; 14 | in 15 | with nixpkgs; 16 | stdenv.mkDerivation { 17 | name = "rush-${version}"; 18 | #src = lib.cleanSource (lib.sourceByRegex source ["target/*"]); 19 | 20 | # build time dependencies targeting the build platform 21 | depsBuildBuild = [ buildPackages.stdenv.cc ]; 22 | HOST_CC = "cc"; 23 | 24 | # build time dependencies targeting the host platform 25 | nativeBuildInputs = [ 26 | # to use a specific nighly: 27 | ((buildPackages.buildPackages.rustChannelOf {date="2021-02-11"; channel="nightly";}) 28 | .rust.override { inherit targets; }) 29 | ]; 30 | shellHook = '' 31 | export RUSTFLAGS="-C linker=$CC" 32 | ''; 33 | CARGO_BUILD_TARGET = targets; 34 | 35 | inherit version; 36 | 37 | # Set Environment Variables 38 | RUST_TEST_THREADS = 1; 39 | RUST_BACKTRACE = 1; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /vendor/memchr/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "memchr" 15 | version = "2.3.3" 16 | authors = ["Andrew Gallant ", "bluss"] 17 | exclude = ["/ci/*", "/.travis.yml", "/Makefile", "/appveyor.yml"] 18 | description = "Safe interface to memchr." 19 | homepage = "https://github.com/BurntSushi/rust-memchr" 20 | documentation = "https://docs.rs/memchr/" 21 | readme = "README.md" 22 | keywords = ["memchr", "char", "scan", "strchr", "string"] 23 | license = "Unlicense/MIT" 24 | repository = "https://github.com/BurntSushi/rust-memchr" 25 | [profile.test] 26 | opt-level = 3 27 | 28 | [lib] 29 | name = "memchr" 30 | bench = false 31 | [dependencies.libc] 32 | version = "0.2.18" 33 | optional = true 34 | default-features = false 35 | [dev-dependencies.quickcheck] 36 | version = "0.9" 37 | default-features = false 38 | 39 | [features] 40 | default = ["std"] 41 | std = [] 42 | use_std = ["std"] 43 | -------------------------------------------------------------------------------- /vendor/aho-corasick/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "aho-corasick" 15 | version = "0.7.10" 16 | authors = ["Andrew Gallant "] 17 | exclude = ["/aho-corasick-debug", "/ci/*", "/.travis.yml", "/appveyor.yml"] 18 | autotests = false 19 | description = "Fast multiple substring searching." 20 | homepage = "https://github.com/BurntSushi/aho-corasick" 21 | readme = "README.md" 22 | keywords = ["string", "search", "text", "aho", "multi"] 23 | categories = ["text-processing"] 24 | license = "Unlicense/MIT" 25 | repository = "https://github.com/BurntSushi/aho-corasick" 26 | [profile.bench] 27 | debug = true 28 | 29 | [profile.release] 30 | debug = true 31 | 32 | [lib] 33 | name = "aho_corasick" 34 | [dependencies.memchr] 35 | version = "2.2.0" 36 | default-features = false 37 | [dev-dependencies.doc-comment] 38 | version = "0.3.1" 39 | 40 | [features] 41 | default = ["std"] 42 | std = ["memchr/use_std"] 43 | -------------------------------------------------------------------------------- /vendor/thread_local/README.md: -------------------------------------------------------------------------------- 1 | thread_local 2 | ============ 3 | 4 | [![Build Status](https://travis-ci.org/Amanieu/thread_local-rs.svg?branch=master)](https://travis-ci.org/Amanieu/thread_local-rs) [![Crates.io](https://img.shields.io/crates/v/thread_local.svg)](https://crates.io/crates/thread_local) 5 | 6 | This library provides the `ThreadLocal` and `CachedThreadLocal` types which 7 | allow a separate copy of an object to be used for each thread. This allows for 8 | per-object thread-local storage, unlike the standard library's `thread_local!` 9 | macro which only allows static thread-local storage. 10 | 11 | [Documentation](https://amanieu.github.io/thread_local-rs/thread_local/index.html) 12 | 13 | ## Usage 14 | 15 | Add this to your `Cargo.toml`: 16 | 17 | ```toml 18 | [dependencies] 19 | thread_local = "1.0" 20 | ``` 21 | 22 | and this to your crate root: 23 | 24 | ```rust 25 | extern crate thread_local; 26 | ``` 27 | 28 | ## License 29 | 30 | Licensed under either of 31 | 32 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) 33 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) 34 | 35 | at your option. 36 | 37 | ### Contribution 38 | 39 | Unless you explicitly state otherwise, any contribution intentionally submitted 40 | for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any 41 | additional terms or conditions. 42 | -------------------------------------------------------------------------------- /vendor/libc/src/switch.rs: -------------------------------------------------------------------------------- 1 | //! Switch C type definitions 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type off_t = i64; 23 | pub type c_char = u8; 24 | pub type c_long = i64; 25 | pub type c_ulong = u64; 26 | pub type wchar_t = u32; 27 | 28 | pub const INT_MIN: c_int = -2147483648; 29 | pub const INT_MAX: c_int = 2147483647; 30 | 31 | cfg_if! { 32 | if #[cfg(libc_core_cvoid)] { 33 | pub use ::ffi::c_void; 34 | } else { 35 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 36 | // enable more optimization opportunities around it recognizing things 37 | // like malloc/free. 38 | #[repr(u8)] 39 | #[allow(missing_copy_implementations)] 40 | #[allow(missing_debug_implementations)] 41 | pub enum c_void { 42 | // Two dummy variants so the #[repr] attribute can be used. 43 | #[doc(hidden)] 44 | __variant1, 45 | #[doc(hidden)] 46 | __variant2, 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_backtrack_utf8bytes.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(feature = "pattern", feature(pattern))] 2 | 3 | extern crate rand; 4 | extern crate regex; 5 | 6 | macro_rules! regex_new { 7 | ($re:expr) => {{ 8 | use regex::internal::ExecBuilder; 9 | ExecBuilder::new($re) 10 | .bounded_backtracking() 11 | .bytes(true) 12 | .build() 13 | .map(|e| e.into_regex()) 14 | }}; 15 | } 16 | 17 | macro_rules! regex { 18 | ($re:expr) => { 19 | regex_new!($re).unwrap() 20 | }; 21 | } 22 | 23 | macro_rules! regex_set_new { 24 | ($re:expr) => {{ 25 | use regex::internal::ExecBuilder; 26 | ExecBuilder::new_many($re) 27 | .bounded_backtracking() 28 | .bytes(true) 29 | .build() 30 | .map(|e| e.into_regex_set()) 31 | }}; 32 | } 33 | 34 | macro_rules! regex_set { 35 | ($res:expr) => { 36 | regex_set_new!($res).unwrap() 37 | }; 38 | } 39 | 40 | // Must come before other module definitions. 41 | include!("macros_str.rs"); 42 | include!("macros.rs"); 43 | 44 | mod api; 45 | mod api_str; 46 | mod crazy; 47 | mod flags; 48 | mod fowler; 49 | mod multiline; 50 | mod noparse; 51 | mod regression; 52 | mod replace; 53 | mod searcher; 54 | mod set; 55 | mod suffix_reverse; 56 | #[cfg(feature = "unicode")] 57 | mod unicode; 58 | #[cfg(feature = "unicode-perl")] 59 | mod word_boundary; 60 | #[cfg(feature = "unicode-perl")] 61 | mod word_boundary_unicode; 62 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/bench_acquire.rs: -------------------------------------------------------------------------------- 1 | /// Benchmark the overhead that the synchronization of `OnceCell::get` causes. 2 | /// We do some other operations that write to memory to get an imprecise but somewhat realistic 3 | /// measurement. 4 | 5 | use once_cell::sync::OnceCell; 6 | use std::sync::atomic::{AtomicUsize, Ordering}; 7 | 8 | const N_THREADS: usize = 16; 9 | const N_ROUNDS: usize = 1_000_000; 10 | 11 | static CELL: OnceCell = OnceCell::new(); 12 | static OTHER: AtomicUsize = AtomicUsize::new(0); 13 | 14 | fn main() { 15 | let start = std::time::Instant::now(); 16 | let threads = 17 | (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); 18 | for thread in threads { 19 | thread.join().unwrap(); 20 | } 21 | println!("{:?}", start.elapsed()); 22 | println!("{:?}", OTHER.load(Ordering::Relaxed)); 23 | } 24 | 25 | #[inline(never)] 26 | fn thread_main(i: usize) { 27 | // The operations we do here don't really matter, as long as we do multiple writes, and 28 | // everything is messy enough to prevent the compiler from optimizing the loop away. 29 | let mut data = [i; 128]; 30 | let mut accum = 0usize; 31 | for _ in 0..N_ROUNDS { 32 | let _value = CELL.get_or_init(|| i+1); 33 | let k = OTHER.fetch_add(data[accum & 0x7F] as usize, Ordering::Relaxed); 34 | for j in data.iter_mut() { 35 | *j = (*j).wrapping_add(accum); 36 | accum = accum.wrapping_add(k); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/regex-syntax/src/unicode_tables/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "unicode-age")] 2 | pub mod age; 3 | 4 | #[cfg(feature = "unicode-case")] 5 | pub mod case_folding_simple; 6 | 7 | #[cfg(feature = "unicode-gencat")] 8 | pub mod general_category; 9 | 10 | #[cfg(feature = "unicode-segment")] 11 | pub mod grapheme_cluster_break; 12 | 13 | #[cfg(all(feature = "unicode-perl", not(feature = "unicode-gencat")))] 14 | #[allow(dead_code)] 15 | pub mod perl_decimal; 16 | 17 | #[cfg(all(feature = "unicode-perl", not(feature = "unicode-bool")))] 18 | #[allow(dead_code)] 19 | pub mod perl_space; 20 | 21 | #[cfg(feature = "unicode-perl")] 22 | pub mod perl_word; 23 | 24 | #[cfg(feature = "unicode-bool")] 25 | pub mod property_bool; 26 | 27 | #[cfg(any( 28 | feature = "unicode-age", 29 | feature = "unicode-bool", 30 | feature = "unicode-gencat", 31 | feature = "unicode-perl", 32 | feature = "unicode-script", 33 | feature = "unicode-segment", 34 | ))] 35 | pub mod property_names; 36 | 37 | #[cfg(any( 38 | feature = "unicode-age", 39 | feature = "unicode-bool", 40 | feature = "unicode-gencat", 41 | feature = "unicode-perl", 42 | feature = "unicode-script", 43 | feature = "unicode-segment", 44 | ))] 45 | pub mod property_values; 46 | 47 | #[cfg(feature = "unicode-script")] 48 | pub mod script; 49 | 50 | #[cfg(feature = "unicode-script")] 51 | pub mod script_extension; 52 | 53 | #[cfg(feature = "unicode-segment")] 54 | pub mod sentence_break; 55 | 56 | #[cfg(feature = "unicode-segment")] 57 | pub mod word_break; 58 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type time_t = i64; 5 | pub type suseconds_t = i32; 6 | 7 | s! { 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | pub st_atime: ::time_t, 17 | pub st_atime_nsec: ::c_long, 18 | pub st_atime_pad: ::c_long, 19 | pub st_mtime: ::time_t, 20 | pub st_mtime_nsec: ::c_long, 21 | pub st_mtime_pad: ::c_long, 22 | pub st_ctime: ::time_t, 23 | pub st_ctime_nsec: ::c_long, 24 | pub st_ctime_pad: ::c_long, 25 | pub st_size: ::off_t, 26 | pub st_blocks: ::blkcnt_t, 27 | pub st_blksize: ::blksize_t, 28 | pub st_flags: ::fflags_t, 29 | pub st_gen: u32, 30 | pub st_lspare: i32, 31 | pub st_birthtime: ::time_t, 32 | pub st_birthtime_nsec: ::c_long, 33 | pub st_birthtime_pad: ::c_long, 34 | } 35 | } 36 | 37 | // should be pub(crate), but that requires Rust 1.18.0 38 | cfg_if! { 39 | if #[cfg(libc_const_size_of)] { 40 | #[doc(hidden)] 41 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 42 | } else { 43 | #[doc(hidden)] 44 | pub const _ALIGNBYTES: usize = 4 - 1; 45 | } 46 | } 47 | pub const MAP_32BIT: ::c_int = 0x00080000; 48 | -------------------------------------------------------------------------------- /vendor/once_cell/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"CHANGELOG.md":"30fa41d2cd20250b4d4defdef99cd18843b38f7991e8eed40801b94b8542ce13","Cargo.lock":"147a02b888dc8555251ba130e61c87afbd3c2af8ccac923b22773904ddb0a85e","Cargo.toml":"79f3565fce8df325c6096c50594228bfd7bfb9cef2dba1fc25ea48ba2fe9e5a0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"d7203c0e18700de8e1408c3f4bb96075df271fea9ab678f6ad2e09855aefa7ed","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"3956f01158abaa1e15f1c633e6f96caf1257bca7bb4311c9568fdbc8347906f9","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"1fe6828a2bfe5b5fbcaf287fcf02d746e757d89db81a2e32f24b849272dd1e90","src/imp_pl.rs":"2ec567e4a0f3b5adc7399822ced03243aa065b61ac50d81c485e952ddf676c7e","src/imp_std.rs":"bfd6e77afa84defffcc7a8b6bc0226353f95c12fd373866884cd8421c9326446","src/lib.rs":"20f7f610a6ad51dbe59b3dff328c6539520d00cec6d60bcfd3b3c0deb5efd06c","tests/test.rs":"d41dcc82bc03a52a1d1985b155d08de991919ae190a424012981a1e6f395eb20"},"package":"b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b"} -------------------------------------------------------------------------------- /vendor/regex-syntax/benches/bench.rs: -------------------------------------------------------------------------------- 1 | #![feature(test)] 2 | 3 | extern crate regex_syntax; 4 | extern crate test; 5 | 6 | use regex_syntax::Parser; 7 | use test::Bencher; 8 | 9 | #[bench] 10 | fn parse_simple1(b: &mut Bencher) { 11 | b.iter(|| { 12 | let re = r"^bc(d|e)*$"; 13 | Parser::new().parse(re).unwrap() 14 | }); 15 | } 16 | 17 | #[bench] 18 | fn parse_simple2(b: &mut Bencher) { 19 | b.iter(|| { 20 | let re = r"'[a-zA-Z_][a-zA-Z0-9_]*(')\b"; 21 | Parser::new().parse(re).unwrap() 22 | }); 23 | } 24 | 25 | #[bench] 26 | fn parse_small1(b: &mut Bencher) { 27 | b.iter(|| { 28 | let re = r"\p{L}|\p{N}|\s|.|\d"; 29 | Parser::new().parse(re).unwrap() 30 | }); 31 | } 32 | 33 | #[bench] 34 | fn parse_medium1(b: &mut Bencher) { 35 | b.iter(|| { 36 | let re = r"\pL\p{Greek}\p{Hiragana}\p{Alphabetic}\p{Hebrew}\p{Arabic}"; 37 | Parser::new().parse(re).unwrap() 38 | }); 39 | } 40 | 41 | #[bench] 42 | fn parse_medium2(b: &mut Bencher) { 43 | b.iter(|| { 44 | let re = r"\s\S\w\W\d\D"; 45 | Parser::new().parse(re).unwrap() 46 | }); 47 | } 48 | 49 | #[bench] 50 | fn parse_medium3(b: &mut Bencher) { 51 | b.iter(|| { 52 | let re = 53 | r"\p{age:3.2}\p{hira}\p{scx:hira}\p{alphabetic}\p{sc:Greek}\pL"; 54 | Parser::new().parse(re).unwrap() 55 | }); 56 | } 57 | 58 | #[bench] 59 | fn parse_huge(b: &mut Bencher) { 60 | b.iter(|| { 61 | let re = r"\p{L}{100}"; 62 | Parser::new().parse(re).unwrap() 63 | }); 64 | } 65 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/bench_vs_lazy_static.rs: -------------------------------------------------------------------------------- 1 | use lazy_static::lazy_static; 2 | use once_cell::sync::Lazy; 3 | 4 | const N_THREADS: usize = 32; 5 | const N_ROUNDS: usize = 100_000_000; 6 | 7 | static ONCE_CELL: Lazy> = Lazy::new(|| vec!["Spica".to_string(), "Hoyten".to_string()]); 8 | 9 | lazy_static! { 10 | static ref LAZY_STATIC: Vec = vec!["Spica".to_string(), "Hoyten".to_string()]; 11 | } 12 | 13 | fn main() { 14 | let once_cell = { 15 | let start = std::time::Instant::now(); 16 | let threads = (0..N_THREADS) 17 | .map(|_| std::thread::spawn(move || thread_once_cell())) 18 | .collect::>(); 19 | for thread in threads { 20 | thread.join().unwrap(); 21 | } 22 | start.elapsed() 23 | }; 24 | let lazy_static = { 25 | let start = std::time::Instant::now(); 26 | let threads = (0..N_THREADS) 27 | .map(|_| std::thread::spawn(move || thread_lazy_static())) 28 | .collect::>(); 29 | for thread in threads { 30 | thread.join().unwrap(); 31 | } 32 | start.elapsed() 33 | }; 34 | 35 | println!("once_cell: {:?}", once_cell); 36 | println!("lazy_static: {:?}", lazy_static); 37 | } 38 | 39 | fn thread_once_cell() { 40 | for _ in 0..N_ROUNDS { 41 | let len = ONCE_CELL.len(); 42 | assert_eq!(len, 2) 43 | } 44 | } 45 | 46 | fn thread_lazy_static() { 47 | for _ in 0..N_ROUNDS { 48 | let len = LAZY_STATIC.len(); 49 | assert_eq!(len, 2) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/regex/tests/set.rs: -------------------------------------------------------------------------------- 1 | matset!(set1, &["a", "a"], "a", 0, 1); 2 | matset!(set2, &["a", "a"], "ba", 0, 1); 3 | matset!(set3, &["a", "b"], "a", 0); 4 | matset!(set4, &["a", "b"], "b", 1); 5 | matset!(set5, &["a|b", "b|a"], "b", 0, 1); 6 | matset!(set6, &["foo", "oo"], "foo", 0, 1); 7 | matset!(set7, &["^foo", "bar$"], "foo", 0); 8 | matset!(set8, &["^foo", "bar$"], "foo bar", 0, 1); 9 | matset!(set9, &["^foo", "bar$"], "bar", 1); 10 | matset!(set10, &[r"[a-z]+$", "foo"], "01234 foo", 0, 1); 11 | matset!(set11, &[r"[a-z]+$", "foo"], "foo 01234", 1); 12 | matset!(set12, &[r".*?", "a"], "zzzzzza", 0, 1); 13 | matset!(set13, &[r".*", "a"], "zzzzzza", 0, 1); 14 | matset!(set14, &[r".*", "a"], "zzzzzz", 0); 15 | matset!(set15, &[r"(?-u)\ba\b"], "hello a bye", 0); 16 | matset!(set16, &["a"], "a", 0); 17 | matset!(set17, &[".*a"], "a", 0); 18 | matset!(set18, &["a", "β"], "β", 1); 19 | 20 | nomatset!(nset1, &["a", "a"], "b"); 21 | nomatset!(nset2, &["^foo", "bar$"], "bar foo"); 22 | nomatset!( 23 | nset3, 24 | { 25 | let xs: &[&str] = &[]; 26 | xs 27 | }, 28 | "a" 29 | ); 30 | nomatset!(nset4, &[r"^rooted$", r"\.log$"], "notrooted"); 31 | 32 | // See: https://github.com/rust-lang/regex/issues/187 33 | #[test] 34 | fn regression_subsequent_matches() { 35 | let set = regex_set!(&["ab", "b"]); 36 | let text = text!("ba"); 37 | assert!(set.matches(text).matched(1)); 38 | assert!(set.matches(text).matched(1)); 39 | } 40 | 41 | #[test] 42 | fn get_set_patterns() { 43 | let set = regex_set!(&["a", "b"]); 44 | assert_eq!(vec!["a", "b"], set.patterns()); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/byteorder/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "byteorder" 15 | version = "1.3.4" 16 | authors = ["Andrew Gallant "] 17 | build = "build.rs" 18 | exclude = ["/ci/*"] 19 | description = "Library for reading/writing numbers in big-endian and little-endian." 20 | homepage = "https://github.com/BurntSushi/byteorder" 21 | documentation = "https://docs.rs/byteorder" 22 | readme = "README.md" 23 | keywords = ["byte", "endian", "big-endian", "little-endian", "binary"] 24 | categories = ["encoding", "parsing"] 25 | license = "Unlicense OR MIT" 26 | repository = "https://github.com/BurntSushi/byteorder" 27 | [profile.bench] 28 | opt-level = 3 29 | 30 | [lib] 31 | name = "byteorder" 32 | bench = false 33 | [dev-dependencies.doc-comment] 34 | version = "0.3" 35 | 36 | [dev-dependencies.quickcheck] 37 | version = "0.8" 38 | default-features = false 39 | 40 | [dev-dependencies.rand] 41 | version = "0.6" 42 | 43 | [features] 44 | default = ["std"] 45 | i128 = [] 46 | std = [] 47 | [badges.travis-ci] 48 | repository = "BurntSushi/byteorder" 49 | -------------------------------------------------------------------------------- /vendor/aho-corasick/src/packed/teddy/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(target_arch = "x86_64")] 2 | pub use packed::teddy::compile::Builder; 3 | #[cfg(not(target_arch = "x86_64"))] 4 | pub use packed::teddy::fallback::Builder; 5 | #[cfg(not(target_arch = "x86_64"))] 6 | pub use packed::teddy::fallback::Teddy; 7 | #[cfg(target_arch = "x86_64")] 8 | pub use packed::teddy::runtime::Teddy; 9 | 10 | #[cfg(target_arch = "x86_64")] 11 | mod compile; 12 | #[cfg(target_arch = "x86_64")] 13 | mod runtime; 14 | 15 | #[cfg(not(target_arch = "x86_64"))] 16 | mod fallback { 17 | use packed::pattern::Patterns; 18 | use Match; 19 | 20 | #[derive(Clone, Debug, Default)] 21 | pub struct Builder(()); 22 | 23 | impl Builder { 24 | pub fn new() -> Builder { 25 | Builder(()) 26 | } 27 | 28 | pub fn build(&self, _: &Patterns) -> Option { 29 | None 30 | } 31 | 32 | pub fn fat(&mut self, _: Option) -> &mut Builder { 33 | self 34 | } 35 | 36 | pub fn avx(&mut self, _: Option) -> &mut Builder { 37 | self 38 | } 39 | } 40 | 41 | #[derive(Clone, Debug)] 42 | pub struct Teddy(()); 43 | 44 | impl Teddy { 45 | pub fn find_at( 46 | &self, 47 | _: &Patterns, 48 | _: &[u8], 49 | _: usize, 50 | ) -> Option { 51 | None 52 | } 53 | 54 | pub fn minimum_len(&self) -> usize { 55 | 0 56 | } 57 | 58 | pub fn heap_bytes(&self) -> usize { 59 | 0 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/libc/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "libc" 15 | version = "0.2.68" 16 | authors = ["The Rust Project Developers"] 17 | build = "build.rs" 18 | exclude = ["/ci/*", "/azure-pipelines.yml"] 19 | description = "Raw FFI bindings to platform libraries like libc.\n" 20 | homepage = "https://github.com/rust-lang/libc" 21 | documentation = "http://doc.rust-lang.org/libc" 22 | readme = "README.md" 23 | keywords = ["libc", "ffi", "bindings", "operating", "system"] 24 | categories = ["external-ffi-bindings", "no-std", "os"] 25 | license = "MIT OR Apache-2.0" 26 | repository = "https://github.com/rust-lang/libc" 27 | [dependencies.rustc-std-workspace-core] 28 | version = "1.0.0" 29 | optional = true 30 | 31 | [features] 32 | align = [] 33 | const-extern-fn = [] 34 | default = ["std"] 35 | extra_traits = [] 36 | rustc-dep-of-std = ["align", "rustc-std-workspace-core"] 37 | std = [] 38 | use_std = ["std"] 39 | [badges.azure-devops] 40 | pipeline = "rust-lang.libc%20(1)" 41 | project = "rust-lang2/libc" 42 | 43 | [badges.cirrus-ci] 44 | branch = "master" 45 | repository = "rust-lang/libc" 46 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_crates_regex.rs: -------------------------------------------------------------------------------- 1 | extern crate quickcheck; 2 | extern crate regex; 3 | 4 | /* 5 | * This test is a minimal version of and 6 | * 7 | * Once this bug gets fixed, uncomment rofl_0 and subdiff_0 8 | * (in `tests/crates_regex.rs`). 9 | #[test] 10 | fn word_boundary_backtracking_default_mismatch() { 11 | use regex::internal::ExecBuilder; 12 | 13 | let backtrack_re = ExecBuilder::new(r"\b") 14 | .bounded_backtracking() 15 | .build() 16 | .map(|exec| exec.into_regex()) 17 | .map_err(|err| format!("{}", err)) 18 | .unwrap(); 19 | 20 | let default_re = ExecBuilder::new(r"\b") 21 | .build() 22 | .map(|exec| exec.into_regex()) 23 | .map_err(|err| format!("{}", err)) 24 | .unwrap(); 25 | 26 | let input = "䅅\\u{a0}"; 27 | 28 | let fi1 = backtrack_re.find_iter(input); 29 | let fi2 = default_re.find_iter(input); 30 | for (m1, m2) in fi1.zip(fi2) { 31 | assert_eq!(m1, m2); 32 | } 33 | } 34 | */ 35 | 36 | mod consistent; 37 | 38 | mod crates_regex { 39 | 40 | macro_rules! consistent { 41 | ($test_name:ident, $regex_src:expr) => { 42 | #[test] 43 | fn $test_name() { 44 | use super::consistent::backends_are_consistent; 45 | 46 | if option_env!("RUST_REGEX_RANDOM_TEST").is_some() { 47 | match backends_are_consistent($regex_src) { 48 | Ok(_) => {} 49 | Err(err) => panic!("{}", err), 50 | } 51 | } 52 | } 53 | }; 54 | } 55 | 56 | include!("crates_regex.rs"); 57 | } 58 | -------------------------------------------------------------------------------- /vendor/lazy_static/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "lazy_static" 15 | version = "1.4.0" 16 | authors = ["Marvin Löbel "] 17 | exclude = ["/.travis.yml", "/appveyor.yml"] 18 | description = "A macro for declaring lazily evaluated statics in Rust." 19 | documentation = "https://docs.rs/lazy_static" 20 | readme = "README.md" 21 | keywords = ["macro", "lazy", "static"] 22 | categories = ["no-std", "rust-patterns", "memory-management"] 23 | license = "MIT/Apache-2.0" 24 | repository = "https://github.com/rust-lang-nursery/lazy-static.rs" 25 | [dependencies.spin] 26 | version = "0.5.0" 27 | optional = true 28 | [dev-dependencies.doc-comment] 29 | version = "0.3.1" 30 | 31 | [features] 32 | spin_no_std = ["spin"] 33 | [badges.appveyor] 34 | repository = "rust-lang-nursery/lazy-static.rs" 35 | 36 | [badges.is-it-maintained-issue-resolution] 37 | repository = "rust-lang-nursery/lazy-static.rs" 38 | 39 | [badges.is-it-maintained-open-issues] 40 | repository = "rust-lang-nursery/lazy-static.rs" 41 | 42 | [badges.maintenance] 43 | status = "passively-maintained" 44 | 45 | [badges.travis-ci] 46 | repository = "rust-lang-nursery/lazy-static.rs" 47 | -------------------------------------------------------------------------------- /vendor/memchr/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"7f0cb3d85439207568f7bb264b9fd5c8c5f5dedf9ee428813ee5d686ca37df18","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"d2ab7c9c77235b68d1cc856ab5ef7b5115312098469edcac9d5611c5b74d3cd1","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","build.rs":"ed35d244304888581bfcbdc52596721a5bbb908bcbd56bbdfe977800ef3042e1","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/c.rs":"86fe35cbb46c8bece9927fbde20f1ca3af526defdde05ac969ad2f4bc9bb25e9","src/fallback.rs":"79519255d480a9c2667c06f9287931cfc2b85f6af6fcf92d453a11ee161dcb74","src/iter.rs":"23b1066d6b40159fe944388db7743c89422b1110ddb44667fde6d722f178ed4e","src/lib.rs":"8278d5f65db8081fa5ad3a0d17dac54d30de3d7a01b0dc4479927156e40b225c","src/naive.rs":"c7453bc99cc4e58eb37cf5a50c88688833e50a270ee1849baefddb8acc0ccd94","src/tests/iter.rs":"8d5999a2a5b8a3228c76cd82cd3ee86dfa6f7b4022405b1f06eedf7d74e4c704","src/tests/memchr.rs":"f30074eeab99a16ce5ca8a30f1890f86c43c0422523a7195cbb3ca5f3e465b67","src/tests/miri.rs":"27859a7ac1d0a9305b2d114e6dd8876f3d5e47fc46a81be96239c793ac6edb1f","src/tests/mod.rs":"2ad0c82d33b32562087254522641ea7bfa2a283130152be5e927a33f1978ebc7","src/x86/avx.rs":"b19987410e49a079f33162424c42494626c91303c41824961e478be3b537c9c9","src/x86/mod.rs":"0b13becaabc150a0099f7528226c82e288136cc7ebcdb8e96cf5ee9aae0f05b6","src/x86/sse2.rs":"7c1b8248a8cd48396cb70a862d77f9a972f1e16324d65c260f39d13af73bf638","src/x86/sse42.rs":"f671ae9dd2b518a823e499a09ce32d4957bc5ae043db90d61c027e32f688f2b2"},"package":"3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"} -------------------------------------------------------------------------------- /vendor/regex-syntax/src/unicode_tables/perl_decimal.rs: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: 2 | // 3 | // ucd-generate general-category ucd-13.0.0 --chars --include decimalnumber 4 | // 5 | // ucd-generate 0.2.7 is available on crates.io. 6 | 7 | pub const BY_NAME: &'static [(&'static str, &'static [(char, char)])] = 8 | &[("Decimal_Number", DECIMAL_NUMBER)]; 9 | 10 | pub const DECIMAL_NUMBER: &'static [(char, char)] = &[ 11 | ('0', '9'), 12 | ('٠', '٩'), 13 | ('۰', '۹'), 14 | ('߀', '߉'), 15 | ('०', '९'), 16 | ('০', '৯'), 17 | ('੦', '੯'), 18 | ('૦', '૯'), 19 | ('୦', '୯'), 20 | ('௦', '௯'), 21 | ('౦', '౯'), 22 | ('೦', '೯'), 23 | ('൦', '൯'), 24 | ('෦', '෯'), 25 | ('๐', '๙'), 26 | ('໐', '໙'), 27 | ('༠', '༩'), 28 | ('၀', '၉'), 29 | ('႐', '႙'), 30 | ('០', '៩'), 31 | ('᠐', '᠙'), 32 | ('᥆', '᥏'), 33 | ('᧐', '᧙'), 34 | ('᪀', '᪉'), 35 | ('᪐', '᪙'), 36 | ('᭐', '᭙'), 37 | ('᮰', '᮹'), 38 | ('᱀', '᱉'), 39 | ('᱐', '᱙'), 40 | ('꘠', '꘩'), 41 | ('꣐', '꣙'), 42 | ('꤀', '꤉'), 43 | ('꧐', '꧙'), 44 | ('꧰', '꧹'), 45 | ('꩐', '꩙'), 46 | ('꯰', '꯹'), 47 | ('0', '9'), 48 | ('𐒠', '𐒩'), 49 | ('𐴰', '𐴹'), 50 | ('𑁦', '𑁯'), 51 | ('𑃰', '𑃹'), 52 | ('𑄶', '𑄿'), 53 | ('𑇐', '𑇙'), 54 | ('𑋰', '𑋹'), 55 | ('𑑐', '𑑙'), 56 | ('𑓐', '𑓙'), 57 | ('𑙐', '𑙙'), 58 | ('𑛀', '𑛉'), 59 | ('𑜰', '𑜹'), 60 | ('𑣠', '𑣩'), 61 | ('\u{11950}', '\u{11959}'), 62 | ('𑱐', '𑱙'), 63 | ('𑵐', '𑵙'), 64 | ('𑶠', '𑶩'), 65 | ('𖩠', '𖩩'), 66 | ('𖭐', '𖭙'), 67 | ('𝟎', '𝟿'), 68 | ('𞅀', '𞅉'), 69 | ('𞋰', '𞋹'), 70 | ('𞥐', '𞥙'), 71 | ('\u{1fbf0}', '\u{1fbf9}'), 72 | ]; 73 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type nlink_t = u32; 4 | pub type blksize_t = ::c_long; 5 | pub type __u64 = ::c_ulonglong; 6 | 7 | s! { 8 | pub struct pthread_attr_t { 9 | __size: [u32; 9] 10 | } 11 | 12 | pub struct sigset_t { 13 | __val: [::c_ulong; 32], 14 | } 15 | 16 | pub struct msghdr { 17 | pub msg_name: *mut ::c_void, 18 | pub msg_namelen: ::socklen_t, 19 | pub msg_iov: *mut ::iovec, 20 | pub msg_iovlen: ::c_int, 21 | pub msg_control: *mut ::c_void, 22 | pub msg_controllen: ::socklen_t, 23 | pub msg_flags: ::c_int, 24 | } 25 | 26 | pub struct cmsghdr { 27 | pub cmsg_len: ::socklen_t, 28 | pub cmsg_level: ::c_int, 29 | pub cmsg_type: ::c_int, 30 | } 31 | 32 | pub struct sem_t { 33 | __val: [::c_int; 4], 34 | } 35 | } 36 | 37 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; 38 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; 39 | 40 | pub const TIOCINQ: ::c_int = ::FIONREAD; 41 | 42 | extern "C" { 43 | pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; 44 | } 45 | 46 | cfg_if! { 47 | if #[cfg(any(target_arch = "x86"))] { 48 | mod x86; 49 | pub use self::x86::*; 50 | } else if #[cfg(any(target_arch = "mips"))] { 51 | mod mips; 52 | pub use self::mips::*; 53 | } else if #[cfg(any(target_arch = "arm"))] { 54 | mod arm; 55 | pub use self::arm::*; 56 | } else if #[cfg(any(target_arch = "powerpc"))] { 57 | mod powerpc; 58 | pub use self::powerpc::*; 59 | } else if #[cfg(any(target_arch = "hexagon"))] { 60 | mod hexagon; 61 | pub use self::hexagon::*; 62 | } else { 63 | // Unknown target_arch 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/byteorder/README.md: -------------------------------------------------------------------------------- 1 | This crate provides convenience methods for encoding and decoding 2 | numbers in either big-endian or little-endian order. 3 | 4 | [![Build status](https://api.travis-ci.org/BurntSushi/byteorder.svg)](https://travis-ci.org/BurntSushi/byteorder) 5 | [![](http://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder) 6 | 7 | Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org). 8 | 9 | 10 | ### Documentation 11 | 12 | https://docs.rs/byteorder 13 | 14 | 15 | ### Installation 16 | 17 | This crate works with Cargo and is on 18 | [crates.io](https://crates.io/crates/byteorder). Add it to your `Cargo.toml` 19 | like so: 20 | 21 | ```toml 22 | [dependencies] 23 | byteorder = "1" 24 | ``` 25 | 26 | If you want to augment existing `Read` and `Write` traits, then import the 27 | extension methods like so: 28 | 29 | ```rust 30 | extern crate byteorder; 31 | 32 | use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian}; 33 | ``` 34 | 35 | For example: 36 | 37 | ```rust 38 | use std::io::Cursor; 39 | use byteorder::{BigEndian, ReadBytesExt}; 40 | 41 | let mut rdr = Cursor::new(vec![2, 5, 3, 0]); 42 | // Note that we use type parameters to indicate which kind of byte order 43 | // we want! 44 | assert_eq!(517, rdr.read_u16::().unwrap()); 45 | assert_eq!(768, rdr.read_u16::().unwrap()); 46 | ``` 47 | 48 | ### `no_std` crates 49 | 50 | This crate has a feature, `std`, that is enabled by default. To use this crate 51 | in a `no_std` context, add the following to your `Cargo.toml`: 52 | 53 | ```toml 54 | [dependencies] 55 | byteorder = { version = "1", default-features = false } 56 | ``` 57 | 58 | 59 | ### Alternatives 60 | 61 | Note that as of Rust 1.32, the standard numeric types provide built-in methods 62 | like `to_le_bytes` and `from_le_bytes`, which support some of the same use 63 | cases. 64 | -------------------------------------------------------------------------------- /vendor/once_cell/examples/regex.rs: -------------------------------------------------------------------------------- 1 | use std::{str::FromStr, time::Instant}; 2 | 3 | use regex::Regex; 4 | 5 | macro_rules! regex { 6 | ($re:literal $(,)?) => {{ 7 | static RE: once_cell::sync::OnceCell = once_cell::sync::OnceCell::new(); 8 | RE.get_or_init(|| regex::Regex::new($re).unwrap()) 9 | }}; 10 | } 11 | 12 | fn slow() { 13 | let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##; 14 | 15 | let mut total = 0; 16 | for _ in 0..1000 { 17 | let re = Regex::new( 18 | r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##, 19 | ) 20 | .unwrap(); 21 | let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); 22 | total += size; 23 | } 24 | println!("{}", total); 25 | } 26 | 27 | fn fast() { 28 | let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##; 29 | 30 | let mut total = 0; 31 | for _ in 0..1000 { 32 | let re: &Regex = regex!( 33 | r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##, 34 | ); 35 | let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); 36 | total += size; 37 | } 38 | println!("{}", total); 39 | } 40 | 41 | fn main() { 42 | let t = Instant::now(); 43 | slow(); 44 | println!("slow: {:?}", t.elapsed()); 45 | 46 | let t = Instant::now(); 47 | fast(); 48 | println!("fast: {:?}", t.elapsed()); 49 | } 50 | -------------------------------------------------------------------------------- /vendor/lazy_static/src/inline_lazy.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2016 lazy-static.rs Developers 2 | // 3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be 6 | // copied, modified, or distributed except according to those terms. 7 | 8 | extern crate core; 9 | extern crate std; 10 | 11 | use self::std::prelude::v1::*; 12 | use self::std::cell::Cell; 13 | use self::std::hint::unreachable_unchecked; 14 | use self::std::sync::Once; 15 | #[allow(deprecated)] 16 | pub use self::std::sync::ONCE_INIT; 17 | 18 | // FIXME: Replace Option with MaybeUninit (stable since 1.36.0) 19 | pub struct Lazy(Cell>, Once); 20 | 21 | impl Lazy { 22 | #[allow(deprecated)] 23 | pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); 24 | 25 | #[inline(always)] 26 | pub fn get(&'static self, f: F) -> &T 27 | where 28 | F: FnOnce() -> T, 29 | { 30 | self.1.call_once(|| { 31 | self.0.set(Some(f())); 32 | }); 33 | 34 | // `self.0` is guaranteed to be `Some` by this point 35 | // The `Once` will catch and propagate panics 36 | unsafe { 37 | match *self.0.as_ptr() { 38 | Some(ref x) => x, 39 | None => { 40 | debug_assert!(false, "attempted to derefence an uninitialized lazy static. This is a bug"); 41 | 42 | unreachable_unchecked() 43 | }, 44 | } 45 | } 46 | } 47 | } 48 | 49 | unsafe impl Sync for Lazy {} 50 | 51 | #[macro_export] 52 | #[doc(hidden)] 53 | macro_rules! __lazy_static_create { 54 | ($NAME:ident, $T:ty) => { 55 | static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/x86_64/l4re.rs: -------------------------------------------------------------------------------- 1 | /// L4Re specifics 2 | /// This module contains definitions required by various L4Re libc backends. 3 | /// Some of them are formally not part of the libc, but are a dependency of the 4 | /// libc and hence we should provide them here. 5 | 6 | pub type l4_umword_t = ::c_ulong; // Unsigned machine word. 7 | pub type pthread_t = *mut ::c_void; 8 | 9 | s! { 10 | /// CPU sets. 11 | pub struct l4_sched_cpu_set_t { 12 | // from the L4Re docs 13 | /// Combination of granularity and offset. 14 | /// 15 | /// The granularity defines how many CPUs each bit in map describes. 16 | /// The offset is the numer of the first CPU described by the first 17 | /// bit in the bitmap. 18 | /// offset must be a multiple of 2^graularity. 19 | /// 20 | /// | MSB | LSB | 21 | /// | ---------------- | ------------------- | 22 | /// | 8bit granularity | 24bit offset .. | 23 | gran_offset: l4_umword_t , 24 | /// Bitmap of CPUs. 25 | map: l4_umword_t , 26 | } 27 | } 28 | 29 | #[cfg(target_os = "l4re")] 30 | #[allow(missing_debug_implementations)] 31 | pub struct pthread_attr_t { 32 | pub __detachstate: ::c_int, 33 | pub __schedpolicy: ::c_int, 34 | pub __schedparam: super::__sched_param, 35 | pub __inheritsched: ::c_int, 36 | pub __scope: ::c_int, 37 | pub __guardsize: ::size_t, 38 | pub __stackaddr_set: ::c_int, 39 | pub __stackaddr: *mut ::c_void, // better don't use it 40 | pub __stacksize: ::size_t, 41 | // L4Re specifics 42 | pub affinity: l4_sched_cpu_set_t, 43 | pub create_flags: ::c_uint, 44 | } 45 | 46 | // L4Re requires a min stack size of 64k; that isn't defined in uClibc, but 47 | // somewhere in the core libraries. uClibc wants 16k, but that's not enough. 48 | pub const PTHREAD_STACK_MIN: usize = 65536; 49 | -------------------------------------------------------------------------------- /vendor/regex/tests/test_default_bytes.rs: -------------------------------------------------------------------------------- 1 | extern crate rand; 2 | extern crate regex; 3 | 4 | macro_rules! regex_new { 5 | ($re:expr) => {{ 6 | use regex::bytes::Regex; 7 | Regex::new($re) 8 | }}; 9 | } 10 | 11 | macro_rules! regex_set_new { 12 | ($res:expr) => {{ 13 | use regex::bytes::RegexSet; 14 | RegexSet::new($res) 15 | }}; 16 | } 17 | 18 | macro_rules! regex { 19 | ($re:expr) => { 20 | regex_new!($re).unwrap() 21 | }; 22 | } 23 | 24 | macro_rules! regex_set { 25 | ($res:expr) => { 26 | regex_set_new!($res).unwrap() 27 | }; 28 | } 29 | 30 | // Must come before other module definitions. 31 | include!("macros_bytes.rs"); 32 | include!("macros.rs"); 33 | 34 | // A silly wrapper to make it possible to write and match raw bytes. 35 | struct R<'a>(&'a [u8]); 36 | impl<'a> R<'a> { 37 | fn as_bytes(&self) -> &'a [u8] { 38 | self.0 39 | } 40 | } 41 | 42 | // See: https://github.com/rust-lang/regex/issues/321 43 | // 44 | // These tests are here because they do not have the same behavior in every 45 | // regex engine. 46 | mat!(invalid_utf8_nfa1, r".", R(b"\xD4\xC2\x65\x2B\x0E\xFE"), Some((2, 3))); 47 | mat!(invalid_utf8_nfa2, r"${2}ä", R(b"\xD4\xC2\x65\x2B\x0E\xFE"), None); 48 | mat!( 49 | invalid_utf8_nfa3, 50 | r".", 51 | R(b"\x0A\xDB\x82\x6E\x33\x01\xDD\x33\xCD"), 52 | Some((1, 3)) 53 | ); 54 | mat!( 55 | invalid_utf8_nfa4, 56 | r"${2}ä", 57 | R(b"\x0A\xDB\x82\x6E\x33\x01\xDD\x33\xCD"), 58 | None 59 | ); 60 | 61 | mod api; 62 | mod bytes; 63 | mod crazy; 64 | mod flags; 65 | mod fowler; 66 | mod multiline; 67 | mod noparse; 68 | mod regression; 69 | mod replace; 70 | mod set; 71 | mod shortest_match; 72 | mod suffix_reverse; 73 | #[cfg(feature = "unicode")] 74 | mod unicode; 75 | #[cfg(feature = "unicode-perl")] 76 | mod word_boundary; 77 | #[cfg(feature = "unicode-perl")] 78 | mod word_boundary_unicode; 79 | -------------------------------------------------------------------------------- /vendor/regex/tests/noparse.rs: -------------------------------------------------------------------------------- 1 | macro_rules! noparse( 2 | ($name:ident, $re:expr) => ( 3 | #[test] 4 | fn $name() { 5 | let re = $re; 6 | match regex_new!(re) { 7 | Err(_) => {}, 8 | Ok(_) => panic!("Regex '{}' should cause a parse error.", re), 9 | } 10 | } 11 | ); 12 | ); 13 | 14 | noparse!(fail_no_repeat_arg, "*"); 15 | noparse!(fail_incomplete_escape, "\\"); 16 | noparse!(fail_class_incomplete, "[A-"); 17 | noparse!(fail_class_not_closed, "[A"); 18 | noparse!(fail_class_no_begin, r"[\A]"); 19 | noparse!(fail_class_no_end, r"[\z]"); 20 | noparse!(fail_class_no_boundary, r"[\b]"); 21 | noparse!(fail_open_paren, "("); 22 | noparse!(fail_close_paren, ")"); 23 | noparse!(fail_invalid_range, "[a-Z]"); 24 | noparse!(fail_empty_capture_name, "(?P<>a)"); 25 | noparse!(fail_bad_capture_name, "(?P)"); 26 | noparse!(fail_bad_flag, "(?a)a"); 27 | noparse!(fail_too_big, "a{10000000}"); 28 | noparse!(fail_counted_no_close, "a{1001"); 29 | noparse!(fail_unfinished_cap, "(?"); 30 | noparse!(fail_unfinished_escape, "\\"); 31 | noparse!(fail_octal_digit, r"\8"); 32 | noparse!(fail_hex_digit, r"\xG0"); 33 | noparse!(fail_hex_short, r"\xF"); 34 | noparse!(fail_hex_long_digits, r"\x{fffg}"); 35 | noparse!(fail_flag_bad, "(?a)"); 36 | noparse!(fail_flag_empty, "(?)"); 37 | noparse!(fail_double_neg, "(?-i-i)"); 38 | noparse!(fail_neg_empty, "(?i-)"); 39 | noparse!(fail_dupe_named, "(?P.)(?P.)"); 40 | noparse!(fail_range_end_no_class, "[a-[:lower:]]"); 41 | noparse!(fail_range_end_no_begin, r"[a-\A]"); 42 | noparse!(fail_range_end_no_end, r"[a-\z]"); 43 | noparse!(fail_range_end_no_boundary, r"[a-\b]"); 44 | noparse!(fail_empty_alt1, r"|z"); 45 | noparse!(fail_empty_alt2, r"z|"); 46 | noparse!(fail_empty_alt3, r"|"); 47 | noparse!(fail_empty_alt4, r"||"); 48 | noparse!(fail_empty_alt5, r"()|z"); 49 | noparse!(fail_empty_alt6, r"z|()"); 50 | noparse!(fail_empty_alt7, r"(|)"); 51 | -------------------------------------------------------------------------------- /vendor/regex/examples/shootout-regex-dna-single.rs: -------------------------------------------------------------------------------- 1 | // The Computer Language Benchmarks Game 2 | // http://benchmarksgame.alioth.debian.org/ 3 | // 4 | // contributed by the Rust Project Developers 5 | // contributed by TeXitoi 6 | // contributed by BurntSushi 7 | 8 | extern crate regex; 9 | 10 | use std::io::{self, Read}; 11 | 12 | macro_rules! regex { 13 | ($re:expr) => { 14 | ::regex::Regex::new($re).unwrap() 15 | }; 16 | } 17 | 18 | fn main() { 19 | let mut seq = String::with_capacity(50 * (1 << 20)); 20 | io::stdin().read_to_string(&mut seq).unwrap(); 21 | let ilen = seq.len(); 22 | 23 | seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); 24 | let clen = seq.len(); 25 | 26 | let variants = vec![ 27 | regex!("agggtaaa|tttaccct"), 28 | regex!("[cgt]gggtaaa|tttaccc[acg]"), 29 | regex!("a[act]ggtaaa|tttacc[agt]t"), 30 | regex!("ag[act]gtaaa|tttac[agt]ct"), 31 | regex!("agg[act]taaa|ttta[agt]cct"), 32 | regex!("aggg[acg]aaa|ttt[cgt]ccct"), 33 | regex!("agggt[cgt]aa|tt[acg]accct"), 34 | regex!("agggta[cgt]a|t[acg]taccct"), 35 | regex!("agggtaa[cgt]|[acg]ttaccct"), 36 | ]; 37 | for re in variants { 38 | println!("{} {}", re.to_string(), re.find_iter(&seq).count()); 39 | } 40 | 41 | let substs = vec![ 42 | (regex!("B"), "(c|g|t)"), 43 | (regex!("D"), "(a|g|t)"), 44 | (regex!("H"), "(a|c|t)"), 45 | (regex!("K"), "(g|t)"), 46 | (regex!("M"), "(a|c)"), 47 | (regex!("N"), "(a|c|g|t)"), 48 | (regex!("R"), "(a|g)"), 49 | (regex!("S"), "(c|g)"), 50 | (regex!("V"), "(a|c|g)"), 51 | (regex!("W"), "(a|t)"), 52 | (regex!("Y"), "(c|t)"), 53 | ]; 54 | let mut seq = seq; 55 | for (re, replacement) in substs { 56 | seq = re.replace_all(&seq, replacement).into_owned(); 57 | } 58 | println!("\n{}\n{}\n{}", ilen, clen, seq.len()); 59 | } 60 | -------------------------------------------------------------------------------- /vendor/memchr/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | enable_simd_optimizations(); 5 | enable_libc(); 6 | } 7 | 8 | // This adds various simd cfgs if this compiler supports it. 9 | // 10 | // This can be disabled with RUSTFLAGS="--cfg memchr_disable_auto_simd", but 11 | // this is generally only intended for testing. 12 | fn enable_simd_optimizations() { 13 | if is_env_set("CARGO_CFG_MEMCHR_DISABLE_AUTO_SIMD") { 14 | return; 15 | } 16 | println!("cargo:rustc-cfg=memchr_runtime_simd"); 17 | println!("cargo:rustc-cfg=memchr_runtime_sse2"); 18 | println!("cargo:rustc-cfg=memchr_runtime_sse42"); 19 | println!("cargo:rustc-cfg=memchr_runtime_avx"); 20 | } 21 | 22 | // This adds a `memchr_libc` cfg if and only if libc can be used, if no other 23 | // better option is available. 24 | // 25 | // This could be performed in the source code, but it's simpler to do it once 26 | // here and consolidate it into one cfg knob. 27 | // 28 | // Basically, we use libc only if its enabled and if we aren't targeting a 29 | // known bad platform. For example, wasm32 doesn't have a libc and the 30 | // performance of memchr on Windows is seemingly worse than the fallback 31 | // implementation. 32 | fn enable_libc() { 33 | const NO_ARCH: &'static [&'static str] = &["wasm32", "windows"]; 34 | const NO_ENV: &'static [&'static str] = &["sgx"]; 35 | 36 | if !is_feature_set("LIBC") { 37 | return; 38 | } 39 | 40 | let arch = match env::var("CARGO_CFG_TARGET_ARCH") { 41 | Err(_) => return, 42 | Ok(arch) => arch, 43 | }; 44 | let env = match env::var("CARGO_CFG_TARGET_ENV") { 45 | Err(_) => return, 46 | Ok(env) => env, 47 | }; 48 | if NO_ARCH.contains(&&*arch) || NO_ENV.contains(&&*env) { 49 | return; 50 | } 51 | 52 | println!("cargo:rustc-cfg=memchr_libc"); 53 | } 54 | 55 | fn is_feature_set(name: &str) -> bool { 56 | is_env_set(&format!("CARGO_FEATURE_{}", name)) 57 | } 58 | 59 | fn is_env_set(name: &str) -> bool { 60 | env::var_os(name).is_some() 61 | } 62 | -------------------------------------------------------------------------------- /vendor/once_cell/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | edition = "2018" 15 | name = "once_cell" 16 | version = "1.3.1" 17 | authors = ["Aleksey Kladov "] 18 | exclude = ["*.png", "*.svg", "/Cargo.lock.min", "/.travis.yml", "/run-miri-tests.sh", "rustfmt.toml"] 19 | description = "Single assignment cells and lazy values." 20 | documentation = "https://docs.rs/once_cell" 21 | readme = "README.md" 22 | keywords = ["lazy", "static"] 23 | categories = ["rust-patterns", "memory-management"] 24 | license = "MIT OR Apache-2.0" 25 | repository = "https://github.com/matklad/once_cell" 26 | 27 | [[example]] 28 | name = "bench" 29 | required-features = ["std"] 30 | 31 | [[example]] 32 | name = "bench_acquire" 33 | required-features = ["std"] 34 | 35 | [[example]] 36 | name = "bench_vs_lazy_static" 37 | required-features = ["std"] 38 | 39 | [[example]] 40 | name = "lazy_static" 41 | required-features = ["std"] 42 | 43 | [[example]] 44 | name = "reentrant_init_deadlocks" 45 | required-features = ["std"] 46 | 47 | [[example]] 48 | name = "regex" 49 | required-features = ["std"] 50 | 51 | [[example]] 52 | name = "test_synchronization" 53 | required-features = ["std"] 54 | [dependencies.parking_lot] 55 | version = "0.9.0" 56 | optional = true 57 | default_features = false 58 | [dev-dependencies.crossbeam-utils] 59 | version = "0.6.0" 60 | 61 | [dev-dependencies.lazy_static] 62 | version = "1.0.0" 63 | 64 | [dev-dependencies.regex] 65 | version = "1.2.0" 66 | 67 | [features] 68 | default = ["std"] 69 | std = [] 70 | -------------------------------------------------------------------------------- /vendor/libc/src/fuchsia/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type __u64 = ::c_ulonglong; 3 | pub type wchar_t = u32; 4 | pub type nlink_t = ::c_ulong; 5 | pub type blksize_t = ::c_long; 6 | 7 | s! { 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | __pad0: ::c_ulong, 17 | pub st_size: ::off_t, 18 | pub st_blksize: ::blksize_t, 19 | __pad1: ::c_int, 20 | pub st_blocks: ::blkcnt_t, 21 | pub st_atime: ::time_t, 22 | pub st_atime_nsec: ::c_long, 23 | pub st_mtime: ::time_t, 24 | pub st_mtime_nsec: ::c_long, 25 | pub st_ctime: ::time_t, 26 | pub st_ctime_nsec: ::c_long, 27 | __unused: [::c_uint; 2], 28 | } 29 | 30 | pub struct stat64 { 31 | pub st_dev: ::dev_t, 32 | pub st_ino: ::ino_t, 33 | pub st_mode: ::mode_t, 34 | pub st_nlink: ::nlink_t, 35 | pub st_uid: ::uid_t, 36 | pub st_gid: ::gid_t, 37 | pub st_rdev: ::dev_t, 38 | __pad0: ::c_ulong, 39 | pub st_size: ::off_t, 40 | pub st_blksize: ::blksize_t, 41 | __pad1: ::c_int, 42 | pub st_blocks: ::blkcnt_t, 43 | pub st_atime: ::time_t, 44 | pub st_atime_nsec: ::c_long, 45 | pub st_mtime: ::time_t, 46 | pub st_mtime_nsec: ::c_long, 47 | pub st_ctime: ::time_t, 48 | pub st_ctime_nsec: ::c_long, 49 | __unused: [::c_uint; 2], 50 | } 51 | 52 | pub struct ipc_perm { 53 | pub __ipc_perm_key: ::key_t, 54 | pub uid: ::uid_t, 55 | pub gid: ::gid_t, 56 | pub cuid: ::uid_t, 57 | pub cgid: ::gid_t, 58 | pub mode: ::mode_t, 59 | pub __seq: ::c_ushort, 60 | __unused1: ::c_ulong, 61 | __unused2: ::c_ulong, 62 | } 63 | } 64 | 65 | pub const MINSIGSTKSZ: ::size_t = 6144; 66 | pub const SIGSTKSZ: ::size_t = 12288; 67 | -------------------------------------------------------------------------------- /vendor/regex/src/pattern.rs: -------------------------------------------------------------------------------- 1 | use std::str::pattern::{Pattern, SearchStep, Searcher}; 2 | 3 | use re_unicode::{Matches, Regex}; 4 | 5 | pub struct RegexSearcher<'r, 't> { 6 | haystack: &'t str, 7 | it: Matches<'r, 't>, 8 | last_step_end: usize, 9 | next_match: Option<(usize, usize)>, 10 | } 11 | 12 | impl<'r, 't> Pattern<'t> for &'r Regex { 13 | type Searcher = RegexSearcher<'r, 't>; 14 | 15 | fn into_searcher(self, haystack: &'t str) -> RegexSearcher<'r, 't> { 16 | RegexSearcher { 17 | haystack: haystack, 18 | it: self.find_iter(haystack), 19 | last_step_end: 0, 20 | next_match: None, 21 | } 22 | } 23 | } 24 | 25 | unsafe impl<'r, 't> Searcher<'t> for RegexSearcher<'r, 't> { 26 | #[inline] 27 | fn haystack(&self) -> &'t str { 28 | self.haystack 29 | } 30 | 31 | #[inline] 32 | fn next(&mut self) -> SearchStep { 33 | if let Some((s, e)) = self.next_match { 34 | self.next_match = None; 35 | self.last_step_end = e; 36 | return SearchStep::Match(s, e); 37 | } 38 | match self.it.next() { 39 | None => { 40 | if self.last_step_end < self.haystack().len() { 41 | let last = self.last_step_end; 42 | self.last_step_end = self.haystack().len(); 43 | SearchStep::Reject(last, self.haystack().len()) 44 | } else { 45 | SearchStep::Done 46 | } 47 | } 48 | Some(m) => { 49 | let (s, e) = (m.start(), m.end()); 50 | if s == self.last_step_end { 51 | self.last_step_end = e; 52 | SearchStep::Match(s, e) 53 | } else { 54 | self.next_match = Some((s, e)); 55 | let last = self.last_step_end; 56 | self.last_step_end = s; 57 | SearchStep::Reject(last, s) 58 | } 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![feature(test)] 3 | #![feature(asm)] 4 | 5 | mod memory; 6 | mod packet; 7 | mod link; 8 | mod engine; 9 | mod config; 10 | mod lib; 11 | mod basic_apps; 12 | mod header; 13 | mod ethernet; 14 | mod ixy82599; 15 | mod ixy82599_app; 16 | mod checksum; 17 | 18 | fn main() { 19 | println!("This could be the beginning of a beautiful network function..."); 20 | } 21 | 22 | #[cfg(test)] 23 | mod tests { 24 | use super::*; 25 | use std::time::{Duration,Instant}; 26 | 27 | #[test] 28 | fn basic1 () { 29 | let npackets = match std::env::var("RUSH_BASIC1_NPACKETS") { 30 | Ok(val) => val.parse::().unwrap() as u64, 31 | _ => 1_000_000 32 | }; 33 | let mut c = config::new(); 34 | config::app(&mut c, "Source", &basic_apps::Source {size: 60}); 35 | config::app(&mut c, "Tee", &basic_apps::Tee {}); 36 | config::app(&mut c, "Sink", &basic_apps::Sink {}); 37 | config::link(&mut c, "Source.tx -> Tee.rx"); 38 | config::link(&mut c, "Tee.tx1 -> Sink.rx1"); 39 | config::link(&mut c, "Tee.tx2 -> Sink.rx2"); 40 | engine::configure(&c); 41 | let start = Instant::now(); 42 | let output = engine::state().app_table 43 | .get("Source").unwrap() 44 | .output.get("tx").unwrap(); 45 | let mut report = engine::throttle(Duration::new(1, 0)); 46 | while output.borrow().txpackets < npackets { 47 | engine::main(Some(engine::Options{ 48 | duration: Some(Duration::new(0, 10_000_000)), // 0.01s 49 | no_report: true, 50 | ..Default::default() 51 | })); 52 | if report() { engine::report_load(); } 53 | } 54 | let finish = Instant::now(); 55 | let runtime = finish.duration_since(start).as_secs_f64(); 56 | let packets = output.borrow().txpackets as f64; 57 | println!("Processed {:.1} million packets in {:.2} seconds (rate: {:.1} Mpps).", 58 | packets / 1e6, runtime, packets / runtime / 1e6); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /vendor/thread_local/src/thread_id.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Amanieu d'Antras 2 | // 3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be 6 | // copied, modified, or distributed except according to those terms. 7 | 8 | use std::collections::BinaryHeap; 9 | use std::sync::Mutex; 10 | use std::usize; 11 | 12 | // Thread ID manager which allocates thread IDs. It attempts to aggressively 13 | // reuse thread IDs where possible to avoid cases where a ThreadLocal grows 14 | // indefinitely when it is used by many short-lived threads. 15 | struct ThreadIdManager { 16 | limit: usize, 17 | free_list: BinaryHeap, 18 | } 19 | impl ThreadIdManager { 20 | fn new() -> ThreadIdManager { 21 | ThreadIdManager { 22 | limit: usize::MAX, 23 | free_list: BinaryHeap::new(), 24 | } 25 | } 26 | fn alloc(&mut self) -> usize { 27 | if let Some(id) = self.free_list.pop() { 28 | id 29 | } else { 30 | let id = self.limit; 31 | self.limit = self.limit.checked_sub(1).expect("Ran out of thread IDs"); 32 | id 33 | } 34 | } 35 | fn free(&mut self, id: usize) { 36 | self.free_list.push(id); 37 | } 38 | } 39 | lazy_static! { 40 | static ref THREAD_ID_MANAGER: Mutex = Mutex::new(ThreadIdManager::new()); 41 | } 42 | 43 | // Non-zero integer which is unique to the current thread while it is running. 44 | // A thread ID may be reused after a thread exits. 45 | struct ThreadId(usize); 46 | impl ThreadId { 47 | fn new() -> ThreadId { 48 | ThreadId(THREAD_ID_MANAGER.lock().unwrap().alloc()) 49 | } 50 | } 51 | impl Drop for ThreadId { 52 | fn drop(&mut self) { 53 | THREAD_ID_MANAGER.lock().unwrap().free(self.0); 54 | } 55 | } 56 | thread_local!(static THREAD_ID: ThreadId = ThreadId::new()); 57 | 58 | /// Returns a non-zero ID for the current thread 59 | pub fn get() -> usize { 60 | THREAD_ID.with(|x| x.0) 61 | } 62 | -------------------------------------------------------------------------------- /vendor/once_cell/README.md: -------------------------------------------------------------------------------- 1 |

once_cell

2 | 3 | 4 | [![Build Status](https://travis-ci.org/matklad/once_cell.svg?branch=master)](https://travis-ci.org/matklad/once_cell) 5 | [![Crates.io](https://img.shields.io/crates/v/once_cell.svg)](https://crates.io/crates/once_cell) 6 | [![API reference](https://docs.rs/once_cell/badge.svg)](https://docs.rs/once_cell/) 7 | 8 | # Overview 9 | 10 | `once_cell` provides two new cell-like types, `unsync::OnceCell` and `sync::OnceCell`. `OnceCell` 11 | might store arbitrary non-`Copy` types, can be assigned to at most once and provide direct access 12 | to the stored contents. In a nutshell, API looks *roughly* like this: 13 | 14 | ```rust 15 | impl OnceCell { 16 | fn new() -> OnceCell { ... } 17 | fn set(&self, value: T) -> Result<(), T> { ... } 18 | fn get(&self) -> Option<&T> { ... } 19 | } 20 | ``` 21 | 22 | Note that, like with `RefCell` and `Mutex`, the `set` method requires only a shared reference. 23 | Because of the single assignment restriction `get` can return an `&T` instead of `Ref` 24 | or `MutexGuard`. 25 | 26 | `once_cell` also has a `Lazy` type, build on top of `OnceCell` which provides the same API as 27 | the `lazy_static!` macro, but without using any macros: 28 | 29 | ```rust 30 | use std::{sync::Mutex, collections::HashMap}; 31 | use once_cell::sync::Lazy; 32 | 33 | static GLOBAL_DATA: Lazy>> = Lazy::new(|| { 34 | let mut m = HashMap::new(); 35 | m.insert(13, "Spica".to_string()); 36 | m.insert(74, "Hoyten".to_string()); 37 | Mutex::new(m) 38 | }); 39 | 40 | fn main() { 41 | println!("{:?}", GLOBAL_DATA.lock().unwrap()); 42 | } 43 | ``` 44 | 45 | More patterns and use-cases are in the [docs](https://docs.rs/once_cell/)! 46 | 47 | # Related crates 48 | 49 | * [double-checked-cell](https://github.com/niklasf/double-checked-cell) 50 | * [lazy-init](https://crates.io/crates/lazy-init) 51 | * [lazycell](https://crates.io/crates/lazycell) 52 | * [mitochondria](https://crates.io/crates/mitochondria) 53 | * [lazy_static](https://crates.io/crates/lazy_static) 54 | 55 | The API of `once_cell` is being proposed for inclusion in 56 | [`std`](https://github.com/rust-lang/rfcs/pull/2788). 57 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/no_align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | pub struct pthread_mutex_t { 5 | #[cfg(any(target_arch = "mips", 6 | target_arch = "arm", 7 | target_arch = "powerpc"))] 8 | __align: [::c_long; 0], 9 | #[cfg(any(libc_align, 10 | target_arch = "mips", 11 | target_arch = "arm", 12 | target_arch = "powerpc"))] 13 | __align: [::c_longlong; 0], 14 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 15 | } 16 | 17 | pub struct pthread_rwlock_t { 18 | #[cfg(any(target_arch = "mips", 19 | target_arch = "arm", 20 | target_arch = "powerpc"))] 21 | __align: [::c_long; 0], 22 | #[cfg(not(any( 23 | target_arch = "mips", 24 | target_arch = "arm", 25 | target_arch = "powerpc")))] 26 | __align: [::c_longlong; 0], 27 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 28 | } 29 | 30 | pub struct pthread_mutexattr_t { 31 | #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", 32 | target_arch = "mips64", target_arch = "s390x", 33 | target_arch = "sparc64"))] 34 | __align: [::c_int; 0], 35 | #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", 36 | target_arch = "mips64", target_arch = "s390x", 37 | target_arch = "sparc64")))] 38 | __align: [::c_long; 0], 39 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 40 | } 41 | 42 | pub struct pthread_cond_t { 43 | __align: [::c_longlong; 0], 44 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 45 | } 46 | 47 | pub struct pthread_condattr_t { 48 | __align: [::c_int; 0], 49 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/no_align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | pub struct pthread_mutex_t { // Unverified 5 | #[cfg(any(target_arch = "mips", 6 | target_arch = "arm", 7 | target_arch = "powerpc"))] 8 | __align: [::c_long; 0], 9 | #[cfg(not(any(target_arch = "mips", 10 | target_arch = "arm", 11 | target_arch = "powerpc")))] 12 | __align: [::c_longlong; 0], 13 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 14 | } 15 | 16 | pub struct pthread_rwlock_t { // Unverified 17 | #[cfg(any(target_arch = "mips", 18 | target_arch = "arm", 19 | target_arch = "powerpc"))] 20 | __align: [::c_long; 0], 21 | #[cfg(not(any(target_arch = "mips", 22 | target_arch = "arm", 23 | target_arch = "powerpc")))] 24 | __align: [::c_longlong; 0], 25 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 26 | } 27 | 28 | pub struct pthread_mutexattr_t { // Unverified 29 | #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", 30 | target_arch = "mips64", target_arch = "s390x", 31 | target_arch = "sparc64"))] 32 | __align: [::c_int; 0], 33 | #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", 34 | target_arch = "mips64", target_arch = "s390x", 35 | target_arch = "sparc64")))] 36 | __align: [::c_long; 0], 37 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 38 | } 39 | 40 | pub struct pthread_cond_t { // Unverified 41 | __align: [::c_longlong; 0], 42 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 43 | } 44 | 45 | pub struct pthread_condattr_t { // Unverified 46 | __align: [::c_int; 0], 47 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::cmp; 2 | use std::ptr; 3 | use regex::Regex; 4 | use once_cell::sync::Lazy; 5 | use core::ffi; 6 | 7 | pub fn fill(dst: &mut [u8], len: usize, val: u8) { 8 | unsafe { 9 | ptr::write_bytes(dst.as_mut_ptr(), val, cmp::min(len, dst.len())); 10 | } 11 | } 12 | 13 | pub fn copy(dst: &mut [u8], src: &[u8], len: usize) { 14 | unsafe { 15 | ptr::copy(src.as_ptr(), dst.as_mut_ptr(), 16 | cmp::min(len, cmp::min(src.len(), dst.len()))); 17 | } 18 | } 19 | 20 | // Increase value to be a multiple of size (if it is not already). 21 | pub fn align(value: usize, size: usize) -> usize { 22 | if value % size == 0 { 23 | value 24 | } else { 25 | value + size - (value % size) 26 | } 27 | } 28 | 29 | #[cfg(target_endian = "little")] pub fn htonl(l: u32) -> u32 { l.swap_bytes() } 30 | #[cfg(target_endian = "little")] pub fn ntohl(l: u32) -> u32 { l.swap_bytes() } 31 | #[cfg(target_endian = "little")] pub fn htons(s: u16) -> u16 { s.swap_bytes() } 32 | #[cfg(target_endian = "little")] pub fn ntohs(s: u16) -> u16 { s.swap_bytes() } 33 | #[cfg(target_endian = "big" )] pub fn htonl(l: u32) -> u32 { l } 34 | #[cfg(target_endian = "big" )] pub fn ntohl(l: u32) -> u32 { l } 35 | #[cfg(target_endian = "big" )] pub fn htons(s: u16) -> u16 { s } 36 | #[cfg(target_endian = "big" )] pub fn ntohs(s: u16) -> u16 { s } 37 | 38 | pub fn comma_value(n: u64) -> String { // credit http://richard.warburton.it 39 | let s = format!("{}", n); 40 | if let Some(cap) = CVLEFTNUM.captures(&s) { 41 | let (left, num) = (&cap[1], &cap[2]); 42 | let rev = |s: &str| { s.chars().rev().collect::() }; 43 | let num = rev(&CVTHOUSANDS.replace_all(&rev(&num), "$1,").to_string()); 44 | format!("{}{}", left, num) 45 | } else { s } 46 | } 47 | static CVLEFTNUM: Lazy = Lazy::new 48 | (|| Regex::new(r"^(\d\d?\d?)(\d{3}*)$").unwrap()); 49 | static CVTHOUSANDS: Lazy = Lazy::new 50 | (|| Regex::new(r"(\d{3})").unwrap()); 51 | 52 | // Fill slice with random bytes. 53 | pub fn random_bytes(dst: &mut [u8], n: usize) { 54 | let n = cmp::min(n, dst.len()); 55 | if unsafe { 56 | libc::getrandom(dst.as_mut_ptr() as *mut ffi::c_void, n, 0) 57 | } != n as isize { panic!("getrandom(2) failed"); } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/regex/examples/shootout-regex-dna.rs: -------------------------------------------------------------------------------- 1 | // The Computer Language Benchmarks Game 2 | // http://benchmarksgame.alioth.debian.org/ 3 | // 4 | // contributed by the Rust Project Developers 5 | // contributed by TeXitoi 6 | // contributed by BurntSushi 7 | 8 | extern crate regex; 9 | 10 | use std::io::{self, Read}; 11 | use std::sync::Arc; 12 | use std::thread; 13 | 14 | macro_rules! regex { 15 | ($re:expr) => { 16 | ::regex::Regex::new($re).unwrap() 17 | }; 18 | } 19 | 20 | fn main() { 21 | let mut seq = String::with_capacity(51 * (1 << 20)); 22 | io::stdin().read_to_string(&mut seq).unwrap(); 23 | let ilen = seq.len(); 24 | 25 | seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); 26 | let clen = seq.len(); 27 | let seq_arc = Arc::new(seq.clone()); 28 | 29 | let variants = vec![ 30 | regex!("agggtaaa|tttaccct"), 31 | regex!("[cgt]gggtaaa|tttaccc[acg]"), 32 | regex!("a[act]ggtaaa|tttacc[agt]t"), 33 | regex!("ag[act]gtaaa|tttac[agt]ct"), 34 | regex!("agg[act]taaa|ttta[agt]cct"), 35 | regex!("aggg[acg]aaa|ttt[cgt]ccct"), 36 | regex!("agggt[cgt]aa|tt[acg]accct"), 37 | regex!("agggta[cgt]a|t[acg]taccct"), 38 | regex!("agggtaa[cgt]|[acg]ttaccct"), 39 | ]; 40 | let mut counts = vec![]; 41 | for variant in variants { 42 | let seq = seq_arc.clone(); 43 | let restr = variant.to_string(); 44 | let future = thread::spawn(move || variant.find_iter(&seq).count()); 45 | counts.push((restr, future)); 46 | } 47 | 48 | let substs = vec![ 49 | (regex!("B"), "(c|g|t)"), 50 | (regex!("D"), "(a|g|t)"), 51 | (regex!("H"), "(a|c|t)"), 52 | (regex!("K"), "(g|t)"), 53 | (regex!("M"), "(a|c)"), 54 | (regex!("N"), "(a|c|g|t)"), 55 | (regex!("R"), "(a|g)"), 56 | (regex!("S"), "(c|g)"), 57 | (regex!("V"), "(a|c|g)"), 58 | (regex!("W"), "(a|t)"), 59 | (regex!("Y"), "(c|t)"), 60 | ]; 61 | let mut seq = seq; 62 | for (re, replacement) in substs { 63 | seq = re.replace_all(&seq, replacement).into_owned(); 64 | } 65 | 66 | for (variant, count) in counts { 67 | println!("{} {}", variant, count.join().unwrap()); 68 | } 69 | println!("\n{}\n{}\n{}", ilen, clen, seq.len()); 70 | } 71 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/emscripten/no_align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | pub struct pthread_mutex_t { 5 | __align: [::c_long; 0], 6 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 7 | } 8 | 9 | pub struct pthread_rwlock_t { 10 | __align: [::c_long; 0], 11 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 12 | } 13 | 14 | pub struct pthread_mutexattr_t { 15 | __align: [::c_int; 0], 16 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 17 | } 18 | 19 | pub struct pthread_rwlockattr_t { 20 | __align: [::c_int; 0], 21 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], 22 | } 23 | 24 | pub struct pthread_condattr_t { 25 | __align: [::c_int; 0], 26 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 27 | } 28 | } 29 | 30 | s_no_extra_traits! { 31 | pub struct pthread_cond_t { 32 | __align: [*const ::c_void; 0], 33 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 34 | } 35 | } 36 | 37 | cfg_if! { 38 | if #[cfg(feature = "extra_traits")] { 39 | impl PartialEq for pthread_cond_t { 40 | fn eq(&self, other: &pthread_cond_t) -> bool { 41 | self.size 42 | .iter() 43 | .zip(other.size.iter()) 44 | .all(|(a,b)| a == b) 45 | } 46 | } 47 | impl Eq for pthread_cond_t {} 48 | impl ::fmt::Debug for pthread_cond_t { 49 | fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 50 | f.debug_struct("pthread_cond_t") 51 | // FIXME: .field("size", &self.size) 52 | .finish() 53 | } 54 | } 55 | impl ::hash::Hash for pthread_cond_t { 56 | fn hash(&self, state: &mut H) { 57 | self.size.hash(state); 58 | } 59 | } 60 | } 61 | } 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aho-corasick" 5 | version = "0.7.10" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" 8 | dependencies = [ 9 | "memchr", 10 | ] 11 | 12 | [[package]] 13 | name = "byteorder" 14 | version = "1.3.4" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 17 | 18 | [[package]] 19 | name = "lazy_static" 20 | version = "1.4.0" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 23 | 24 | [[package]] 25 | name = "libc" 26 | version = "0.2.68" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" 29 | 30 | [[package]] 31 | name = "memchr" 32 | version = "2.3.3" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 35 | 36 | [[package]] 37 | name = "once_cell" 38 | version = "1.3.1" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" 41 | 42 | [[package]] 43 | name = "regex" 44 | version = "1.3.6" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3" 47 | dependencies = [ 48 | "aho-corasick", 49 | "memchr", 50 | "regex-syntax", 51 | "thread_local", 52 | ] 53 | 54 | [[package]] 55 | name = "regex-syntax" 56 | version = "0.6.17" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" 59 | 60 | [[package]] 61 | name = "rush" 62 | version = "0.1.0" 63 | dependencies = [ 64 | "byteorder", 65 | "libc", 66 | "once_cell", 67 | "regex", 68 | ] 69 | 70 | [[package]] 71 | name = "thread_local" 72 | version = "1.0.1" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" 75 | dependencies = [ 76 | "lazy_static", 77 | ] 78 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Rust Project Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // http://rust-lang.org/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | 11 | // libc port for HermitCore (https://hermitcore.org) 12 | // 13 | // Ported by Colin Fink 14 | // and Stefan Lankes 15 | 16 | pub type c_schar = i8; 17 | pub type c_uchar = u8; 18 | pub type c_short = i16; 19 | pub type c_ushort = u16; 20 | pub type c_int = i32; 21 | pub type c_uint = u32; 22 | pub type c_float = f32; 23 | pub type c_double = f64; 24 | pub type c_longlong = i64; 25 | pub type c_ulonglong = u64; 26 | pub type intmax_t = i64; 27 | pub type uintmax_t = u64; 28 | 29 | pub type size_t = usize; 30 | pub type ptrdiff_t = isize; 31 | pub type intptr_t = isize; 32 | pub type uintptr_t = usize; 33 | pub type ssize_t = isize; 34 | 35 | pub type c_long = i64; 36 | pub type c_ulong = u64; 37 | 38 | pub type wint_t = u32; 39 | pub type wctype_t = i64; 40 | 41 | pub type regoff_t = size_t; 42 | pub type off_t = c_long; 43 | 44 | cfg_if! { 45 | if #[cfg(target_arch = "aarch64")] { 46 | mod aarch64; 47 | pub use self::aarch64::*; 48 | } else if #[cfg(target_arch = "x86_64")] { 49 | mod x86_64; 50 | pub use self::x86_64::*; 51 | } else { 52 | // Unknown target_arch 53 | } 54 | } 55 | 56 | cfg_if! { 57 | if #[cfg(libc_core_cvoid)] { 58 | pub use ::ffi::c_void; 59 | } else { 60 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 61 | // enable more optimization opportunities around it recognizing things 62 | // like malloc/free. 63 | #[repr(u8)] 64 | #[allow(missing_copy_implementations)] 65 | #[allow(missing_debug_implementations)] 66 | pub enum c_void { 67 | // Two dummy variants so the #[repr] attribute can be used. 68 | #[doc(hidden)] 69 | __variant1, 70 | #[doc(hidden)] 71 | __variant2, 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/regex/examples/shootout-regex-dna-bytes.rs: -------------------------------------------------------------------------------- 1 | // The Computer Language Benchmarks Game 2 | // http://benchmarksgame.alioth.debian.org/ 3 | // 4 | // contributed by the Rust Project Developers 5 | // contributed by TeXitoi 6 | // contributed by BurntSushi 7 | 8 | extern crate regex; 9 | 10 | use std::io::{self, Read}; 11 | use std::sync::Arc; 12 | use std::thread; 13 | 14 | macro_rules! regex { 15 | ($re:expr) => { 16 | ::regex::bytes::Regex::new($re).unwrap() 17 | }; 18 | } 19 | 20 | fn main() { 21 | let mut seq = Vec::with_capacity(51 * (1 << 20)); 22 | io::stdin().read_to_end(&mut seq).unwrap(); 23 | let ilen = seq.len(); 24 | 25 | seq = regex!(">[^\n]*\n|\n").replace_all(&seq, &b""[..]).into_owned(); 26 | let clen = seq.len(); 27 | let seq_arc = Arc::new(seq.clone()); 28 | 29 | let variants = vec![ 30 | regex!("agggtaaa|tttaccct"), 31 | regex!("[cgt]gggtaaa|tttaccc[acg]"), 32 | regex!("a[act]ggtaaa|tttacc[agt]t"), 33 | regex!("ag[act]gtaaa|tttac[agt]ct"), 34 | regex!("agg[act]taaa|ttta[agt]cct"), 35 | regex!("aggg[acg]aaa|ttt[cgt]ccct"), 36 | regex!("agggt[cgt]aa|tt[acg]accct"), 37 | regex!("agggta[cgt]a|t[acg]taccct"), 38 | regex!("agggtaa[cgt]|[acg]ttaccct"), 39 | ]; 40 | let mut counts = vec![]; 41 | for variant in variants { 42 | let seq = seq_arc.clone(); 43 | let restr = variant.to_string(); 44 | let future = thread::spawn(move || variant.find_iter(&seq).count()); 45 | counts.push((restr, future)); 46 | } 47 | 48 | let substs = vec![ 49 | (regex!("B"), &b"(c|g|t)"[..]), 50 | (regex!("D"), &b"(a|g|t)"[..]), 51 | (regex!("H"), &b"(a|c|t)"[..]), 52 | (regex!("K"), &b"(g|t)"[..]), 53 | (regex!("M"), &b"(a|c)"[..]), 54 | (regex!("N"), &b"(a|c|g|t)"[..]), 55 | (regex!("R"), &b"(a|g)"[..]), 56 | (regex!("S"), &b"(c|g)"[..]), 57 | (regex!("V"), &b"(a|c|g)"[..]), 58 | (regex!("W"), &b"(a|t)"[..]), 59 | (regex!("Y"), &b"(c|t)"[..]), 60 | ]; 61 | let mut seq = seq; 62 | for (re, replacement) in substs { 63 | seq = re.replace_all(&seq, replacement).into_owned(); 64 | } 65 | 66 | for (variant, count) in counts { 67 | println!("{} {}", variant, count.join().unwrap()); 68 | } 69 | println!("\n{}\n{}\n{}", ilen, clen, seq.len()); 70 | } 71 | -------------------------------------------------------------------------------- /vendor/regex/src/sparse.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Deref; 2 | use std::slice; 3 | 4 | /// A sparse set used for representing ordered NFA states. 5 | /// 6 | /// This supports constant time addition and membership testing. Clearing an 7 | /// entire set can also be done in constant time. Iteration yields elements 8 | /// in the order in which they were inserted. 9 | /// 10 | /// The data structure is based on: http://research.swtch.com/sparse 11 | /// Note though that we don't actually use uninitialized memory. We generally 12 | /// reuse allocations, so the initial allocation cost is bareable. However, 13 | /// its other properties listed above are extremely useful. 14 | #[derive(Clone, Debug)] 15 | pub struct SparseSet { 16 | /// Dense contains the instruction pointers in the order in which they 17 | /// were inserted. 18 | dense: Vec, 19 | /// Sparse maps instruction pointers to their location in dense. 20 | /// 21 | /// An instruction pointer is in the set if and only if 22 | /// sparse[ip] < dense.len() && ip == dense[sparse[ip]]. 23 | sparse: Box<[usize]>, 24 | } 25 | 26 | impl SparseSet { 27 | pub fn new(size: usize) -> SparseSet { 28 | SparseSet { 29 | dense: Vec::with_capacity(size), 30 | sparse: vec![0; size].into_boxed_slice(), 31 | } 32 | } 33 | 34 | pub fn len(&self) -> usize { 35 | self.dense.len() 36 | } 37 | 38 | pub fn is_empty(&self) -> bool { 39 | self.dense.is_empty() 40 | } 41 | 42 | pub fn capacity(&self) -> usize { 43 | self.dense.capacity() 44 | } 45 | 46 | pub fn insert(&mut self, value: usize) { 47 | let i = self.len(); 48 | assert!(i < self.capacity()); 49 | self.dense.push(value); 50 | self.sparse[value] = i; 51 | } 52 | 53 | pub fn contains(&self, value: usize) -> bool { 54 | let i = self.sparse[value]; 55 | self.dense.get(i) == Some(&value) 56 | } 57 | 58 | pub fn clear(&mut self) { 59 | self.dense.clear(); 60 | } 61 | } 62 | 63 | impl Deref for SparseSet { 64 | type Target = [usize]; 65 | 66 | fn deref(&self) -> &Self::Target { 67 | &self.dense 68 | } 69 | } 70 | 71 | impl<'a> IntoIterator for &'a SparseSet { 72 | type Item = &'a usize; 73 | type IntoIter = slice::Iter<'a, usize>; 74 | fn into_iter(self) -> Self::IntoIter { 75 | self.iter() 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/regex/src/testdata/nullsubexpr.dat: -------------------------------------------------------------------------------- 1 | NOTE null subexpression matches : 2002-06-06 2 | 3 | E (a*)* a (0,1)(0,1) 4 | #E SAME x (0,0)(0,0) 5 | E SAME x (0,0)(?,?) RE2/Go 6 | E SAME aaaaaa (0,6)(0,6) 7 | E SAME aaaaaax (0,6)(0,6) 8 | E (a*)+ a (0,1)(0,1) 9 | E SAME x (0,0)(0,0) 10 | E SAME aaaaaa (0,6)(0,6) 11 | E SAME aaaaaax (0,6)(0,6) 12 | E (a+)* a (0,1)(0,1) 13 | E SAME x (0,0) 14 | E SAME aaaaaa (0,6)(0,6) 15 | E SAME aaaaaax (0,6)(0,6) 16 | E (a+)+ a (0,1)(0,1) 17 | E SAME x NOMATCH 18 | E SAME aaaaaa (0,6)(0,6) 19 | E SAME aaaaaax (0,6)(0,6) 20 | 21 | E ([a]*)* a (0,1)(0,1) 22 | #E SAME x (0,0)(0,0) 23 | E SAME x (0,0)(?,?) RE2/Go 24 | E SAME aaaaaa (0,6)(0,6) 25 | E SAME aaaaaax (0,6)(0,6) 26 | E ([a]*)+ a (0,1)(0,1) 27 | E SAME x (0,0)(0,0) 28 | E SAME aaaaaa (0,6)(0,6) 29 | E SAME aaaaaax (0,6)(0,6) 30 | E ([^b]*)* a (0,1)(0,1) 31 | #E SAME b (0,0)(0,0) 32 | E SAME b (0,0)(?,?) RE2/Go 33 | E SAME aaaaaa (0,6)(0,6) 34 | E SAME aaaaaab (0,6)(0,6) 35 | E ([ab]*)* a (0,1)(0,1) 36 | E SAME aaaaaa (0,6)(0,6) 37 | E SAME ababab (0,6)(0,6) 38 | E SAME bababa (0,6)(0,6) 39 | E SAME b (0,1)(0,1) 40 | E SAME bbbbbb (0,6)(0,6) 41 | E SAME aaaabcde (0,5)(0,5) 42 | E ([^a]*)* b (0,1)(0,1) 43 | E SAME bbbbbb (0,6)(0,6) 44 | #E SAME aaaaaa (0,0)(0,0) 45 | E SAME aaaaaa (0,0)(?,?) RE2/Go 46 | E ([^ab]*)* ccccxx (0,6)(0,6) 47 | #E SAME ababab (0,0)(0,0) 48 | E SAME ababab (0,0)(?,?) RE2/Go 49 | 50 | E ((z)+|a)* zabcde (0,2)(1,2) 51 | 52 | #{E a+? aaaaaa (0,1) no *? +? mimimal match ops 53 | #E (a) aaa (0,1)(0,1) 54 | #E (a*?) aaa (0,0)(0,0) 55 | #E (a)*? aaa (0,0) 56 | #E (a*?)*? aaa (0,0) 57 | #} 58 | 59 | B \(a*\)*\(x\) x (0,1)(0,0)(0,1) 60 | B \(a*\)*\(x\) ax (0,2)(0,1)(1,2) 61 | B \(a*\)*\(x\) axa (0,2)(0,1)(1,2) 62 | B \(a*\)*\(x\)\(\1\) x (0,1)(0,0)(0,1)(1,1) 63 | B \(a*\)*\(x\)\(\1\) ax (0,2)(1,1)(1,2)(2,2) 64 | B \(a*\)*\(x\)\(\1\) axa (0,3)(0,1)(1,2)(2,3) 65 | B \(a*\)*\(x\)\(\1\)\(x\) axax (0,4)(0,1)(1,2)(2,3)(3,4) 66 | B \(a*\)*\(x\)\(\1\)\(x\) axxa (0,3)(1,1)(1,2)(2,2)(2,3) 67 | 68 | #E (a*)*(x) x (0,1)(0,0)(0,1) 69 | E (a*)*(x) x (0,1)(?,?)(0,1) RE2/Go 70 | E (a*)*(x) ax (0,2)(0,1)(1,2) 71 | E (a*)*(x) axa (0,2)(0,1)(1,2) 72 | 73 | E (a*)+(x) x (0,1)(0,0)(0,1) 74 | E (a*)+(x) ax (0,2)(0,1)(1,2) 75 | E (a*)+(x) axa (0,2)(0,1)(1,2) 76 | 77 | E (a*){2}(x) x (0,1)(0,0)(0,1) 78 | E (a*){2}(x) ax (0,2)(1,1)(1,2) 79 | E (a*){2}(x) axa (0,2)(1,1)(1,2) 80 | -------------------------------------------------------------------------------- /vendor/aho-corasick/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"bf3140f591d5e16e2c178bfdc39bc2ea9fecf3b50963ff60343d3e5a68d024cc","DESIGN.md":"9065f33d818d1562244d36dc4781e2a351108030cee17f11c2ba512ca7b4c27e","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"f679a3a8fa99694e00e2ed8ec9cd6f7dc28eee36f47c472411744aabb0556d0b","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/ahocorasick.rs":"46c57a83a75a8f25fdf19a15deae10748d12b8af9445ae74700a546a92024608","src/automaton.rs":"ea3fc2648e026eac9f9969b0d457e49af7b4a40044379ce010d054f22afbc98f","src/buffer.rs":"0641828d1058b9c1c16e8e2445ce05c94b0ad2d97736a7e3cd8b913fa8edd7fd","src/byte_frequencies.rs":"2fb85b381c038c1e44ce94294531cdcd339dca48b1e61f41455666e802cbbc9e","src/classes.rs":"166c9f15c9a2e370e2bc9a9e1620bb2db13df52edfde9a0db1f20144519a7e72","src/dfa.rs":"e34f485a7c3257d2edee16fcdb2a5586aa0d2aa9e34d624288eb2b5a0f7cc65b","src/error.rs":"36dbf2cefbfaa8a69186551320dbff023d3e82780a6c925e87c3e3997b967e66","src/lib.rs":"a2a65d72cbe1eed1964c3fb080e5fa54245ab208a3c855531c1036f05e073452","src/nfa.rs":"6e8fe7633033c378e5487604a2772af3fc2eca011fe374fe0b6d6cee98198f58","src/packed/api.rs":"6c65dfa177b7d7b79f90a048f260bec7f817126c693b85f49704c7d2ecf5f646","src/packed/mod.rs":"29c76ad3cbb1f831140cefac7a27fb504ac4af4f454975a571965b48aad417eb","src/packed/pattern.rs":"b88c57af057997da0a5a06f4c5604a7e598c20acfc11c15cd8977727f6e1cf9c","src/packed/rabinkarp.rs":"b3242a8631ea5607163dcbb641e4ac9c6da26774378da1e51651b0ab5656b390","src/packed/teddy/README.md":"5819f40d221af93288e705eadef5393a41d7a0900881b4d676e01fd65d5adf15","src/packed/teddy/compile.rs":"5d7de6a45a84bb2322647a6de7a7b1573837b9222b16e348f023b8d47e0a5130","src/packed/teddy/mod.rs":"f63db3419b1d378929bf0bc1f0e3b909ff3c38b9f2b6e86ba4546b8f39907cd3","src/packed/teddy/runtime.rs":"0a1250ea73159b3be6e0fa9a3f55ecedbb2cb90cb798d1709e9f5ee48f8855d5","src/packed/tests.rs":"0b52ab9eef73a1a4f141f475a9fa98e54d447104aa69acba3a7f8248ce7164b2","src/packed/vector.rs":"ab3c0535fca5f09198d58cbfae44c292aeb3ce44bc92bca36d30dc72963639fc","src/prefilter.rs":"f615e929629f9356fb779a4456a0b6b1ee139960029df71d41620bf3fed9282d","src/state_id.rs":"50958ca2b089d775fb4e49a64950e2f1e8a4af1772fe782ae3715a7745dcc6d7","src/tests.rs":"7458d220c78bbc382c1332e0a222f7e47b6b8ff1fac666d46db4c3a9e63cef4c"},"package":"8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"} -------------------------------------------------------------------------------- /vendor/regex/examples/shootout-regex-dna-single-cheat.rs: -------------------------------------------------------------------------------- 1 | // The Computer Language Benchmarks Game 2 | // http://benchmarksgame.alioth.debian.org/ 3 | // 4 | // contributed by the Rust Project Developers 5 | // contributed by TeXitoi 6 | // contributed by BurntSushi 7 | 8 | extern crate regex; 9 | 10 | use std::io::{self, Read}; 11 | 12 | macro_rules! regex { 13 | ($re:expr) => { 14 | ::regex::Regex::new($re).unwrap() 15 | }; 16 | } 17 | 18 | fn main() { 19 | let mut seq = String::with_capacity(50 * (1 << 20)); 20 | io::stdin().read_to_string(&mut seq).unwrap(); 21 | let ilen = seq.len(); 22 | 23 | seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); 24 | let clen = seq.len(); 25 | 26 | let variants = vec![ 27 | regex!("agggtaaa|tttaccct"), 28 | regex!("[cgt]gggtaaa|tttaccc[acg]"), 29 | regex!("a[act]ggtaaa|tttacc[agt]t"), 30 | regex!("ag[act]gtaaa|tttac[agt]ct"), 31 | regex!("agg[act]taaa|ttta[agt]cct"), 32 | regex!("aggg[acg]aaa|ttt[cgt]ccct"), 33 | regex!("agggt[cgt]aa|tt[acg]accct"), 34 | regex!("agggta[cgt]a|t[acg]taccct"), 35 | regex!("agggtaa[cgt]|[acg]ttaccct"), 36 | ]; 37 | for re in variants { 38 | println!("{} {}", re.to_string(), re.find_iter(&seq).count()); 39 | } 40 | 41 | let substs = vec![ 42 | (b'B', "(c|g|t)"), 43 | (b'D', "(a|g|t)"), 44 | (b'H', "(a|c|t)"), 45 | (b'K', "(g|t)"), 46 | (b'M', "(a|c)"), 47 | (b'N', "(a|c|g|t)"), 48 | (b'R', "(a|g)"), 49 | (b'S', "(c|g)"), 50 | (b'V', "(a|c|g)"), 51 | (b'W', "(a|t)"), 52 | (b'Y', "(c|t)"), 53 | ]; // combined into one regex in `replace_all` 54 | let seq = replace_all(&seq, substs); 55 | 56 | println!("\n{}\n{}\n{}", ilen, clen, seq.len()); 57 | } 58 | 59 | fn replace_all(text: &str, substs: Vec<(u8, &str)>) -> String { 60 | let mut replacements = vec![""; 256]; 61 | let mut alternates = vec![]; 62 | for (re, replacement) in substs { 63 | replacements[re as usize] = replacement; 64 | alternates.push((re as char).to_string()); 65 | } 66 | 67 | let re = regex!(&alternates.join("|")); 68 | let mut new = String::with_capacity(text.len()); 69 | let mut last_match = 0; 70 | for m in re.find_iter(text) { 71 | new.push_str(&text[last_match..m.start()]); 72 | new.push_str(replacements[text.as_bytes()[m.start()] as usize]); 73 | last_match = m.end(); 74 | } 75 | new.push_str(&text[last_match..]); 76 | new 77 | } 78 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/uclibc/x86_64/no_align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | pub struct sem_t { // FIXME 5 | #[cfg(target_pointer_width = "32")] 6 | __size: [::c_char; 16], 7 | #[cfg(target_pointer_width = "64")] 8 | __size: [::c_char; 32], 9 | __align: [::c_long; 0], 10 | } 11 | 12 | pub struct pthread_mutex_t { // FIXME 13 | #[cfg(any(target_arch = "mips", 14 | target_arch = "arm", 15 | target_arch = "powerpc"))] 16 | __align: [::c_long; 0], 17 | #[cfg(not(any(target_arch = "mips", 18 | target_arch = "arm", 19 | target_arch = "powerpc")))] 20 | __align: [::c_longlong; 0], 21 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 22 | } 23 | 24 | pub struct pthread_mutexattr_t { // FIXME 25 | #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", 26 | target_arch = "mips64", target_arch = "s390x", 27 | target_arch = "sparc64"))] 28 | __align: [::c_int; 0], 29 | #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", 30 | target_arch = "mips64", target_arch = "s390x", 31 | target_arch = "sparc64")))] 32 | __align: [::c_long; 0], 33 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 34 | } 35 | 36 | pub struct pthread_cond_t { // FIXME 37 | __align: [::c_longlong; 0], 38 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 39 | } 40 | 41 | pub struct pthread_condattr_t { // FIXME 42 | __align: [::c_int; 0], 43 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 44 | } 45 | 46 | pub struct pthread_rwlock_t { // FIXME 47 | #[cfg(any(target_arch = "mips", 48 | target_arch = "arm", 49 | target_arch = "powerpc"))] 50 | __align: [::c_long; 0], 51 | #[cfg(not(any(target_arch = "mips", 52 | target_arch = "arm", 53 | target_arch = "powerpc")))] 54 | __align: [::c_longlong; 0], 55 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/thread_local/src/unreachable.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Amanieu d'Antras 2 | // 3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be 6 | // copied, modified, or distributed except according to those terms. 7 | 8 | //! # unreachable 9 | //! inlined from https://github.com/reem/rust-unreachable/ 10 | //! 11 | //! An unreachable code optimization hint in stable rust, and some useful 12 | //! extension traits for `Option` and `Result`. 13 | //! 14 | 15 | /// Hint to the optimizer that any code path which calls this function is 16 | /// statically unreachable and can be removed. 17 | /// 18 | /// Calling this function in reachable code invokes undefined behavior. Be 19 | /// very, very sure this is what you want; often, a simple `panic!` is more 20 | /// suitable. 21 | #[inline] 22 | pub unsafe fn unreachable() -> ! { 23 | /// The empty type for cases which can't occur. 24 | enum Void { } 25 | let x: &Void = ::std::mem::transmute(1usize); 26 | match *x {} 27 | } 28 | 29 | /// An extension trait for `Option` providing unchecked unwrapping methods. 30 | pub trait UncheckedOptionExt { 31 | /// Get the value out of this Option without checking for None. 32 | unsafe fn unchecked_unwrap(self) -> T; 33 | 34 | /// Assert that this Option is a None to the optimizer. 35 | unsafe fn unchecked_unwrap_none(self); 36 | } 37 | 38 | /// An extension trait for `Result` providing unchecked unwrapping methods. 39 | pub trait UncheckedResultExt { 40 | /// Get the value out of this Result without checking for Err. 41 | unsafe fn unchecked_unwrap_ok(self) -> T; 42 | 43 | /// Get the error out of this Result without checking for Ok. 44 | unsafe fn unchecked_unwrap_err(self) -> E; 45 | } 46 | 47 | impl UncheckedOptionExt for Option { 48 | unsafe fn unchecked_unwrap(self) -> T { 49 | match self { 50 | Some(x) => x, 51 | None => unreachable() 52 | } 53 | } 54 | 55 | unsafe fn unchecked_unwrap_none(self) { 56 | if self.is_some() { unreachable() } 57 | } 58 | } 59 | 60 | impl UncheckedResultExt for Result { 61 | unsafe fn unchecked_unwrap_ok(self) -> T { 62 | match self { 63 | Ok(x) => x, 64 | Err(_) => unreachable() 65 | } 66 | } 67 | 68 | unsafe fn unchecked_unwrap_err(self) -> E { 69 | match self { 70 | Ok(_) => unreachable(), 71 | Err(e) => e 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs: -------------------------------------------------------------------------------- 1 | //! 64-bit specific definitions for linux-like values 2 | 3 | pub type clock_t = i64; 4 | pub type time_t = i64; 5 | pub type ino_t = u64; 6 | pub type off_t = i64; 7 | pub type blkcnt_t = i64; 8 | pub type shmatt_t = u64; 9 | pub type msgqnum_t = u64; 10 | pub type msglen_t = u64; 11 | pub type fsblkcnt_t = u64; 12 | pub type fsfilcnt_t = u64; 13 | pub type rlim_t = u64; 14 | pub type __fsword_t = i64; 15 | 16 | s! { 17 | pub struct sigset_t { 18 | #[cfg(target_pointer_width = "32")] 19 | __val: [u32; 32], 20 | #[cfg(target_pointer_width = "64")] 21 | __val: [u64; 16], 22 | } 23 | 24 | pub struct sysinfo { 25 | pub uptime: i64, 26 | pub loads: [u64; 3], 27 | pub totalram: u64, 28 | pub freeram: u64, 29 | pub sharedram: u64, 30 | pub bufferram: u64, 31 | pub totalswap: u64, 32 | pub freeswap: u64, 33 | pub procs: ::c_ushort, 34 | pub pad: ::c_ushort, 35 | pub totalhigh: u64, 36 | pub freehigh: u64, 37 | pub mem_unit: ::c_uint, 38 | pub _f: [::c_char; 0], 39 | } 40 | 41 | pub struct msqid_ds { 42 | pub msg_perm: ::ipc_perm, 43 | pub msg_stime: ::time_t, 44 | pub msg_rtime: ::time_t, 45 | pub msg_ctime: ::time_t, 46 | __msg_cbytes: u64, 47 | pub msg_qnum: ::msgqnum_t, 48 | pub msg_qbytes: ::msglen_t, 49 | pub msg_lspid: ::pid_t, 50 | pub msg_lrpid: ::pid_t, 51 | __glibc_reserved4: u64, 52 | __glibc_reserved5: u64, 53 | } 54 | 55 | } 56 | 57 | pub const RLIM_INFINITY: ::rlim_t = !0; 58 | pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; 59 | 60 | pub const O_LARGEFILE: ::c_int = 0; 61 | 62 | cfg_if! { 63 | if #[cfg(target_arch = "aarch64")] { 64 | mod aarch64; 65 | pub use self::aarch64::*; 66 | } else if #[cfg(any(target_arch = "powerpc64"))] { 67 | mod powerpc64; 68 | pub use self::powerpc64::*; 69 | } else if #[cfg(any(target_arch = "sparc64"))] { 70 | mod sparc64; 71 | pub use self::sparc64::*; 72 | } else if #[cfg(any(target_arch = "mips64"))] { 73 | mod mips64; 74 | pub use self::mips64::*; 75 | } else if #[cfg(any(target_arch = "s390x"))] { 76 | mod s390x; 77 | pub use self::s390x::*; 78 | } else if #[cfg(any(target_arch = "x86_64"))] { 79 | mod x86_64; 80 | pub use self::x86_64::*; 81 | } else if #[cfg(any(target_arch = "riscv64"))] { 82 | mod riscv64; 83 | pub use self::riscv64::*; 84 | } else { 85 | // Unknown target_arch 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/regex/src/error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use std::iter::repeat; 3 | 4 | /// An error that occurred during parsing or compiling a regular expression. 5 | #[derive(Clone, PartialEq)] 6 | pub enum Error { 7 | /// A syntax error. 8 | Syntax(String), 9 | /// The compiled program exceeded the set size limit. 10 | /// The argument is the size limit imposed. 11 | CompiledTooBig(usize), 12 | /// Hints that destructuring should not be exhaustive. 13 | /// 14 | /// This enum may grow additional variants, so this makes sure clients 15 | /// don't count on exhaustive matching. (Otherwise, adding a new variant 16 | /// could break existing code.) 17 | #[doc(hidden)] 18 | __Nonexhaustive, 19 | } 20 | 21 | impl ::std::error::Error for Error { 22 | // TODO: Remove this method entirely on the next breaking semver release. 23 | #[allow(deprecated)] 24 | fn description(&self) -> &str { 25 | match *self { 26 | Error::Syntax(ref err) => err, 27 | Error::CompiledTooBig(_) => "compiled program too big", 28 | Error::__Nonexhaustive => unreachable!(), 29 | } 30 | } 31 | } 32 | 33 | impl fmt::Display for Error { 34 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 35 | match *self { 36 | Error::Syntax(ref err) => err.fmt(f), 37 | Error::CompiledTooBig(limit) => write!( 38 | f, 39 | "Compiled regex exceeds size limit of {} bytes.", 40 | limit 41 | ), 42 | Error::__Nonexhaustive => unreachable!(), 43 | } 44 | } 45 | } 46 | 47 | // We implement our own Debug implementation so that we show nicer syntax 48 | // errors when people use `Regex::new(...).unwrap()`. It's a little weird, 49 | // but the `Syntax` variant is already storing a `String` anyway, so we might 50 | // as well format it nicely. 51 | impl fmt::Debug for Error { 52 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 53 | match *self { 54 | Error::Syntax(ref err) => { 55 | let hr: String = repeat('~').take(79).collect(); 56 | writeln!(f, "Syntax(")?; 57 | writeln!(f, "{}", hr)?; 58 | writeln!(f, "{}", err)?; 59 | writeln!(f, "{}", hr)?; 60 | write!(f, ")")?; 61 | Ok(()) 62 | } 63 | Error::CompiledTooBig(limit) => { 64 | f.debug_tuple("CompiledTooBig").field(&limit).finish() 65 | } 66 | Error::__Nonexhaustive => { 67 | f.debug_tuple("__Nonexhaustive").finish() 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/basic_apps.rs: -------------------------------------------------------------------------------- 1 | use super::packet; 2 | use super::link; 3 | use super::engine; 4 | use super::lib; 5 | 6 | // Source app: generate synthetic packets 7 | 8 | #[derive(Clone,Debug)] 9 | pub struct Source { pub size: u16 } 10 | impl engine::AppConfig for Source { 11 | fn new(&self) -> Box { 12 | Box::new(SourceApp {size: self.size}) 13 | } 14 | } 15 | pub struct SourceApp { size: u16 } 16 | impl engine::App for SourceApp { 17 | fn has_pull(&self) -> bool { true } 18 | fn pull(&self, app: &engine::AppState) { 19 | for output in app.output.values() { 20 | let mut output = output.borrow_mut(); 21 | for _ in 0..engine::PULL_NPACKETS { 22 | let mut p = packet::allocate(); 23 | lib::fill(&mut p.data, self.size as usize, 0); 24 | p.length = self.size; 25 | link::transmit(&mut output, p); 26 | } 27 | } 28 | } 29 | } 30 | 31 | // Sink app: Receive and discard packets 32 | 33 | #[derive(Clone,Debug)] 34 | pub struct Sink {} 35 | impl engine::AppConfig for Sink { 36 | fn new(&self) -> Box { 37 | Box::new(SinkApp {}) 38 | } 39 | } 40 | pub struct SinkApp {} 41 | impl engine::App for SinkApp { 42 | fn has_push(&self) -> bool { true } 43 | fn push(&self, app: &engine::AppState) { 44 | for input in app.input.values() { 45 | let mut input = input.borrow_mut(); 46 | while !link::empty(&input) { 47 | packet::free(link::receive(&mut input)); 48 | } 49 | } 50 | } 51 | } 52 | 53 | // Tee app: Send inputs to all outputs 54 | 55 | #[derive(Clone,Debug)] 56 | pub struct Tee {} 57 | impl engine::AppConfig for Tee { 58 | fn new(&self) -> Box { 59 | Box::new(TeeApp {}) 60 | } 61 | } 62 | pub struct TeeApp {} 63 | impl engine::App for TeeApp { 64 | fn has_push(&self) -> bool { true } 65 | fn push(&self, app: &engine::AppState) { 66 | //let noutputs = app.output.len(); 67 | for input in app.input.values() { 68 | let mut input = input.borrow_mut(); 69 | while !link::empty(&input) { 70 | let p = link::receive(&mut input); 71 | //let mut outn = 0; 72 | for output in app.output.values() { 73 | let mut output = output.borrow_mut(); 74 | //outn += 1; 75 | link::transmit(&mut output, packet::clone(&p)); 76 | //if outn == noutputs { packet::clone(&p) } else { p } 77 | } 78 | packet::free(p); 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/byteorder/build.rs: -------------------------------------------------------------------------------- 1 | // For the 'try!' macro, until we bump MSRV past 1.12. 2 | #![allow(deprecated)] 3 | 4 | use std::env; 5 | use std::ffi::OsString; 6 | use std::io::{self, Write}; 7 | use std::process::Command; 8 | 9 | fn main() { 10 | let version = match Version::read() { 11 | Ok(version) => version, 12 | Err(err) => { 13 | writeln!( 14 | &mut io::stderr(), 15 | "failed to parse `rustc --version`: {}", 16 | err 17 | ).unwrap(); 18 | return; 19 | } 20 | }; 21 | enable_i128(version); 22 | } 23 | 24 | fn enable_i128(version: Version) { 25 | if version < (Version { major: 1, minor: 26, patch: 0 }) { 26 | return; 27 | } 28 | 29 | println!("cargo:rustc-cfg=byteorder_i128"); 30 | } 31 | 32 | #[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)] 33 | struct Version { 34 | major: u32, 35 | minor: u32, 36 | patch: u32, 37 | } 38 | 39 | impl Version { 40 | fn read() -> Result { 41 | let rustc = env::var_os("RUSTC").unwrap_or(OsString::from("rustc")); 42 | let output = Command::new(&rustc) 43 | .arg("--version") 44 | .output() 45 | .unwrap() 46 | .stdout; 47 | Version::parse(&String::from_utf8(output).unwrap()) 48 | } 49 | 50 | fn parse(mut s: &str) -> Result { 51 | if !s.starts_with("rustc ") { 52 | return Err(format!("unrecognized version string: {}", s)); 53 | } 54 | s = &s["rustc ".len()..]; 55 | 56 | let parts: Vec<&str> = s.split(".").collect(); 57 | if parts.len() < 3 { 58 | return Err(format!("not enough version parts: {:?}", parts)); 59 | } 60 | 61 | let mut num = String::new(); 62 | for c in parts[0].chars() { 63 | if !c.is_digit(10) { 64 | break; 65 | } 66 | num.push(c); 67 | } 68 | let major = try!(num.parse::().map_err(|e| e.to_string())); 69 | 70 | num.clear(); 71 | for c in parts[1].chars() { 72 | if !c.is_digit(10) { 73 | break; 74 | } 75 | num.push(c); 76 | } 77 | let minor = try!(num.parse::().map_err(|e| e.to_string())); 78 | 79 | num.clear(); 80 | for c in parts[2].chars() { 81 | if !c.is_digit(10) { 82 | break; 83 | } 84 | num.push(c); 85 | } 86 | let patch = try!(num.parse::().map_err(|e| e.to_string())); 87 | 88 | Ok(Version { major: major, minor: minor, patch: patch }) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/emscripten/align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | #[allow(missing_debug_implementations)] 5 | #[repr(align(4))] 6 | pub struct pthread_mutex_t { 7 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 8 | } 9 | 10 | #[repr(align(4))] 11 | pub struct pthread_rwlock_t { 12 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 13 | } 14 | 15 | #[repr(align(4))] 16 | pub struct pthread_mutexattr_t { 17 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 18 | } 19 | 20 | #[repr(align(4))] 21 | pub struct pthread_rwlockattr_t { 22 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], 23 | } 24 | 25 | #[repr(align(4))] 26 | pub struct pthread_condattr_t { 27 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 28 | } 29 | } 30 | 31 | s_no_extra_traits! { 32 | #[cfg_attr(target_pointer_width = "32", 33 | repr(align(4)))] 34 | #[cfg_attr(target_pointer_width = "64", 35 | repr(align(8)))] 36 | pub struct pthread_cond_t { 37 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 38 | } 39 | 40 | #[allow(missing_debug_implementations)] 41 | #[repr(align(8))] 42 | pub struct max_align_t { 43 | priv_: [f64; 2] 44 | } 45 | 46 | } 47 | 48 | cfg_if! { 49 | if #[cfg(feature = "extra_traits")] { 50 | impl PartialEq for pthread_cond_t { 51 | fn eq(&self, other: &pthread_cond_t) -> bool { 52 | self.size 53 | .iter() 54 | .zip(other.size.iter()) 55 | .all(|(a,b)| a == b) 56 | } 57 | } 58 | impl Eq for pthread_cond_t {} 59 | impl ::fmt::Debug for pthread_cond_t { 60 | fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 61 | f.debug_struct("pthread_cond_t") 62 | // FIXME: .field("size", &self.size) 63 | .finish() 64 | } 65 | } 66 | impl ::hash::Hash for pthread_cond_t { 67 | fn hash(&self, state: &mut H) { 68 | self.size.hash(state); 69 | } 70 | } 71 | } 72 | } 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /vendor/memchr/src/x86/sse42.rs: -------------------------------------------------------------------------------- 1 | // This code is unused. PCMPESTRI is gratuitously slow. I imagine it might 2 | // start winning with a hypothetical memchr4 (or greater). This technique might 3 | // also be good for exposing searches over ranges of bytes, but that departs 4 | // from the standard memchr API, so it's not clear whether we actually want 5 | // that or not. 6 | // 7 | // N.B. PCMPISTRI appears to be about twice as fast as PCMPESTRI, which is kind 8 | // of neat. Unfortunately, UTF-8 strings can contain NUL bytes, which means 9 | // I don't see a way of effectively using PCMPISTRI unless there's some fast 10 | // way to replace zero bytes with a byte that is not not a needle byte. 11 | 12 | use core::arch::x86_64::*; 13 | use core::mem::size_of; 14 | 15 | use x86::sse2; 16 | 17 | const VECTOR_SIZE: usize = size_of::<__m128i>(); 18 | const CONTROL_ANY: i32 = 19 | _SIDD_UBYTE_OPS 20 | | _SIDD_CMP_EQUAL_ANY 21 | | _SIDD_POSITIVE_POLARITY 22 | | _SIDD_LEAST_SIGNIFICANT; 23 | 24 | #[target_feature(enable = "sse4.2")] 25 | pub unsafe fn memchr3( 26 | n1: u8, n2: u8, n3: u8, 27 | haystack: &[u8] 28 | ) -> Option { 29 | let vn1 = _mm_set1_epi8(n1 as i8); 30 | let vn2 = _mm_set1_epi8(n2 as i8); 31 | let vn3 = _mm_set1_epi8(n3 as i8); 32 | let vn = _mm_setr_epi8( 33 | n1 as i8, n2 as i8, n3 as i8, 0, 34 | 0, 0, 0, 0, 35 | 0, 0, 0, 0, 36 | 0, 0, 0, 0, 37 | ); 38 | let len = haystack.len(); 39 | let start_ptr = haystack.as_ptr(); 40 | let end_ptr = haystack[haystack.len()..].as_ptr(); 41 | let mut ptr = start_ptr; 42 | 43 | if haystack.len() < VECTOR_SIZE { 44 | while ptr < end_ptr { 45 | if *ptr == n1 || *ptr == n2 || *ptr == n3 { 46 | return Some(sub(ptr, start_ptr)); 47 | } 48 | ptr = ptr.offset(1); 49 | } 50 | return None; 51 | } 52 | while ptr <= end_ptr.sub(VECTOR_SIZE) { 53 | let chunk = _mm_loadu_si128(ptr as *const __m128i); 54 | let res = _mm_cmpestri(vn, 3, chunk, 16, CONTROL_ANY); 55 | if res < 16 { 56 | return Some(sub(ptr, start_ptr) + res as usize); 57 | } 58 | ptr = ptr.add(VECTOR_SIZE); 59 | } 60 | if ptr < end_ptr { 61 | debug_assert!(sub(end_ptr, ptr) < VECTOR_SIZE); 62 | ptr = ptr.sub(VECTOR_SIZE - sub(end_ptr, ptr)); 63 | debug_assert_eq!(sub(end_ptr, ptr), VECTOR_SIZE); 64 | 65 | return sse2::forward_search3(start_ptr, end_ptr, ptr, vn1, vn2, vn3); 66 | } 67 | None 68 | } 69 | 70 | /// Subtract `b` from `a` and return the difference. `a` should be greater than 71 | /// or equal to `b`. 72 | fn sub(a: *const u8, b: *const u8) -> usize { 73 | debug_assert!(a >= b); 74 | (a as usize) - (b as usize) 75 | } 76 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | #[cfg_attr(all(target_pointer_width = "32", 5 | any(target_arch = "mips", 6 | target_arch = "arm", 7 | target_arch = "powerpc")), 8 | repr(align(4)))] 9 | #[cfg_attr(any(target_pointer_width = "64", 10 | not(any(target_arch = "mips", 11 | target_arch = "arm", 12 | target_arch = "powerpc"))), 13 | repr(align(8)))] 14 | pub struct pthread_mutex_t { // Unverified 15 | size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], 16 | } 17 | 18 | #[cfg_attr(all(target_pointer_width = "32", 19 | any(target_arch = "mips", 20 | target_arch = "arm", 21 | target_arch = "powerpc")), 22 | repr(align(4)))] 23 | #[cfg_attr(any(target_pointer_width = "64", 24 | not(any(target_arch = "mips", 25 | target_arch = "arm", 26 | target_arch = "powerpc"))), 27 | repr(align(8)))] 28 | pub struct pthread_rwlock_t { // Unverified 29 | size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], 30 | } 31 | 32 | #[cfg_attr(any(target_pointer_width = "32", 33 | target_arch = "x86_64", 34 | target_arch = "powerpc64", 35 | target_arch = "mips64", 36 | target_arch = "s390x", 37 | target_arch = "sparc64"), 38 | repr(align(4)))] 39 | #[cfg_attr(not(any(target_pointer_width = "32", 40 | target_arch = "x86_64", 41 | target_arch = "powerpc64", 42 | target_arch = "mips64", 43 | target_arch = "s390x", 44 | target_arch = "sparc64")), 45 | repr(align(8)))] 46 | pub struct pthread_mutexattr_t { // Unverified 47 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 48 | } 49 | 50 | #[repr(align(8))] 51 | pub struct pthread_cond_t { // Unverified 52 | size: [u8; ::__SIZEOF_PTHREAD_COND_T], 53 | } 54 | 55 | #[repr(align(4))] 56 | pub struct pthread_condattr_t { // Unverified 57 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 58 | } 59 | } 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /vendor/regex/tests/searcher.rs: -------------------------------------------------------------------------------- 1 | macro_rules! searcher { 2 | ($name:ident, $re:expr, $haystack:expr) => ( 3 | searcher!($name, $re, $haystack, vec vec![]); 4 | ); 5 | ($name:ident, $re:expr, $haystack:expr, $($steps:expr,)*) => ( 6 | searcher!($name, $re, $haystack, vec vec![$($steps),*]); 7 | ); 8 | ($name:ident, $re:expr, $haystack:expr, $($steps:expr),*) => ( 9 | searcher!($name, $re, $haystack, vec vec![$($steps),*]); 10 | ); 11 | ($name:ident, $re:expr, $haystack:expr, vec $expect_steps:expr) => ( 12 | #[test] 13 | #[allow(unused_imports)] 14 | fn $name() { 15 | searcher_expr! {{ 16 | use std::str::pattern::{Pattern, Searcher}; 17 | use std::str::pattern::SearchStep::{Match, Reject, Done}; 18 | let re = regex!($re); 19 | let mut se = re.into_searcher($haystack); 20 | let mut got_steps = vec![]; 21 | loop { 22 | match se.next() { 23 | Done => break, 24 | step => { got_steps.push(step); } 25 | } 26 | } 27 | assert_eq!(got_steps, $expect_steps); 28 | }} 29 | } 30 | ); 31 | } 32 | 33 | searcher!(searcher_empty_regex_empty_haystack, r"", "", Match(0, 0)); 34 | searcher!( 35 | searcher_empty_regex, 36 | r"", 37 | "ab", 38 | Match(0, 0), 39 | Reject(0, 1), 40 | Match(1, 1), 41 | Reject(1, 2), 42 | Match(2, 2) 43 | ); 44 | searcher!(searcher_empty_haystack, r"\d", ""); 45 | searcher!(searcher_one_match, r"\d", "5", Match(0, 1)); 46 | searcher!(searcher_no_match, r"\d", "a", Reject(0, 1)); 47 | searcher!( 48 | searcher_two_adjacent_matches, 49 | r"\d", 50 | "56", 51 | Match(0, 1), 52 | Match(1, 2) 53 | ); 54 | searcher!( 55 | searcher_two_non_adjacent_matches, 56 | r"\d", 57 | "5a6", 58 | Match(0, 1), 59 | Reject(1, 2), 60 | Match(2, 3) 61 | ); 62 | searcher!(searcher_reject_first, r"\d", "a6", Reject(0, 1), Match(1, 2)); 63 | searcher!( 64 | searcher_one_zero_length_matches, 65 | r"\d*", 66 | "a1b2", 67 | Match(0, 0), // ^ 68 | Reject(0, 1), // a 69 | Match(1, 2), // a1 70 | Reject(2, 3), // a1b 71 | Match(3, 4), // a1b2 72 | ); 73 | searcher!( 74 | searcher_many_zero_length_matches, 75 | r"\d*", 76 | "a1bbb2", 77 | Match(0, 0), // ^ 78 | Reject(0, 1), // a 79 | Match(1, 2), // a1 80 | Reject(2, 3), // a1b 81 | Match(3, 3), // a1bb 82 | Reject(3, 4), // a1bb 83 | Match(4, 4), // a1bbb 84 | Reject(4, 5), // a1bbb 85 | Match(5, 6), // a1bbba 86 | ); 87 | searcher!( 88 | searcher_unicode, 89 | r".+?", 90 | "Ⅰ1Ⅱ2", 91 | Match(0, 3), 92 | Match(3, 4), 93 | Match(4, 7), 94 | Match(7, 8) 95 | ); 96 | -------------------------------------------------------------------------------- /vendor/lazy_static/README.md: -------------------------------------------------------------------------------- 1 | lazy-static.rs 2 | ============== 3 | 4 | A macro for declaring lazily evaluated statics in Rust. 5 | 6 | Using this macro, it is possible to have `static`s that require code to be 7 | executed at runtime in order to be initialized. 8 | This includes anything requiring heap allocations, like vectors or hash maps, 9 | as well as anything that requires non-const function calls to be computed. 10 | 11 | [![Travis-CI Status](https://travis-ci.com/rust-lang-nursery/lazy-static.rs.svg?branch=master)](https://travis-ci.com/rust-lang-nursery/lazy-static.rs) 12 | [![Latest version](https://img.shields.io/crates/v/lazy_static.svg)](https://crates.io/crates/lazy_static) 13 | [![Documentation](https://docs.rs/lazy_static/badge.svg)](https://docs.rs/lazy_static) 14 | [![License](https://img.shields.io/crates/l/lazy_static.svg)](https://github.com/rust-lang-nursery/lazy-static.rs#license) 15 | 16 | ## Minimum supported `rustc` 17 | 18 | `1.27.2+` 19 | 20 | This version is explicitly tested in CI and may only be bumped in new minor versions. Any changes to the supported minimum version will be called out in the release notes. 21 | 22 | 23 | # Getting Started 24 | 25 | [lazy-static.rs is available on crates.io](https://crates.io/crates/lazy_static). 26 | It is recommended to look there for the newest released version, as well as links to the newest builds of the docs. 27 | 28 | At the point of the last update of this README, the latest published version could be used like this: 29 | 30 | Add the following dependency to your Cargo manifest... 31 | 32 | ```toml 33 | [dependencies] 34 | lazy_static = "1.4.0" 35 | ``` 36 | 37 | ...and see the [docs](https://docs.rs/lazy_static) for how to use it. 38 | 39 | # Example 40 | 41 | ```rust 42 | #[macro_use] 43 | extern crate lazy_static; 44 | 45 | use std::collections::HashMap; 46 | 47 | lazy_static! { 48 | static ref HASHMAP: HashMap = { 49 | let mut m = HashMap::new(); 50 | m.insert(0, "foo"); 51 | m.insert(1, "bar"); 52 | m.insert(2, "baz"); 53 | m 54 | }; 55 | } 56 | 57 | fn main() { 58 | // First access to `HASHMAP` initializes it 59 | println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); 60 | 61 | // Any further access to `HASHMAP` just returns the computed value 62 | println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap()); 63 | } 64 | ``` 65 | 66 | ## License 67 | 68 | Licensed under either of 69 | 70 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) 71 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) 72 | 73 | at your option. 74 | 75 | ### Contribution 76 | 77 | Unless you explicitly state otherwise, any contribution intentionally submitted 78 | for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any 79 | additional terms or conditions. 80 | --------------------------------------------------------------------------------