]> git.lizzy.rs Git - rust.git/blob - bench-cargo-miri/unicode/src/main.rs
move atomic intrinsics to their own file
[rust.git] / bench-cargo-miri / unicode / src / main.rs
1 //! Extracted from the unicode-xid exhaustive test all_valid_chars_do_not_panic_for_is_xid_continue
2
3 use unicode_xid::UnicodeXID;
4
5 /// A `char` in Rust is a Unicode Scalar Value
6 ///
7 /// See: http://www.unicode.org/glossary/#unicode_scalar_value
8 fn all_valid_chars() -> impl Iterator<Item = char> {
9     (0u32..=0xD7FF).chain(0xE000u32..=0x10FFFF).map(|u| {
10         core::convert::TryFrom::try_from(u)
11             .expect("The selected range should be infallible if the docs match impl")
12     })
13 }
14
15 fn main() {
16     // Take only the first few chars because we don't want to wait all day
17     for c in all_valid_chars().take(1_500) {
18         let _ = UnicodeXID::is_xid_continue(c);
19     }
20 }