1macro_rules! formatting_docs {($($additional_fmt_overrides:expr)?) => {
2concat!(r##"
3# Formatting
45Literals are Display formatted by default, so that you can pass string literals
6without worrying about what the current formatting settings are.
78Expressions are formatted as determined by the `$fmtarg` argument.
910Note that literals inside parentheses (eg: `(100)`) are considered expressions
11by this macro.
1213### Formatting overrides
1415You can override how an argument is formatted by prefixing the argument expression with
16any of the options below:
17- `debug:` or `{?}:`: `Debug` formats the argument.
18- `alt_debug:` or `{#?}:`: alternate-`Debug` formats the argument.
19- `display:` or `{}:`: `Display` formats the argument.
20- `alt_display:` or `{#}:`: alternate-`Display` formats the argument.
21- `bin:` or `{b}:`: `Debug` formats the argument, with binary-formatted numbers.
22- `alt_bin:` or `{#b}:`:
23alternate-`Debug` formats the argument, with binary-formatted numbers.
24- `hex:` or `{X}:`:
25`Debug` formats the argument, with hexadecimal-formatted numbers.
26- `alt_hex:` or `{#X}:`:
27alternate-`Debug` formats the argument, with hexadecimal-formatted numbers.
28"##,
29$($additional_fmt_overrides,)?
30r##"
31### String formatting
3233String expressions are debug-formatted like this:
34- Prepending and appending the double quote character (`"`).
35- Escaping the `'\t'`,`'\n'`,`'\r'`,`'\\'`, `'\''`, and`'\"'` characters.
36- Escaping control characters with `\xYY`,
37where `YY` is the hexadecimal value of the control character.
3839"##
40)}}
4142macro_rules! limitation_docs {() => {
43"
44Arguments to the formatting/panicking macros must have a fully inferred concrete type,
45because `const_panic` macros use duck typing to call methods on those arguments.
4647One effect of that limitation is that you will have to pass suffixed
48integer literals (eg: `100u8`) when those integers aren't inferred to be a concrete type.
49"
50}}
51pub(crate) use limitation_docs;