Commit Graph

847 Commits

Author SHA1 Message Date
David Tolnay
efeb5eceb1
Call site has no source text 2023-03-21 22:50:21 -07:00
David Tolnay
67c6cbaf16
Expose proc_macro's source_text() on Span 2023-03-21 22:48:49 -07:00
David Tolnay
ab254879e7
Release 1.0.52 2023-03-12 14:09:04 -07:00
David Tolnay
006d135ffa
Merge pull request #367 from dtolnay/fallback
Rename 'stable' terminology to 'fallback'
2023-03-12 14:07:50 -07:00
David Tolnay
96da1a2bc1
Rename 'stable' terminology to 'fallback' 2023-03-12 14:03:49 -07:00
David Tolnay
65699c4bcb
Merge pull request #366 from dtolnay-contrib/delim
Add DelimSpan to hold the 3 different spans of a delimiter
2023-03-12 14:01:51 -07:00
David Tolnay
0dc873698b
Add DelimSpan to hold the 3 different spans of a delimiter 2023-03-11 20:18:15 -08:00
David Tolnay
1e7fc7b026
Expand documentation of Group::delimiter 2023-03-11 20:16:45 -08:00
David Tolnay
68bfd52445
Format test cfg attributes with rustfmt 2023-03-11 14:42:01 -08:00
David Tolnay
23d5478e33
Fix warning on duplicate test ignore attribute
warning: unused attribute
      --> tests/test_size.rs:27:60
       |
    27 | #[cfg_attr(not(all(wrap_proc_macro, not(span_locations))), ignore)]
       |                                                            ^^^^^^
       |
       = note: #[warn(unused_attributes)] on by default
