code_ownership 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +30 -27
- data/bin/codeownership +1 -0
- data/ext/cargo-vendor/bindgen-0.72.1/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/bindgen-0.72.1/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/bindgen-0.72.1/Cargo.lock +485 -0
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/Cargo.toml +72 -38
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/Cargo.toml.orig +26 -28
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/README.md +2 -2
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/build.rs +2 -2
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/callbacks.rs +114 -10
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/clang.rs +184 -83
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/bitfield_unit.rs +20 -10
- data/ext/cargo-vendor/bindgen-0.72.1/codegen/bitfield_unit_raw_ref_macros.rs +191 -0
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/bitfield_unit_tests.rs +4 -4
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/dyngen.rs +77 -20
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/error.rs +2 -3
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/helpers.rs +106 -66
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/impl_debug.rs +32 -34
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/impl_partialeq.rs +5 -5
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/mod.rs +1197 -679
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/postprocessing/merge_extern_blocks.rs +3 -3
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/postprocessing/sort_semantically.rs +3 -3
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/serialize.rs +33 -34
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/struct_layout.rs +33 -26
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/deps.rs +1 -1
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/diagnostics.rs +22 -65
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/extra_assertions.rs +1 -1
- data/ext/cargo-vendor/bindgen-0.72.1/features.rs +570 -0
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/derive.rs +69 -75
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/has_destructor.rs +5 -6
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/has_float.rs +13 -17
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/has_type_param_in_array.rs +22 -32
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/has_vtable.rs +11 -16
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/mod.rs +15 -20
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/sizedness.rs +13 -21
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/analysis/template_params.rs +20 -26
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/annotations.rs +18 -15
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/comment.rs +2 -2
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/comp.rs +54 -29
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/context.rs +205 -136
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/derive.rs +5 -10
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/dot.rs +3 -4
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/enum_ty.rs +5 -7
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/function.rs +27 -28
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/int.rs +7 -6
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/item.rs +92 -132
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/item_kind.rs +7 -7
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/layout.rs +11 -23
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/module.rs +2 -2
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/objc.rs +22 -33
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/template.rs +26 -33
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/traversal.rs +4 -5
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/ty.rs +63 -88
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/var.rs +73 -38
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/lib.rs +186 -144
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/log_stubs.rs +6 -0
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/options/as_args.rs +1 -1
- data/ext/cargo-vendor/bindgen-0.72.1/options/cli.rs +1151 -0
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/options/mod.rs +234 -27
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/regex_set.rs +23 -28
- data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/time.rs +4 -4
- data/ext/cargo-vendor/rb-sys-0.9.130/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/Cargo.lock +23 -31
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/Cargo.toml +5 -4
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/Cargo.toml.orig +5 -4
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/build/main.rs +7 -1
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/build/stable_api_config.rs +30 -6
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/build/version.rs +14 -6
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/bindings.rs +1 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/macros.rs +701 -0
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/memory.rs +17 -6
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/stable_api/compiled.c +169 -10
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/stable_api/compiled.rs +209 -14
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_2_7.rs +770 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_3_0.rs +773 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_3_1.rs +766 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_3_2.rs +764 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_3_3.rs +777 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_3_4.rs +788 -0
- data/ext/cargo-vendor/rb-sys-0.9.130/src/stable_api/ruby_4_0.rs +784 -0
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/stable_api.rs +213 -9
- data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/utils.rs +12 -7
- data/ext/cargo-vendor/rb-sys-build-0.9.130/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/.cargo_vcs_info.json +1 -1
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/Cargo.lock +19 -27
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/Cargo.toml +8 -3
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/Cargo.toml.orig +4 -3
- data/ext/cargo-vendor/rb-sys-build-0.9.130/src/bindings/gc_stress.rs +303 -0
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/bindings/stable_api.rs +102 -11
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/bindings.rs +19 -13
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/cc.rs +1 -1
- data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/rb_config.rs +199 -2
- data/ext/cargo-vendor/rb-sys-build-0.9.130/tests/fixtures/rubyopt_stdout.rb +1 -0
- data/ext/cargo-vendor/rb-sys-build-0.9.130/tests/rubyopt.rs +17 -0
- data/ext/cargo-vendor/rb-sys-env-0.2.3/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/rb-sys-env-0.2.3/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/rb-sys-env-0.2.3/Cargo.lock +7 -0
- data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/Cargo.toml +2 -2
- data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/Cargo.toml.orig +2 -2
- data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/readme.md +0 -2
- data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/src/ruby_version.rs +3 -1
- data/ext/cargo-vendor/rustc-hash-2.1.3/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/.github/workflows/rust.yml +73 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/CHANGELOG.md +41 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/CODE_OF_CONDUCT.md +3 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/Cargo.lock +90 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/Cargo.toml +50 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/Cargo.toml.orig +20 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/LICENSE-APACHE +176 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/LICENSE-MIT +23 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/README.md +42 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/src/lib.rs +472 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/src/random_state.rs +101 -0
- data/ext/cargo-vendor/rustc-hash-2.1.3/src/seeded_state.rs +76 -0
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/.cargo-checksum.json +1 -1
- data/ext/cargo-vendor/serde-1.0.229/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/Cargo.lock +13 -13
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/Cargo.toml +2 -2
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/Cargo.toml.orig +2 -2
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde-1.0.229}/README.md +3 -3
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/build.rs +2 -2
- data/ext/cargo-vendor/{serde_core-1.0.228/src → serde-1.0.229/src/core}/de/impls.rs +4 -4
- data/ext/cargo-vendor/{serde_core-1.0.228/src → serde-1.0.229/src/core}/lib.rs +2 -2
- data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/lib.rs +3 -3
- data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/.cargo-checksum.json +1 -1
- data/ext/cargo-vendor/serde_core-1.0.229/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/Cargo.lock +11 -11
- data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/Cargo.toml +2 -2
- data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/Cargo.toml.orig +2 -2
- data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/build.rs +5 -5
- data/ext/cargo-vendor/{serde-1.0.228/src/core → serde_core-1.0.229/src}/de/impls.rs +4 -4
- data/ext/cargo-vendor/{serde-1.0.228/src/core → serde_core-1.0.229/src}/lib.rs +2 -2
- data/ext/cargo-vendor/serde_derive-1.0.229/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/serde_derive-1.0.229/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/Cargo.lock +29 -18
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/Cargo.toml +3 -3
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/Cargo.toml.orig +2 -2
- data/ext/cargo-vendor/{serde-1.0.228 → serde_derive-1.0.229}/README.md +3 -3
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/bound.rs +80 -59
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/enum_adjacently.rs +46 -45
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/enum_externally.rs +3 -2
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de.rs +10 -7
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/ast.rs +15 -8
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/attr.rs +18 -31
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/ctxt.rs +3 -4
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/receiver.rs +2 -2
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/lib.rs +1 -1
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/pretend.rs +7 -7
- data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/ser.rs +94 -94
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/.cargo-checksum.json +1 -1
- data/ext/cargo-vendor/serde_magnus-0.11.0/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/Cargo.lock +71 -73
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/Cargo.toml +2 -2
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/Cargo.toml.orig +2 -2
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/README.md +1 -1
- data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/deserializer.rs +2 -2
- data/ext/cargo-vendor/syn-3.0.9/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/syn-3.0.9/.cargo_vcs_info.json +6 -0
- data/ext/cargo-vendor/syn-3.0.9/Cargo.lock +1948 -0
- data/ext/cargo-vendor/syn-3.0.9/Cargo.toml +268 -0
- data/ext/cargo-vendor/syn-3.0.9/Cargo.toml.orig +95 -0
- data/ext/cargo-vendor/{lazycell-1.3.0 → syn-3.0.9}/LICENSE-APACHE +0 -25
- data/ext/cargo-vendor/syn-3.0.9/README.md +297 -0
- data/ext/cargo-vendor/syn-3.0.9/benches/file.rs +59 -0
- data/ext/cargo-vendor/syn-3.0.9/benches/rust.rs +189 -0
- data/ext/cargo-vendor/syn-3.0.9/src/attr.rs +841 -0
- data/ext/cargo-vendor/syn-3.0.9/src/bigint.rs +68 -0
- data/ext/cargo-vendor/syn-3.0.9/src/buffer.rs +462 -0
- data/ext/cargo-vendor/syn-3.0.9/src/classify.rs +311 -0
- data/ext/cargo-vendor/syn-3.0.9/src/custom_keyword.rs +260 -0
- data/ext/cargo-vendor/syn-3.0.9/src/custom_punctuation.rs +305 -0
- data/ext/cargo-vendor/syn-3.0.9/src/data.rs +489 -0
- data/ext/cargo-vendor/syn-3.0.9/src/derive.rs +260 -0
- data/ext/cargo-vendor/syn-3.0.9/src/discouraged.rs +233 -0
- data/ext/cargo-vendor/syn-3.0.9/src/drops.rs +58 -0
- data/ext/cargo-vendor/syn-3.0.9/src/error.rs +552 -0
- data/ext/cargo-vendor/syn-3.0.9/src/export.rs +73 -0
- data/ext/cargo-vendor/syn-3.0.9/src/expr.rs +4249 -0
- data/ext/cargo-vendor/syn-3.0.9/src/ext.rs +180 -0
- data/ext/cargo-vendor/syn-3.0.9/src/file.rs +136 -0
- data/ext/cargo-vendor/syn-3.0.9/src/fixup.rs +773 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/clone.rs +2394 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/debug.rs +3399 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/eq.rs +2459 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/fold.rs +3934 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/hash.rs +3040 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/token.css +744 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/visit.rs +4037 -0
- data/ext/cargo-vendor/syn-3.0.9/src/gen/visit_mut.rs +3824 -0
- data/ext/cargo-vendor/syn-3.0.9/src/generics.rs +1490 -0
- data/ext/cargo-vendor/syn-3.0.9/src/group.rs +294 -0
- data/ext/cargo-vendor/syn-3.0.9/src/ident.rs +109 -0
- data/ext/cargo-vendor/syn-3.0.9/src/item.rs +3923 -0
- data/ext/cargo-vendor/syn-3.0.9/src/lib.rs +1132 -0
- data/ext/cargo-vendor/syn-3.0.9/src/lifetime.rs +193 -0
- data/ext/cargo-vendor/syn-3.0.9/src/lit.rs +1881 -0
- data/ext/cargo-vendor/syn-3.0.9/src/lookahead.rs +350 -0
- data/ext/cargo-vendor/syn-3.0.9/src/mac.rs +225 -0
- data/ext/cargo-vendor/syn-3.0.9/src/macros.rs +151 -0
- data/ext/cargo-vendor/syn-3.0.9/src/meta.rs +427 -0
- data/ext/cargo-vendor/syn-3.0.9/src/op.rs +219 -0
- data/ext/cargo-vendor/syn-3.0.9/src/parse.rs +1420 -0
- data/ext/cargo-vendor/syn-3.0.9/src/parse_macro_input.rs +128 -0
- data/ext/cargo-vendor/syn-3.0.9/src/parse_quote.rs +261 -0
- data/ext/cargo-vendor/syn-3.0.9/src/pat.rs +994 -0
- data/ext/cargo-vendor/syn-3.0.9/src/path.rs +972 -0
- data/ext/cargo-vendor/syn-3.0.9/src/precedence.rs +210 -0
- data/ext/cargo-vendor/syn-3.0.9/src/print.rs +16 -0
- data/ext/cargo-vendor/syn-3.0.9/src/punctuated.rs +1200 -0
- data/ext/cargo-vendor/syn-3.0.9/src/restriction.rs +160 -0
- data/ext/cargo-vendor/syn-3.0.9/src/scan_expr.rs +270 -0
- data/ext/cargo-vendor/syn-3.0.9/src/sealed.rs +4 -0
- data/ext/cargo-vendor/syn-3.0.9/src/span.rs +63 -0
- data/ext/cargo-vendor/syn-3.0.9/src/spanned.rs +118 -0
- data/ext/cargo-vendor/syn-3.0.9/src/stmt.rs +536 -0
- data/ext/cargo-vendor/syn-3.0.9/src/thread.rs +60 -0
- data/ext/cargo-vendor/syn-3.0.9/src/token.rs +1103 -0
- data/ext/cargo-vendor/syn-3.0.9/src/tt.rs +97 -0
- data/ext/cargo-vendor/syn-3.0.9/src/ty.rs +1347 -0
- data/ext/cargo-vendor/syn-3.0.9/src/verbatim.rs +32 -0
- data/ext/cargo-vendor/syn-3.0.9/src/whitespace.rs +65 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/common/eq.rs +939 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/common/mod.rs +6 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/common/parse.rs +51 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/common/visit.rs +119 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/debug/gen.rs +5394 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/debug/mod.rs +147 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/macros/mod.rs +7 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/regression/issue1108.rs +5 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/regression/issue1235.rs +32 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/regression.rs +5 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/repo/mod.rs +789 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/repo/progress.rs +37 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/snapshot/mod.rs +68 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_attribute.rs +231 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_derive_input.rs +801 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_expr.rs +1721 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_generics.rs +363 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_grouping.rs +59 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_ident.rs +87 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_item.rs +374 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_lit.rs +335 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_meta.rs +180 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_parse_buffer.rs +104 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_parse_quote.rs +175 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_parse_stream.rs +187 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_pat.rs +158 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_path.rs +117 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_precedence.rs +560 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_punctuated.rs +92 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_receiver.rs +275 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_round_trip.rs +226 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_shebang.rs +77 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_size.rs +54 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_stmt.rs +378 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_token_trees.rs +38 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_ty.rs +479 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_unparenthesize.rs +71 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/test_visibility.rs +193 -0
- data/ext/cargo-vendor/syn-3.0.9/tests/zzz_stable.rs +33 -0
- data/ext/code_ownership/Cargo.toml +1 -1
- data/ext/code_ownership/src/lib.rs +2 -2
- data/lib/code_ownership/version.rb +1 -1
- data/lib/code_ownership.rb +1 -1
- metadata +400 -293
- data/ext/cargo-vendor/bindgen-0.69.5/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/bindgen-0.69.5/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/bindgen-0.69.5/features.rs +0 -296
- data/ext/cargo-vendor/lazycell-1.3.0/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/lazycell-1.3.0/.cargo_vcs_info.json +0 -5
- data/ext/cargo-vendor/lazycell-1.3.0/CHANGELOG.md +0 -197
- data/ext/cargo-vendor/lazycell-1.3.0/Cargo.toml +0 -34
- data/ext/cargo-vendor/lazycell-1.3.0/Cargo.toml.orig +0 -27
- data/ext/cargo-vendor/lazycell-1.3.0/LICENSE-MIT +0 -26
- data/ext/cargo-vendor/lazycell-1.3.0/README.md +0 -73
- data/ext/cargo-vendor/lazycell-1.3.0/src/lib.rs +0 -680
- data/ext/cargo-vendor/lazycell-1.3.0/src/serde_impl.rs +0 -86
- data/ext/cargo-vendor/rb-sys-0.9.117/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/rb-sys-0.9.117/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/rb-sys-0.9.117/src/macros.rs +0 -371
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_2_6.rs +0 -324
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_2_7.rs +0 -324
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_3_0.rs +0 -332
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_3_1.rs +0 -325
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_3_2.rs +0 -323
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_3_3.rs +0 -339
- data/ext/cargo-vendor/rb-sys-0.9.117/src/stable_api/ruby_3_4.rs +0 -339
- data/ext/cargo-vendor/rb-sys-build-0.9.117/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/rb-sys-env-0.2.2/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/rb-sys-env-0.2.2/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/rustc-hash-1.1.0/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/rustc-hash-1.1.0/.cargo_vcs_info.json +0 -5
- data/ext/cargo-vendor/rustc-hash-1.1.0/CODE_OF_CONDUCT.md +0 -40
- data/ext/cargo-vendor/rustc-hash-1.1.0/Cargo.toml +0 -25
- data/ext/cargo-vendor/rustc-hash-1.1.0/Cargo.toml.orig +0 -13
- data/ext/cargo-vendor/rustc-hash-1.1.0/LICENSE-APACHE +0 -201
- data/ext/cargo-vendor/rustc-hash-1.1.0/README.md +0 -38
- data/ext/cargo-vendor/rustc-hash-1.1.0/src/lib.rs +0 -148
- data/ext/cargo-vendor/serde-1.0.228/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/serde_core-1.0.228/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/serde_derive-1.0.228/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/serde_derive-1.0.228/.cargo_vcs_info.json +0 -6
- data/ext/cargo-vendor/serde_magnus-0.10.0/.cargo_vcs_info.json +0 -6
- /data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/LICENSE +0 -0
- /data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/codegen/postprocessing/mod.rs +0 -0
- /data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/ir/mod.rs +0 -0
- /data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/options/helpers.rs +0 -0
- /data/ext/cargo-vendor/{bindgen-0.69.5 → bindgen-0.72.1}/parse.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/bin/release.sh +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/build/features.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/readme.md +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/hidden.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/ruby_abi_version.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/special_consts.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/symbol.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/tracking_allocator.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-0.9.117 → rb-sys-0.9.130}/src/value_type.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/bindings/sanitizer.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/bindings/wrapper.h +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/rb_config/flags.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/rb_config/library.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/rb_config/search_path.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-build-0.9.117 → rb-sys-build-0.9.130}/src/utils.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/build.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/src/defines.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/src/rb_env.rs +0 -0
- /data/ext/cargo-vendor/{rb-sys-env-0.2.2 → rb-sys-env-0.2.3}/src/utils.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{rustc-hash-1.1.0 → serde-1.0.229}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/crates-io.md +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/crate_root.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/de/ignored_any.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/de/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/de/value.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/format.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/macros.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/content.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/doc.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/seed.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/size_hint.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/private/string.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/ser/fmt.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/ser/impls.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/ser/impossible.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/ser/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/core/std_error.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/integer128.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/private/de.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/private/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde-1.0.229}/src/private/ser.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{serde-1.0.228 → serde_core-1.0.229}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/README.md +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/crate_root.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/de/ignored_any.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/de/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/de/value.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/format.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/macros.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/content.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/doc.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/seed.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/size_hint.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/private/string.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/ser/fmt.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/ser/impls.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/ser/impossible.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/ser/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_core-1.0.229}/src/std_error.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/LICENSE-APACHE +0 -0
- /data/ext/cargo-vendor/{serde_core-1.0.228 → serde_derive-1.0.229}/LICENSE-MIT +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/crates-io.md +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/enum_.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/enum_internally.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/enum_untagged.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/identifier.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/struct_.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/tuple.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/de/unit.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/deprecated.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/dummy.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/fragment.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/case.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/check.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/name.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/respan.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/internals/symbol.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → serde_derive-1.0.229}/src/this.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/array_deserializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/array_enumerator.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/enum_deserializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/hash_deserializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/de/variant_deserializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/enums.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/map_serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/mod.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/seq_serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/struct_serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/struct_variant_serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/src/ser/tuple_variant_serializer.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_arrays.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_booleans.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_enums.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_floats.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_integers.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_maps.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_options.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_results.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_strings.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_structs.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_tuples.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/deserializing_vecs.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_arrays.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_booleans.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_enums.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_floats.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_integers.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_maps.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_options.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_results.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_strings.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_structs.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_tuples.rs +0 -0
- /data/ext/cargo-vendor/{serde_magnus-0.10.0 → serde_magnus-0.11.0}/tests/serializing_vecs.rs +0 -0
- /data/ext/cargo-vendor/{serde_derive-1.0.228 → syn-3.0.9}/LICENSE-MIT +0 -0
|
@@ -0,0 +1,1347 @@
|
|
|
1
|
+
use crate::attr::Attribute;
|
|
2
|
+
use crate::expr::Expr;
|
|
3
|
+
use crate::generics::{BoundLifetimes, TypeParamBound};
|
|
4
|
+
use crate::ident::Ident;
|
|
5
|
+
use crate::lifetime::Lifetime;
|
|
6
|
+
use crate::lit::LitStr;
|
|
7
|
+
use crate::mac::Macro;
|
|
8
|
+
use crate::path::{Path, QSelf};
|
|
9
|
+
use crate::punctuated::Punctuated;
|
|
10
|
+
use crate::token;
|
|
11
|
+
use alloc::boxed::Box;
|
|
12
|
+
use alloc::vec::Vec;
|
|
13
|
+
use proc_macro2::TokenStream;
|
|
14
|
+
|
|
15
|
+
ast_enum_of_structs! {
|
|
16
|
+
/// The possible types that a Rust value could have.
|
|
17
|
+
///
|
|
18
|
+
/// # Syntax tree enum
|
|
19
|
+
///
|
|
20
|
+
/// This type is a [syntax tree enum].
|
|
21
|
+
///
|
|
22
|
+
/// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
|
|
23
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
24
|
+
#[non_exhaustive]
|
|
25
|
+
pub enum Type {
|
|
26
|
+
/// A fixed size array type: `[T; n]`.
|
|
27
|
+
Array(TypeArray),
|
|
28
|
+
|
|
29
|
+
/// A function pointer type: `fn(usize) -> bool`.
|
|
30
|
+
FnPtr(TypeFnPtr),
|
|
31
|
+
|
|
32
|
+
/// A type contained within invisible delimiters.
|
|
33
|
+
Group(TypeGroup),
|
|
34
|
+
|
|
35
|
+
/// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
|
|
36
|
+
/// a lifetime.
|
|
37
|
+
ImplTrait(TypeImplTrait),
|
|
38
|
+
|
|
39
|
+
/// Indication that a type should be inferred by the compiler: `_`.
|
|
40
|
+
Infer(TypeInfer),
|
|
41
|
+
|
|
42
|
+
/// A macro in the type position.
|
|
43
|
+
Macro(TypeMacro),
|
|
44
|
+
|
|
45
|
+
/// The never type: `!`.
|
|
46
|
+
Never(TypeNever),
|
|
47
|
+
|
|
48
|
+
/// A parenthesized type equivalent to the inner type.
|
|
49
|
+
Paren(TypeParen),
|
|
50
|
+
|
|
51
|
+
/// A path like `core::slice::Iter`, optionally qualified with a
|
|
52
|
+
/// self-type as in `<Vec<T> as SomeTrait>::Associated`.
|
|
53
|
+
Path(TypePath),
|
|
54
|
+
|
|
55
|
+
/// A raw pointer type: `*const T` or `*mut T`.
|
|
56
|
+
Ptr(TypePtr),
|
|
57
|
+
|
|
58
|
+
/// A reference type: `&'a T` or `&'a mut T`.
|
|
59
|
+
Reference(TypeReference),
|
|
60
|
+
|
|
61
|
+
/// A dynamically sized slice type: `[T]`.
|
|
62
|
+
Slice(TypeSlice),
|
|
63
|
+
|
|
64
|
+
/// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
|
|
65
|
+
/// trait or a lifetime.
|
|
66
|
+
TraitObject(TypeTraitObject),
|
|
67
|
+
|
|
68
|
+
/// A tuple type: `(A, B, C, String)`.
|
|
69
|
+
Tuple(TypeTuple),
|
|
70
|
+
|
|
71
|
+
/// Tokens in type position not interpreted by Syn.
|
|
72
|
+
///
|
|
73
|
+
/// <div class="warning">
|
|
74
|
+
///
|
|
75
|
+
/// Important: see [Compatibility notes][crate#verbatim-variants].
|
|
76
|
+
///
|
|
77
|
+
/// </div>
|
|
78
|
+
Verbatim(TokenStream),
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ast_struct! {
|
|
83
|
+
/// A fixed size array type: `[T; n]`.
|
|
84
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
85
|
+
pub struct TypeArray {
|
|
86
|
+
pub attrs: Vec<Attribute>,
|
|
87
|
+
pub bracket_token: token::Bracket,
|
|
88
|
+
pub elem: Box<Type>,
|
|
89
|
+
pub semi_token: Token![;],
|
|
90
|
+
pub len: Expr,
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ast_struct! {
|
|
95
|
+
/// A function pointer type: `fn(usize) -> bool`.
|
|
96
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
97
|
+
pub struct TypeFnPtr {
|
|
98
|
+
pub attrs: Vec<Attribute>,
|
|
99
|
+
pub lifetimes: Option<BoundLifetimes>,
|
|
100
|
+
pub unsafety: Option<Token![unsafe]>,
|
|
101
|
+
pub abi: Option<Abi>,
|
|
102
|
+
pub fn_token: Token![fn],
|
|
103
|
+
pub paren_token: token::Paren,
|
|
104
|
+
pub inputs: Punctuated<NamedArg, Token![,]>,
|
|
105
|
+
pub variadic: Option<FnPtrVariadic>,
|
|
106
|
+
pub output: ReturnType,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ast_struct! {
|
|
111
|
+
/// A type contained within invisible delimiters.
|
|
112
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
113
|
+
pub struct TypeGroup {
|
|
114
|
+
pub attrs: Vec<Attribute>,
|
|
115
|
+
pub group_token: token::Group,
|
|
116
|
+
pub elem: Box<Type>,
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ast_struct! {
|
|
121
|
+
/// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
|
|
122
|
+
/// a lifetime.
|
|
123
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
124
|
+
pub struct TypeImplTrait {
|
|
125
|
+
pub attrs: Vec<Attribute>,
|
|
126
|
+
pub impl_token: Token![impl],
|
|
127
|
+
pub bounds: Punctuated<TypeParamBound, Token![+]>,
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
ast_struct! {
|
|
132
|
+
/// Indication that a type should be inferred by the compiler: `_`.
|
|
133
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
134
|
+
pub struct TypeInfer {
|
|
135
|
+
pub attrs: Vec<Attribute>,
|
|
136
|
+
pub underscore_token: Token![_],
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ast_struct! {
|
|
141
|
+
/// A macro in the type position.
|
|
142
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
143
|
+
pub struct TypeMacro {
|
|
144
|
+
pub attrs: Vec<Attribute>,
|
|
145
|
+
pub mac: Macro,
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
ast_struct! {
|
|
150
|
+
/// The never type: `!`.
|
|
151
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
152
|
+
pub struct TypeNever {
|
|
153
|
+
pub attrs: Vec<Attribute>,
|
|
154
|
+
pub bang_token: Token![!],
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
ast_struct! {
|
|
159
|
+
/// A parenthesized type equivalent to the inner type.
|
|
160
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
161
|
+
pub struct TypeParen {
|
|
162
|
+
pub attrs: Vec<Attribute>,
|
|
163
|
+
pub paren_token: token::Paren,
|
|
164
|
+
pub elem: Box<Type>,
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
ast_struct! {
|
|
169
|
+
/// A path like `core::slice::Iter`, optionally qualified with a
|
|
170
|
+
/// self-type as in `<Vec<T> as SomeTrait>::Associated`.
|
|
171
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
172
|
+
pub struct TypePath {
|
|
173
|
+
pub attrs: Vec<Attribute>,
|
|
174
|
+
pub qself: Option<QSelf>,
|
|
175
|
+
pub path: Path,
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
ast_struct! {
|
|
180
|
+
/// A raw pointer type: `*const T` or `*mut T`.
|
|
181
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
182
|
+
pub struct TypePtr {
|
|
183
|
+
pub attrs: Vec<Attribute>,
|
|
184
|
+
pub star_token: Token![*],
|
|
185
|
+
pub mutability: PointerMutability,
|
|
186
|
+
pub elem: Box<Type>,
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
ast_struct! {
|
|
191
|
+
/// A reference type: `&'a T` or `&'a mut T`.
|
|
192
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
193
|
+
pub struct TypeReference {
|
|
194
|
+
pub attrs: Vec<Attribute>,
|
|
195
|
+
pub and_token: Token![&],
|
|
196
|
+
pub lifetime: Option<Lifetime>,
|
|
197
|
+
pub mutability: Option<Token![mut]>,
|
|
198
|
+
pub elem: Box<Type>,
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
ast_struct! {
|
|
203
|
+
/// A dynamically sized slice type: `[T]`.
|
|
204
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
205
|
+
pub struct TypeSlice {
|
|
206
|
+
pub attrs: Vec<Attribute>,
|
|
207
|
+
pub bracket_token: token::Bracket,
|
|
208
|
+
pub elem: Box<Type>,
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
ast_struct! {
|
|
213
|
+
/// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
|
|
214
|
+
/// trait or a lifetime.
|
|
215
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
216
|
+
pub struct TypeTraitObject {
|
|
217
|
+
pub attrs: Vec<Attribute>,
|
|
218
|
+
/// The `dyn` keyword is required since Rust 2021 edition. In editions
|
|
219
|
+
/// 2015–2018, trait objects without a `dyn` keyword are allowed
|
|
220
|
+
/// but deprecated.
|
|
221
|
+
pub dyn_token: Option<Token![dyn]>,
|
|
222
|
+
pub bounds: Punctuated<TypeParamBound, Token![+]>,
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
ast_struct! {
|
|
227
|
+
/// A tuple type: `(A, B, C, String)`.
|
|
228
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
229
|
+
pub struct TypeTuple {
|
|
230
|
+
pub attrs: Vec<Attribute>,
|
|
231
|
+
pub paren_token: token::Paren,
|
|
232
|
+
pub elems: Punctuated<Type, Token![,]>,
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
ast_struct! {
|
|
237
|
+
/// The binary interface of a function: `extern "C"`.
|
|
238
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
239
|
+
pub struct Abi {
|
|
240
|
+
pub extern_token: Token![extern],
|
|
241
|
+
|
|
242
|
+
/// ABI name is optional, but note that extern blocks and functions with
|
|
243
|
+
/// an omitted ABI name are [deprecated since Rust 1.86.0][deprecated].
|
|
244
|
+
/// Omitting the ABI after the extern keyword has always implicitly
|
|
245
|
+
/// resulted in the "C" ABI. It is now recommended to explicitly specify
|
|
246
|
+
/// the "C" ABI (`extern "C" {}` and `extern "C" fn`).
|
|
247
|
+
///
|
|
248
|
+
/// [deprecated]: https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/#make-missing-abi-lint-warn-by-default
|
|
249
|
+
pub name: Option<LitStr>,
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
ast_enum! {
|
|
254
|
+
/// Mutability of a raw pointer (`*const T`, `*mut T`), in which non-mutable
|
|
255
|
+
/// isn't the implicit default.
|
|
256
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
257
|
+
pub enum PointerMutability {
|
|
258
|
+
Const(Token![const]),
|
|
259
|
+
Mut(Token![mut]),
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
ast_struct! {
|
|
264
|
+
/// An argument in a function type: the `usize` in `fn(usize) -> bool`.
|
|
265
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
266
|
+
pub struct NamedArg {
|
|
267
|
+
pub attrs: Vec<Attribute>,
|
|
268
|
+
pub name: Option<(Ident, Token![:])>,
|
|
269
|
+
pub ty: Type,
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
ast_struct! {
|
|
274
|
+
/// The variadic argument of a function pointer like `fn(usize, ...)`.
|
|
275
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
276
|
+
pub struct FnPtrVariadic {
|
|
277
|
+
pub attrs: Vec<Attribute>,
|
|
278
|
+
pub name: Option<(Ident, Token![:])>,
|
|
279
|
+
pub dots: Token![...],
|
|
280
|
+
pub comma: Option<Token![,]>,
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
ast_enum! {
|
|
285
|
+
/// Return type of a function signature.
|
|
286
|
+
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
|
|
287
|
+
pub enum ReturnType {
|
|
288
|
+
/// Return type is not specified.
|
|
289
|
+
///
|
|
290
|
+
/// Functions default to `()` and closures default to type inference.
|
|
291
|
+
Default,
|
|
292
|
+
/// A particular type is returned.
|
|
293
|
+
Type(Token![->], Box<Type>),
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
#[cfg(feature = "parsing")]
|
|
298
|
+
pub(crate) mod parsing {
|
|
299
|
+
use crate::attr::Attribute;
|
|
300
|
+
use crate::buffer::Cursor;
|
|
301
|
+
use crate::error::{Error, Result};
|
|
302
|
+
use crate::ext::IdentExt as _;
|
|
303
|
+
use crate::generics::{BoundLifetimes, TraitBound, TraitBoundModifiers, TypeParamBound};
|
|
304
|
+
use crate::ident::Ident;
|
|
305
|
+
use crate::lifetime::Lifetime;
|
|
306
|
+
use crate::mac::{self, Macro};
|
|
307
|
+
use crate::parse::{Parse, ParseStream};
|
|
308
|
+
use crate::path;
|
|
309
|
+
use crate::path::{Path, PathArguments, QSelf};
|
|
310
|
+
use crate::punctuated::Punctuated;
|
|
311
|
+
use crate::token;
|
|
312
|
+
use crate::ty::{
|
|
313
|
+
Abi, FnPtrVariadic, NamedArg, PointerMutability, ReturnType, Type, TypeArray, TypeFnPtr,
|
|
314
|
+
TypeGroup, TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr,
|
|
315
|
+
TypeReference, TypeSlice, TypeTraitObject, TypeTuple,
|
|
316
|
+
};
|
|
317
|
+
use crate::verbatim;
|
|
318
|
+
use alloc::boxed::Box;
|
|
319
|
+
use alloc::vec::Vec;
|
|
320
|
+
use proc_macro2::TokenStream;
|
|
321
|
+
|
|
322
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
323
|
+
impl Parse for Type {
|
|
324
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
325
|
+
let allow_plus = true;
|
|
326
|
+
let allow_group_generic = true;
|
|
327
|
+
ambig_ty(input, allow_plus, allow_group_generic)
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
impl Type {
|
|
332
|
+
/// In some positions, types may not contain the `+` character, to
|
|
333
|
+
/// disambiguate them. For example in the expression `1 as T`, T may not
|
|
334
|
+
/// contain a `+` character.
|
|
335
|
+
///
|
|
336
|
+
/// This parser does not allow a `+`, while the default parser does.
|
|
337
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
338
|
+
pub fn without_plus(input: ParseStream) -> Result<Self> {
|
|
339
|
+
let allow_plus = false;
|
|
340
|
+
let allow_group_generic = true;
|
|
341
|
+
ambig_ty(input, allow_plus, allow_group_generic)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
pub(crate) fn ambig_ty(
|
|
346
|
+
input: ParseStream,
|
|
347
|
+
allow_plus: bool,
|
|
348
|
+
allow_group_generic: bool,
|
|
349
|
+
) -> Result<Type> {
|
|
350
|
+
let begin = input.cursor();
|
|
351
|
+
|
|
352
|
+
if input.peek(token::Group) {
|
|
353
|
+
let mut group: TypeGroup = input.parse()?;
|
|
354
|
+
if input.peek(Token![::]) && input.peek3(Ident::peek_any) {
|
|
355
|
+
if let Type::Path(mut ty) = *group.elem {
|
|
356
|
+
Path::parse_rest(input, &mut ty.path, false)?;
|
|
357
|
+
return Ok(Type::Path(ty));
|
|
358
|
+
} else {
|
|
359
|
+
return Ok(Type::Path(TypePath {
|
|
360
|
+
attrs: Vec::new(),
|
|
361
|
+
qself: Some(QSelf {
|
|
362
|
+
lt_token: Token,
|
|
363
|
+
position: 0,
|
|
364
|
+
as_token: None,
|
|
365
|
+
gt_token: Token,
|
|
366
|
+
ty: group.elem,
|
|
367
|
+
}),
|
|
368
|
+
path: Path::parse_helper(input, false)?,
|
|
369
|
+
}));
|
|
370
|
+
}
|
|
371
|
+
} else if input.peek(Token![<]) && allow_group_generic
|
|
372
|
+
|| input.peek(Token![::]) && input.peek3(Token![<])
|
|
373
|
+
{
|
|
374
|
+
if let Type::Path(mut ty) = *group.elem {
|
|
375
|
+
let arguments = &mut ty.path.segments.last_mut().unwrap().arguments;
|
|
376
|
+
if arguments.is_none() {
|
|
377
|
+
*arguments = PathArguments::AngleBracketed(input.parse()?);
|
|
378
|
+
Path::parse_rest(input, &mut ty.path, false)?;
|
|
379
|
+
return Ok(Type::Path(ty));
|
|
380
|
+
} else {
|
|
381
|
+
*group.elem = Type::Path(ty);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return Ok(Type::Group(group));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
let mut lifetimes = None::<BoundLifetimes>;
|
|
389
|
+
let mut lookahead = input.lookahead1();
|
|
390
|
+
if lookahead.peek(Token![for]) {
|
|
391
|
+
lifetimes = input.parse()?;
|
|
392
|
+
lookahead = input.lookahead1();
|
|
393
|
+
if !lookahead.peek(Ident)
|
|
394
|
+
&& !lookahead.peek(Token![fn])
|
|
395
|
+
&& !lookahead.peek(Token![unsafe])
|
|
396
|
+
&& !lookahead.peek(Token![extern])
|
|
397
|
+
&& !lookahead.peek(Token![super])
|
|
398
|
+
&& !lookahead.peek(Token![self])
|
|
399
|
+
&& !lookahead.peek(Token![Self])
|
|
400
|
+
&& !lookahead.peek(Token![crate])
|
|
401
|
+
|| input.peek(Token![dyn])
|
|
402
|
+
{
|
|
403
|
+
return Err(lookahead.error());
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if lookahead.peek(token::Paren) {
|
|
408
|
+
let content;
|
|
409
|
+
let paren_token = parenthesized!(content in input);
|
|
410
|
+
if content.is_empty() {
|
|
411
|
+
return Ok(Type::Tuple(TypeTuple {
|
|
412
|
+
attrs: Vec::new(),
|
|
413
|
+
paren_token,
|
|
414
|
+
elems: Punctuated::new(),
|
|
415
|
+
}));
|
|
416
|
+
}
|
|
417
|
+
if content.peek(Lifetime) {
|
|
418
|
+
return Ok(Type::Paren(TypeParen {
|
|
419
|
+
attrs: Vec::new(),
|
|
420
|
+
paren_token,
|
|
421
|
+
elem: Box::new(Type::TraitObject(content.parse()?)),
|
|
422
|
+
}));
|
|
423
|
+
}
|
|
424
|
+
if content.peek(Token![?]) {
|
|
425
|
+
return Ok(Type::TraitObject(TypeTraitObject {
|
|
426
|
+
attrs: Vec::new(),
|
|
427
|
+
dyn_token: None,
|
|
428
|
+
bounds: {
|
|
429
|
+
let mut bounds = Punctuated::new();
|
|
430
|
+
bounds.push_value(TypeParamBound::Trait(TraitBound {
|
|
431
|
+
paren_token: Some(paren_token),
|
|
432
|
+
..content.parse()?
|
|
433
|
+
}));
|
|
434
|
+
while let Some(plus) = input.parse()? {
|
|
435
|
+
bounds.push_punct(plus);
|
|
436
|
+
bounds.push_value({
|
|
437
|
+
let allow_precise_capture = false;
|
|
438
|
+
let allow_const = false;
|
|
439
|
+
TypeParamBound::parse_single(
|
|
440
|
+
input,
|
|
441
|
+
allow_precise_capture,
|
|
442
|
+
allow_const,
|
|
443
|
+
)?
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
bounds
|
|
447
|
+
},
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
let mut first: Type = content.parse()?;
|
|
451
|
+
if content.peek(Token![,]) {
|
|
452
|
+
return Ok(Type::Tuple(TypeTuple {
|
|
453
|
+
attrs: Vec::new(),
|
|
454
|
+
paren_token,
|
|
455
|
+
elems: {
|
|
456
|
+
let mut elems = Punctuated::new();
|
|
457
|
+
elems.push_value(first);
|
|
458
|
+
elems.push_punct(content.parse()?);
|
|
459
|
+
while !content.is_empty() {
|
|
460
|
+
elems.push_value(content.parse()?);
|
|
461
|
+
if content.is_empty() {
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
elems.push_punct(content.parse()?);
|
|
465
|
+
}
|
|
466
|
+
elems
|
|
467
|
+
},
|
|
468
|
+
}));
|
|
469
|
+
}
|
|
470
|
+
if allow_plus && input.peek(Token![+]) {
|
|
471
|
+
loop {
|
|
472
|
+
let first = match first {
|
|
473
|
+
Type::Path(TypePath {
|
|
474
|
+
attrs: _,
|
|
475
|
+
qself: None,
|
|
476
|
+
path,
|
|
477
|
+
}) => TypeParamBound::Trait(TraitBound {
|
|
478
|
+
paren_token: Some(paren_token),
|
|
479
|
+
lifetimes: None,
|
|
480
|
+
modifiers: TraitBoundModifiers {},
|
|
481
|
+
maybe: None,
|
|
482
|
+
path,
|
|
483
|
+
}),
|
|
484
|
+
Type::TraitObject(TypeTraitObject {
|
|
485
|
+
attrs: _,
|
|
486
|
+
dyn_token: None,
|
|
487
|
+
bounds,
|
|
488
|
+
}) => {
|
|
489
|
+
if bounds.len() > 1 || bounds.trailing_punct() {
|
|
490
|
+
first = Type::TraitObject(TypeTraitObject {
|
|
491
|
+
attrs: Vec::new(),
|
|
492
|
+
dyn_token: None,
|
|
493
|
+
bounds,
|
|
494
|
+
});
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
match bounds.into_iter().next().unwrap() {
|
|
498
|
+
TypeParamBound::Trait(trait_bound) => {
|
|
499
|
+
TypeParamBound::Trait(TraitBound {
|
|
500
|
+
paren_token: Some(paren_token),
|
|
501
|
+
..trait_bound
|
|
502
|
+
})
|
|
503
|
+
}
|
|
504
|
+
other @ (TypeParamBound::Lifetime(_)
|
|
505
|
+
| TypeParamBound::PreciseCapture(_)
|
|
506
|
+
| TypeParamBound::Verbatim(_)) => other,
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
_ => break,
|
|
510
|
+
};
|
|
511
|
+
return Ok(Type::TraitObject(TypeTraitObject {
|
|
512
|
+
attrs: Vec::new(),
|
|
513
|
+
dyn_token: None,
|
|
514
|
+
bounds: {
|
|
515
|
+
let mut bounds = Punctuated::new();
|
|
516
|
+
bounds.push_value(first);
|
|
517
|
+
while let Some(plus) = input.parse()? {
|
|
518
|
+
bounds.push_punct(plus);
|
|
519
|
+
bounds.push_value({
|
|
520
|
+
let allow_precise_capture = false;
|
|
521
|
+
let allow_const = false;
|
|
522
|
+
TypeParamBound::parse_single(
|
|
523
|
+
input,
|
|
524
|
+
allow_precise_capture,
|
|
525
|
+
allow_const,
|
|
526
|
+
)?
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
bounds
|
|
530
|
+
},
|
|
531
|
+
}));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
Ok(Type::Paren(TypeParen {
|
|
535
|
+
attrs: Vec::new(),
|
|
536
|
+
paren_token,
|
|
537
|
+
elem: Box::new(first),
|
|
538
|
+
}))
|
|
539
|
+
} else if lookahead.peek(Token![unsafe]) && input.peek2(Token![<]) {
|
|
540
|
+
input.parse::<Token![unsafe]>()?;
|
|
541
|
+
input.parse::<Token![<]>()?;
|
|
542
|
+
while !input.peek(Token![>]) {
|
|
543
|
+
Lifetime::parse_any(input)?;
|
|
544
|
+
if input.peek(Token![>]) {
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
input.parse::<Token![,]>()?;
|
|
548
|
+
}
|
|
549
|
+
input.parse::<Token![>]>()?;
|
|
550
|
+
ambig_ty(input, allow_plus, allow_group_generic)?;
|
|
551
|
+
Ok(Type::Verbatim(verbatim::between(begin, input.cursor())))
|
|
552
|
+
} else if lookahead.peek(Token![fn])
|
|
553
|
+
|| input.peek(Token![unsafe])
|
|
554
|
+
|| lookahead.peek(Token![extern])
|
|
555
|
+
{
|
|
556
|
+
let mut fn_ptr: TypeFnPtr = input.parse()?;
|
|
557
|
+
fn_ptr.lifetimes = lifetimes;
|
|
558
|
+
Ok(Type::FnPtr(fn_ptr))
|
|
559
|
+
} else if cfg!(feature = "full")
|
|
560
|
+
&& input.cursor().peek_keyword("builtin")
|
|
561
|
+
&& input.peek2(Token![#])
|
|
562
|
+
{
|
|
563
|
+
token::parsing::keyword(input, "builtin")?;
|
|
564
|
+
input.parse::<Token![#]>()?;
|
|
565
|
+
input.parse::<Ident>()?;
|
|
566
|
+
let args;
|
|
567
|
+
parenthesized!(args in input);
|
|
568
|
+
args.parse::<TokenStream>()?;
|
|
569
|
+
Ok(Type::Verbatim(verbatim::between(begin, input.cursor())))
|
|
570
|
+
} else if lookahead.peek(Ident)
|
|
571
|
+
|| input.peek(Token![super])
|
|
572
|
+
|| input.peek(Token![self])
|
|
573
|
+
|| input.peek(Token![Self])
|
|
574
|
+
|| input.peek(Token![crate])
|
|
575
|
+
|| lookahead.peek(Token![::])
|
|
576
|
+
|| lookahead.peek(Token![<])
|
|
577
|
+
{
|
|
578
|
+
let ty: TypePath = input.parse()?;
|
|
579
|
+
if ty.qself.is_some() {
|
|
580
|
+
return Ok(Type::Path(ty));
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if input.peek(Token![!]) && !input.peek(Token![!=]) && ty.path.is_mod_style() {
|
|
584
|
+
let bang_token: Token![!] = input.parse()?;
|
|
585
|
+
let (delimiter, tokens) = mac::parse_delimiter(input)?;
|
|
586
|
+
return Ok(Type::Macro(TypeMacro {
|
|
587
|
+
attrs: Vec::new(),
|
|
588
|
+
mac: Macro {
|
|
589
|
+
path: ty.path,
|
|
590
|
+
bang_token,
|
|
591
|
+
delimiter,
|
|
592
|
+
tokens,
|
|
593
|
+
},
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
if lifetimes.is_some() || allow_plus && input.peek(Token![+]) {
|
|
598
|
+
let mut bounds = Punctuated::new();
|
|
599
|
+
bounds.push_value(TypeParamBound::Trait(TraitBound {
|
|
600
|
+
paren_token: None,
|
|
601
|
+
lifetimes,
|
|
602
|
+
modifiers: TraitBoundModifiers {},
|
|
603
|
+
maybe: None,
|
|
604
|
+
path: ty.path,
|
|
605
|
+
}));
|
|
606
|
+
if allow_plus {
|
|
607
|
+
while input.peek(Token![+]) {
|
|
608
|
+
bounds.push_punct(input.parse()?);
|
|
609
|
+
if !(input.peek(Ident::peek_any)
|
|
610
|
+
|| input.peek(Token![::])
|
|
611
|
+
|| input.peek(Token![?])
|
|
612
|
+
|| input.peek(Lifetime)
|
|
613
|
+
|| input.peek(token::Paren))
|
|
614
|
+
{
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
bounds.push_value({
|
|
618
|
+
let allow_precise_capture = false;
|
|
619
|
+
let allow_const = false;
|
|
620
|
+
TypeParamBound::parse_single(input, allow_precise_capture, allow_const)?
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return Ok(Type::TraitObject(TypeTraitObject {
|
|
625
|
+
attrs: Vec::new(),
|
|
626
|
+
dyn_token: None,
|
|
627
|
+
bounds,
|
|
628
|
+
}));
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
Ok(Type::Path(ty))
|
|
632
|
+
} else if lookahead.peek(Token![dyn]) {
|
|
633
|
+
let dyn_begin = input.cursor();
|
|
634
|
+
let dyn_token: Token![dyn] = input.parse()?;
|
|
635
|
+
let star_token: Option<Token![*]> = input.parse()?;
|
|
636
|
+
let bounds = TypeTraitObject::parse_bounds(dyn_begin, input, allow_plus)?;
|
|
637
|
+
Ok(if star_token.is_some() {
|
|
638
|
+
Type::Verbatim(verbatim::between(begin, input.cursor()))
|
|
639
|
+
} else {
|
|
640
|
+
Type::TraitObject(TypeTraitObject {
|
|
641
|
+
attrs: Vec::new(),
|
|
642
|
+
dyn_token: Some(dyn_token),
|
|
643
|
+
bounds,
|
|
644
|
+
})
|
|
645
|
+
})
|
|
646
|
+
} else if lookahead.peek(token::Bracket) {
|
|
647
|
+
let content;
|
|
648
|
+
let bracket_token = bracketed!(content in input);
|
|
649
|
+
let elem: Type = content.parse()?;
|
|
650
|
+
if content.peek(Token![;]) {
|
|
651
|
+
Ok(Type::Array(TypeArray {
|
|
652
|
+
attrs: Vec::new(),
|
|
653
|
+
bracket_token,
|
|
654
|
+
elem: Box::new(elem),
|
|
655
|
+
semi_token: content.parse()?,
|
|
656
|
+
len: content.parse()?,
|
|
657
|
+
}))
|
|
658
|
+
} else {
|
|
659
|
+
Ok(Type::Slice(TypeSlice {
|
|
660
|
+
attrs: Vec::new(),
|
|
661
|
+
bracket_token,
|
|
662
|
+
elem: Box::new(elem),
|
|
663
|
+
}))
|
|
664
|
+
}
|
|
665
|
+
} else if lookahead.peek(Token![*]) {
|
|
666
|
+
input.parse().map(Type::Ptr)
|
|
667
|
+
} else if lookahead.peek(Token![&]) {
|
|
668
|
+
input.parse().map(Type::Reference)
|
|
669
|
+
} else if lookahead.peek(Token![!]) && !input.peek(Token![=]) {
|
|
670
|
+
input.parse().map(Type::Never)
|
|
671
|
+
} else if lookahead.peek(Token![impl]) {
|
|
672
|
+
TypeImplTrait::parse(input, allow_plus).map(Type::ImplTrait)
|
|
673
|
+
} else if lookahead.peek(Token![_]) {
|
|
674
|
+
input.parse().map(Type::Infer)
|
|
675
|
+
} else if lookahead.peek(Lifetime) {
|
|
676
|
+
input.parse().map(Type::TraitObject)
|
|
677
|
+
} else {
|
|
678
|
+
Err(lookahead.error())
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
683
|
+
impl Parse for TypeSlice {
|
|
684
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
685
|
+
let content;
|
|
686
|
+
Ok(TypeSlice {
|
|
687
|
+
attrs: Vec::new(),
|
|
688
|
+
bracket_token: bracketed!(content in input),
|
|
689
|
+
elem: content.parse()?,
|
|
690
|
+
})
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
695
|
+
impl Parse for TypeArray {
|
|
696
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
697
|
+
let content;
|
|
698
|
+
Ok(TypeArray {
|
|
699
|
+
attrs: Vec::new(),
|
|
700
|
+
bracket_token: bracketed!(content in input),
|
|
701
|
+
elem: content.parse()?,
|
|
702
|
+
semi_token: content.parse()?,
|
|
703
|
+
len: content.parse()?,
|
|
704
|
+
})
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
709
|
+
impl Parse for TypePtr {
|
|
710
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
711
|
+
Ok(TypePtr {
|
|
712
|
+
attrs: Vec::new(),
|
|
713
|
+
star_token: input.parse()?,
|
|
714
|
+
mutability: input.parse()?,
|
|
715
|
+
elem: Box::new(input.call(Type::without_plus)?),
|
|
716
|
+
})
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
721
|
+
impl Parse for TypeReference {
|
|
722
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
723
|
+
Ok(TypeReference {
|
|
724
|
+
attrs: Vec::new(),
|
|
725
|
+
and_token: input.parse()?,
|
|
726
|
+
lifetime: Lifetime::parse_optional_any(input),
|
|
727
|
+
mutability: input.parse()?,
|
|
728
|
+
// & binds tighter than +, so we don't allow + here.
|
|
729
|
+
elem: Box::new(input.call(Type::without_plus)?),
|
|
730
|
+
})
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
735
|
+
impl Parse for TypeFnPtr {
|
|
736
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
737
|
+
let args;
|
|
738
|
+
let mut variadic = None;
|
|
739
|
+
|
|
740
|
+
Ok(TypeFnPtr {
|
|
741
|
+
attrs: Vec::new(),
|
|
742
|
+
lifetimes: input.parse()?,
|
|
743
|
+
unsafety: input.parse()?,
|
|
744
|
+
abi: input.parse()?,
|
|
745
|
+
fn_token: input.parse()?,
|
|
746
|
+
paren_token: parenthesized!(args in input),
|
|
747
|
+
inputs: {
|
|
748
|
+
let mut inputs = Punctuated::new();
|
|
749
|
+
|
|
750
|
+
while !args.is_empty() {
|
|
751
|
+
let attrs = args.call(Attribute::parse_outer)?;
|
|
752
|
+
|
|
753
|
+
if inputs.empty_or_trailing()
|
|
754
|
+
&& (args.peek(Token![...])
|
|
755
|
+
|| (args.peek(Ident) || args.peek(Token![_]))
|
|
756
|
+
&& args.peek2(Token![:])
|
|
757
|
+
&& args.peek3(Token![...]))
|
|
758
|
+
{
|
|
759
|
+
variadic = Some(parse_fn_ptr_variadic(&args, attrs)?);
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
let allow_self = inputs.is_empty();
|
|
764
|
+
let arg = parse_fn_ptr_arg(&args, allow_self)?;
|
|
765
|
+
inputs.push_value(NamedArg { attrs, ..arg });
|
|
766
|
+
if args.is_empty() {
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
let comma = args.parse()?;
|
|
771
|
+
inputs.push_punct(comma);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
inputs
|
|
775
|
+
},
|
|
776
|
+
variadic,
|
|
777
|
+
output: input.call(ReturnType::without_plus)?,
|
|
778
|
+
})
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
783
|
+
impl Parse for TypeNever {
|
|
784
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
785
|
+
Ok(TypeNever {
|
|
786
|
+
attrs: Vec::new(),
|
|
787
|
+
bang_token: input.parse()?,
|
|
788
|
+
})
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
793
|
+
impl Parse for TypeInfer {
|
|
794
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
795
|
+
Ok(TypeInfer {
|
|
796
|
+
attrs: Vec::new(),
|
|
797
|
+
underscore_token: input.parse()?,
|
|
798
|
+
})
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
803
|
+
impl Parse for TypeTuple {
|
|
804
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
805
|
+
let content;
|
|
806
|
+
let paren_token = parenthesized!(content in input);
|
|
807
|
+
|
|
808
|
+
if content.is_empty() {
|
|
809
|
+
return Ok(TypeTuple {
|
|
810
|
+
attrs: Vec::new(),
|
|
811
|
+
paren_token,
|
|
812
|
+
elems: Punctuated::new(),
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
let first: Type = content.parse()?;
|
|
817
|
+
Ok(TypeTuple {
|
|
818
|
+
attrs: Vec::new(),
|
|
819
|
+
paren_token,
|
|
820
|
+
elems: {
|
|
821
|
+
let mut elems = Punctuated::new();
|
|
822
|
+
elems.push_value(first);
|
|
823
|
+
elems.push_punct(content.parse()?);
|
|
824
|
+
while !content.is_empty() {
|
|
825
|
+
elems.push_value(content.parse()?);
|
|
826
|
+
if content.is_empty() {
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
elems.push_punct(content.parse()?);
|
|
830
|
+
}
|
|
831
|
+
elems
|
|
832
|
+
},
|
|
833
|
+
})
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
838
|
+
impl Parse for TypeMacro {
|
|
839
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
840
|
+
Ok(TypeMacro {
|
|
841
|
+
attrs: Vec::new(),
|
|
842
|
+
mac: input.parse()?,
|
|
843
|
+
})
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
848
|
+
impl Parse for TypePath {
|
|
849
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
850
|
+
let expr_style = false;
|
|
851
|
+
let (qself, path) = path::parsing::qpath(input, expr_style)?;
|
|
852
|
+
Ok(TypePath {
|
|
853
|
+
attrs: Vec::new(),
|
|
854
|
+
qself,
|
|
855
|
+
path,
|
|
856
|
+
})
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
impl ReturnType {
|
|
861
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
862
|
+
pub fn without_plus(input: ParseStream) -> Result<Self> {
|
|
863
|
+
let allow_plus = false;
|
|
864
|
+
Self::parse(input, allow_plus)
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
|
|
868
|
+
if input.peek(Token![->]) {
|
|
869
|
+
let arrow = input.parse()?;
|
|
870
|
+
let allow_group_generic = true;
|
|
871
|
+
let ty = ambig_ty(input, allow_plus, allow_group_generic)?;
|
|
872
|
+
Ok(ReturnType::Type(arrow, Box::new(ty)))
|
|
873
|
+
} else {
|
|
874
|
+
Ok(ReturnType::Default)
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
880
|
+
impl Parse for ReturnType {
|
|
881
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
882
|
+
let allow_plus = true;
|
|
883
|
+
Self::parse(input, allow_plus)
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
888
|
+
impl Parse for TypeTraitObject {
|
|
889
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
890
|
+
let allow_plus = true;
|
|
891
|
+
Self::parse(input, allow_plus)
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
impl TypeTraitObject {
|
|
896
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
897
|
+
pub fn without_plus(input: ParseStream) -> Result<Self> {
|
|
898
|
+
let allow_plus = false;
|
|
899
|
+
Self::parse(input, allow_plus)
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
// Only allow multiple trait references if allow_plus is true.
|
|
903
|
+
pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
|
|
904
|
+
let dyn_begin = input.cursor();
|
|
905
|
+
let dyn_token: Option<Token![dyn]> = input.parse()?;
|
|
906
|
+
let bounds = Self::parse_bounds(dyn_begin, input, allow_plus)?;
|
|
907
|
+
Ok(TypeTraitObject {
|
|
908
|
+
attrs: Vec::new(),
|
|
909
|
+
dyn_token,
|
|
910
|
+
bounds,
|
|
911
|
+
})
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
fn parse_bounds(
|
|
915
|
+
dyn_begin: Cursor,
|
|
916
|
+
input: ParseStream,
|
|
917
|
+
allow_plus: bool,
|
|
918
|
+
) -> Result<Punctuated<TypeParamBound, Token![+]>> {
|
|
919
|
+
let allow_precise_capture = false;
|
|
920
|
+
let allow_const = false;
|
|
921
|
+
let bounds = TypeParamBound::parse_multiple(
|
|
922
|
+
input,
|
|
923
|
+
allow_plus,
|
|
924
|
+
allow_precise_capture,
|
|
925
|
+
allow_const,
|
|
926
|
+
)?;
|
|
927
|
+
let mut at_least_one_trait = false;
|
|
928
|
+
for bound in &bounds {
|
|
929
|
+
match bound {
|
|
930
|
+
TypeParamBound::Trait(_) => {
|
|
931
|
+
at_least_one_trait = true;
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
TypeParamBound::Lifetime(_) => {}
|
|
935
|
+
TypeParamBound::PreciseCapture(_) | TypeParamBound::Verbatim(_) => {
|
|
936
|
+
unreachable!()
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
// Just lifetimes like `'a + 'b` is not a TraitObject.
|
|
941
|
+
if !at_least_one_trait {
|
|
942
|
+
let msg = "at least one trait is required for an object type";
|
|
943
|
+
return Err(Error::new_range(dyn_begin..input.cursor(), msg));
|
|
944
|
+
}
|
|
945
|
+
Ok(bounds)
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
950
|
+
impl Parse for TypeImplTrait {
|
|
951
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
952
|
+
let allow_plus = true;
|
|
953
|
+
Self::parse(input, allow_plus)
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
impl TypeImplTrait {
|
|
958
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
959
|
+
pub fn without_plus(input: ParseStream) -> Result<Self> {
|
|
960
|
+
let allow_plus = false;
|
|
961
|
+
Self::parse(input, allow_plus)
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
|
|
965
|
+
let impl_begin = input.cursor();
|
|
966
|
+
let impl_token: Token![impl] = input.parse()?;
|
|
967
|
+
let allow_precise_capture = true;
|
|
968
|
+
let allow_const = true;
|
|
969
|
+
let bounds = TypeParamBound::parse_multiple(
|
|
970
|
+
input,
|
|
971
|
+
allow_plus,
|
|
972
|
+
allow_precise_capture,
|
|
973
|
+
allow_const,
|
|
974
|
+
)?;
|
|
975
|
+
let mut at_least_one_trait = false;
|
|
976
|
+
for bound in &bounds {
|
|
977
|
+
match bound {
|
|
978
|
+
TypeParamBound::Trait(_) => {
|
|
979
|
+
at_least_one_trait = true;
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
TypeParamBound::Lifetime(_) | TypeParamBound::PreciseCapture(_) => {}
|
|
983
|
+
TypeParamBound::Verbatim(_) => {
|
|
984
|
+
// `[const] Trait`
|
|
985
|
+
at_least_one_trait = true;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if !at_least_one_trait {
|
|
991
|
+
let msg = "at least one trait must be specified";
|
|
992
|
+
return Err(Error::new_range(impl_begin..input.cursor(), msg));
|
|
993
|
+
}
|
|
994
|
+
Ok(TypeImplTrait {
|
|
995
|
+
attrs: Vec::new(),
|
|
996
|
+
impl_token,
|
|
997
|
+
bounds,
|
|
998
|
+
})
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1003
|
+
impl Parse for TypeGroup {
|
|
1004
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1005
|
+
let group = crate::group::parse_group(input)?;
|
|
1006
|
+
Ok(TypeGroup {
|
|
1007
|
+
attrs: Vec::new(),
|
|
1008
|
+
group_token: group.token,
|
|
1009
|
+
elem: group.content.parse()?,
|
|
1010
|
+
})
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1015
|
+
impl Parse for TypeParen {
|
|
1016
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1017
|
+
let allow_plus = false;
|
|
1018
|
+
Self::parse(input, allow_plus)
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
impl TypeParen {
|
|
1023
|
+
fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
|
|
1024
|
+
let content;
|
|
1025
|
+
Ok(TypeParen {
|
|
1026
|
+
attrs: Vec::new(),
|
|
1027
|
+
paren_token: parenthesized!(content in input),
|
|
1028
|
+
elem: Box::new({
|
|
1029
|
+
let allow_group_generic = true;
|
|
1030
|
+
ambig_ty(&content, allow_plus, allow_group_generic)?
|
|
1031
|
+
}),
|
|
1032
|
+
})
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1037
|
+
impl Parse for NamedArg {
|
|
1038
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1039
|
+
let allow_self = false;
|
|
1040
|
+
parse_fn_ptr_arg(input, allow_self)
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
fn parse_fn_ptr_arg(input: ParseStream, allow_self: bool) -> Result<NamedArg> {
|
|
1045
|
+
let attrs = input.call(Attribute::parse_outer)?;
|
|
1046
|
+
|
|
1047
|
+
let begin = input.cursor();
|
|
1048
|
+
|
|
1049
|
+
let has_mut_self = allow_self && input.peek(Token![mut]) && input.peek2(Token![self]);
|
|
1050
|
+
if has_mut_self {
|
|
1051
|
+
input.parse::<Token![mut]>()?;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
let mut has_self = false;
|
|
1055
|
+
let mut name = if (input.peek(Ident) || input.peek(Token![_]) || {
|
|
1056
|
+
has_self = allow_self && input.peek(Token![self]);
|
|
1057
|
+
has_self
|
|
1058
|
+
}) && input.peek2(Token![:])
|
|
1059
|
+
&& !input.peek2(Token![::])
|
|
1060
|
+
{
|
|
1061
|
+
let name = input.call(Ident::parse_any)?;
|
|
1062
|
+
let colon: Token![:] = input.parse()?;
|
|
1063
|
+
Some((name, colon))
|
|
1064
|
+
} else {
|
|
1065
|
+
has_self = false;
|
|
1066
|
+
None
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
let ty = if allow_self && !has_self && input.peek(Token![mut]) && input.peek2(Token![self])
|
|
1070
|
+
{
|
|
1071
|
+
input.parse::<Token![mut]>()?;
|
|
1072
|
+
input.parse::<Token![self]>()?;
|
|
1073
|
+
None
|
|
1074
|
+
} else if has_mut_self && name.is_none() {
|
|
1075
|
+
input.parse::<Token![self]>()?;
|
|
1076
|
+
None
|
|
1077
|
+
} else {
|
|
1078
|
+
Some(input.parse()?)
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
let ty = match ty {
|
|
1082
|
+
Some(ty) if !has_mut_self => ty,
|
|
1083
|
+
_ => {
|
|
1084
|
+
name = None;
|
|
1085
|
+
Type::Verbatim(verbatim::between(begin, input.cursor()))
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
Ok(NamedArg { attrs, name, ty })
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
fn parse_fn_ptr_variadic(input: ParseStream, attrs: Vec<Attribute>) -> Result<FnPtrVariadic> {
|
|
1093
|
+
Ok(FnPtrVariadic {
|
|
1094
|
+
attrs,
|
|
1095
|
+
name: if input.peek(Ident) || input.peek(Token![_]) {
|
|
1096
|
+
let name = input.call(Ident::parse_any)?;
|
|
1097
|
+
let colon: Token![:] = input.parse()?;
|
|
1098
|
+
Some((name, colon))
|
|
1099
|
+
} else {
|
|
1100
|
+
None
|
|
1101
|
+
},
|
|
1102
|
+
dots: input.parse()?,
|
|
1103
|
+
comma: input.parse()?,
|
|
1104
|
+
})
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1108
|
+
impl Parse for Abi {
|
|
1109
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1110
|
+
Ok(Abi {
|
|
1111
|
+
extern_token: input.parse()?,
|
|
1112
|
+
name: input.parse()?,
|
|
1113
|
+
})
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1118
|
+
impl Parse for Option<Abi> {
|
|
1119
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1120
|
+
if input.peek(Token![extern]) {
|
|
1121
|
+
input.parse().map(Some)
|
|
1122
|
+
} else {
|
|
1123
|
+
Ok(None)
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
|
|
1129
|
+
impl Parse for PointerMutability {
|
|
1130
|
+
fn parse(input: ParseStream) -> Result<Self> {
|
|
1131
|
+
let lookahead = input.lookahead1();
|
|
1132
|
+
if lookahead.peek(Token![const]) {
|
|
1133
|
+
Ok(PointerMutability::Const(input.parse()?))
|
|
1134
|
+
} else if lookahead.peek(Token![mut]) {
|
|
1135
|
+
Ok(PointerMutability::Mut(input.parse()?))
|
|
1136
|
+
} else {
|
|
1137
|
+
Err(lookahead.error())
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
#[cfg(feature = "printing")]
|
|
1144
|
+
mod printing {
|
|
1145
|
+
use crate::attr::FilterAttrs;
|
|
1146
|
+
use crate::path;
|
|
1147
|
+
use crate::path::printing::PathStyle;
|
|
1148
|
+
use crate::ty::{
|
|
1149
|
+
Abi, FnPtrVariadic, NamedArg, PointerMutability, ReturnType, TypeArray, TypeFnPtr,
|
|
1150
|
+
TypeGroup, TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr,
|
|
1151
|
+
TypeReference, TypeSlice, TypeTraitObject, TypeTuple,
|
|
1152
|
+
};
|
|
1153
|
+
use proc_macro2::TokenStream;
|
|
1154
|
+
use quote::{ToTokens, TokenStreamExt as _};
|
|
1155
|
+
|
|
1156
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1157
|
+
impl ToTokens for TypeSlice {
|
|
1158
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1159
|
+
self.bracket_token.surround(tokens, |tokens| {
|
|
1160
|
+
self.elem.to_tokens(tokens);
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1166
|
+
impl ToTokens for TypeArray {
|
|
1167
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1168
|
+
self.bracket_token.surround(tokens, |tokens| {
|
|
1169
|
+
self.elem.to_tokens(tokens);
|
|
1170
|
+
self.semi_token.to_tokens(tokens);
|
|
1171
|
+
self.len.to_tokens(tokens);
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1177
|
+
impl ToTokens for TypePtr {
|
|
1178
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1179
|
+
self.star_token.to_tokens(tokens);
|
|
1180
|
+
self.mutability.to_tokens(tokens);
|
|
1181
|
+
self.elem.to_tokens(tokens);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1186
|
+
impl ToTokens for TypeReference {
|
|
1187
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1188
|
+
self.and_token.to_tokens(tokens);
|
|
1189
|
+
self.lifetime.to_tokens(tokens);
|
|
1190
|
+
self.mutability.to_tokens(tokens);
|
|
1191
|
+
self.elem.to_tokens(tokens);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1196
|
+
impl ToTokens for TypeFnPtr {
|
|
1197
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1198
|
+
self.lifetimes.to_tokens(tokens);
|
|
1199
|
+
self.unsafety.to_tokens(tokens);
|
|
1200
|
+
self.abi.to_tokens(tokens);
|
|
1201
|
+
self.fn_token.to_tokens(tokens);
|
|
1202
|
+
self.paren_token.surround(tokens, |tokens| {
|
|
1203
|
+
self.inputs.to_tokens(tokens);
|
|
1204
|
+
if let Some(variadic) = &self.variadic {
|
|
1205
|
+
if !self.inputs.empty_or_trailing() {
|
|
1206
|
+
let span = variadic.dots.spans[0];
|
|
1207
|
+
Token.to_tokens(tokens);
|
|
1208
|
+
}
|
|
1209
|
+
variadic.to_tokens(tokens);
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
self.output.to_tokens(tokens);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1217
|
+
impl ToTokens for TypeNever {
|
|
1218
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1219
|
+
self.bang_token.to_tokens(tokens);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1224
|
+
impl ToTokens for TypeTuple {
|
|
1225
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1226
|
+
self.paren_token.surround(tokens, |tokens| {
|
|
1227
|
+
self.elems.to_tokens(tokens);
|
|
1228
|
+
// If we only have one argument, we need a trailing comma to
|
|
1229
|
+
// distinguish TypeTuple from TypeParen.
|
|
1230
|
+
if self.elems.len() == 1 && !self.elems.trailing_punct() {
|
|
1231
|
+
<Token![,]>::default().to_tokens(tokens);
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1238
|
+
impl ToTokens for TypePath {
|
|
1239
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1240
|
+
path::printing::print_qpath(tokens, &self.qself, &self.path, PathStyle::AsWritten);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1245
|
+
impl ToTokens for TypeTraitObject {
|
|
1246
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1247
|
+
self.dyn_token.to_tokens(tokens);
|
|
1248
|
+
self.bounds.to_tokens(tokens);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1253
|
+
impl ToTokens for TypeImplTrait {
|
|
1254
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1255
|
+
self.impl_token.to_tokens(tokens);
|
|
1256
|
+
self.bounds.to_tokens(tokens);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1261
|
+
impl ToTokens for TypeGroup {
|
|
1262
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1263
|
+
self.group_token.surround(tokens, |tokens| {
|
|
1264
|
+
self.elem.to_tokens(tokens);
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1270
|
+
impl ToTokens for TypeParen {
|
|
1271
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1272
|
+
self.paren_token.surround(tokens, |tokens| {
|
|
1273
|
+
self.elem.to_tokens(tokens);
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1279
|
+
impl ToTokens for TypeInfer {
|
|
1280
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1281
|
+
self.underscore_token.to_tokens(tokens);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1286
|
+
impl ToTokens for TypeMacro {
|
|
1287
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1288
|
+
self.mac.to_tokens(tokens);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1293
|
+
impl ToTokens for ReturnType {
|
|
1294
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1295
|
+
match self {
|
|
1296
|
+
ReturnType::Default => {}
|
|
1297
|
+
ReturnType::Type(arrow, ty) => {
|
|
1298
|
+
arrow.to_tokens(tokens);
|
|
1299
|
+
ty.to_tokens(tokens);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1306
|
+
impl ToTokens for NamedArg {
|
|
1307
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1308
|
+
tokens.append_all(self.attrs.outer());
|
|
1309
|
+
if let Some((name, colon)) = &self.name {
|
|
1310
|
+
name.to_tokens(tokens);
|
|
1311
|
+
colon.to_tokens(tokens);
|
|
1312
|
+
}
|
|
1313
|
+
self.ty.to_tokens(tokens);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1318
|
+
impl ToTokens for FnPtrVariadic {
|
|
1319
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1320
|
+
tokens.append_all(self.attrs.outer());
|
|
1321
|
+
if let Some((name, colon)) = &self.name {
|
|
1322
|
+
name.to_tokens(tokens);
|
|
1323
|
+
colon.to_tokens(tokens);
|
|
1324
|
+
}
|
|
1325
|
+
self.dots.to_tokens(tokens);
|
|
1326
|
+
self.comma.to_tokens(tokens);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1331
|
+
impl ToTokens for Abi {
|
|
1332
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1333
|
+
self.extern_token.to_tokens(tokens);
|
|
1334
|
+
self.name.to_tokens(tokens);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
|
|
1339
|
+
impl ToTokens for PointerMutability {
|
|
1340
|
+
fn to_tokens(&self, tokens: &mut TokenStream) {
|
|
1341
|
+
match self {
|
|
1342
|
+
PointerMutability::Const(const_token) => const_token.to_tokens(tokens),
|
|
1343
|
+
PointerMutability::Mut(mut_token) => mut_token.to_tokens(tokens),
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|