| 1 |
use superrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/::*; |
| 2 |
|
| 3 |
use superrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/::{ParseErrorrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# as PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#, ParseErrorKindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind# as PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#}; |
| 4 |
|
| 5 |
use craterust-analyzer cargo const_format_proc_macros 0.2.34 crate/::formattingrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/::{FormattingFlagsrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags# as FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#, IsAlternaterust-analyzer cargo const_format_proc_macros 0.2.34 formatting/IsAlternate#, NumberFormattingrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/NumberFormatting#}; |
| 6 |
|
| 7 |
use fastrandrust-analyzer cargo fastrand 2.5.0 crate/::Rngrust-analyzer cargo fastrand 2.5.0 Rng#; |
| 8 |
|
| 9 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#; |
| 10 |
|
| 11 |
fn errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(s: &'static str) -> ParseErrorrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 12 |
FormatStrrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#::parserust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FormatStr]parse().(s, StrRawnessrust-analyzer cargo const_format_proc_macros 0.2.34 parse_utils/StrRawness#::dummyrust-analyzer cargo const_format_proc_macros 0.2.34 parse_utils/impl#[StrRawness]dummy().()).unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().() |
| 13 |
} |
| 14 |
|
| 15 |
fn okrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok().(s: &'static str) -> FormatStrrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr# { |
| 16 |
FormatStrrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#::parserust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FormatStr]parse().(s, StrRawnessrust-analyzer cargo const_format_proc_macros 0.2.34 parse_utils/StrRawness#::dummyrust-analyzer cargo const_format_proc_macros 0.2.34 parse_utils/impl#[StrRawness]dummy().()).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 17 |
} |
| 18 |
|
| 19 |
const NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.: IsAlternaterust-analyzer cargo const_format_proc_macros 0.2.34 formatting/IsAlternate# = IsAlternaterust-analyzer cargo const_format_proc_macros 0.2.34 formatting/IsAlternate#::Norust-analyzer cargo const_format_proc_macros 0.2.34 formatting/IsAlternate#No#; |
| 20 |
const NFDECrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NFDEC.: NumberFormattingrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/NumberFormatting# = NumberFormattingrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/NumberFormatting#::Decimalrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/NumberFormatting#Decimal#; |
| 21 |
|
| 22 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 23 |
fn unclosed_argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/unclosed_arg().() { |
| 24 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 25 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("_{"), |
| 26 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 27 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 1, |
| 28 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::UnclosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#UnclosedArg# |
| 29 |
} |
| 30 |
); |
| 31 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 32 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("___{"), |
| 33 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 34 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 35 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::UnclosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#UnclosedArg# |
| 36 |
} |
| 37 |
); |
| 38 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 39 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("___{__"), |
| 40 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 41 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 42 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::UnclosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#UnclosedArg# |
| 43 |
} |
| 44 |
); |
| 45 |
} |
| 46 |
|
| 47 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 48 |
fn invalid_closed_argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/invalid_closed_arg().() { |
| 49 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 50 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("_}"), |
| 51 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 52 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 1, |
| 53 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::InvalidClosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#InvalidClosedArg# |
| 54 |
} |
| 55 |
); |
| 56 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 57 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("___}"), |
| 58 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 59 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 60 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::InvalidClosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#InvalidClosedArg# |
| 61 |
} |
| 62 |
); |
| 63 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 64 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().("___}__"), |
| 65 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 66 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 67 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::InvalidClosedArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#InvalidClosedArg# |
| 68 |
} |
| 69 |
); |
| 70 |
} |
| 71 |
|
| 72 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 73 |
fn not_a_numberrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/not_a_number().() { |
| 74 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 75 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {0a} "), |
| 76 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 77 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 78 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_a_numberrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_a_number().("0a") |
| 79 |
} |
| 80 |
); |
| 81 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 82 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {4B:?} "), |
| 83 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 84 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 4, |
| 85 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_a_numberrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_a_number().("4B") |
| 86 |
} |
| 87 |
); |
| 88 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 89 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {6_:} "), |
| 90 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 91 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 5, |
| 92 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_a_numberrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_a_number().("6_") |
| 93 |
} |
| 94 |
); |
| 95 |
} |
| 96 |
|
| 97 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 98 |
fn not_an_identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/not_an_ident().() { |
| 99 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 100 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {?} "), |
| 101 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 102 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 103 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_an_identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_an_ident().("?") |
| 104 |
} |
| 105 |
); |
| 106 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 107 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {_} "), |
| 108 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 109 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 3, |
| 110 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_an_identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_an_ident().("_") |
| 111 |
} |
| 112 |
); |
| 113 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 114 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {a?} "), |
| 115 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 116 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 4, |
| 117 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_an_identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_an_ident().("a?") |
| 118 |
} |
| 119 |
); |
| 120 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 121 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {_?:} "), |
| 122 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 123 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 5, |
| 124 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::not_an_identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]not_an_ident().("_?") |
| 125 |
} |
| 126 |
); |
| 127 |
} |
| 128 |
|
| 129 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 130 |
fn unknown_formattingrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/unknown_formatting().() { |
| 131 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 132 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {:!} "), |
| 133 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 134 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 5, |
| 135 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::unknown_formattingrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]unknown_formatting().("!") |
| 136 |
} |
| 137 |
); |
| 138 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 139 |
errrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/err().(" {:????} "), |
| 140 |
PErust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError# { |
| 141 |
posrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#pos.: 6, |
| 142 |
kindrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseError#kind.: PEKrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/ParseErrorKind#::unknown_formattingrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/errors/impl#[ParseErrorKind]unknown_formatting().("????") |
| 143 |
} |
| 144 |
); |
| 145 |
} |
| 146 |
|
| 147 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 148 |
fn ok_casesrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok_cases().() { |
| 149 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 150 |
okrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok().("{{{100}}}{200:}{300:?}").listrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#list., |
| 151 |
vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 152 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("{"), |
| 153 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(100)), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 154 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("}"), |
| 155 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(200)), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 156 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(300)), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::debugrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]debug().(NFDECrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NFDEC., NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 157 |
] |
| 158 |
); |
| 159 |
|
| 160 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 161 |
okrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok().("{{{}}}{:}{:?}").listrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#list., |
| 162 |
vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 163 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("{"), |
| 164 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 165 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("}"), |
| 166 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 167 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::Positionalrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#Positional#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::debugrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]debug().(NFDECrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NFDEC., NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 168 |
] |
| 169 |
); |
| 170 |
|
| 171 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 172 |
okrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok().("{{{AA}}}{BB:}{CC:?}").listrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#list., |
| 173 |
vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 174 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("{"), |
| 175 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("AA"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 176 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("}"), |
| 177 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("BB"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 178 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("CC"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::debugrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]debug().(NFDECrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NFDEC., NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 179 |
] |
| 180 |
); |
| 181 |
|
| 182 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 183 |
okrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/ok().("AA {BB} CC {__:}{_aA0ñÑóö:}{FF:?} EE").listrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#list., |
| 184 |
vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 185 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().("AA "), |
| 186 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("BB"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 187 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().(" CC "), |
| 188 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("__"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 189 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("_aA0ñÑóö"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::displayrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]display().(NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 190 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::argrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]arg().(WhichArgrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/WhichArg#::identrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[WhichArg]ident().("FF"), FFrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/FormattingFlags#::debugrust-analyzer cargo const_format_proc_macros 0.2.34 formatting/impl#[FormattingFlags]debug().(NFDECrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NFDEC., NOALTrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/NOALT.)), |
| 191 |
FmtStrComponentrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FmtStrComponent#::strrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/parsing/impl#[FmtStrComponent]str().(" EE"), |
| 192 |
] |
| 193 |
); |
| 194 |
} |
| 195 |
|
| 196 |
//////////////////////////////////////////////////////////////////////////////// |
| 197 |
|
| 198 |
trait RngExtrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/RngExt# { |
| 199 |
/// # Panic |
| 200 |
/// |
| 201 |
/// Panics if the input slice is empty |
| •202 |
fn pickrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/RngExt#pick().<'a, T>(&mut self, slice: &'a [T]) -> &'a T; |
| 203 |
|
| 204 |
/// # Panic |
| 205 |
/// |
| 206 |
/// Panics if there are no `chars` in the `bounds` |
| •207 |
fn char_rust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/RngExt#char_().(&mut self, bounds: RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#<char>) -> char; |
| 208 |
} |
| 209 |
|
| 210 |
impl RngExtrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/RngExt# for Rngrust-analyzer cargo fastrand 2.5.0 Rng# { |
| •211 |
fn pickrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/impl#[Rng][RngExt]pick().<'a, T>(&mut self, slice: &'a [T]) -> &'a T { |
| 212 |
&slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.usizerust-analyzer cargo fastrand 2.5.0 impl#[Rng]usize().(0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#slice.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().())]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 213 |
} |
| 214 |
|
| •215 |
fn char_rust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/impl#[Rng][RngExt]char_().(&mut self, bounds: RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#<char>) -> char { |
| 216 |
if let Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# = bounds.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`][Clone]clone().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/range/impl#[`ops::RangeInclusive<A>`][Iterator]next().() { |
| 217 |
panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("There are no chars in the {:?} bounds", bounds); |
| 218 |
} |
| 219 |
|
| 220 |
let u32_bounds = u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[u32][`From<char>`]from().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().bounds.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]start().())..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[u32][`From<char>`]from().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().bounds.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]end().()); |
| 221 |
|
| 222 |
loop { |
| 223 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(x) = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::charrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/::from_u32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/from_u32().(self.u32rust-analyzer cargo fastrand 2.5.0 impl#[Rng]u32().(u32_bounds.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`][Clone]clone().())) { |
| 224 |
break x; |
| 225 |
} |
| 226 |
} |
| 227 |
} |
| 228 |
} |
| 229 |
|
| 230 |
fn generate_inputrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/generate_input().() -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| •231 |
let mut rng = Rngrust-analyzer cargo fastrand 2.5.0 Rng#::newrust-analyzer cargo fastrand 2.5.0 global_rng/impl#[Rng]new().(); |
| 232 |
let len = rng.usizerust-analyzer cargo fastrand 2.5.0 impl#[Rng]usize().(0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#40); |
| 233 |
let mut string = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]with_capacity().(len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().2); |
| 234 |
|
| 235 |
for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#len { |
| 236 |
match rng.u8rust-analyzer cargo fastrand 2.5.0 impl#[Rng]u8().(0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#100) { |
| 237 |
0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#10 => string.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rng.pickrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/impl#[Rng][RngExt]pick().(&['{', '}'])), |
| 238 |
_ => { |
| 239 |
let range = rng |
| 240 |
.pickrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/impl#[Rng][RngExt]pick().(&[ |
| 241 |
'A'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'Z', |
| 242 |
'a'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'z', |
| 243 |
'0'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'9', |
| 244 |
'\u{0000}'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'\u{007F}', |
| 245 |
'\u{007F}'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'\u{07FF}', |
| 246 |
'\u{07FF}'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'\u{FFFF}', |
| 247 |
'\u{10000}'..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#'\u{10FFFF}', |
| 248 |
]) |
| 249 |
.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`][Clone]clone().(); |
| 250 |
|
| 251 |
for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#rng.u32rust-analyzer cargo fastrand 2.5.0 impl#[Rng]u32().(0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#4) { |
| 252 |
string.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(rng.char_rust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/impl#[Rng][RngExt]char_().(range.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`][Clone]clone().())); |
| 253 |
} |
| 254 |
} |
| 255 |
}; |
| 256 |
} |
| 257 |
|
| 258 |
string |
| 259 |
} |
| 260 |
|
| 261 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 262 |
fn never_panicsrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/never_panics().() { |
| 263 |
let iters = 200; |
| 264 |
loop { |
| 265 |
let mut ok_count = 0u64; |
| 266 |
for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#iters { |
| 267 |
let input = generate_inputrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/tests/generate_input().(); |
| 268 |
// println!("input: {}\n\n", input); |
| 269 |
if input.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<FormatStrrust-analyzer cargo const_format_proc_macros 0.2.34 format_str/FormatStr#>().is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() { |
| 270 |
ok_count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().1; |
| 271 |
} |
| 272 |
} |
| 273 |
if ok_count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().100 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().iters rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().30 { |
| 274 |
break; |
| 275 |
} else { |
| 276 |
printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("retrying never_panics"); |
| 277 |
} |
| 278 |
} |
| 279 |
} |