├── .externalToolBuilders └── MyPy checks.launch ├── .gitignore ├── .project ├── .pydevproject ├── Cargo.lock ├── Cargo.toml ├── Jenkinsfile ├── Makefile ├── README.md ├── TODO.md ├── bin ├── qvm-folder-share-manager └── qvm-mount-folder ├── build.parameters ├── desktop └── qvm-folder-share-manager.desktop ├── doc ├── auth-dialog.png ├── auth-flow.dia ├── auth-flow.png ├── authorization-design.md ├── authorization.dia ├── authorization.png ├── building-from-source.md └── folder-share-manager.png ├── etc ├── qubes-rpc │ ├── ruddo.AuthorizeFolderAccess │ ├── ruddo.ConnectToFolder │ └── ruddo.QueryFolderAuthorization └── qubes │ └── policy.d │ ├── 79-qubes-shared-folders.policy │ └── 80-qubes-shared-folders.policy ├── libexec └── qvm-authorize-folder-access ├── p9 ├── .cargo-ok ├── .cargo_vcs_info.json ├── .gitignore ├── CONTRIBUTING.md ├── Cargo.toml ├── Cargo.toml.orig ├── LICENSE ├── OWNERS ├── README.md └── src │ ├── fuzzing.rs │ ├── lib.rs │ ├── protocol │ ├── messages.rs │ ├── mod.rs │ └── wire_format.rs │ └── server │ ├── mod.rs │ ├── read_dir.rs │ └── tests.rs ├── py ├── .gitignore └── sharedfolders │ ├── .gitignore │ ├── __init__.py │ ├── programs.py │ ├── test_sharedfolders.py │ └── ui.py ├── qubes-shared-folders.spec ├── selinux └── fix-qvm-mount-folder.te ├── src ├── main.rs └── test-qfsd-mount.py ├── ui └── authorization-dialog.ui └── vendor ├── libc ├── .cargo-checksum.json ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── build.rs ├── rustfmt.toml ├── src │ ├── fixed_width_ints.rs │ ├── fuchsia │ │ ├── aarch64.rs │ │ ├── align.rs │ │ ├── mod.rs │ │ ├── no_align.rs │ │ ├── riscv64.rs │ │ └── x86_64.rs │ ├── hermit │ │ ├── aarch64.rs │ │ ├── mod.rs │ │ └── x86_64.rs │ ├── lib.rs │ ├── macros.rs │ ├── psp.rs │ ├── sgx.rs │ ├── solid │ │ ├── aarch64.rs │ │ ├── arm.rs │ │ └── mod.rs │ ├── switch.rs │ ├── teeos │ │ └── mod.rs │ ├── unix │ │ ├── aix │ │ │ ├── mod.rs │ │ │ └── powerpc64.rs │ │ ├── align.rs │ │ ├── bsd │ │ │ ├── apple │ │ │ │ ├── b32 │ │ │ │ │ ├── align.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── b64 │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── x86_64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ ├── long_array.rs │ │ │ │ └── mod.rs │ │ │ ├── freebsdlike │ │ │ │ ├── dragonfly │ │ │ │ │ ├── errno.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── freebsd │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ ├── arm.rs │ │ │ │ │ ├── freebsd11 │ │ │ │ │ │ ├── b64.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── freebsd12 │ │ │ │ │ │ ├── b64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ ├── freebsd13 │ │ │ │ │ │ ├── b64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ ├── freebsd14 │ │ │ │ │ │ ├── b64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ ├── freebsd15 │ │ │ │ │ │ ├── b64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ ├── riscv64.rs │ │ │ │ │ ├── x86.rs │ │ │ │ │ └── x86_64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ └── netbsdlike │ │ │ │ ├── mod.rs │ │ │ │ ├── netbsd │ │ │ │ ├── aarch64.rs │ │ │ │ ├── arm.rs │ │ │ │ ├── mips.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── powerpc.rs │ │ │ │ ├── riscv64.rs │ │ │ │ ├── sparc64.rs │ │ │ │ ├── x86.rs │ │ │ │ └── x86_64.rs │ │ │ │ └── openbsd │ │ │ │ ├── aarch64.rs │ │ │ │ ├── arm.rs │ │ │ │ ├── mips64.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── powerpc.rs │ │ │ │ ├── powerpc64.rs │ │ │ │ ├── riscv64.rs │ │ │ │ ├── sparc64.rs │ │ │ │ ├── x86.rs │ │ │ │ └── x86_64.rs │ │ ├── haiku │ │ │ ├── b32.rs │ │ │ ├── b64.rs │ │ │ ├── mod.rs │ │ │ ├── native.rs │ │ │ └── x86_64.rs │ │ ├── hurd │ │ │ ├── align.rs │ │ │ ├── b32.rs │ │ │ ├── b64.rs │ │ │ ├── mod.rs │ │ │ └── no_align.rs │ │ ├── linux_like │ │ │ ├── android │ │ │ │ ├── b32 │ │ │ │ │ ├── arm.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── x86 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ ├── b64 │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ ├── int128.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── riscv64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── x86_64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ └── mod.rs │ │ │ ├── emscripten │ │ │ │ ├── align.rs │ │ │ │ ├── lfs64.rs │ │ │ │ ├── mod.rs │ │ │ │ └── no_align.rs │ │ │ ├── linux │ │ │ │ ├── align.rs │ │ │ │ ├── arch │ │ │ │ │ ├── generic │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── mips │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── powerpc │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── sparc │ │ │ │ │ │ └── mod.rs │ │ │ │ ├── gnu │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── b32 │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── csky │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── m68k │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ │ ├── riscv32 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── sparc │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── b64 │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ ├── fallback.rs │ │ │ │ │ │ │ ├── ilp32.rs │ │ │ │ │ │ │ ├── int128.rs │ │ │ │ │ │ │ ├── lp64.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── loongarch64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mips64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── powerpc64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── riscv64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── s390x.rs │ │ │ │ │ │ ├── sparc64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ ├── not_x32.rs │ │ │ │ │ │ │ └── x32.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── musl │ │ │ │ │ ├── b32 │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── hexagon.rs │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ │ ├── riscv32 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── b64 │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ ├── int128.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mips64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ │ ├── riscv64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── s390x.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── lfs64.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── no_align.rs │ │ │ │ ├── non_exhaustive.rs │ │ │ │ └── uclibc │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── arm │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ │ ├── mips │ │ │ │ │ ├── mips32 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── no_align.rs │ │ │ │ │ ├── mips64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── no_align.rs │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── no_align.rs │ │ │ │ │ └── x86_64 │ │ │ │ │ ├── l4re.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── other.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── newlib │ │ │ ├── aarch64 │ │ │ │ └── mod.rs │ │ │ ├── align.rs │ │ │ ├── arm │ │ │ │ └── mod.rs │ │ │ ├── espidf │ │ │ │ └── mod.rs │ │ │ ├── generic.rs │ │ │ ├── horizon │ │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ ├── no_align.rs │ │ │ ├── powerpc │ │ │ │ └── mod.rs │ │ │ └── vita │ │ │ │ └── mod.rs │ │ ├── no_align.rs │ │ ├── nto │ │ │ ├── aarch64.rs │ │ │ ├── mod.rs │ │ │ ├── neutrino.rs │ │ │ └── x86_64.rs │ │ ├── redox │ │ │ └── mod.rs │ │ └── solarish │ │ │ ├── compat.rs │ │ │ ├── illumos.rs │ │ │ ├── mod.rs │ │ │ ├── solaris.rs │ │ │ ├── x86.rs │ │ │ ├── x86_64.rs │ │ │ └── x86_common.rs │ ├── vxworks │ │ ├── aarch64.rs │ │ ├── arm.rs │ │ ├── mod.rs │ │ ├── powerpc.rs │ │ ├── powerpc64.rs │ │ ├── x86.rs │ │ └── x86_64.rs │ ├── wasi.rs │ ├── windows │ │ ├── gnu │ │ │ ├── align.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ └── msvc │ │ │ └── mod.rs │ └── xous.rs └── tests │ └── const_fn.rs ├── p9_wire_format_derive ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE ├── README.md └── src │ └── lib.rs ├── proc-macro2 ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── build.rs ├── build │ └── probe.rs ├── rust-toolchain.toml ├── src │ ├── detection.rs │ ├── extra.rs │ ├── fallback.rs │ ├── lib.rs │ ├── location.rs │ ├── marker.rs │ ├── parse.rs │ ├── rcvec.rs │ └── wrapper.rs └── tests │ ├── comments.rs │ ├── features.rs │ ├── marker.rs │ ├── test.rs │ ├── test_fmt.rs │ └── test_size.rs ├── quote ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── rust-toolchain.toml ├── src │ ├── ext.rs │ ├── format.rs │ ├── ident_fragment.rs │ ├── lib.rs │ ├── runtime.rs │ ├── spanned.rs │ └── to_tokens.rs └── tests │ ├── compiletest.rs │ ├── test.rs │ └── ui │ ├── does-not-have-iter-interpolated-dup.rs │ ├── does-not-have-iter-interpolated-dup.stderr │ ├── does-not-have-iter-interpolated.rs │ ├── does-not-have-iter-interpolated.stderr │ ├── does-not-have-iter-separated.rs │ ├── does-not-have-iter-separated.stderr │ ├── does-not-have-iter.rs │ ├── does-not-have-iter.stderr │ ├── not-quotable.rs │ ├── not-quotable.stderr │ ├── not-repeatable.rs │ ├── not-repeatable.stderr │ ├── wrong-type-span.rs │ └── wrong-type-span.stderr ├── serde ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── build.rs ├── crates-io.md └── src │ ├── de │ ├── format.rs │ ├── ignored_any.rs │ ├── impls.rs │ ├── mod.rs │ ├── seed.rs │ ├── size_hint.rs │ └── value.rs │ ├── integer128.rs │ ├── lib.rs │ ├── macros.rs │ ├── private │ ├── de.rs │ ├── doc.rs │ ├── mod.rs │ └── ser.rs │ ├── ser │ ├── fmt.rs │ ├── impls.rs │ ├── impossible.rs │ └── mod.rs │ └── std_error.rs ├── serde_derive ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── crates-io.md └── src │ ├── bound.rs │ ├── de.rs │ ├── dummy.rs │ ├── fragment.rs │ ├── internals │ ├── ast.rs │ ├── attr.rs │ ├── case.rs │ ├── check.rs │ ├── ctxt.rs │ ├── mod.rs │ ├── receiver.rs │ ├── respan.rs │ └── symbol.rs │ ├── lib.rs │ ├── pretend.rs │ ├── ser.rs │ └── this.rs ├── syn-1.0.109 ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── benches │ ├── file.rs │ └── rust.rs ├── build.rs ├── src │ ├── attr.rs │ ├── await.rs │ ├── bigint.rs │ ├── buffer.rs │ ├── custom_keyword.rs │ ├── custom_punctuation.rs │ ├── data.rs │ ├── derive.rs │ ├── discouraged.rs │ ├── drops.rs │ ├── error.rs │ ├── export.rs │ ├── expr.rs │ ├── ext.rs │ ├── file.rs │ ├── gen │ │ ├── clone.rs │ │ ├── debug.rs │ │ ├── eq.rs │ │ ├── fold.rs │ │ ├── hash.rs │ │ ├── visit.rs │ │ └── visit_mut.rs │ ├── gen_helper.rs │ ├── generics.rs │ ├── group.rs │ ├── ident.rs │ ├── item.rs │ ├── lib.rs │ ├── lifetime.rs │ ├── lit.rs │ ├── lookahead.rs │ ├── mac.rs │ ├── macros.rs │ ├── op.rs │ ├── parse.rs │ ├── parse_macro_input.rs │ ├── parse_quote.rs │ ├── pat.rs │ ├── path.rs │ ├── print.rs │ ├── punctuated.rs │ ├── reserved.rs │ ├── sealed.rs │ ├── span.rs │ ├── spanned.rs │ ├── stmt.rs │ ├── thread.rs │ ├── token.rs │ ├── tt.rs │ ├── ty.rs │ ├── verbatim.rs │ └── whitespace.rs └── tests │ ├── common │ ├── eq.rs │ ├── mod.rs │ └── parse.rs │ ├── debug │ ├── gen.rs │ └── mod.rs │ ├── macros │ └── mod.rs │ ├── regression.rs │ ├── regression │ ├── issue1108.rs │ └── issue1235.rs │ ├── repo │ ├── mod.rs │ └── progress.rs │ ├── test_asyncness.rs │ ├── test_attribute.rs │ ├── test_derive_input.rs │ ├── test_expr.rs │ ├── test_generics.rs │ ├── test_grouping.rs │ ├── test_ident.rs │ ├── test_item.rs │ ├── test_iterators.rs │ ├── test_lit.rs │ ├── test_meta.rs │ ├── test_parse_buffer.rs │ ├── test_parse_stream.rs │ ├── test_pat.rs │ ├── test_path.rs │ ├── test_precedence.rs │ ├── test_receiver.rs │ ├── test_round_trip.rs │ ├── test_shebang.rs │ ├── test_should_parse.rs │ ├── test_size.rs │ ├── test_stmt.rs │ ├── test_token_trees.rs │ ├── test_ty.rs │ ├── test_visibility.rs │ └── zzz_stable.rs ├── syn ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── benches │ ├── file.rs │ └── rust.rs ├── src │ ├── attr.rs │ ├── bigint.rs │ ├── buffer.rs │ ├── custom_keyword.rs │ ├── custom_punctuation.rs │ ├── data.rs │ ├── derive.rs │ ├── discouraged.rs │ ├── drops.rs │ ├── error.rs │ ├── export.rs │ ├── expr.rs │ ├── ext.rs │ ├── file.rs │ ├── gen │ │ ├── clone.rs │ │ ├── debug.rs │ │ ├── eq.rs │ │ ├── fold.rs │ │ ├── hash.rs │ │ ├── visit.rs │ │ └── visit_mut.rs │ ├── gen_helper.rs │ ├── generics.rs │ ├── group.rs │ ├── ident.rs │ ├── item.rs │ ├── lib.rs │ ├── lifetime.rs │ ├── lit.rs │ ├── lookahead.rs │ ├── mac.rs │ ├── macros.rs │ ├── meta.rs │ ├── op.rs │ ├── parse.rs │ ├── parse_macro_input.rs │ ├── parse_quote.rs │ ├── pat.rs │ ├── path.rs │ ├── print.rs │ ├── punctuated.rs │ ├── restriction.rs │ ├── sealed.rs │ ├── span.rs │ ├── spanned.rs │ ├── stmt.rs │ ├── thread.rs │ ├── token.rs │ ├── tt.rs │ ├── ty.rs │ ├── verbatim.rs │ └── whitespace.rs └── tests │ ├── common │ ├── eq.rs │ ├── mod.rs │ └── parse.rs │ ├── debug │ ├── gen.rs │ └── mod.rs │ ├── macros │ └── mod.rs │ ├── regression.rs │ ├── regression │ ├── issue1108.rs │ └── issue1235.rs │ ├── repo │ ├── mod.rs │ └── progress.rs │ ├── test_asyncness.rs │ ├── test_attribute.rs │ ├── test_derive_input.rs │ ├── test_expr.rs │ ├── test_generics.rs │ ├── test_grouping.rs │ ├── test_ident.rs │ ├── test_item.rs │ ├── test_iterators.rs │ ├── test_lit.rs │ ├── test_meta.rs │ ├── test_parse_buffer.rs │ ├── test_parse_quote.rs │ ├── test_parse_stream.rs │ ├── test_pat.rs │ ├── test_path.rs │ ├── test_precedence.rs │ ├── test_receiver.rs │ ├── test_round_trip.rs │ ├── test_shebang.rs │ ├── test_should_parse.rs │ ├── test_size.rs │ ├── test_stmt.rs │ ├── test_token_trees.rs │ ├── test_ty.rs │ ├── test_visibility.rs │ └── zzz_stable.rs └── unicode-ident ├── .cargo-checksum.json ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── LICENSE-UNICODE ├── README.md ├── benches └── xid.rs ├── src ├── lib.rs └── tables.rs └── tests ├── compare.rs ├── fst ├── mod.rs ├── xid_continue.fst └── xid_start.fst ├── roaring └── mod.rs ├── static_size.rs ├── tables ├── mod.rs └── tables.rs └── trie ├── mod.rs └── trie.rs /.externalToolBuilders/MyPy checks.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *swp 2 | *.rpm 3 | *.tar.gz 4 | *.pyc 5 | *~ 6 | /.mypy_cache/ 7 | 8 | 9 | # Added by cargo 10 | 11 | /target 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | qubes-shared-folders 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.ui.externaltools.ExternalToolBuilder 15 | auto,full,incremental, 16 | 17 | 18 | LaunchConfigHandle 19 | <project>/.externalToolBuilders/MyPy checks.launch 20 | 21 | 22 | 23 | 24 | 25 | org.python.pydev.pythonNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /.pydevproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | python interpreter 4 | Default 5 | 6 | /${PROJECT_DIR_NAME}/py 7 | 8 | 9 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "qubes-shared-folders" 3 | edition = "2021" 4 | version = "0.0.0" 5 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 6 | 7 | [[bin]] 8 | name = "qfsd" 9 | path = "src/main.rs" 10 | 11 | [dependencies] 12 | p9 = { path = "p9" } 13 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | // https://github.com/Rudd-O/shared-jenkins-libraries 2 | @Library('shared-jenkins-libraries@master') _ 3 | 4 | genericFedoraRPMPipeline() 5 | -------------------------------------------------------------------------------- /bin/qvm-folder-share-manager: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | from sharedfolders.ui import FolderShareManager 4 | 5 | 6 | FolderShareManager().run() 7 | -------------------------------------------------------------------------------- /bin/qvm-mount-folder: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import sharedfolders.programs 5 | 6 | sys.exit(sharedfolders.programs.QvmMountFolder()) 7 | -------------------------------------------------------------------------------- /build.parameters: -------------------------------------------------------------------------------- 1 | ["QUBES_RELEASES": "4.2"] 2 | -------------------------------------------------------------------------------- /desktop/qvm-folder-share-manager.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Exec=qvm-folder-share-manager 4 | Icon=folder-publicshare 5 | Terminal=false 6 | Name=Folder share manager 7 | GenericName=Folder share manager 8 | StartupNotify=false 9 | Categories=System; -------------------------------------------------------------------------------- /doc/auth-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/auth-dialog.png -------------------------------------------------------------------------------- /doc/auth-flow.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/auth-flow.dia -------------------------------------------------------------------------------- /doc/auth-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/auth-flow.png -------------------------------------------------------------------------------- /doc/authorization.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/authorization.dia -------------------------------------------------------------------------------- /doc/authorization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/authorization.png -------------------------------------------------------------------------------- /doc/folder-share-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/doc/folder-share-manager.png -------------------------------------------------------------------------------- /etc/qubes-rpc/ruddo.AuthorizeFolderAccess: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import sharedfolders.programs 5 | 6 | sys.exit(sharedfolders.programs.AuthorizeFolderAccess()) 7 | -------------------------------------------------------------------------------- /etc/qubes-rpc/ruddo.ConnectToFolder: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | if [ "$QREXEC_SERVICE_ARGUMENT" == "" ] ; then 7 | echo 'error: an argument specifying the fingerprint for the folder to be shared is required' >&2 8 | exit 126 9 | fi 10 | fingerprint="$QREXEC_SERVICE_ARGUMENT" 11 | 12 | ret=0 13 | # Read the folder that the user intends to mount. 14 | # We pass it blindly to QueryFolderAuthorization, which will then 15 | # check if the user has permission to mount the specific folder 16 | # or a subfolder thereof, doing the base64 decoding prior to that. 17 | read -n 6000 requested_folder_base64 18 | # Now read the requested folder (will come out empty if it was not authorized). 19 | # We do not bother with base64 encoding here because the remote side will close 20 | # the pipe, so we already have a sturdy mechanism to obtain the returned folder. 21 | requested_folder=$(echo "$requested_folder_base64" | qrexec-client-vm dom0 ruddo.QueryFolderAuthorization+"$fingerprint") || ret=$? 22 | if [ "$ret" != "0" ] ; then 23 | echo 'Request refused' >&2 24 | exit 126 25 | fi 26 | 27 | if [ "$requested_folder" == "" ] ; then 28 | echo 'error: Qubes dom0 failed to reply with the folder to be shared' >&2 29 | exit 126 30 | fi 31 | 32 | if [ ! -d "$requested_folder" ] ; then 33 | echo "error: the folder to be shared $requested_folder does not exist or is not a directory" >&2 34 | exit 2 35 | fi 36 | # Good news! The folder exists, and is within the scope of the 37 | # permissions that have been granted to the caller. We proceed 38 | # and signal to the caller that we are about to start qfsd. 39 | echo ok 40 | 41 | exec /usr/bin/qfsd 0 1 "$requested_folder" || { 42 | ret=$? 43 | echo "error: qfsd is not installed" >&2 44 | exit $ret 45 | } 46 | -------------------------------------------------------------------------------- /etc/qubes-rpc/ruddo.QueryFolderAuthorization: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import sharedfolders.programs 5 | 6 | sys.exit(sharedfolders.programs.QueryFolderForAuthorization()) 7 | -------------------------------------------------------------------------------- /etc/qubes/policy.d/79-qubes-shared-folders.policy: -------------------------------------------------------------------------------- 1 | ## The following policies are remembered. 2 | -------------------------------------------------------------------------------- /etc/qubes/policy.d/80-qubes-shared-folders.policy: -------------------------------------------------------------------------------- 1 | ## This policy allows VMs to ask for share folder authorization. 2 | ruddo.AuthorizeFolderAccess * @anyvm dom0 allow 3 | ruddo.AuthorizeFolderAccess * @anyvm @anyvm deny 4 | 5 | ## This policy is used by VMs to verify folder authorization. 6 | ## Do not change this or add policy -- this is managed by qubes-shared-folders. 7 | ruddo.ConnectToFolder * @anyvm @anyvm deny 8 | 9 | ## This policy allows VMs to ask for share folder authorization. 10 | ruddo.QueryFolderAuthorization * @anyvm dom0 allow 11 | ruddo.QueryFolderAuthorization * @anyvm @anyvm deny 12 | -------------------------------------------------------------------------------- /libexec/qvm-authorize-folder-access: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | from sharedfolders.ui import AuthorizationDialog 5 | 6 | print(AuthorizationDialog(*sys.argv[1:]).run()) 7 | -------------------------------------------------------------------------------- /p9/.cargo-ok: -------------------------------------------------------------------------------- 1 | {"v":1} -------------------------------------------------------------------------------- /p9/.cargo_vcs_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "sha1": "68f2a1caea21b7707f5c6a992fe5e71f2e89513a" 4 | }, 5 | "path_in_vcs": "" 6 | } -------------------------------------------------------------------------------- /p9/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /p9/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We'd love to accept your patches and contributions to this project. 4 | 5 | ## Before you begin 6 | 7 | ### Sign our Contributor License Agreement 8 | 9 | Contributions to this project must be accompanied by a 10 | [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). 11 | You (or your employer) retain the copyright to your contribution; this simply 12 | gives us permission to use and redistribute your contributions as part of the 13 | project. 14 | 15 | If you or your current employer have already signed the Google CLA (even if it 16 | was for a different project), you probably don't need to do it again. 17 | 18 | Visit to see your current agreements or to 19 | sign a new one. 20 | 21 | ### Review our community guidelines 22 | 23 | This project follows 24 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 25 | 26 | ## Contribution process 27 | 28 | ### Code reviews 29 | 30 | All submissions, including submissions by project members, require review. We 31 | use GitHub pull requests for this purpose. Consult 32 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 33 | information on using pull requests. 34 | -------------------------------------------------------------------------------- /p9/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | edition = "2021" 14 | name = "p9" 15 | version = "0.2.3" 16 | authors = ["The ChromiumOS Authors"] 17 | description = "Server implementation of the 9p file system protocol" 18 | readme = "README.md" 19 | license = "BSD-3-Clause" 20 | repository = "https://github.com/google/rust-p9" 21 | 22 | [features] 23 | trace = [] 24 | 25 | [target."cfg(unix)".dependencies.libc] 26 | version = "0.2" 27 | 28 | [target."cfg(unix)".dependencies.p9_wire_format_derive] 29 | version = "0.2.3" 30 | 31 | [target."cfg(unix)".dependencies.serde] 32 | version = "1.0" 33 | features = ["derive"] 34 | -------------------------------------------------------------------------------- /p9/Cargo.toml.orig: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "p9" 3 | version = "0.2.3" 4 | authors = ["The ChromiumOS Authors"] 5 | edition = "2021" 6 | license = "BSD-3-Clause" 7 | description = "Server implementation of the 9p file system protocol" 8 | repository = "https://github.com/google/rust-p9" 9 | 10 | [target.'cfg(unix)'.dependencies] 11 | libc = "0.2" 12 | serde = { version = "1.0", features = ["derive"] } 13 | p9_wire_format_derive = { path = "p9_wire_format_derive", version = "0.2.3" } 14 | 15 | [features] 16 | trace = [] 17 | 18 | [workspace] 19 | members = ["p9_wire_format_derive"] 20 | -------------------------------------------------------------------------------- /p9/LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The ChromiumOS Authors 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /p9/OWNERS: -------------------------------------------------------------------------------- 1 | # This file exists so it can be passed to fuzzer_install in dev-rust/p9. 2 | denniskempin@google.com 3 | dverkamp@chromium.org 4 | -------------------------------------------------------------------------------- /p9/README.md: -------------------------------------------------------------------------------- 1 | # p9 - Server implementation of the [9p] file system protocol 2 | 3 | This directory contains the protocol definition and a server implementation of the [9p] file system 4 | protocol. 5 | 6 | - [wire_format_derive] - A [procedural macro] that derives the serialization and de-serialization 7 | implementation for a struct into the [9p] wire format. 8 | - [src/protocol] - Defines all the messages used in the [9p] protocol. Also implements serialization 9 | and de-serialization for some base types (integers, strings, vectors) that form the foundation of 10 | all [9p] messages. Wire format implementations for all other messages are derived using the 11 | `wire_format_derive` macro. 12 | - [src/server.rs] - Implements a full [9p] server, carrying out file system requests on behalf of 13 | clients. 14 | 15 | [9p]: http://man.cat-v.org/plan_9/5/intro 16 | [procedural macro]: https://doc.rust-lang.org/proc_macro/index.html 17 | [src/protocol]: src/protocol/ 18 | [src/server.rs]: src/server.rs 19 | [wire_format_derive]: wire_format_derive/ 20 | -------------------------------------------------------------------------------- /p9/src/fuzzing.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The ChromiumOS Authors 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | use std::io::Cursor; 6 | 7 | use crate::protocol::Tframe; 8 | use crate::protocol::WireFormat; 9 | 10 | pub fn tframe_decode(bytes: &[u8]) { 11 | let mut cursor = Cursor::new(bytes); 12 | 13 | while Tframe::decode(&mut cursor).is_ok() {} 14 | } 15 | -------------------------------------------------------------------------------- /p9/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The ChromiumOS Authors 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #![cfg(unix)] 6 | 7 | extern crate libc; 8 | 9 | #[macro_use] 10 | extern crate p9_wire_format_derive; 11 | 12 | mod protocol; 13 | mod server; 14 | 15 | pub mod fuzzing; 16 | 17 | pub use server::*; 18 | 19 | #[macro_export] 20 | macro_rules! syscall { 21 | ($e:expr) => {{ 22 | let res = $e; 23 | if res < 0 { 24 | Err(std::io::Error::last_os_error()) 25 | } else { 26 | Ok(res) 27 | } 28 | }}; 29 | } 30 | -------------------------------------------------------------------------------- /p9/src/protocol/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The ChromiumOS Authors 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | mod messages; 6 | mod wire_format; 7 | 8 | pub use self::messages::*; 9 | pub use self::wire_format::Data; 10 | pub use self::wire_format::WireFormat; 11 | -------------------------------------------------------------------------------- /py/.gitignore: -------------------------------------------------------------------------------- 1 | /.mypy_cache/ 2 | -------------------------------------------------------------------------------- /py/sharedfolders/.gitignore: -------------------------------------------------------------------------------- 1 | /.mypy_cache/ 2 | -------------------------------------------------------------------------------- /selinux/fix-qvm-mount-folder.te: -------------------------------------------------------------------------------- 1 | module fix-qvm-mount-folder 1.0; 2 | 3 | # https://github.com/Rudd-O/qubes-shared-folders/issues/15 4 | 5 | require { 6 | type unconfined_t; 7 | type kernel_t; 8 | class fifo_file read; 9 | } 10 | 11 | require { 12 | type kernel_t; 13 | type unconfined_t; 14 | class fifo_file write; 15 | } 16 | 17 | #============= kernel_t ============== 18 | allow kernel_t unconfined_t:fifo_file read; 19 | allow kernel_t unconfined_t:fifo_file write; 20 | -------------------------------------------------------------------------------- /vendor/libc/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2020 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vendor/libc/rustfmt.toml: -------------------------------------------------------------------------------- 1 | error_on_line_overflow = true 2 | -------------------------------------------------------------------------------- /vendor/libc/src/fuchsia/riscv64.rs: -------------------------------------------------------------------------------- 1 | // From psABI Calling Convention for RV64 2 | pub type c_char = u8; 3 | pub type __u64 = ::c_ulonglong; 4 | pub type wchar_t = i32; 5 | 6 | pub type nlink_t = ::c_ulong; 7 | pub type blksize_t = ::c_long; 8 | 9 | pub type stat64 = stat; 10 | s! { 11 | pub struct stat { 12 | pub st_dev: ::dev_t, 13 | pub st_ino: ::ino_t, 14 | pub st_nlink: ::nlink_t, 15 | pub st_mode: ::mode_t, 16 | pub st_uid: ::uid_t, 17 | pub st_gid: ::gid_t, 18 | __pad0: ::c_int, 19 | pub st_rdev: ::dev_t, 20 | pub st_size: ::off_t, 21 | pub st_blksize: ::blksize_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_atime: ::time_t, 24 | pub st_atime_nsec: ::c_long, 25 | pub st_mtime: ::time_t, 26 | pub st_mtime_nsec: ::c_long, 27 | pub st_ctime: ::time_t, 28 | pub st_ctime_nsec: ::c_long, 29 | __unused: [::c_long; 3], 30 | } 31 | 32 | // Not actually used, IPC calls just return ENOSYS 33 | pub struct ipc_perm { 34 | pub __ipc_perm_key: ::key_t, 35 | pub uid: ::uid_t, 36 | pub gid: ::gid_t, 37 | pub cuid: ::uid_t, 38 | pub cgid: ::gid_t, 39 | pub mode: ::mode_t, 40 | pub __seq: ::c_ushort, 41 | __unused1: ::c_ulong, 42 | __unused2: ::c_ulong, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/mod.rs: -------------------------------------------------------------------------------- 1 | //! Hermit C types definition 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type c_long = i64; 23 | pub type c_ulong = u64; 24 | 25 | pub type wint_t = u32; 26 | pub type wctype_t = i64; 27 | 28 | pub type regoff_t = size_t; 29 | pub type off_t = c_long; 30 | 31 | cfg_if! { 32 | if #[cfg(target_arch = "aarch64")] { 33 | mod aarch64; 34 | pub use self::aarch64::*; 35 | } else if #[cfg(target_arch = "x86_64")] { 36 | mod x86_64; 37 | pub use self::x86_64::*; 38 | } else { 39 | // Unknown target_arch 40 | } 41 | } 42 | 43 | cfg_if! { 44 | if #[cfg(libc_core_cvoid)] { 45 | pub use ::ffi::c_void; 46 | } else { 47 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 48 | // enable more optimization opportunities around it recognizing things 49 | // like malloc/free. 50 | #[repr(u8)] 51 | #[allow(missing_copy_implementations)] 52 | #[allow(missing_debug_implementations)] 53 | pub enum c_void { 54 | // Two dummy variants so the #[repr] attribute can be used. 55 | #[doc(hidden)] 56 | __variant1, 57 | #[doc(hidden)] 58 | __variant2, 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/libc/src/hermit/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | -------------------------------------------------------------------------------- /vendor/libc/src/sgx.rs: -------------------------------------------------------------------------------- 1 | //! SGX C types definition 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type c_char = i8; 23 | pub type c_long = i64; 24 | pub type c_ulong = u64; 25 | 26 | pub const INT_MIN: c_int = -2147483648; 27 | pub const INT_MAX: c_int = 2147483647; 28 | 29 | cfg_if! { 30 | if #[cfg(libc_core_cvoid)] { 31 | pub use ::ffi::c_void; 32 | } else { 33 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 34 | // enable more optimization opportunities around it recognizing things 35 | // like malloc/free. 36 | #[repr(u8)] 37 | #[allow(missing_copy_implementations)] 38 | #[allow(missing_debug_implementations)] 39 | pub enum c_void { 40 | // Two dummy variants so the #[repr] attribute can be used. 41 | #[doc(hidden)] 42 | __variant1, 43 | #[doc(hidden)] 44 | __variant2, 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/libc/src/solid/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/solid/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/switch.rs: -------------------------------------------------------------------------------- 1 | //! Switch C type definitions 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type off_t = i64; 23 | pub type c_char = u8; 24 | pub type c_long = i64; 25 | pub type c_ulong = u64; 26 | pub type wchar_t = u32; 27 | 28 | pub const INT_MIN: c_int = -2147483648; 29 | pub const INT_MAX: c_int = 2147483647; 30 | 31 | cfg_if! { 32 | if #[cfg(libc_core_cvoid)] { 33 | pub use ::ffi::c_void; 34 | } else { 35 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 36 | // enable more optimization opportunities around it recognizing things 37 | // like malloc/free. 38 | #[repr(u8)] 39 | #[allow(missing_copy_implementations)] 40 | #[allow(missing_debug_implementations)] 41 | pub enum c_void { 42 | // Two dummy variants so the #[repr] attribute can be used. 43 | #[doc(hidden)] 44 | __variant1, 45 | #[doc(hidden)] 46 | __variant2, 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | #[repr(align(4))] 3 | pub struct in6_addr { 4 | pub s6_addr: [u8; 16], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b32/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | pub type mcontext_t = *mut __darwin_mcontext64; 2 | 3 | s_no_extra_traits! { 4 | #[allow(missing_debug_implementations)] 5 | pub struct max_align_t { 6 | priv_: f64 7 | } 8 | } 9 | 10 | s! { 11 | pub struct ucontext_t { 12 | pub uc_onstack: ::c_int, 13 | pub uc_sigmask: ::sigset_t, 14 | pub uc_stack: ::stack_t, 15 | pub uc_link: *mut ::ucontext_t, 16 | pub uc_mcsize: usize, 17 | pub uc_mcontext: mcontext_t, 18 | } 19 | 20 | pub struct __darwin_mcontext64 { 21 | pub __es: __darwin_arm_exception_state64, 22 | pub __ss: __darwin_arm_thread_state64, 23 | pub __ns: __darwin_arm_neon_state64, 24 | } 25 | 26 | pub struct __darwin_arm_exception_state64 { 27 | pub __far: u64, 28 | pub __esr: u32, 29 | pub __exception: u32, 30 | } 31 | 32 | pub struct __darwin_arm_thread_state64 { 33 | pub __x: [u64; 29], 34 | pub __fp: u64, 35 | pub __lr: u64, 36 | pub __sp: u64, 37 | pub __pc: u64, 38 | pub __cpsr: u32, 39 | pub __pad: u32, 40 | } 41 | 42 | // This type natively uses a uint128, but for a while we hacked 43 | // it in with repr(align) and `[u64; 2]`. uint128 isn't available 44 | // all the way back to our earliest supported versions so we 45 | // preserver the old shim. 46 | #[cfg_attr(not(libc_int128), repr(align(16)))] 47 | pub struct __darwin_arm_neon_state64 { 48 | #[cfg(libc_int128)] 49 | pub __v: [::__uint128_t; 32], 50 | #[cfg(not(libc_int128))] 51 | pub __v: [[u64; 2]; 32], 52 | pub __fpsr: u32, 53 | pub __fpcr: u32, 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs: -------------------------------------------------------------------------------- 1 | pub type boolean_t = ::c_int; 2 | 3 | s! { 4 | pub struct malloc_zone_t { 5 | __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support 6 | } 7 | } 8 | 9 | cfg_if! { 10 | if #[cfg(libc_align)] { 11 | mod align; 12 | pub use self::align::*; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/apple/long_array.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct ctl_info { 3 | pub ctl_id: u32, 4 | pub ctl_name: [::c_char; MAX_KCTL_NAME], 5 | } 6 | } 7 | 8 | pub const MAX_KCTL_NAME: usize = 96; 9 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs: -------------------------------------------------------------------------------- 1 | // DragonFlyBSD's __error function is declared with "static inline", so it must 2 | // be implemented in the libc crate, as a pointer to a static thread_local. 3 | f! { 4 | #[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")] 5 | pub fn __error() -> *mut ::c_int { 6 | &mut errno 7 | } 8 | } 9 | 10 | extern "C" { 11 | #[thread_local] 12 | pub static mut errno: ::c_int; 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = u32; 5 | pub type time_t = i64; 6 | pub type suseconds_t = i32; 7 | pub type register_t = i32; 8 | 9 | s! { 10 | pub struct stat { 11 | pub st_dev: ::dev_t, 12 | pub st_ino: ::ino_t, 13 | pub st_mode: ::mode_t, 14 | pub st_nlink: ::nlink_t, 15 | pub st_uid: ::uid_t, 16 | pub st_gid: ::gid_t, 17 | pub st_rdev: ::dev_t, 18 | pub st_atime: ::time_t, 19 | pub st_atime_nsec: ::c_long, 20 | pub st_atime_pad: ::c_long, 21 | pub st_mtime: ::time_t, 22 | pub st_mtime_nsec: ::c_long, 23 | pub st_mtime_pad: ::c_long, 24 | pub st_ctime: ::time_t, 25 | pub st_ctime_nsec: ::c_long, 26 | pub st_ctime_pad: ::c_long, 27 | pub st_size: ::off_t, 28 | pub st_blocks: ::blkcnt_t, 29 | pub st_blksize: ::blksize_t, 30 | pub st_flags: ::fflags_t, 31 | pub st_gen: u32, 32 | pub st_lspare: i32, 33 | pub st_birthtime: ::time_t, 34 | pub st_birthtime_nsec: ::c_long, 35 | pub st_birthtime_pad: ::c_long, 36 | } 37 | } 38 | 39 | // should be pub(crate), but that requires Rust 1.18.0 40 | cfg_if! { 41 | if #[cfg(libc_const_size_of)] { 42 | #[doc(hidden)] 43 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 44 | } else { 45 | #[doc(hidden)] 46 | pub const _ALIGNBYTES: usize = 4 - 1; 47 | } 48 | } 49 | pub const MAP_32BIT: ::c_int = 0x00080000; 50 | pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 51 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_mode: ::mode_t, 7 | pub st_nlink: ::nlink_t, 8 | pub st_uid: ::uid_t, 9 | pub st_gid: ::gid_t, 10 | pub st_rdev: ::dev_t, 11 | pub st_atime: ::time_t, 12 | pub st_atime_nsec: ::c_long, 13 | pub st_mtime: ::time_t, 14 | pub st_mtime_nsec: ::c_long, 15 | pub st_ctime: ::time_t, 16 | pub st_ctime_nsec: ::c_long, 17 | pub st_size: ::off_t, 18 | pub st_blocks: ::blkcnt_t, 19 | pub st_blksize: ::blksize_t, 20 | pub st_flags: ::fflags_t, 21 | pub st_gen: u32, 22 | pub st_lspare: i32, 23 | pub st_birthtime: ::time_t, 24 | pub st_birthtime_nsec: ::c_long, 25 | } 26 | 27 | impl ::Copy for ::stat {} 28 | impl ::Clone for ::stat { 29 | fn clone(&self) -> ::stat { 30 | *self 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_nlink: ::nlink_t, 7 | pub st_mode: ::mode_t, 8 | st_padding0: i16, 9 | pub st_uid: ::uid_t, 10 | pub st_gid: ::gid_t, 11 | st_padding1: i32, 12 | pub st_rdev: ::dev_t, 13 | pub st_atime: ::time_t, 14 | pub st_atime_nsec: ::c_long, 15 | pub st_mtime: ::time_t, 16 | pub st_mtime_nsec: ::c_long, 17 | pub st_ctime: ::time_t, 18 | pub st_ctime_nsec: ::c_long, 19 | pub st_birthtime: ::time_t, 20 | pub st_birthtime_nsec: ::c_long, 21 | pub st_size: ::off_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_blksize: ::blksize_t, 24 | pub st_flags: ::fflags_t, 25 | pub st_gen: u64, 26 | pub st_spare: [u64; 10], 27 | } 28 | 29 | impl ::Copy for ::stat {} 30 | impl ::Clone for ::stat { 31 | fn clone(&self) -> ::stat { 32 | *self 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; 2 | pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; 3 | pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; 4 | pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; 5 | pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; 6 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_nlink: ::nlink_t, 7 | pub st_mode: ::mode_t, 8 | st_padding0: i16, 9 | pub st_uid: ::uid_t, 10 | pub st_gid: ::gid_t, 11 | st_padding1: i32, 12 | pub st_rdev: ::dev_t, 13 | pub st_atime: ::time_t, 14 | pub st_atime_nsec: ::c_long, 15 | pub st_mtime: ::time_t, 16 | pub st_mtime_nsec: ::c_long, 17 | pub st_ctime: ::time_t, 18 | pub st_ctime_nsec: ::c_long, 19 | pub st_birthtime: ::time_t, 20 | pub st_birthtime_nsec: ::c_long, 21 | pub st_size: ::off_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_blksize: ::blksize_t, 24 | pub st_flags: ::fflags_t, 25 | pub st_gen: u64, 26 | pub st_spare: [u64; 10], 27 | } 28 | 29 | impl ::Copy for ::stat {} 30 | impl ::Clone for ::stat { 31 | fn clone(&self) -> ::stat { 32 | *self 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; 2 | pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; 3 | pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; 4 | pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; 5 | pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; 6 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_nlink: ::nlink_t, 7 | pub st_mode: ::mode_t, 8 | st_padding0: i16, 9 | pub st_uid: ::uid_t, 10 | pub st_gid: ::gid_t, 11 | st_padding1: i32, 12 | pub st_rdev: ::dev_t, 13 | pub st_atime: ::time_t, 14 | pub st_atime_nsec: ::c_long, 15 | pub st_mtime: ::time_t, 16 | pub st_mtime_nsec: ::c_long, 17 | pub st_ctime: ::time_t, 18 | pub st_ctime_nsec: ::c_long, 19 | pub st_birthtime: ::time_t, 20 | pub st_birthtime_nsec: ::c_long, 21 | pub st_size: ::off_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_blksize: ::blksize_t, 24 | pub st_flags: ::fflags_t, 25 | pub st_gen: u64, 26 | pub st_spare: [u64; 10], 27 | } 28 | 29 | impl ::Copy for ::stat {} 30 | impl ::Clone for ::stat { 31 | fn clone(&self) -> ::stat { 32 | *self 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; 2 | pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; 3 | pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; 4 | pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; 5 | pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; 6 | pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2; 7 | pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3; 8 | pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1; 9 | pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2; 10 | pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3; 11 | pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000; 12 | pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000; 13 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] 3 | pub struct stat { 4 | pub st_dev: ::dev_t, 5 | pub st_ino: ::ino_t, 6 | pub st_nlink: ::nlink_t, 7 | pub st_mode: ::mode_t, 8 | st_padding0: i16, 9 | pub st_uid: ::uid_t, 10 | pub st_gid: ::gid_t, 11 | st_padding1: i32, 12 | pub st_rdev: ::dev_t, 13 | pub st_atime: ::time_t, 14 | pub st_atime_nsec: ::c_long, 15 | pub st_mtime: ::time_t, 16 | pub st_mtime_nsec: ::c_long, 17 | pub st_ctime: ::time_t, 18 | pub st_ctime_nsec: ::c_long, 19 | pub st_birthtime: ::time_t, 20 | pub st_birthtime_nsec: ::c_long, 21 | pub st_size: ::off_t, 22 | pub st_blocks: ::blkcnt_t, 23 | pub st_blksize: ::blksize_t, 24 | pub st_flags: ::fflags_t, 25 | pub st_gen: u64, 26 | pub st_spare: [u64; 10], 27 | } 28 | 29 | impl ::Copy for ::stat {} 30 | impl ::Clone for ::stat { 31 | fn clone(&self) -> ::stat { 32 | *self 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; 2 | pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; 3 | pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; 4 | pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; 5 | pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; 6 | pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2; 7 | pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3; 8 | pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1; 9 | pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2; 10 | pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3; 11 | pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000; 12 | pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000; 13 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = i32; 5 | pub type time_t = i64; 6 | pub type suseconds_t = i32; 7 | pub type register_t = i32; 8 | 9 | s! { 10 | pub struct stat { 11 | pub st_dev: ::dev_t, 12 | pub st_ino: ::ino_t, 13 | pub st_mode: ::mode_t, 14 | pub st_nlink: ::nlink_t, 15 | pub st_uid: ::uid_t, 16 | pub st_gid: ::gid_t, 17 | pub st_rdev: ::dev_t, 18 | pub st_atime: ::time_t, 19 | pub st_atime_nsec: ::c_long, 20 | pub st_mtime: ::time_t, 21 | pub st_mtime_nsec: ::c_long, 22 | pub st_ctime: ::time_t, 23 | pub st_ctime_nsec: ::c_long, 24 | pub st_size: ::off_t, 25 | pub st_blocks: ::blkcnt_t, 26 | pub st_blksize: ::blksize_t, 27 | pub st_flags: ::fflags_t, 28 | pub st_gen: u32, 29 | pub st_lspare: i32, 30 | pub st_birthtime: ::time_t, 31 | pub st_birthtime_nsec: ::c_long, 32 | } 33 | } 34 | 35 | // should be pub(crate), but that requires Rust 1.18.0 36 | cfg_if! { 37 | if #[cfg(libc_const_size_of)] { 38 | #[doc(hidden)] 39 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 40 | } else { 41 | #[doc(hidden)] 42 | pub const _ALIGNBYTES: usize = 4 - 1; 43 | } 44 | } 45 | 46 | pub const MAP_32BIT: ::c_int = 0x00080000; 47 | pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 48 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type wchar_t = i32; 5 | pub type time_t = i64; 6 | pub type suseconds_t = i64; 7 | pub type register_t = i64; 8 | 9 | s! { 10 | pub struct stat { 11 | pub st_dev: ::dev_t, 12 | pub st_ino: ::ino_t, 13 | pub st_mode: ::mode_t, 14 | pub st_nlink: ::nlink_t, 15 | pub st_uid: ::uid_t, 16 | pub st_gid: ::gid_t, 17 | pub st_rdev: ::dev_t, 18 | pub st_atime: ::time_t, 19 | pub st_atime_nsec: ::c_long, 20 | pub st_mtime: ::time_t, 21 | pub st_mtime_nsec: ::c_long, 22 | pub st_ctime: ::time_t, 23 | pub st_ctime_nsec: ::c_long, 24 | pub st_size: ::off_t, 25 | pub st_blocks: ::blkcnt_t, 26 | pub st_blksize: ::blksize_t, 27 | pub st_flags: ::fflags_t, 28 | pub st_gen: u32, 29 | pub st_lspare: i32, 30 | pub st_birthtime: ::time_t, 31 | pub st_birthtime_nsec: ::c_long, 32 | } 33 | } 34 | 35 | // should be pub(crate), but that requires Rust 1.18.0 36 | cfg_if! { 37 | if #[cfg(libc_const_size_of)] { 38 | #[doc(hidden)] 39 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 40 | } else { 41 | #[doc(hidden)] 42 | pub const _ALIGNBYTES: usize = 8 - 1; 43 | } 44 | } 45 | 46 | pub const MAP_32BIT: ::c_int = 0x00080000; 47 | pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 48 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | pub type c_char = i8; 6 | pub type __cpu_simple_lock_nv_t = ::c_int; 7 | 8 | cfg_if! { 9 | if #[cfg(libc_const_size_of)] { 10 | #[doc(hidden)] 11 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; 12 | } else { 13 | #[doc(hidden)] 14 | pub const _ALIGNBYTES: usize = 8 - 1; 15 | } 16 | } 17 | 18 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 19 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 20 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; 21 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; 22 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | pub type c_char = u8; 6 | pub type __cpu_simple_lock_nv_t = ::c_int; 7 | 8 | // should be pub(crate), but that requires Rust 1.18.0 9 | cfg_if! { 10 | if #[cfg(libc_const_size_of)] { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; 13 | } else { 14 | #[doc(hidden)] 15 | pub const _ALIGNBYTES: usize = 8 - 1; 16 | } 17 | } 18 | 19 | pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; 20 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; 21 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; 22 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs: -------------------------------------------------------------------------------- 1 | use PT_FIRSTMACH; 2 | 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | pub type c_char = u8; 6 | pub type __cpu_simple_lock_nv_t = ::c_int; 7 | 8 | cfg_if! { 9 | if #[cfg(libc_const_size_of)] { 10 | #[doc(hidden)] 11 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 12 | } else { 13 | #[doc(hidden)] 14 | pub const _ALIGNBYTES: usize = 8 - 1; 15 | } 16 | } 17 | 18 | pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0; 19 | pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1; 20 | pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2; 21 | pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3; 22 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | #[doc(hidden)] 8 | pub const _ALIGNBYTES: usize = 0xf; 9 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | cfg_if! { 8 | if #[cfg(libc_const_size_of)] { 9 | #[doc(hidden)] 10 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 11 | } else { 12 | #[doc(hidden)] 13 | pub const _ALIGNBYTES: usize = 4 - 1; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = u8; 4 | pub type ucontext_t = sigcontext; 5 | 6 | s! { 7 | pub struct sigcontext { 8 | __sc_unused: ::c_int, 9 | pub sc_mask: ::c_int, 10 | pub sc_sp: ::c_ulong, 11 | pub sc_lr: ::c_ulong, 12 | pub sc_elr: ::c_ulong, 13 | pub sc_spsr: ::c_ulong, 14 | pub sc_x: [::c_ulong; 30], 15 | pub sc_cookie: ::c_long, 16 | } 17 | } 18 | 19 | // should be pub(crate), but that requires Rust 1.18.0 20 | cfg_if! { 21 | if #[cfg(libc_const_size_of)] { 22 | #[doc(hidden)] 23 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 24 | } else { 25 | #[doc(hidden)] 26 | pub const _ALIGNBYTES: usize = 8 - 1; 27 | } 28 | } 29 | 30 | pub const _MAX_PAGE_SHIFT: u32 = 12; 31 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = u8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 8 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | 5 | #[doc(hidden)] 6 | pub const _ALIGNBYTES: usize = 7; 7 | 8 | pub const _MAX_PAGE_SHIFT: u32 = 14; 9 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = u8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 8 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = u8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 8 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = u8; 4 | pub type ucontext_t = sigcontext; 5 | 6 | s! { 7 | pub struct sigcontext { 8 | __sc_unused: ::c_int, 9 | pub sc_mask: ::c_int, 10 | pub sc_ra: ::c_long, 11 | pub sc_sp: ::c_long, 12 | pub sc_gp: ::c_long, 13 | pub sc_tp: ::c_long, 14 | pub sc_t: [::c_long; 7], 15 | pub sc_s: [::c_long; 12], 16 | pub sc_a: [::c_long; 8], 17 | pub sc_sepc: ::c_long, 18 | pub sc_f: [::c_long; 32], 19 | pub sc_fcsr: ::c_long, 20 | pub sc_cookie: ::c_long, 21 | } 22 | } 23 | 24 | // should be pub(crate), but that requires Rust 1.18.0 25 | cfg_if! { 26 | if #[cfg(libc_const_size_of)] { 27 | #[doc(hidden)] 28 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 29 | } else { 30 | #[doc(hidden)] 31 | pub const _ALIGNBYTES: usize = 8 - 1; 32 | } 33 | } 34 | 35 | pub const _MAX_PAGE_SHIFT: u32 = 12; 36 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | 5 | #[doc(hidden)] 6 | pub const _ALIGNBYTES: usize = 0xf; 7 | 8 | pub const _MAX_PAGE_SHIFT: u32 = 13; 9 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 4 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/haiku/b32.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type time_t = i32; 4 | 5 | pub type Elf_Addr = ::Elf32_Addr; 6 | pub type Elf_Half = ::Elf32_Half; 7 | pub type Elf_Phdr = ::Elf32_Phdr; 8 | 9 | s! { 10 | pub struct Elf32_Phdr { 11 | pub p_type: ::Elf32_Word, 12 | pub p_offset: ::Elf32_Off, 13 | pub p_vaddr: ::Elf32_Addr, 14 | pub p_paddr: ::Elf32_Addr, 15 | pub p_filesz: ::Elf32_Word, 16 | pub p_memsz: ::Elf32_Word, 17 | pub p_flags: ::Elf32_Word, 18 | pub p_align: ::Elf32_Word, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/haiku/b64.rs: -------------------------------------------------------------------------------- 1 | pub type c_ulong = u64; 2 | pub type c_long = i64; 3 | pub type time_t = i64; 4 | 5 | pub type Elf_Addr = ::Elf64_Addr; 6 | pub type Elf_Half = ::Elf64_Half; 7 | pub type Elf_Phdr = ::Elf64_Phdr; 8 | 9 | s! { 10 | pub struct Elf64_Phdr { 11 | pub p_type: ::Elf64_Word, 12 | pub p_flags: ::Elf64_Word, 13 | pub p_offset: ::Elf64_Off, 14 | pub p_vaddr: ::Elf64_Addr, 15 | pub p_paddr: ::Elf64_Addr, 16 | pub p_filesz: ::Elf64_Xword, 17 | pub p_memsz: ::Elf64_Xword, 18 | pub p_align: ::Elf64_Xword, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/hurd/align.rs: -------------------------------------------------------------------------------- 1 | // Placeholder file 2 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/hurd/no_align.rs: -------------------------------------------------------------------------------- 1 | // Placeholder file 2 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | 9 | s! { 10 | pub struct ucontext_t { 11 | pub uc_flags: ::c_ulong, 12 | pub uc_link: *mut ucontext_t, 13 | pub uc_stack: ::stack_t, 14 | pub uc_sigmask: ::sigset_t, 15 | pub uc_mcontext: mcontext_t, 16 | } 17 | 18 | #[repr(align(16))] 19 | pub struct mcontext_t { 20 | pub fault_address: ::c_ulonglong, 21 | pub regs: [::c_ulonglong; 31], 22 | pub sp: ::c_ulonglong, 23 | pub pc: ::c_ulonglong, 24 | pub pstate: ::c_ulonglong, 25 | // nested arrays to get the right size/length while being able to 26 | // auto-derive traits like Debug 27 | __reserved: [[u64; 32]; 16], 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct user_fpsimd_struct { 3 | pub vregs: [::__uint128_t; 32], 4 | pub fpsr: u32, 5 | pub fpcr: u32, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/arch/mod.rs: -------------------------------------------------------------------------------- 1 | cfg_if! { 2 | if #[cfg(any(target_arch = "mips", 3 | target_arch = "mips32r6", 4 | target_arch = "mips64", 5 | target_arch = "mips64r6"))] { 6 | mod mips; 7 | pub use self::mips::*; 8 | } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] { 9 | mod powerpc; 10 | pub use self::powerpc::*; 11 | } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { 12 | mod sparc; 13 | pub use self::sparc::*; 14 | } else { 15 | mod generic; 16 | pub use self::generic::*; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 2] 6 | } 7 | 8 | #[allow(missing_debug_implementations)] 9 | #[repr(align(8))] 10 | pub struct ucontext_t { 11 | pub uc_flags: ::c_ulong, 12 | pub uc_link: *mut ucontext_t, 13 | pub uc_stack: ::stack_t, 14 | pub uc_mcontext: ::mcontext_t, 15 | pub uc_sigmask: ::sigset_t, 16 | pub uc_regspace: [::c_ulong; 128], 17 | } 18 | } 19 | 20 | cfg_if! { 21 | if #[cfg(feature = "extra_traits")] { 22 | impl PartialEq for ucontext_t { 23 | fn eq(&self, other: &ucontext_t) -> bool { 24 | self.uc_flags == other.uc_flags 25 | && self.uc_link == other.uc_link 26 | && self.uc_stack == other.uc_stack 27 | && self.uc_mcontext == other.uc_mcontext 28 | && self.uc_sigmask == other.uc_sigmask 29 | } 30 | } 31 | impl Eq for ucontext_t {} 32 | impl ::fmt::Debug for ucontext_t { 33 | fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 34 | f.debug_struct("ucontext_t") 35 | .field("uc_flags", &self.uc_link) 36 | .field("uc_link", &self.uc_link) 37 | .field("uc_stack", &self.uc_stack) 38 | .field("uc_mcontext", &self.uc_mcontext) 39 | .field("uc_sigmask", &self.uc_sigmask) 40 | .finish() 41 | } 42 | } 43 | impl ::hash::Hash for ucontext_t { 44 | fn hash(&self, state: &mut H) { 45 | self.uc_flags.hash(state); 46 | self.uc_link.hash(state); 47 | self.uc_stack.hash(state); 48 | self.uc_mcontext.hash(state); 49 | self.uc_sigmask.hash(state); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(2))] 4 | pub struct max_align_t { 5 | priv_: [i8; 20] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | pub struct ucontext_t { 4 | pub __uc_flags: ::c_ulong, 5 | pub uc_link: *mut ucontext_t, 6 | pub uc_stack: ::stack_t, 7 | pub uc_sigmask: ::sigset_t, 8 | pub uc_mcontext: mcontext_t, 9 | } 10 | 11 | #[allow(missing_debug_implementations)] 12 | #[repr(align(16))] 13 | pub struct mcontext_t { 14 | pub __gregs: [::c_ulong; 32], 15 | pub __fpregs: __riscv_mc_fp_state, 16 | } 17 | 18 | #[allow(missing_debug_implementations)] 19 | pub union __riscv_mc_fp_state { 20 | pub __f: __riscv_mc_f_ext_state, 21 | pub __d: __riscv_mc_d_ext_state, 22 | pub __q: __riscv_mc_q_ext_state, 23 | } 24 | 25 | #[allow(missing_debug_implementations)] 26 | pub struct __riscv_mc_f_ext_state { 27 | pub __f: [::c_uint; 32], 28 | pub __fcsr: ::c_uint, 29 | } 30 | 31 | #[allow(missing_debug_implementations)] 32 | pub struct __riscv_mc_d_ext_state { 33 | pub __f: [::c_ulonglong; 32], 34 | pub __fcsr: ::c_uint, 35 | } 36 | 37 | #[allow(missing_debug_implementations)] 38 | #[repr(align(16))] 39 | pub struct __riscv_mc_q_ext_state { 40 | pub __f: [::c_ulonglong; 64], 41 | pub __fcsr: ::c_uint, 42 | pub __glibc_reserved: [::c_uint; 3], 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 6] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | 9 | s! { 10 | pub struct ucontext_t { 11 | pub uc_flags: ::c_ulong, 12 | pub uc_link: *mut ucontext_t, 13 | pub uc_stack: ::stack_t, 14 | pub uc_sigmask: ::sigset_t, 15 | pub uc_mcontext: mcontext_t, 16 | } 17 | 18 | #[repr(align(16))] 19 | pub struct mcontext_t { 20 | pub fault_address: ::c_ulonglong, 21 | pub regs: [::c_ulonglong; 31], 22 | pub sp: ::c_ulonglong, 23 | pub pc: ::c_ulonglong, 24 | pub pstate: ::c_ulonglong, 25 | // nested arrays to get the right size/length while being able to 26 | // auto-derive traits like Debug 27 | __reserved: [[u64; 32]; 16], 28 | } 29 | 30 | #[repr(align(8))] 31 | pub struct clone_args { 32 | pub flags: ::c_ulonglong, 33 | pub pidfd: ::c_ulonglong, 34 | pub child_tid: ::c_ulonglong, 35 | pub parent_tid: ::c_ulonglong, 36 | pub exit_signal: ::c_ulonglong, 37 | pub stack: ::c_ulonglong, 38 | pub stack_size: ::c_ulonglong, 39 | pub tls: ::c_ulonglong, 40 | pub set_tid: ::c_ulonglong, 41 | pub set_tid_size: ::c_ulonglong, 42 | pub cgroup: ::c_ulonglong, 43 | } 44 | } 45 | 46 | extern "C" { 47 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; 48 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; 49 | pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); 50 | pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; 51 | } 52 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | #[repr(align(16))] 3 | pub struct user_fpsimd_struct { 4 | pub vregs: [[u64; 2]; 32], 5 | pub fpsr: ::c_uint, 6 | pub fpcr: ::c_uint, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct user_fpsimd_struct { 3 | pub vregs: [::__uint128_t; 32], 4 | pub fpsr: u32, 5 | pub fpcr: u32, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | 9 | s! { 10 | pub struct ucontext_t { 11 | pub uc_flags: ::c_ulong, 12 | pub uc_link: *mut ucontext_t, 13 | pub uc_stack: ::stack_t, 14 | pub uc_sigmask: ::sigset_t, 15 | pub uc_mcontext: mcontext_t, 16 | } 17 | 18 | #[repr(align(16))] 19 | pub struct mcontext_t { 20 | pub __pc: ::c_ulonglong, 21 | pub __gregs: [::c_ulonglong; 32], 22 | pub __flags: ::c_uint, 23 | pub __extcontext: [::c_ulonglong; 0], 24 | } 25 | 26 | #[repr(align(8))] 27 | pub struct clone_args { 28 | pub flags: ::c_ulonglong, 29 | pub pidfd: ::c_ulonglong, 30 | pub child_tid: ::c_ulonglong, 31 | pub parent_tid: ::c_ulonglong, 32 | pub exit_signal: ::c_ulonglong, 33 | pub stack: ::c_ulonglong, 34 | pub stack_size: ::c_ulonglong, 35 | pub tls: ::c_ulonglong, 36 | pub set_tid: ::c_ulonglong, 37 | pub set_tid_size: ::c_ulonglong, 38 | pub cgroup: ::c_ulonglong, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | pub struct ucontext_t { 4 | pub __uc_flags: ::c_ulong, 5 | pub uc_link: *mut ucontext_t, 6 | pub uc_stack: ::stack_t, 7 | pub uc_sigmask: ::sigset_t, 8 | pub uc_mcontext: mcontext_t, 9 | } 10 | 11 | #[allow(missing_debug_implementations)] 12 | #[repr(align(16))] 13 | pub struct mcontext_t { 14 | pub __gregs: [::c_ulong; 32], 15 | pub __fpregs: __riscv_mc_fp_state, 16 | } 17 | 18 | #[allow(missing_debug_implementations)] 19 | pub union __riscv_mc_fp_state { 20 | pub __f: __riscv_mc_f_ext_state, 21 | pub __d: __riscv_mc_d_ext_state, 22 | pub __q: __riscv_mc_q_ext_state, 23 | } 24 | 25 | #[allow(missing_debug_implementations)] 26 | pub struct __riscv_mc_f_ext_state { 27 | pub __f: [::c_uint; 32], 28 | pub __fcsr: ::c_uint, 29 | } 30 | 31 | #[allow(missing_debug_implementations)] 32 | pub struct __riscv_mc_d_ext_state { 33 | pub __f: [::c_ulonglong; 32], 34 | pub __fcsr: ::c_uint, 35 | } 36 | 37 | #[allow(missing_debug_implementations)] 38 | #[repr(align(16))] 39 | pub struct __riscv_mc_q_ext_state { 40 | pub __f: [::c_ulonglong; 64], 41 | pub __fcsr: ::c_uint, 42 | pub __glibc_reserved: [::c_uint; 3], 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | 9 | s! { 10 | #[repr(align(8))] 11 | pub struct clone_args { 12 | pub flags: ::c_ulonglong, 13 | pub pidfd: ::c_ulonglong, 14 | pub child_tid: ::c_ulonglong, 15 | pub parent_tid: ::c_ulonglong, 16 | pub exit_signal: ::c_ulonglong, 17 | pub stack: ::c_ulonglong, 18 | pub stack_size: ::c_ulonglong, 19 | pub tls: ::c_ulonglong, 20 | pub set_tid: ::c_ulonglong, 21 | pub set_tid_size: ::c_ulonglong, 22 | pub cgroup: ::c_ulonglong, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: (i64, i64) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type nlink_t = u32; 4 | pub type blksize_t = ::c_long; 5 | pub type __u64 = ::c_ulonglong; 6 | pub type __s64 = ::c_longlong; 7 | pub type regoff_t = ::c_int; 8 | 9 | s! { 10 | pub struct pthread_attr_t { 11 | __size: [u32; 9] 12 | } 13 | 14 | pub struct sigset_t { 15 | __val: [::c_ulong; 32], 16 | } 17 | 18 | pub struct msghdr { 19 | pub msg_name: *mut ::c_void, 20 | pub msg_namelen: ::socklen_t, 21 | pub msg_iov: *mut ::iovec, 22 | pub msg_iovlen: ::c_int, 23 | pub msg_control: *mut ::c_void, 24 | pub msg_controllen: ::socklen_t, 25 | pub msg_flags: ::c_int, 26 | } 27 | 28 | pub struct cmsghdr { 29 | pub cmsg_len: ::socklen_t, 30 | pub cmsg_level: ::c_int, 31 | pub cmsg_type: ::c_int, 32 | } 33 | 34 | pub struct sem_t { 35 | __val: [::c_int; 4], 36 | } 37 | } 38 | 39 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; 40 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; 41 | pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; 42 | 43 | cfg_if! { 44 | if #[cfg(any(target_arch = "x86"))] { 45 | mod x86; 46 | pub use self::x86::*; 47 | } else if #[cfg(any(target_arch = "mips"))] { 48 | mod mips; 49 | pub use self::mips::*; 50 | } else if #[cfg(any(target_arch = "arm"))] { 51 | mod arm; 52 | pub use self::arm::*; 53 | } else if #[cfg(any(target_arch = "powerpc"))] { 54 | mod powerpc; 55 | pub use self::powerpc::*; 56 | } else if #[cfg(any(target_arch = "hexagon"))] { 57 | mod hexagon; 58 | pub use self::hexagon::*; 59 | } else if #[cfg(any(target_arch = "riscv32"))] { 60 | mod riscv32; 61 | pub use self::riscv32::*; 62 | } else { 63 | // Unknown target_arch 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: (i64, f64) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | 9 | s! { 10 | pub struct ucontext_t { 11 | pub uc_flags: ::c_ulong, 12 | pub uc_link: *mut ucontext_t, 13 | pub uc_stack: ::stack_t, 14 | pub uc_sigmask: ::sigset_t, 15 | pub uc_mcontext: mcontext_t, 16 | } 17 | 18 | #[repr(align(16))] 19 | pub struct mcontext_t { 20 | pub fault_address: ::c_ulong, 21 | pub regs: [::c_ulong; 31], 22 | pub sp: ::c_ulong, 23 | pub pc: ::c_ulong, 24 | pub pstate: ::c_ulong, 25 | __reserved: [[u64; 32]; 16], 26 | } 27 | 28 | #[repr(align(8))] 29 | pub struct clone_args { 30 | pub flags: ::c_ulonglong, 31 | pub pidfd: ::c_ulonglong, 32 | pub child_tid: ::c_ulonglong, 33 | pub parent_tid: ::c_ulonglong, 34 | pub exit_signal: ::c_ulonglong, 35 | pub stack: ::c_ulonglong, 36 | pub stack_size: ::c_ulonglong, 37 | pub tls: ::c_ulonglong, 38 | pub set_tid: ::c_ulonglong, 39 | pub set_tid_size: ::c_ulonglong, 40 | pub cgroup: ::c_ulonglong, 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct user_fpsimd_struct { 3 | pub vregs: [::__uint128_t; 32], 4 | pub fpsr: u32, 5 | pub fpcr: u32, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | pub struct ucontext_t { 4 | pub __uc_flags: ::c_ulong, 5 | pub uc_link: *mut ucontext_t, 6 | pub uc_stack: ::stack_t, 7 | pub uc_sigmask: ::sigset_t, 8 | pub uc_mcontext: mcontext_t, 9 | } 10 | 11 | #[allow(missing_debug_implementations)] 12 | #[repr(align(16))] 13 | pub struct mcontext_t { 14 | pub __gregs: [::c_ulong; 32], 15 | pub __fpregs: __riscv_mc_fp_state, 16 | } 17 | 18 | #[allow(missing_debug_implementations)] 19 | pub union __riscv_mc_fp_state { 20 | pub __f: __riscv_mc_f_ext_state, 21 | pub __d: __riscv_mc_d_ext_state, 22 | pub __q: __riscv_mc_q_ext_state, 23 | } 24 | 25 | #[allow(missing_debug_implementations)] 26 | pub struct __riscv_mc_f_ext_state { 27 | pub __f: [::c_uint; 32], 28 | pub __fcsr: ::c_uint, 29 | } 30 | 31 | #[allow(missing_debug_implementations)] 32 | pub struct __riscv_mc_d_ext_state { 33 | pub __f: [::c_ulonglong; 32], 34 | pub __fcsr: ::c_uint, 35 | } 36 | 37 | #[allow(missing_debug_implementations)] 38 | #[repr(align(16))] 39 | pub struct __riscv_mc_q_ext_state { 40 | pub __f: [::c_ulonglong; 64], 41 | pub __fcsr: ::c_uint, 42 | pub __glibc_reserved: [::c_uint; 3], 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | 8 | } 9 | 10 | s! { 11 | #[repr(align(8))] 12 | pub struct clone_args { 13 | pub flags: ::c_ulonglong, 14 | pub pidfd: ::c_ulonglong, 15 | pub child_tid: ::c_ulonglong, 16 | pub parent_tid: ::c_ulonglong, 17 | pub exit_signal: ::c_ulonglong, 18 | pub stack: ::c_ulonglong, 19 | pub stack_size: ::c_ulonglong, 20 | pub tls: ::c_ulonglong, 21 | pub set_tid: ::c_ulonglong, 22 | pub set_tid_size: ::c_ulonglong, 23 | pub cgroup: ::c_ulonglong, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // linux/openat2.h 3 | #[non_exhaustive] 4 | pub struct open_how { 5 | pub flags: ::__u64, 6 | pub mode: ::__u64, 7 | pub resolve: ::__u64, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/align.rs: -------------------------------------------------------------------------------- 1 | macro_rules! expand_align { 2 | () => { 3 | s! { 4 | #[cfg_attr(any(target_pointer_width = "32", 5 | target_arch = "x86_64", 6 | target_arch = "powerpc64", 7 | target_arch = "mips64", 8 | target_arch = "s390x", 9 | target_arch = "sparc64"), 10 | repr(align(4)))] 11 | #[cfg_attr(not(any(target_pointer_width = "32", 12 | target_arch = "x86_64", 13 | target_arch = "powerpc64", 14 | target_arch = "mips64", 15 | target_arch = "s390x", 16 | target_arch = "sparc64")), 17 | repr(align(8)))] 18 | pub struct pthread_mutexattr_t { 19 | size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], 20 | } 21 | 22 | #[repr(align(4))] 23 | pub struct pthread_condattr_t { 24 | size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], 25 | } 26 | } 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | __size: [::c_char; 32], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | __size: [::c_char; 32], 5 | __align: [::c_long; 0], 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs: -------------------------------------------------------------------------------- 1 | // Thestyle checker discourages the use of #[cfg], so this has to go into a 2 | // separate module 3 | pub type pthread_t = ::c_ulong; 4 | 5 | pub const PTHREAD_STACK_MIN: usize = 16384; 6 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/aarch64/mod.rs: -------------------------------------------------------------------------------- 1 | pub type clock_t = ::c_long; 2 | pub type c_char = u8; 3 | pub type wchar_t = u32; 4 | 5 | pub type c_long = i64; 6 | pub type c_ulong = u64; 7 | 8 | s! { 9 | pub struct sockaddr { 10 | pub sa_len: u8, 11 | pub sa_family: ::sa_family_t, 12 | pub sa_data: [::c_char; 14], 13 | } 14 | 15 | pub struct sockaddr_in6 { 16 | pub sin6_len: u8, 17 | pub sin6_family: ::sa_family_t, 18 | pub sin6_port: ::in_port_t, 19 | pub sin6_flowinfo: u32, 20 | pub sin6_addr: ::in6_addr, 21 | pub sin6_scope_id: u32, 22 | } 23 | 24 | pub struct sockaddr_in { 25 | pub sin_len: u8, 26 | pub sin_family: ::sa_family_t, 27 | pub sin_port: ::in_port_t, 28 | pub sin_addr: ::in_addr, 29 | pub sin_zero: [::c_char; 8], 30 | } 31 | } 32 | 33 | pub const AF_INET6: ::c_int = 23; 34 | 35 | pub const FIONBIO: ::c_ulong = 1; 36 | 37 | pub const POLLIN: ::c_short = 0x1; 38 | pub const POLLPRI: ::c_short = 0x2; 39 | pub const POLLOUT: ::c_short = 0x4; 40 | pub const POLLERR: ::c_short = 0x8; 41 | pub const POLLHUP: ::c_short = 0x10; 42 | pub const POLLNVAL: ::c_short = 0x20; 43 | 44 | pub const SOL_SOCKET: ::c_int = 65535; 45 | 46 | pub const MSG_OOB: ::c_int = 1; 47 | pub const MSG_PEEK: ::c_int = 2; 48 | pub const MSG_DONTWAIT: ::c_int = 4; 49 | pub const MSG_DONTROUTE: ::c_int = 0; 50 | pub const MSG_WAITALL: ::c_int = 0; 51 | pub const MSG_MORE: ::c_int = 0; 52 | pub const MSG_NOSIGNAL: ::c_int = 0; 53 | 54 | pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; 55 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/arm/mod.rs: -------------------------------------------------------------------------------- 1 | pub type clock_t = ::c_long; 2 | pub type c_char = u8; 3 | pub type wchar_t = u32; 4 | 5 | pub type c_long = i32; 6 | pub type c_ulong = u32; 7 | 8 | s! { 9 | pub struct sockaddr { 10 | pub sa_family: ::sa_family_t, 11 | pub sa_data: [::c_char; 14], 12 | } 13 | 14 | pub struct sockaddr_in6 { 15 | pub sin6_family: ::sa_family_t, 16 | pub sin6_port: ::in_port_t, 17 | pub sin6_flowinfo: u32, 18 | pub sin6_addr: ::in6_addr, 19 | pub sin6_scope_id: u32, 20 | } 21 | 22 | pub struct sockaddr_in { 23 | pub sin_family: ::sa_family_t, 24 | pub sin_port: ::in_port_t, 25 | pub sin_addr: ::in_addr, 26 | pub sin_zero: [u8; 8], 27 | } 28 | 29 | pub struct sockaddr_storage { 30 | pub ss_family: ::sa_family_t, 31 | pub __ss_padding: [u8; 26], 32 | } 33 | } 34 | 35 | pub const AF_INET6: ::c_int = 23; 36 | 37 | pub const FIONBIO: ::c_ulong = 1; 38 | 39 | pub const POLLIN: ::c_short = 0x1; 40 | pub const POLLPRI: ::c_short = 0x2; 41 | pub const POLLHUP: ::c_short = 0x4; 42 | pub const POLLERR: ::c_short = 0x8; 43 | pub const POLLOUT: ::c_short = 0x10; 44 | pub const POLLNVAL: ::c_short = 0x20; 45 | 46 | pub const SOL_SOCKET: ::c_int = 65535; 47 | 48 | pub const MSG_OOB: ::c_int = 1; 49 | pub const MSG_PEEK: ::c_int = 2; 50 | pub const MSG_DONTWAIT: ::c_int = 4; 51 | pub const MSG_DONTROUTE: ::c_int = 0; 52 | pub const MSG_WAITALL: ::c_int = 0; 53 | pub const MSG_MORE: ::c_int = 0; 54 | pub const MSG_NOSIGNAL: ::c_int = 0; 55 | 56 | pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; 57 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/generic.rs: -------------------------------------------------------------------------------- 1 | //! Common types used by most newlib platforms 2 | 3 | s! { 4 | pub struct sigset_t { 5 | __val: [::c_ulong; 16], 6 | } 7 | 8 | pub struct stat { 9 | pub st_dev: ::dev_t, 10 | pub st_ino: ::ino_t, 11 | pub st_mode: ::mode_t, 12 | pub st_nlink: ::nlink_t, 13 | pub st_uid: ::uid_t, 14 | pub st_gid: ::gid_t, 15 | pub st_rdev: ::dev_t, 16 | pub st_size: ::off_t, 17 | pub st_atime: ::time_t, 18 | pub st_spare1: ::c_long, 19 | pub st_mtime: ::time_t, 20 | pub st_spare2: ::c_long, 21 | pub st_ctime: ::time_t, 22 | pub st_spare3: ::c_long, 23 | pub st_blksize: ::blksize_t, 24 | pub st_blocks: ::blkcnt_t, 25 | pub st_spare4: [::c_long; 2usize], 26 | } 27 | 28 | pub struct dirent { 29 | pub d_ino: ::ino_t, 30 | pub d_type: ::c_uchar, 31 | pub d_name: [::c_char; 256usize], 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/newlib/powerpc/mod.rs: -------------------------------------------------------------------------------- 1 | pub type clock_t = ::c_ulong; 2 | pub type c_char = u8; 3 | pub type wchar_t = ::c_int; 4 | 5 | pub type c_long = i32; 6 | pub type c_ulong = u32; 7 | 8 | pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; 9 | 10 | // the newlib shipped with devkitPPC does not support the following components: 11 | // - sockaddr 12 | // - AF_INET6 13 | // - FIONBIO 14 | // - POLL* 15 | // - SOL_SOCKET 16 | // - MSG_* 17 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct in6_addr { 3 | pub s6_addr: [u8; 16], 4 | __align: [u32; 0], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/nto/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | pub type time_t = i64; 6 | 7 | s! { 8 | pub struct aarch64_qreg_t { 9 | pub qlo: u64, 10 | pub qhi: u64, 11 | } 12 | 13 | pub struct aarch64_fpu_registers { 14 | pub reg: [::aarch64_qreg_t; 32], 15 | pub fpsr: u32, 16 | pub fpcr: u32, 17 | } 18 | 19 | pub struct aarch64_cpu_registers { 20 | pub gpr: [u64; 32], 21 | pub elr: u64, 22 | pub pstate: u64, 23 | } 24 | 25 | #[repr(align(16))] 26 | pub struct mcontext_t { 27 | pub cpu: ::aarch64_cpu_registers, 28 | pub fpu: ::aarch64_fpu_registers, 29 | } 30 | 31 | pub struct stack_t { 32 | pub ss_sp: *mut ::c_void, 33 | pub ss_size: ::size_t, 34 | pub ss_flags: ::c_int, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/libc/src/unix/solarish/x86.rs: -------------------------------------------------------------------------------- 1 | pub type Elf32_Addr = ::c_ulong; 2 | pub type Elf32_Half = ::c_ushort; 3 | pub type Elf32_Off = ::c_ulong; 4 | pub type Elf32_Sword = ::c_long; 5 | pub type Elf32_Word = ::c_ulong; 6 | pub type Elf32_Lword = ::c_ulonglong; 7 | pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr; 8 | 9 | s! { 10 | pub struct __c_anonymous_Elf32_Phdr { 11 | pub p_type: ::Elf32_Word, 12 | pub p_offset: ::Elf32_Off, 13 | pub p_vaddr: ::Elf32_Addr, 14 | pub p_paddr: ::Elf32_Addr, 15 | pub p_filesz: ::Elf32_Word, 16 | pub p_memsz: ::Elf32_Word, 17 | pub p_flags: ::Elf32_Word, 18 | pub p_align: ::Elf32_Word, 19 | } 20 | 21 | pub struct dl_phdr_info { 22 | pub dlpi_addr: ::Elf32_Addr, 23 | pub dlpi_name: *const ::c_char, 24 | pub dlpi_phdr: *const ::Elf32_Phdr, 25 | pub dlpi_phnum: ::Elf32_Half, 26 | pub dlpi_adds: ::c_ulonglong, 27 | pub dlpi_subs: ::c_ulonglong, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/powerpc.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/vxworks/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/gnu/align.rs: -------------------------------------------------------------------------------- 1 | cfg_if! { 2 | if #[cfg(target_pointer_width = "64")] { 3 | s_no_extra_traits! { 4 | #[allow(missing_debug_implementations)] 5 | #[repr(align(16))] 6 | pub struct max_align_t { 7 | priv_: [f64; 4] 8 | } 9 | } 10 | } else if #[cfg(target_pointer_width = "32")] { 11 | s_no_extra_traits! { 12 | #[allow(missing_debug_implementations)] 13 | #[repr(align(16))] 14 | pub struct max_align_t { 15 | priv_: [i64; 6] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/gnu/mod.rs: -------------------------------------------------------------------------------- 1 | pub const L_tmpnam: ::c_uint = 14; 2 | pub const TMP_MAX: ::c_uint = 0x7fff; 3 | 4 | // stdio file descriptor numbers 5 | pub const STDIN_FILENO: ::c_int = 0; 6 | pub const STDOUT_FILENO: ::c_int = 1; 7 | pub const STDERR_FILENO: ::c_int = 2; 8 | 9 | extern "C" { 10 | pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; 11 | pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int; 12 | 13 | // NOTE: For MSVC target, `wmemchr` is only a inline function in `` 14 | // header file. We cannot find a way to link to that symbol from Rust. 15 | pub fn wmemchr(cx: *const ::wchar_t, c: ::wchar_t, n: ::size_t) -> *mut ::wchar_t; 16 | } 17 | 18 | cfg_if! { 19 | if #[cfg(libc_align)] { 20 | mod align; 21 | pub use self::align::*; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/libc/src/windows/msvc/mod.rs: -------------------------------------------------------------------------------- 1 | pub const L_tmpnam: ::c_uint = 260; 2 | pub const TMP_MAX: ::c_uint = 0x7fff_ffff; 3 | 4 | // POSIX Supplement (from errno.h) 5 | // This particular error code is only currently available in msvc toolchain 6 | pub const EOTHER: ::c_int = 131; 7 | 8 | extern "C" { 9 | #[link_name = "_stricmp"] 10 | pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; 11 | #[link_name = "_strnicmp"] 12 | pub fn strnicmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int; 13 | #[link_name = "_memccpy"] 14 | pub fn memccpy( 15 | dest: *mut ::c_void, 16 | src: *const ::c_void, 17 | c: ::c_int, 18 | count: ::size_t, 19 | ) -> *mut ::c_void; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/libc/src/xous.rs: -------------------------------------------------------------------------------- 1 | //! Xous C type definitions 2 | 3 | pub type c_schar = i8; 4 | pub type c_uchar = u8; 5 | pub type c_short = i16; 6 | pub type c_ushort = u16; 7 | pub type c_int = i32; 8 | pub type c_uint = u32; 9 | pub type c_float = f32; 10 | pub type c_double = f64; 11 | pub type c_longlong = i64; 12 | pub type c_ulonglong = u64; 13 | pub type intmax_t = i64; 14 | pub type uintmax_t = u64; 15 | 16 | pub type size_t = usize; 17 | pub type ptrdiff_t = isize; 18 | pub type intptr_t = isize; 19 | pub type uintptr_t = usize; 20 | pub type ssize_t = isize; 21 | 22 | pub type off_t = i64; 23 | pub type c_char = u8; 24 | pub type c_long = i64; 25 | pub type c_ulong = u64; 26 | pub type wchar_t = u32; 27 | 28 | pub const INT_MIN: c_int = -2147483648; 29 | pub const INT_MAX: c_int = 2147483647; 30 | 31 | cfg_if! { 32 | if #[cfg(libc_core_cvoid)] { 33 | pub use ::ffi::c_void; 34 | } else { 35 | // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 36 | // enable more optimization opportunities around it recognizing things 37 | // like malloc/free. 38 | #[repr(u8)] 39 | #[allow(missing_copy_implementations)] 40 | #[allow(missing_debug_implementations)] 41 | pub enum c_void { 42 | // Two dummy variants so the #[repr] attribute can be used. 43 | #[doc(hidden)] 44 | __variant1, 45 | #[doc(hidden)] 46 | __variant2, 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/libc/tests/const_fn.rs: -------------------------------------------------------------------------------- 1 | #![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty 2 | 3 | #[cfg(target_os = "linux")] 4 | const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; 5 | //^ if CMSG_SPACE is not const, this will fail to compile 6 | -------------------------------------------------------------------------------- /vendor/p9_wire_format_derive/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"bb71ab1bfe1d15059b4a998ab551445103cdb6abf509a84b4392863e25e0a677","LICENSE":"c1d1dea1a52ff09809c990efd95cbcd0dd98f9bd52a58d5c09cfbac218e32511","README.md":"84b912a21e219377520d8095fb167e2d9578df9e23b62e0d9dfeec21ea127d18","src/lib.rs":"9ddf8861bd1a0ecd5d87f600c781b98326b897490a8724c712ac3189562a81d9"},"package":"e6085210d8ec9bcbdf38b5c8e97bccef1877f3f291eae48b65388ca979f5314e"} -------------------------------------------------------------------------------- /vendor/p9_wire_format_derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | name = "p9_wire_format_derive" 14 | version = "0.2.3" 15 | authors = ["The ChromiumOS Authors"] 16 | description = "Supporting proc-macro for the `p9` crate." 17 | readme = "README.md" 18 | license = "BSD-3-Clause" 19 | repository = "https://github.com/google/rust-p9" 20 | resolver = "2" 21 | 22 | [lib] 23 | proc-macro = true 24 | 25 | [dependencies.proc-macro2] 26 | version = "^1" 27 | 28 | [dependencies.quote] 29 | version = "^1" 30 | 31 | [dependencies.syn] 32 | version = "^1" 33 | -------------------------------------------------------------------------------- /vendor/p9_wire_format_derive/LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The ChromiumOS Authors 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/p9_wire_format_derive/README.md: -------------------------------------------------------------------------------- 1 | # p9 - Server implementation of the [9p] file system protocol 2 | 3 | This directory contains the protocol definition and a server implementation of the [9p] file system 4 | protocol. 5 | 6 | - [wire_format_derive] - A [procedural macro] that derives the serialization and de-serialization 7 | implementation for a struct into the [9p] wire format. 8 | - [src/protocol] - Defines all the messages used in the [9p] protocol. Also implements serialization 9 | and de-serialization for some base types (integers, strings, vectors) that form the foundation of 10 | all [9p] messages. Wire format implementations for all other messages are derived using the 11 | `wire_format_derive` macro. 12 | - [src/server.rs] - Implements a full [9p] server, carrying out file system requests on behalf of 13 | clients. 14 | 15 | [9p]: http://man.cat-v.org/plan_9/5/intro 16 | [procedural macro]: https://doc.rust-lang.org/proc_macro/index.html 17 | [src/protocol]: src/protocol/ 18 | [src/server.rs]: src/server.rs 19 | [wire_format_derive]: wire_format_derive/ 20 | -------------------------------------------------------------------------------- /vendor/proc-macro2/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"cf58b9b5cd9abb5dca91d4d61809edcf425156bd8e9bb69e0398e00e74aa7af1","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c609b6865476d6c35879784e9155367a97a0da496aa5c3c61488440a20f59883","build.rs":"8b4facae0d125ca3b437b4f5ebcd6ea3da3fcc65fcfc2cf357ae544423aa4568","build/probe.rs":"971fd2178dc506ccdc5c2065c37b77696a4aee8e00330ca52625db4a857f68d3","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/extra.rs":"7c3864497cb5298fd5d0e9f5ae5797860338a9a4263220a8e8eabecda1583797","src/fallback.rs":"2e668a1ed90243e6f627a0c85c73c61f5c4107d82e149de5960d806d5eae99f9","src/lib.rs":"ea7a33758942e0911d5545e57b6a726c5bca7960fe3eed58a46b692244ac575a","src/location.rs":"f55d2e61f1bb1af65e14ed04c9e91eb1ddbf8430e8c05f2048d1cd538d27368e","src/marker.rs":"c11c5a1be8bdf18be3fcd224393f350a9aae7ce282e19ce583c84910c6903a8f","src/parse.rs":"4b77cddbc2752bc4d38a65acd8b96b6786c5220d19b1e1b37810257b5d24132d","src/rcvec.rs":"1c3c48c4f819927cc445ae15ca3bb06775feff2fd1cb21901ae4c40c7e6b4e82","src/wrapper.rs":"029fc07e8adbea2dd2a0aab49b07c3fb9cd8bc0539ea85bf9166c46922933742","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"3190ee07dae510251f360db701ce257030f94a479b6689c3a9ef804bd5d8d099","tests/test.rs":"de9163d0b7d53a56de4c3d00acb415785e55c161becfe37b2a0c5d8d1931f14f","tests/test_fmt.rs":"b7743b612af65f2c88cbe109d50a093db7aa7e87f9e37bf45b7bbaeb240aa020","tests/test_size.rs":"acf05963c1e62052d769d237b50844a2c59b4182b491231b099a4f74e5456ab0"},"package":"e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"} -------------------------------------------------------------------------------- /vendor/proc-macro2/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/proc-macro2/build/probe.rs: -------------------------------------------------------------------------------- 1 | // This code exercises the surface area that we expect of Span's unstable API. 2 | // If the current toolchain is able to compile it, then proc-macro2 is able to 3 | // offer these APIs too. 4 | 5 | #![feature(proc_macro_span)] 6 | 7 | extern crate proc_macro; 8 | 9 | use core::ops::{Range, RangeBounds}; 10 | use proc_macro::{Literal, Span}; 11 | 12 | pub fn byte_range(this: &Span) -> Range { 13 | this.byte_range() 14 | } 15 | 16 | pub fn join(this: &Span, other: Span) -> Option { 17 | this.join(other) 18 | } 19 | 20 | pub fn subspan>(this: &Literal, range: R) -> Option { 21 | this.subspan(range) 22 | } 23 | 24 | // Include in sccache cache key. 25 | const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP"); 26 | -------------------------------------------------------------------------------- /vendor/proc-macro2/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | components = ["rust-src"] 3 | -------------------------------------------------------------------------------- /vendor/proc-macro2/src/location.rs: -------------------------------------------------------------------------------- 1 | use core::cmp::Ordering; 2 | 3 | /// A line-column pair representing the start or end of a `Span`. 4 | /// 5 | /// This type is semver exempt and not exposed by default. 6 | #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))] 7 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] 8 | pub struct LineColumn { 9 | /// The 1-indexed line in the source file on which the span starts or ends 10 | /// (inclusive). 11 | pub line: usize, 12 | /// The 0-indexed column (in UTF-8 characters) in the source file on which 13 | /// the span starts or ends (inclusive). 14 | pub column: usize, 15 | } 16 | 17 | impl Ord for LineColumn { 18 | fn cmp(&self, other: &Self) -> Ordering { 19 | self.line 20 | .cmp(&other.line) 21 | .then(self.column.cmp(&other.column)) 22 | } 23 | } 24 | 25 | impl PartialOrd for LineColumn { 26 | fn partial_cmp(&self, other: &Self) -> Option { 27 | Some(self.cmp(other)) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/proc-macro2/src/marker.rs: -------------------------------------------------------------------------------- 1 | use alloc::rc::Rc; 2 | use core::marker::PhantomData; 3 | use core::panic::{RefUnwindSafe, UnwindSafe}; 4 | 5 | // Zero sized marker with the correct set of autotrait impls we want all proc 6 | // macro types to have. 7 | #[derive(Copy, Clone)] 8 | #[cfg_attr( 9 | all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)), 10 | derive(PartialEq, Eq) 11 | )] 12 | pub(crate) struct ProcMacroAutoTraits(PhantomData>); 13 | 14 | pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData); 15 | 16 | impl UnwindSafe for ProcMacroAutoTraits {} 17 | impl RefUnwindSafe for ProcMacroAutoTraits {} 18 | -------------------------------------------------------------------------------- /vendor/proc-macro2/tests/features.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | #[ignore] 3 | fn make_sure_no_proc_macro() { 4 | assert!( 5 | !cfg!(feature = "proc-macro"), 6 | "still compiled with proc_macro?" 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /vendor/proc-macro2/tests/test_fmt.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::from_iter_instead_of_collect)] 2 | 3 | use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; 4 | use std::iter; 5 | 6 | #[test] 7 | fn test_fmt_group() { 8 | let ident = Ident::new("x", Span::call_site()); 9 | let inner = TokenStream::from_iter(iter::once(TokenTree::Ident(ident))); 10 | let parens_empty = Group::new(Delimiter::Parenthesis, TokenStream::new()); 11 | let parens_nonempty = Group::new(Delimiter::Parenthesis, inner.clone()); 12 | let brackets_empty = Group::new(Delimiter::Bracket, TokenStream::new()); 13 | let brackets_nonempty = Group::new(Delimiter::Bracket, inner.clone()); 14 | let braces_empty = Group::new(Delimiter::Brace, TokenStream::new()); 15 | let braces_nonempty = Group::new(Delimiter::Brace, inner.clone()); 16 | let none_empty = Group::new(Delimiter::None, TokenStream::new()); 17 | let none_nonempty = Group::new(Delimiter::None, inner); 18 | 19 | // Matches libproc_macro. 20 | assert_eq!("()", parens_empty.to_string()); 21 | assert_eq!("(x)", parens_nonempty.to_string()); 22 | assert_eq!("[]", brackets_empty.to_string()); 23 | assert_eq!("[x]", brackets_nonempty.to_string()); 24 | assert_eq!("{ }", braces_empty.to_string()); 25 | assert_eq!("{ x }", braces_nonempty.to_string()); 26 | assert_eq!("", none_empty.to_string()); 27 | assert_eq!("x", none_nonempty.to_string()); 28 | } 29 | -------------------------------------------------------------------------------- /vendor/proc-macro2/tests/test_size.rs: -------------------------------------------------------------------------------- 1 | extern crate proc_macro; 2 | 3 | use std::mem; 4 | 5 | #[rustversion::attr(before(1.32), ignore)] 6 | #[test] 7 | fn test_proc_macro_span_size() { 8 | assert_eq!(mem::size_of::(), 4); 9 | assert_eq!(mem::size_of::>(), 4); 10 | } 11 | 12 | #[cfg_attr(not(all(not(wrap_proc_macro), not(span_locations))), ignore)] 13 | #[test] 14 | fn test_proc_macro2_fallback_span_size_without_locations() { 15 | assert_eq!(mem::size_of::(), 0); 16 | assert_eq!(mem::size_of::>(), 1); 17 | } 18 | 19 | #[cfg_attr(not(all(not(wrap_proc_macro), span_locations)), ignore)] 20 | #[test] 21 | fn test_proc_macro2_fallback_span_size_with_locations() { 22 | assert_eq!(mem::size_of::(), 8); 23 | assert_eq!(mem::size_of::>(), 12); 24 | } 25 | 26 | #[rustversion::attr(before(1.32), ignore)] 27 | #[rustversion::attr( 28 | since(1.32), 29 | cfg_attr(not(all(wrap_proc_macro, not(span_locations))), ignore) 30 | )] 31 | #[test] 32 | fn test_proc_macro2_wrapper_span_size_without_locations() { 33 | assert_eq!(mem::size_of::(), 4); 34 | assert_eq!(mem::size_of::>(), 8); 35 | } 36 | 37 | #[cfg_attr(not(all(wrap_proc_macro, span_locations)), ignore)] 38 | #[test] 39 | fn test_proc_macro2_wrapper_span_size_with_locations() { 40 | assert_eq!(mem::size_of::(), 12); 41 | assert_eq!(mem::size_of::>(), 12); 42 | } 43 | -------------------------------------------------------------------------------- /vendor/quote/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | edition = "2018" 14 | rust-version = "1.56" 15 | name = "quote" 16 | version = "1.0.35" 17 | authors = ["David Tolnay "] 18 | autobenches = false 19 | description = "Quasi-quoting macro quote!(...)" 20 | documentation = "https://docs.rs/quote/" 21 | readme = "README.md" 22 | keywords = [ 23 | "macros", 24 | "syn", 25 | ] 26 | categories = ["development-tools::procedural-macro-helpers"] 27 | license = "MIT OR Apache-2.0" 28 | repository = "https://github.com/dtolnay/quote" 29 | 30 | [package.metadata.docs.rs] 31 | rustdoc-args = ["--generate-link-to-definition"] 32 | targets = ["x86_64-unknown-linux-gnu"] 33 | 34 | [lib] 35 | doc-scrape-examples = false 36 | 37 | [dependencies.proc-macro2] 38 | version = "1.0.74" 39 | default-features = false 40 | 41 | [dev-dependencies.rustversion] 42 | version = "1.0" 43 | 44 | [dev-dependencies.trybuild] 45 | version = "1.0.66" 46 | features = ["diff"] 47 | 48 | [features] 49 | default = ["proc-macro"] 50 | proc-macro = ["proc-macro2/proc-macro"] 51 | -------------------------------------------------------------------------------- /vendor/quote/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/quote/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | components = ["rust-src"] 3 | -------------------------------------------------------------------------------- /vendor/quote/src/spanned.rs: -------------------------------------------------------------------------------- 1 | use crate::ToTokens; 2 | use proc_macro2::extra::DelimSpan; 3 | use proc_macro2::{Span, TokenStream}; 4 | 5 | // Not public API other than via the syn crate. Use syn::spanned::Spanned. 6 | pub trait Spanned: private::Sealed { 7 | fn __span(&self) -> Span; 8 | } 9 | 10 | impl Spanned for Span { 11 | fn __span(&self) -> Span { 12 | *self 13 | } 14 | } 15 | 16 | impl Spanned for DelimSpan { 17 | fn __span(&self) -> Span { 18 | self.join() 19 | } 20 | } 21 | 22 | impl Spanned for T { 23 | fn __span(&self) -> Span { 24 | join_spans(self.into_token_stream()) 25 | } 26 | } 27 | 28 | fn join_spans(tokens: TokenStream) -> Span { 29 | let mut iter = tokens.into_iter().map(|tt| tt.span()); 30 | 31 | let first = match iter.next() { 32 | Some(span) => span, 33 | None => return Span::call_site(), 34 | }; 35 | 36 | iter.fold(None, |_prev, next| Some(next)) 37 | .and_then(|last| first.join(last)) 38 | .unwrap_or(first) 39 | } 40 | 41 | mod private { 42 | use crate::ToTokens; 43 | use proc_macro2::extra::DelimSpan; 44 | use proc_macro2::Span; 45 | 46 | pub trait Sealed {} 47 | impl Sealed for Span {} 48 | impl Sealed for DelimSpan {} 49 | impl Sealed for T {} 50 | } 51 | -------------------------------------------------------------------------------- /vendor/quote/tests/compiletest.rs: -------------------------------------------------------------------------------- 1 | #[rustversion::attr(not(nightly), ignore)] 2 | #[cfg_attr(miri, ignore)] 3 | #[test] 4 | fn ui() { 5 | let t = trybuild::TestCases::new(); 6 | t.compile_fail("tests/ui/*.rs"); 7 | } 8 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | 3 | fn main() { 4 | let nonrep = ""; 5 | 6 | // Without some protection against repetitions with no iterator somewhere 7 | // inside, this would loop infinitely. 8 | quote!(#(#nonrep #nonrep)*); 9 | } 10 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/does-not-have-iter-interpolated-dup.rs:8:5 3 | | 4 | 8 | quote!(#(#nonrep #nonrep)*); 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | | | 7 | | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` 8 | | expected due to this 9 | | here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition` 10 | | 11 | = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 12 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-interpolated.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | 3 | fn main() { 4 | let nonrep = ""; 5 | 6 | // Without some protection against repetitions with no iterator somewhere 7 | // inside, this would loop infinitely. 8 | quote!(#(#nonrep)*); 9 | } 10 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/does-not-have-iter-interpolated.rs:8:5 3 | | 4 | 8 | quote!(#(#nonrep)*); 5 | | ^^^^^^^^^^^^^^^^^^^ 6 | | | 7 | | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` 8 | | expected due to this 9 | | here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition` 10 | | 11 | = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 12 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-separated.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | 3 | fn main() { 4 | quote!(#(a b),*); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter-separated.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/does-not-have-iter-separated.rs:4:5 3 | | 4 | 4 | quote!(#(a b),*); 5 | | ^^^^^^^^^^^^^^^^ 6 | | | 7 | | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` 8 | | expected due to this 9 | | 10 | = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 11 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | 3 | fn main() { 4 | quote!(#(a b)*); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/does-not-have-iter.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/does-not-have-iter.rs:4:5 3 | | 4 | 4 | quote!(#(a b)*); 5 | | ^^^^^^^^^^^^^^^ 6 | | | 7 | | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` 8 | | expected due to this 9 | | 10 | = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 11 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/not-quotable.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | use std::net::Ipv4Addr; 3 | 4 | fn main() { 5 | let ip = Ipv4Addr::LOCALHOST; 6 | let _ = quote! { #ip }; 7 | } 8 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/not-quotable.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied 2 | --> tests/ui/not-quotable.rs:6:13 3 | | 4 | 6 | let _ = quote! { #ip }; 5 | | ^^^^^^^^^^^^^^ 6 | | | 7 | | the trait `ToTokens` is not implemented for `Ipv4Addr` 8 | | required by a bound introduced by this call 9 | | 10 | = help: the following other types implement trait `ToTokens`: 11 | bool 12 | char 13 | isize 14 | i8 15 | i16 16 | i32 17 | i64 18 | i128 19 | and $N others 20 | = note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 21 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/not-repeatable.rs: -------------------------------------------------------------------------------- 1 | use quote::quote; 2 | 3 | struct Ipv4Addr; 4 | 5 | fn main() { 6 | let ip = Ipv4Addr; 7 | let _ = quote! { #(#ip)* }; 8 | } 9 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/not-repeatable.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied 2 | --> tests/ui/not-repeatable.rs:7:13 3 | | 4 | 3 | struct Ipv4Addr; 5 | | --------------- 6 | | | 7 | | method `quote_into_iter` not found for this struct 8 | | doesn't satisfy `Ipv4Addr: Iterator` 9 | | doesn't satisfy `Ipv4Addr: ToTokens` 10 | | doesn't satisfy `Ipv4Addr: ext::RepIteratorExt` 11 | | doesn't satisfy `Ipv4Addr: ext::RepToTokensExt` 12 | ... 13 | 7 | let _ = quote! { #(#ip)* }; 14 | | ^^^^^^^^^^^^^^^^^^ method cannot be called on `Ipv4Addr` due to unsatisfied trait bounds 15 | | 16 | = note: the following trait bounds were not satisfied: 17 | `Ipv4Addr: Iterator` 18 | which is required by `Ipv4Addr: ext::RepIteratorExt` 19 | `&Ipv4Addr: Iterator` 20 | which is required by `&Ipv4Addr: ext::RepIteratorExt` 21 | `Ipv4Addr: ToTokens` 22 | which is required by `Ipv4Addr: ext::RepToTokensExt` 23 | `&mut Ipv4Addr: Iterator` 24 | which is required by `&mut Ipv4Addr: ext::RepIteratorExt` 25 | note: the traits `ToTokens` and `Iterator` must be implemented 26 | --> src/to_tokens.rs 27 | | 28 | | pub trait ToTokens { 29 | | ^^^^^^^^^^^^^^^^^^ 30 | | 31 | ::: $RUST/core/src/iter/traits/iterator.rs 32 | | 33 | | pub trait Iterator { 34 | | ^^^^^^^^^^^^^^^^^^ 35 | = note: this error originates in the macro `$crate::quote_bind_into_iter` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) 36 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/wrong-type-span.rs: -------------------------------------------------------------------------------- 1 | use quote::quote_spanned; 2 | 3 | fn main() { 4 | let span = ""; 5 | let x = 0i32; 6 | quote_spanned!(span=> #x); 7 | } 8 | -------------------------------------------------------------------------------- /vendor/quote/tests/ui/wrong-type-span.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/wrong-type-span.rs:6:5 3 | | 4 | 6 | quote_spanned!(span=> #x); 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | | | 7 | | expected `Span`, found `&str` 8 | | expected due to this 9 | | 10 | = note: this error originates in the macro `quote_spanned` (in Nightly builds, run with -Z macro-backtrace for more info) 11 | -------------------------------------------------------------------------------- /vendor/serde/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | edition = "2018" 14 | rust-version = "1.31" 15 | name = "serde" 16 | version = "1.0.197" 17 | authors = [ 18 | "Erick Tryzelaar ", 19 | "David Tolnay ", 20 | ] 21 | build = "build.rs" 22 | description = "A generic serialization/deserialization framework" 23 | homepage = "https://serde.rs" 24 | documentation = "https://docs.rs/serde" 25 | readme = "crates-io.md" 26 | keywords = [ 27 | "serde", 28 | "serialization", 29 | "no_std", 30 | ] 31 | categories = [ 32 | "encoding", 33 | "no-std", 34 | "no-std::no-alloc", 35 | ] 36 | license = "MIT OR Apache-2.0" 37 | repository = "https://github.com/serde-rs/serde" 38 | 39 | [package.metadata.docs.rs] 40 | features = [ 41 | "derive", 42 | "rc", 43 | "unstable", 44 | ] 45 | rustdoc-args = [ 46 | "--cfg", 47 | "doc_cfg", 48 | "--generate-link-to-definition", 49 | ] 50 | targets = ["x86_64-unknown-linux-gnu"] 51 | 52 | [package.metadata.playground] 53 | features = [ 54 | "derive", 55 | "rc", 56 | ] 57 | 58 | [lib] 59 | doc-scrape-examples = false 60 | 61 | [dependencies.serde_derive] 62 | version = "1" 63 | optional = true 64 | 65 | [dev-dependencies.serde_derive] 66 | version = "1" 67 | 68 | [features] 69 | alloc = [] 70 | default = ["std"] 71 | derive = ["serde_derive"] 72 | rc = [] 73 | std = [] 74 | unstable = [] 75 | 76 | [target."cfg(any())".dependencies.serde_derive] 77 | version = "=1.0.197" 78 | -------------------------------------------------------------------------------- /vendor/serde/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/serde/src/de/format.rs: -------------------------------------------------------------------------------- 1 | use crate::lib::fmt::{self, Write}; 2 | use crate::lib::str; 3 | 4 | pub(super) struct Buf<'a> { 5 | bytes: &'a mut [u8], 6 | offset: usize, 7 | } 8 | 9 | impl<'a> Buf<'a> { 10 | pub fn new(bytes: &'a mut [u8]) -> Self { 11 | Buf { bytes, offset: 0 } 12 | } 13 | 14 | pub fn as_str(&self) -> &str { 15 | let slice = &self.bytes[..self.offset]; 16 | unsafe { str::from_utf8_unchecked(slice) } 17 | } 18 | } 19 | 20 | impl<'a> Write for Buf<'a> { 21 | fn write_str(&mut self, s: &str) -> fmt::Result { 22 | if self.offset + s.len() > self.bytes.len() { 23 | Err(fmt::Error) 24 | } else { 25 | self.bytes[self.offset..self.offset + s.len()].copy_from_slice(s.as_bytes()); 26 | self.offset += s.len(); 27 | Ok(()) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/serde/src/de/seed.rs: -------------------------------------------------------------------------------- 1 | use crate::de::{Deserialize, DeserializeSeed, Deserializer}; 2 | 3 | /// A DeserializeSeed helper for implementing deserialize_in_place Visitors. 4 | /// 5 | /// Wraps a mutable reference and calls deserialize_in_place on it. 6 | pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T); 7 | 8 | impl<'a, 'de, T> DeserializeSeed<'de> for InPlaceSeed<'a, T> 9 | where 10 | T: Deserialize<'de>, 11 | { 12 | type Value = (); 13 | fn deserialize(self, deserializer: D) -> Result 14 | where 15 | D: Deserializer<'de>, 16 | { 17 | T::deserialize_in_place(deserializer, self.0) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/serde/src/de/size_hint.rs: -------------------------------------------------------------------------------- 1 | use crate::lib::*; 2 | 3 | pub fn from_bounds(iter: &I) -> Option 4 | where 5 | I: Iterator, 6 | { 7 | helper(iter.size_hint()) 8 | } 9 | 10 | #[cfg(any(feature = "std", feature = "alloc"))] 11 | pub fn cautious(hint: Option) -> usize { 12 | const MAX_PREALLOC_BYTES: usize = 1024 * 1024; 13 | 14 | if mem::size_of::() == 0 { 15 | 0 16 | } else { 17 | cmp::min( 18 | hint.unwrap_or(0), 19 | MAX_PREALLOC_BYTES / mem::size_of::(), 20 | ) 21 | } 22 | } 23 | 24 | fn helper(bounds: (usize, Option)) -> Option { 25 | match bounds { 26 | (lower, Some(upper)) if lower == upper => Some(upper), 27 | _ => None, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/serde/src/integer128.rs: -------------------------------------------------------------------------------- 1 | // No longer used. Old versions of serde used this macro for supporting targets 2 | // that did not yet have 128-bit integer support. 3 | #[macro_export] 4 | #[doc(hidden)] 5 | macro_rules! serde_if_integer128 { 6 | ($($tt:tt)*) => { 7 | $($tt)* 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /vendor/serde/src/private/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(not(no_serde_derive))] 2 | pub mod de; 3 | #[cfg(not(no_serde_derive))] 4 | pub mod ser; 5 | 6 | // FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed. 7 | pub mod doc; 8 | 9 | pub use crate::lib::clone::Clone; 10 | pub use crate::lib::convert::{From, Into}; 11 | pub use crate::lib::default::Default; 12 | pub use crate::lib::fmt::{self, Formatter}; 13 | pub use crate::lib::marker::PhantomData; 14 | pub use crate::lib::option::Option::{self, None, Some}; 15 | pub use crate::lib::ptr; 16 | pub use crate::lib::result::Result::{self, Err, Ok}; 17 | 18 | pub use self::string::from_utf8_lossy; 19 | 20 | #[cfg(any(feature = "alloc", feature = "std"))] 21 | pub use crate::lib::{ToString, Vec}; 22 | 23 | #[cfg(not(no_core_try_from))] 24 | pub use crate::lib::convert::TryFrom; 25 | 26 | mod string { 27 | use crate::lib::*; 28 | 29 | #[cfg(any(feature = "std", feature = "alloc"))] 30 | pub fn from_utf8_lossy(bytes: &[u8]) -> Cow { 31 | String::from_utf8_lossy(bytes) 32 | } 33 | 34 | // The generated code calls this like: 35 | // 36 | // let value = &_serde::__private::from_utf8_lossy(bytes); 37 | // Err(_serde::de::Error::unknown_variant(value, VARIANTS)) 38 | // 39 | // so it is okay for the return type to be different from the std case as long 40 | // as the above works. 41 | #[cfg(not(any(feature = "std", feature = "alloc")))] 42 | pub fn from_utf8_lossy(bytes: &[u8]) -> &str { 43 | // Three unicode replacement characters if it fails. They look like a 44 | // white-on-black question mark. The user will recognize it as invalid 45 | // UTF-8. 46 | str::from_utf8(bytes).unwrap_or("\u{fffd}\u{fffd}\u{fffd}") 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/serde/src/std_error.rs: -------------------------------------------------------------------------------- 1 | use crate::lib::{Debug, Display}; 2 | 3 | /// Either a re-export of std::error::Error or a new identical trait, depending 4 | /// on whether Serde's "std" feature is enabled. 5 | /// 6 | /// Serde's error traits [`serde::ser::Error`] and [`serde::de::Error`] require 7 | /// [`std::error::Error`] as a supertrait, but only when Serde is built with 8 | /// "std" enabled. Data formats that don't care about no\_std support should 9 | /// generally provide their error types with a `std::error::Error` impl 10 | /// directly: 11 | /// 12 | /// ```edition2021 13 | /// #[derive(Debug)] 14 | /// struct MySerError {...} 15 | /// 16 | /// impl serde::ser::Error for MySerError {...} 17 | /// 18 | /// impl std::fmt::Display for MySerError {...} 19 | /// 20 | /// // We don't support no_std! 21 | /// impl std::error::Error for MySerError {} 22 | /// ``` 23 | /// 24 | /// Data formats that *do* support no\_std may either have a "std" feature of 25 | /// their own: 26 | /// 27 | /// ```toml 28 | /// [features] 29 | /// std = ["serde/std"] 30 | /// ``` 31 | /// 32 | /// ```edition2021 33 | /// #[cfg(feature = "std")] 34 | /// impl std::error::Error for MySerError {} 35 | /// ``` 36 | /// 37 | /// ... or else provide the std Error impl unconditionally via Serde's 38 | /// re-export: 39 | /// 40 | /// ```edition2021 41 | /// impl serde::ser::StdError for MySerError {} 42 | /// ``` 43 | pub trait Error: Debug + Display { 44 | /// The underlying cause of this error, if any. 45 | fn source(&self) -> Option<&(Error + 'static)> { 46 | None 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/serde_derive/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"daf3d8f8efdf30d3575c7d1e1372ff7287891fb95625223e4a8a2f792c4474e1","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"731c044fc5f98b37a89e9049c9214267db98763309cb63146b45c029640f82a3","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/bound.rs":"6c5c20785ac95af9480f8d0de35a7e844cc36a16012f6468db148acd03cb15c2","src/de.rs":"c221ab2b94a5d80dccff74a37f3448b3d695656552b452595dc289c73b12fb2b","src/dummy.rs":"9533dfee23f20d92ea75734c739022820c2787ded0d54f459feacdeb770ec912","src/fragment.rs":"6757cb4c3131d4300f093572efc273c4ab5a20e3e1efb54a311dcfa52d0bd6eb","src/internals/ast.rs":"7dc997e4090033bbd1d0bdd870e8bb87b096b7f66cfd02047f6b85ebdd569b12","src/internals/attr.rs":"6584c0a02de0d17993877303f3cc2c1bccf235257632220421f98082d82d387a","src/internals/case.rs":"10c8dda2b32d8c6c6b63cf09cdc63d02375af7e95ecefe8fecb34f93b65191bb","src/internals/check.rs":"d842eb9912fd29311060b67f3bc62c438eb7b5d86093355acb4de7eee02a0ef8","src/internals/ctxt.rs":"83a4e6fbe0e439d578478883594407e03f2f340541be479bdf0b04a202633a37","src/internals/mod.rs":"ed021ca635c18132a0e5c3d90f21b7f65def0a61e946421a30200b5b9ab6ad43","src/internals/receiver.rs":"fe8a480669511b5edcfe71f5dd290cf72ccec54c9016ec85f2ac59dce538077f","src/internals/respan.rs":"899753859c58ce5f532a3ec4584796a52f13ed5a0533191e48c953ba5c1b52ff","src/internals/symbol.rs":"d619e88caa3c7a09b03014257f2b349ee922290062d9b97b4dd19d0e64532690","src/lib.rs":"7a6c2796244658f62d398ebc6819c4f3064dac4a1ad7c52b40359f9411f1c266","src/pretend.rs":"7facc10a5b805564dd95735ae11118ec17ca6adcc49a59764e7c920e27b9fc4a","src/ser.rs":"e3341471cea9d7e2fb4043e5d1746862beb9a4e25196170879eeac529d460920","src/this.rs":"87818dc80cbb521b51938a653d09daf10aafc220bb10425948de82ad670fcb85"},"package":"7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"} -------------------------------------------------------------------------------- /vendor/serde_derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | rust-version = "1.56" 14 | name = "serde_derive" 15 | version = "1.0.197" 16 | authors = [ 17 | "Erick Tryzelaar ", 18 | "David Tolnay ", 19 | ] 20 | description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]" 21 | homepage = "https://serde.rs" 22 | documentation = "https://serde.rs/derive.html" 23 | readme = "crates-io.md" 24 | keywords = [ 25 | "serde", 26 | "serialization", 27 | "no_std", 28 | "derive", 29 | ] 30 | categories = [ 31 | "no-std", 32 | "no-std::no-alloc", 33 | ] 34 | license = "MIT OR Apache-2.0" 35 | repository = "https://github.com/serde-rs/serde" 36 | 37 | [package.metadata.docs.rs] 38 | rustdoc-args = ["--generate-link-to-definition"] 39 | targets = ["x86_64-unknown-linux-gnu"] 40 | 41 | [lib] 42 | name = "serde_derive" 43 | proc-macro = true 44 | 45 | [dependencies.proc-macro2] 46 | version = "1.0.74" 47 | features = ["proc-macro"] 48 | default-features = false 49 | 50 | [dependencies.quote] 51 | version = "1.0.35" 52 | features = ["proc-macro"] 53 | default-features = false 54 | 55 | [dependencies.syn] 56 | version = "2.0.46" 57 | features = [ 58 | "clone-impls", 59 | "derive", 60 | "parsing", 61 | "printing", 62 | "proc-macro", 63 | ] 64 | default-features = false 65 | 66 | [dev-dependencies.serde] 67 | version = "1" 68 | 69 | [features] 70 | default = [] 71 | deserialize_in_place = [] 72 | -------------------------------------------------------------------------------- /vendor/serde_derive/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/serde_derive/src/dummy.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::TokenStream; 2 | use quote::quote; 3 | 4 | pub fn wrap_in_const(serde_path: Option<&syn::Path>, code: TokenStream) -> TokenStream { 5 | let use_serde = match serde_path { 6 | Some(path) => quote! { 7 | use #path as _serde; 8 | }, 9 | None => quote! { 10 | #[allow(unused_extern_crates, clippy::useless_attribute)] 11 | extern crate serde as _serde; 12 | }, 13 | }; 14 | 15 | quote! { 16 | #[doc(hidden)] 17 | #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] 18 | const _: () = { 19 | #use_serde 20 | #code 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/serde_derive/src/internals/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ast; 2 | pub mod attr; 3 | 4 | mod case; 5 | mod check; 6 | mod ctxt; 7 | mod receiver; 8 | mod respan; 9 | mod symbol; 10 | 11 | use syn::Type; 12 | 13 | pub use self::ctxt::Ctxt; 14 | pub use self::receiver::replace_receiver; 15 | 16 | #[derive(Copy, Clone)] 17 | pub enum Derive { 18 | Serialize, 19 | Deserialize, 20 | } 21 | 22 | pub fn ungroup(mut ty: &Type) -> &Type { 23 | while let Type::Group(group) = ty { 24 | ty = &group.elem; 25 | } 26 | ty 27 | } 28 | -------------------------------------------------------------------------------- /vendor/serde_derive/src/internals/respan.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::{Group, Span, TokenStream, TokenTree}; 2 | 3 | pub(crate) fn respan(stream: TokenStream, span: Span) -> TokenStream { 4 | stream 5 | .into_iter() 6 | .map(|token| respan_token(token, span)) 7 | .collect() 8 | } 9 | 10 | fn respan_token(mut token: TokenTree, span: Span) -> TokenTree { 11 | if let TokenTree::Group(g) = &mut token { 12 | *g = Group::new(g.delimiter(), respan(g.stream(), span)); 13 | } 14 | token.set_span(span); 15 | token 16 | } 17 | -------------------------------------------------------------------------------- /vendor/serde_derive/src/this.rs: -------------------------------------------------------------------------------- 1 | use crate::internals::ast::Container; 2 | use syn::{Path, PathArguments, Token}; 3 | 4 | pub fn this_type(cont: &Container) -> Path { 5 | if let Some(remote) = cont.attrs.remote() { 6 | let mut this = remote.clone(); 7 | for segment in &mut this.segments { 8 | if let PathArguments::AngleBracketed(arguments) = &mut segment.arguments { 9 | arguments.colon2_token = None; 10 | } 11 | } 12 | this 13 | } else { 14 | Path::from(cont.ident.clone()) 15 | } 16 | } 17 | 18 | pub fn this_value(cont: &Container) -> Path { 19 | if let Some(remote) = cont.attrs.remote() { 20 | let mut this = remote.clone(); 21 | for segment in &mut this.segments { 22 | if let PathArguments::AngleBracketed(arguments) = &mut segment.arguments { 23 | if arguments.colon2_token.is_none() { 24 | arguments.colon2_token = Some(Token![::](arguments.lt_token.span)); 25 | } 26 | } 27 | } 28 | this 29 | } else { 30 | Path::from(cont.ident.clone()) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/benches/file.rs: -------------------------------------------------------------------------------- 1 | // $ cargo bench --features full,test --bench file 2 | 3 | #![feature(rustc_private, test)] 4 | #![recursion_limit = "1024"] 5 | #![allow( 6 | clippy::items_after_statements, 7 | clippy::missing_panics_doc, 8 | clippy::must_use_candidate 9 | )] 10 | 11 | extern crate test; 12 | 13 | #[macro_use] 14 | #[path = "../tests/macros/mod.rs"] 15 | mod macros; 16 | 17 | #[path = "../tests/common/mod.rs"] 18 | mod common; 19 | #[path = "../tests/repo/mod.rs"] 20 | pub mod repo; 21 | 22 | use proc_macro2::{Span, TokenStream}; 23 | use std::fs; 24 | use std::str::FromStr; 25 | use syn::parse::{ParseStream, Parser}; 26 | use test::Bencher; 27 | 28 | const FILE: &str = "tests/rust/library/core/src/str/mod.rs"; 29 | 30 | fn get_tokens() -> TokenStream { 31 | repo::clone_rust(); 32 | let content = fs::read_to_string(FILE).unwrap(); 33 | TokenStream::from_str(&content).unwrap() 34 | } 35 | 36 | #[bench] 37 | fn baseline(b: &mut Bencher) { 38 | let tokens = get_tokens(); 39 | b.iter(|| drop(tokens.clone())); 40 | } 41 | 42 | #[bench] 43 | fn create_token_buffer(b: &mut Bencher) { 44 | let tokens = get_tokens(); 45 | fn immediate_fail(_input: ParseStream) -> syn::Result<()> { 46 | Err(syn::Error::new(Span::call_site(), "")) 47 | } 48 | b.iter(|| immediate_fail.parse2(tokens.clone())); 49 | } 50 | 51 | #[bench] 52 | fn parse_file(b: &mut Bencher) { 53 | let tokens = get_tokens(); 54 | b.iter(|| syn::parse2::(tokens.clone())); 55 | } 56 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::process::Command; 3 | use std::str; 4 | 5 | // The rustc-cfg strings below are *not* public API. Please let us know by 6 | // opening a GitHub issue if your build environment requires some way to enable 7 | // these cfgs other than by executing our build script. 8 | fn main() { 9 | let compiler = match rustc_version() { 10 | Some(compiler) => compiler, 11 | None => return, 12 | }; 13 | 14 | if compiler.minor < 36 { 15 | println!("cargo:rustc-cfg=syn_omit_await_from_token_macro"); 16 | } 17 | 18 | if compiler.minor < 39 { 19 | println!("cargo:rustc-cfg=syn_no_const_vec_new"); 20 | } 21 | 22 | if compiler.minor < 40 { 23 | println!("cargo:rustc-cfg=syn_no_non_exhaustive"); 24 | } 25 | 26 | if compiler.minor < 56 { 27 | println!("cargo:rustc-cfg=syn_no_negative_literal_parse"); 28 | } 29 | 30 | if !compiler.nightly { 31 | println!("cargo:rustc-cfg=syn_disable_nightly_tests"); 32 | } 33 | } 34 | 35 | struct Compiler { 36 | minor: u32, 37 | nightly: bool, 38 | } 39 | 40 | fn rustc_version() -> Option { 41 | let rustc = env::var_os("RUSTC")?; 42 | let output = Command::new(rustc).arg("--version").output().ok()?; 43 | let version = str::from_utf8(&output.stdout).ok()?; 44 | let mut pieces = version.split('.'); 45 | if pieces.next() != Some("rustc 1") { 46 | return None; 47 | } 48 | let minor = pieces.next()?.parse().ok()?; 49 | let nightly = version.contains("nightly") || version.ends_with("-dev"); 50 | Some(Compiler { minor, nightly }) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/await.rs: -------------------------------------------------------------------------------- 1 | // See include!("await.rs") in token.rs. 2 | export_token_macro! {[await]} 3 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/bigint.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{AddAssign, MulAssign}; 2 | 3 | // For implementing base10_digits() accessor on LitInt. 4 | pub struct BigInt { 5 | digits: Vec, 6 | } 7 | 8 | impl BigInt { 9 | pub fn new() -> Self { 10 | BigInt { digits: Vec::new() } 11 | } 12 | 13 | pub fn to_string(&self) -> String { 14 | let mut repr = String::with_capacity(self.digits.len()); 15 | 16 | let mut has_nonzero = false; 17 | for digit in self.digits.iter().rev() { 18 | has_nonzero |= *digit != 0; 19 | if has_nonzero { 20 | repr.push((*digit + b'0') as char); 21 | } 22 | } 23 | 24 | if repr.is_empty() { 25 | repr.push('0'); 26 | } 27 | 28 | repr 29 | } 30 | 31 | fn reserve_two_digits(&mut self) { 32 | let len = self.digits.len(); 33 | let desired = 34 | len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize; 35 | self.digits.resize(desired, 0); 36 | } 37 | } 38 | 39 | impl AddAssign for BigInt { 40 | // Assumes increment <16. 41 | fn add_assign(&mut self, mut increment: u8) { 42 | self.reserve_two_digits(); 43 | 44 | let mut i = 0; 45 | while increment > 0 { 46 | let sum = self.digits[i] + increment; 47 | self.digits[i] = sum % 10; 48 | increment = sum / 10; 49 | i += 1; 50 | } 51 | } 52 | } 53 | 54 | impl MulAssign for BigInt { 55 | // Assumes base <=16. 56 | fn mul_assign(&mut self, base: u8) { 57 | self.reserve_two_digits(); 58 | 59 | let mut carry = 0; 60 | for digit in &mut self.digits { 61 | let prod = *digit * base + carry; 62 | *digit = prod % 10; 63 | carry = prod / 10; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/drops.rs: -------------------------------------------------------------------------------- 1 | use std::iter; 2 | use std::mem::ManuallyDrop; 3 | use std::ops::{Deref, DerefMut}; 4 | use std::option; 5 | use std::slice; 6 | 7 | #[repr(transparent)] 8 | pub(crate) struct NoDrop(ManuallyDrop); 9 | 10 | impl NoDrop { 11 | pub(crate) fn new(value: T) -> Self 12 | where 13 | T: TrivialDrop, 14 | { 15 | NoDrop(ManuallyDrop::new(value)) 16 | } 17 | } 18 | 19 | impl Deref for NoDrop { 20 | type Target = T; 21 | fn deref(&self) -> &Self::Target { 22 | &self.0 23 | } 24 | } 25 | 26 | impl DerefMut for NoDrop { 27 | fn deref_mut(&mut self) -> &mut Self::Target { 28 | &mut self.0 29 | } 30 | } 31 | 32 | pub(crate) trait TrivialDrop {} 33 | 34 | impl TrivialDrop for iter::Empty {} 35 | impl<'a, T> TrivialDrop for slice::Iter<'a, T> {} 36 | impl<'a, T> TrivialDrop for slice::IterMut<'a, T> {} 37 | impl<'a, T> TrivialDrop for option::IntoIter<&'a T> {} 38 | impl<'a, T> TrivialDrop for option::IntoIter<&'a mut T> {} 39 | 40 | #[test] 41 | fn test_needs_drop() { 42 | use std::mem::needs_drop; 43 | 44 | struct NeedsDrop; 45 | 46 | impl Drop for NeedsDrop { 47 | fn drop(&mut self) {} 48 | } 49 | 50 | assert!(needs_drop::()); 51 | 52 | // Test each of the types with a handwritten TrivialDrop impl above. 53 | assert!(!needs_drop::>()); 54 | assert!(!needs_drop::>()); 55 | assert!(!needs_drop::>()); 56 | assert!(!needs_drop::>()); 57 | assert!(!needs_drop::>()); 58 | } 59 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/export.rs: -------------------------------------------------------------------------------- 1 | pub use std::clone::Clone; 2 | pub use std::cmp::{Eq, PartialEq}; 3 | pub use std::default::Default; 4 | pub use std::fmt::{self, Debug, Formatter}; 5 | pub use std::hash::{Hash, Hasher}; 6 | pub use std::marker::Copy; 7 | pub use std::option::Option::{None, Some}; 8 | pub use std::result::Result::{Err, Ok}; 9 | 10 | #[cfg(feature = "printing")] 11 | pub extern crate quote; 12 | 13 | pub use proc_macro2::{Span, TokenStream as TokenStream2}; 14 | 15 | #[cfg(feature = "parsing")] 16 | pub use crate::group::{parse_braces, parse_brackets, parse_parens}; 17 | 18 | pub use crate::span::IntoSpans; 19 | 20 | #[cfg(all( 21 | not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), 22 | feature = "proc-macro" 23 | ))] 24 | pub use proc_macro::TokenStream; 25 | 26 | #[cfg(feature = "printing")] 27 | pub use quote::{ToTokens, TokenStreamExt}; 28 | 29 | #[allow(non_camel_case_types)] 30 | pub type bool = help::Bool; 31 | #[allow(non_camel_case_types)] 32 | pub type str = help::Str; 33 | 34 | mod help { 35 | pub type Bool = bool; 36 | pub type Str = str; 37 | } 38 | 39 | pub struct private(pub(crate) ()); 40 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/print.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::TokenStream; 2 | use quote::ToTokens; 3 | 4 | pub struct TokensOrDefault<'a, T: 'a>(pub &'a Option); 5 | 6 | impl<'a, T> ToTokens for TokensOrDefault<'a, T> 7 | where 8 | T: ToTokens + Default, 9 | { 10 | fn to_tokens(&self, tokens: &mut TokenStream) { 11 | match self.0 { 12 | Some(t) => t.to_tokens(tokens), 13 | None => T::default().to_tokens(tokens), 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/reserved.rs: -------------------------------------------------------------------------------- 1 | // Type for a syntax tree node that is reserved for future use. 2 | // 3 | // For example ExprReference contains a field `raw` of type Reserved. If `&raw 4 | // place` syntax becomes a thing as per https://github.com/rust-lang/rfcs/pull/2582, 5 | // we can backward compatibly change `raw`'s type to Option without 6 | // the possibility of breaking any code. 7 | 8 | use proc_macro2::Span; 9 | use std::marker::PhantomData; 10 | 11 | #[cfg(feature = "extra-traits")] 12 | use std::fmt::{self, Debug}; 13 | 14 | ast_struct! { 15 | pub struct Reserved { 16 | _private: PhantomData, 17 | } 18 | } 19 | 20 | impl Default for Reserved { 21 | fn default() -> Self { 22 | Reserved { 23 | _private: PhantomData, 24 | } 25 | } 26 | } 27 | 28 | #[cfg(feature = "clone-impls")] 29 | #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] 30 | impl Clone for Reserved { 31 | fn clone(&self) -> Self { 32 | Reserved { 33 | _private: self._private, 34 | } 35 | } 36 | } 37 | 38 | #[cfg(feature = "extra-traits")] 39 | #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] 40 | impl Debug for Reserved { 41 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 42 | formatter.debug_struct("Reserved").finish() 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/sealed.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "parsing")] 2 | pub mod lookahead { 3 | pub trait Sealed: Copy {} 4 | } 5 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/span.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::Span; 2 | 3 | pub trait IntoSpans { 4 | fn into_spans(self) -> S; 5 | } 6 | 7 | impl IntoSpans<[Span; 1]> for Span { 8 | fn into_spans(self) -> [Span; 1] { 9 | [self] 10 | } 11 | } 12 | 13 | impl IntoSpans<[Span; 2]> for Span { 14 | fn into_spans(self) -> [Span; 2] { 15 | [self, self] 16 | } 17 | } 18 | 19 | impl IntoSpans<[Span; 3]> for Span { 20 | fn into_spans(self) -> [Span; 3] { 21 | [self, self, self] 22 | } 23 | } 24 | 25 | impl IntoSpans<[Span; 1]> for [Span; 1] { 26 | fn into_spans(self) -> [Span; 1] { 27 | self 28 | } 29 | } 30 | 31 | impl IntoSpans<[Span; 2]> for [Span; 2] { 32 | fn into_spans(self) -> [Span; 2] { 33 | self 34 | } 35 | } 36 | 37 | impl IntoSpans<[Span; 3]> for [Span; 3] { 38 | fn into_spans(self) -> [Span; 3] { 39 | self 40 | } 41 | } 42 | 43 | #[cfg(feature = "parsing")] 44 | pub trait FromSpans: Sized { 45 | fn from_spans(spans: &[Span]) -> Self; 46 | } 47 | 48 | #[cfg(feature = "parsing")] 49 | impl FromSpans for [Span; 1] { 50 | fn from_spans(spans: &[Span]) -> Self { 51 | [spans[0]] 52 | } 53 | } 54 | 55 | #[cfg(feature = "parsing")] 56 | impl FromSpans for [Span; 2] { 57 | fn from_spans(spans: &[Span]) -> Self { 58 | [spans[0], spans[1]] 59 | } 60 | } 61 | 62 | #[cfg(feature = "parsing")] 63 | impl FromSpans for [Span; 3] { 64 | fn from_spans(spans: &[Span]) -> Self { 65 | [spans[0], spans[1], spans[2]] 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/thread.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::{self, Debug}; 2 | use std::thread::{self, ThreadId}; 3 | 4 | /// ThreadBound is a Sync-maker and Send-maker that allows accessing a value 5 | /// of type T only from the original thread on which the ThreadBound was 6 | /// constructed. 7 | pub struct ThreadBound { 8 | value: T, 9 | thread_id: ThreadId, 10 | } 11 | 12 | unsafe impl Sync for ThreadBound {} 13 | 14 | // Send bound requires Copy, as otherwise Drop could run in the wrong place. 15 | unsafe impl Send for ThreadBound {} 16 | 17 | impl ThreadBound { 18 | pub fn new(value: T) -> Self { 19 | ThreadBound { 20 | value, 21 | thread_id: thread::current().id(), 22 | } 23 | } 24 | 25 | pub fn get(&self) -> Option<&T> { 26 | if thread::current().id() == self.thread_id { 27 | Some(&self.value) 28 | } else { 29 | None 30 | } 31 | } 32 | } 33 | 34 | impl Debug for ThreadBound { 35 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 36 | match self.get() { 37 | Some(value) => Debug::fmt(value, formatter), 38 | None => formatter.write_str("unknown"), 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/src/verbatim.rs: -------------------------------------------------------------------------------- 1 | use crate::parse::{ParseBuffer, ParseStream}; 2 | use proc_macro2::{Delimiter, TokenStream}; 3 | use std::cmp::Ordering; 4 | use std::iter; 5 | 6 | pub fn between<'a>(begin: ParseBuffer<'a>, end: ParseStream<'a>) -> TokenStream { 7 | let end = end.cursor(); 8 | let mut cursor = begin.cursor(); 9 | assert!(crate::buffer::same_buffer(end, cursor)); 10 | 11 | let mut tokens = TokenStream::new(); 12 | while cursor != end { 13 | let (tt, next) = cursor.token_tree().unwrap(); 14 | 15 | if crate::buffer::cmp_assuming_same_buffer(end, next) == Ordering::Less { 16 | // A syntax node can cross the boundary of a None-delimited group 17 | // due to such groups being transparent to the parser in most cases. 18 | // Any time this occurs the group is known to be semantically 19 | // irrelevant. https://github.com/dtolnay/syn/issues/1235 20 | if let Some((inside, _span, after)) = cursor.group(Delimiter::None) { 21 | assert!(next == after); 22 | cursor = inside; 23 | continue; 24 | } else { 25 | panic!("verbatim end must not be inside a delimited group"); 26 | } 27 | } 28 | 29 | tokens.extend(iter::once(tt)); 30 | cursor = next; 31 | } 32 | tokens 33 | } 34 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/common/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(clippy::module_name_repetitions, clippy::shadow_unrelated)] 3 | 4 | use rayon::ThreadPoolBuilder; 5 | use std::env; 6 | 7 | pub mod eq; 8 | pub mod parse; 9 | 10 | /// Read the `ABORT_AFTER_FAILURE` environment variable, and parse it. 11 | pub fn abort_after() -> usize { 12 | match env::var("ABORT_AFTER_FAILURE") { 13 | Ok(s) => s.parse().expect("failed to parse ABORT_AFTER_FAILURE"), 14 | Err(_) => usize::max_value(), 15 | } 16 | } 17 | 18 | /// Configure Rayon threadpool. 19 | pub fn rayon_init() { 20 | let stack_size = match env::var("RUST_MIN_STACK") { 21 | Ok(s) => s.parse().expect("failed to parse RUST_MIN_STACK"), 22 | Err(_) => 20 * 1024 * 1024, 23 | }; 24 | ThreadPoolBuilder::new() 25 | .stack_size(stack_size) 26 | .build_global() 27 | .unwrap(); 28 | } 29 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/common/parse.rs: -------------------------------------------------------------------------------- 1 | extern crate rustc_ast; 2 | extern crate rustc_expand; 3 | extern crate rustc_parse as parse; 4 | extern crate rustc_session; 5 | extern crate rustc_span; 6 | 7 | use rustc_ast::ast; 8 | use rustc_ast::ptr::P; 9 | use rustc_session::parse::ParseSess; 10 | use rustc_span::source_map::FilePathMapping; 11 | use rustc_span::FileName; 12 | use std::panic; 13 | 14 | pub fn librustc_expr(input: &str) -> Option> { 15 | match panic::catch_unwind(|| { 16 | let sess = ParseSess::new(FilePathMapping::empty()); 17 | let e = parse::new_parser_from_source_str( 18 | &sess, 19 | FileName::Custom("test_precedence".to_string()), 20 | input.to_string(), 21 | ) 22 | .parse_expr(); 23 | match e { 24 | Ok(expr) => Some(expr), 25 | Err(mut diagnostic) => { 26 | diagnostic.emit(); 27 | None 28 | } 29 | } 30 | }) { 31 | Ok(Some(e)) => Some(e), 32 | Ok(None) => None, 33 | Err(_) => { 34 | errorf!("librustc panicked\n"); 35 | None 36 | } 37 | } 38 | } 39 | 40 | pub fn syn_expr(input: &str) -> Option { 41 | match syn::parse_str(input) { 42 | Ok(e) => Some(e), 43 | Err(msg) => { 44 | errorf!("syn failed to parse\n{:?}\n", msg); 45 | None 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/regression.rs: -------------------------------------------------------------------------------- 1 | mod regression { 2 | automod::dir!("tests/regression"); 3 | } 4 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/regression/issue1108.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn issue1108() { 3 | let data = "impl>::x for"; 4 | _ = syn::parse_file(data); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/regression/issue1235.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::{Delimiter, Group}; 2 | use quote::quote; 3 | 4 | #[test] 5 | fn main() { 6 | // Okay. Rustc allows top-level `static` with no value syntactically, but 7 | // not semantically. Syn parses as Item::Verbatim. 8 | let tokens = quote! { 9 | pub static FOO: usize; 10 | pub static BAR: usize; 11 | }; 12 | let file = syn::parse2::(tokens).unwrap(); 13 | println!("{:#?}", file); 14 | 15 | // Okay. 16 | let inner = Group::new( 17 | Delimiter::None, 18 | quote!(static FOO: usize = 0; pub static BAR: usize = 0), 19 | ); 20 | let tokens = quote!(pub #inner;); 21 | let file = syn::parse2::(tokens).unwrap(); 22 | println!("{:#?}", file); 23 | 24 | // Formerly parser crash. 25 | let inner = Group::new( 26 | Delimiter::None, 27 | quote!(static FOO: usize; pub static BAR: usize), 28 | ); 29 | let tokens = quote!(pub #inner;); 30 | let file = syn::parse2::(tokens).unwrap(); 31 | println!("{:#?}", file); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/repo/progress.rs: -------------------------------------------------------------------------------- 1 | use std::io::{Read, Result}; 2 | use std::time::{Duration, Instant}; 3 | 4 | pub struct Progress { 5 | bytes: usize, 6 | tick: Instant, 7 | stream: R, 8 | } 9 | 10 | impl Progress { 11 | pub fn new(stream: R) -> Self { 12 | Progress { 13 | bytes: 0, 14 | tick: Instant::now() + Duration::from_millis(2000), 15 | stream, 16 | } 17 | } 18 | } 19 | 20 | impl Read for Progress { 21 | fn read(&mut self, buf: &mut [u8]) -> Result { 22 | let num = self.stream.read(buf)?; 23 | self.bytes += num; 24 | let now = Instant::now(); 25 | if now > self.tick { 26 | self.tick = now + Duration::from_millis(500); 27 | errorf!("downloading... {} bytes\n", self.bytes); 28 | } 29 | Ok(num) 30 | } 31 | } 32 | 33 | impl Drop for Progress { 34 | fn drop(&mut self) { 35 | errorf!("done ({} bytes)\n", self.bytes); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_asyncness.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | mod macros; 3 | 4 | use syn::{Expr, Item}; 5 | 6 | #[test] 7 | fn test_async_fn() { 8 | let input = "async fn process() {}"; 9 | 10 | snapshot!(input as Item, @r###" 11 | Item::Fn { 12 | vis: Inherited, 13 | sig: Signature { 14 | asyncness: Some, 15 | ident: "process", 16 | generics: Generics, 17 | output: Default, 18 | }, 19 | block: Block, 20 | } 21 | "###); 22 | } 23 | 24 | #[test] 25 | fn test_async_closure() { 26 | let input = "async || {}"; 27 | 28 | snapshot!(input as Expr, @r###" 29 | Expr::Closure { 30 | asyncness: Some, 31 | output: Default, 32 | body: Expr::Block { 33 | block: Block, 34 | }, 35 | } 36 | "###); 37 | } 38 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_grouping.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | mod macros; 3 | 4 | use proc_macro2::{Delimiter, Group, Literal, Punct, Spacing, TokenStream, TokenTree}; 5 | use std::iter::FromIterator; 6 | use syn::Expr; 7 | 8 | #[test] 9 | fn test_grouping() { 10 | let tokens: TokenStream = TokenStream::from_iter(vec![ 11 | TokenTree::Literal(Literal::i32_suffixed(1)), 12 | TokenTree::Punct(Punct::new('+', Spacing::Alone)), 13 | TokenTree::Group(Group::new( 14 | Delimiter::None, 15 | TokenStream::from_iter(vec![ 16 | TokenTree::Literal(Literal::i32_suffixed(2)), 17 | TokenTree::Punct(Punct::new('+', Spacing::Alone)), 18 | TokenTree::Literal(Literal::i32_suffixed(3)), 19 | ]), 20 | )), 21 | TokenTree::Punct(Punct::new('*', Spacing::Alone)), 22 | TokenTree::Literal(Literal::i32_suffixed(4)), 23 | ]); 24 | 25 | assert_eq!(tokens.to_string(), "1i32 + 2i32 + 3i32 * 4i32"); 26 | 27 | snapshot!(tokens as Expr, @r###" 28 | Expr::Binary { 29 | left: Expr::Lit { 30 | lit: 1i32, 31 | }, 32 | op: Add, 33 | right: Expr::Binary { 34 | left: Expr::Group { 35 | expr: Expr::Binary { 36 | left: Expr::Lit { 37 | lit: 2i32, 38 | }, 39 | op: Add, 40 | right: Expr::Lit { 41 | lit: 3i32, 42 | }, 43 | }, 44 | }, 45 | op: Mul, 46 | right: Expr::Lit { 47 | lit: 4i32, 48 | }, 49 | }, 50 | } 51 | "###); 52 | } 53 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_ident.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::{Ident, Span, TokenStream}; 2 | use std::str::FromStr; 3 | use syn::Result; 4 | 5 | fn parse(s: &str) -> Result { 6 | syn::parse2(TokenStream::from_str(s).unwrap()) 7 | } 8 | 9 | fn new(s: &str) -> Ident { 10 | Ident::new(s, Span::call_site()) 11 | } 12 | 13 | #[test] 14 | fn ident_parse() { 15 | parse("String").unwrap(); 16 | } 17 | 18 | #[test] 19 | fn ident_parse_keyword() { 20 | parse("abstract").unwrap_err(); 21 | } 22 | 23 | #[test] 24 | fn ident_parse_empty() { 25 | parse("").unwrap_err(); 26 | } 27 | 28 | #[test] 29 | fn ident_parse_lifetime() { 30 | parse("'static").unwrap_err(); 31 | } 32 | 33 | #[test] 34 | fn ident_parse_underscore() { 35 | parse("_").unwrap_err(); 36 | } 37 | 38 | #[test] 39 | fn ident_parse_number() { 40 | parse("255").unwrap_err(); 41 | } 42 | 43 | #[test] 44 | fn ident_parse_invalid() { 45 | parse("a#").unwrap_err(); 46 | } 47 | 48 | #[test] 49 | fn ident_new() { 50 | new("String"); 51 | } 52 | 53 | #[test] 54 | fn ident_new_keyword() { 55 | new("abstract"); 56 | } 57 | 58 | #[test] 59 | #[should_panic(expected = "use Option")] 60 | fn ident_new_empty() { 61 | new(""); 62 | } 63 | 64 | #[test] 65 | #[should_panic(expected = "not a valid Ident")] 66 | fn ident_new_lifetime() { 67 | new("'static"); 68 | } 69 | 70 | #[test] 71 | fn ident_new_underscore() { 72 | new("_"); 73 | } 74 | 75 | #[test] 76 | #[should_panic(expected = "use Literal instead")] 77 | fn ident_new_number() { 78 | new("255"); 79 | } 80 | 81 | #[test] 82 | #[should_panic(expected = "\"a#\" is not a valid Ident")] 83 | fn ident_new_invalid() { 84 | new("a#"); 85 | } 86 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_iterators.rs: -------------------------------------------------------------------------------- 1 | use syn::punctuated::{Pair, Punctuated}; 2 | use syn::Token; 3 | 4 | #[macro_use] 5 | mod macros; 6 | 7 | macro_rules! check_exact_size_iterator { 8 | ($iter:expr) => {{ 9 | let iter = $iter; 10 | let size_hint = iter.size_hint(); 11 | let len = iter.len(); 12 | let count = iter.count(); 13 | assert_eq!(len, count); 14 | assert_eq!(size_hint, (count, Some(count))); 15 | }}; 16 | } 17 | 18 | #[test] 19 | fn pairs() { 20 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 21 | 22 | check_exact_size_iterator!(p.pairs()); 23 | check_exact_size_iterator!(p.pairs_mut()); 24 | check_exact_size_iterator!(p.into_pairs()); 25 | 26 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 27 | 28 | assert_eq!(p.pairs().next_back().map(Pair::into_value), Some(&4)); 29 | assert_eq!( 30 | p.pairs_mut().next_back().map(Pair::into_value), 31 | Some(&mut 4) 32 | ); 33 | assert_eq!(p.into_pairs().next_back().map(Pair::into_value), Some(4)); 34 | } 35 | 36 | #[test] 37 | fn iter() { 38 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 39 | 40 | check_exact_size_iterator!(p.iter()); 41 | check_exact_size_iterator!(p.iter_mut()); 42 | check_exact_size_iterator!(p.into_iter()); 43 | 44 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 45 | 46 | assert_eq!(p.iter().next_back(), Some(&4)); 47 | assert_eq!(p.iter_mut().next_back(), Some(&mut 4)); 48 | assert_eq!(p.into_iter().next_back(), Some(4)); 49 | } 50 | 51 | #[test] 52 | fn may_dangle() { 53 | let p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 54 | for element in &p { 55 | if *element == 2 { 56 | drop(p); 57 | break; 58 | } 59 | } 60 | 61 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 62 | for element in &mut p { 63 | if *element == 2 { 64 | drop(p); 65 | break; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_parse_stream.rs: -------------------------------------------------------------------------------- 1 | use syn::ext::IdentExt; 2 | use syn::parse::ParseStream; 3 | use syn::{Ident, Token}; 4 | 5 | #[test] 6 | fn test_peek() { 7 | _ = |input: ParseStream| { 8 | _ = input.peek(Ident); 9 | _ = input.peek(Ident::peek_any); 10 | _ = input.peek(Token![::]); 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_shebang.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | mod macros; 3 | 4 | #[test] 5 | fn test_basic() { 6 | let content = "#!/usr/bin/env rustx\nfn main() {}"; 7 | let file = syn::parse_file(content).unwrap(); 8 | snapshot!(file, @r###" 9 | File { 10 | shebang: Some("#!/usr/bin/env rustx"), 11 | items: [ 12 | Item::Fn { 13 | vis: Inherited, 14 | sig: Signature { 15 | ident: "main", 16 | generics: Generics, 17 | output: Default, 18 | }, 19 | block: Block, 20 | }, 21 | ], 22 | } 23 | "###); 24 | } 25 | 26 | #[test] 27 | fn test_comment() { 28 | let content = "#!//am/i/a/comment\n[allow(dead_code)] fn main() {}"; 29 | let file = syn::parse_file(content).unwrap(); 30 | snapshot!(file, @r###" 31 | File { 32 | attrs: [ 33 | Attribute { 34 | style: Inner, 35 | path: Path { 36 | segments: [ 37 | PathSegment { 38 | ident: "allow", 39 | arguments: None, 40 | }, 41 | ], 42 | }, 43 | tokens: TokenStream(`(dead_code)`), 44 | }, 45 | ], 46 | items: [ 47 | Item::Fn { 48 | vis: Inherited, 49 | sig: Signature { 50 | ident: "main", 51 | generics: Generics, 52 | output: Default, 53 | }, 54 | block: Block, 55 | }, 56 | ], 57 | } 58 | "###); 59 | } 60 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_should_parse.rs: -------------------------------------------------------------------------------- 1 | macro_rules! should_parse { 2 | ($name:ident, { $($in:tt)* }) => { 3 | #[test] 4 | fn $name() { 5 | // Make sure we can parse the file! 6 | syn::parse_file(stringify!($($in)*)).unwrap(); 7 | } 8 | } 9 | } 10 | 11 | should_parse!(generic_associated_type, { 12 | impl Foo { 13 | type Item = &'a i32; 14 | fn foo<'a>(&'a self) -> Self::Item<'a> {} 15 | } 16 | }); 17 | 18 | #[rustfmt::skip] 19 | should_parse!(const_generics_use, { 20 | type X = Foo<5>; 21 | type Y = Foo<"foo">; 22 | type Z = Foo; 23 | type W = Foo<{ X + 10 }>; 24 | }); 25 | 26 | should_parse!(trailing_plus_type, { 27 | type A = Box; 28 | type A = Box; 29 | type A = Box<'a + Foo>; 30 | }); 31 | 32 | should_parse!(generic_associated_type_where, { 33 | trait Foo { 34 | type Item; 35 | fn foo(&self, t: T) -> Self::Item; 36 | } 37 | }); 38 | 39 | should_parse!(match_with_block_expr, { 40 | fn main() { 41 | match false { 42 | _ => {}.a(), 43 | } 44 | } 45 | }); 46 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_size.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_pointer_width = "64")] 2 | 3 | use std::mem; 4 | use syn::{Expr, Item, Lit, Pat, Type}; 5 | 6 | #[test] 7 | fn test_expr_size() { 8 | assert_eq!(mem::size_of::(), 272); 9 | } 10 | 11 | #[test] 12 | fn test_item_size() { 13 | assert_eq!(mem::size_of::(), 320); 14 | } 15 | 16 | #[test] 17 | fn test_type_size() { 18 | assert_eq!(mem::size_of::(), 288); 19 | } 20 | 21 | #[test] 22 | fn test_pat_size() { 23 | assert_eq!(mem::size_of::(), 144); 24 | } 25 | 26 | #[test] 27 | fn test_lit_size() { 28 | assert_eq!(mem::size_of::(), 32); 29 | } 30 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/test_token_trees.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | mod macros; 3 | 4 | use proc_macro2::TokenStream; 5 | use quote::quote; 6 | use syn::Lit; 7 | 8 | #[test] 9 | fn test_struct() { 10 | let input = " 11 | #[derive(Debug, Clone)] 12 | pub struct Item { 13 | pub ident: Ident, 14 | pub attrs: Vec, 15 | } 16 | "; 17 | 18 | snapshot!(input as TokenStream, @r###" 19 | TokenStream( 20 | `# [derive (Debug , Clone)] pub struct Item { pub ident : Ident , pub attrs : Vec < Attribute >, }`, 21 | ) 22 | "###); 23 | } 24 | 25 | #[test] 26 | fn test_literal_mangling() { 27 | let code = "0_4"; 28 | let parsed: Lit = syn::parse_str(code).unwrap(); 29 | assert_eq!(code, quote!(#parsed).to_string()); 30 | } 31 | -------------------------------------------------------------------------------- /vendor/syn-1.0.109/tests/zzz_stable.rs: -------------------------------------------------------------------------------- 1 | #![cfg(syn_disable_nightly_tests)] 2 | 3 | use std::io::{self, Write}; 4 | use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; 5 | 6 | const MSG: &str = "\ 7 | ‖ 8 | ‖ WARNING: 9 | ‖ This is not a nightly compiler so not all tests were able to 10 | ‖ run. Syn includes tests that compare Syn's parser against the 11 | ‖ compiler's parser, which requires access to unstable librustc 12 | ‖ data structures and a nightly compiler. 13 | ‖ 14 | "; 15 | 16 | #[test] 17 | fn notice() -> io::Result<()> { 18 | let header = "WARNING"; 19 | let index_of_header = MSG.find(header).unwrap(); 20 | let before = &MSG[..index_of_header]; 21 | let after = &MSG[index_of_header + header.len()..]; 22 | 23 | let mut stderr = StandardStream::stderr(ColorChoice::Auto); 24 | stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 25 | write!(&mut stderr, "{}", before)?; 26 | stderr.set_color(ColorSpec::new().set_bold(true).set_fg(Some(Color::Yellow)))?; 27 | write!(&mut stderr, "{}", header)?; 28 | stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 29 | write!(&mut stderr, "{}", after)?; 30 | stderr.reset()?; 31 | 32 | Ok(()) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/syn/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/syn/benches/file.rs: -------------------------------------------------------------------------------- 1 | // $ cargo bench --features full,test --bench file 2 | 3 | #![feature(rustc_private, test)] 4 | #![recursion_limit = "1024"] 5 | #![allow( 6 | clippy::items_after_statements, 7 | clippy::manual_let_else, 8 | clippy::match_like_matches_macro, 9 | clippy::missing_panics_doc, 10 | clippy::must_use_candidate, 11 | clippy::uninlined_format_args 12 | )] 13 | 14 | extern crate test; 15 | 16 | #[macro_use] 17 | #[path = "../tests/macros/mod.rs"] 18 | mod macros; 19 | 20 | #[allow(dead_code)] 21 | #[path = "../tests/repo/mod.rs"] 22 | mod repo; 23 | 24 | use proc_macro2::{Span, TokenStream}; 25 | use std::fs; 26 | use std::str::FromStr; 27 | use syn::parse::{ParseStream, Parser}; 28 | use test::Bencher; 29 | 30 | const FILE: &str = "tests/rust/library/core/src/str/mod.rs"; 31 | 32 | fn get_tokens() -> TokenStream { 33 | repo::clone_rust(); 34 | let content = fs::read_to_string(FILE).unwrap(); 35 | TokenStream::from_str(&content).unwrap() 36 | } 37 | 38 | #[bench] 39 | fn baseline(b: &mut Bencher) { 40 | let tokens = get_tokens(); 41 | b.iter(|| drop(tokens.clone())); 42 | } 43 | 44 | #[bench] 45 | fn create_token_buffer(b: &mut Bencher) { 46 | let tokens = get_tokens(); 47 | fn immediate_fail(_input: ParseStream) -> syn::Result<()> { 48 | Err(syn::Error::new(Span::call_site(), "")) 49 | } 50 | b.iter(|| immediate_fail.parse2(tokens.clone())); 51 | } 52 | 53 | #[bench] 54 | fn parse_file(b: &mut Bencher) { 55 | let tokens = get_tokens(); 56 | b.iter(|| syn::parse2::(tokens.clone())); 57 | } 58 | -------------------------------------------------------------------------------- /vendor/syn/src/bigint.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{AddAssign, MulAssign}; 2 | 3 | // For implementing base10_digits() accessor on LitInt. 4 | pub(crate) struct BigInt { 5 | digits: Vec, 6 | } 7 | 8 | impl BigInt { 9 | pub(crate) fn new() -> Self { 10 | BigInt { digits: Vec::new() } 11 | } 12 | 13 | pub(crate) fn to_string(&self) -> String { 14 | let mut repr = String::with_capacity(self.digits.len()); 15 | 16 | let mut has_nonzero = false; 17 | for digit in self.digits.iter().rev() { 18 | has_nonzero |= *digit != 0; 19 | if has_nonzero { 20 | repr.push((*digit + b'0') as char); 21 | } 22 | } 23 | 24 | if repr.is_empty() { 25 | repr.push('0'); 26 | } 27 | 28 | repr 29 | } 30 | 31 | fn reserve_two_digits(&mut self) { 32 | let len = self.digits.len(); 33 | let desired = 34 | len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize; 35 | self.digits.resize(desired, 0); 36 | } 37 | } 38 | 39 | impl AddAssign for BigInt { 40 | // Assumes increment <16. 41 | fn add_assign(&mut self, mut increment: u8) { 42 | self.reserve_two_digits(); 43 | 44 | let mut i = 0; 45 | while increment > 0 { 46 | let sum = self.digits[i] + increment; 47 | self.digits[i] = sum % 10; 48 | increment = sum / 10; 49 | i += 1; 50 | } 51 | } 52 | } 53 | 54 | impl MulAssign for BigInt { 55 | // Assumes base <=16. 56 | fn mul_assign(&mut self, base: u8) { 57 | self.reserve_two_digits(); 58 | 59 | let mut carry = 0; 60 | for digit in &mut self.digits { 61 | let prod = *digit * base + carry; 62 | *digit = prod % 10; 63 | carry = prod / 10; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/syn/src/drops.rs: -------------------------------------------------------------------------------- 1 | use std::iter; 2 | use std::mem::ManuallyDrop; 3 | use std::ops::{Deref, DerefMut}; 4 | use std::option; 5 | use std::slice; 6 | 7 | #[repr(transparent)] 8 | pub(crate) struct NoDrop(ManuallyDrop); 9 | 10 | impl NoDrop { 11 | pub(crate) fn new(value: T) -> Self 12 | where 13 | T: TrivialDrop, 14 | { 15 | NoDrop(ManuallyDrop::new(value)) 16 | } 17 | } 18 | 19 | impl Deref for NoDrop { 20 | type Target = T; 21 | fn deref(&self) -> &Self::Target { 22 | &self.0 23 | } 24 | } 25 | 26 | impl DerefMut for NoDrop { 27 | fn deref_mut(&mut self) -> &mut Self::Target { 28 | &mut self.0 29 | } 30 | } 31 | 32 | pub(crate) trait TrivialDrop {} 33 | 34 | impl TrivialDrop for iter::Empty {} 35 | impl<'a, T> TrivialDrop for slice::Iter<'a, T> {} 36 | impl<'a, T> TrivialDrop for slice::IterMut<'a, T> {} 37 | impl<'a, T> TrivialDrop for option::IntoIter<&'a T> {} 38 | impl<'a, T> TrivialDrop for option::IntoIter<&'a mut T> {} 39 | 40 | #[test] 41 | fn test_needs_drop() { 42 | use std::mem::needs_drop; 43 | 44 | struct NeedsDrop; 45 | 46 | impl Drop for NeedsDrop { 47 | fn drop(&mut self) {} 48 | } 49 | 50 | assert!(needs_drop::()); 51 | 52 | // Test each of the types with a handwritten TrivialDrop impl above. 53 | assert!(!needs_drop::>()); 54 | assert!(!needs_drop::>()); 55 | assert!(!needs_drop::>()); 56 | assert!(!needs_drop::>()); 57 | assert!(!needs_drop::>()); 58 | } 59 | -------------------------------------------------------------------------------- /vendor/syn/src/export.rs: -------------------------------------------------------------------------------- 1 | #[doc(hidden)] 2 | pub use std::clone::Clone; 3 | #[doc(hidden)] 4 | pub use std::cmp::{Eq, PartialEq}; 5 | #[doc(hidden)] 6 | pub use std::concat; 7 | #[doc(hidden)] 8 | pub use std::default::Default; 9 | #[doc(hidden)] 10 | pub use std::fmt::Debug; 11 | #[doc(hidden)] 12 | pub use std::hash::{Hash, Hasher}; 13 | #[doc(hidden)] 14 | pub use std::marker::Copy; 15 | #[doc(hidden)] 16 | pub use std::option::Option::{None, Some}; 17 | #[doc(hidden)] 18 | pub use std::result::Result::{Err, Ok}; 19 | #[doc(hidden)] 20 | pub use std::stringify; 21 | 22 | #[doc(hidden)] 23 | pub type Formatter<'a> = std::fmt::Formatter<'a>; 24 | #[doc(hidden)] 25 | pub type FmtResult = std::fmt::Result; 26 | 27 | #[doc(hidden)] 28 | pub type bool = std::primitive::bool; 29 | #[doc(hidden)] 30 | pub type str = std::primitive::str; 31 | 32 | #[cfg(feature = "printing")] 33 | #[doc(hidden)] 34 | pub use quote; 35 | 36 | #[doc(hidden)] 37 | pub type Span = proc_macro2::Span; 38 | #[doc(hidden)] 39 | pub type TokenStream2 = proc_macro2::TokenStream; 40 | 41 | #[cfg(feature = "parsing")] 42 | #[doc(hidden)] 43 | pub use crate::group::{parse_braces, parse_brackets, parse_parens}; 44 | 45 | #[doc(hidden)] 46 | pub use crate::span::IntoSpans; 47 | 48 | #[cfg(all(feature = "parsing", feature = "printing"))] 49 | #[doc(hidden)] 50 | pub use crate::parse_quote::parse as parse_quote; 51 | 52 | #[cfg(feature = "parsing")] 53 | #[doc(hidden)] 54 | pub use crate::token::parsing::{peek_punct, punct as parse_punct}; 55 | 56 | #[cfg(feature = "printing")] 57 | #[doc(hidden)] 58 | pub use crate::token::printing::punct as print_punct; 59 | 60 | #[cfg(feature = "parsing")] 61 | #[doc(hidden)] 62 | pub use crate::token::private::CustomToken; 63 | 64 | #[cfg(feature = "proc-macro")] 65 | #[doc(hidden)] 66 | pub type TokenStream = proc_macro::TokenStream; 67 | 68 | #[cfg(feature = "printing")] 69 | #[doc(hidden)] 70 | pub use quote::{ToTokens, TokenStreamExt}; 71 | 72 | #[doc(hidden)] 73 | pub struct private(pub(crate) ()); 74 | -------------------------------------------------------------------------------- /vendor/syn/src/gen_helper.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "fold")] 2 | pub(crate) mod fold { 3 | use crate::punctuated::{Pair, Punctuated}; 4 | 5 | pub(crate) trait FoldHelper { 6 | type Item; 7 | fn lift(self, f: F) -> Self 8 | where 9 | F: FnMut(Self::Item) -> Self::Item; 10 | } 11 | 12 | impl FoldHelper for Vec { 13 | type Item = T; 14 | fn lift(self, f: F) -> Self 15 | where 16 | F: FnMut(Self::Item) -> Self::Item, 17 | { 18 | self.into_iter().map(f).collect() 19 | } 20 | } 21 | 22 | impl FoldHelper for Punctuated { 23 | type Item = T; 24 | fn lift(self, mut f: F) -> Self 25 | where 26 | F: FnMut(Self::Item) -> Self::Item, 27 | { 28 | self.into_pairs() 29 | .map(Pair::into_tuple) 30 | .map(|(t, u)| Pair::new(f(t), u)) 31 | .collect() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/syn/src/print.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::TokenStream; 2 | use quote::ToTokens; 3 | 4 | pub(crate) struct TokensOrDefault<'a, T: 'a>(pub &'a Option); 5 | 6 | impl<'a, T> ToTokens for TokensOrDefault<'a, T> 7 | where 8 | T: ToTokens + Default, 9 | { 10 | fn to_tokens(&self, tokens: &mut TokenStream) { 11 | match self.0 { 12 | Some(t) => t.to_tokens(tokens), 13 | None => T::default().to_tokens(tokens), 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/syn/src/sealed.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "parsing")] 2 | pub(crate) mod lookahead { 3 | pub trait Sealed: Copy {} 4 | } 5 | -------------------------------------------------------------------------------- /vendor/syn/src/span.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::extra::DelimSpan; 2 | use proc_macro2::{Delimiter, Group, Span, TokenStream}; 3 | 4 | #[doc(hidden)] 5 | pub trait IntoSpans { 6 | fn into_spans(self) -> S; 7 | } 8 | 9 | impl IntoSpans for Span { 10 | fn into_spans(self) -> Span { 11 | self 12 | } 13 | } 14 | 15 | impl IntoSpans<[Span; 1]> for Span { 16 | fn into_spans(self) -> [Span; 1] { 17 | [self] 18 | } 19 | } 20 | 21 | impl IntoSpans<[Span; 2]> for Span { 22 | fn into_spans(self) -> [Span; 2] { 23 | [self, self] 24 | } 25 | } 26 | 27 | impl IntoSpans<[Span; 3]> for Span { 28 | fn into_spans(self) -> [Span; 3] { 29 | [self, self, self] 30 | } 31 | } 32 | 33 | impl IntoSpans<[Span; 1]> for [Span; 1] { 34 | fn into_spans(self) -> [Span; 1] { 35 | self 36 | } 37 | } 38 | 39 | impl IntoSpans<[Span; 2]> for [Span; 2] { 40 | fn into_spans(self) -> [Span; 2] { 41 | self 42 | } 43 | } 44 | 45 | impl IntoSpans<[Span; 3]> for [Span; 3] { 46 | fn into_spans(self) -> [Span; 3] { 47 | self 48 | } 49 | } 50 | 51 | impl IntoSpans for Span { 52 | fn into_spans(self) -> DelimSpan { 53 | let mut group = Group::new(Delimiter::None, TokenStream::new()); 54 | group.set_span(self); 55 | group.delim_span() 56 | } 57 | } 58 | 59 | impl IntoSpans for DelimSpan { 60 | fn into_spans(self) -> DelimSpan { 61 | self 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/syn/src/verbatim.rs: -------------------------------------------------------------------------------- 1 | use crate::parse::ParseStream; 2 | use proc_macro2::{Delimiter, TokenStream}; 3 | use std::cmp::Ordering; 4 | use std::iter; 5 | 6 | pub(crate) fn between<'a>(begin: ParseStream<'a>, end: ParseStream<'a>) -> TokenStream { 7 | let end = end.cursor(); 8 | let mut cursor = begin.cursor(); 9 | assert!(crate::buffer::same_buffer(end, cursor)); 10 | 11 | let mut tokens = TokenStream::new(); 12 | while cursor != end { 13 | let (tt, next) = cursor.token_tree().unwrap(); 14 | 15 | if crate::buffer::cmp_assuming_same_buffer(end, next) == Ordering::Less { 16 | // A syntax node can cross the boundary of a None-delimited group 17 | // due to such groups being transparent to the parser in most cases. 18 | // Any time this occurs the group is known to be semantically 19 | // irrelevant. https://github.com/dtolnay/syn/issues/1235 20 | if let Some((inside, _span, after)) = cursor.group(Delimiter::None) { 21 | assert!(next == after); 22 | cursor = inside; 23 | continue; 24 | } else { 25 | panic!("verbatim end must not be inside a delimited group"); 26 | } 27 | } 28 | 29 | tokens.extend(iter::once(tt)); 30 | cursor = next; 31 | } 32 | tokens 33 | } 34 | -------------------------------------------------------------------------------- /vendor/syn/tests/common/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(clippy::module_name_repetitions, clippy::shadow_unrelated)] 3 | 4 | use rayon::ThreadPoolBuilder; 5 | use std::env; 6 | 7 | pub mod eq; 8 | pub mod parse; 9 | 10 | /// Read the `ABORT_AFTER_FAILURE` environment variable, and parse it. 11 | pub fn abort_after() -> usize { 12 | match env::var("ABORT_AFTER_FAILURE") { 13 | Ok(s) => s.parse().expect("failed to parse ABORT_AFTER_FAILURE"), 14 | Err(_) => usize::max_value(), 15 | } 16 | } 17 | 18 | /// Configure Rayon threadpool. 19 | pub fn rayon_init() { 20 | let stack_size = match env::var("RUST_MIN_STACK") { 21 | Ok(s) => s.parse().expect("failed to parse RUST_MIN_STACK"), 22 | Err(_) => 20 * 1024 * 1024, 23 | }; 24 | ThreadPoolBuilder::new() 25 | .stack_size(stack_size) 26 | .build_global() 27 | .unwrap(); 28 | } 29 | -------------------------------------------------------------------------------- /vendor/syn/tests/common/parse.rs: -------------------------------------------------------------------------------- 1 | extern crate rustc_ast; 2 | extern crate rustc_driver; 3 | extern crate rustc_expand; 4 | extern crate rustc_parse as parse; 5 | extern crate rustc_session; 6 | extern crate rustc_span; 7 | 8 | use rustc_ast::ast; 9 | use rustc_ast::ptr::P; 10 | use rustc_session::parse::ParseSess; 11 | use rustc_span::source_map::FilePathMapping; 12 | use rustc_span::FileName; 13 | use std::panic; 14 | 15 | pub fn librustc_expr(input: &str) -> Option> { 16 | match panic::catch_unwind(|| { 17 | let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(); 18 | let file_path_mapping = FilePathMapping::empty(); 19 | let sess = ParseSess::new(locale_resources, file_path_mapping); 20 | let e = parse::new_parser_from_source_str( 21 | &sess, 22 | FileName::Custom("test_precedence".to_string()), 23 | input.to_string(), 24 | ) 25 | .parse_expr(); 26 | match e { 27 | Ok(expr) => Some(expr), 28 | Err(diagnostic) => { 29 | diagnostic.emit(); 30 | None 31 | } 32 | } 33 | }) { 34 | Ok(Some(e)) => Some(e), 35 | Ok(None) => None, 36 | Err(_) => { 37 | errorf!("librustc panicked\n"); 38 | None 39 | } 40 | } 41 | } 42 | 43 | pub fn syn_expr(input: &str) -> Option { 44 | match syn::parse_str(input) { 45 | Ok(e) => Some(e), 46 | Err(msg) => { 47 | errorf!("syn failed to parse\n{:?}\n", msg); 48 | None 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/syn/tests/regression.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::let_underscore_untyped, clippy::uninlined_format_args)] 2 | 3 | mod regression { 4 | automod::dir!("tests/regression"); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/syn/tests/regression/issue1108.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn issue1108() { 3 | let data = "impl>::x for"; 4 | let _ = syn::parse_file(data); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/syn/tests/regression/issue1235.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::{Delimiter, Group}; 2 | use quote::quote; 3 | 4 | #[test] 5 | fn main() { 6 | // Okay. Rustc allows top-level `static` with no value syntactically, but 7 | // not semantically. Syn parses as Item::Verbatim. 8 | let tokens = quote! { 9 | pub static FOO: usize; 10 | pub static BAR: usize; 11 | }; 12 | let file = syn::parse2::(tokens).unwrap(); 13 | println!("{:#?}", file); 14 | 15 | // Okay. 16 | let inner = Group::new( 17 | Delimiter::None, 18 | quote!(static FOO: usize = 0; pub static BAR: usize = 0), 19 | ); 20 | let tokens = quote!(pub #inner;); 21 | let file = syn::parse2::(tokens).unwrap(); 22 | println!("{:#?}", file); 23 | 24 | // Formerly parser crash. 25 | let inner = Group::new( 26 | Delimiter::None, 27 | quote!(static FOO: usize; pub static BAR: usize), 28 | ); 29 | let tokens = quote!(pub #inner;); 30 | let file = syn::parse2::(tokens).unwrap(); 31 | println!("{:#?}", file); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/syn/tests/repo/progress.rs: -------------------------------------------------------------------------------- 1 | use std::io::{Read, Result}; 2 | use std::time::{Duration, Instant}; 3 | 4 | pub struct Progress { 5 | bytes: usize, 6 | tick: Instant, 7 | stream: R, 8 | } 9 | 10 | impl Progress { 11 | pub fn new(stream: R) -> Self { 12 | Progress { 13 | bytes: 0, 14 | tick: Instant::now() + Duration::from_millis(2000), 15 | stream, 16 | } 17 | } 18 | } 19 | 20 | impl Read for Progress { 21 | fn read(&mut self, buf: &mut [u8]) -> Result { 22 | let num = self.stream.read(buf)?; 23 | self.bytes += num; 24 | let now = Instant::now(); 25 | if now > self.tick { 26 | self.tick = now + Duration::from_millis(500); 27 | errorf!("downloading... {} bytes\n", self.bytes); 28 | } 29 | Ok(num) 30 | } 31 | } 32 | 33 | impl Drop for Progress { 34 | fn drop(&mut self) { 35 | errorf!("done ({} bytes)\n", self.bytes); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_asyncness.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | #[macro_use] 4 | mod macros; 5 | 6 | use syn::{Expr, Item}; 7 | 8 | #[test] 9 | fn test_async_fn() { 10 | let input = "async fn process() {}"; 11 | 12 | snapshot!(input as Item, @r###" 13 | Item::Fn { 14 | vis: Visibility::Inherited, 15 | sig: Signature { 16 | asyncness: Some, 17 | ident: "process", 18 | generics: Generics, 19 | output: ReturnType::Default, 20 | }, 21 | block: Block { 22 | stmts: [], 23 | }, 24 | } 25 | "###); 26 | } 27 | 28 | #[test] 29 | fn test_async_closure() { 30 | let input = "async || {}"; 31 | 32 | snapshot!(input as Expr, @r###" 33 | Expr::Closure { 34 | asyncness: Some, 35 | output: ReturnType::Default, 36 | body: Expr::Block { 37 | block: Block { 38 | stmts: [], 39 | }, 40 | }, 41 | } 42 | "###); 43 | } 44 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_grouping.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | #[macro_use] 4 | mod macros; 5 | 6 | use proc_macro2::{Delimiter, Group, Literal, Punct, Spacing, TokenStream, TokenTree}; 7 | use syn::Expr; 8 | 9 | #[test] 10 | fn test_grouping() { 11 | let tokens: TokenStream = TokenStream::from_iter(vec![ 12 | TokenTree::Literal(Literal::i32_suffixed(1)), 13 | TokenTree::Punct(Punct::new('+', Spacing::Alone)), 14 | TokenTree::Group(Group::new( 15 | Delimiter::None, 16 | TokenStream::from_iter(vec![ 17 | TokenTree::Literal(Literal::i32_suffixed(2)), 18 | TokenTree::Punct(Punct::new('+', Spacing::Alone)), 19 | TokenTree::Literal(Literal::i32_suffixed(3)), 20 | ]), 21 | )), 22 | TokenTree::Punct(Punct::new('*', Spacing::Alone)), 23 | TokenTree::Literal(Literal::i32_suffixed(4)), 24 | ]); 25 | 26 | assert_eq!(tokens.to_string(), "1i32 + 2i32 + 3i32 * 4i32"); 27 | 28 | snapshot!(tokens as Expr, @r###" 29 | Expr::Binary { 30 | left: Expr::Lit { 31 | lit: 1i32, 32 | }, 33 | op: BinOp::Add, 34 | right: Expr::Binary { 35 | left: Expr::Group { 36 | expr: Expr::Binary { 37 | left: Expr::Lit { 38 | lit: 2i32, 39 | }, 40 | op: BinOp::Add, 41 | right: Expr::Lit { 42 | lit: 3i32, 43 | }, 44 | }, 45 | }, 46 | op: BinOp::Mul, 47 | right: Expr::Lit { 48 | lit: 4i32, 49 | }, 50 | }, 51 | } 52 | "###); 53 | } 54 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_ident.rs: -------------------------------------------------------------------------------- 1 | use proc_macro2::{Ident, Span, TokenStream}; 2 | use std::str::FromStr; 3 | use syn::Result; 4 | 5 | fn parse(s: &str) -> Result { 6 | syn::parse2(TokenStream::from_str(s).unwrap()) 7 | } 8 | 9 | fn new(s: &str) -> Ident { 10 | Ident::new(s, Span::call_site()) 11 | } 12 | 13 | #[test] 14 | fn ident_parse() { 15 | parse("String").unwrap(); 16 | } 17 | 18 | #[test] 19 | fn ident_parse_keyword() { 20 | parse("abstract").unwrap_err(); 21 | } 22 | 23 | #[test] 24 | fn ident_parse_empty() { 25 | parse("").unwrap_err(); 26 | } 27 | 28 | #[test] 29 | fn ident_parse_lifetime() { 30 | parse("'static").unwrap_err(); 31 | } 32 | 33 | #[test] 34 | fn ident_parse_underscore() { 35 | parse("_").unwrap_err(); 36 | } 37 | 38 | #[test] 39 | fn ident_parse_number() { 40 | parse("255").unwrap_err(); 41 | } 42 | 43 | #[test] 44 | fn ident_parse_invalid() { 45 | parse("a#").unwrap_err(); 46 | } 47 | 48 | #[test] 49 | fn ident_new() { 50 | new("String"); 51 | } 52 | 53 | #[test] 54 | fn ident_new_keyword() { 55 | new("abstract"); 56 | } 57 | 58 | #[test] 59 | #[should_panic(expected = "use Option")] 60 | fn ident_new_empty() { 61 | new(""); 62 | } 63 | 64 | #[test] 65 | #[should_panic(expected = "not a valid Ident")] 66 | fn ident_new_lifetime() { 67 | new("'static"); 68 | } 69 | 70 | #[test] 71 | fn ident_new_underscore() { 72 | new("_"); 73 | } 74 | 75 | #[test] 76 | #[should_panic(expected = "use Literal instead")] 77 | fn ident_new_number() { 78 | new("255"); 79 | } 80 | 81 | #[test] 82 | #[should_panic(expected = "\"a#\" is not a valid Ident")] 83 | fn ident_new_invalid() { 84 | new("a#"); 85 | } 86 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_iterators.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | use syn::punctuated::{Pair, Punctuated}; 4 | use syn::Token; 5 | 6 | #[macro_use] 7 | mod macros; 8 | 9 | macro_rules! check_exact_size_iterator { 10 | ($iter:expr) => {{ 11 | let iter = $iter; 12 | let size_hint = iter.size_hint(); 13 | let len = iter.len(); 14 | let count = iter.count(); 15 | assert_eq!(len, count); 16 | assert_eq!(size_hint, (count, Some(count))); 17 | }}; 18 | } 19 | 20 | #[test] 21 | fn pairs() { 22 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 23 | 24 | check_exact_size_iterator!(p.pairs()); 25 | check_exact_size_iterator!(p.pairs_mut()); 26 | check_exact_size_iterator!(p.into_pairs()); 27 | 28 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 29 | 30 | assert_eq!(p.pairs().next_back().map(Pair::into_value), Some(&4)); 31 | assert_eq!( 32 | p.pairs_mut().next_back().map(Pair::into_value), 33 | Some(&mut 4) 34 | ); 35 | assert_eq!(p.into_pairs().next_back().map(Pair::into_value), Some(4)); 36 | } 37 | 38 | #[test] 39 | fn iter() { 40 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 41 | 42 | check_exact_size_iterator!(p.iter()); 43 | check_exact_size_iterator!(p.iter_mut()); 44 | check_exact_size_iterator!(p.into_iter()); 45 | 46 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 47 | 48 | assert_eq!(p.iter().next_back(), Some(&4)); 49 | assert_eq!(p.iter_mut().next_back(), Some(&mut 4)); 50 | assert_eq!(p.into_iter().next_back(), Some(4)); 51 | } 52 | 53 | #[test] 54 | fn may_dangle() { 55 | let p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 56 | for element in &p { 57 | if *element == 2 { 58 | drop(p); 59 | break; 60 | } 61 | } 62 | 63 | let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4); 64 | for element in &mut p { 65 | if *element == 2 { 66 | drop(p); 67 | break; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_parse_stream.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::let_underscore_untyped)] 2 | 3 | use syn::ext::IdentExt as _; 4 | use syn::parse::ParseStream; 5 | use syn::{Ident, Token}; 6 | 7 | #[test] 8 | fn test_peek() { 9 | let _ = |input: ParseStream| { 10 | let _ = input.peek(Ident); 11 | let _ = input.peek(Ident::peek_any); 12 | let _ = input.peek(Token![::]); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_shebang.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | #[macro_use] 4 | mod macros; 5 | 6 | #[test] 7 | fn test_basic() { 8 | let content = "#!/usr/bin/env rustx\nfn main() {}"; 9 | let file = syn::parse_file(content).unwrap(); 10 | snapshot!(file, @r###" 11 | File { 12 | shebang: Some("#!/usr/bin/env rustx"), 13 | items: [ 14 | Item::Fn { 15 | vis: Visibility::Inherited, 16 | sig: Signature { 17 | ident: "main", 18 | generics: Generics, 19 | output: ReturnType::Default, 20 | }, 21 | block: Block { 22 | stmts: [], 23 | }, 24 | }, 25 | ], 26 | } 27 | "###); 28 | } 29 | 30 | #[test] 31 | fn test_comment() { 32 | let content = "#!//am/i/a/comment\n[allow(dead_code)] fn main() {}"; 33 | let file = syn::parse_file(content).unwrap(); 34 | snapshot!(file, @r###" 35 | File { 36 | attrs: [ 37 | Attribute { 38 | style: AttrStyle::Inner, 39 | meta: Meta::List { 40 | path: Path { 41 | segments: [ 42 | PathSegment { 43 | ident: "allow", 44 | }, 45 | ], 46 | }, 47 | delimiter: MacroDelimiter::Paren, 48 | tokens: TokenStream(`dead_code`), 49 | }, 50 | }, 51 | ], 52 | items: [ 53 | Item::Fn { 54 | vis: Visibility::Inherited, 55 | sig: Signature { 56 | ident: "main", 57 | generics: Generics, 58 | output: ReturnType::Default, 59 | }, 60 | block: Block { 61 | stmts: [], 62 | }, 63 | }, 64 | ], 65 | } 66 | "###); 67 | } 68 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_should_parse.rs: -------------------------------------------------------------------------------- 1 | macro_rules! should_parse { 2 | ($name:ident, { $($in:tt)* }) => { 3 | #[test] 4 | fn $name() { 5 | // Make sure we can parse the file! 6 | syn::parse_file(stringify!($($in)*)).unwrap(); 7 | } 8 | } 9 | } 10 | 11 | should_parse!(generic_associated_type, { 12 | impl Foo { 13 | type Item = &'a i32; 14 | fn foo<'a>(&'a self) -> Self::Item<'a> {} 15 | } 16 | }); 17 | 18 | #[rustfmt::skip] 19 | should_parse!(const_generics_use, { 20 | type X = Foo<5>; 21 | type Y = Foo<"foo">; 22 | type Z = Foo; 23 | type W = Foo<{ X + 10 }>; 24 | }); 25 | 26 | should_parse!(trailing_plus_type, { 27 | type A = Box; 28 | type A = Box; 29 | type A = Box<'a + Foo>; 30 | }); 31 | 32 | should_parse!(generic_associated_type_where, { 33 | trait Foo { 34 | type Item; 35 | fn foo(&self, t: T) -> Self::Item; 36 | } 37 | }); 38 | 39 | should_parse!(match_with_block_expr, { 40 | fn main() { 41 | match false { 42 | _ => {}.a(), 43 | } 44 | } 45 | }); 46 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_size.rs: -------------------------------------------------------------------------------- 1 | // Assumes proc-macro2's "span-locations" feature is off. 2 | 3 | #![cfg(target_pointer_width = "64")] 4 | 5 | use std::mem; 6 | use syn::{Expr, Item, Lit, Pat, Type}; 7 | 8 | #[rustversion::attr(before(2022-11-24), ignore)] 9 | #[test] 10 | fn test_expr_size() { 11 | assert_eq!(mem::size_of::(), 176); 12 | } 13 | 14 | #[rustversion::attr(before(2022-09-09), ignore)] 15 | #[test] 16 | fn test_item_size() { 17 | assert_eq!(mem::size_of::(), 360); 18 | } 19 | 20 | #[rustversion::attr(before(2023-04-29), ignore)] 21 | #[test] 22 | fn test_type_size() { 23 | assert_eq!(mem::size_of::(), 232); 24 | } 25 | 26 | #[rustversion::attr(before(2023-04-29), ignore)] 27 | #[test] 28 | fn test_pat_size() { 29 | assert_eq!(mem::size_of::(), 184); 30 | } 31 | 32 | #[rustversion::attr(before(2023-12-20), ignore)] 33 | #[test] 34 | fn test_lit_size() { 35 | assert_eq!(mem::size_of::(), 24); 36 | } 37 | -------------------------------------------------------------------------------- /vendor/syn/tests/test_token_trees.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | #[macro_use] 4 | mod macros; 5 | 6 | use proc_macro2::TokenStream; 7 | use quote::quote; 8 | use syn::Lit; 9 | 10 | #[test] 11 | fn test_struct() { 12 | let input = " 13 | #[derive(Debug, Clone)] 14 | pub struct Item { 15 | pub ident: Ident, 16 | pub attrs: Vec, 17 | } 18 | "; 19 | 20 | snapshot!(input as TokenStream, @r###" 21 | TokenStream( 22 | `# [derive (Debug , Clone)] pub struct Item { pub ident : Ident , pub attrs : Vec < Attribute >, }`, 23 | ) 24 | "###); 25 | } 26 | 27 | #[test] 28 | fn test_literal_mangling() { 29 | let code = "0_4"; 30 | let parsed: Lit = syn::parse_str(code).unwrap(); 31 | assert_eq!(code, quote!(#parsed).to_string()); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/syn/tests/zzz_stable.rs: -------------------------------------------------------------------------------- 1 | #![cfg(syn_disable_nightly_tests)] 2 | 3 | use std::io::{self, Write}; 4 | use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; 5 | 6 | const MSG: &str = "\ 7 | ‖ 8 | ‖ WARNING: 9 | ‖ This is not a nightly compiler so not all tests were able to 10 | ‖ run. Syn includes tests that compare Syn's parser against the 11 | ‖ compiler's parser, which requires access to unstable librustc 12 | ‖ data structures and a nightly compiler. 13 | ‖ 14 | "; 15 | 16 | #[test] 17 | fn notice() -> io::Result<()> { 18 | let header = "WARNING"; 19 | let index_of_header = MSG.find(header).unwrap(); 20 | let before = &MSG[..index_of_header]; 21 | let after = &MSG[index_of_header + header.len()..]; 22 | 23 | let mut stderr = StandardStream::stderr(ColorChoice::Auto); 24 | stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 25 | write!(&mut stderr, "{}", before)?; 26 | stderr.set_color(ColorSpec::new().set_bold(true).set_fg(Some(Color::Yellow)))?; 27 | write!(&mut stderr, "{}", header)?; 28 | stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?; 29 | write!(&mut stderr, "{}", after)?; 30 | stderr.reset()?; 31 | 32 | Ok(()) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/unicode-ident/.cargo-checksum.json: -------------------------------------------------------------------------------- 1 | {"files":{"Cargo.toml":"7b10355305359d5feefb120329396a8823ce903cd66612d7d27612d51e6ceced","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844","README.md":"eff1f30712e93cc160101c25bf31738448c284b90636deb3e3a651cb9ad20dd1","benches/xid.rs":"a61f61ecc7d5124c759cdeb55ab74470ab69f2f3ca37613da65f16e0e5e33487","src/lib.rs":"2673969775cff349816e3fb30f62476a802523fe4940482288b75bd747cbe748","src/tables.rs":"ffe8e252eabccf261385865cb781b3d76c9f32f6f9503d00196a30fb92d80b29","tests/compare.rs":"62471ffb157744cac6faae1adafdbdf785349d7eb6dc2ff4b4941c9d618397f9","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"41fc751514b8bde658544d5fe7e100115d299d41897af855934b9f4ebda9d3a2","tests/fst/xid_start.fst":"ffa5e2bfe7dd5f6738fbe4b7a3e6e2083c9777191c54f8291a80d558ec4e2dd2","tests/roaring/mod.rs":"784f65a48477fab7549620c7843c7ad6da533f69a18abca1172f6acb95045e53","tests/static_size.rs":"4524332c1e424cb987d7cee1f47a98aea9ed7b256303a3828eda5aa1d06da240","tests/tables/mod.rs":"e6949172d10fc4b2431ce7546269bfd4f9146454c8c3e31faf5e5d80c16a8ab6","tests/tables/tables.rs":"011404dab8a3958da6e18a1fe9406c191675e6f49bf30ce813e3d05f582e750b","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"3c1ca56062f1b3ffdf2ae2063d3fee8d362b90082778056181b5c95e2e242ad8"},"package":"3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"} -------------------------------------------------------------------------------- /vendor/unicode-ident/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | edition = "2018" 14 | rust-version = "1.31" 15 | name = "unicode-ident" 16 | version = "1.0.12" 17 | authors = ["David Tolnay "] 18 | description = "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31" 19 | documentation = "https://docs.rs/unicode-ident" 20 | readme = "README.md" 21 | keywords = [ 22 | "unicode", 23 | "xid", 24 | ] 25 | categories = [ 26 | "development-tools::procedural-macro-helpers", 27 | "no-std", 28 | "no-std::no-alloc", 29 | ] 30 | license = "(MIT OR Apache-2.0) AND Unicode-DFS-2016" 31 | repository = "https://github.com/dtolnay/unicode-ident" 32 | 33 | [package.metadata.docs.rs] 34 | rustdoc-args = ["--generate-link-to-definition"] 35 | targets = ["x86_64-unknown-linux-gnu"] 36 | 37 | [lib] 38 | doc-scrape-examples = false 39 | 40 | [[bench]] 41 | name = "xid" 42 | harness = false 43 | 44 | [dev-dependencies.criterion] 45 | version = "0.5" 46 | default-features = false 47 | 48 | [dev-dependencies.fst] 49 | version = "0.4" 50 | 51 | [dev-dependencies.rand] 52 | version = "0.8" 53 | features = ["small_rng"] 54 | 55 | [dev-dependencies.roaring] 56 | version = "0.10" 57 | 58 | [dev-dependencies.ucd-trie] 59 | version = "0.1" 60 | default-features = false 61 | 62 | [dev-dependencies.unicode-xid] 63 | version = "0.2.4" 64 | -------------------------------------------------------------------------------- /vendor/unicode-ident/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/compare.rs: -------------------------------------------------------------------------------- 1 | mod fst; 2 | mod roaring; 3 | mod trie; 4 | 5 | #[test] 6 | fn compare_all_implementations() { 7 | let xid_start_fst = fst::xid_start_fst(); 8 | let xid_continue_fst = fst::xid_continue_fst(); 9 | let xid_start_roaring = roaring::xid_start_bitmap(); 10 | let xid_continue_roaring = roaring::xid_continue_bitmap(); 11 | 12 | for ch in '\0'..=char::MAX { 13 | let thought_to_be_start = unicode_ident::is_xid_start(ch); 14 | let thought_to_be_continue = unicode_ident::is_xid_continue(ch); 15 | 16 | // unicode-xid 17 | // FIXME: unicode-xid does not support Unicode 15.1.0 yet. 18 | /* 19 | assert_eq!( 20 | thought_to_be_start, 21 | unicode_xid::UnicodeXID::is_xid_start(ch), 22 | "{ch:?}", 23 | ); 24 | assert_eq!( 25 | thought_to_be_continue, 26 | unicode_xid::UnicodeXID::is_xid_continue(ch), 27 | "{ch:?}", 28 | ); 29 | */ 30 | 31 | // ucd-trie 32 | assert_eq!( 33 | thought_to_be_start, 34 | trie::XID_START.contains_char(ch), 35 | "{ch:?}", 36 | ); 37 | assert_eq!( 38 | thought_to_be_continue, 39 | trie::XID_CONTINUE.contains_char(ch), 40 | "{ch:?}", 41 | ); 42 | 43 | // fst 44 | assert_eq!( 45 | thought_to_be_start, 46 | xid_start_fst.contains((ch as u32).to_be_bytes()), 47 | "{ch:?}", 48 | ); 49 | assert_eq!( 50 | thought_to_be_continue, 51 | xid_continue_fst.contains((ch as u32).to_be_bytes()), 52 | "{ch:?}", 53 | ); 54 | 55 | // roaring 56 | assert_eq!( 57 | thought_to_be_start, 58 | xid_start_roaring.contains(ch as u32), 59 | "{ch:?}", 60 | ); 61 | assert_eq!( 62 | thought_to_be_continue, 63 | xid_continue_roaring.contains(ch as u32), 64 | "{ch:?}", 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/fst/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_name_repetitions)] 2 | 3 | pub fn xid_start_fst() -> fst::Set<&'static [u8]> { 4 | let data = include_bytes!("xid_start.fst"); 5 | fst::Set::from(fst::raw::Fst::new(data.as_slice()).unwrap()) 6 | } 7 | 8 | pub fn xid_continue_fst() -> fst::Set<&'static [u8]> { 9 | let data = include_bytes!("xid_continue.fst"); 10 | fst::Set::from(fst::raw::Fst::new(data.as_slice()).unwrap()) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/fst/xid_continue.fst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/vendor/unicode-ident/tests/fst/xid_continue.fst -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/fst/xid_start.fst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rudd-O/qubes-shared-folders/7fa918909dc72b723df4b23832ac11535c29e0c7/vendor/unicode-ident/tests/fst/xid_start.fst -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/roaring/mod.rs: -------------------------------------------------------------------------------- 1 | use roaring::RoaringBitmap; 2 | 3 | pub fn xid_start_bitmap() -> RoaringBitmap { 4 | let mut bitmap = RoaringBitmap::new(); 5 | for ch in '\0'..=char::MAX { 6 | if unicode_ident::is_xid_start(ch) { 7 | bitmap.insert(ch as u32); 8 | } 9 | } 10 | bitmap 11 | } 12 | 13 | pub fn xid_continue_bitmap() -> RoaringBitmap { 14 | let mut bitmap = RoaringBitmap::new(); 15 | for ch in '\0'..=char::MAX { 16 | if unicode_ident::is_xid_continue(ch) { 17 | bitmap.insert(ch as u32); 18 | } 19 | } 20 | bitmap 21 | } 22 | -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/tables/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | #[allow(clippy::redundant_static_lifetimes)] 4 | #[rustfmt::skip] 5 | mod tables; 6 | 7 | pub(crate) use self::tables::*; 8 | -------------------------------------------------------------------------------- /vendor/unicode-ident/tests/trie/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | #[allow(dead_code, clippy::redundant_static_lifetimes, clippy::unreadable_literal)] 4 | #[rustfmt::skip] 5 | mod trie; 6 | 7 | pub(crate) use self::trie::*; 8 | --------------------------------------------------------------------------------