Commit Graph

221 Commits

Author SHA1 Message Date
徐未来
76b407eb79 syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-04-02 16:51:27 +08:00
openharmony_ci
e4c68997d9
回退 'Pull Request !6 : syn 1.0.107升级至2.0.48' 2024-04-02 03:27:54 +00:00
徐未来
20f0300a69 syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-04-01 20:47:12 +08:00
openharmony_ci
cf68197ecf
回退 'Pull Request !4 : syn 1.0.107升级至2.0.48' 2024-04-01 12:11:54 +00:00
徐未来
f138b90acb syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-03-08 17:26:00 +08:00
David Tolnay
c6ce512015
Switch non exhaustive syntax tree enums to use #[non_exhaustive]
This follows through on the comments on the __TestExhaustive variants
promising that their purpose will be substituted with a deny(reachable)
rustc lint once one is available.

That lint is now landing as non_exhaustive_omitted_patterns in Rust 1.57.
The correct way to use it for checking exhaustivity of a match is:

    match expr {
        Expr::Array(e) => {...}
        Expr::Assign(e) => {...}
        ...
        Expr::Yield(e) => {...}

        #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
        _ => { /* some sane fallback */ }
    }
2022-03-27 14:19:01 -07:00
David Tolnay
76a4d857d7
Replace rustfmt with prettyplease crate 2022-01-12 10:01:19 -08:00
David Tolnay
7ab5312db6
Update rustfmt for generated code to 1.4.38 2022-01-12 10:00:02 -08:00
David Tolnay
7fe4cbf858
Emit imports in rustfmt's preferred order 2022-01-11 13:35:29 -08:00
David Tolnay
f6a73463a6
Disable reorder_imports in code generator 2022-01-11 13:28:46 -08:00
David Tolnay
efa6eebe15
Eliminate unneeded closure braces from fold impl 2022-01-10 23:36:52 -08:00
David Tolnay
6ceeb7dd98
Resolve semicolon_if_nothing_returned clippy lint in generated code 2021-06-04 20:49:29 -07:00
David Tolnay
621484084c
Update to semver 1.0 2021-05-26 14:57:41 -07:00
David Tolnay
d1028a2ef2
Bump codegen to rustfmt built with nightly-2021-04-26
The previously used rustfmt commit only builds with an old version of
1.52-dev, and that one is missing trait bounds on const fn.

    error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
       --> .cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.4/src/mutex.rs:143:6
        |
    143 | impl<R: RawMutex, T> Mutex<R, T> {
        |      ^
        = help: add `#![feature(const_fn)]` to the crate attributes to enable

    error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
       --> .cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.4/src/remutex.rs:224:6
        |
    224 | impl<R: RawMutex, G: GetThreadId, T> ReentrantMutex<R, G, T> {
        |      ^
        = help: add `#![feature(const_fn)]` to the crate attributes to enable

    error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
       --> .cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.4/src/remutex.rs:224:19
        |
    224 | impl<R: RawMutex, G: GetThreadId, T> ReentrantMutex<R, G, T> {
        |                   ^
        = help: add `#![feature(const_fn)]` to the crate attributes to enable

    error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
       --> .cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.4/src/rwlock.rs:348:6
        |
    348 | impl<R: RawRwLock, T> RwLock<R, T> {
        |      ^
        = help: add `#![feature(const_fn)]` to the crate attributes to enable
2021-04-30 19:35:28 -07:00
David Tolnay
17332d952a
Bump codegen build to newer rustfmt commit
The previously used rustfmt commit only builds with an early version of
1.51-dev, and that one is missing addr_of.

    error[E0433]: failed to resolve: could not find `addr_of` in `ptr`
       --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.40/src/error.rs:606:14
        |
    606 |         ptr::addr_of!((*unerased.as_ptr())._object) as *mut E,
        |              ^^^^^^^ could not find `addr_of` in `ptr`

    error[E0433]: failed to resolve: could not find `addr_of` in `ptr`
       --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.40/src/error.rs:647:22
        |
    647 |                 ptr::addr_of!((*unerased.as_ptr())._object) as *mut E,
        |                      ^^^^^^^ could not find `addr_of` in `ptr`
2021-03-26 13:52:16 -04:00
David Tolnay
dffc40d1c7
Do nonexhaustive detection based on doc(hidden) attribute 2021-01-24 00:12:58 -08:00
David Tolnay
f30253a22c
Parse variant attributes from ast_enum_of_structs 2021-01-24 00:12:14 -08:00
David Tolnay
ebfb8f2c1a
Handle path attr in internal code generator 2021-01-05 13:02:34 -08:00
David Tolnay
a632de1ad9
Update internal code generator to rustfmt 2.0.0-rc.2
The previously pinned rustfmt commit + toolchain have no longer been
compiling as of servo/rust-smallvec#248.

    error[E0658]: unions with non-`Copy` fields are unstable
       --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.6.0/src/lib.rs:353:1
        |
    353 | / union SmallVecData<A: Array> {
    354 | |     inline: core::mem::ManuallyDrop<MaybeUninit<A>>,
    355 | |     heap: (*mut A::Item, usize),
    356 | | }
        | |_^
        |
        = note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
        = help: add `#![feature(untagged_unions)]` to the crate attributes to enable
2020-12-31 21:39:29 -08:00
David Tolnay
c8719be4c1
Revert "Revert doc cfg from Eq impls due to rustdoc bug"
Fixed by https://github.com/rust-lang/rust/pull/79300.

This reverts commit d9fb4164a4.
2020-11-23 05:32:28 -08:00
David Tolnay
d9fb4164a4
Revert doc cfg from Eq impls due to rustdoc bug 2020-11-21 14:10:46 -08:00
David Tolnay
99be3074d1
Put doc cfg on extra-traits impls 2020-11-21 14:10:46 -08:00
David Tolnay
82777db3db
Put doc cfg on Clone impls 2020-11-21 14:10:46 -08:00
David Tolnay
301a74eae7
Unpin crossbeam-utils since they released fix 2020-10-24 12:18:42 -07:00
David Tolnay
8f0dbd5050
Update syn-internal-codegen deps 2020-10-24 12:17:05 -07:00
David Tolnay
ab2c642edd
Update syn-codegen to semver 0.11 2020-10-24 12:11:27 -07:00
David Tolnay
f1f86306dc
Expand wildcard import 2020-10-24 11:26:24 -07:00
David Tolnay
ce86fcecf3
Format syn-internal-codegen with rustfmt 1.4.22-nightly 2020-10-24 11:26:24 -07:00
David Tolnay
f9f55521a8
Adjust code generator for brackets in Token definition 2020-10-24 11:17:25 -07:00
David Tolnay
ab059367b4
Condense some import blocks 2020-09-05 22:04:36 -07:00
David Tolnay
19f8297213
Update generated code with proc-macro2 1.0.20's formatting 2020-09-04 16:48:40 -07:00
David Tolnay
ba23fd18e1
Move Copy impls into code generator 2020-08-17 20:54:43 -07:00
David Tolnay
d4dd462fb3
Update codegen for LitBool impls 2020-08-17 19:52:52 -07:00
David Tolnay
a674dd0a4e
Merge pull request #885 from dtolnay/gen
Generate extra-traits impls without derive
2020-08-17 00:53:58 -07:00
David Tolnay
36ddd9aa54
Resolve clippy lints in syn-internal-codegen 2020-08-17 00:22:32 -07:00
David Tolnay
148dd04c4f
Resolve clippy lints in generated Clone impls 2020-08-17 00:18:48 -07:00
David Tolnay
ad60148cb9
Pre-expand Clone derives 2020-08-16 23:55:49 -07:00
David Tolnay
b5127106b1
Remove #manual_extra_traits marker 2020-08-16 23:37:36 -07:00
David Tolnay
ac1124b354
Pre-expand Hash derives 2020-08-16 23:31:59 -07:00
David Tolnay
f89b47203d
Pre-expand Eq/PartialEq derives 2020-08-16 22:53:51 -07:00
David Tolnay
9406d59a18
Pre-expand Debug derives for syntax tree 2020-08-16 22:51:02 -07:00
David Tolnay
4c45b2d4b2
Drop clone-impls dependency from code generator
This will unblock pre-expanding those Clone impls from the code
generator, rather that relying on derive which takes longer to compile.
2020-08-16 22:49:14 -07:00
David Tolnay
42fc98067f
Better use of imports in codegen's parser 2020-08-16 22:33:27 -07:00
David Tolnay
a3961cb972
Factor out codegen node lookup for reuse 2020-08-16 20:59:57 -07:00
David Tolnay
cbe7503b97
Apply format_ident macro in syn codegen 2020-08-16 20:30:13 -07:00
David Tolnay
10d86c4eba
Factor out features-to-cfg conversion for reuse 2020-08-16 20:02:07 -07:00
David Tolnay
ba481824d4
Drop unused extra-traits dependency from syn-internal-codegen 2020-08-16 16:24:18 -07:00
David Tolnay
56e3b0b902
Rename snapshot-specific Debug impl generator 2020-08-16 15:39:24 -07:00
David Tolnay
252c00fd54
Add rust-codegen configuration for codegen dir 2020-08-12 18:05:13 -07:00
David Tolnay
0af800cecb
Quote no longer requires recursion 2020-07-16 10:54:25 -07:00