Commit Graph

542 Commits

Author SHA1 Message Date
David Tolnay
607a171c05
Update workflows to actions/checkout@v3 2022-04-25 01:49:18 -07:00
David Tolnay
6dd04dadec
Disable ui test on miri 2022-04-24 15:15:58 -07:00
David Tolnay
8c954ca61f
Release 1.0.18 2022-04-10 21:09:13 -07:00
David Tolnay
0447cf03ff
Merge pull request #219 from dtolnay/doc
Show simpler rules in macro documentation
2022-04-10 21:08:50 -07:00
David Tolnay
241b8d6fdb
Show simpler rules in macro documentation 2022-04-10 21:05:42 -07:00
David Tolnay
b5160b1512
Touch up PR 217 2022-04-10 21:01:28 -07:00
David Tolnay
2d23d9de7c
Merge pull request #217 from nnethercote/special-case-1-2
Special case `quote!`/`quote_spanned!` for 1 and 2 tts.
2022-04-10 20:58:17 -07:00
Nicholas Nethercote
4d75f2e550 Special case quote!/quote_spanned! for 1 and 2 tts.
These make crates that use `quote` compile faster.

I also tried specializing for 3 tts, but the rules are more complex and
the additional perf wins are much smaller than they are for 1 and 2 tts.
2022-04-11 13:52:58 +10:00
David Tolnay
31c3be473d
Update ui test suite to nightly-2022-04-06 2022-04-05 19:36:03 -07:00
David Tolnay
a53dd098d4
Merge pull request #216 from dtolnay/character0
Use a character other than \0 for testing unicode escapes
2022-03-27 20:14:17 -07:00
David Tolnay
678d83dd58
Use a character other than \0 for testing unicode escapes 2022-03-27 20:08:16 -07:00
David Tolnay
0ec6e20dc9
Release 1.0.17 2022-03-25 15:26:41 -07:00
David Tolnay
7c357e801a
Merge pull request #215 from dtolnay/comments
Touch up comments from PR #211
2022-03-25 00:57:26 -07:00
David Tolnay
8e11f47054
Touch up comments from PR 211 2022-03-25 00:49:44 -07:00
David Tolnay
927317c5ed
Merge pull request 211 from nnethercote/add-comments 2022-03-25 00:27:01 -07:00
David Tolnay
c1723f9d74
Merge pull request #214 from dtolnay/docconcat
Remove part about `concat!` from doc comment example
2022-03-25 00:15:38 -07:00
David Tolnay
86c29ac520
Remove part about concat! from doc comment example 2022-03-25 00:08:49 -07:00
Nicholas Nethercote
7f2e0d6b5b Add some comments about how quote_each_token works.
I didn't understand how this code worked until I used `trace_macros` on
an example and saw some expansions. This commit contains the comments I
wish had been present.
2022-03-21 09:23:44 +11:00
David Tolnay
8cad741724
Release 1.0.16 2022-03-17 15:46:18 -07:00
David Tolnay
5353edb24a
Reword quote_token explanation comment 2022-03-17 15:45:47 -07:00
David Tolnay
5b7afe8922
Merge pull request #210 from lqd/reorder_arguments
Reorder arguments in `quote_token` and `quote_token_spanned`
2022-03-17 15:45:43 -07:00
Rémy Rakic
9af37e4762 Add comment to quote_token about the tokens order 2022-03-17 23:19:05 +01:00
Rémy Rakic
8ee39a80ae reorder quote_token_spanned arguments 2022-03-17 23:03:40 +01:00
Rémy Rakic
738b651263 reorder quote_token arguments 2022-03-17 13:25:29 +01:00
David Tolnay
05fcc344ec
Revert "Work around clippy semicolon_if_nothing_returned regression"
This reverts commit 264221ecb5.
2022-03-17 01:21:37 -07:00
David Tolnay
3d12669786
Merge pull request #209 from nnethercote/reorder-quote_token
Order rules in `quote_token!` and `quote_token_spanned!` by frequency.
2022-03-17 01:17:51 -07:00
Nicholas Nethercote
fad6995254 Order rules in quote_token! and quote_token_spanned! by frequency.
This reduces `cargo check` times by 4-9% on a few crates that use
`quote!` heavily.
2022-03-17 14:16:50 +11:00
David Tolnay
278057d0d2
Release 1.0.15 2022-01-21 17:07:00 -08:00
David Tolnay
ae93cf2947
Detect warnings in CI 2021-12-31 22:15:51 -08:00
David Tolnay
63ce7f4d13
Release 1.0.14 2021-12-27 19:02:55 -08:00
David Tolnay
0a04bae97b
Merge pull request #203 from dtolnay/parse
Optimize parse+extend to make only one proc macro bridge call
2021-12-27 19:02:25 -08:00
David Tolnay
b273a4cb9b
Optimize parse+extend to make only one proc macro bridge call 2021-12-27 18:52:16 -08:00
David Tolnay
f621fe64a8
Delete $:literal codepath
It turns out this breaks non-builtin literal suffixes, such as in
`quote!(1u256)`. Those match fine against $:tt, but if you match them
against $:literal they eagerly fail the macro expansion without falling
through to the next macro_rules arm.

    error: invalid width `256` for integer literal
     --> repro.rs:4:9
      |
    4 |         1u256
      |         ^^^^^
      |
      = help: valid widths are 8, 16, 32, 64 and 128