2023-03-11 14:41:27 -08:00
David Tolnay
e1fa7326a0
Account for proc_macro::Span layout change between 1.31 and 1.32 2023-03-11 14:36:48 -08:00
David Tolnay
6083bef110
More specifically run make_sure_no_proc_macro test in CI 2023-03-11 14:33:15 -08:00
David Tolnay
74443a6795
Add sizes of not(wrap_proc_macro) spans 2023-03-11 14:29:39 -08:00
David Tolnay
31c0f43dea
Add Span size test 2023-03-11 14:22:15 -08:00
David Tolnay
a3fbb7de91
Ignore let_underscore_untyped pedantic clippy lint
error: non-binding `let` without a type annotation
       --> src/fallback.rs:433:9
        |
    433 |         let _ = name;
        |         ^^^^^^^^^^^^^
        |
        = help: consider adding a type annotation or removing the `let` keyword
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
        = note: `-D clippy::let-underscore-untyped` implied by `-D clippy::pedantic`

    error: non-binding `let` without a type annotation
       --> src/fallback.rs:940:21
        |
    940 |                     let _ = write!(escaped, "\\x{:02X}", b);
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider adding a type annotation or removing the `let` keyword
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
2023-02-26 21:57:07 -07:00
David Tolnay
9635ed9f0d
Enable type layout randomization in CI on nightly 2023-02-19 09:21:57 -08:00
David Tolnay
82eb726b71
Support a manual trigger on CI workflow 2023-02-18 17:23:55 -08:00
David Tolnay
4822d05db1
Ignore extra_unused_type_parameters clippy lint in test
error: type parameter goes unused in function definition
      --> tests/marker.rs:10:34
       |
    10 |             fn assert_implemented<T: $($marker +)+>() {}
       |                                  ^^^^^^^^^^^^^^^^^^
    ...
    42 | assert_impl!(Delimiter is Send and Sync);
       | ---------------------------------------- in this macro invocation
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
       = note: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`
       = note: this error originates in the macro `assert_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: type parameter goes unused in function definition
      --> tests/marker.rs:10:34
       |
    10 |             fn assert_implemented<T: $($marker +)+>() {}
       |                                  ^^^^^^^^^^^^^^^^^^
    ...
    43 | assert_impl!(Spacing is Send and Sync);
       | -------------------------------------- in this macro invocation
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
       = note: this error originates in the macro `assert_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: type parameter goes unused in function definition
      --> tests/marker.rs:10:34
       |
    10 |               fn assert_implemented<T: $($marker +)+>() {}
       |                                    ^^^^^^^^^^^^^^^^^^
    ...
    80 | /     assert_unwind_safe! {
    81 | |         Delimiter
    82 | |         Group
    83 | |         Ident
    ...  |
    90 | |         TokenTree
    91 | |     }
       | |_____- in this macro invocation
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
       = note: this error originates in the macro `assert_impl` which comes from the expansion of the macro `assert_unwind_safe` (in Nightly builds, run with -Z macro-backtrace for more info)
2023-02-10 19:08:42 -08:00
David Tolnay
bc369f088f
Release 1.0.51 2023-02-04 15:32:51 -08:00
David Tolnay
ec804f1267
Merge pull request #364 from dtolnay/hashes
Reduce max hash in raw strings to 255
2023-02-04 15:32:24 -08:00
David Tolnay
dffd53caa1
Reduce max hash in raw strings to 255 2023-02-04 15:29:35 -08:00
David Tolnay
f0a3490e97
Add raw string literal test cases 2023-02-04 15:29:35 -08:00
David Tolnay
3b90e7d1ed
Ignore items_after_statements pedantic clippy lint 2023-02-04 15:29:19 -08:00
David Tolnay
bce0e5f0ab
Consistently use Self in the return of From impls 2023-01-19 20:50:03 -08:00
David Tolnay
3915aeedc6
Speed up cargo fuzz CI job
https://github.com/rust-fuzz/cargo-fuzz/pull/317
2023-01-19 17:28:30 -08:00
David Tolnay
94c7519134
Release 1.0.50 2023-01-16 11:33:54 -08:00
David Tolnay
f01da432fa
Merge pull request #362 from dtolnay/hashlinecolumn
Implement Hash for LineColumn
2023-01-16 11:33:29 -08:00
David Tolnay
d4c564b836
Implement Hash for LineColumn 2023-01-16 11:31:13 -08:00
David Tolnay
92a029553b
Merge pull request #361 from dtolnay/linecolumn
Deduplicate implementations of LineColumn
2023-01-16 11:30:34 -08:00
David Tolnay
a4be9825bc
Deduplicate implementations of LineColumn 2023-01-16 11:28:24 -08:00
David Tolnay
9924b79370
Prevent actions duplication on noop merge commits 2022-12-31 12:45:32 -08:00
David Tolnay
37e89e109c
Sync license text with rust-lang repos 2022-12-30 12:00:49 -08:00
David Tolnay
8779f4c658
Update ui test suite to nightly-2022-12-30 2022-12-29 18:25:59 -08:00
David Tolnay
293705d8df
Release 1.0.49 2022-12-18 09:30:58 -08:00
David Tolnay
6b9ee3dbf6
Opt out -Zrustdoc-scrape-examples on docs.rs
I'd like a chance to audit all the code that rustdoc is inserting into
the docs. Currently I am skeptical that showing proc-macro2's internal
usages of APIs is a net benefit to the public documentation. I am also
skeptical that quite so many examples are needed, and that they should
be featured so prominently in comparison to handwritten docs. Lastly I
wish there were a way to turn this behavior off on a more granular
basis.
2022-12-18 09:30:29 -08:00
David Tolnay
a83ad604b1
Release 1.0.48 2022-12-17 11:29:38 -08:00
David Tolnay
b4fa77fea7
Update build status badge 2022-12-15 17:52:41 -08:00
David Tolnay
975c3248db
Time out workflows after 45 minutes
GitHub's default timeout is 6 hours. Recently some of my GitHub Actions
jobs have started randomly stalling for that long, which is inconvenient
because it ties up a chunk of my runner quota. It apepars to be very
rare for a job to recover after stalling. It's better to time out
quicker and retry on a different runner.
2022-11-25 18:56:18 -08:00
David Tolnay
f633e3106c
MIT copyright line
Delete the first paragraph of LICENSE-MIT (an inaccurate
pseudo-copyright line), leaving only the text of the MIT license.

Nothing about the license of proc-macro2 has changed, only our
understanding of how to correctly communicate that license has changed.

This mirrors an equivalent change applied in the rust-lang/rust
repository years ago.
2022-10-18 02:03:31 -07:00
David Tolnay
47c91c8525
Release 1.0.47 2022-10-15 01:23:57 -07:00
David Tolnay
c6942085ff
Make i's inferred type explicit to be consistent with depth 2022-10-15 01:23:24 -07:00
David Tolnay
46e9bd6b7e
Merge pull request #358 from dtolnay/depth
Fix integer overflow in nested comment parser
2022-10-15 01:23:11 -07:00
David Tolnay
5635f1b0ad
Fix integer overflow in nested comment parser 2022-10-15 01:20:34 -07:00
David Tolnay
69150f4ff2
Release 1.0.46 2022-09-28 18:59:20 -07:00
David Tolnay
6004b0aa0d
Merge pull request #354 from dtolnay/bom
Handle parsing input that starts with byte order mark
2022-09-28 18:58:41 -07:00
David Tolnay
1d068c8f1a
Test that byte order mark can only go at beginning of input 2022-09-28 18:53:26 -07:00
David Tolnay
e2327f0854
Strip a byte order mark if present 2022-09-28 18:52:07 -07:00
David Tolnay
eeb2e5b922
Add a test involving byte order mark
Currently fails with:

    thread 'byte_order_mark' panicked at 'called `Result::unwrap()` on
    an `Err` value: LexError { span: Span }', tests/test.rs:637:48
2022-09-28 18:42:24 -07:00
David Tolnay
f26128d5d6
Release 1.0.45 2022-09-28 13:39:20 -07:00
David Tolnay
4784921da6
Merge pull request #352 from dtolnay/fuzz
Add fuzz target for fallback TokenStream parser
2022-09-28 13:38:57 -07:00