Commit Graph

221 Commits

Author SHA1 Message Date
徐未来 24b56b7a55 syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-04-02 16:51:27 +08:00
openharmony_ci 5496fdbd4c 回退 'Pull Request !6 : syn 1.0.107升级至2.0.48' 2024-04-02 03:27:54 +00:00
徐未来 a83871dba6 syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-04-01 20:47:12 +08:00
openharmony_ci b23f93737f 回退 'Pull Request !4 : syn 1.0.107升级至2.0.48' 2024-04-01 12:11:54 +00:00
徐未来 38de391e34 syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-03-08 17:26:00 +08:00
David Tolnay 009133d0d2 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 25b6227f79 Replace rustfmt with prettyplease crate 2022-01-12 10:01:19 -08:00
David Tolnay e3ef04ca87 Update rustfmt for generated code to 1.4.38 2022-01-12 10:00:02 -08:00
David Tolnay 2d6c353d19 Emit imports in rustfmt's preferred order 2022-01-11 13:35:29 -08:00
David Tolnay 8003864fb4 Disable reorder_imports in code generator 2022-01-11 13:28:46 -08:00
David Tolnay 9cf8f75288 Eliminate unneeded closure braces from fold impl 2022-01-10 23:36:52 -08:00
David Tolnay d5782ceb84 Resolve semicolon_if_nothing_returned clippy lint in generated code 2021-06-04 20:49:29 -07:00
David Tolnay 6d52cbdb7e Update to semver 1.0 2021-05-26 14:57:41 -07:00
David Tolnay 64a560fd0d 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 34ce349e1e 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 86717d7718 Do nonexhaustive detection based on doc(hidden) attribute 2021-01-24 00:12:58 -08:00
David Tolnay 2313693ca2 Parse variant attributes from ast_enum_of_structs 2021-01-24 00:12:14 -08:00
David Tolnay 3db7525ccd Handle path attr in internal code generator 2021-01-05 13:02:34 -08:00
David Tolnay 034390ab16 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 21b8995dc0 Revert "Revert doc cfg from Eq impls due to rustdoc bug"
Fixed by https://github.com/rust-lang/rust/pull/79300.

This reverts commit eba428d1ce.
2020-11-23 05:32:28 -08:00
David Tolnay eba428d1ce Revert doc cfg from Eq impls due to rustdoc bug 2020-11-21 14:10:46 -08:00
David Tolnay 54c268f70d Put doc cfg on extra-traits impls 2020-11-21 14:10:46 -08:00
David Tolnay 7200953c3f Put doc cfg on Clone impls 2020-11-21 14:10:46 -08:00
David Tolnay 40527c11c6 Unpin crossbeam-utils since they released fix 2020-10-24 12:18:42 -07:00
David Tolnay f45fcb09c4 Update syn-internal-codegen deps 2020-10-24 12:17:05 -07:00
David Tolnay d7656d6f31 Update syn-codegen to semver 0.11 2020-10-24 12:11:27 -07:00
David Tolnay a618c73328 Expand wildcard import 2020-10-24 11:26:24 -07:00
David Tolnay 50f92ef675 Format syn-internal-codegen with rustfmt 1.4.22-nightly 2020-10-24 11:26:24 -07:00
David Tolnay 8f1bb167e8 Adjust code generator for brackets in Token definition 2020-10-24 11:17:25 -07:00
David Tolnay 18f4af7393 Condense some import blocks 2020-09-05 22:04:36 -07:00
David Tolnay 946a9872d2 Update generated code with proc-macro2 1.0.20's formatting 2020-09-04 16:48:40 -07:00
David Tolnay 763d919f90 Move Copy impls into code generator 2020-08-17 20:54:43 -07:00
David Tolnay 95f9e40c28 Update codegen for LitBool impls 2020-08-17 19:52:52 -07:00
David Tolnay ec5a04ea32 Merge pull request #885 from dtolnay/gen
Generate extra-traits impls without derive
2020-08-17 00:53:58 -07:00
David Tolnay 3e54e8003b Resolve clippy lints in syn-internal-codegen 2020-08-17 00:22:32 -07:00
David Tolnay 068a4e43d8 Resolve clippy lints in generated Clone impls 2020-08-17 00:18:48 -07:00
David Tolnay 44b016873b Pre-expand Clone derives 2020-08-16 23:55:49 -07:00
David Tolnay ad531ec2a9 Remove #manual_extra_traits marker 2020-08-16 23:37:36 -07:00
David Tolnay 832db4021a Pre-expand Hash derives 2020-08-16 23:31:59 -07:00
David Tolnay b05412fdf3 Pre-expand Eq/PartialEq derives 2020-08-16 22:53:51 -07:00
David Tolnay 0b8e6d074a Pre-expand Debug derives for syntax tree 2020-08-16 22:51:02 -07:00
David Tolnay 0b43497f6b 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 139e04347f Better use of imports in codegen's parser 2020-08-16 22:33:27 -07:00
David Tolnay ea61a4e643 Factor out codegen node lookup for reuse 2020-08-16 20:59:57 -07:00
David Tolnay 77d5c3589c Apply format_ident macro in syn codegen 2020-08-16 20:30:13 -07:00
David Tolnay 7fc2bde4ec Factor out features-to-cfg conversion for reuse 2020-08-16 20:02:07 -07:00
David Tolnay c8e66f5f1e Drop unused extra-traits dependency from syn-internal-codegen 2020-08-16 16:24:18 -07:00
David Tolnay bc9c03be20 Rename snapshot-specific Debug impl generator 2020-08-16 15:39:24 -07:00
David Tolnay 8c49991876 Add rust-codegen configuration for codegen dir 2020-08-12 18:05:13 -07:00
David Tolnay b4c63889e8 Quote no longer requires recursion 2020-07-16 10:54:25 -07:00