2021-12-27 18:45:52 -08:00
David Tolnay
b8b6e4201b
Add test involving non-builtin literal suffix
Currently fails:

    error: invalid width `256` for integer literal
       --> tests/test.rs:179:16
        |
    179 |         1 1i32 1u256
        |                ^^^^^
        |
        = help: valid widths are 8, 16, 32, 64 and 128
2021-12-27 18:44:06 -08:00
David Tolnay
917d940933
Release 1.0.13 2021-12-27 14:31:20 -08:00
David Tolnay
b276b1b7a0
Fix broken IdentFragment link in format_ident doc
warning: unresolved link to `IdentFragment`
      --> src/format.rs:13:16
       |
    13 | /// * `{}` ⇒ [`IdentFragment`]
       |                ^^^^^^^^^^^^^ no item named `IdentFragment` in scope
       |
       = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
       = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

    warning: unresolved link to `IdentFragment`
      --> src/format.rs:25:45
       |
    25 | /// Unlike `format!`, this macro uses the [`IdentFragment`] formatting trait by
       |                                             ^^^^^^^^^^^^^ no item named `IdentFragment` in scope
       |
       = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
2021-12-27 14:30:46 -08:00
David Tolnay
703c1ca754
Remove unneeded backticks in links in format_ident doc 2021-12-27 14:29:55 -08:00
David Tolnay
071f17ff2c
Release 1.0.12 2021-12-27 12:43:14 -08:00
David Tolnay
0a522dfaca
Declare dependency on proc-macro2 1.0.36+
This version added the Literal::from_str_unchecked constructor.
2021-12-27 12:42:44 -08:00
David Tolnay
b5c2f2bbd1
Remove proc-macro2 patch now that 1.0.36 is published 2021-12-27 12:42:24 -08:00
David Tolnay
d9b632738f
Release 1.0.11 2021-12-27 12:30:50 -08:00
David Tolnay
28fa00e755
Merge pull request #202 from dtolnay/literal
Restore support for toolchains without $:literal matcher
2021-12-27 12:30:30 -08:00
David Tolnay
27d9d5ed51
Restore support for toolchains without $:literal matcher 2021-12-27 12:26:07 -08:00
David Tolnay
7e3c9fca76
Merge pull request #201 from dtolnay/isboolean
Fix no as_slice() on arrays on old toolchains
2021-12-27 12:17:01 -08:00
David Tolnay
50e8ac82c9
Fix no as_slice() on arrays on old toolchains 2021-12-27 12:12:08 -08:00
David Tolnay
72ca26e03b
Merge pull request #200 from dtolnay/isboolean
Fix Pattern trait unimplemented for [char; 2]
2021-12-27 12:10:42 -08:00
David Tolnay
96085ca54d
Fix Pattern trait unimplemented for [char; 2] 2021-12-27 12:07:12 -08:00
David Tolnay
d74545e82b
Merge pull request #199 from dtolnay/respan
Recursively respan tokens interpolated from a macro_rules metavariable
2021-12-26 22:48:08 -08:00
David Tolnay
ce4d081908
Recursively respan tokens interpolated from a macro_rules metavariable 2021-12-26 22:44:51 -08:00
David Tolnay
f45df3134f
Merge pull request #198 from dtolnay/underscore
Recognize underscore token to avoid slow path
2021-12-26 22:35:41 -08:00