diff -Nru distinst-0.1.0/bash/install_bios.sh distinst-0.2.0+1513882807+18.04~34a6ac4/bash/install_bios.sh --- distinst-0.1.0/bash/install_bios.sh 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/bash/install_bios.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -if [ ! -f "$1" ] -then - echo "$0 [squashfs]" >&2 - exit 1 -fi -SQUASHFS="$(realpath "$1")" - -IMAGE=bios.img - -set -ex - -dd if=/dev/zero of="${IMAGE}" bs=1G count=8 -parted -s "${IMAGE}" mklabel msdos -parted -s "${IMAGE}" print -parted -s "${IMAGE}" mkpart primary ext4 0% 100% -parted -s "${IMAGE}" print - -LO="$(sudo losetup --find --partscan --show "${IMAGE}")" - -sudo mkfs.ext4 "${LO}p1" - -DIR="$(mktemp -d)" - -sudo mount "${LO}p1" "$DIR" - -sudo unsquashfs -f -d "${DIR}/" "$SQUASHFS" - -sudo mount --bind /dev "${DIR}/dev" -sudo mount --bind /proc "${DIR}/proc" -sudo mount --bind /sys "${DIR}/sys" - -sudo chroot "${DIR}/" apt-get purge -y casper ubiquity -sudo chroot "${DIR}/" apt-get autoremove -y --purge - -ROOTDEV="$(sudo chroot "${DIR}/" df --output=source / | sed 1d)" -ROOTUUID="$(sudo chroot "${DIR}/" blkid -o value -s UUID "${ROOTDEV}")" -echo "# / was on ${ROOTDEV} during installation" | sudo chroot "${DIR}/" tee /etc/fstab -echo "UUID=${ROOTUUID} / ext4 errors=remount-ro 0 1" | sudo chroot "${DIR}/" tee -a /etc/fstab - -sudo chroot "${DIR}/" locale-gen --purge - -sudo chroot "${DIR}/" apt-get install -y xterm grub-pc - -sudo chroot "${DIR}/" grub-mkconfig -o /boot/grub/grub.cfg - -sudo grub-install --target=i386-pc --boot-directory="${DIR}/boot/" "${LO}" - -sudo umount "${DIR}/dev" -sudo umount "${DIR}/proc" -sudo umount "${DIR}/sys" - -sudo umount "${DIR}" || sudo umount -lf "${DIR}" - -rmdir "${DIR}" - -sudo losetup -d "${LO}" diff -Nru distinst-0.1.0/bash/install_efi.sh distinst-0.2.0+1513882807+18.04~34a6ac4/bash/install_efi.sh --- distinst-0.1.0/bash/install_efi.sh 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/bash/install_efi.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -if [ ! -f "$1" ] -then - echo "$0 [squashfs]" >&2 - exit 1 -fi -SQUASHFS="$(realpath "$1")" - -IMAGE=efi.img - -set -ex - -dd if=/dev/zero of="${IMAGE}" bs=1G count=8 -parted -s "${IMAGE}" mklabel gpt -parted -s "${IMAGE}" print -parted -s "${IMAGE}" mkpart primary fat32 0% 256M -parted -s "${IMAGE}" mkpart primary ext4 256M 100% -parted -s "${IMAGE}" print - -LO="$(sudo losetup --find --partscan --show "${IMAGE}")" - -sudo mkfs.fat -F 32 "${LO}p1" -sudo mkfs.ext4 "${LO}p2" - -DIR="$(mktemp -d)" - -sudo mount "${LO}p2" "${DIR}/" -sudo mkdir -p "${DIR}/boot/efi" -sudo mount "${LO}p1" "${DIR}/boot/efi" - -sudo unsquashfs -f -d "${DIR}/" "$SQUASHFS" - -sudo mount --bind /dev "${DIR}/dev" -sudo mount --bind /proc "${DIR}/proc" -sudo mount --bind /sys "${DIR}/sys" - -sudo chroot "${DIR}/" apt-get purge -y casper ubiquity -sudo chroot "${DIR}/" apt-get autoremove -y --purge - -ROOTDEV="$(sudo chroot "${DIR}/" df --output=source / | sed 1d)" -ROOTUUID="$(sudo chroot "${DIR}/" blkid -o value -s UUID "${ROOTDEV}")" -echo "# / was on ${ROOTDEV} during installation" | sudo chroot "${DIR}/" tee /etc/fstab -echo "UUID=${ROOTUUID} / ext4 errors=remount-ro 0 1" | sudo chroot "${DIR}/" tee -a /etc/fstab - -EFIDEV="$(sudo chroot "${DIR}/" df --output=source /boot/efi/ | sed 1d)" -EFIUUID="$(sudo chroot "${DIR}/" blkid -o value -s UUID "${EFIDEV}")" -echo "# /boot/efi was on ${EFIDEV} during installation" | sudo chroot "${DIR}/" tee -a /etc/fstab -echo "UUID=${EFIUUID} /boot/efi vfat umask=0077 0 1" | sudo chroot "${DIR}/" tee -a /etc/fstab - -sudo chroot "${DIR}/" locale-gen --purge - -sudo chroot "${DIR}/" apt-get install -y xterm grub-efi-amd64-signed - -sudo chroot "${DIR}/" grub-mkconfig -o /boot/grub/grub.cfg - -sudo grub-install --target=x86_64-efi --boot-directory="${DIR}/boot/" --efi-directory="${DIR}/boot/efi/" "${LO}" - -sudo umount "${DIR}/dev" -sudo umount "${DIR}/proc" -sudo umount "${DIR}/sys" - -sudo umount "${DIR}" || sudo umount -lf "${DIR}" - -rmdir "${DIR}" - -sudo losetup -d "${LO}" diff -Nru distinst-0.1.0/bash/run_bios.sh distinst-0.2.0+1513882807+18.04~34a6ac4/bash/run_bios.sh --- distinst-0.1.0/bash/run_bios.sh 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/bash/run_bios.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -qemu-system-x86_64 -enable-kvm -vga qxl -m 2G -hda bios.img -boot c diff -Nru distinst-0.1.0/bash/run_efi.sh distinst-0.2.0+1513882807+18.04~34a6ac4/bash/run_efi.sh --- distinst-0.1.0/bash/run_efi.sh 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/bash/run_efi.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cp /usr/share/OVMF/OVMF_VARS.fd efivars.img -qemu-system-x86_64 -enable-kvm -m 2048 -vga qxl -hda efi.img -boot c \ - -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \ - -drive if=pflash,format=raw,file=efivars.img diff -Nru distinst-0.1.0/.cargo/config distinst-0.2.0+1513882807+18.04~34a6ac4/.cargo/config --- distinst-0.1.0/.cargo/config 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/.cargo/config 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,5 @@ [source.crates-io] -replace-with = "local" +replace-with = "vendor" -[source.local] +[source.vendor] directory = "vendor" diff -Nru distinst-0.1.0/Cargo.lock distinst-0.2.0+1513882807+18.04~34a6ac4/Cargo.lock --- distinst-0.1.0/Cargo.lock 2017-09-08 15:58:31.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/Cargo.lock 2017-12-21 19:00:07.000000000 +0000 @@ -1,16 +1,3 @@ -[root] -name = "distinst" -version = "0.1.0" -dependencies = [ - "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "moz-cheddar 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pbr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syslog 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ansi_term" version = "0.9.0" @@ -18,11 +5,12 @@ [[package]] name = "atty" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -42,38 +30,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "cfg-if" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "clap" -version = "2.26.0" +version = "2.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "conv" -version = "0.3.3" +name = "distinst" +version = "0.2.0" +dependencies = [ + "clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "moz-cheddar 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pbr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "custom_derive" -version = "0.1.7" +name = "fuchsia-zircon-sys" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "kernel32-sys" @@ -86,7 +82,7 @@ [[package]] name = "libc" -version = "0.2.30" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -95,31 +91,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "magenta" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "magenta-sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "moz-cheddar" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -128,18 +107,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -148,13 +127,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "redox_termios" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "rustc-serialize" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.9.15" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -167,7 +154,7 @@ version = "0.58.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -196,22 +183,11 @@ ] [[package]] -name = "syslog" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "tempdir" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -224,21 +200,20 @@ ] [[package]] -name = "term_size" -version = "0.3.0" +name = "termion" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -248,25 +223,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" -version = "0.3.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "unicode-segmentation" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "unicode-width" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -277,15 +247,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "unix_socket" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "vec_map" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -302,40 +263,35 @@ [metadata] "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" -"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" +"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" -"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2267a8fdd4dce6956ba6649e130f62fb279026e5e84b92aa939ac8f85ce3f9f0" -"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" -"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" +"checksum clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b8c532887f1a292d17de05ae858a8fe50a301e196f9ef0ddb7ccd0d1d00f180" +"checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159" +"checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915" +"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2" "checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" -"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527" -"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699" -"checksum moz-cheddar 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ea88fbe82964741aa3b57ec5c34d8808aa5c7e058bb9781add200d391063ab" +"checksum moz-cheddar 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "43b29fdad80b06f38d959105a138ab8ca8c5a57c3435f5bfbd770fa73e625015" "checksum pbr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e048e3afebb6c454bb1c5d0fe73fda54698b4715d78ed8e7302447c37736d23a" -"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf" +"checksum rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd" "checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509" +"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" -"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" +"checksum serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6eda663e865517ee783b0891a3f6eb3a253e0b0dabb46418969ee9635beadd9e" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" -"checksum syslog 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bbc9b0acde4f7c05fdc1cfb05239b8a53a66815dd86c67fee5aa9bfac5b4ed42" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" -"checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" -"checksum textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f728584ea33b0ad19318e20557cb0a39097751dbb07171419673502f848c7af6" +"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" +"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520" -"checksum toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd86ad9ebee246fdedd610e0f6d0587b754a3d81438db930a244d0480ed7878f" -"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946" +"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff -Nru distinst-0.1.0/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/Cargo.toml --- distinst-0.1.0/Cargo.toml 2017-09-20 19:20:50.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,7 @@ [package] name = "distinst" description = "Distribution Installer Backend" -version = "0.1.0" +version = "0.2.0" authors = ["Jeremy Soller "] build = "build.rs" @@ -17,6 +17,5 @@ "libc" = "0.2" "log" = "0.3" "pbr" = "1.0" -"syslog" = "3.3" "tempdir" = "0.3" #TODO "libparted" = { "git" = "https://github.com/system76/libparted.git" } diff -Nru distinst-0.1.0/CODE_OF_CONDUCT.md distinst-0.2.0+1513882807+18.04~34a6ac4/CODE_OF_CONDUCT.md --- distinst-0.1.0/CODE_OF_CONDUCT.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/CODE_OF_CONDUCT.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +Contributors to this repo agree to be bound by the [Pop! Code of Conduct](https://github.com/pop-os/code-of-conduct). diff -Nru distinst-0.1.0/debian/changelog distinst-0.2.0+1513882807+18.04~34a6ac4/debian/changelog --- distinst-0.1.0/debian/changelog 2017-09-20 20:04:31.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/debian/changelog 2017-12-21 19:00:07.000000000 +0000 @@ -1,73 +1,6 @@ -distinst (0.1.0-4) artful; urgency=medium +distinst (0.2.0+1513882807+18.04~34a6ac4) bionic; urgency=medium - * Add more logging and init step + * Auto Build - -- Jeremy Soller Wed, 20 Sep 2017 14:04:31 -0600 + -- Pop OS (ISO Signing Key) Thu, 21 Dec 2017 12:00:07 -0700 -distinst (0.1.0-3) artful; urgency=medium - - * Add logging initialization function for C and Vala - - -- Jeremy Soller Fri, 08 Sep 2017 14:07:32 -0600 - -distinst (0.1.0-2) artful; urgency=medium - - * Add logging - * Improve reliability - * Purge distinst and io.elementary.installer - - -- Jeremy Soller Thu, 07 Sep 2017 21:26:41 -0600 - -distinst (0.1.0-1) artful; urgency=medium - - * Add fixes for DNS - * Produce unique machine ID - * Set LC_ALL - * Purge more packages - - -- Jeremy Soller Thu, 07 Sep 2017 14:33:35 -0600 - -distinst (0.1.0-0) artful; urgency=medium - - * Use cargo version followed by debian version - * Add vendor files - - -- Jeremy Soller Tue, 05 Sep 2017 11:50:28 -0600 - -distinst (0.0.6) artful; urgency=medium - - * Release for artful - * Fix system locale issue - * Use partx instead of partprobe - - -- Jeremy Soller Tue, 05 Sep 2017 11:12:32 -0600 - -distinst (0.0.5) xenial; urgency=medium - - * Add vapi - - -- Jeremy Soller Mon, 04 Sep 2017 16:02:07 -0600 - -distinst (0.0.4) xenial; urgency=medium - - * Switch to using `cargo-vendor` - - -- Jeremy Soller Mon, 04 Sep 2017 14:22:55 -0600 - -distinst (0.0.3) xenial; urgency=medium - - * Use `--frozen` with `cargo build` - - -- Jeremy Soller Mon, 04 Sep 2017 08:36:03 -0600 - -distinst (0.0.2) xenial; urgency=medium - - * Store dependencies locally with `make fetch` - - -- Jeremy Soller Mon, 04 Sep 2017 08:20:28 -0600 - -distinst (0.0.1) xenial; urgency=medium - - * Initial release. - - -- Jeremy Soller Sat, 02 Sep 2017 17:31:58 -0600 diff -Nru distinst-0.1.0/debian/control distinst-0.2.0+1513882807+18.04~34a6ac4/debian/control --- distinst-0.1.0/debian/control 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/debian/control 2017-12-21 19:00:07.000000000 +0000 @@ -5,8 +5,8 @@ Build-Depends: debhelper (>=9), cargo -Standards-Version: 3.9.8 -Homepage: https://github.com/system76/distinst +Standards-Version: 4.1.1 +Homepage: https://github.com/pop-os/distinst Package: distinst Architecture: amd64 diff -Nru distinst-0.1.0/debian/copyright distinst-0.2.0+1513882807+18.04~34a6ac4/debian/copyright --- distinst-0.1.0/debian/copyright 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/debian/copyright 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: distinst -Source: https://github.com/system76/distinst +Source: https://github.com/pop-os/distinst Files: * Copyright: Copyright 2017 System76 diff -Nru distinst-0.1.0/debian/rules distinst-0.2.0+1513882807+18.04~34a6ac4/debian/rules --- distinst-0.1.0/debian/rules 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/debian/rules 2017-12-21 19:00:07.000000000 +0000 @@ -1,24 +1,11 @@ #!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#DH_VERBOSE = 1 -# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - -# main packaging script based on dh7 syntax %: dh $@ +override_dh_auto_clean: + make clean + make vendor + override_dh_auto_install: dh_auto_install -- prefix=/usr diff -Nru distinst-0.1.0/examples/c/install.c distinst-0.2.0+1513882807+18.04~34a6ac4/examples/c/install.c --- distinst-0.1.0/examples/c/install.c 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/examples/c/install.c 2017-12-21 19:00:07.000000000 +0000 @@ -3,6 +3,23 @@ #include #include +const char * level_name (DISTINST_LOG_LEVEL level) { + switch(level) { + case DISTINST_LOG_LEVEL_TRACE: + return "Trace"; + case DISTINST_LOG_LEVEL_DEBUG: + return "Debug"; + case DISTINST_LOG_LEVEL_INFO: + return "Info"; + case DISTINST_LOG_LEVEL_WARN: + return "Warn"; + case DISTINST_LOG_LEVEL_ERROR: + return "Error"; + default: + return "Unknown"; + } +} + const char * step_name(DISTINST_STEP step) { switch(step) { case DISTINST_STEP_PARTITION: @@ -20,6 +37,10 @@ } } +void on_log(DISTINST_LOG_LEVEL level, const char * message, void * user_data) { + printf("Log: %s %s %p\n", level_name(level), message, user_data); +} + void on_error(const DistinstError * error, void * user_data) { printf("Error: %s %s %p\n", step_name(error->step), strerror(error->err), user_data); } @@ -29,13 +50,15 @@ } int main(int argc, char ** argv) { + distinst_log(on_log, (void*)0xFEEEF000); + DistinstInstaller * installer = distinst_installer_new(); distinst_installer_on_error(installer, on_error, (void*)0x12C0FFEE); distinst_installer_on_status(installer, on_status, (void *)0xDEADBEEF); DistinstConfig config = { .squashfs = "../../bash/filesystem.squashfs", - .drive = "/dev/sda", + .disk = "/dev/sda", }; distinst_installer_install(installer, &config); diff -Nru distinst-0.1.0/examples/vala/install.vala distinst-0.2.0+1513882807+18.04~34a6ac4/examples/vala/install.vala --- distinst-0.1.0/examples/vala/install.vala 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/examples/vala/install.vala 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,20 @@ +public static string level_name (Distinst.LogLevel level) { + switch(level) { + case Distinst.LogLevel.TRACE: + return "Trace"; + case Distinst.LogLevel.DEBUG: + return "Debug"; + case Distinst.LogLevel.INFO: + return "Info"; + case Distinst.LogLevel.WARN: + return "Warn"; + case Distinst.LogLevel.ERROR: + return "Error"; + default: + return "Unknown"; + } +} + public static string step_name (Distinst.Step step) { switch(step) { case Distinst.Step.PARTITION: @@ -16,9 +33,14 @@ } public static int main (string[] args) { - var installer = new Distinst.Installer (); var user_data = 0x12C0FFEE; + Distinst.log((level, message) => { + warning ("Log: %s %s %X", level_name (level), message, user_data); + }); + + var installer = new Distinst.Installer (); + installer.on_error((error) => { warning ("Error: %s %s %X", step_name (error.step), strerror (error.err), user_data); }); @@ -29,7 +51,7 @@ var config = Distinst.Config (); config.squashfs = "../../bash/filesystem.squashfs"; - config.drive = "/dev/sda"; + config.disk = "/dev/sda"; installer.install (config); diff -Nru distinst-0.1.0/Makefile distinst-0.2.0+1513882807+18.04~34a6ac4/Makefile --- distinst-0.1.0/Makefile 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/Makefile 2017-12-21 19:00:07.000000000 +0000 @@ -8,37 +8,50 @@ .PHONY: all clean distclean install uninstall update -all: target/release/distinst target/release/libdistinst.so target/include/distinst.h target/pkgconfig/distinst.pc +BIN=distinst + +all: target/release/$(BIN) target/release/lib$(BIN).so target/include/$(BIN).h target/pkgconfig/$(BIN).pc clean: cargo clean distclean: clean + rm -rf .cargo vendor install: all - install -D -m 0755 "target/release/distinst" "$(DESTDIR)$(bindir)/distinst" - install -D -m 0644 "target/release/libdistinst.so" "$(DESTDIR)$(libdir)/libdistinst.so" - install -D -m 0644 "target/include/distinst.h" "$(DESTDIR)$(includedir)/distinst.h" - install -D -m 0644 "target/pkgconfig/distinst.pc" "$(DESTDIR)$(datadir)/pkgconfig/distinst.pc" - install -D -m 0644 "src/distinst.vapi" "$(DESTDIR)$(datadir)/vala/vapi/distinst.vapi" + install -D -m 0755 "target/release/$(BIN)" "$(DESTDIR)$(bindir)/$(BIN)" + install -D -m 0644 "target/release/lib$(BIN).so" "$(DESTDIR)$(libdir)/lib$(BIN).so" + install -D -m 0644 "target/include/$(BIN).h" "$(DESTDIR)$(includedir)/$(BIN).h" + install -D -m 0644 "target/pkgconfig/$(BIN).pc" "$(DESTDIR)$(datadir)/pkgconfig/$(BIN).pc" + install -D -m 0644 "src/$(BIN).vapi" "$(DESTDIR)$(datadir)/vala/vapi/$(BIN).vapi" uninstall: - rm -f "$(DESTDIR)$(bindir)/distinst" - rm -f "$(DESTDIR)$(libdir)/libdistinst.so" - rm -f "$(DESTDIR)$(includedir)/distinst.h" - rm -f "$(DESTDIR)$(datadir)/pkgconfig/distinst.pc" - rm -f "$(DESTDIR)$(datadir)/vala/vapi/distinst.vapi" + rm -f "$(DESTDIR)$(bindir)/$(BIN)" + rm -f "$(DESTDIR)$(libdir)/lib$(BIN).so" + rm -f "$(DESTDIR)$(includedir)/$(BIN).h" + rm -f "$(DESTDIR)$(datadir)/pkgconfig/$(BIN).pc" + rm -f "$(DESTDIR)$(datadir)/vala/vapi/$(BIN).vapi" update: cargo update -vendor: +.cargo/config: vendor_config + mkdir -p .cargo + cp $< $@ + +vendor: .cargo/config cargo vendor + touch vendor -target/release/distinst target/release/libdistinst.so target/include/distinst.h target/pkgconfig/distinst.pc.stub: vendor - cargo build --frozen --release +target/release/$(BIN) target/release/lib$(BIN).so target/include/$(BIN).h target/pkgconfig/$(BIN).pc.stub: + if [ -d vendor ]; \ + then \ + cargo build --release --frozen; \ + else \ + cargo build --release; \ + fi -target/pkgconfig/distinst.pc: target/pkgconfig/distinst.pc.stub +target/pkgconfig/$(BIN).pc: target/pkgconfig/$(BIN).pc.stub echo "libdir=$(libdir)" > "$@.partial" echo "includedir=$(includedir)" >> "$@.partial" cat "$<" >> "$@.partial" diff -Nru distinst-0.1.0/src/configure.sh distinst-0.2.0+1513882807+18.04~34a6ac4/src/configure.sh --- distinst-0.1.0/src/configure.sh 2017-09-07 20:33:27.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/configure.sh 2017-12-21 19:00:07.000000000 +0000 @@ -37,7 +37,7 @@ update-locale --reset "LANG=${LANG}" # Remove installer packages -apt-get purge -y casper distinst io.elementary.installer ubiquity +apt-get purge -y casper distinst ubiquity apt-get autoremove -y --purge # Install grub packages diff -Nru distinst-0.1.0/src/c.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/c.rs --- distinst-0.1.0/src/c.rs 2017-09-20 20:04:23.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/c.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,10 +1,24 @@ extern crate libc; -use std::ffi::CStr; +use std::ffi::{CStr, CString}; use std::io; use super::{log, Config, Error, Installer, Status, Step}; +/// Log level +#[repr(C)] +#[derive(Copy, Clone, Debug)] +pub enum DISTINST_LOG_LEVEL { + TRACE, + DEBUG, + INFO, + WARN, + ERROR, +} + +/// Installer log callback +pub type DistinstLogCallback = extern "C" fn(level: DISTINST_LOG_LEVEL, message: *const libc::c_char, user_data: * mut libc::c_void); + /// Bootloader steps #[repr(C)] #[derive(Copy, Clone, Debug)] @@ -50,7 +64,7 @@ #[derive(Debug)] pub struct DistinstConfig { squashfs: *const libc::c_char, - drive: *const libc::c_char, + disk: *const libc::c_char, } impl DistinstConfig { @@ -60,14 +74,14 @@ io::Error::new(io::ErrorKind::InvalidData, format!("config.squashfs: Invalid UTF-8: {}", err)) })?; - let drive_cstr = CStr::from_ptr(self.drive); - let drive = drive_cstr.to_str().map_err(|err| { - io::Error::new(io::ErrorKind::InvalidData, format!("config.drive: Invalid UTF-8: {}", err)) + let disk_cstr = CStr::from_ptr(self.disk); + let disk = disk_cstr.to_str().map_err(|err| { + io::Error::new(io::ErrorKind::InvalidData, format!("config.disk: Invalid UTF-8: {}", err)) })?; Ok(Config { squashfs: squashfs.to_string(), - drive: drive.to_string(), + disk: disk.to_string(), }) } } @@ -100,14 +114,22 @@ /// Initialize logging #[no_mangle] -pub unsafe extern fn distinst_log(name: *const libc::c_char) -> libc::c_int { - let name_cstr = CStr::from_ptr(name); - let name_str = match name_cstr.to_str() { - Ok(name_str) => name_str, - Err(_err) => return libc::EINVAL - }; - - match log(name_str) { +pub unsafe extern fn distinst_log(callback: DistinstLogCallback, user_data: * mut libc::c_void) -> libc::c_int { + use DISTINST_LOG_LEVEL::*; + use log::LogLevel; + + let user_data_sync = user_data as usize; + match log(move |level, message| { + let c_level = match level { + LogLevel::Trace => TRACE, + LogLevel::Debug => DEBUG, + LogLevel::Info => INFO, + LogLevel::Warn => WARN, + LogLevel::Error => ERROR, + }; + let c_message = CString::new(message).unwrap(); + callback(c_level, c_message.as_ptr(), user_data_sync as * mut libc::c_void); + }) { Ok(()) => 0, Err(_err) => libc::EINVAL } diff -Nru distinst-0.1.0/src/disk/disk.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/disk.rs --- distinst-0.1.0/src/disk/disk.rs 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/disk.rs 2017-12-21 19:00:07.000000000 +0000 @@ -2,7 +2,7 @@ use std::path::PathBuf; use super::Partition; -use super::sys::Device; +use super::sys::{Device, Mount, Swap}; #[derive(Debug, Eq, Ord, PartialEq, PartialOrd)] pub struct Disk(Device); @@ -50,6 +50,16 @@ self.0.size() } + /// Get the current mount point of the device + pub fn mounts(&self) -> Result> { + self.0.mounts() + } + + /// Get the current swap point of the device + pub fn swaps(&self) -> Result> { + self.0.swaps() + } + /// Get disk partitions pub fn parts(&self) -> Result> { let mut parts = vec![]; diff -Nru distinst-0.1.0/src/disk/linux/device.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/device.rs --- distinst-0.1.0/src/disk/linux/device.rs 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/device.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,10 @@ use std::fs; use std::io::{Error, ErrorKind, Read, Result}; +use std::os::unix::ffi::OsStrExt; use std::path::{Path, PathBuf}; +use super::{Mount, Swap}; + #[derive(Debug, Eq, Ord, PartialEq, PartialOrd)] pub struct Device(String); @@ -73,7 +76,7 @@ Ok((major, minor)) } - /// Get the size of the disk in bytes + /// Get the size of the device in bytes pub fn size(&self) -> Result { let mut file = fs::File::open(&format!("/sys/class/block/{}/size", self.0))?; @@ -87,6 +90,30 @@ Ok(sectors * 512) } + /// Get the current mount point of the device + pub fn mounts(&self) -> Result> { + let mut mounts = Mount::all()?; + + let path = self.path(); + mounts.retain(|mount| { + mount.source.as_bytes().starts_with(path.as_os_str().as_bytes()) + }); + + Ok(mounts) + } + + /// Get the current swap point of the device + pub fn swaps(&self) -> Result> { + let mut swaps = Swap::all()?; + + let path = self.path(); + swaps.retain(|swap| { + swap.source.as_bytes().starts_with(path.as_os_str().as_bytes()) + }); + + Ok(swaps) + } + /// Get the children of the device pub fn children(&self) -> Result> { let mut devs = vec![]; diff -Nru distinst-0.1.0/src/disk/linux/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/mod.rs --- distinst-0.1.0/src/disk/linux/mod.rs 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,7 @@ pub use self::device::Device; +pub use self::mount::Mount; +pub use self::swap::Swap; mod device; +mod mount; +mod swap; diff -Nru distinst-0.1.0/src/disk/linux/mount.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/mount.rs --- distinst-0.1.0/src/disk/linux/mount.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/mount.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,77 @@ +use std::char; +use std::ffi::OsString; +use std::fs::File; +use std::io::{BufRead, BufReader, Error, ErrorKind, Result}; +use std::os::unix::ffi::OsStringExt; + +pub struct Mount { + pub source: OsString, + pub dest: OsString, + pub fs: OsString, + pub options: OsString, + pub dump: OsString, + pub pass: OsString, +} + +impl Mount { + fn parse_value(value: &str) -> Result { + let mut ret = Vec::new(); + + let mut bytes = value.bytes(); + while let Some(b) = bytes.next() { + match b { + b'\\' => { + let mut code = 0; + for _i in 0..3 { + if let Some(b) = bytes.next() { + code *= 8; + code += u32::from_str_radix(&(b as char).to_string(), 8).map_err(|err| { + Error::new(ErrorKind::Other, err) + })?; + } else { + return Err(Error::new(ErrorKind::Other, "truncated octal code")); + } + } + ret.push(code as u8); + }, + _ => { + ret.push(b); + } + } + } + + Ok(OsString::from_vec(ret)) + } + + fn parse_line(line: &str) -> Result { + let mut parts = line.split(' '); + + let source = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing source"))?; + let dest = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing dest"))?; + let fs = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing fs"))?; + let options = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing options"))?; + let dump = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing dump"))?; + let pass = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing pass"))?; + + Ok(Mount { + source: Self::parse_value(&source)?, + dest: Self::parse_value(&dest)?, + fs: Self::parse_value(&fs)?, + options: Self::parse_value(&options)?, + dump: Self::parse_value(&dump)?, + pass: Self::parse_value(&pass)? + }) + } + + pub fn all() -> Result> { + let mut ret = Vec::new(); + + let file = BufReader::new(File::open("/proc/self/mounts")?); + for line_res in file.lines() { + let line = line_res?; + ret.push(Self::parse_line(&line)?); + } + + Ok(ret) + } +} diff -Nru distinst-0.1.0/src/disk/linux/swap.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/swap.rs --- distinst-0.1.0/src/disk/linux/swap.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/linux/swap.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,74 @@ +use std::char; +use std::ffi::OsString; +use std::fs::File; +use std::io::{BufRead, BufReader, Error, ErrorKind, Result}; +use std::os::unix::ffi::OsStringExt; + +pub struct Swap { + pub source: OsString, + pub kind: OsString, + pub size: OsString, + pub used: OsString, + pub priority: OsString, +} + +impl Swap { + fn parse_value(value: &str) -> Result { + let mut ret = Vec::new(); + + let mut bytes = value.bytes(); + while let Some(b) = bytes.next() { + match b { + b'\\' => { + let mut code = 0; + for _i in 0..3 { + if let Some(b) = bytes.next() { + code *= 8; + code += u32::from_str_radix(&(b as char).to_string(), 8).map_err(|err| { + Error::new(ErrorKind::Other, err) + })?; + } else { + return Err(Error::new(ErrorKind::Other, "truncated octal code")); + } + } + ret.push(code as u8); + }, + _ => { + ret.push(b); + } + } + } + + Ok(OsString::from_vec(ret)) + } + + fn parse_line(line: &str) -> Result { + let mut parts = line.split_whitespace(); + + let source = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing source"))?; + let kind = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing kind"))?; + let size = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing size"))?; + let used = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing used"))?; + let priority = parts.next().ok_or(Error::new(ErrorKind::Other, "Missing priority"))?; + + Ok(Swap { + source: Self::parse_value(&source)?, + kind: Self::parse_value(&kind)?, + size: Self::parse_value(&size)?, + used: Self::parse_value(&used)?, + priority: Self::parse_value(&priority)? + }) + } + + pub fn all() -> Result> { + let mut ret = Vec::new(); + + let file = BufReader::new(File::open("/proc/swaps")?); + for line_res in file.lines().skip(1) { + let line = line_res?; + ret.push(Self::parse_line(&line)?); + } + + Ok(ret) + } +} diff -Nru distinst-0.1.0/src/disk/part.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/part.rs --- distinst-0.1.0/src/disk/part.rs 2017-09-06 16:04:14.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/disk/part.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,7 @@ use std::io::{Error, ErrorKind, Result}; use std::path::PathBuf; -use super::sys::Device; +use super::sys::{Device, Mount, Swap}; #[derive(Debug, Eq, Ord, PartialEq, PartialOrd)] pub struct Partition(Device); @@ -48,4 +48,14 @@ pub fn size(&self) -> Result { self.0.size() } + + /// Get the current mount point of the device + pub fn mounts(&self) -> Result> { + self.0.mounts() + } + + /// Get the current swap point of the device + pub fn swaps(&self) -> Result> { + self.0.swaps() + } } diff -Nru distinst-0.1.0/src/distinst.vapi distinst-0.2.0+1513882807+18.04~34a6ac4/src/distinst.vapi --- distinst-0.1.0/src/distinst.vapi 2017-09-20 20:04:23.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/distinst.vapi 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,17 @@ [CCode (cprefix = "Distinst", lower_case_cprefix = "distinst_", cheader_filename = "distinst.h")] namespace Distinst { + [CCode (cname = "DISTINST_LOG_LEVEL", has_type_id = false)] + public enum LogLevel { + TRACE, + DEBUG, + INFO, + WARN, + ERROR + } + + public delegate void LogCallback (Distinst.LogLevel level, string message); + [CCode (cname = "DISTINST_STEP", has_type_id = false)] public enum Step { INIT, @@ -14,7 +25,7 @@ [CCode (has_type_id = false, destroy_function = "")] public struct Config { string squashfs; - string drive; + string disk; } [CCode (has_type_id = false)] @@ -33,7 +44,7 @@ public delegate void StatusCallback (Distinst.Status status); - int log (string name); + int log (Distinst.LogCallback callback); [Compact] [CCode (free_function = "distinst_installer_destroy", has_type_id = false)] diff -Nru distinst-0.1.0/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/lib.rs --- distinst-0.1.0/src/lib.rs 2017-09-20 20:04:23.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -2,14 +2,14 @@ #[macro_use] extern crate log; -extern crate syslog; extern crate tempdir; use tempdir::TempDir; use std::{fs, io}; use std::io::Write; -use std::path::Path; +use std::path::{Path, PathBuf}; +use std::process::Command; use disk::Disk; use format::{MkfsKind, mkfs}; @@ -24,17 +24,17 @@ mod chroot; mod disk; mod format; +mod logger; mod mount; mod partition; mod squashfs; /// Initialize logging -pub fn log(name: &str) -> Result<(), syslog::SyslogError> { - match syslog::init( - syslog::Facility::LOG_SYSLOG, - log::LogLevelFilter::Debug, - Some(name) - ) { +pub fn log(callback: F) -> Result<(), log::SetLoggerError> { + match log::set_logger(|max_log_level| { + max_log_level.set(log::LogLevelFilter::Debug); + Box::new(logger::Logger::new(callback)) + }) { Ok(()) => { info!("Logging enabled"); Ok(()) @@ -75,7 +75,7 @@ #[derive(Debug)] pub struct Config { pub squashfs: String, - pub drive: String, + pub disk: String, } /// Installer error @@ -167,6 +167,66 @@ self.status_cb = Some(Box::new(callback)); } + fn initialize(config: &Config, mut callback: F) -> io::Result<(PathBuf, Disk)> { + info!("Initializing"); + + let squashfs = match Path::new(&config.squashfs).canonicalize() { + Ok(squashfs) => squashfs, + Err(err) => { + error!("config.squashfs: {}", err); + return Err(err); + } + }; + + callback(25); + + let disk = match Disk::from_name(&config.disk) { + Ok(disk) => disk, + Err(err) => { + error!("config.disk: {}", err); + return Err(err); + } + }; + + callback(50); + + for mount in disk.mounts()? { + info!( + "Unmounting '{}': {:?} is mounted at {:?}", + disk.name(), mount.source, mount.dest + ); + + let status = Command::new("umount").arg(&mount.source).status()?; + if ! status.success() { + return Err(io::Error::new( + io::ErrorKind::Other, + format!("umount failed with status: {}", status) + )); + } + } + + callback(75); + + for swap in disk.swaps()? { + info!( + "Unswapping '{}': {:?} is swapped", + disk.name(), swap.source, + ); + + let status = Command::new("swapoff").arg(&swap.source).status()?; + if ! status.success() { + return Err(io::Error::new( + io::ErrorKind::Other, + format!("swapoff failed with status: {}", status) + )); + } + } + + callback(100); + + Ok((squashfs, disk)) + } + fn partition(disk: &mut Disk, bootloader: Bootloader, mut callback: F) -> io::Result<()> { let disk_dev = disk.path(); info!("{}: Partitioning for {:?}", disk_dev.display(), bootloader); @@ -486,26 +546,13 @@ }; self.emit_status(&status); - let squashfs = match Path::new(&config.squashfs).canonicalize() { - Ok(squashfs) => squashfs, - Err(err) => { - error!("config.squashfs: {}", err); - let error = Error { - step: status.step, - err: err, - }; - self.emit_error(&error); - return Err(error.err); - } - }; - - status.percent = 50; - self.emit_status(&status); - - let mut disk = match Disk::from_name(&config.drive) { - Ok(disk) => disk, + let (squashfs, mut disk) = match Installer::initialize(&config, |percent| { + status.percent = percent; + self.emit_status(&status); + }) { + Ok(value) => value, Err(err) => { - error!("config.drive: {}", err); + error!("initialize: {}", err); let error = Error { step: status.step, err: err, @@ -515,9 +562,6 @@ } }; - status.percent = 100; - self.emit_status(&status); - let bootloader = Bootloader::detect(); info!("Detected {:?}", bootloader); diff -Nru distinst-0.1.0/src/logger.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/logger.rs --- distinst-0.1.0/src/logger.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/logger.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,25 @@ +use log::{Log, LogLevel, LogRecord, LogMetadata}; + +pub struct Logger { + callback: F +} + +impl Logger { + pub fn new(callback: F) -> Logger { + Logger { + callback: callback + } + } +} + +impl Log for Logger { + fn enabled(&self, _metadata: &LogMetadata) -> bool { + true + } + + fn log(&self, record: &LogRecord) { + if self.enabled(record.metadata()) { + (self.callback)(record.level(), &format!("{}", record.args())); + } + } +} diff -Nru distinst-0.1.0/src/main.rs distinst-0.2.0+1513882807+18.04~34a6ac4/src/main.rs --- distinst-0.1.0/src/main.rs 2017-09-20 20:04:23.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/src/main.rs 2017-12-21 19:00:07.000000000 +0000 @@ -17,17 +17,19 @@ .required(true) ) .arg( - Arg::with_name("drive") + Arg::with_name("disk") .required(true) ) .get_matches(); - if let Err(err) = distinst::log("distinst") { + if let Err(err) = distinst::log(|_level, message| { + println!("{}", message); + }) { println!("Failed to initialize logging: {}", err); } let squashfs = matches.value_of("squashfs").unwrap(); - let drive = matches.value_of("drive").unwrap(); + let disk = matches.value_of("disk").unwrap(); let pb_opt: Rc>>> = Rc::new(RefCell::new(None)); @@ -78,7 +80,7 @@ installer.install(&Config { squashfs: squashfs.to_string(), - drive: drive.to_string(), + disk: disk.to_string(), }) }; diff -Nru distinst-0.1.0/vendor/ansi_term/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/ansi_term/.cargo-checksum.json --- distinst-0.1.0/vendor/ansi_term/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/ansi_term/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"eb7113e5f5e36c2e00ae8e88a84dd5273505036520f2787133ba575d5fdd93c1","Cargo.toml":"ffe01d108855864ea3c975aad9da22d2a2324730022a5d4e119639f5850209db","LICENCE":"2762990c7fbba9d550802a2593c1d857dcd52596bb0f9f192a97e9a7ac5f4f9e","README.md":"ee22a0db93788e9bfe4c3cf4d7df5daf881a3105f941a915140a34018ff394e5","src/lib.rs":"867242d0699126af5a115709030888e958edfb835a0b3c15c4159a045f367e18"},"package":"23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"} \ No newline at end of file +{"files":{".travis.yml":"eb7113e5f5e36c2e00ae8e88a84dd5273505036520f2787133ba575d5fdd93c1","Cargo.toml":"ffe01d108855864ea3c975aad9da22d2a2324730022a5d4e119639f5850209db","LICENCE":"2762990c7fbba9d550802a2593c1d857dcd52596bb0f9f192a97e9a7ac5f4f9e","README.md":"ee22a0db93788e9bfe4c3cf4d7df5daf881a3105f941a915140a34018ff394e5","src/lib.rs":"867242d0699126af5a115709030888e958edfb835a0b3c15c4159a045f367e18"},"package":"23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/atty/appveyor.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/appveyor.yml --- distinst-0.1.0/vendor/atty/appveyor.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/appveyor.yml 2017-12-21 19:00:07.000000000 +0000 @@ -4,7 +4,6 @@ - TARGET: nightly-i686-pc-windows-msvc - TARGET: nightly-x86_64-pc-windows-gnu - TARGET: nightly-i686-pc-windows-gnu - - TARGET: 1.8.0-x86_64-pc-windows-gnu install: - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:TARGET}.exe" -FileName "rust-install.exe" - ps: .\rust-install.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null @@ -14,4 +13,4 @@ - cargo -vV build: false test_script: - - cargo test --verbose + - cargo build diff -Nru distinst-0.1.0/vendor/atty/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/.cargo-checksum.json --- distinst-0.1.0/vendor/atty/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"4752c993a36dc8b271f25998b2c0b34af65f82fb61f7d71d0e34612a8a7cd5b0","CHANGELOG.md":"a182831141a059342664a8aaf40b9fd7828e8004094fb42e1b17129a090899ec","Cargo.toml":"5fa1586ac82ee945f057b87c81acae6e588de2303536445b4a766028633347e0","LICENSE":"235760c32039b0a6b23207918b71c1aa5d8318ee651c0f245d290ba1f47631cf","README.md":"b23f66e15c8311e11cbc3b10bfc87a7cb10bc4d758c6a352b155127b48b970d7","appveyor.yml":"dfe3d3eddd762a3cc76174e03ea91c93f544ce7fa05fbca4975f1624757d65e4","examples/atty.rs":"1551387a71474d9ac1b5153231f884e9e05213badcfaa3494ad2cb7ea958374a","src/lib.rs":"4530fe39e123b042eb023e4cf98a81d5184d06c938d3604b002f418101beb524"},"package":"d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"} \ No newline at end of file +{"files":{".travis.yml":"9002419ea748e146ea85fd5c2646aaa6649168d4baf2e23de834c7e13e5742d3","CHANGELOG.md":"664089066ff064327c2b6caaf158f5c856613133392916fcbf68dccd4cfcedbf","Cargo.toml":"cab6e155dd2881d7fbcad66f2b93849c4328eef031147adee07f5222289c8635","LICENSE":"f3f8d32084848316048c5a1e125a3c5003eb32145a5f5f2a0d5586377324f9ba","README.md":"d951a533ae4cf9251c6f6ab4045461a7e4846ade9eb9c2f72b3a469d8279cf8a","appveyor.yml":"dea9c8da309cbb02bce31c613b697256f4cfada20b2f7b0c8911b73d569daf58","examples/atty.rs":"1551387a71474d9ac1b5153231f884e9e05213badcfaa3494ad2cb7ea958374a","rustfmt.toml":"bd196700242d17913cf8adead6912f55e9347e52ab5a001729d6c18d169f05c4","src/lib.rs":"90b420f94a0cbcd8bf4396c30da23747a1ce34ddb51a86f3410ed34b8d0040b2"},"package":"21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/atty/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/Cargo.toml --- distinst-0.1.0/vendor/atty/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,17 +1,35 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + [package] name = "atty" -version = "0.2.2" +version = "0.2.3" authors = ["softprops "] description = "A simple interface for querying atty" -documentation = "http://softprops.github.io/atty" homepage = "https://github.com/softprops/atty" -repository = "https://github.com/softprops/atty" +documentation = "http://softprops.github.io/atty" +readme = "README.md" keywords = ["terminal", "tty"] license = "MIT" +repository = "https://github.com/softprops/atty" +[target."cfg(target_os = \"redox\")".dependencies.termion] +version = "1.5" +[target."cfg(windows)".dependencies.kernel32-sys] +version = "0.2" -[target.'cfg(not(windows))'.dependencies] -libc = "0.2" - -[target.'cfg(windows)'.dependencies] -kernel32-sys = "0.2" -winapi = "0.2" +[target."cfg(windows)".dependencies.winapi] +version = "0.2" +[target."cfg(unix)".dependencies.libc] +version = "0.2" +default-features = false +[badges.travis-ci] +repository = "softprops/atty" diff -Nru distinst-0.1.0/vendor/atty/CHANGELOG.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/CHANGELOG.md --- distinst-0.1.0/vendor/atty/CHANGELOG.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/CHANGELOG.md 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,7 @@ +# 0.2.3 + +* added support for Redox OS [#14](https://github.com/softprops/atty/pull/14) + # 0.2.2 * use target specific dependencies [#11](https://github.com/softprops/atty/pull/11) diff -Nru distinst-0.1.0/vendor/atty/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/LICENSE --- distinst-0.1.0/vendor/atty/LICENSE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/LICENSE 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2015-2016 Doug Tangren +Copyright (c) 2015-2017 Doug Tangren Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru distinst-0.1.0/vendor/atty/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/README.md --- distinst-0.1.0/vendor/atty/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -5,7 +5,16 @@ > are you or are you not a tty? -[Api documentation](http://softprops.github.io/atty) +[Documentation](http://softprops.github.io/atty) + +## install + +Add the following to your `Cargo.toml` + +```toml +[dependencies] +atty = "0.2" +``` ## usage @@ -23,15 +32,6 @@ } ``` -## install - -Add the following to your `Cargo.toml` - -```toml -[dependencies] -atty = "0.2" -``` - ## testing This library has been unit tested on both unix and windows platforms (via appveyor). @@ -75,4 +75,4 @@ stdin? true ``` -Doug Tangren (softprops) 2015 +Doug Tangren (softprops) 2015-2017 diff -Nru distinst-0.1.0/vendor/atty/rustfmt.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/rustfmt.toml --- distinst-0.1.0/vendor/atty/rustfmt.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/rustfmt.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,10 @@ +# keep imports tidy +reorder_imported_names = true +reorder_imports = true +reorder_imports_in_group = true +# there is no try! +use_try_shorthand = true +# don't create rustfmt artifacts +write_mode = "Replace" +# reduce wide load +max_width = 80 \ No newline at end of file diff -Nru distinst-0.1.0/vendor/atty/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/src/lib.rs --- distinst-0.1.0/vendor/atty/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -15,12 +15,16 @@ //! } //! ``` +#![cfg_attr(unix, no_std)] + #[cfg(windows)] extern crate kernel32; -#[cfg(not(windows))] +#[cfg(unix)] extern crate libc; #[cfg(windows)] extern crate winapi; +#[cfg(target_os = "redox")] +extern crate termion; #[cfg(windows)] use winapi::minwindef::DWORD; @@ -49,11 +53,8 @@ /// returns true if this is a tty #[cfg(windows)] pub fn is(stream: Stream) -> bool { - use winapi::{ - STD_INPUT_HANDLE as STD_INPUT, - STD_ERROR_HANDLE as STD_ERROR, - STD_OUTPUT_HANDLE as STD_OUTPUT - }; + use winapi::{STD_ERROR_HANDLE as STD_ERROR, STD_INPUT_HANDLE as STD_INPUT, + STD_OUTPUT_HANDLE as STD_OUTPUT}; let (fd, others) = match stream { Stream::Stdin => (STD_INPUT, [STD_ERROR, STD_OUTPUT]), @@ -117,24 +118,42 @@ kernel32::GetStdHandle(fd), FileNameInfo, &mut *name_info_bytes as *mut _ as *mut c_void, - name_info_bytes.len() as u32); + name_info_bytes.len() as u32, + ); if res == 0 { return true; } - let name_info: FILE_NAME_INFO = - *(name_info_bytes[0..size].as_ptr() as *const FILE_NAME_INFO); + let name_info: FILE_NAME_INFO = *(name_info_bytes[0..size].as_ptr() as + *const FILE_NAME_INFO); let name_bytes = &name_info_bytes[size..size + name_info.FileNameLength as usize]; let name_u16 = slice::from_raw_parts( - name_bytes.as_ptr() as *const u16, name_bytes.len() / 2); + name_bytes.as_ptr() as *const u16, + name_bytes.len() / 2, + ); let name = OsString::from_wide(name_u16) - .as_os_str().to_string_lossy().into_owned(); + .as_os_str() + .to_string_lossy() + .into_owned(); name.contains("msys-") || name.contains("-pty") } +/// returns true if this is a tty +#[cfg(target_os = "redox")] +pub fn is(stream: Stream) -> bool { + use std::io; + use termion::is_tty; + + match stream { + Stream::Stdin => is_tty(&io::stdin()), + Stream::Stdout => is_tty(&io::stdout()), + Stream::Stderr => is_tty(&io::stderr()), + } +} + #[cfg(test)] mod tests { - use super::{is, Stream}; + use super::{Stream, is}; #[test] #[cfg(windows)] @@ -172,7 +191,7 @@ #[cfg(target_os = "macos")] fn is_in() { // macos on travis seems to pipe its input - assert!(!is(Stream::Stdin)) + assert!(is(Stream::Stdin)) } #[test] diff -Nru distinst-0.1.0/vendor/atty/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/.travis.yml --- distinst-0.1.0/vendor/atty/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/atty/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -4,41 +4,70 @@ fast_finish: true include: - rust: nightly + - rust: nightly + os: osx + - rust: beta - rust: beta + os: osx - rust: stable - - rust: 1.8.0 -os: - - linux - - osx + - rust: stable + os: osx + allow_failures: + - rust: nightly + +before_cache: + # Travis can't cache files that are not readable by "others" + - chmod -R a+r $HOME/.cargo + +before_install: + # install kcov + - > + if [ ! -d "$HOME/.kcov/bin" ]; then + wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && + tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && + cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/.kcov .. && make && make install && cd ../.. + fi + - export PATH=$HOME/.kcov/bin:$PATH + script: - cargo build - - cargo test + cache: + cargo: true apt: true directories: - target/debug/deps - target/debug/build + addons: apt: packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - - binutils-dev # required for `kcov --verify` - - libbfd-dev # required for `kcov --verify` -after_success: | - [ $TRAVIS_RUST_VERSION = stable ] && - wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && - tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp && cd ../.. && - ls target/debug && - ./kcov-master/tmp/usr/local/bin/kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/atty-* && - [ $TRAVIS_BRANCH = master ] && - [ $TRAVIS_PULL_REQUEST = false ] && - cargo doc --no-deps && - echo "" > target/doc/index.html && - pip install --user ghp-import && - /home/travis/.local/bin/ghp-import -n target/doc && - git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages -env: - global: - secure: acjXoBFG4yFklz/iW4q9PLaMmTgug0c8hOov4uiaXYjDkVGhnEePBozGc8ctKuFv2BVlwBSzvE1neE9dHcCS6il0x+G79sVTekfVN5dERja3UpwrC0/QodJuDmErIUpb6zylupPnUGq5pzZabRPNKyAnsFS5wYhLMSLxGPu4pfYdW0Eu8CEPIgPYsI6o2pfKgNpXbeizdHRLMeZCN4cbEPohO1odc+Z6WJvgKn2xEkpAcfhAuaroqGGxRtmDiJZ/JaBijAKY/O9Q3Xq1GSGOPT5lmwJSp3Fxw5dgmeX6LmN0ZODASdnEoYfoqUDUFzkCON3Sk4a7hugxlkZ7cx1tfqXxMg+0BgYIUdGQNloDJnuusWvXPBFdB2jxMsfcbrCjNsrJ8kjN6uBsW9yy0kqN7a8eOJckwh5fYRWfNta0R+BrveNXWmGp4u4aBq/85jEiHi30XKTzaEUbF0Y3cIONweWeWwBOcAvPBhO63Y07TRRe+SSk1NYm7QHGW9RsHhz89OSbaIXqn+r/o+6DZcw5XaO73DtZ62Kx48NErej9kVqcIJ6HnyvCJ/fJoT7h1ixSRI/WmS30l2S/q33Q2G4C/IZ4ZZRD/1thSltAxeA6OAUnr8ITZyW47CqOmyL1IUptrdAb9OLEedYV/QrOhcg2RJLXyP66xnItOwMp014bEp4= + - libcurl4-openssl-dev + - libelf-dev + - libdw-dev + - binutils-dev + - libiberty-dev + +after_success: + - '[ $TRAVIS_RUST_VERSION = stable ] && + [ $TRAVIS_BRANCH = master ] && + [ $TRAVIS_PULL_REQUEST = false ] && + (ls target/debug && + RUSTFLAGS="-C link-dead-code" cargo test --no-run && + for file in target/debug/atty-*; do + if [[ "${file: -2}" != ".d" ]]; then + mkdir -p "target/cov/$(basename $file)"; + kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; + fi; + done && + kcov --coveralls-id=$COVERALLS_REPO_TOKEN --merge target/cov target/cov/* && + echo "covered") || true' + - '[ $TRAVIS_RUST_VERSION = stable ] && + [ $TRAVIS_BRANCH = master ] && + [ $TRAVIS_PULL_REQUEST = false ] + && cargo doc --no-deps && + echo "" > target/doc/index.html && + pip install --user ghp-import && + /home/travis/.local/bin/ghp-import -n target/doc && + git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages && + echo "documented"' \ No newline at end of file diff -Nru distinst-0.1.0/vendor/bitflags/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags/.cargo-checksum.json --- distinst-0.1.0/vendor/bitflags/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"e7a77c1800f9852e4c9a2acb9df041773ecd0bc005bd1b0657ae0512c67100ac","Cargo.toml":"f35826eec96c765ae8aee4f8a66c6b3cb0d918b49935baf05bae79b6df8e1077","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"602c63819e332e93c85dc8426db4855f18fe0fabbd642c5b2303ed83f1ba926f","src/example_generated.rs":"161b69d92cf6e5fa4b5dc30f06031f3a0fb590b44be2bcf0f31cb8be4fab36fa","src/lib.rs":"56e86a16356d9322fa6b4e9b910041e2e7558c08b52ffbdacc647eba36b37abc","tests/conflicting_trait_impls.rs":"79993ea67ef09a5f99fddd69d8b73b1c137e41d0e8f8535f03865d6766dcc498","tests/external.rs":"15f7901698e286197666ccd309ad1debd3c35eaff680ca090368494e8b06ccf2","tests/external_no_std.rs":"c3556fd19dd91d1b093eb6a65d09a9d0985544f0377ba3d30c0e265c956f7237","tests/i128_bitflags.rs":"c955ef2c9fd385848195bb416e660e946ccbe59acc87862ef2646eb082d82e3f"},"package":"4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"} \ No newline at end of file +{"files":{".travis.yml":"e7a77c1800f9852e4c9a2acb9df041773ecd0bc005bd1b0657ae0512c67100ac","Cargo.toml":"f35826eec96c765ae8aee4f8a66c6b3cb0d918b49935baf05bae79b6df8e1077","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"602c63819e332e93c85dc8426db4855f18fe0fabbd642c5b2303ed83f1ba926f","src/example_generated.rs":"161b69d92cf6e5fa4b5dc30f06031f3a0fb590b44be2bcf0f31cb8be4fab36fa","src/lib.rs":"56e86a16356d9322fa6b4e9b910041e2e7558c08b52ffbdacc647eba36b37abc","tests/conflicting_trait_impls.rs":"79993ea67ef09a5f99fddd69d8b73b1c137e41d0e8f8535f03865d6766dcc498","tests/external.rs":"15f7901698e286197666ccd309ad1debd3c35eaff680ca090368494e8b06ccf2","tests/external_no_std.rs":"c3556fd19dd91d1b093eb6a65d09a9d0985544f0377ba3d30c0e265c956f7237","tests/i128_bitflags.rs":"c955ef2c9fd385848195bb416e660e946ccbe59acc87862ef2646eb082d82e3f"},"package":"4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/bitflags-0.7.0/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags-0.7.0/.cargo-checksum.json --- distinst-0.1.0/vendor/bitflags-0.7.0/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags-0.7.0/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"2b615144d3f4b2e63ba6ec435cc18df7d76354aa07c2a02d6c707028cc448784","Cargo.toml":"db8c2e9ea912c5f3d2d89cf4cf936c448300e356b0fb533db8875923cb135256","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"8cfbc986af45867d9e620188af2392320fe6e0d9536753ba415c94ab522f5fb5","src/lib.rs":"618ce383bb219725363fba174fc66beb4874d9682e5da953f9e3e9cb3f786d5f","tests/external.rs":"546e549ec831876a5dc272bd0537adc9e9886c6da54656c825e7bffc079e2c74","tests/external_no_std.rs":"48929f5109aabc156442d5ae2ab07b4bce5d648488bf49dba725f6ab23bcb48a"},"package":"aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"} \ No newline at end of file +{"files":{".travis.yml":"2b615144d3f4b2e63ba6ec435cc18df7d76354aa07c2a02d6c707028cc448784","Cargo.toml":"db8c2e9ea912c5f3d2d89cf4cf936c448300e356b0fb533db8875923cb135256","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"8cfbc986af45867d9e620188af2392320fe6e0d9536753ba415c94ab522f5fb5","src/lib.rs":"618ce383bb219725363fba174fc66beb4874d9682e5da953f9e3e9cb3f786d5f","tests/external.rs":"546e549ec831876a5dc272bd0537adc9e9886c6da54656c825e7bffc079e2c74","tests/external_no_std.rs":"48929f5109aabc156442d5ae2ab07b4bce5d648488bf49dba725f6ab23bcb48a"},"package":"aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/bitflags-0.8.2/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags-0.8.2/.cargo-checksum.json --- distinst-0.1.0/vendor/bitflags-0.8.2/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/bitflags-0.8.2/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"793de473e858941a0d41e0c4e114373bca6b822737cdcf5ff8f36238a9b51837","Cargo.toml":"98d1298b1d79ccc587957062cf1c56712f68ee2796bed5f39c8d334133d9c562","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"1cce1c9c1fe2cf40ec1c6a0384f8cc2f0c5c40ece4acfedd64330ed95ef74e44","src/lib.rs":"006a631d800f713e2ffc74e33f65fd47505eec1b047c109e180905a9dcb7e973","tests/external.rs":"546e549ec831876a5dc272bd0537adc9e9886c6da54656c825e7bffc079e2c74","tests/external_no_std.rs":"48929f5109aabc156442d5ae2ab07b4bce5d648488bf49dba725f6ab23bcb48a","tests/i128_bitflags.rs":"fb1bf9e01f528478539c52de94e82a96b2639dc271ea242fea6ebb32dcb0f99e"},"package":"1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"} \ No newline at end of file +{"files":{".travis.yml":"793de473e858941a0d41e0c4e114373bca6b822737cdcf5ff8f36238a9b51837","Cargo.toml":"98d1298b1d79ccc587957062cf1c56712f68ee2796bed5f39c8d334133d9c562","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"1cce1c9c1fe2cf40ec1c6a0384f8cc2f0c5c40ece4acfedd64330ed95ef74e44","src/lib.rs":"006a631d800f713e2ffc74e33f65fd47505eec1b047c109e180905a9dcb7e973","tests/external.rs":"546e549ec831876a5dc272bd0537adc9e9886c6da54656c825e7bffc079e2c74","tests/external_no_std.rs":"48929f5109aabc156442d5ae2ab07b4bce5d648488bf49dba725f6ab23bcb48a","tests/i128_bitflags.rs":"fb1bf9e01f528478539c52de94e82a96b2639dc271ea242fea6ebb32dcb0f99e"},"package":"1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/cfg-if/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/.cargo-checksum.json --- distinst-0.1.0/vendor/cfg-if/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"50f67b20a376d437e0706d9bbb0343c677295529991370b2962f814c0b2efea3","Cargo.toml":"764b9ce160653e841430da3919ff968b957ff811f7da42c8483c8bfc2f06be25","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"3fa9368c60bc701dea294fbacae0469188c4be1de79f82e972bb9b321776cd52","src/lib.rs":"6915169e3ca05f28e1cb0e052379d74f2496400de1240b74c56e55c2674a6560","tests/xcrate.rs":"30dcb70fbb9c96fda2b7825592558279f534776f72e2a8a0a3e26df4dedb3caa"},"package":"d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/cfg-if/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/Cargo.toml --- distinst-0.1.0/vendor/cfg-if/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -[package] -name = "cfg-if" -version = "0.1.2" -authors = ["Alex Crichton "] -license = "MIT/Apache-2.0" -readme = "README.md" -repository = "https://github.com/alexcrichton/cfg-if" -homepage = "https://github.com/alexcrichton/cfg-if" -documentation = "http://alexcrichton.com/cfg-if" -description = """ -A macro to ergonomically define an item depending on a large number of #[cfg] -parameters. Structured like an if-else chain, the first matching branch is the -item that gets emitted. -""" diff -Nru distinst-0.1.0/vendor/cfg-if/LICENSE-APACHE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/LICENSE-APACHE --- distinst-0.1.0/vendor/cfg-if/LICENSE-APACHE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff -Nru distinst-0.1.0/vendor/cfg-if/LICENSE-MIT distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/LICENSE-MIT --- distinst-0.1.0/vendor/cfg-if/LICENSE-MIT 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Copyright (c) 2014 Alex Crichton - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff -Nru distinst-0.1.0/vendor/cfg-if/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/README.md --- distinst-0.1.0/vendor/cfg-if/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -# cfg-if - -[![Build Status](https://travis-ci.org/alexcrichton/cfg-if.svg?branch=master)](https://travis-ci.org/alexcrichton/cfg-if) - -[Documentation](http://alexcrichton.com/cfg-if) - -A macro to ergonomically define an item depending on a large number of #[cfg] -parameters. Structured like an if-else chain, the first matching branch is the -item that gets emitted. - -```toml -[dependencies] -cfg-if = "0.1" -``` - -## Example - -```rust -#[macro_use] -extern crate cfg_if; - -cfg_if! { - if #[cfg(unix)] { - fn foo() { /* unix specific functionality */ } - } else if #[cfg(target_pointer_width = "32")] { - fn foo() { /* non-unix, 32-bit functionality */ } - } else { - fn foo() { /* fallback implementation */ } - } -} - -fn main() { - foo(); -} -``` - -# License - -`cfg-if` is primarily distributed under the terms of both the MIT license and -the Apache License (Version 2.0), with portions covered by various BSD-like -licenses. - -See LICENSE-APACHE, and LICENSE-MIT for details. - diff -Nru distinst-0.1.0/vendor/cfg-if/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/src/lib.rs --- distinst-0.1.0/vendor/cfg-if/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -//! A macro for defining #[cfg] if-else statements. -//! -//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C -//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases, -//! emitting the implementation which matches first. -//! -//! This allows you to conveniently provide a long list #[cfg]'d blocks of code -//! without having to rewrite each clause multiple times. -//! -//! # Example -//! -//! ``` -//! #[macro_use] -//! extern crate cfg_if; -//! -//! cfg_if! { -//! if #[cfg(unix)] { -//! fn foo() { /* unix specific functionality */ } -//! } else if #[cfg(target_pointer_width = "32")] { -//! fn foo() { /* non-unix, 32-bit functionality */ } -//! } else { -//! fn foo() { /* fallback implementation */ } -//! } -//! } -//! -//! # fn main() {} -//! ``` - -#![no_std] - -#![doc(html_root_url = "http://alexcrichton.com/cfg-if")] -#![deny(missing_docs)] -#![cfg_attr(test, deny(warnings))] - -#[macro_export] -macro_rules! cfg_if { - ($( - if #[cfg($($meta:meta),*)] { $($it:item)* } - ) else * else { - $($it2:item)* - }) => { - __cfg_if_items! { - () ; - $( ( ($($meta),*) ($($it)*) ), )* - ( () ($($it2)*) ), - } - }; - ( - if #[cfg($($i_met:meta),*)] { $($i_it:item)* } - $( - else if #[cfg($($e_met:meta),*)] { $($e_it:item)* } - )* - ) => { - __cfg_if_items! { - () ; - ( ($($i_met),*) ($($i_it)*) ), - $( ( ($($e_met),*) ($($e_it)*) ), )* - ( () () ), - } - } -} - -#[macro_export] -#[doc(hidden)] -macro_rules! __cfg_if_items { - (($($not:meta,)*) ; ) => {}; - (($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => { - __cfg_if_apply! { cfg(all($($m,)* not(any($($not),*)))), $($it)* } - __cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* } - } -} - -#[macro_export] -#[doc(hidden)] -macro_rules! __cfg_if_apply { - ($m:meta, $($it:item)*) => { - $(#[$m] $it)* - } -} - -#[cfg(test)] -mod tests { - cfg_if! { - if #[cfg(test)] { - use core::option::Option as Option2; - fn works1() -> Option2 { Some(1) } - } else { - fn works1() -> Option { None } - } - } - - cfg_if! { - if #[cfg(foo)] { - fn works2() -> bool { false } - } else if #[cfg(test)] { - fn works2() -> bool { true } - } else { - fn works2() -> bool { false } - } - } - - cfg_if! { - if #[cfg(foo)] { - fn works3() -> bool { false } - } else { - fn works3() -> bool { true } - } - } - - cfg_if! { - if #[cfg(test)] { - use core::option::Option as Option3; - fn works4() -> Option3 { Some(1) } - } - } - - cfg_if! { - if #[cfg(foo)] { - fn works5() -> bool { false } - } else if #[cfg(test)] { - fn works5() -> bool { true } - } - } - - #[test] - fn it_works() { - assert!(works1().is_some()); - assert!(works2()); - assert!(works3()); - assert!(works4().is_some()); - assert!(works5()); - } -} diff -Nru distinst-0.1.0/vendor/cfg-if/tests/xcrate.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/tests/xcrate.rs --- distinst-0.1.0/vendor/cfg-if/tests/xcrate.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/tests/xcrate.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#[macro_use] -extern crate cfg_if; - -cfg_if! { - if #[cfg(foo)] { - fn works() -> bool { false } - } else if #[cfg(test)] { - fn works() -> bool { true } - } else { - fn works() -> bool { false } - } -} - -#[test] -fn smoke() { - assert!(works()); -} diff -Nru distinst-0.1.0/vendor/cfg-if/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/.travis.yml --- distinst-0.1.0/vendor/cfg-if/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/cfg-if/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly -sudo: false -before_script: - - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH -script: - - cargo build --verbose - - cargo test --verbose - - rustdoc --test README.md -L target/debug -L target/debug/deps - - cargo doc --no-deps -after_success: - - travis-cargo --only nightly doc-upload -env: - global: - secure: "TyMGH+sbPmKs9lKCziKShxWr3G6im0owEchVrbUChWnQIQv1WydXftFoEoUsVl6qZspjehWK1b1AsnIgCXK0HtEi4DnqLsxs0s36bOjfg5yHBT/pETTr6kcq7KAL4Be4GmI331k6gT1Oi0TPFp7Sg9xpiWsQqKIHA5Szk2wpFQ8=" - - -notifications: - email: - on_success: never diff -Nru distinst-0.1.0/vendor/clap/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/.cargo-checksum.json --- distinst-0.1.0/vendor/clap/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".appveyor.yml":"38fb7e583271029caad727c9123a2b2679b7c59971de418f16dc5136dbebaeb5",".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".clog.toml":"f691701bd51b5f311931d0d8f05fa3d78c00dda8d60f3313e21011309c736ff1",".github/CONTRIBUTING.md":"f7eff737f3aa25294802fefb233e3758a64b248781dbbf3262532d693f340a87",".github/ISSUE_TEMPLATE.md":"181a07050efec74e52bb3890585eb02dc77259ac6396ff33fe0869208fa86cee",".mention-bot":"51790ab49f43ed86a4a7c3d2e468aa5fa526ca5e2ac6af20432a2cb5b2fdbe84",".travis.yml":"691bfd78c9b54845aa38a478ccd2ad8196598f8f486d6aeeef2090bb5fe341f5","CHANGELOG.md":"b4ece6d3c5d05f30fbbf080c5335a86e03013d9978b6c504c6f59e7e420d2fb1","CONTRIBUTORS.md":"5d7dbafaff6879bbfbb01b22cca299953ec163872d8d624bbf99e20851ca0165","Cargo.toml":"310f013f05c604ecf332ec6447c0be4d9c4c24cee2f64ea53f2ae3101465efbb","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"37f3ed7b305737c08f6a4a6e287fc0c2e49fc89c25bf6e110b6d7c0e390f3ad3","clap-test.rs":"995a9d41ef372a814616113f4a58c1e580043678e54527afc2ebee7e8e1d3ef5","index.html":"36f9ce4465266f3af9a259444b01c4239200473cabfc848f789f75b322a3ea8f","justfile":"811b2dec57aec46e570aeeb9945018cf87fe65f6d5b27cdb9ffca79d906910f6","rustfmt.toml":"8fd2d63119df515fd5f44e530c709b19d66b09fbc2e22a640bf4b64c57e7d6b3","src/app/help.rs":"dae302ae9db036e480034d2ec4a8af59333d2ac4c42d9db76861fb6572b3289b","src/app/macros.rs":"77764555c2831180f4e976d5bcd95f3da4fdb609d77ae84c94f4ce602afd0c9b","src/app/meta.rs":"a56d28bb466a8ba68155b3f2883e85228b4b74cf25658f62fc050e07cff2dc85","src/app/mod.rs":"da44fb4d0390299763fe8975f171b800be80e8630cf4aa5fa08d32a667c18eca","src/app/parser.rs":"2e9f9b8bdab727a57d4c904aa701457a49ffd62fb7e8c2366fe6d24a06da6f1b","src/app/settings.rs":"c6b87d4da01891123edddee9e28b048cba0c19d8c1db34ad5ad3e85b657c6b97","src/app/usage.rs":"703cec975c53e7f01b14b4593de41c518910ab347bc4c54efe79367a704ffc4c","src/app/validator.rs":"3e41b683e6e60535cb8a52e5e4b08b4bb14a29780869f486110488c627124e9c","src/args/any_arg.rs":"b082385eeff2505ced7b747bd44d20a3fb6fd9d4bd14be9e99870699c43ea072","src/args/arg.rs":"673de3f1957eccb1b116255bac9638fe24c0da54ccb358d958446c8ed54c9621","src/args/arg_builder/base.rs":"8b99a9ab811df3e0bdcfba8c0994042b0bcd06d8ddf794ab559baaf9a490ba59","src/args/arg_builder/flag.rs":"3e2c28bb9e3a30ecf7d3b8502af70738893d450511719724a5836598bcfbdb06","src/args/arg_builder/mod.rs":"7a32c8fd85b48f7b60e5f2c13dc70fa9100aa65cd933ba419300d28d682bf722","src/args/arg_builder/option.rs":"f45429d97fafa630b2d74816eddddc4d9f19498b7619a5f623d6dfb9f50f6ed8","src/args/arg_builder/positional.rs":"e9fe32bad3744b75548e7fd3e9f5bccab19ba835ff9506f147b32c9fb5f46c7a","src/args/arg_builder/switched.rs":"61f5121b0ec746461215a47e1b7a4d699a37a3f181172820e0615f68d5f6f0ef","src/args/arg_builder/valued.rs":"19368a03e046d6b63451c3d04dff6e51d49f140ed45330f82879539c6d1b28dd","src/args/arg_matcher.rs":"27829739ae12ac7800a26109e751ce9f8c3d26e262d41de161a38baf5c421167","src/args/arg_matches.rs":"5fc622e847810ff6a956da00fa64f4a4cff3acd656abf742c4a52e64dfa61218","src/args/group.rs":"7fe5e2f0dd24faf1765410a9336d85976875e964d7f246e1fa216c4808d88dde","src/args/macros.rs":"57f248e2694f9413cbbaf9087813ed4f27064f5f8e29eaf4ec41ec2b274ae806","src/args/matched_arg.rs":"1ed8d338869ecc3b5fa426ef4cf42f4c9c3b1dd538cdea1fe0489169345536f7","src/args/mod.rs":"c155cd989fa4ca1f8de6a79115afbf5086f092adcb854ff9698b9100f45fc323","src/args/settings.rs":"2753ff50046def9ccb7f601b3d9f565348da1ef0253af24ccee94616a2e5c470","src/args/subcommand.rs":"e1ad9638c33785f1301675de1795b0a4f4b079452aa11f7526d263c2a1179432","src/completions/bash.rs":"116c6830ee2b6310f299a69924f5b1e39b05ebec2b5f7b0ffe3b6938b7fa5514","src/completions/fish.rs":"63975f8beea9af6bef66c7dd7938bfa61c6f871995a74dbc1545daa9fbc1f2d0","src/completions/macros.rs":"ebad5037e6e63401b1a54498e09d3bd93d1a3a06f045c2990902d47eb9a73774","src/completions/mod.rs":"5d4a734df6a21e6c1e0831a2f7be50a45d2e7bdaf7475589ea78b978643229cd","src/completions/powershell.rs":"866409e5d0a9b2551d739f86c0e4faf86911e9e7c656fb74b38e6960844233b5","src/completions/shell.rs":"c7995ca229fd0d8671761da0aca0513c4f740165f02d06cd97aa0ae881c22cd4","src/completions/zsh.rs":"8ac4576e1cb3b1403dbb35ce146159aa8b29864e1d8201776200d999052b422d","src/errors.rs":"3c46a4d79d9304ffb152a190528ec9db0cb6c05799bb5211e6df9f7d7abab814","src/fmt.rs":"f205f784268572544ff7e84a89f416c898255404275d4ab1f8fea7e89695daa9","src/lib.rs":"87b3ee49c6389cdbaa23e705732bcc68e7235bb16ff469321c92a89258c21beb","src/macros.rs":"9ae2fd66d40692edbe245b3cfe17b87401f00362368e49fcbb333f771b35a7df","src/osstringext.rs":"a87a5a0685dd8310f6329d5f8e8f54c0fac68eb75595a835aeb1c36208efd5f9","src/strext.rs":"d4418d396069e9c05804f92c042ba7192a4244e46059e2edc98670b45cd2daee","src/suggestions.rs":"ad1165a9896382a0f09f73c0f6bf468454c19da207f28c3973e02879f453ad68","src/usage_parser.rs":"a04143bba42a6506746091a3f898c38e2c7409bacefed21fa8194c90961ca390"},"package":"2267a8fdd4dce6956ba6649e130f62fb279026e5e84b92aa939ac8f85ce3f9f0"} \ No newline at end of file +{"files":{".appveyor.yml":"38fb7e583271029caad727c9123a2b2679b7c59971de418f16dc5136dbebaeb5",".clog.toml":"f691701bd51b5f311931d0d8f05fa3d78c00dda8d60f3313e21011309c736ff1",".github/CONTRIBUTING.md":"f7eff737f3aa25294802fefb233e3758a64b248781dbbf3262532d693f340a87",".github/ISSUE_TEMPLATE.md":"181a07050efec74e52bb3890585eb02dc77259ac6396ff33fe0869208fa86cee",".mention-bot":"51790ab49f43ed86a4a7c3d2e468aa5fa526ca5e2ac6af20432a2cb5b2fdbe84",".travis.yml":"939aa491f28ece97d9a98e781ae8e76c484592742317390bb1de92224bf0678a","CHANGELOG.md":"9487316c1d190fa572f2779979c99395c687dd0495f4657ffb460e1a2a6c5019","CONTRIBUTORS.md":"6890277f02e66ec77120d3335240ac677abd126db5f7a9d9168f47f5cb4df977","Cargo.toml":"25cb059a452c73a7177ab54d9edf7c0dfcb1489e8013a3efd522e9b2fdfef05e","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"57e3b95a81faf3503cc8ba14f8b30f725172551507846b6a6e0f9eb1f1ba2b2a","SPONSORS.md":"097c6b7a80feba1e1b9170fa641a2d7d1868e6115fce73a90ab26448ba36f843","clap-test.rs":"995a9d41ef372a814616113f4a58c1e580043678e54527afc2ebee7e8e1d3ef5","index.html":"36f9ce4465266f3af9a259444b01c4239200473cabfc848f789f75b322a3ea8f","justfile":"811b2dec57aec46e570aeeb9945018cf87fe65f6d5b27cdb9ffca79d906910f6","rustfmt.toml":"8fd2d63119df515fd5f44e530c709b19d66b09fbc2e22a640bf4b64c57e7d6b3","src/app/help.rs":"6bf52a4b213ae6b1e53d206bd63816961608284c1c0cbb6cebe9cc1dcf0dc463","src/app/macros.rs":"77764555c2831180f4e976d5bcd95f3da4fdb609d77ae84c94f4ce602afd0c9b","src/app/meta.rs":"a56d28bb466a8ba68155b3f2883e85228b4b74cf25658f62fc050e07cff2dc85","src/app/mod.rs":"672b7472eb674dd0e875dddb6916f7f63c49873ad6d5afcb46f054b9161fc3a4","src/app/parser.rs":"dd87e6e5b22ec761d0228de66f6d929b68a06a692099cb86feabba1924506e4d","src/app/settings.rs":"e6e73720774d7040efa0c155267e996ad9a1d1d4626bb568f3b902edc8913344","src/app/usage.rs":"703cec975c53e7f01b14b4593de41c518910ab347bc4c54efe79367a704ffc4c","src/app/validator.rs":"0e8d58ce7f22482897a48c8b34d52540274ece40f974226fcca6078cc896ae02","src/args/any_arg.rs":"2960506a31a884a9b3142fea532afa0a01f7de8d14ba2a6347eb5cd5b2fdd98b","src/args/arg.rs":"e10c790b12aea012a52edec6c5e8afe27925ae4b936f83352830a40ef1f4c93d","src/args/arg_builder/base.rs":"8b99a9ab811df3e0bdcfba8c0994042b0bcd06d8ddf794ab559baaf9a490ba59","src/args/arg_builder/flag.rs":"fd6eef19c4de7ded217e86224de472147d4f4c5813607bc0fa67462c5d347b7a","src/args/arg_builder/mod.rs":"7a32c8fd85b48f7b60e5f2c13dc70fa9100aa65cd933ba419300d28d682bf722","src/args/arg_builder/option.rs":"e73031991e561ea7e61574f719207034df0fa3acdd28735502d8511f00d7adbf","src/args/arg_builder/positional.rs":"897df6cda52b67728103c7b2c0750f91326880b751204f4ab15852b18be0d929","src/args/arg_builder/switched.rs":"61f5121b0ec746461215a47e1b7a4d699a37a3f181172820e0615f68d5f6f0ef","src/args/arg_builder/valued.rs":"20998bf790a58206b27cf8b09f6740812d507336042a2026f203f99af4500ed5","src/args/arg_matcher.rs":"ff2b23b43fb5d61727410ab156844b90f898279e08b4aa56f244ad7ced12d03f","src/args/arg_matches.rs":"2342be87d96e3b7437d711a3550e8bf83a524a52b3cd1a34e91de02f16e01fa6","src/args/group.rs":"7fe5e2f0dd24faf1765410a9336d85976875e964d7f246e1fa216c4808d88dde","src/args/macros.rs":"57f248e2694f9413cbbaf9087813ed4f27064f5f8e29eaf4ec41ec2b274ae806","src/args/matched_arg.rs":"1ed8d338869ecc3b5fa426ef4cf42f4c9c3b1dd538cdea1fe0489169345536f7","src/args/mod.rs":"c155cd989fa4ca1f8de6a79115afbf5086f092adcb854ff9698b9100f45fc323","src/args/settings.rs":"2753ff50046def9ccb7f601b3d9f565348da1ef0253af24ccee94616a2e5c470","src/args/subcommand.rs":"e1ad9638c33785f1301675de1795b0a4f4b079452aa11f7526d263c2a1179432","src/completions/bash.rs":"116c6830ee2b6310f299a69924f5b1e39b05ebec2b5f7b0ffe3b6938b7fa5514","src/completions/fish.rs":"65782afc62724e068efcb1c85b193f7963891def2ff5cd6e5200ebdb67003bb5","src/completions/macros.rs":"ebad5037e6e63401b1a54498e09d3bd93d1a3a06f045c2990902d47eb9a73774","src/completions/mod.rs":"5d4a734df6a21e6c1e0831a2f7be50a45d2e7bdaf7475589ea78b978643229cd","src/completions/powershell.rs":"866409e5d0a9b2551d739f86c0e4faf86911e9e7c656fb74b38e6960844233b5","src/completions/shell.rs":"c7995ca229fd0d8671761da0aca0513c4f740165f02d06cd97aa0ae881c22cd4","src/completions/zsh.rs":"e98cc3676c0bfa67f0816947b932c92a14cbcf13b45656cf2f8683f9ab05fbca","src/errors.rs":"3c46a4d79d9304ffb152a190528ec9db0cb6c05799bb5211e6df9f7d7abab814","src/fmt.rs":"f205f784268572544ff7e84a89f416c898255404275d4ab1f8fea7e89695daa9","src/lib.rs":"804d8a9c384122e54cc230327810bde108660e61238c2b889d5bbbbcc2f19c75","src/macros.rs":"a65e1349b12ff164578b5c106c73eb646c86b8be04ec4964fa6da511b3135d76","src/map.rs":"67ac4802ed485359c78a1747c832666095b5ee05d68c686d110bd2e4aa9f06e2","src/osstringext.rs":"a87a5a0685dd8310f6329d5f8e8f54c0fac68eb75595a835aeb1c36208efd5f9","src/strext.rs":"d4418d396069e9c05804f92c042ba7192a4244e46059e2edc98670b45cd2daee","src/suggestions.rs":"1f348d393c0c85e622ca97253fd3f25fed9c2c660996d6ca5ac7e3abfd99783b","src/usage_parser.rs":"cc23ff4156d5bebc8a1bebc45edcf337947d8d217461b052271777e0bf31fa51"},"package":"1b8c532887f1a292d17de05ae858a8fe50a301e196f9ef0ddb7ccd0d1d00f180"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/clap/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/Cargo.toml --- distinst-0.1.0/vendor/clap/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -12,7 +12,7 @@ [package] name = "clap" -version = "2.26.0" +version = "2.27.1" authors = ["Kevin K. "] exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"] description = "A simple to use, efficient, and full featured Command Line Argument Parser\n" @@ -62,33 +62,34 @@ debug = false debug-assertions = false rpath = false -[dependencies.atty] -version = "0.2.2" -optional = true - -[dependencies.unicode-width] -version = "0.1.4" +[dependencies.bitflags] +version = "0.9" [dependencies.clippy] -version = "~0.0.131" +version = "~0.0.166" optional = true -[dependencies.unicode-segmentation] -version = "1.2.0" - -[dependencies.strsim] -version = "0.6.0" +[dependencies.ansi_term] +version = "0.9.0" optional = true [dependencies.vec_map] version = "0.8" +optional = true -[dependencies.ansi_term] -version = "0.9.0" +[dependencies.strsim] +version = "0.6.0" optional = true -[dependencies.bitflags] -version = "0.9" +[dependencies.atty] +version = "0.2.2" +optional = true + +[dependencies.unicode-width] +version = "0.1.4" + +[dependencies.textwrap] +version = "0.9.0" [dependencies.term_size] version = "0.3.0" @@ -97,27 +98,27 @@ [dependencies.yaml-rust] version = "0.3.5" optional = true +[dev-dependencies.regex] +version = "0.2" -[dependencies.textwrap] -version = "0.7.0" [dev-dependencies.lazy_static] version = "0.2" -[dev-dependencies.regex] -version = "0.2" +[dev-dependencies.version-sync] +version = "0.3" [features] -nightly = [] -lints = ["clippy"] -unstable = [] debug = [] +no_cargo = [] yaml = ["yaml-rust"] -wrap_help = ["term_size"] +nightly = [] +color = ["ansi_term", "atty"] suggestions = ["strsim"] +default = ["suggestions", "color", "vec_map"] +wrap_help = ["term_size", "textwrap/term_size"] +lints = ["clippy"] +unstable = [] doc = ["yaml"] -no_cargo = [] -default = ["suggestions", "color", "wrap_help"] -color = ["ansi_term", "atty"] [badges.appveyor] repository = "kbknapp/clap-rs" diff -Nru distinst-0.1.0/vendor/clap/CHANGELOG.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/CHANGELOG.md --- distinst-0.1.0/vendor/clap/CHANGELOG.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/CHANGELOG.md 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,89 @@ + +## v2.27.1 (2017-10-24) + + +#### Bug Fixes + +* Adds `term_size` as an optional dependency (with feature `wrap_help`) to fix compile bug + + +## v2.27.0 (2017-10-24) + +** This release raises the minimum required version of Rust to 1.18 ** + +** This release also contains a very minor breaking change to fix a bug ** + +The only CLIs affected will be those using unrestrained multiple values and subcommands where the +subcommand name can coincide with one of the multiple values. + +See the commit [0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31) for full details. + + +#### Bug Fixes + +* Values from global args are now propagated UP and DOWN! +* fixes a bug where using AppSettings::AllowHyphenValues would allow invalid arguments even when there is no way for them to be valid ([77ed4684](https://github.com/kbknapp/clap-rs/commit/77ed46841fc0263d7aa32fcc5cc49ef703b37c04), closes [#1066](https://github.com/kbknapp/clap-rs/issues/1066)) +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value ([0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31), closes [#1031](https://github.com/kbknapp/clap-rs/issues/1031), breaks [#](https://github.com/kbknapp/clap-rs/issues/), [#](https://github.com/kbknapp/clap-rs/issues/)) +* fixes a bug that prevented number_of_values and default_values to be used together ([5eb342a9](https://github.com/kbknapp/clap-rs/commit/5eb342a99dde07b0f011048efde3e283bc1110fc), closes [#1050](https://github.com/kbknapp/clap-rs/issues/1050), [#1056](https://github.com/kbknapp/clap-rs/issues/1056)) +* fixes a bug that didn't allow args with default values to have conflicts ([58b5b4be](https://github.com/kbknapp/clap-rs/commit/58b5b4be315280888d50d9b15119b91a9028f050), closes [#1071](https://github.com/kbknapp/clap-rs/issues/1071)) +* fixes a panic when using global args and calling App::get_matches_from_safe_borrow multiple times ([d86ec797](https://github.com/kbknapp/clap-rs/commit/d86ec79742c77eb3f663fb30e225954515cf25bb), closes [#1076](https://github.com/kbknapp/clap-rs/issues/1076)) +* fixes issues and potential regressions with global args values not being propagated properly or at all ([a43f9dd4](https://github.com/kbknapp/clap-rs/commit/a43f9dd4aaf1864dd14a3c28dec89ccdd70c61e5), closes [#1010](https://github.com/kbknapp/clap-rs/issues/1010), [#1061](https://github.com/kbknapp/clap-rs/issues/1061), [#978](https://github.com/kbknapp/clap-rs/issues/978)) +* fixes a bug where default values are not applied if the option supports zero values ([9c248cbf](https://github.com/kbknapp/clap-rs/commit/9c248cbf7d8a825119bc387c23e9a1d1989682b0), closes [#1047](https://github.com/kbknapp/clap-rs/issues/1047)) + +#### Documentation + +* adds addtional blurbs about using multiples with subcommands ([03455b77](https://github.com/kbknapp/clap-rs/commit/03455b7751a757e7b2f6ffaf2d16168539c99661)) +* updates the docs to reflect changes to global args and that global args values can now be propagated back up the stack ([ead076f0](https://github.com/kbknapp/clap-rs/commit/ead076f03ada4c322bf3e34203925561ec496d87)) +* add html_root_url attribute ([e67a061b](https://github.com/kbknapp/clap-rs/commit/e67a061bcf567c6518d6c2f58852e01f02764b22)) +* sync README version numbers with crate version ([5536361b](https://github.com/kbknapp/clap-rs/commit/5536361bcda29887ed86bb68e43d0b603cbc423f)) + +#### Improvements + +* args that have require_delimiter(true) is now reflected in help and usage strings ([dce61699](https://github.com/kbknapp/clap-rs/commit/dce616998ed9bd95e8ed3bec1f09a4883da47b85), closes [#1052](https://github.com/kbknapp/clap-rs/issues/1052)) +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed ([4ae7b046](https://github.com/kbknapp/clap-rs/commit/4ae7b0464750bc07ec80ece38e43f003fdd1b8ae), closes [#1046](https://github.com/kbknapp/clap-rs/issues/1046)) + +#### Breaking Changes + +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value ([0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31), closes [#1031](https://github.com/kbknapp/clap-rs/issues/1031), breaks [#](https://github.com/kbknapp/clap-rs/issues/), [#](https://github.com/kbknapp/clap-rs/issues/)) + +#### Deprecations + +* **AppSettings::PropagateGlobalValuesDown:** this setting is no longer required to propagate values down or up ([2bb5ddce](https://github.com/kbknapp/clap-rs/commit/2bb5ddcee61c791ca1aaca494fbeb4bd5e277488)) + + + + +### v2.26.2 (2017-09-14) + + +#### Improvements + +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed ([4ae7b046](https://github.com/kbknapp/clap-rs/commit/4ae7b0464750bc07ec80ece38e43f003fdd1b8ae), closes [#1046](https://github.com/kbknapp/clap-rs/issues/1046)) + +#### Bug Fixes + +* fixes a bug where default values are not applied if the option supports zero values ([9c248cbf](https://github.com/kbknapp/clap-rs/commit/9c248cbf7d8a825119bc387c23e9a1d1989682b0), closes [#1047](https://github.com/kbknapp/clap-rs/issues/1047)) + + + + +### v2.26.1 (2017-09-14) + + +#### Bug Fixes + +* fixes using require_equals(true) and min_values(0) together ([10ae208f](https://github.com/kbknapp/clap-rs/commit/10ae208f68518eff6e98166724065745f4083174), closes [#1044](https://github.com/kbknapp/clap-rs/issues/1044)) +* escape special characters in zsh and fish completions ([87e019fc](https://github.com/kbknapp/clap-rs/commit/87e019fc84ba6193a8c4ddc26c61eb99efffcd25)) +* avoid panic generating default help msg if term width set to 0 due to bug in textwrap 0.7.0 ([b3eadb0d](https://github.com/kbknapp/clap-rs/commit/b3eadb0de516106db4e08f078ad32e8f6d6e7a57)) +* Change `who's` -> `whose` ([53c1ffe8](https://github.com/kbknapp/clap-rs/commit/53c1ffe87f38b05d8804a0f7832412a952845349)) +* adds a debug assertion to ensure all args added to groups actually exist ([7ad123e2](https://github.com/kbknapp/clap-rs/commit/7ad123e2c02577e3ca30f7e205181e896b157d11), closes [#917](https://github.com/kbknapp/clap-rs/issues/917)) +* fixes a bug where args that allow values to start with a hyphen couldnt contain a double hyphen -- as a value ([ab2f4c9e](https://github.com/kbknapp/clap-rs/commit/ab2f4c9e563e36ec739a4b55d5a5b76fdb9e9fa4), closes [#960](https://github.com/kbknapp/clap-rs/issues/960)) +* fixes a bug where positional argument help text is misaligned ([54c16836](https://github.com/kbknapp/clap-rs/commit/54c16836dea4651806a2cfad53146a83fa3abf21)) +* **Help Message:** fixes long_about not being usable ([a8257ea0](https://github.com/kbknapp/clap-rs/commit/a8257ea0ffb812e552aca256c4a3d2aebfd8065b), closes [#1043](https://github.com/kbknapp/clap-rs/issues/1043)) +* **Suggestions:** output for flag after subcommand ([434ea5ba](https://github.com/kbknapp/clap-rs/commit/434ea5ba71395d8c1afcf88e69f0b0d8339b01a1)) + + + ## v2.26.0 (2017-07-29) diff -Nru distinst-0.1.0/vendor/clap/CONTRIBUTORS.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/CONTRIBUTORS.md --- distinst-0.1.0/vendor/clap/CONTRIBUTORS.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/CONTRIBUTORS.md 2017-12-21 19:00:07.000000000 +0000 @@ -1,65 +1,77 @@ the following is a list of contributors: -[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[sru](https://github.com/sru) |[nabijaczleweli](https://github.com/nabijaczleweli) | +[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[little-dude](https://github.com/little-dude) |[sru](https://github.com/sru) | :---: |:---: |:---: |:---: |:---: |:---: | -[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[sru](https://github.com/sru) |[nabijaczleweli](https://github.com/nabijaczleweli) | +[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[little-dude](https://github.com/little-dude) |[sru](https://github.com/sru) | -[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[james-darkfox](https://github.com/james-darkfox) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[Arnavion](https://github.com/Arnavion) | +[nabijaczleweli](https://github.com/nabijaczleweli) |[mgeisler](https://github.com/mgeisler) |[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[nateozem](https://github.com/nateozem) |[james-darkfox](https://github.com/james-darkfox) | :---: |:---: |:---: |:---: |:---: |:---: | -[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[james-darkfox](https://github.com/james-darkfox) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[Arnavion](https://github.com/Arnavion) | +[nabijaczleweli](https://github.com/nabijaczleweli) |[mgeisler](https://github.com/mgeisler) |[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[nateozem](https://github.com/nateozem) |[james-darkfox](https://github.com/james-darkfox) | -[mgeisler](https://github.com/mgeisler) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) |[SuperFluffy](https://github.com/SuperFluffy) |[untitaker](https://github.com/untitaker) |[japaric](https://github.com/japaric) | +[Arnavion](https://github.com/Arnavion) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | :---: |:---: |:---: |:---: |:---: |:---: | -[mgeisler](https://github.com/mgeisler) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) |[SuperFluffy](https://github.com/SuperFluffy) |[untitaker](https://github.com/untitaker) |[japaric](https://github.com/japaric) | +[Arnavion](https://github.com/Arnavion) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | -[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[gohyda](https://github.com/gohyda) |[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[tshepang](https://github.com/tshepang) | +[SuperFluffy](https://github.com/SuperFluffy) |[japaric](https://github.com/japaric) |[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[tshepang](https://github.com/tshepang) |[gohyda](https://github.com/gohyda) | :---: |:---: |:---: |:---: |:---: |:---: | -[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[gohyda](https://github.com/gohyda) |[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[tshepang](https://github.com/tshepang) | +[SuperFluffy](https://github.com/SuperFluffy) |[japaric](https://github.com/japaric) |[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[tshepang](https://github.com/tshepang) |[gohyda](https://github.com/gohyda) | -[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) |[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) | +[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[golem131](https://github.com/golem131) |[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | :---: |:---: |:---: |:---: |:---: |:---: | -[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) |[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) | +[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[golem131](https://github.com/golem131) |[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | -[ignatenkobrain](https://github.com/ignatenkobrain) |[cstorey](https://github.com/cstorey) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) | +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[ignatenkobrain](https://github.com/ignatenkobrain) |[shepmaster](https://github.com/shepmaster) |[cstorey](https://github.com/cstorey) | :---: |:---: |:---: |:---: |:---: |:---: | -[ignatenkobrain](https://github.com/ignatenkobrain) |[cstorey](https://github.com/cstorey) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) | +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[ignatenkobrain](https://github.com/ignatenkobrain) |[shepmaster](https://github.com/shepmaster) |[cstorey](https://github.com/cstorey) | -[N-006](https://github.com/N-006) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | +[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | :---: |:---: |:---: |:---: |:---: |:---: | -[N-006](https://github.com/N-006) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | +[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | -[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[pixelistik](https://github.com/pixelistik) |[brennie](https://github.com/brennie) |[ogham](https://github.com/ogham) | +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | :---: |:---: |:---: |:---: |:---: |:---: | -[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[pixelistik](https://github.com/pixelistik) |[brennie](https://github.com/brennie) |[ogham](https://github.com/ogham) | +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | -[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[casey](https://github.com/casey) | +[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[pixelistik](https://github.com/pixelistik) | +:---: |:---: |:---: |:---: |:---: |:---: | +[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[pixelistik](https://github.com/pixelistik) | + +[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[casey](https://github.com/casey) | :---: |:---: |:---: |:---: |:---: |:---: | [Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[casey](https://github.com/casey) | -[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[eddyb](https://github.com/eddyb) | +[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | :---: |:---: |:---: |:---: |:---: |:---: | -[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[eddyb](https://github.com/eddyb) | +[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | -[birkenfeld](https://github.com/birkenfeld) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[shepmaster](https://github.com/shepmaster) | +[eddyb](https://github.com/eddyb) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) | :---: |:---: |:---: |:---: |:---: |:---: | -[birkenfeld](https://github.com/birkenfeld) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[shepmaster](https://github.com/shepmaster) | +[eddyb](https://github.com/eddyb) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) | -[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) |[malbarbo](https://github.com/malbarbo) |[iliekturtles](https://github.com/iliekturtles) | +[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[jdanford](https://github.com/jdanford) | :---: |:---: |:---: |:---: |:---: |:---: | -[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) |[malbarbo](https://github.com/malbarbo) |[iliekturtles](https://github.com/iliekturtles) | +[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[jdanford](https://github.com/jdanford) | -[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[Geogi](https://github.com/Geogi) |[flying-sheep](https://github.com/flying-sheep) |[peppsac](https://github.com/peppsac) | +[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[malbarbo](https://github.com/malbarbo) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) | :---: |:---: |:---: |:---: |:---: |:---: | -[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[Geogi](https://github.com/Geogi) |[flying-sheep](https://github.com/flying-sheep) |[peppsac](https://github.com/peppsac) | +[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[malbarbo](https://github.com/malbarbo) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) | -[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) |[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) | +[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) | :---: |:---: |:---: |:---: |:---: |:---: | -[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) |[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) | +[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) | -[mineo](https://github.com/mineo) |[grossws](https://github.com/grossws) |[messense](https://github.com/messense) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[mitsuhiko](https://github.com/mitsuhiko) | +[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) | :---: |:---: |:---: |:---: |:---: |:---: | -[mineo](https://github.com/mineo) |[grossws](https://github.com/grossws) |[messense](https://github.com/messense) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[mitsuhiko](https://github.com/mitsuhiko) | +[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) | + +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) | +:---: |:---: |:---: |:---: |:---: |:---: | +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) | + +[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | +:---: |:---: |:---: |:---: |:---: | +[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | diff -Nru distinst-0.1.0/vendor/clap/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/README.md --- distinst-0.1.0/vendor/clap/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -45,16 +45,48 @@ ## What's New -Here's the highlights for v2.26.0 +Here's whats new in 2.27.1: -* **The minimum required version of Rust is now 1.13.0 (Stable)** -* bumps unicode-segmentation to v1.2 -* update textwrap to version 0.7.0 which increases the performance of writing help strings +** This release also contains a very minor breaking change to fix a bug ** +The only CLIs affected will be those using unrestrained multiple values and subcommands where the +subcommand name can coincide with one of the multiple values. -Here's the highlights for v2.21.0 to v2.25.1 +See the commit [0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31) for full details. -* impl Default for Values + OsValues for any lifetime. +* Adds `term_size` as an optional dependency (with feature `wrap_help`) to fix compile bug +* **The minimum required version of Rust is now 1.18.0 (Stable)** +* Values from global args are now propagated UP and DOWN! +* fixes a bug where using AppSettings::AllowHyphenValues would allow invalid arguments even when there is no way for them to be valid +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value +* fixes a bug that prevented number_of_values and default_values to be used together +* fixes a bug that didn't allow args with default values to have conflicts +* fixes a panic when using global args and calling App::get_matches_from_safe_borrow multiple times +* fixes issues and potential regressions with global args values not being propagated properly or at all +* fixes a bug where default values are not applied if the option supports zero values +* adds addtional blurbs about using multiples with subcommands +* updates the docs to reflect changes to global args and that global args values can now be propagated back up the stack +* add html_root_url attribute +* sync README version numbers with crate version +* args that have require_delimiter(true) is now reflected in help and usage strings +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed +* fixes when an argument requires a value and that value happens to match a subcommand name, its parsed as a value +* **AppSettings::PropagateGlobalValuesDown:** this setting deprecated and is no longer required to propagate values down or up + +Here's the highlights for v2.21.0 to v2.26.2 + +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed +* fixes a bug where default values are not applied if the option supports zero values +* fixes using require_equals(true) and min_values(0) together +* escape special characters in zsh and fish completions +* avoid panic generating default help msg if term width set to 0 due to bug in textwrap 0.7.0 +* Change `who's` -> `whose` in documentation +* **Help Message:** fixes `App::long_about` not being displayed +* **Suggestions:** output for flag after subcommand +* **The minimum required version of Rust is now 1.13.0 (Stable)** +* bumps unicode-segmentation to v1.2 +* update textwrap to version 0.7.0 which increases the performance of writing help strings +* impl Default for Values + OsValues for any lifetime. * use textwrap crate for wrapping help texts * suggests to use flag after subcommand when applicable * Bumps bitflags crate to v0.9 @@ -144,7 +176,7 @@ `docopt` is also excellent at translating arguments into Rust types automatically. There is even a syntax extension which will do all this for you, if you're willing to use a nightly compiler (use of a stable compiler requires you to somewhat manually translate from arguments to Rust types). To use BurntSushi's words, `docopt` is also a sort of black box. You get what you get, and it's hard to tweak implementation or customize the experience for your use case. -Because `docopt` is doing a ton of work to parse your help messages and determine what you were trying to communicate as valid arguments, it's also one of the more heavy weight parsers performance-wise. For most applications this isn't a concern and this isn't to say `docopt` is slow, in fact from it. This is just something to keep in mind while comparing. +Because `docopt` is doing a ton of work to parse your help messages and determine what you were trying to communicate as valid arguments, it's also one of the more heavy weight parsers performance-wise. For most applications this isn't a concern and this isn't to say `docopt` is slow, in fact far from it. This is just something to keep in mind while comparing. #### All else being equal, what are some reasons to use `clap`? @@ -345,7 +377,7 @@ Since this feature requires additional dependencies that not everyone may want, it is *not* compiled in by default and we need to enable a feature flag in Cargo.toml: -Simply change your `clap = "2.19"` to `clap = {version = "2.19", features = ["yaml"]}`. +Simply change your `clap = "2.27"` to `clap = {version = "2.27", features = ["yaml"]}`. At last we create our `main.rs` file just like we would have with the previous two examples: @@ -464,7 +496,7 @@ ```toml [dependencies] -clap = "~2.19.0" +clap = "~2.27" ``` (**note**: If you are concerned with supporting a minimum version of Rust that is *older* than the current stable Rust minus 2 stable releases, it's recommended to use the `~major.minor.patch` style versions in your `Cargo.toml` which will only update the patch version automatically. For more information see the [Compatibility Policy](#compatibility-policy)) @@ -482,12 +514,13 @@ * **"suggestions"**: Turns on the `Did you mean '--myoption'?` feature for when users make typos. (builds dependency `strsim`) * **"color"**: Turns on colored error messages. This feature only works on non-Windows OSs. (builds dependency `ansi-term`) * **"wrap_help"**: Wraps the help at the actual terminal width when available, instead of 120 characters. (builds dependency `term_size`) +* **"vec_map"**: Use [`VecMap`](https://crates.io/crates/vec_map) internally instead of a [`BTreeMap`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html). This feature provides a _slight_ performance improvement. (builds dependency `vec_map`) To disable these, add this to your `Cargo.toml`: ```toml [dependencies.clap] -version = "2.19" +version = "2.27" default-features = false ``` @@ -495,7 +528,7 @@ ```toml [dependencies.clap] -version = "2.19" +version = "2.27" default-features = false # Cherry-pick the features you'd like to use @@ -621,7 +654,7 @@ ```toml [dependencies] -clap = "~2.19.0" +clap = "~2.27" ``` This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore cannot break due to new features, or bumped minimum versions of Rust. @@ -634,15 +667,15 @@ Right now Cargo's version resolution is pretty naive, it's just a brute-force search of the solution space, returning the first resolvable graph. This also means that it currently won't terminate until it proves there is not possible resolvable graph. This leads to situations where workspaces with multiple binaries, for example, have two different dependencies such as: -```toml +```toml,no_sync # In one Cargo.toml [dependencies] -clap = "~2.19.0" +clap = "~2.27.0" # In another Cargo.toml [dependencies] -clap = "2.22" +clap = "2.27" ``` @@ -650,8 +683,9 @@ #### Minimum Version of Rust -`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.13.0, meaning `clap` is guaranteed to compile with 1.11.0 and beyond. -At the 1.14.0 release, `clap` will be guaranteed to compile with 1.12.0 and beyond, etc. +`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.21.0, meaning `clap` is guaranteed to compile with 1.19.0 and beyond. + +At the 1.22.0 stable release, `clap` will be guaranteed to compile with 1.20.0 and beyond, etc. Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be clearly annotated in the `CHANGELOG.md` @@ -715,6 +749,6 @@ Old method names will be left around for several minor version bumps, or one major version bump. -As of 2.19.0: +As of 2.27.0: - * None! +* **AppSettings::PropagateGlobalValuesDown:** this setting deprecated and is no longer required to propagate values down or up diff -Nru distinst-0.1.0/vendor/clap/SPONSORS.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/SPONSORS.md --- distinst-0.1.0/vendor/clap/SPONSORS.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/SPONSORS.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,7 @@ +The following is a list of [sponsors](https://www.clap.rs/sponsor/) for the clap-rs project: + +[Noelia Seva-Gonzalez](http://vsgrealestategroup.com.realproserver.com/About) +Noelia Seva-Gonzalez + +[Rob Tsuk](https://github.com/rtsuk) +Rob Tsuk \ No newline at end of file diff -Nru distinst-0.1.0/vendor/clap/src/app/help.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/help.rs --- distinst-0.1.0/vendor/clap/src/app/help.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/help.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,5 @@ // Std +use std::borrow::Cow; use std::cmp; use std::collections::BTreeMap; use std::fmt::Display; @@ -10,15 +11,16 @@ use app::parser::Parser; use args::{AnyArg, ArgSettings, DispOrder}; use errors::{Error, Result as ClapResult}; -use fmt::{Format, Colorizer, ColorizerOption}; +use fmt::{Colorizer, ColorizerOption, Format}; use app::usage; +use map::VecMap; +use INTERNAL_ERROR_MSG; // Third Party use unicode_width::UnicodeWidthStr; #[cfg(feature = "wrap_help")] use term_size; use textwrap; -use vec_map::VecMap; #[cfg(not(feature = "wrap_help"))] mod term_size { @@ -31,13 +33,18 @@ // These are just convenient traits to make the code easier to read. trait ArgWithDisplay<'b, 'c>: AnyArg<'b, 'c> + Display {} -impl<'b, 'c, T> ArgWithDisplay<'b, 'c> for T where T: AnyArg<'b, 'c> + Display {} +impl<'b, 'c, T> ArgWithDisplay<'b, 'c> for T +where + T: AnyArg<'b, 'c> + Display, +{ +} trait ArgWithOrder<'b, 'c>: ArgWithDisplay<'b, 'c> + DispOrder { fn as_base(&self) -> &ArgWithDisplay<'b, 'c>; } impl<'b, 'c, T> ArgWithOrder<'b, 'c> for T - where T: ArgWithDisplay<'b, 'c> + DispOrder +where + T: ArgWithDisplay<'b, 'c> + DispOrder, { fn as_base(&self) -> &ArgWithDisplay<'b, 'c> { self } } @@ -84,29 +91,34 @@ impl<'a> Help<'a> { /// Create a new `Help` instance. #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] - pub fn new(w: &'a mut Write, - next_line_help: bool, - hide_pv: bool, - color: bool, - cizer: Colorizer, - term_w: Option, - max_w: Option, - use_long: bool) - -> Self { + pub fn new( + w: &'a mut Write, + next_line_help: bool, + hide_pv: bool, + color: bool, + cizer: Colorizer, + term_w: Option, + max_w: Option, + use_long: bool, + ) -> Self { debugln!("Help::new;"); Help { writer: w, next_line_help: next_line_help, hide_pv: hide_pv, term_w: match term_w { - Some(width) => if width == 0 { usize::MAX } else { width }, - None => { - cmp::min(term_size::dimensions().map_or(120, |(w, _)| w), - match max_w { - None | Some(0) => usize::MAX, - Some(mw) => mw, - }) - } + Some(width) => if width == 0 { + usize::MAX + } else { + width + }, + None => cmp::min( + term_size::dimensions().map_or(120, |(w, _)| w), + match max_w { + None | Some(0) => usize::MAX, + Some(mw) => mw, + }, + ), }, color: color, cizer: cizer, @@ -139,7 +151,12 @@ } #[doc(hidden)] - pub fn _write_parser_help(w: &'a mut Write, parser: &Parser, stderr: bool, use_long: bool) -> ClapResult<()> { + pub fn _write_parser_help( + w: &'a mut Write, + parser: &Parser, + stderr: bool, + use_long: bool, + ) -> ClapResult<()> { debugln!("Help::write_parser_help;"); let nlh = parser.is_set(AppSettings::NextLineHelp); let hide_v = parser.is_set(AppSettings::HidePossibleValuesInHelp); @@ -148,15 +165,16 @@ use_stderr: stderr, when: parser.color(), }); - Self::new(w, - nlh, - hide_v, - color, - cizer, - parser.meta.term_w, - parser.meta.max_w, - use_long) - .write_help(parser) + Self::new( + w, + nlh, + hide_v, + color, + cizer, + parser.meta.term_w, + parser.meta.max_w, + use_long, + ).write_help(parser) } /// Writes the parser help to the wrapped stream. @@ -177,16 +195,16 @@ impl<'a> Help<'a> { /// Writes help for each argument in the order they were declared to the wrapped stream. fn write_args_unsorted<'b: 'd, 'c: 'd, 'd, I: 'd>(&mut self, args: I) -> io::Result<()> - where I: Iterator> + where + I: Iterator>, { debugln!("Help::write_args_unsorted;"); // The shortest an arg can legally be is 2 (i.e. '-x') self.longest = 2; let mut arg_v = Vec::with_capacity(10); for arg in args.filter(|arg| { - !(arg.is_set(ArgSettings::Hidden)) || - arg.is_set(ArgSettings::NextLineHelp) - }) { + !(arg.is_set(ArgSettings::Hidden)) || arg.is_set(ArgSettings::NextLineHelp) + }) { if arg.longest_filter() { self.longest = cmp::max(self.longest, str_width(arg.to_string().as_str())); } @@ -206,7 +224,8 @@ /// Sorts arguments by length and display order and write their help to the wrapped stream. fn write_args<'b: 'd, 'c: 'd, 'd, I: 'd>(&mut self, args: I) -> io::Result<()> - where I: Iterator> + where + I: Iterator>, { debugln!("Help::write_args;"); // The shortest an arg can legally be is 2 (i.e. '-x') @@ -297,12 +316,17 @@ fn val<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>) -> Result { debugln!("Help::val: arg={}", arg); if arg.takes_value() { + let delim = if arg.is_set(ArgSettings::RequireDelimiter) { + arg.val_delim().expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }; if let Some(vec) = arg.val_names() { let mut it = vec.iter().peekable(); while let Some((_, val)) = it.next() { color!(self, "<{}>", val, good)?; if it.peek().is_some() { - write!(self.writer, " ")?; + write!(self.writer, "{}", delim)?; } } let num = vec.len(); @@ -314,7 +338,7 @@ while let Some(_) = it.next() { color!(self, "<{}>", arg.name(), good)?; if it.peek().is_some() { - write!(self.writer, " ")?; + write!(self.writer, "{}", delim)?; } } if arg.is_set(ArgSettings::Multiple) && num == 1 { @@ -335,9 +359,9 @@ let h_w = str_width(h) + str_width(&*spec_vals); let nlh = self.next_line_help || arg.is_set(ArgSettings::NextLineHelp); let taken = self.longest + 12; - self.force_next_line = !nlh && self.term_w >= taken && - (taken as f32 / self.term_w as f32) > 0.40 && - h_w > (self.term_w - taken); + self.force_next_line = !nlh && self.term_w >= taken + && (taken as f32 / self.term_w as f32) > 0.40 + && h_w > (self.term_w - taken); debug!("Help::val: Has switch..."); if arg.has_switch() { @@ -345,10 +369,12 @@ debugln!("Help::val: force_next_line...{:?}", self.force_next_line); debugln!("Help::val: nlh...{:?}", nlh); debugln!("Help::val: taken...{}", taken); - debugln!("Help::val: help_width > (width - taken)...{} > ({} - {})", - h_w, - self.term_w, - taken); + debugln!( + "Help::val: help_width > (width - taken)...{} > ({} - {})", + h_w, + self.term_w, + taken + ); debugln!("Help::val: longest...{}", self.longest); debug!("Help::val: next_line..."); if !(nlh || self.force_next_line) { @@ -372,7 +398,10 @@ } } else if !(nlh || self.force_next_line) { sdebugln!("No, and not next_line"); - write_nspaces!(self.writer, self.longest + 4 - (str_width(arg.to_string().as_str()))); + write_nspaces!( + self.writer, + self.longest + 4 - (str_width(arg.to_string().as_str())) + ); } else { sdebugln!("No"); } @@ -383,19 +412,25 @@ debugln!("Help::write_before_after_help;"); let mut help = String::from(h); // determine if our help fits or needs to wrap - debugln!("Help::write_before_after_help: Term width...{}", - self.term_w); + debugln!( + "Help::write_before_after_help: Term width...{}", + self.term_w + ); let too_long = str_width(h) >= self.term_w; debug!("Help::write_before_after_help: Too long..."); if too_long || h.contains("{n}") { sdebugln!("Yes"); debugln!("Help::write_before_after_help: help: {}", help); - debugln!("Help::write_before_after_help: help width: {}", - str_width(&*help)); + debugln!( + "Help::write_before_after_help: help width: {}", + str_width(&*help) + ); // Determine how many newlines we need to insert - debugln!("Help::write_before_after_help: Usable space: {}", - self.term_w); + debugln!( + "Help::write_before_after_help: Usable space: {}", + self.term_w + ); help = wrap_help(&help.replace("{n}", "\n"), self.term_w); } else { sdebugln!("No"); @@ -464,42 +499,60 @@ fn spec_vals(&self, a: &ArgWithDisplay) -> String { debugln!("Help::spec_vals: a={}", a); let mut spec_vals = vec![]; + if let Some(ref env) = a.env() { + debugln!( + "Help::spec_vals: Found environment variable...[{:?}:{:?}]", + env.0, + env.1 + ); + spec_vals.push(format!( + " [env:{}: {}]", + env.0.to_string_lossy(), + env.1.map_or(Cow::Borrowed(""), |val| val.to_string_lossy()) + )); + } if !a.is_set(ArgSettings::HideDefaultValue) { if let Some(pv) = a.default_val() { debugln!("Help::spec_vals: Found default value...[{:?}]", pv); - spec_vals.push(format!(" [default: {}]", - if self.color { - self.cizer.good(pv.to_string_lossy()) - } else { - Format::None(pv.to_string_lossy()) - })); + spec_vals.push(format!( + " [default: {}]", + if self.color { + self.cizer.good(pv.to_string_lossy()) + } else { + Format::None(pv.to_string_lossy()) + } + )); } } if let Some(ref aliases) = a.aliases() { debugln!("Help::spec_vals: Found aliases...{:?}", aliases); - spec_vals.push(format!(" [aliases: {}]", - if self.color { - aliases - .iter() - .map(|v| format!("{}", self.cizer.good(v))) - .collect::>() - .join(", ") - } else { - aliases.join(", ") - })); + spec_vals.push(format!( + " [aliases: {}]", + if self.color { + aliases + .iter() + .map(|v| format!("{}", self.cizer.good(v))) + .collect::>() + .join(", ") + } else { + aliases.join(", ") + } + )); } if !self.hide_pv && !a.is_set(ArgSettings::HidePossibleValues) { if let Some(pv) = a.possible_vals() { debugln!("Help::spec_vals: Found possible vals...{:?}", pv); spec_vals.push(if self.color { - format!(" [values: {}]", - pv.iter() - .map(|v| format!("{}", self.cizer.good(v))) - .collect::>() - .join(", ")) - } else { - format!(" [values: {}]", pv.join(", ")) - }); + format!( + " [values: {}]", + pv.iter() + .map(|v| format!("{}", self.cizer.good(v))) + .collect::>() + .join(", ") + ) + } else { + format!(" [values: {}]", pv.join(", ")) + }); } } spec_vals.join(" ") @@ -521,7 +574,7 @@ .filter(|arg| !arg.is_set(ArgSettings::Hidden)) .count() > 0; let opts = parser.has_opts(); - let subcmds = parser.has_subcommands(); + let subcmds = parser.has_visible_subcommands(); let unified_help = parser.is_set(AppSettings::UnifiedHelpMessage); @@ -578,12 +631,11 @@ self.longest = 2; let mut ord_m = VecMap::new(); for sc in parser - .subcommands - .iter() - .filter(|s| !s.p.is_set(AppSettings::Hidden)) { - let btm = ord_m - .entry(sc.p.meta.disp_ord) - .or_insert(BTreeMap::new()); + .subcommands + .iter() + .filter(|s| !s.p.is_set(AppSettings::Hidden)) + { + let btm = ord_m.entry(sc.p.meta.disp_ord).or_insert(BTreeMap::new()); self.longest = cmp::max(self.longest, str_width(sc.p.meta.name.as_str())); //self.longest = cmp::max(self.longest, sc.p.meta.name.len()); btm.insert(sc.p.meta.name.clone(), sc.clone()); @@ -657,15 +709,29 @@ if let Some(author) = parser.meta.author { write_thing!(author) } - if let Some(about) = parser.meta.about { + if self.use_long { + if let Some(about) = parser.meta.long_about { + debugln!("Help::write_default_help: writing long about"); + write_thing!(about) + } else if let Some(about) = parser.meta.about { + debugln!("Help::write_default_help: writing about"); + write_thing!(about) + } + } else if let Some(about) = parser.meta.about { + debugln!("Help::write_default_help: writing about"); + write_thing!(about) + } else if let Some(about) = parser.meta.long_about { + debugln!("Help::write_default_help: writing long about"); write_thing!(about) } color!(self, "\nUSAGE:", warning)?; - write!(self.writer, - "\n{}{}\n\n", - TAB, - usage::create_usage_no_title(parser, &[]))?; + write!( + self.writer, + "\n{}{}\n\n", + TAB, + usage::create_usage_no_title(parser, &[]) + )?; let flags = parser.has_flags(); let pos = parser.has_positionals(); @@ -731,21 +797,20 @@ /// - `None`: The reader was consumed. /// - `Some(Ok(0))`: No tag was captured but the reader still contains data. /// - `Some(Ok(length>0))`: a tag with `length` was captured to the `tag_buffer`. -fn copy_and_capture(r: &mut R, - w: &mut W, - tag_buffer: &mut Cursor>) - -> Option> { +fn copy_and_capture( + r: &mut R, + w: &mut W, + tag_buffer: &mut Cursor>, +) -> Option> { use self::CopyUntilResult::*; debugln!("copy_and_capture;"); // Find the opening byte. match copy_until(r, w, b'{') { - // The end of the reader was reached without finding the opening tag. // (either with or without having copied data to the writer) // Return None indicating that we are done. - ReaderEmpty | - DelimiterNotFound(_) => None, + ReaderEmpty | DelimiterNotFound(_) => None, // Something went wrong. ReadError(e) | WriteError(e) => Some(Err(e)), @@ -753,7 +818,6 @@ // The opening byte was found. // (either with or without having copied data to the writer) DelimiterFound(_) => { - // Lets reset the buffer first and find out how long it is. tag_buffer.set_position(0); let buffer_size = tag_buffer.get_ref().len(); @@ -761,7 +825,6 @@ // Find the closing byte,limiting the reader to the length of the buffer. let mut rb = r.take(buffer_size as u64); match copy_until(&mut rb, tag_buffer, b'}') { - // We were already at the end of the reader. // Return None indicating that we are done. ReaderEmpty => None, @@ -773,17 +836,13 @@ // The end of the reader was found without finding the closing tag. // Write the opening byte and captured text to the writer. // Return 0 indicating that nothing was caputred but the reader still contains data. - DelimiterNotFound(not_tag_length) => { - match w.write(b"{") { + DelimiterNotFound(not_tag_length) => match w.write(b"{") { + Err(e) => Some(Err(e)), + _ => match w.write(&tag_buffer.get_ref()[0..not_tag_length]) { Err(e) => Some(Err(e)), - _ => { - match w.write(&tag_buffer.get_ref()[0..not_tag_length]) { - Err(e) => Some(Err(e)), - _ => Some(Ok(0)), - } - } - } - } + _ => Some(Ok(0)), + }, + }, ReadError(e) | WriteError(e) => Some(Err(e)), } @@ -834,10 +893,12 @@ }; debugln!("Help::write_template_help:iter: tag_buf={};", unsafe { - String::from_utf8_unchecked(tag_buf.get_ref()[0..tag_length] - .iter() - .map(|&i| i) - .collect::>()) + String::from_utf8_unchecked( + tag_buf.get_ref()[0..tag_length] + .iter() + .map(|&i| i) + .collect::>(), + ) }); match &tag_buf.get_ref()[0..tag_length] { b"?" => { @@ -847,19 +908,32 @@ self.write_bin_name(parser)?; } b"version" => { - write!(self.writer, - "{}", - parser.meta.version.unwrap_or("unknown version"))?; + write!( + self.writer, + "{}", + parser.meta.version.unwrap_or("unknown version") + )?; } b"author" => { - write!(self.writer, - "{}", - parser.meta.author.unwrap_or("unknown author"))?; + write!( + self.writer, + "{}", + parser.meta.author.unwrap_or("unknown author") + )?; } b"about" => { - write!(self.writer, - "{}", - parser.meta.about.unwrap_or("unknown about"))?; + write!( + self.writer, + "{}", + parser.meta.about.unwrap_or("unknown about") + )?; + } + b"long-about" => { + write!( + self.writer, + "{}", + parser.meta.long_about.unwrap_or("unknown about") + )?; } b"usage" => { write!(self.writer, "{}", usage::create_usage_no_title(parser, &[]))?; @@ -887,14 +961,18 @@ self.write_subcommands(parser)?; } b"after-help" => { - write!(self.writer, - "{}", - parser.meta.more_help.unwrap_or("unknown after-help"))?; + write!( + self.writer, + "{}", + parser.meta.more_help.unwrap_or("unknown after-help") + )?; } b"before-help" => { - write!(self.writer, - "{}", - parser.meta.pre_help.unwrap_or("unknown before-help"))?; + write!( + self.writer, + "{}", + parser.meta.pre_help.unwrap_or("unknown before-help") + )?; } // Unknown tag, write it back. r => { diff -Nru distinst-0.1.0/vendor/clap/src/app/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/mod.rs --- distinst-0.1.0/vendor/clap/src/app/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -18,7 +18,6 @@ use std::result::Result as StdResult; // Third Party -use vec_map::{self, VecMap}; #[cfg(feature = "yaml")] use yaml_rust::Yaml; @@ -29,6 +28,7 @@ use errors::Result as ClapResult; pub use self::settings::AppSettings; use completions::Shell; +use map::{self, VecMap}; /// Used to create a representation of a command line program and all possible command line /// arguments. Application settings are set using the "builder pattern" with the @@ -609,11 +609,11 @@ self } - /// Enables a single setting that is propogated *down* through all child [`SubCommand`]s. + /// Enables a single setting that is propagated down through all child [`SubCommand`]s. /// /// See [`AppSettings`] for a full list of possibilities and examples. /// - /// **NOTE**: The setting is *only* propogated *down* and not up through parent commands. + /// **NOTE**: The setting is *only* propagated *down* and not up through parent commands. /// /// # Examples /// @@ -631,11 +631,11 @@ self } - /// Enables multiple settings which are propogated *down* through all child [`SubCommand`]s. + /// Enables multiple settings which are propagated *down* through all child [`SubCommand`]s. /// /// See [`AppSettings`] for a full list of possibilities and examples. /// - /// **NOTE**: The setting is *only* propogated *down* and not up through parent commands. + /// **NOTE**: The setting is *only* propagated *down* and not up through parent commands. /// /// # Examples /// @@ -1153,8 +1153,8 @@ pub fn print_help(&mut self) -> ClapResult<()> { // If there are global arguments, or settings we need to propgate them down to subcommands // before parsing incase we run into a subcommand - self.p.propogate_globals(); - self.p.propogate_settings(); + self.p.propagate_globals(); + self.p.propagate_settings(); self.p.derive_display_order(); self.p.create_help_and_version(); @@ -1183,8 +1183,8 @@ pub fn print_long_help(&mut self) -> ClapResult<()> { // If there are global arguments, or settings we need to propgate them down to subcommands // before parsing incase we run into a subcommand - self.p.propogate_globals(); - self.p.propogate_settings(); + self.p.propagate_globals(); + self.p.propagate_settings(); self.p.derive_display_order(); self.p.create_help_and_version(); @@ -1199,7 +1199,7 @@ /// **NOTE:** clap has the ability to distinguish between "short" and "long" help messages /// depending on if the user ran [`-h` (short)] or [`--help` (long)] /// - /// **NOTE:** There is a known bug where this method does not write propogated global arguments + /// **NOTE:** There is a known bug where this method does not write propagated global arguments /// or autogenerated arguments (i.e. the default help/version args). Prefer /// [`App::write_long_help`] instead if possibe! /// @@ -1220,8 +1220,8 @@ // https://github.com/kbknapp/clap-rs/issues/808 // If there are global arguments, or settings we need to propgate them down to subcommands // before parsing incase we run into a subcommand - // self.p.propogate_globals(); - // self.p.propogate_settings(); + // self.p.propagate_globals(); + // self.p.propagate_settings(); // self.p.derive_display_order(); // self.p.create_help_and_version(); @@ -1247,8 +1247,8 @@ /// [`-h` (short)]: ./struct.Arg.html#method.help /// [`--help` (long)]: ./struct.Arg.html#method.long_help pub fn write_long_help(&mut self, w: &mut W) -> ClapResult<()> { - self.p.propogate_globals(); - self.p.propogate_settings(); + self.p.propagate_globals(); + self.p.propagate_settings(); self.p.derive_display_order(); self.p.create_help_and_version(); @@ -1586,9 +1586,12 @@ { // If there are global arguments, or settings we need to propgate them down to subcommands // before parsing incase we run into a subcommand - self.p.propogate_globals(); - self.p.propogate_settings(); - self.p.derive_display_order(); + if !self.p.is_set(AppSettings::Propagated) { + self.p.propagate_globals(); + self.p.propagate_settings(); + self.p.derive_display_order(); + self.p.set(AppSettings::Propagated); + } let mut matcher = ArgMatcher::new(); @@ -1619,11 +1622,8 @@ return Err(e); } - if self.p.is_set(AppSettings::PropagateGlobalValuesDown) { - for a in &self.p.global_args { - matcher.propagate(a.b.name); - } - } + let global_arg_vec : Vec<&str> = (&self).p.global_args.iter().map(|ga| ga.b.name).collect(); + matcher.propagate_globals(&global_arg_vec); Ok(matcher.into()) } @@ -1793,9 +1793,10 @@ fn help(&self) -> Option<&'e str> { self.p.meta.about } fn long_help(&self) -> Option<&'e str> { self.p.meta.long_about } fn default_val(&self) -> Option<&'e OsStr> { None } - fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { None } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { None } fn longest_filter(&self) -> bool { true } fn aliases(&self) -> Option> { if let Some(ref aliases) = self.p.meta.aliases { diff -Nru distinst-0.1.0/vendor/clap/src/app/parser.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/parser.rs --- distinst-0.1.0/vendor/clap/src/app/parser.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/parser.rs 2017-12-21 19:00:07.000000000 +0000 @@ -9,9 +9,6 @@ use std::slice::Iter; use std::iter::Peekable; -// Third Party -use vec_map::{self, VecMap}; - // Internal use INTERNAL_ERROR_MSG; use INVALID_UTF8; @@ -32,6 +29,7 @@ use app::settings::AppSettings as AS; use app::validator::Validator; use app::usage; +use map::{self, VecMap}; #[derive(Debug, PartialEq, Copy, Clone)] #[doc(hidden)] @@ -98,12 +96,12 @@ } pub fn gen_completions_to(&mut self, for_shell: Shell, buf: &mut W) { - if !self.is_set(AS::Propogated) { - self.propogate_help_version(); + if !self.is_set(AS::Propagated) { + self.propagate_help_version(); self.build_bin_names(); - self.propogate_globals(); - self.propogate_settings(); - self.set(AS::Propogated); + self.propagate_globals(); + self.propagate_settings(); + self.set(AS::Propagated); } ComplGen::new(self).generate(for_shell, buf) @@ -368,12 +366,12 @@ self.subcommands.push(subcmd); } - pub fn propogate_settings(&mut self) { - debugln!("Parser::propogate_settings: self={}, g_settings={:#?}", + pub fn propagate_settings(&mut self) { + debugln!("Parser::propagate_settings: self={}, g_settings={:#?}", self.meta.name, self.g_settings); for sc in &mut self.subcommands { - debugln!("Parser::propogate_settings: sc={}, settings={:#?}, g_settings={:#?}", + debugln!("Parser::propagate_settings: sc={}, settings={:#?}, g_settings={:#?}", sc.p.meta.name, sc.p.settings, sc.p.g_settings); @@ -395,7 +393,7 @@ sc.p.meta.term_w = self.meta.term_w; sc.p.meta.max_w = self.meta.max_w; } - sc.p.propogate_settings(); + sc.p.propagate_settings(); } } @@ -475,10 +473,7 @@ #[inline] pub fn has_visible_subcommands(&self) -> bool { - if self.subcommands.is_empty() { - return false; - } - self.subcommands.iter().any(|s| !s.p.is_set(AS::Hidden)) + self.has_subcommands() && self.subcommands.iter().filter(|sc| sc.p.meta.name != "help").any(|sc| !sc.p.is_set(AS::Hidden)) } #[inline] @@ -612,7 +607,7 @@ true } - pub fn propogate_globals(&mut self) { + pub fn propagate_globals(&mut self) { for sc in &mut self.subcommands { // We have to create a new scope in order to tell rustc the borrow of `sc` is // done and to recursively call this method @@ -621,7 +616,7 @@ sc.p.add_arg_ref(a); } } - sc.p.propogate_globals(); + sc.p.propagate_globals(); } } @@ -853,17 +848,22 @@ if !self.is_set(AS::TrailingValues) { // Does the arg match a subcommand name, or any of it's aliases (if defined) { - let (is_match, sc_name) = self.possible_subcommand(&arg_os); - debugln!("Parser::get_matches_with: possible_sc={:?}, sc={:?}", - is_match, - sc_name); - if is_match { - let sc_name = sc_name.expect(INTERNAL_ERROR_MSG); - if sc_name == "help" && self.is_set(AS::NeedsSubcommandHelp) { - self.parse_help_subcommand(it)?; + match needs_val_of { + ParseResult::Opt(_) | ParseResult::Pos(_) =>(), + _ => { + let (is_match, sc_name) = self.possible_subcommand(&arg_os); + debugln!("Parser::get_matches_with: possible_sc={:?}, sc={:?}", + is_match, + sc_name); + if is_match { + let sc_name = sc_name.expect(INTERNAL_ERROR_MSG); + if sc_name == "help" && self.is_set(AS::NeedsSubcommandHelp) { + self.parse_help_subcommand(it)?; + } + subcmd_name = Some(sc_name.to_owned()); + break; + } } - subcmd_name = Some(sc_name.to_owned()); - break; } } @@ -1015,8 +1015,8 @@ name: sc_name, matches: sc_m.into(), }); - } else if !(self.is_set(AS::AllowLeadingHyphen) || - self.is_set(AS::AllowNegativeNumbers)) && + } else if !((self.is_set(AS::AllowLeadingHyphen) || + self.is_set(AS::AllowNegativeNumbers)) && arg_os.starts_with(b"-")) && !self.is_set(AS::InferSubcommands) { return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), "", @@ -1047,6 +1047,13 @@ .unwrap_or(&self.meta.name), self.color())); } + } else { + return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), + "", + &*usage::create_error_usage(self, + matcher, + None), + self.color())); } } @@ -1080,11 +1087,11 @@ } - fn propogate_help_version(&mut self) { - debugln!("Parser::propogate_help_version;"); + fn propagate_help_version(&mut self) { + debugln!("Parser::propagate_help_version;"); self.create_help_and_version(); for sc in &mut self.subcommands { - sc.p.propogate_help_version(); + sc.p.propagate_help_version(); } } @@ -1337,16 +1344,14 @@ Ok(()) } - #[cfg_attr(feature = "cargo-clippy", allow(let_and_return))] fn use_long_help(&self) -> bool { - let ul = self.flags.iter().any(|f| f.b.long_help.is_some()) || + self.meta.long_about.is_some() || + self.flags.iter().any(|f| f.b.long_help.is_some()) || self.opts.iter().any(|o| o.b.long_help.is_some()) || self.positionals.values().any(|p| p.b.long_help.is_some()) || self.subcommands .iter() - .any(|s| s.p.meta.long_about.is_some()); - debugln!("Parser::use_long_help: ret={:?}", ul); - ul + .any(|s| s.p.meta.long_about.is_some()) } fn _help(&self, mut use_long: bool) -> Error { @@ -1356,7 +1361,7 @@ match Help::write_parser_help(&mut buf, self, use_long) { Err(e) => e, _ => Error { - message: unsafe { String::from_utf8_unchecked(buf) }, + message: String::from_utf8(buf).unwrap_or_default(), kind: ErrorKind::HelpDisplayed, info: None, } @@ -1529,13 +1534,17 @@ debugln!("Parser::parse_opt; opt={}, val={:?}", opt.b.name, val); debugln!("Parser::parse_opt; opt.settings={:?}", opt.b.settings); let mut has_eq = false; + let no_val = val.is_none(); + let empty_vals = opt.is_set(ArgSettings::EmptyValues); + let min_vals_zero = opt.v.min_vals.unwrap_or(1) == 0; + let needs_eq = opt.is_set(ArgSettings::RequireEquals); debug!("Parser::parse_opt; Checking for val..."); if let Some(fv) = val { has_eq = fv.starts_with(&[b'=']) || had_eq; let v = fv.trim_left_matches(b'='); - if !opt.is_set(ArgSettings::EmptyValues) && - (v.len_() == 0 || (opt.is_set(ArgSettings::RequireEquals) && !has_eq)) { + if !empty_vals && + (v.len_() == 0 || (needs_eq && !has_eq)) { sdebugln!("Found Empty - Error"); return Err(Error::empty_value(opt, &*usage::create_error_usage(self, matcher, None), @@ -1546,7 +1555,7 @@ fv, fv.starts_with(&[b'='])); self.add_val_to_arg(opt, v, matcher)?; - } else if opt.is_set(ArgSettings::RequireEquals) && !opt.is_set(ArgSettings::EmptyValues) { + } else if needs_eq && !(empty_vals || min_vals_zero) { sdebugln!("None, but requires equals...Error"); return Err(Error::empty_value(opt, &*usage::create_error_usage(self, matcher, None), @@ -1561,10 +1570,12 @@ self.groups_for_arg(opt.b.name) .and_then(|vec| Some(matcher.inc_occurrences_of(&*vec))); - if val.is_none() || - !has_eq && - (opt.is_set(ArgSettings::Multiple) && !opt.is_set(ArgSettings::RequireDelimiter) && - matcher.needs_more_vals(opt)) { + let needs_delim = opt.is_set(ArgSettings::RequireDelimiter); + let mult = opt.is_set(ArgSettings::Multiple); + if no_val && min_vals_zero && !has_eq && needs_eq { + debugln!("Parser::parse_opt: More arg vals not required..."); + return Ok(ParseResult::ValuesDone); + } else if no_val || (mult && !needs_delim) && !has_eq && matcher.needs_more_vals(opt) { debugln!("Parser::parse_opt: More arg vals required..."); return Ok(ParseResult::Opt(opt.b.name)); } @@ -1724,10 +1735,24 @@ } pub fn add_defaults(&mut self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + debugln!("Parser::add_defaults;"); macro_rules! add_val { (@default $_self:ident, $a:ident, $m:ident) => { if let Some(ref val) = $a.v.default_val { - if $m.get($a.b.name).is_none() { + debugln!("Parser::add_defaults:iter:{}: has default vals", $a.b.name); + if $m.get($a.b.name).map(|ma| ma.vals.len()).map(|len| len == 0).unwrap_or(false) { + debugln!("Parser::add_defaults:iter:{}: has no user defined vals", $a.b.name); + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } else if $m.get($a.b.name).is_some() { + debugln!("Parser::add_defaults:iter:{}: has user defined vals", $a.b.name); + } else { + debugln!("Parser::add_defaults:iter:{}: wasn't used", $a.b.name); + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; if $_self.cache.map_or(true, |name| name != $a.name()) { @@ -1735,10 +1760,13 @@ $_self.cache = Some($a.name()); } } + } else { + debugln!("Parser::add_defaults:iter:{}: doesn't have default vals", $a.b.name); } }; ($_self:ident, $a:ident, $m:ident) => { if let Some(ref vm) = $a.v.default_vals_ifs { + sdebugln!(" has conditional defaults"); let mut done = false; if $m.get($a.b.name).is_none() { for &(arg, val, default) in vm.values() { @@ -1766,12 +1794,52 @@ if done { continue; // outer loop (outside macro) } + } else { + sdebugln!(" doesn't have conditional defaults"); } add_val!(@default $_self, $a, $m) }; } for o in &self.opts { + debug!("Parser::add_defaults:iter:{}:", o.b.name); + add_val!(self, o, matcher); + } + for p in self.positionals.values() { + debug!("Parser::add_defaults:iter:{}:", p.b.name); + add_val!(self, p, matcher); + } + Ok(()) + } + + pub fn add_env(&mut self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + macro_rules! add_val { + ($_self:ident, $a:ident, $m:ident) => { + if let Some(ref val) = $a.v.env { + if $m.get($a.b.name).map(|ma| ma.vals.len()).map(|len| len == 0).unwrap_or(false) { + if let Some(ref val) = val.1 { + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } + } else { + if let Some(ref val) = val.1 { + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } + } + } + }; + } + + for o in &self.opts { add_val!(self, o, matcher); } for p in self.positionals.values() { @@ -1784,7 +1852,7 @@ pub fn opts(&self) -> Iter> { self.opts.iter() } - pub fn positionals(&self) -> vec_map::Values> { self.positionals.values() } + pub fn positionals(&self) -> map::Values> { self.positionals.values() } pub fn subcommands(&self) -> Iter { self.subcommands.iter() } diff -Nru distinst-0.1.0/vendor/clap/src/app/settings.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/settings.rs --- distinst-0.1.0/vendor/clap/src/app/settings.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/settings.rs 2017-12-21 19:00:07.000000000 +0000 @@ -41,7 +41,7 @@ const ALLOW_MISSING_POS = 1 << 33; const TRAILING_VALUES = 1 << 34; const VALID_NEG_NUM_FOUND = 1 << 35; - const PROPOGATED = 1 << 36; + const PROPAGATED = 1 << 36; const VALID_ARG_FOUND = 1 << 37; const INFER_SUBCOMMANDS = 1 << 38; const CONTAINS_LAST = 1 << 39; @@ -103,7 +103,7 @@ WaitOnError => WAIT_ON_ERROR, TrailingValues => TRAILING_VALUES, ValidNegNumFound => VALID_NEG_NUM_FOUND, - Propogated => PROPOGATED, + Propagated => PROPAGATED, ValidArgFound => VALID_ARG_FOUND, InferSubcommands => INFER_SUBCOMMANDS, ContainsLast => CONTAINS_LAST @@ -588,18 +588,17 @@ /// ``` NextLineHelp, - /// Specifies that the parser should propagate global arg's values down through any *used* child - /// subcommands. Meaning, if a subcommand wasn't used, the values won't be propagated down to + /// **DEPRECATED**: This setting is no longer required in order to propagate values up or down + /// + /// Specifies that the parser should propagate global arg's values down or up through any *used* + /// child subcommands. Meaning, if a subcommand wasn't used, the values won't be propagated to /// said subcommand. /// - /// **NOTE:** Values are only propagated *down* through futher child commands, not up - /// /// # Examples /// /// ```rust /// # use clap::{App, Arg, AppSettings, SubCommand}; /// let m = App::new("myprog") - /// .setting(AppSettings::PropagateGlobalValuesDown) /// .arg(Arg::from_usage("[cmd] 'command to run'") /// .global(true)) /// .subcommand(SubCommand::with_name("foo")) @@ -616,7 +615,6 @@ /// ```rust /// # use clap::{App, Arg, AppSettings, SubCommand}; /// let m = App::new("myprog") - /// .setting(AppSettings::PropagateGlobalValuesDown) /// .arg(Arg::from_usage("[cmd] 'command to run'") /// .global(true)) /// .subcommand(SubCommand::with_name("foo")) @@ -626,6 +624,7 @@ /// /// assert!(m.subcommand_matches("foo").is_none()); /// ``` + #[deprecated(since = "2.27.0", note = "No longer required to propagate values")] PropagateGlobalValuesDown, /// Allows [`SubCommand`]s to override all requirements of the parent command. @@ -856,7 +855,7 @@ ValidNegNumFound, #[doc(hidden)] - Propogated, + Propagated, #[doc(hidden)] ValidArgFound, @@ -901,7 +900,7 @@ "waitonerror" => Ok(AppSettings::WaitOnError), "validnegnumfound" => Ok(AppSettings::ValidNegNumFound), "validargfound" => Ok(AppSettings::ValidArgFound), - "propogated" => Ok(AppSettings::Propogated), + "propagated" => Ok(AppSettings::Propagated), "trailingvalues" => Ok(AppSettings::TrailingValues), _ => Err("unknown AppSetting, cannot convert from str".to_owned()), } @@ -976,8 +975,8 @@ AppSettings::ValidNegNumFound); assert_eq!("validargfound".parse::().unwrap(), AppSettings::ValidArgFound); - assert_eq!("propogated".parse::().unwrap(), - AppSettings::Propogated); + assert_eq!("propagated".parse::().unwrap(), + AppSettings::Propagated); assert_eq!("trailingvalues".parse::().unwrap(), AppSettings::TrailingValues); assert_eq!("infersubcommands".parse::().unwrap(), diff -Nru distinst-0.1.0/vendor/clap/src/app/validator.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/validator.rs --- distinst-0.1.0/vendor/clap/src/app/validator.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/app/validator.rs 2017-12-21 19:00:07.000000000 +0000 @@ -28,6 +28,7 @@ -> ClapResult<()> { debugln!("Validator::validate;"); let mut reqs_validated = false; + self.0.add_env(matcher)?; self.0.add_defaults(matcher)?; if let ParseResult::Opt(a) = needs_val_of { debugln!("Validator::validate: needs_val_of={:?}", a); @@ -165,20 +166,22 @@ } for name in &self.0.blacklist { - debugln!("Validator::validate_blacklist:iter: Checking blacklisted name: {}", - name); + debugln!("Validator::validate_blacklist:iter:{}: Checking blacklisted arg", name); + let mut should_err = false; if self.0.groups.iter().any(|g| &g.name == name) { - debugln!("Validator::validate_blacklist:iter: groups contains it..."); + debugln!("Validator::validate_blacklist:iter:{}: groups contains it...", name); for n in self.0.arg_names_in_group(name) { - debugln!("Validator::validate_blacklist:iter:iter: Checking arg '{}' in group...", - n); + debugln!("Validator::validate_blacklist:iter:{}:iter:{}: looking in group...", name, n); if matcher.contains(n) { - debugln!("Validator::validate_blacklist:iter:iter: matcher contains it..."); + debugln!("Validator::validate_blacklist:iter:{}:iter:{}: matcher contains it...", name, n); return Err(build_err!(self.0, n, matcher)); } } - } else if matcher.contains(name) { - debugln!("Validator::validate_blacklist:iter: matcher contains it..."); + } else if let Some(ma) = matcher.get(name) { + debugln!("Validator::validate_blacklist:iter:{}: matcher contains it...", name); + should_err = ma.occurs > 0; + } + if should_err { return Err(build_err!(self.0, *name, matcher)); } } @@ -294,9 +297,9 @@ self.0.color())); } } - if let Some(num) = a.min_vals() { + let min_vals_zero = if let Some(num) = a.min_vals() { debugln!("Validator::validate_arg_num_vals: min_vals set: {}", num); - if (ma.vals.len() as u64) < num { + if (ma.vals.len() as u64) < num && num != 0 { debugln!("Validator::validate_arg_num_vals: Sending error TooFewValues"); return Err(Error::too_few_values(a, num, @@ -306,9 +309,10 @@ None), self.0.color())); } - } + num == 0 + } else { false }; // Issue 665 (https://github.com/kbknapp/clap-rs/issues/665) - if a.takes_value() && !a.is_set(ArgSettings::EmptyValues) && ma.vals.is_empty() { + if a.takes_value() && !(a.is_set(ArgSettings::EmptyValues) || min_vals_zero) && ma.vals.is_empty() { return Err(Error::empty_value(a, &*usage::create_error_usage(self.0, matcher, None), self.0.color())); diff -Nru distinst-0.1.0/vendor/clap/src/args/any_arg.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/any_arg.rs --- distinst-0.1.0/vendor/clap/src/args/any_arg.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/any_arg.rs 2017-12-21 19:00:07.000000000 +0000 @@ -3,11 +3,9 @@ use std::fmt as std_fmt; use std::ffi::{OsStr, OsString}; -// Third Party -use vec_map::{self, VecMap}; - // Internal use args::settings::ArgSettings; +use map::{self, VecMap}; #[doc(hidden)] pub trait AnyArg<'n, 'e>: std_fmt::Display { @@ -34,7 +32,8 @@ fn help(&self) -> Option<&'e str>; fn long_help(&self) -> Option<&'e str>; fn default_val(&self) -> Option<&'e OsStr>; - fn default_vals_ifs(&self) -> Option, &'e OsStr)>>; + fn default_vals_ifs(&self) -> Option, &'e OsStr)>>; + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)>; fn longest_filter(&self) -> bool; fn val_terminator(&self) -> Option<&'e str>; } diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_builder/flag.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/flag.rs --- distinst-0.1.0/vendor/clap/src/args/arg_builder/flag.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/flag.rs 2017-12-21 19:00:07.000000000 +0000 @@ -6,24 +6,28 @@ use std::ffi::{OsStr, OsString}; use std::mem; -// Third Party -use vec_map::{self, VecMap}; - // Internal use Arg; -use args::{ArgSettings, Base, Switched, AnyArg, DispOrder}; +use args::{AnyArg, ArgSettings, Base, DispOrder, Switched}; +use map::{self, VecMap}; #[derive(Default, Clone, Debug)] #[doc(hidden)] pub struct FlagBuilder<'n, 'e> - where 'n: 'e +where + 'n: 'e, { pub b: Base<'n, 'e>, pub s: Switched<'e>, } impl<'n, 'e> FlagBuilder<'n, 'e> { - pub fn new(name: &'n str) -> Self { FlagBuilder { b: Base::new(name), ..Default::default() } } + pub fn new(name: &'n str) -> Self { + FlagBuilder { + b: Base::new(name), + ..Default::default() + } + } } impl<'a, 'b, 'z> From<&'z Arg<'a, 'b>> for FlagBuilder<'a, 'b> { @@ -82,13 +86,15 @@ fn long_help(&self) -> Option<&'e str> { self.b.long_help } fn val_terminator(&self) -> Option<&'e str> { None } fn default_val(&self) -> Option<&'e OsStr> { None } - fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { None } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { None } fn longest_filter(&self) -> bool { self.s.long.is_some() } fn aliases(&self) -> Option> { if let Some(ref aliases) = self.s.aliases { - let vis_aliases: Vec<_> = aliases.iter() + let vis_aliases: Vec<_> = aliases + .iter() .filter_map(|&(n, v)| if v { Some(n) } else { None }) .collect(); if vis_aliases.is_empty() { @@ -107,9 +113,7 @@ } impl<'n, 'e> PartialEq for FlagBuilder<'n, 'e> { - fn eq(&self, other: &FlagBuilder<'n, 'e>) -> bool { - self.b == other.b - } + fn eq(&self, other: &FlagBuilder<'n, 'e>) -> bool { self.b == other.b } } #[cfg(test)] @@ -144,8 +148,12 @@ fn flagbuilder_display_multiple_aliases() { let mut f = FlagBuilder::new("flg"); f.s.short = Some('f'); - f.s.aliases = - Some(vec![("alias_not_visible", false), ("f2", true), ("f3", true), ("f4", true)]); + f.s.aliases = Some(vec![ + ("alias_not_visible", false), + ("f2", true), + ("f3", true), + ("f4", true), + ]); assert_eq!(&*format!("{}", f), "-f"); } } diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_builder/option.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/option.rs --- distinst-0.1.0/vendor/clap/src/args/arg_builder/option.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/option.rs 2017-12-21 19:00:07.000000000 +0000 @@ -5,17 +5,17 @@ use std::ffi::{OsStr, OsString}; use std::mem; -// Third Party -use vec_map::{self, VecMap}; - // Internal -use args::{ArgSettings, AnyArg, Base, Switched, Valued, Arg, DispOrder}; +use args::{AnyArg, Arg, ArgSettings, Base, DispOrder, Switched, Valued}; +use map::{self, VecMap}; +use INTERNAL_ERROR_MSG; #[allow(missing_debug_implementations)] #[doc(hidden)] #[derive(Default, Clone)] pub struct OptBuilder<'n, 'e> - where 'n: 'e +where + 'n: 'e, { pub b: Base<'n, 'e>, pub s: Switched<'e>, @@ -23,7 +23,12 @@ } impl<'n, 'e> OptBuilder<'n, 'e> { - pub fn new(name: &'n str) -> Self { OptBuilder { b: Base::new(name), ..Default::default() } } + pub fn new(name: &'n str) -> Self { + OptBuilder { + b: Base::new(name), + ..Default::default() + } + } } impl<'n, 'e, 'z> From<&'z Arg<'n, 'e>> for OptBuilder<'n, 'e> { @@ -61,6 +66,11 @@ } else { write!(f, "-{}{}", self.s.short.unwrap(), sep)?; } + let delim = if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }; // Write the values such as if let Some(ref vec) = self.v.val_names { @@ -68,7 +78,7 @@ while let Some((_, val)) = it.next() { write!(f, "<{}>", val)?; if it.peek().is_some() { - write!(f, " ")?; + write!(f, "{}", delim)?; } } let num = vec.len(); @@ -80,21 +90,23 @@ while let Some(_) = it.next() { write!(f, "<{}>", self.b.name)?; if it.peek().is_some() { - write!(f, " ")?; + write!(f, "{}", delim)?; } } if self.is_set(ArgSettings::Multiple) && num == 1 { write!(f, "...")?; } } else { - write!(f, + write!( + f, "<{}>{}", self.b.name, if self.is_set(ArgSettings::Multiple) { "..." } else { "" - })?; + } + )?; } Ok(()) @@ -131,13 +143,20 @@ fn help(&self) -> Option<&'e str> { self.b.help } fn long_help(&self) -> Option<&'e str> { self.b.long_help } fn default_val(&self) -> Option<&'e OsStr> { self.v.default_val } - fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { self.v.default_vals_ifs.as_ref().map(|vm| vm.values()) } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { + self.v + .env + .as_ref() + .map(|&(key, ref value)| (key, value.as_ref())) + } fn longest_filter(&self) -> bool { true } fn aliases(&self) -> Option> { if let Some(ref aliases) = self.s.aliases { - let vis_aliases: Vec<_> = aliases.iter() + let vis_aliases: Vec<_> = aliases + .iter() .filter_map(|&(n, v)| if v { Some(n) } else { None }) .collect(); if vis_aliases.is_empty() { @@ -156,16 +175,14 @@ } impl<'n, 'e> PartialEq for OptBuilder<'n, 'e> { - fn eq(&self, other: &OptBuilder<'n, 'e>) -> bool { - self.b == other.b - } + fn eq(&self, other: &OptBuilder<'n, 'e>) -> bool { self.b == other.b } } #[cfg(test)] mod test { use args::settings::ArgSettings; use super::OptBuilder; - use vec_map::VecMap; + use map::VecMap; #[test] fn optbuilder_display1() { @@ -216,8 +233,12 @@ fn optbuilder_display_multiple_aliases() { let mut o = OptBuilder::new("opt"); o.s.long = Some("option"); - o.s.aliases = - Some(vec![("als_not_visible", false), ("als2", true), ("als3", true), ("als4", true)]); + o.s.aliases = Some(vec![ + ("als_not_visible", false), + ("als2", true), + ("als3", true), + ("als4", true), + ]); assert_eq!(&*format!("{}", o), "--option "); } } diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_builder/positional.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/positional.rs --- distinst-0.1.0/vendor/clap/src/args/arg_builder/positional.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/positional.rs 2017-12-21 19:00:07.000000000 +0000 @@ -6,19 +6,18 @@ use std::ffi::{OsStr, OsString}; use std::mem; -// Third Party -use vec_map::{self, VecMap}; - // Internal use Arg; -use args::{ArgSettings, Base, Valued, AnyArg, DispOrder}; +use args::{AnyArg, ArgSettings, Base, DispOrder, Valued}; use INTERNAL_ERROR_MSG; +use map::{self, VecMap}; #[allow(missing_debug_implementations)] #[doc(hidden)] #[derive(Clone, Default)] pub struct PosBuilder<'n, 'e> - where 'n: 'e +where + 'n: 'e, { pub b: Base<'n, 'e>, pub v: Valued<'n, 'e>, @@ -40,16 +39,18 @@ v: Valued::from(a), index: idx, }; - if a.v.max_vals.is_some() || a.v.min_vals.is_some() || - (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) { + if a.v.max_vals.is_some() || a.v.min_vals.is_some() + || (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) + { pb.b.settings.set(ArgSettings::Multiple); } pb } pub fn from_arg(mut a: Arg<'n, 'e>, idx: u64) -> Self { - if a.v.max_vals.is_some() || a.v.min_vals.is_some() || - (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) { + if a.v.max_vals.is_some() || a.v.min_vals.is_some() + || (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) + { a.b.settings.set(ArgSettings::Multiple); } PosBuilder { @@ -73,14 +74,22 @@ pub fn name_no_brackets(&self) -> Cow { debugln!("PosBuilder::name_no_brackets;"); + let mut delim = String::new(); + delim.push(if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }); if let Some(ref names) = self.v.val_names { debugln!("PosBuilder:name_no_brackets: val_names={:#?}", names); if names.len() > 1 { - Cow::Owned(names - .values() - .map(|n| format!("<{}>", n)) - .collect::>() - .join(" ")) + Cow::Owned( + names + .values() + .map(|n| format!("<{}>", n)) + .collect::>() + .join(&*delim), + ) } else { Cow::Borrowed(names.values().next().expect(INTERNAL_ERROR_MSG)) } @@ -93,18 +102,28 @@ impl<'n, 'e> Display for PosBuilder<'n, 'e> { fn fmt(&self, f: &mut Formatter) -> Result { + let mut delim = String::new(); + delim.push(if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }); if let Some(ref names) = self.v.val_names { - write!(f, + write!( + f, "{}", names .values() .map(|n| format!("<{}>", n)) .collect::>() - .join(" "))?; + .join(&*delim) + )?; } else { write!(f, "<{}>", self.b.name)?; } - if self.b.settings.is_set(ArgSettings::Multiple) && (self.v.val_names.is_none() || self.v.val_names.as_ref().unwrap().len() == 1) { + if self.b.settings.is_set(ArgSettings::Multiple) + && (self.v.val_names.is_none() || self.v.val_names.as_ref().unwrap().len() == 1) + { write!(f, "...")?; } @@ -141,10 +160,16 @@ fn takes_value(&self) -> bool { true } fn help(&self) -> Option<&'e str> { self.b.help } fn long_help(&self) -> Option<&'e str> { self.b.long_help } - fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { self.v.default_vals_ifs.as_ref().map(|vm| vm.values()) } fn default_val(&self) -> Option<&'e OsStr> { self.v.default_val } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { + self.v + .env + .as_ref() + .map(|&(key, ref value)| (key, value.as_ref())) + } fn longest_filter(&self) -> bool { true } fn aliases(&self) -> Option> { None } } @@ -161,7 +186,7 @@ mod test { use args::settings::ArgSettings; use super::PosBuilder; - use vec_map::VecMap; + use map::VecMap; #[test] fn display_mult() { diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_builder/valued.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/valued.rs --- distinst-0.1.0/vendor/clap/src/args/arg_builder/valued.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_builder/valued.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,14 +1,15 @@ use std::rc::Rc; use std::ffi::{OsStr, OsString}; -use vec_map::VecMap; +use map::VecMap; use Arg; #[allow(missing_debug_implementations)] #[derive(Clone)] pub struct Valued<'a, 'b> - where 'a: 'b +where + 'a: 'b, { pub possible_vals: Option>, pub val_names: Option>, @@ -20,6 +21,7 @@ pub val_delim: Option, pub default_val: Option<&'b OsStr>, pub default_vals_ifs: Option, &'b OsStr)>>, + pub env: Option<(&'a OsStr, Option)>, pub terminator: Option<&'b str>, } @@ -36,6 +38,7 @@ val_delim: None, default_val: None, default_vals_ifs: None, + env: None, terminator: None, } } diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_matcher.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_matcher.rs --- distinst-0.1.0/vendor/clap/src/args/arg_matcher.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_matcher.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,6 @@ // Std use std::collections::hash_map::{Entry, Iter}; +use std::collections::HashMap; use std::ffi::OsStr; use std::ops::Deref; use std::mem; @@ -20,31 +21,45 @@ impl<'a> ArgMatcher<'a> { pub fn new() -> Self { ArgMatcher::default() } - pub fn propagate(&mut self, arg: &'a str) { - debugln!("ArgMatcher::propagate: arg={}", arg); - let vals: Vec<_> = if let Some(ma) = self.get(arg) { - ma.vals.clone() - } else { - debugln!("ArgMatcher::propagate: arg wasn't used"); - return; - }; - if let Some(ref mut sc) = self.0.subcommand { - { - let sma = (*sc).matches.args.entry(arg).or_insert_with(|| { - let mut gma = MatchedArg::new(); - gma.occurs += 1; - gma.vals = vals.clone(); - gma - }); - if sma.vals.is_empty() { - sma.vals = vals.clone(); - } + pub fn propagate_globals(&mut self, global_arg_vec : &[&'a str]) { + debugln!("ArgMatcher::get_global_values: global_arg_vec={:?}", global_arg_vec); + let mut vals_map = HashMap::new(); + self.fill_in_global_values(global_arg_vec, &mut vals_map); + } + + fn fill_in_global_values( + &mut self, + global_arg_vec: &[&'a str], + vals_map: &mut HashMap<&'a str, MatchedArg> + ) { + for global_arg in global_arg_vec { + if let Some(ma) = self.get(global_arg) { + // We have to check if the parent's global arg wasn't used but still exists + // such as from a default value. + // + // For example, `myprog subcommand --global-arg=value` where --global-arg defines + // a default value of `other` myprog would have an existing MatchedArg for + // --global-arg where the value is `other`, however the occurs will be 0. + let to_update = if let Some(parent_ma) = vals_map.get(global_arg) { + if parent_ma.occurs > 0 && ma.occurs == 0 { + parent_ma.clone() + } else { + ma.clone() + } + } else { + ma.clone() + }; + vals_map.insert(global_arg, to_update); } + } + if let Some(ref mut sc) = self.0.subcommand { let mut am = ArgMatcher(mem::replace(&mut sc.matches, ArgMatches::new())); - am.propagate(arg); + am.fill_in_global_values(global_arg_vec, vals_map); mem::swap(&mut am.0, &mut sc.matches); - } else { - debugln!("ArgMatcher::propagate: Subcommand wasn't used"); + } + + for (name, matched_arg) in vals_map.into_iter() { + self.0.args.insert(name, matched_arg.clone()); } } diff -Nru distinst-0.1.0/vendor/clap/src/args/arg_matches.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_matches.rs --- distinst-0.1.0/vendor/clap/src/args/arg_matches.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg_matches.rs 2017-12-21 19:00:07.000000000 +0000 @@ -179,7 +179,7 @@ pub fn value_of_os>(&self, name: S) -> Option<&OsStr> { self.args .get(name.as_ref()) - .map_or(None, |arg| arg.vals.get(0).map(|v| v.as_os_str())) + .and_then(|arg| arg.vals.get(0).map(|v| v.as_os_str())) } /// Gets a [`Values`] struct which implements [`Iterator`] for values of a specific argument diff -Nru distinst-0.1.0/vendor/clap/src/args/arg.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg.rs --- distinst-0.1.0/vendor/clap/src/args/arg.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/args/arg.rs 2017-12-21 19:00:07.000000000 +0000 @@ -6,11 +6,11 @@ use osstringext::OsStrExt3; #[cfg(not(target_os="windows"))] use std::os::unix::ffi::OsStrExt; - +use std::env; #[cfg(feature = "yaml")] use yaml_rust::Yaml; -use vec_map::VecMap; +use map::VecMap; use usage_parser::UsageParser; use args::settings::ArgSettings; @@ -128,6 +128,7 @@ "default_value" => yaml_to_str!(a, v, default_value), "default_value_if" => yaml_tuple3!(a, v, default_value_if), "default_value_ifs" => yaml_tuple3!(a, v, default_value_if), + "env" => yaml_to_str!(a, v, env), "value_names" => yaml_vec_or_str!(v, a, value_name), "groups" => yaml_vec_or_str!(v, a, group), "requires" => yaml_vec_or_str!(v, a, requires), @@ -1507,7 +1508,7 @@ /// assert!(res.is_ok()); // We didn't use --other=special, so "cfg" wasn't required /// ``` /// - /// Setting [`Arg::required_if(arg, val)`] and having `arg` used with a vaue of `val` but *not* + /// Setting [`Arg::required_if(arg, val)`] and having `arg` used with a value of `val` but *not* /// using this arg is an error. /// /// ```rust @@ -1591,7 +1592,7 @@ /// ``` /// /// Setting [`Arg::required_ifs(&[(arg, val)])`] and having any of the `arg`s used with it's - /// vaue of `val` but *not* using this arg is an error. + /// value of `val` but *not* using this arg is an error. /// /// ```rust /// # use clap::{App, Arg, ErrorKind}; @@ -1890,11 +1891,11 @@ /// **WARNING:** /// /// Setting `multiple(true)` for an [option] with no other details, allows multiple values - /// **and** multiple occurrences because it isn't possible to have more occurrences than values for - /// options. Because multiple values are allowed, `--option val1 val2 val3` is perfectly valid, - /// be careful when designing a CLI where positional arguments are expected after a option which - /// accepts multiple values, as `clap` will continue parsing *values* until it reaches the max - /// or specific number of values defined, or another flag or option. + /// **and** multiple occurrences because it isn't possible to have more occurrences than values + /// for options. Because multiple values are allowed, `--option val1 val2 val3` is perfectly + /// valid, be careful when designing a CLI where positional arguments are expected after a + /// option which accepts multiple values, as `clap` will continue parsing *values* until it + /// reaches the max or specific number of values defined, or another flag or option. /// /// **Pro Tip**: /// @@ -1902,6 +1903,36 @@ /// occurrence. To do this use [`Arg::number_of_values(1)`] in coordination with /// [`Arg::multiple(true)`]. /// + /// **WARNING:** + /// + /// When using args with `multiple(true)` on [options] or [positionals] (i.e. those args that + /// accept values) and [subcommands], one needs to consider the posibility of an argument value + /// being the same as a valid subcommand. By default `clap` will parse the argument in question + /// as a value *only if* a value is possible at that moment. Otherwise it will be parsed as a + /// subcommand. In effect, this means using `multiple(true)` with no additional parameters and + /// a possible value that coincides with a subcommand name, the subcommand cannot be called + /// unless another argument is passed first. + /// + /// As an example, consider a CLI with an option `--ui-paths=...` and subcommand `signer` + /// + /// The following would be parsed as values to `--ui-paths`. + /// + /// ```notrust + /// $ program --ui-paths path1 path2 signer + /// ``` + /// + /// This is because `--ui-paths` accepts multiple values. `clap` will continue parsing values + /// until another argument is reached and it knows `--ui-paths` is done. + /// + /// By adding additional parameters to `--ui-paths` we can solve this issue. Consider adding + /// [`Arg::number_of_values(1)`] as discussed above. The following are all valid, and `signer` + /// is parsed as both a subcommand and a value in the second case. + /// + /// ```notrust + /// $ program --ui-paths path1 signer + /// $ program --ui-paths path1 --ui-paths signer signer + /// ``` + /// /// # Examples /// /// ```rust @@ -2035,6 +2066,9 @@ /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); /// ``` /// [option]: ./struct.Arg.html#method.takes_value + /// [options]: ./struct.Arg.html#method.takes_value + /// [subcommands]: ./struct.SubCommand.html + /// [positionals]: ./struct.Arg.html#method.index /// [`Arg::number_of_values(1)`]: ./struct.Arg.html#method.number_of_values /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple pub fn multiple(self, multi: bool) -> Self { @@ -2054,7 +2088,7 @@ /// **NOTE:** This setting only applies to [options] and [positional arguments] /// /// **NOTE:** When the terminator is passed in on the command line, it is **not** stored as one - /// of the vaues + /// of the values /// /// # Examples /// @@ -2098,14 +2132,10 @@ /// Specifies that an argument can be matched to all child [`SubCommand`]s. /// - /// **NOTE:** Global arguments *only* propagate down, **not** up (to parent commands) - /// - /// **NOTE:** Global arguments *cannot* be [required]. - /// - /// **NOTE:** Global arguments, when matched, *only* exist in the command's matches that they - /// were matched to. For example, if you defined a `--flag` global argument in the top most - /// parent command, but the user supplied the arguments `top cmd1 cmd2 --flag` *only* `cmd2`'s - /// [`ArgMatches`] would return `true` if tested for [`ArgMatches::is_present("flag")`]. + /// **NOTE:** Global arguments *only* propagate down, **not** up (to parent commands), however + /// their values once a user uses them will be propagated back up to parents. In effect, this + /// means one should *define* all global arguments at the top level, however it doesn't matter + /// where the user *uses* the global argument. /// /// # Examples /// @@ -3014,7 +3044,7 @@ /// **NOTE:** If the user *does not* use this argument at runtime [`ArgMatches::is_present`] will /// still return `true`. If you wish to determine whether the argument was used at runtime or /// not, consider [`ArgMatches::occurrences_of`] which will return `0` if the argument was *not* - /// used at runtmie. + /// used at runtime. /// /// **NOTE:** This setting is perfectly compatible with [`Arg::default_value_if`] but slightly /// different. `Arg::default_value` *only* takes affect when the user has not provided this arg @@ -3311,6 +3341,119 @@ self } + /// Specifies that if the value is not passed in as an argument, that it should be retrieved + /// from the environment, if available. If it is not present in the environment, then default + /// rules will apply. + /// + /// **NOTE:** If the user *does not* use this argument at runtime, [`ArgMatches::occurrences_of`] + /// will return `0` even though the [`ArgMatches::value_of`] will return the default specified. + /// + /// **NOTE:** If the user *does not* use this argument at runtime [`ArgMatches::is_present`] will + /// return `true` if the variable is present in the environemnt . If you wish to determine whether + /// the argument was used at runtime or not, consider [`ArgMatches::occurrences_of`] which will + /// return `0` if the argument was *not* used at runtime. + /// + /// **NOTE:** This implicitly sets [`Arg::takes_value(true)`]. + /// + /// **NOTE:** If [`Arg::multiple(true)`] is set then [`Arg::use_delimiter(true)`] should also be + /// set. Otherwise, only a single argument will be returned from the environment variable. The + /// default delimiter is `,` and follows all the other delimiter rules. + /// + /// # Examples + /// + /// In this example, we show the variable coming from the environment: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("env")); + /// ``` + /// + /// In this example, we show the variable coming from an option on the CLI: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG")) + /// .get_matches_from(vec![ + /// "prog", "--flag", "opt" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("opt")); + /// ``` + /// + /// In this example, we show the variable coming from the environment even with the + /// presence of a default: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG") + /// .default_value("default")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("env")); + /// ``` + /// + /// In this example, we show the use of multiple values in a single environment variable: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG_MULTI", "env1,env2"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG_MULTI") + /// .multiple(true) + /// .use_delimiter(true)) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.values_of("flag").unwrap().collect::>(), vec!["env1", "env2"]); + /// ``` + pub fn env(self, name: &'a str) -> Self { + self.env_os(OsStr::new(name)) + } + + /// Specifies that if the value is not passed in as an argument, that it should be retrieved + /// from the environment if available in the exact same manner as [`Arg::env`] only using + /// [`OsStr`]s instead. + pub fn env_os(mut self, name: &'a OsStr) -> Self { + self.setb(ArgSettings::TakesValue); + + self.v.env = Some((name, env::var_os(name))); + self + } + /// When set to `true` the help string will be displayed on the line after the argument and /// indented once. This can be helpful for arguments with very long or complex help messages. /// This can also be helpful for arguments with very long flag names, or many/long value names. diff -Nru distinst-0.1.0/vendor/clap/src/completions/fish.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/completions/fish.rs --- distinst-0.1.0/vendor/clap/src/completions/fish.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/completions/fish.rs 2017-12-21 19:00:07.000000000 +0000 @@ -40,6 +40,11 @@ } } +// Escape string inside single quotes +fn escape_string(string: &str) -> String { + string.replace("\\", "\\\\").replace("'", "\\'") +} + fn gen_fish_inner(root_command: &str, comp_gen: &FishGen, parent_cmds: &str, buffer: &mut String) { debugln!("FishGen::gen_fish_inner;"); // example : @@ -67,7 +72,7 @@ template.push_str(format!(" -l {}", data).as_str()); } if let Some(data) = option.b.help { - template.push_str(format!(" -d \"{}\"", data).as_str()); + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()); } if let Some(ref data) = option.v.possible_vals { template.push_str(format!(" -r -f -a \"{}\"", data.join(" ")).as_str()); @@ -85,7 +90,7 @@ template.push_str(format!(" -l {}", data).as_str()); } if let Some(data) = flag.b.help { - template.push_str(format!(" -d \"{}\"", data).as_str()); + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()); } buffer.push_str(template.as_str()); buffer.push_str("\n"); @@ -96,7 +101,7 @@ template.push_str(" -f"); template.push_str(format!(" -a \"{}\"", &subcommand.p.meta.name).as_str()); if let Some(data) = subcommand.p.meta.about { - template.push_str(format!(" -d \"{}\"", &data).as_str()) + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()) } buffer.push_str(template.as_str()); buffer.push_str("\n"); diff -Nru distinst-0.1.0/vendor/clap/src/completions/zsh.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/completions/zsh.rs --- distinst-0.1.0/vendor/clap/src/completions/zsh.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/completions/zsh.rs 2017-12-21 19:00:07.000000000 +0000 @@ -292,12 +292,20 @@ ret.join("\n") } +// Escape string inside single quotes and brackets +fn escape_string(string: &str) -> String { + string.replace("\\", "\\\\") + .replace("'", "'\\''") + .replace("[", "\\[") + .replace("]", "\\]") +} + fn write_opts_of(p: &Parser) -> String { debugln!("write_opts_of;"); let mut ret = vec![]; for o in p.opts() { debugln!("write_opts_of:iter: o={}", o.name()); - let help = o.help().unwrap_or("").replace("[", "\\[").replace("]", "\\]"); + let help = o.help().map_or(String::new(), escape_string); let mut conflicts = get_zsh_arg_conflicts!(p, o, INTERNAL_ERROR_MSG); conflicts = if conflicts.is_empty() { String::new() @@ -316,7 +324,7 @@ String::new() }; if let Some(short) = o.short() { - let s = format!("\"{conflicts}{multiple}-{arg}+[{help}]{possible_values}\" \\", + let s = format!("'{conflicts}{multiple}-{arg}+[{help}]{possible_values}' \\", conflicts = conflicts, multiple = multiple, arg = short, @@ -327,7 +335,7 @@ ret.push(s); } if let Some(long) = o.long() { - let l = format!("\"{conflicts}{multiple}--{arg}+[{help}]{possible_values}\" \\", + let l = format!("'{conflicts}{multiple}--{arg}+[{help}]{possible_values}' \\", conflicts = conflicts, multiple = multiple, arg = long, @@ -347,7 +355,7 @@ let mut ret = vec![]; for f in p.flags() { debugln!("write_flags_of:iter: f={}", f.name()); - let help = f.help().unwrap_or("").replace("[", "\\[").replace("]", "\\]"); + let help = f.help().map_or(String::new(), escape_string); let mut conflicts = get_zsh_arg_conflicts!(p, f, INTERNAL_ERROR_MSG); conflicts = if conflicts.is_empty() { String::new() @@ -361,7 +369,7 @@ "" }; if let Some(short) = f.short() { - let s = format!("\"{conflicts}{multiple}-{arg}[{help}]\" \\", + let s = format!("'{conflicts}{multiple}-{arg}[{help}]' \\", multiple = multiple, conflicts = conflicts, arg = short, @@ -372,7 +380,7 @@ } if let Some(long) = f.long() { - let l = format!("\"{conflicts}{multiple}--{arg}[{help}]\" \\", + let l = format!("'{conflicts}{multiple}--{arg}[{help}]' \\", conflicts = conflicts, multiple = multiple, arg = long, diff -Nru distinst-0.1.0/vendor/clap/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/lib.rs --- distinst-0.1.0/vendor/clap/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -38,7 +38,7 @@ //! The first example shows a method that allows more advanced configuration options (not shown in //! this small example), or even dynamically generating arguments when desired. The downside is it's //! more verbose. -//! +//! //! ```no_run //! // (Full example with detailed comments in examples/01b_quick_example.rs) //! // @@ -47,7 +47,7 @@ //! // to generate arguments dynamically. //! extern crate clap; //! use clap::{Arg, App, SubCommand}; -//! +//! //! fn main() { //! let matches = App::new("My Super Program") //! .version("1.0") @@ -75,15 +75,15 @@ //! .short("d") //! .help("print debug information verbosely"))) //! .get_matches(); -//! +//! //! // Gets a value for config if supplied by user, or defaults to "default.conf" //! let config = matches.value_of("config").unwrap_or("default.conf"); //! println!("Value for config: {}", config); -//! +//! //! // Calling .unwrap() is safe here because "INPUT" is required (if "INPUT" wasn't //! // required we could have used an 'if let' to conditionally get the value) //! println!("Using input file: {}", matches.value_of("INPUT").unwrap()); -//! +//! //! // Vary the output based on how many times the user used the "verbose" flag //! // (i.e. 'myprog -v -v -v' or 'myprog -vvv' vs 'myprog -v' //! match matches.occurrences_of("v") { @@ -92,7 +92,7 @@ //! 2 => println!("Tons of verbose info"), //! 3 | _ => println!("Don't be crazy"), //! } -//! +//! //! // You can handle information about subcommands by requesting their matches by name //! // (as below), requesting just the name used, or both at the same time //! if let Some(matches) = matches.subcommand_matches("test") { @@ -102,15 +102,15 @@ //! println!("Printing normally..."); //! } //! } -//! +//! //! // more program logic goes here... //! } //! ``` -//! +//! //! The next example shows a far less verbose method, but sacrifices some of the advanced //! configuration options (not shown in this small example). This method also takes a *very* minor //! runtime penalty. -//! +//! //! ```no_run //! // (Full example with detailed comments in examples/01a_quick_example.rs) //! // @@ -118,7 +118,7 @@ //! // which is less verbose //! extern crate clap; //! use clap::{Arg, App, SubCommand}; -//! +//! //! fn main() { //! let matches = App::new("myapp") //! .version("1.0") @@ -134,18 +134,18 @@ //! .author("Someone E. ") //! .arg_from_usage("-d, --debug 'Print debug information'")) //! .get_matches(); -//! +//! //! // Same as previous example... //! } //! ``` -//! +//! //! This third method shows how you can use a YAML file to build your CLI and keep your Rust source //! tidy or support multiple localized translations by having different YAML files for each //! localization. //! //! First, create the `cli.yml` file to hold your CLI options, but it could be called anything we //! like: -//! +//! //! ```yaml //! name: myapp //! version: "1.0" @@ -176,14 +176,14 @@ //! short: d //! help: print debug information //! ``` -//! +//! //! Since this feature requires additional dependencies that not everyone may want, it is *not* //! compiled in by default and we need to enable a feature flag in Cargo.toml: //! -//! Simply change your `clap = "~2.19.0"` to `clap = {version = "~2.19.0", features = ["yaml"]}`. +//! Simply change your `clap = "~2.27.0"` to `clap = {version = "~2.27.0", features = ["yaml"]}`. //! //! At last we create our `main.rs` file just like we would have with the previous two examples: -//! +//! //! ```ignore //! // (Full example with detailed comments in examples/17_yaml.rs) //! // @@ -192,23 +192,23 @@ //! #[macro_use] //! extern crate clap; //! use clap::App; -//! +//! //! fn main() { //! // The YAML file is found relative to the current file, similar to how modules are found //! let yaml = load_yaml!("cli.yml"); //! let matches = App::from_yaml(yaml).get_matches(); -//! +//! //! // Same as previous examples... //! } //! ``` -//! +//! //! Finally there is a macro version, which is like a hybrid approach offering the speed of the //! builder pattern (the first example), but without all the verbosity. -//! +//! //! ```no_run //! #[macro_use] //! extern crate clap; -//! +//! //! fn main() { //! let matches = clap_app!(myapp => //! (version: "1.0") @@ -224,55 +224,55 @@ //! (@arg verbose: -v --verbose "Print test information verbosely") //! ) //! ).get_matches(); -//! +//! //! // Same as before... //! } //! ``` -//! +//! //! If you were to compile any of the above programs and run them with the flag `--help` or `-h` (or //! `help` subcommand, since we defined `test` as a subcommand) the following would be output -//! +//! //! ```text //! $ myprog --help //! My Super Program 1.0 //! Kevin K. //! Does awesome things -//! +//! //! USAGE: //! MyApp [FLAGS] [OPTIONS] [SUBCOMMAND] -//! +//! //! FLAGS: //! -h, --help Prints this message //! -v Sets the level of verbosity //! -V, --version Prints version information -//! +//! //! OPTIONS: //! -c, --config Sets a custom config file -//! +//! //! ARGS: //! INPUT The input file to use -//! +//! //! SUBCOMMANDS: //! help Prints this message //! test Controls testing features //! ``` -//! +//! //! **NOTE:** You could also run `myapp test --help` to see similar output and options for the //! `test` subcommand. -//! +//! //! ## Try it! -//! +//! //! ### Pre-Built Test -//! +//! //! To try out the pre-built example, use the following steps: -//! +//! //! * Clone the repository `$ git clone https://github.com/kbknapp/clap-rs && cd clap-rs/tests` //! * Compile the example `$ cargo build --release` //! * Run the help info `$ ./target/release/claptests --help` //! * Play with the arguments! -//! +//! //! ### BYOB (Build Your Own Binary) -//! +//! //! To test out `clap`'s default auto-generated help/version follow these steps: //! //! * Create a new cargo project `$ cargo new fake --bin && cd fake` @@ -282,104 +282,106 @@ //! [dependencies] //! clap = "2" //! ``` -//! +//! //! * Add the following to your `src/main.rs` -//! +//! //! ```no_run //! extern crate clap; //! use clap::App; -//! +//! //! fn main() { //! App::new("fake").version("v1.0-beta").get_matches(); //! } //! ``` -//! +//! //! * Build your program `$ cargo build --release` //! * Run with help or version `$ ./target/release/fake --help` or `$ ./target/release/fake //! --version` -//! +//! //! ## Usage -//! +//! //! For full usage, add `clap` as a dependency in your `Cargo.toml` (it is **highly** recommended to //! use the `~major.minor.patch` style versions in your `Cargo.toml`, for more information see //! [Compatibility Policy](#compatibility-policy)) to use from crates.io: -//! +//! //! ```toml //! [dependencies] -//! clap = "~2.19.0" +//! clap = "~2.27.0" //! ``` -//! +//! //! Or get the latest changes from the master branch at github: -//! +//! //! ```toml //! [dependencies.clap] //! git = "https://github.com/kbknapp/clap-rs.git" //! ``` -//! +//! //! Add `extern crate clap;` to your crate root. -//! -//! Define a list of valid arguments for your program (see the +//! +//! Define a list of valid arguments for your program (see the //! [documentation](https://docs.rs/clap/) or [examples/](examples) directory of this repo) -//! +//! //! Then run `cargo build` or `cargo update && cargo build` for your project. -//! +//! //! ### Optional Dependencies / Features -//! +//! //! #### Features enabled by default -//! +//! //! * `suggestions`: Turns on the `Did you mean '--myoption'?` feature for when users make typos. (builds dependency `strsim`) //! * `color`: Turns on colored error messages. This feature only works on non-Windows OSs. (builds dependency `ansi-term` and `atty`) -//! * `wrap_help`: Wraps the help at the actual terminal width when available, instead of 120 chracters. (builds dependency `term_size`) -//! +//! * `wrap_help`: Wraps the help at the actual terminal width when +//! available, instead of 120 chracters. (builds dependency `textwrap` +//! with feature `term_size`) +//! //! To disable these, add this to your `Cargo.toml`: -//! +//! //! ```toml //! [dependencies.clap] -//! version = "~2.19.0" +//! version = "~2.27.0" //! default-features = false //! ``` -//! +//! //! You can also selectively enable only the features you'd like to include, by adding: -//! +//! //! ```toml //! [dependencies.clap] -//! version = "~2.19.0" +//! version = "~2.27.0" //! default-features = false -//! +//! //! # Cherry-pick the features you'd like to use //! features = [ "suggestions", "color" ] //! ``` -//! +//! //! #### Opt-in features -//! +//! //! * **"yaml"**: Enables building CLIs from YAML documents. (builds dependency `yaml-rust`) //! * **"unstable"**: Enables unstable `clap` features that may change from release to release -//! +//! //! ### Dependencies Tree -//! -//! The following graphic depicts `clap`s dependency graph (generated using +//! +//! The following graphic depicts `clap`s dependency graph (generated using //! [cargo-graph](https://github.com/kbknapp/cargo-graph)). -//! +//! //! * **Dashed** Line: Optional dependency //! * **Red** Color: **NOT** included by default (must use cargo `features` to enable) //! * **Blue** Color: Dev dependency, only used while developing. -//! +//! //! ![clap dependencies](clap_dep_graph.png) -//! +//! //! ### More Information -//! +//! //! You can find complete documentation on the [docs.rs](https://docs.rs/clap/) for this project. -//! +//! //! You can also find usage examples in the [examples/](examples) directory of this repo. -//! +//! //! #### Video Tutorials -//! +//! //! There's also the video tutorial series [Argument Parsing with Rust v2](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U). -//! +//! //! These videos slowly trickle out as I finish them and currently a work in progress. -//! +//! //! ## How to Contribute -//! +//! //! Contributions are always welcome! And there is a multitude of ways in which you can help //! depending on what you like to do, or are good at. Anything from documentation, code cleanup, //! issue completion, new features, you name it, even filing issues is contributing and greatly @@ -388,82 +390,82 @@ //! Another really great way to help is if you find an interesting, or helpful way in which to use //! `clap`. You can either add it to the [examples/](examples) directory, or file an issue and tell //! me. I'm all about giving credit where credit is due :) -//! +//! //! Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) before you start contributing. -//! -//! +//! +//! //! ### Testing Code -//! +//! //! To test with all features both enabled and disabled, you can run theese commands: -//! +//! //! ```text //! $ cargo test --no-default-features //! $ cargo test --features "yaml unstable" //! ``` -//! +//! //! Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the //! prebuilt recipies. *Not* using `just` is prfeclty fine as well, it simply bundles commands //! automatically. -//! +//! //! For example, to test the code, as above simply run: -//! +//! //! ```text //! $ just run-tests` //! ``` -//! +//! //! From here on, I will lis the appropriate `cargo` command as well as the `just` command. -//! +//! //! Sometimes it's helpful to only run a subset of the tests, which can be done via: -//! +//! //! ```text //! $ cargo test --test -//! +//! //! # Or -//! +//! //! $ just run-test //! ``` -//! +//! //! ### Linting Code -//! +//! //! During the CI process `clap` runs against many different lints using //! [`clippy`](https://github.com/Manishearth/rust-clippy). In order to check if these lints pass on //! your own computer prior to submitting a PR you'll need a nightly compiler. -//! +//! //! In order to check the code for lints run either: -//! +//! //! ```text //! $ rustup override add nightly //! $ cargo build --features lints //! $ rustup override remove -//! +//! //! # Or -//! +//! //! $ just lint //! ``` -//! +//! //! ### Debugging Code -//! +//! //! Another helpful technique is to see the `clap` debug output while developing features. In order //! to see the debug output while running the full test suite or individual tests, run: -//! +//! //! ```text //! $ cargo test --features debug -//! +//! //! # Or for individual tests //! $ cargo test --test --features debug -//! +//! //! # The corresponding just command for individual debugging tests is: //! $ just debug //! ``` -//! +//! //! ### Goals -//! +//! //! There are a few goals of `clap` that I'd like to maintain throughout contributions. If your //! proposed changes break, or go against any of these goals we'll discuss the changes further //! before merging (but will *not* be ignored, all contributes are welcome!). These are by no means //! hard-and-fast rules, as I'm no expert and break them myself from time to time (even if by //! mistake or ignorance). -//! +//! //! * Remain backwards compatible when possible //! - If backwards compatibility *must* be broken, use deprecation warnings if at all possible before //! removing legacy code - This does not apply for security concerns @@ -475,7 +477,7 @@ //! - Once parsing is complete, the memory footprint of `clap` should be low since the main program //! is the star of the show //! * `panic!` on *developer* error, exit gracefully on *end-user* error -//! +//! //! ### Compatibility Policy //! //! Because `clap` takes `SemVer` and compatibility seriously, this is the official policy regarding @@ -488,8 +490,8 @@ //! In order to keep from being suprised of breaking changes, it is **highly** recommended to use //! the `~major.minor.patch` style in your `Cargo.toml`: //! -//! ```toml -//! [dependencies] clap = "~2.19.0" +//! ```toml +//! [dependencies] clap = "~2.27.0" //! ``` //! //! This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore @@ -498,19 +500,20 @@ //! #### Minimum Version of Rust //! //! `clap` will officially support current stable Rust, minus two releases, but may work with prior -//! releases as well. For example, current stable Rust at the time of this writing is 1.13.0, -//! meaning `clap` is guaranteed to compile with 1.11.0 and beyond. At the 1.14.0 release, `clap` -//! will be guaranteed to compile with 1.12.0 and beyond, etc. -//! +//! releases as well. For example, current stable Rust at the time of this writing is 1.21.0, +//! meaning `clap` is guaranteed to compile with 1.19.0 and beyond. At the 1.22.0 release, `clap` +//! will be guaranteed to compile with 1.20.0 and beyond, etc. +//! //! Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be //! clearly annotated in the `CHANGELOG.md` -//! +//! //! ## License -//! +//! //! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT](LICENSE-MIT) file in //! this repository for more information. #![crate_type= "lib"] +#![doc(html_root_url = "https://docs.rs/clap/2.27.1")] #![deny( missing_docs, missing_debug_implementations, @@ -524,7 +527,8 @@ #![cfg_attr(not(any(feature = "lints", feature = "nightly")), forbid(unstable_features))] #![cfg_attr(feature = "lints", feature(plugin))] #![cfg_attr(feature = "lints", plugin(clippy))] -#![cfg_attr(feature = "lints", deny(warnings))] +// Need to disable deny(warnings) while deprecations are active +// #![cfg_attr(feature = "lints", deny(warnings))] #![cfg_attr(feature = "lints", allow(cyclomatic_complexity))] #![cfg_attr(feature = "lints", allow(doc_markdown))] #![cfg_attr(feature = "lints", allow(explicit_iter_loop))] @@ -538,11 +542,11 @@ extern crate unicode_width; #[macro_use] extern crate bitflags; +#[cfg(feature = "vec_map")] extern crate vec_map; #[cfg(feature = "wrap_help")] extern crate term_size; extern crate textwrap; -extern crate unicode_segmentation; #[cfg(feature = "color")] extern crate atty; @@ -565,6 +569,7 @@ mod osstringext; mod strext; mod completions; +mod map; const INTERNAL_ERROR_MSG: &'static str = "Fatal internal error. Please consider filing a bug \ report at https://github.com/kbknapp/clap-rs/issues"; diff -Nru distinst-0.1.0/vendor/clap/src/macros.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/macros.rs --- distinst-0.1.0/vendor/clap/src/macros.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/macros.rs 2017-12-21 19:00:07.000000000 +0000 @@ -422,26 +422,29 @@ use std::sync::{ONCE_INIT, Once}; #[allow(missing_copy_implementations)] - #[allow(non_camel_case_types)] #[allow(dead_code)] - struct CARGO_AUTHORS {__private_field: ()} - static CARGO_AUTHORS: CARGO_AUTHORS = CARGO_AUTHORS {__private_field: ()}; + struct CargoAuthors { __private_field: () }; - impl Deref for CARGO_AUTHORS { - type Target = String; + impl Deref for CargoAuthors { + type Target = str; #[allow(unsafe_code)] - fn deref<'a>(&'a self) -> &'a String { + fn deref(&self) -> &'static str { + static ONCE: Once = ONCE_INIT; + static mut VALUE: *const String = 0 as *const String; + unsafe { - static mut LAZY: (*const String, Once) = (0 as *const String, ONCE_INIT); + ONCE.call_once(|| { + let s = env!("CARGO_PKG_AUTHORS").replace(':', $sep); + VALUE = Box::into_raw(Box::new(s)); + }); - LAZY.1.call_once(|| LAZY.0 = Box::into_raw(Box::new(env!("CARGO_PKG_AUTHORS").replace(':', $sep)))); - &*LAZY.0 + &(*VALUE)[..] } } } - &CARGO_AUTHORS[..] + &*CargoAuthors { __private_field: () } }}; () => { env!("CARGO_PKG_AUTHORS") diff -Nru distinst-0.1.0/vendor/clap/src/map.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/map.rs --- distinst-0.1.0/vendor/clap/src/map.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/map.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,84 @@ +#[cfg(feature = "vec_map")] +pub use vec_map::{VecMap, Values}; + +#[cfg(not(feature = "vec_map"))] +pub use self::vec_map::{VecMap, Values}; + +#[cfg(not(feature = "vec_map"))] +mod vec_map { + use std::collections::BTreeMap; + use std::collections::btree_map; + use std::fmt::{self, Debug, Formatter}; + + #[derive(Clone, Default, Debug)] + pub struct VecMap { + inner: BTreeMap, + } + + impl VecMap { + pub fn new() -> Self { + VecMap { inner: Default::default() } + } + + pub fn len(&self) -> usize { + self.inner.len() + } + + pub fn is_empty(&self) -> bool { + self.inner.is_empty() + } + + pub fn insert(&mut self, key: usize, value: V) -> Option { + self.inner.insert(key, value) + } + + pub fn values(&self) -> Values { + self.inner.values() + } + + pub fn iter(&self) -> Iter { + Iter { inner: self.inner.iter() } + } + + pub fn contains_key(&self, key: usize) -> bool { + self.inner.contains_key(&key) + } + + pub fn entry(&mut self, key: usize) -> Entry { + self.inner.entry(key) + } + + pub fn get(&self, key: usize) -> Option<&V> { + self.inner.get(&key) + } + } + + pub type Values<'a, V> = btree_map::Values<'a, usize, V>; + + pub type Entry<'a, V> = btree_map::Entry<'a, usize, V>; + + #[derive(Clone)] + pub struct Iter<'a, V: 'a> { + inner: btree_map::Iter<'a, usize, V>, + } + + impl<'a, V: 'a + Debug> Debug for Iter<'a, V> { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + f.debug_list().entries(self.inner.clone()).finish() + } + } + + impl<'a, V: 'a> Iterator for Iter<'a, V> { + type Item = (usize, &'a V); + + fn next(&mut self) -> Option { + self.inner.next().map(|(k, v)| (*k, v)) + } + } + + impl<'a, V: 'a> DoubleEndedIterator for Iter<'a, V> { + fn next_back(&mut self) -> Option { + self.inner.next_back().map(|(k, v)| (*k, v)) + } + } +} diff -Nru distinst-0.1.0/vendor/clap/src/suggestions.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/suggestions.rs --- distinst-0.1.0/vendor/clap/src/suggestions.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/suggestions.rs 2017-12-21 19:00:07.000000000 +0000 @@ -58,15 +58,16 @@ if let Some(candidate) = did_you_mean(arg, opts) { let suffix = format!( - "\n\tDid you mean to put '--{}' after the subcommand '{}'?", - Format::Good(arg), - Format::Good(candidate)); + "\n\tDid you mean to put '{}{}' after the subcommand '{}'?", + Format::Good("--"), + Format::Good(candidate), + Format::Good(subcommand.get_name())); return (suffix, Some(candidate)); } } } } - return (String::new(), None) + (String::new(), None) } /// Returns a suffix that can be empty, or is the standard 'did you mean' phrase diff -Nru distinst-0.1.0/vendor/clap/src/usage_parser.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/usage_parser.rs --- distinst-0.1.0/vendor/clap/src/usage_parser.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/src/usage_parser.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,10 +1,9 @@ -// Third Party -use vec_map::VecMap; // Internal use INTERNAL_ERROR_MSG; use args::Arg; use args::settings::ArgSettings; +use map::VecMap; #[derive(PartialEq, Debug)] enum UsageToken { diff -Nru distinst-0.1.0/vendor/clap/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/.travis.yml --- distinst-0.1.0/vendor/clap/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/clap/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -3,10 +3,10 @@ cache: cargo rust: - nightly - - nightly-2017-01-25 + - nightly-2017-06-07 - beta - stable - - 1.13.0 + - 1.18.0 matrix: allow_failures: - rust: nightly @@ -14,6 +14,12 @@ - | pip install git+git://github.com/kbknapp/travis-cargo.git --user && export PATH=$HOME/.local/bin:$PATH + - | + if [[ "$TRAVIS_RUST_VERSION" == "1.13.0" ]]; then + echo "Old Rust detected, removing version-sync dependency" + sed -i "/^version-sync =/d" Cargo.toml + rm "tests/version-numbers.rs" + fi script: - | travis-cargo test -- --verbose --no-default-features && diff -Nru distinst-0.1.0/vendor/conv/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/.cargo-checksum.json --- distinst-0.1.0/vendor/conv/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"ed17d8ac9d834ecaaba9736aba1f48340e129f5dcc8bb42423f81b92466b1957","Cargo.toml":"5a5ebfcd3c64dd9c621b2322b9a4f26078afcc6e0898737f6b1c316f22f24d91","LICENSE":"b2507383f9c3de7b2067c5af0fbe8ab5f24bb5fc0f606525201f2890d51c3400","README.md":"961818d81b7596a3575148a8ab54b66b40e7fa5e7942e6f78770635a675de031","src/errors.rs":"60cb67d97d4dcd8cb37c47a107ca064f101e24cb5dc9ff3e56939b87e6ea6372","src/impls.rs":"6620dca1ac72b1b2c1ff46b1ec1a637cbe3ecbde2a2e4471f9e25ca4da706d59","src/lib.rs":"b2573e4eb1e75abac4a959a1f870752fc6d9592e682c34b68d52b31fbf95ccc3","src/macros.rs":"8f5d4cf40c127e1eda1b4c13c1e81a45aed11af8bb6db88e3672a267b79b4daa","src/misc.rs":"9e4f8012588b81a0e9445d4072dc55a530591b67d3149dc5cc7688409d5e8f69","tests/conv_utils.rs":"e6704c5cda52cb7adafddbc6be4f4a6267cd4caf7eb44864cf8d9809dba3d079","tests/derive_try_from.rs":"f0a5a5f084e01666049f766373327520ff33f18ab845d22e01d111cdaacc36a4","tests/lang_char.rs":"8d410c9c9efcc1d1ba2ff3c1454a5c3b3d3913596ba59ffd34eb973ad87e56eb","tests/lang_floats.rs":"398ce7cae3388f707d0850ddde6ae46ed26d3cabfe8eb1417cc5093fe49e6bcb","tests/lang_ints.rs":"fd8179a8d1279f5e42a28622e38a6edbd5206aa6abaea6f7bd40886e6fabb058","tests/unwraps.rs":"0edd2cfd1fcf3ed1804bf1bee68c56ae7edaa2efc6a6599f8d669cd8726ea3e3","tests/use_in_generics.rs":"965d9debc0982fe96103a1a08144c5a9d4b8af07510ea84fc997ead568b49563","tests/util/mod.rs":"fdd9bb3500bd060f70288f79f7dd083eb25a09d8fe6a02f12951208a7ae999cf"},"package":"78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/conv/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/Cargo.toml --- distinst-0.1.0/vendor/conv/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -[package] -name = "conv" -version = "0.3.3" -authors = ["Daniel Keep "] - -description = "This crate provides a number of conversion traits with more specific semantics than those provided by 'as' or 'From'/'Into'." -repository = "https://github.com/DanielKeep/rust-conv" -documentation = "https://danielkeep.github.io/rust-conv/doc/conv/index.html" -readme = "README.md" -license = "MIT" -keywords = ["from", "into", "conversion", "approximation"] - -exclude = [ - "scripts/*", - "update-docs.py", -] - -[dependencies] -custom_derive = "0.1.2" - -[dev-dependencies] -quickcheck = "0.2.21, < 0.2.25" diff -Nru distinst-0.1.0/vendor/conv/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/LICENSE --- distinst-0.1.0/vendor/conv/LICENSE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Copyright (c) 2015 Daniel Keep - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff -Nru distinst-0.1.0/vendor/conv/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/README.md --- distinst-0.1.0/vendor/conv/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ - -# `conv` - -This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`. - -The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describing alternatives to the standard `From`/`Into` traits. For example, the although `T: From` might be satisfied in generic code, this says nothing about what *kind* of conversion that represents. - -In addition, `From`/`Into` provide no facility for a conversion failing, meaning that implementations may need to choose between conversions that may not be valid, or panicking; neither option is appealing in general. - -**Links** - -* [Latest Release](https://crates.io/crates/scan-rules/) -* [Latest Docs](https://danielkeep.github.io/rust-scan-rules/doc/scan_rules/index.html) -* [Repository](https://github.com/DanielKeep/rust-scan-rules) - -## Compatibility - -`conv` is compatible with Rust 1.2 and higher. - -## Examples - -```rust -# extern crate conv; -# use conv::*; -# fn main() { -// This *cannot* fail, so we can use `unwrap_ok` to discard the `Result`. -assert_eq!(u8::value_from(0u8).unwrap_ok(), 0u8); - -// This *can* fail. Specifically, it can overflow toward negative infinity. -assert_eq!(u8::value_from(0i8), Ok(0u8)); -assert_eq!(u8::value_from(-1i8), Err(NegOverflow(-1))); - -// This can overflow in *either* direction; hence the change to `RangeError`. -assert_eq!(u8::value_from(-1i16), Err(RangeError::NegOverflow(-1))); -assert_eq!(u8::value_from(0i16), Ok(0u8)); -assert_eq!(u8::value_from(256i16), Err(RangeError::PosOverflow(256))); - -// We can use the extension traits to simplify this a little. -assert_eq!(u8::value_from(-1i16).unwrap_or_saturate(), 0u8); -assert_eq!(u8::value_from(0i16).unwrap_or_saturate(), 0u8); -assert_eq!(u8::value_from(256i16).unwrap_or_saturate(), 255u8); - -// Obviously, all integers can be "approximated" using the default scheme (it -// doesn't *do* anything), but they can *also* be approximated with the -// `Wrapping` scheme. -assert_eq!( - >::approx_from(400u16), - Err(PosOverflow(400))); -assert_eq!( - >::approx_from(400u16), - Ok(144u8)); - -// This is rather inconvenient; as such, there are a number of convenience -// extension methods available via `ConvUtil` and `ConvAsUtil`. -assert_eq!(400u16.approx(), Err::(PosOverflow(400))); -assert_eq!(400u16.approx_by::(), Ok::(144u8)); -assert_eq!(400u16.approx_as::(), Err(PosOverflow(400))); -assert_eq!(400u16.approx_as_by::(), Ok(144)); - -// Integer -> float conversions *can* fail due to limited precision. -// Once the continuous range of exactly representable integers is exceeded, the -// provided implementations fail with overflow errors. -assert_eq!(f32::value_from(16_777_216i32), Ok(16_777_216.0f32)); -assert_eq!(f32::value_from(16_777_217i32), Err(RangeError::PosOverflow(16_777_217))); - -// Float -> integer conversions have to be done using approximations. Although -// exact conversions are *possible*, "advertising" this with an implementation -// is misleading. -// -// Note that `DefaultApprox` for float -> integer uses whatever rounding -// mode is currently active (*i.e.* whatever `as` would do). -assert_eq!(41.0f32.approx(), Ok(41u8)); -assert_eq!(41.3f32.approx(), Ok(41u8)); -assert_eq!(41.5f32.approx(), Ok(41u8)); -assert_eq!(41.8f32.approx(), Ok(41u8)); -assert_eq!(42.0f32.approx(), Ok(42u8)); - -assert_eq!(255.0f32.approx(), Ok(255u8)); -assert_eq!(256.0f32.approx(), Err::(FloatError::PosOverflow(256.0))); - -// Sometimes, it can be useful to saturate the conversion from float to -// integer directly, then account for NaN as input separately. The `Saturate` -// extension trait exists for this reason. -assert_eq!((-23.0f32).approx_as::().saturate(), Ok(0)); -assert_eq!(302.0f32.approx_as::().saturate(), Ok(255u8)); -assert!(std::f32::NAN.approx_as::().saturate().is_err()); - -// If you really don't care about the specific kind of error, you can just rely -// on automatic conversion to `GeneralErrorKind`. -fn too_many_errors() -> Result<(), GeneralErrorKind> { - assert_eq!({let r: u8 = try!(0u8.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0i8.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0i16.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0.0f32.approx()); r}, 0u8); - Ok(()) -} -# let _ = too_many_errors(); -# } -``` - -## Change Log - -### v0.3.2 - -- Added integer ↔ `char` conversions. -- Added missing `isize`/`usize` → `f32`/`f64` conversions. -- Fixed the error type of `i64` → `usize` for 64-bit targets. - -### v0.3.1 - -- Change to `unwrap_ok` for better codegen (thanks bluss). -- Fix for Rust breaking change (code in question was dodgy anyway; thanks m4rw3r). - -### v0.3.0 - -- Added an `Error` constraint to all `Err` associated types. This will break any user-defined conversions where the `Err` type does not implement `Error`. -- Renamed the `Overflow` and `Underflow` errors to `PosOverflow` and `NegOverflow` respectively. In the context of floating point conversions, "underflow" usually means the value was too close to zero to correctly represent. - -### v0.2.1 - -- Added `ConvUtil::into_as` as a shortcut for `Into::::into`. -- Added `#[inline]` attributes. -- Added `Saturate::saturate`, which can saturate `Result`s arising from over/underflow. - -### v0.2.0 - -- Changed all error types to include the original input as payload. This breaks pretty much *everything*. Sorry about that. On the bright side, there's now no downside to using the conversion traits for non-`Copy` types. -- Added the normal rounding modes for float → int approximations: `RoundToNearest`, `RoundToNegInf`, `RoundToPosInf`, and `RoundToZero`. -- `ApproxWith` is now subsumed by a pair of extension traits (`ConvUtil` and `ConvAsUtil`), that also have shortcuts for `TryInto` and `ValueInto` so that you can specify the destination type on the method. diff -Nru distinst-0.1.0/vendor/conv/src/errors.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/errors.rs --- distinst-0.1.0/vendor/conv/src/errors.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/errors.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,606 +0,0 @@ -/*! -This module defines the various error types that can be produced by a failed conversion. - -In addition, it also defines some extension traits to make working with failable conversions more ergonomic (see the `Unwrap*` traits). -*/ - -use std::any::Any; -use std::error::Error; -use std::fmt::{self, Debug, Display}; -use misc::{Saturated, InvalidSentinel, SignedInfinity}; - -macro_rules! Desc { - ( - ($desc:expr) - pub struct $name:ident<$t:ident> $_body:tt; - ) => { - impl<$t> Display for $name<$t> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(fmt, $desc) - } - } - - impl<$t> Error for $name<$t> where $t: Any { - fn description(&self) -> &str { - $desc - } - } - }; -} - -macro_rules! DummyDebug { - ( - () pub enum $name:ident<$t:ident> { - $(#[doc=$_doc:tt] $vname:ident($_vpay:ident),)+ - } - ) => { - impl<$t> Debug for $name<$t> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - let msg = match *self { - $($name::$vname(_) => stringify!($vname),)+ - }; - write!(fmt, concat!(stringify!($name), "::{}(..)"), msg) - } - } - }; - - ( - () pub struct $name:ident<$t:ident>(pub $_pay:ident); - ) => { - impl<$t> Debug for $name<$t> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(fmt, concat!(stringify!($name), "(..)")) - } - } - }; -} - -macro_rules! EnumDesc { - ( - ($($vname:ident => $vdesc:expr,)+) - pub enum $name:ident $_body:tt - ) => { - impl Display for $name { - fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(fmt, "{}", - match *self { $($name::$vname => $vdesc,)+ }) - } - } - - impl Error for $name { - fn description(&self) -> &str { - match *self { $($name::$vname => $vdesc,)+ } - } - } - }; - - ( - ($($vname:ident => $vdesc:expr,)+) - pub enum $name:ident<$t:ident> $_body:tt - ) => { - impl<$t> Display for $name<$t> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(fmt, "{}", - match *self { $($name::$vname(..) => $vdesc,)+ }) - } - } - - impl<$t> Error for $name<$t> where $t: Any { - fn description(&self) -> &str { - match *self { $($name::$vname(..) => $vdesc,)+ } - } - } - }; -} - -macro_rules! FromName { - ( - ($fname:ident) - pub enum $name:ident<$t:ident> $_body:tt - ) => { - impl<$t> From<$fname<$t>> for $name<$t> { - #[inline] - fn from(e: $fname<$t>) -> Self { - $name::$fname(e.into_inner()) - } - } - }; - - ( - ($fname:ident<$t:ident>) - pub enum $name:ident $_body:tt - ) => { - impl<$t> From<$fname<$t>> for $name { - #[inline] - fn from(_: $fname<$t>) -> Self { - $name::$fname - } - } - }; -} - -macro_rules! FromNoError { - ( - () pub enum $name:ident $_body:tt - ) => { - impl From for $name { - #[inline] - fn from(_: NoError) -> Self { - panic!(concat!("cannot convert NoError into ", stringify!($name))) - } - } - }; - - ( - () pub enum $name:ident<$t:ident> $_body:tt - ) => { - impl<$t> From for $name<$t> { - fn from(_: NoError) -> Self { - panic!(concat!("cannot convert NoError into ", stringify!($name))) - } - } - }; - - ( - () pub struct $name:ident<$t:ident> $_body:tt; - ) => { - impl<$t> From for $name<$t> { - fn from(_: NoError) -> Self { - panic!(concat!("cannot convert NoError into ", stringify!($name))) - } - } - }; -} - -macro_rules! FromRemap { - ( - ($from:ident($($vname:ident),+)) - pub enum $name:ident $_body:tt - ) => { - impl From<$from> for $name { - #[inline] - fn from(e: $from) -> Self { - match e { - $($from::$vname => $name::$vname,)+ - } - } - } - }; - - ( - ($from:ident<$t:ident>($($vname:ident),+)) - pub enum $name:ident $_body:tt - ) => { - impl<$t> From<$from<$t>> for $name { - #[inline] - fn from(e: $from<$t>) -> Self { - match e { - $($from::$vname(..) => $name::$vname,)+ - } - } - } - }; - - ( - ($from:ident($($vname:ident),+)) - pub enum $name:ident<$t:ident> $_body:tt - ) => { - impl<$t> From<$from<$t>> for $name<$t> { - #[inline] - fn from(e: $from<$t>) -> Self { - match e { - $($from::$vname(v) => $name::$vname(v),)+ - } - } - } - }; -} - -macro_rules! IntoInner { - ( - () pub enum $name:ident<$t:ident> { - $(#[doc=$_doc:tt] $vname:ident($_vpay:ident),)+ - } - ) => { - impl<$t> $name<$t> { - /// Returns the value stored in this error. - #[inline] - pub fn into_inner(self) -> $t { - match self { $($name::$vname(v))|+ => v } - } - } - }; - - ( - () pub struct $name:ident<$t:ident>(pub $_pay:ident); - ) => { - impl<$t> $name<$t> { - /// Returns the value stored in this error. - #[inline] - pub fn into_inner(self) -> $t { - self.0 - } - } - }; -} - -custom_derive!{ - /** - A general error enumeration that subsumes all other conversion errors. - - This exists primarily as a "catch-all" for reliably unifying various different kinds of conversion errors. - */ - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - EnumDesc( - NegOverflow => "conversion resulted in negative overflow", - PosOverflow => "conversion resulted in positive overflow", - Unrepresentable => "could not convert unrepresentable value", - ), - FromName(Unrepresentable), - FromName(NegOverflow), - FromName(PosOverflow), - FromRemap(RangeError(NegOverflow, PosOverflow)) - )] - pub enum GeneralError { - /// Input was too negative for the target type. - NegOverflow(T), - - /// Input was too positive for the target type. - PosOverflow(T), - - /// Input was not representable in the target type. - Unrepresentable(T), - } -} - -impl From> for GeneralError { - #[inline] - fn from(e: FloatError) -> GeneralError { - use self::FloatError as F; - use self::GeneralError as G; - match e { - F::NegOverflow(v) => G::NegOverflow(v), - F::PosOverflow(v) => G::PosOverflow(v), - F::NotANumber(v) => G::Unrepresentable(v), - } - } -} - -custom_derive! { - /** - A general error enumeration that subsumes all other conversion errors, but discards all input payloads the errors may be carrying. - - This exists primarily as a "catch-all" for reliably unifying various different kinds of conversion errors, and between different input types. - */ - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, - FromNoError, - EnumDesc( - NegOverflow => "conversion resulted in negative overflow", - PosOverflow => "conversion resulted in positive overflow", - Unrepresentable => "could not convert unrepresentable value", - ), - FromName(Unrepresentable), - FromName(NegOverflow), - FromName(PosOverflow), - FromRemap(RangeErrorKind(NegOverflow, PosOverflow)), - FromRemap(RangeError(NegOverflow, PosOverflow)), - FromRemap(GeneralError(NegOverflow, PosOverflow, Unrepresentable)) - )] - pub enum GeneralErrorKind { - /// Input was too negative for the target type. - NegOverflow, - - /// Input was too positive for the target type. - PosOverflow, - - /// Input was not representable in the target type. - Unrepresentable, - } -} - -impl From> for GeneralErrorKind { - #[inline] - fn from(e: FloatError) -> GeneralErrorKind { - use self::FloatError as F; - use self::GeneralErrorKind as G; - match e { - F::NegOverflow(..) => G::NegOverflow, - F::PosOverflow(..) => G::PosOverflow, - F::NotANumber(..) => G::Unrepresentable, - } - } -} - -/** -Indicates that it is not possible for the conversion to fail. - -You can use the [`UnwrapOk::unwrap_ok`](./trait.UnwrapOk.html#tymethod.unwrap_ok) method to discard the (statically impossible) `Err` case from a `Result<_, NoError>`, without using `Result::unwrap` (which is typically viewed as a "code smell"). -*/ -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)] -pub enum NoError {} - -impl Display for NoError { - fn fmt(&self, _: &mut fmt::Formatter) -> Result<(), fmt::Error> { - unreachable!() - } -} - -impl Error for NoError { - fn description(&self) -> &str { - unreachable!() - } -} - -custom_derive! { - /// Indicates that the conversion failed because the value was not representable. - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - Desc("could not convert unrepresentable value") - )] - pub struct Unrepresentable(pub T); -} - -custom_derive! { - /// Indicates that the conversion failed due to a negative overflow. - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - Desc("conversion resulted in negative overflow") - )] - pub struct NegOverflow(pub T); -} - -custom_derive! { - /// Indicates that the conversion failed due to a positive overflow. - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - Desc("conversion resulted in positive overflow") - )] - pub struct PosOverflow(pub T); -} - -custom_derive! { - /** - Indicates that a conversion from a floating point type failed. - */ - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - EnumDesc( - NegOverflow => "conversion resulted in negative overflow", - PosOverflow => "conversion resulted in positive overflow", - NotANumber => "conversion target does not support not-a-number", - ), - FromName(NegOverflow), - FromName(PosOverflow), - FromRemap(RangeError(NegOverflow, PosOverflow)) - )] - pub enum FloatError { - /// Input was too negative for the target type. - NegOverflow(T), - - /// Input was too positive for the target type. - PosOverflow(T), - - /// Input was not-a-number, which the target type could not represent. - NotANumber(T), - } -} - -custom_derive! { - /** - Indicates that a conversion failed due to a range error. - */ - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, - IntoInner, DummyDebug, FromNoError, - EnumDesc( - NegOverflow => "conversion resulted in negative overflow", - PosOverflow => "conversion resulted in positive overflow", - ), - FromName(NegOverflow), - FromName(PosOverflow) - )] - pub enum RangeError { - /// Input was too negative for the target type. - NegOverflow(T), - - /// Input was too positive the target type. - PosOverflow(T), - } -} - -custom_derive! { - /** - Indicates that a conversion failed due to a range error. - - This is a variant of `RangeError` that does not retain the input value which caused the error. It exists to help unify some utility methods and should not generally be used directly, unless you are targeting the `Unwrap*` traits. - */ - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, - FromNoError, - EnumDesc( - NegOverflow => "conversion resulted in negative overflow", - PosOverflow => "conversion resulted in positive overflow", - ), - FromName(NegOverflow), - FromName(PosOverflow), - FromRemap(RangeError(NegOverflow, PosOverflow)) - )] - pub enum RangeErrorKind { - /// Input was too negative for the target type. - NegOverflow, - - /// Input was too positive for the target type. - PosOverflow, - } -} - -/** -Saturates a `Result`. -*/ -pub trait Saturate { - /// The result of saturating. - type Output; - - /** - Replaces an overflow error with a saturated value. - - Unlike `unwrap_or_saturate`, this method can be used in cases where the `Result` error type can encode failures *other* than overflow and underflow. For example, you cannot saturate a float-to-integer conversion using `unwrap_or_saturate` as the error might be `NotANumber`, which doesn't have a meaningful saturation "direction". - - The output of this method will be a `Result` where the error type *does not* contain overflow conditions. What conditions remain must still be dealt with in some fashion. - */ - fn saturate(self) -> Self::Output; -} - -impl Saturate for Result> -where T: Saturated { - type Output = Result>; - - #[inline] - fn saturate(self) -> Self::Output { - use self::FloatError::*; - match self { - Ok(v) => Ok(v), - Err(NegOverflow(_)) => Ok(T::saturated_min()), - Err(PosOverflow(_)) => Ok(T::saturated_max()), - Err(NotANumber(v)) => Err(Unrepresentable(v)) - } - } -} - -impl Saturate for Result> -where T: Saturated { - type Output = Result; - - #[inline] - fn saturate(self) -> Self::Output { - use self::RangeError::*; - match self { - Ok(v) => Ok(v), - Err(NegOverflow(_)) => Ok(T::saturated_min()), - Err(PosOverflow(_)) => Ok(T::saturated_max()) - } - } -} - -impl Saturate for Result -where T: Saturated { - type Output = Result; - - #[inline] - fn saturate(self) -> Self::Output { - use self::RangeErrorKind::*; - match self { - Ok(v) => Ok(v), - Err(NegOverflow) => Ok(T::saturated_min()), - Err(PosOverflow) => Ok(T::saturated_max()) - } - } -} - -/** -Safely unwrap a `Result` that cannot contain an error. -*/ -pub trait UnwrapOk { - /** - Unwraps a `Result` without possibility of failing. - - Technically, this is not necessary; it's provided simply to make user code a little clearer. - */ - fn unwrap_ok(self) -> T; -} - -impl UnwrapOk for Result { - #[inline] - fn unwrap_ok(self) -> T { - match self { - Ok(v) => v, - Err(no_error) => match no_error {}, - } - } -} - -/** -Unwrap a conversion by saturating to infinity. -*/ -pub trait UnwrapOrInf { - /// The result of unwrapping. - type Output; - - /** - Either unwraps the successfully converted value, or saturates to infinity in the "direction" of overflow. - */ - fn unwrap_or_inf(self) -> Self::Output; -} - -/** -Unwrap a conversion by replacing a failure with an invalid sentinel value. -*/ -pub trait UnwrapOrInvalid { - /// The result of unwrapping. - type Output; - - /** - Either unwraps the successfully converted value, or returns the output type's invalid sentinel value. - */ - fn unwrap_or_invalid(self) -> Self::Output; -} - -/** -Unwrap a conversion by saturating. -*/ -pub trait UnwrapOrSaturate { - /// The result of unwrapping. - type Output; - - /** - Either unwraps the successfully converted value, or saturates in the "direction" of overflow. - */ - fn unwrap_or_saturate(self) -> Self::Output; -} - -impl UnwrapOrInf for Result -where T: SignedInfinity, E: Into { - type Output = T; - #[inline] - fn unwrap_or_inf(self) -> T { - use self::RangeErrorKind::*; - match self.map_err(Into::into) { - Ok(v) => v, - Err(NegOverflow) => T::neg_infinity(), - Err(PosOverflow) => T::pos_infinity(), - } - } -} - -impl UnwrapOrInvalid for Result -where T: InvalidSentinel { - type Output = T; - #[inline] - fn unwrap_or_invalid(self) -> T { - match self { - Ok(v) => v, - Err(..) => T::invalid_sentinel(), - } - } -} - -impl UnwrapOrSaturate for Result -where T: Saturated, E: Into { - type Output = T; - #[inline] - fn unwrap_or_saturate(self) -> T { - use self::RangeErrorKind::*; - match self.map_err(Into::into) { - Ok(v) => v, - Err(NegOverflow) => T::saturated_min(), - Err(PosOverflow) => T::saturated_max(), - } - } -} diff -Nru distinst-0.1.0/vendor/conv/src/impls.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/impls.rs --- distinst-0.1.0/vendor/conv/src/impls.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/impls.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,591 +0,0 @@ -macro_rules! max_of { - ($name:ident) => { ::std::$name::MAX }; -} - -macro_rules! min_of { - ($name:ident) => { ::std::$name::MIN }; -} - -macro_rules! approx_blind { - (($($attrs:tt)*), $src:ty, $dst:ty, $scheme:ty) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::NoError; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - Ok(src as $dst) - } - } - } - }; -} - -macro_rules! approx_z_to_dmax { - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::RangeError<$src>; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - if !(0 <= src) { - return Err(::errors::RangeError::NegOverflow(src)); - } - if !(src <= max_of!($dst) as $src) { - return Err(::errors::RangeError::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - }; -} - -macro_rules! approx_to_dmax { - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::PosOverflow<$src>; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - if !(src <= max_of!($dst) as $src) { - return Err(::errors::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - }; -} - -macro_rules! approx_dmin_to_dmax { - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::RangeError<$src>; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - if !(min_of!($dst) as $src <= src) { - return Err(::errors::RangeError::NegOverflow(src)); - } - if !(src <= max_of!($dst) as $src) { - return Err(::errors::RangeError::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - } -} - -macro_rules! approx_z_up { - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::NegOverflow<$src>; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - if !(0 <= src) { - return Err(::errors::NegOverflow(src)); - } - Ok(src as $dst) - } - } - } - }; -} - -macro_rules! approx_dmin_to_dmax_no_nan { - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => { - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, $scheme, approx: |s| s } - }; - - (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty, approx: |$src_name:ident| $conv:expr) => { - approx_range_no_nan! { - ($($attrs)*), $src, - $dst, [min_of!($dst) as $src, max_of!($dst) as $src], - $scheme, approx: |$src_name| $conv - } - }; -} - -macro_rules! approx_range_no_nan { - (($($attrs:tt)*), $src:ty, $dst:ident, [$min:expr, $max:expr], $scheme:ty) => { - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], $scheme, approx: |s| s } - }; - - (($($attrs:tt)*), $src:ty, $dst:ident, [$min:expr, $max:expr], $scheme:ty, approx: |$src_name:ident| $conv:expr) => { - as_item! { - $($attrs)* - impl ::ApproxFrom<$src, $scheme> for $dst { - type Err = ::errors::FloatError<$src>; - #[inline] - fn approx_from(src: $src) -> Result<$dst, Self::Err> { - if src.is_nan() { - return Err(::errors::FloatError::NotANumber(src)); - } - let approx = { let $src_name = src; $conv }; - if !($min <= approx) { - return Err(::errors::FloatError::NegOverflow(src)); - } - if !(approx <= $max) { - return Err(::errors::FloatError::PosOverflow(src)); - } - Ok(approx as $dst) - } - } - } - }; -} - -macro_rules! num_conv { - (@ $src:ty=> $(,)*) => {}; - - (@ $src:ty=> #[32] $($tail:tt)*) => { - num_conv! { @ $src=> (#[cfg(target_pointer_width="32")]) $($tail)* } - }; - - (@ $src:ty=> #[64] $($tail:tt)*) => { - num_conv! { @ $src=> (#[cfg(target_pointer_width="64")]) $($tail)* } - }; - - (@ $src:ty=> e $($tail:tt)*) => { num_conv! { @ $src=> () e $($tail)* } }; - (@ $src:ty=> n+ $($tail:tt)*) => { num_conv! { @ $src=> () n+ $($tail)* } }; - (@ $src:ty=> n $($tail:tt)*) => { num_conv! { @ $src=> () n $($tail)* } }; - (@ $src:ty=> w+ $($tail:tt)*) => { num_conv! { @ $src=> () w+ $($tail)* } }; - (@ $src:ty=> w $($tail:tt)*) => { num_conv! { @ $src=> () w $($tail)* } }; - (@ $src:ty=> aW $($tail:tt)*) => { num_conv! { @ $src=> () aW $($tail)* } }; - (@ $src:ty=> nf $($tail:tt)*) => { num_conv! { @ $src=> () nf $($tail)* } }; - (@ $src:ty=> fan $($tail:tt)*) => { num_conv! { @ $src=> () fan $($tail)* } }; - - // Exact conversion - (@ $src:ty=> ($($attrs:tt)*) e $dst:ty, $($tail:tt)*) => { - as_item! { - approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::NoError; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Narrowing a signed type *into* an unsigned type where the destination type's maximum value is representable by the source type. - (@ $src:ty=> ($($attrs:tt)*) n+ $dst:ident, $($tail:tt)*) => { - as_item! { - approx_z_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::RangeError<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(0 <= src) { - return Err(::errors::RangeError::NegOverflow(src)); - } - if !(src <= max_of!($dst) as $src) { - return Err(::errors::RangeError::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Narrowing an unsigned type *into* a type where the destination type's maximum value is representable by the source type. - (@ $src:ty=> ($($attrs:tt)*) n- $dst:ident, $($tail:tt)*) => { - as_item! { - approx_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::PosOverflow<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(src <= max_of!($dst) as $src) { - return Err(::errors::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Narrowing where the destination type's bounds are representable by the source type. - (@ $src:ty=> ($($attrs:tt)*) n $dst:ident, $($tail:tt)*) => { - as_item! { - approx_dmin_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::RangeError<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(min_of!($dst) as $src <= src) { - return Err(::errors::RangeError::NegOverflow(src)); - } - if !(src <= max_of!($dst) as $src) { - return Err(::errors::RangeError::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Widening a signed type *into* an unsigned type. - (@ $src:ty=> ($($attrs:tt)*) w+ $dst:ident, $($tail:tt)*) => { - as_item! { - approx_z_up! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::NegOverflow<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(0 <= src) { - return Err(::errors::NegOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Widening. - (@ $src:ty=> ($($attrs:tt)*) w $dst:ident, $($tail:tt)*) => { - as_item! { - approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::NoError; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Narrowing *into* a floating-point type where the conversion is only exact within a given range. - (@ $src:ty=> ($($attrs:tt)*) nf [+- $bound:expr] $dst:ident, $($tail:tt)*) => { - as_item! { - approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::RangeError<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(-$bound <= src) { - return Err(::errors::RangeError::NegOverflow(src)); - } - if !(src <= $bound) { - return Err(::errors::RangeError::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - (@ $src:ty=> ($($attrs:tt)*) nf [, $max:expr] $dst:ident, $($tail:tt)*) => { - as_item! { - approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox } - - $($attrs)* - impl ::ValueFrom<$src> for $dst { - type Err = ::errors::PosOverflow<$src>; - #[inline] - fn value_from(src: $src) -> Result<$dst, Self::Err> { - if !(src <= $max) { - return Err(::errors::PosOverflow(src)); - } - Ok(src as $dst) - } - } - } - num_conv! { @ $src=> $($tail)* } - }; - - // Approximately narrowing a floating point value *into* a type where the source value is constrained by the given range of values. - (@ $src:ty=> ($($attrs:tt)*) fan [$min:expr, $max:expr] $dst:ident, $($tail:tt)*) => { - as_item! { - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], - ::DefaultApprox } - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], - ::RoundToNearest, approx: |s| s.round() } - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], - ::RoundToNegInf, approx: |s| s.floor() } - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], - ::RoundToPosInf, approx: |s| s.ceil() } - approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max], - ::RoundToZero, approx: |s| s.trunc() } - } - num_conv! { @ $src=> $($tail)* } - }; - - (@ $src:ty=> ($($attrs:tt)*) fan $dst:ident, $($tail:tt)*) => { - as_item! { - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::DefaultApprox } - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToNearest, - approx: |s| s.round() } - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToNegInf, - approx: |s| s.floor() } - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToPosInf, - approx: |s| s.ceil() } - approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToZero, - approx: |s| s.trunc() } - } - num_conv! { @ $src=> $($tail)* } - }; - - ($src:ty=> $($tail:tt)*) => { - num_conv! { @ $src=> $($tail)*, } - }; -} - -mod lang_ints { - num_conv! { i8=> w i16, w i32, w i64, w+u8, w+u16, w+u32, w+u64, w isize, w+usize } - num_conv! { i16=> n i8, w i32, w i64, n+u8, w+u16, w+u32, w+u64, w isize, w+usize } - num_conv! { i32=> n i8, n i16, w i64, n+u8, n+u16, w+u32, w+u64 } - num_conv! { i64=> n i8, n i16, n i32, n+u8, n+u16, n+u32, w+u64 } - num_conv! { i32=> #[32] e isize, #[64] w isize, w+usize } - num_conv! { i64=> #[32] n isize, #[64] e isize, #[32] n+usize, #[64] w+usize } - - num_conv! { u8=> n-i8, w i16, w i32, w i64, w u16, w u32, w u64, w isize, w usize } - num_conv! { u16=> n-i8, n-i16, w i32, w i64, n-u8, w u32, w u64, w isize, w usize } - num_conv! { u32=> n-i8, n-i16, n-i32, w i64, n-u8, n-u16, w u64 } - num_conv! { u64=> n-i8, n-i16, n-i32, n-i64, n-u8, n-u16, n-u32 } - num_conv! { u32=> #[32] n-isize, #[64] w isize, #[32] e usize, #[64] w usize } - num_conv! { u64=> n-isize, #[32] n-usize, #[64] e usize } - - num_conv! { isize=> n i8, n i16, #[32] e i32, #[32] w i64, #[64] n i32, #[64] e i64 } - num_conv! { isize=> n+u8, n+u16, #[32] w+u32, #[32] w+u64, #[64] n+u32, #[64] w+u64 } - num_conv! { isize=> w+usize } - - num_conv! { usize=> n-i8, n-i16, #[32] n-i32, #[32] w i64, #[64] n-i32, #[64] n-i64 } - num_conv! { usize=> n-u8, n-u16, #[32] e u32, #[32] w u64, #[64] n-u32, #[64] e u64 } - num_conv! { usize=> n-isize } -} - -mod lang_floats { - use {ApproxFrom, ApproxScheme}; - use ValueFrom; - use errors::{NoError, RangeError}; - - // f32 -> f64: strictly widening - impl ApproxFrom for f64 - where Scheme: ApproxScheme { - type Err = NoError; - #[inline] - fn approx_from(src: f32) -> Result { - Ok(src as f64) - } - } - - impl ValueFrom for f64 { - type Err = NoError; - #[inline] - fn value_from(src: f32) -> Result { - Ok(src as f64) - } - } - - // f64 -> f32: narrowing, approximate - impl ApproxFrom for f32 { - type Err = RangeError; - #[inline] - fn approx_from(src: f64) -> Result { - if !src.is_finite() { - return Ok(src as f32); - } - if !(::std::f32::MIN as f64 <= src) { - return Err(RangeError::NegOverflow(src)); - } - if !(src <= ::std::f32::MAX as f64) { - return Err(RangeError::PosOverflow(src)); - } - Ok(src as f32) - } - } -} - -mod lang_int_to_float { - num_conv! { i8=> w f32, w f64 } - num_conv! { i16=> w f32, w f64 } - num_conv! { i32=> nf [+- 16_777_216] f32, w f64 } - num_conv! { i64=> nf [+- 16_777_216] f32, nf [+- 9_007_199_254_740_992] f64 } - - num_conv! { u8=> w f32, w f64 } - num_conv! { u16=> w f32, w f64 } - num_conv! { u32=> nf [, 16_777_216] f32, w f64 } - num_conv! { u64=> nf [, 16_777_216] f32, nf [, 9_007_199_254_740_992] f64 } - - num_conv! { isize=> nf [+- 16_777_216] f32, - #[32] w f64, #[64] nf [+- 9_007_199_254_740_992] f64 } - num_conv! { usize=> nf [, 16_777_216] f32, - #[32] w f64, #[64] nf [, 9_007_199_254_740_992] f64 } -} - -mod lang_float_to_int { - /* - We use explicit ranges on narrowing float-to-int conversions because it *turns out* that just because you can cast an integer to a float, this *does not* mean you can cast it back and get the original input. The non-explicit-range implementation of `fan` *depends* on this, so it was kinda *totally broken* for narrowing conversions. - - *Yeah.* That's floating point for you! - */ - num_conv! { f32=> fan i8, fan i16, - fan [-2.1474836e9, 2.1474835e9] i32, - fan [-9.223372e18, 9.2233715e18] i64 } - num_conv! { f32=> fan u8, fan u16, - fan [0.0, 4.294967e9] u32, - fan [0.0, 1.8446743e19] u64 } - num_conv! { f32=> - #[32] fan [-2.1474836e9, 2.1474835e9] isize, - #[32] fan [0.0, 4.294967e9] usize, - #[64] fan [-9.223372e18, 9.2233715e18] isize, - #[64] fan [0.0, 1.8446743e19] usize } - - num_conv! { f64=> fan i8, fan i16, fan i32, - fan [-9.223372036854776e18, 9.223372036854775e18] i64 } - num_conv! { f64=> fan u8, fan u16, fan u32, - fan [0.0, 1.844674407370955e19] u64 } - num_conv! { f64=> - #[32] fan isize, #[32] fan usize, - #[64] fan [-9.223372036854776e18, 9.223372036854775e18] isize, - #[64] fan [0.0, 1.844674407370955e19] usize } -} - -mod lang_char_to_int { - use TryFrom; - use ValueFrom; - use errors::{NoError, PosOverflow}; - - impl TryFrom for u32 { - type Err = NoError; - #[inline] - fn try_from(src: char) -> Result { - Ok(src as u32) - } - } - - impl TryFrom for usize { - type Err = NoError; - #[inline] - fn try_from(src: char) -> Result { - Ok(src as usize) - } - } - - impl TryFrom for isize { - type Err = NoError; - #[inline] - fn try_from(src: char) -> Result { - Ok(src as isize) - } - } - - macro_rules! conv_char_to_int { - ($($ts:ty),* $(,)*) => { - $( - impl TryFrom for $ts { - type Err = PosOverflow; - #[inline] - fn try_from(src: char) -> Result<$ts, Self::Err> { - <$ts as ValueFrom<_>>::value_from(src as u32) - .map_err(|_| PosOverflow(src)) - } - } - )* - }; - } - - macro_rules! conv_char_to_int_wide { - ($($ts:ty),* $(,)*) => { - $( - impl TryFrom for $ts { - type Err = NoError; - #[inline] - fn try_from(src: char) -> Result<$ts, Self::Err> { - <$ts as ValueFrom<_>>::value_from(src as u32) - } - } - )* - }; - } - - conv_char_to_int! { i8, i16, i32, u8, u16 } - conv_char_to_int_wide! { i64, u64 } -} - -mod lang_int_to_char { - use TryFrom; - use ValueFrom; - use errors::{NoError, Unrepresentable, UnwrapOk}; - - impl TryFrom for char { - type Err = NoError; - #[inline] - fn try_from(src: u8) -> Result { - Ok(src as char) - } - } - impl TryFrom for char { - type Err = Unrepresentable; - #[inline] - fn try_from(src: u16) -> Result { - TryFrom::try_from( - >::value_from(src).unwrap_ok() - ).map_err(|_| Unrepresentable(src)) - } - } - - impl TryFrom for char { - type Err = Unrepresentable; - #[inline] - fn try_from(src: u32) -> Result { - ::std::char::from_u32(src).ok_or_else(|| Unrepresentable(src)) - } - } - - macro_rules! conv_int_to_char { - ($($ts:ty),* $(,)*) => { - $( - impl TryFrom<$ts> for char { - type Err = Unrepresentable<$ts>; - #[inline] - fn try_from(src: $ts) -> Result { - >::value_from(src) - .map_err(|_| Unrepresentable(src)) - .and_then(|usv| TryFrom::try_from(usv) - .map_err(|_| Unrepresentable(src))) - } - } - )* - }; - } - - conv_int_to_char! { i8, i16, i32, i64, isize, u64, usize } -} diff -Nru distinst-0.1.0/vendor/conv/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/lib.rs --- distinst-0.1.0/vendor/conv/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,525 +0,0 @@ -/*! -This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`. - -The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describing alternatives to the standard `From`/`Into` traits. For example, the although `T: From` might be satisfied, it imposes no restrictions on the *kind* of conversion being implemented. As such, the traits in this crate try to be very specific about what conversions are allowed. This makes them less generally applicable, but more useful where they *do* apply. - -In addition, `From`/`Into` requires all conversions to succeed or panic. All conversion traits in this crate define an associated error type, allowing code to react to failed conversions as appropriate. - - - - -## Compatibility - -`conv` is compatible with Rust 1.2 and higher. - -## Change Log - -### v0.3.2 - -- Added integer ↔ `char` conversions. -- Added missing `isize`/`usize` → `f32`/`f64` conversions. -- Fixed the error type of `i64` → `usize` for 64-bit targets. - -### v0.3.1 - -- Change to `unwrap_ok` for better codegen (thanks bluss). -- Fix for Rust breaking change (code in question was dodgy anyway; thanks m4rw3r). - -### v0.3.0 - -- Added an `Error` constraint to all `Err` associated types. This will break any user-defined conversions where the `Err` type does not implement `Error`. -- Renamed the `Overflow` and `Underflow` errors to `PosOverflow` and `NegOverflow` respectively. In the context of floating point conversions, "underflow" usually means the value was too close to zero to correctly represent. - -### v0.2.1 - -- Added `ConvUtil::into_as` as a shortcut for `Into::::into`. -- Added `#[inline]` attributes. -- Added `Saturate::saturate`, which can saturate `Result`s arising from over/underflow. - -### v0.2.0 - -- Changed all error types to include the original input as payload. This breaks pretty much *everything*. Sorry about that. On the bright side, there's now no downside to using the conversion traits for non-`Copy` types. -- Added the normal rounding modes for float → int approximations: `RoundToNearest`, `RoundToNegInf`, `RoundToPosInf`, and `RoundToZero`. -- `ApproxWith` is now subsumed by a pair of extension traits (`ConvUtil` and `ConvAsUtil`), that also have shortcuts for `TryInto` and `ValueInto` so that you can specify the destination type on the method. - -# Overview - -The following traits are used to define various conversion semantics: - -- [`ApproxFrom`](./trait.ApproxFrom.html)/[`ApproxInto`](./trait.ApproxInto.html) - approximate conversions, with selectable approximation scheme (see [`ApproxScheme`](./trait.ApproxScheme.html)). -- [`TryFrom`](./trait.TryFrom.html)/[`TryInto`](./trait.TryInto.html) - general, potentially failing value conversions. -- [`ValueFrom`](./trait.ValueFrom.html)/[`ValueInto`](./trait.ValueInto.html) - exact, value-preserving conversions. - -When *defining* a conversion, try to implement the `*From` trait variant where possible. When *using* a conversion, try to depend on the `*Into` trait variant where possible. This is because the `*Into` traits automatically use `*From` implementations, but not the reverse. Implementing `*From` and using `*Into` ensures conversions work in as many contexts as possible. - -These extension methods are provided to help with some common cases: - -- [`ConvUtil::approx_as`](./trait.ConvUtil.html#method.approx_as) - approximates to `Dst` with the `DefaultApprox` scheme. -- [`ConvUtil::approx_as_by`](./trait.ConvUtil.html#method.approx_as_by) - approximates to `Dst` with the scheme `S`. -- [`ConvUtil::into_as`](./trait.ConvUtil.html#method.into_as) - converts to `Dst` using `Into::into`. -- [`ConvUtil::try_as`](./trait.ConvUtil.html#method.try_as) - converts to `Dst` using `TryInto::try_into`. -- [`ConvUtil::value_as`](./trait.ConvUtil.html#method.value_as) - converts to `Dst` using `ValueInto::value_into`. -- [`ConvAsUtil::approx`](./trait.ConvAsUtil.html#method.approx) - approximates to an inferred destination type with the `DefaultApprox` scheme. -- [`ConvAsUtil::approx_by`](./trait.ConvAsUtil.html#method.approx_by) - approximates to an inferred destination type with the scheme `S`. -- [`Saturate::saturate`](./errors/trait.Saturate.html#tymethod.saturate) - saturates on overflow. -- [`UnwrapOk::unwrap_ok`](./errors/trait.UnwrapOk.html#tymethod.unwrap_ok) - unwraps results from conversions that cannot fail. -- [`UnwrapOrInf::unwrap_or_inf`](./errors/trait.UnwrapOrInf.html#tymethod.unwrap_or_inf) - saturates to ±∞ on failure. -- [`UnwrapOrInvalid::unwrap_or_invalid`](./errors/trait.UnwrapOrInvalid.html#tymethod.unwrap_or_invalid) - substitutes the target type's "invalid" sentinel value on failure. -- [`UnwrapOrSaturate::unwrap_or_saturate`](./errors/trait.UnwrapOrSaturate.html#tymethod.unwrap_or_saturate) - saturates to the maximum or minimum value of the target type on failure. - -A macro is provided to assist in implementing conversions: - -- [`TryFrom!`](./macros/index.html#tryfrom!) - derives an implementation of [`TryFrom`](./trait.TryFrom.html). - -If you are implementing your own types, you may also be interested in the traits contained in the [`misc`](./misc/index.html) module. - -## Provided Implementations - -The crate provides several blanket implementations: - -- `*From for A` (all types can be converted from and into themselves). -- `*Into for Src where Dst: *From` (`*From` implementations imply a matching `*Into` implementation). - -Conversions for the builtin numeric (integer and floating point) types are provided. In general, `ValueFrom` conversions exist for all pairs except for float → integer (since such a conversion is generally unlikely to *exactly* succeed) and `f64 → f32` (for the same reason). `ApproxFrom` conversions with the `DefaultApprox` scheme exist between all pairs. `ApproxFrom` with the `Wrapping` scheme exist between integers. - -## Errors - -A number of error types are defined in the [`errors`](./errors/index.html) module. Generally, conversions use whichever error type most *narrowly* defines the kinds of failures that can occur. For example: - -- `ValueFrom for u16` cannot possibly fail, and as such it uses `NoError`. -- `ValueFrom for u16` can *only* fail with a negative overflow, thus it uses the `NegOverflow` type. -- `ValueFrom for u16` can overflow in either direction, hence it uses `RangeError`. -- Finally, `ApproxFrom for u16` can overflow (positive or negative), or attempt to convert NaN; `FloatError` covers those three cases. - -Because there are *numerous* error types, the `GeneralError` enum is provided. `From for GeneralError` exists for each error type `E` defined by this crate (even for `NoError`!), allowing errors to be translated automatically by `try!`. In fact, all errors can be "expanded" to *all* more general forms (*e.g.* `NoError` → `NegOverflow`, `PosOverflow` → `RangeError` → `FloatError`). - -Aside from `NoError`, the various error types wrap the input value that you attempted to convert. This is so that non-`Copy` types do not need to be pre-emptively cloned prior to conversion, just in case the conversion fails. A downside is that this means there are many, *many* incompatible error types. - -To help alleviate this, there is also `GeneralErrorKind`, which is simply `GeneralError` without the payload, and all errors can be converted into it directly. - -The reason for not just using `GeneralErrorKind` in the first place is to statically reduce the number of potential error cases you need to deal with. It also allows the `Unwrap*` extension traits to be defined *without* the possibility for runtime failure (*e.g.* you cannot use `unwrap_or_saturate` with a `FloatError`, because what do you do if the error is `NotANumber`; saturate to max or to min? Or panic?). - -# Examples - -``` -# extern crate conv; -# use conv::*; -# fn main() { -// This *cannot* fail, so we can use `unwrap_ok` to discard the `Result`. -assert_eq!(u8::value_from(0u8).unwrap_ok(), 0u8); - -// This *can* fail. Specifically, it can overflow toward negative infinity. -assert_eq!(u8::value_from(0i8), Ok(0u8)); -assert_eq!(u8::value_from(-1i8), Err(NegOverflow(-1))); - -// This can overflow in *either* direction; hence the change to `RangeError`. -assert_eq!(u8::value_from(-1i16), Err(RangeError::NegOverflow(-1))); -assert_eq!(u8::value_from(0i16), Ok(0u8)); -assert_eq!(u8::value_from(256i16), Err(RangeError::PosOverflow(256))); - -// We can use the extension traits to simplify this a little. -assert_eq!(u8::value_from(-1i16).unwrap_or_saturate(), 0u8); -assert_eq!(u8::value_from(0i16).unwrap_or_saturate(), 0u8); -assert_eq!(u8::value_from(256i16).unwrap_or_saturate(), 255u8); - -// Obviously, all integers can be "approximated" using the default scheme (it -// doesn't *do* anything), but they can *also* be approximated with the -// `Wrapping` scheme. -assert_eq!( - >::approx_from(400u16), - Err(PosOverflow(400))); -assert_eq!( - >::approx_from(400u16), - Ok(144u8)); - -// This is rather inconvenient; as such, there are a number of convenience -// extension methods available via `ConvUtil` and `ConvAsUtil`. -assert_eq!(400u16.approx(), Err::(PosOverflow(400))); -assert_eq!(400u16.approx_by::(), Ok::(144u8)); -assert_eq!(400u16.approx_as::(), Err(PosOverflow(400))); -assert_eq!(400u16.approx_as_by::(), Ok(144)); - -// Integer -> float conversions *can* fail due to limited precision. -// Once the continuous range of exactly representable integers is exceeded, the -// provided implementations fail with overflow errors. -assert_eq!(f32::value_from(16_777_216i32), Ok(16_777_216.0f32)); -assert_eq!(f32::value_from(16_777_217i32), Err(RangeError::PosOverflow(16_777_217))); - -// Float -> integer conversions have to be done using approximations. Although -// exact conversions are *possible*, "advertising" this with an implementation -// is misleading. -// -// Note that `DefaultApprox` for float -> integer uses whatever rounding -// mode is currently active (*i.e.* whatever `as` would do). -assert_eq!(41.0f32.approx(), Ok(41u8)); -assert_eq!(41.3f32.approx(), Ok(41u8)); -assert_eq!(41.5f32.approx(), Ok(41u8)); -assert_eq!(41.8f32.approx(), Ok(41u8)); -assert_eq!(42.0f32.approx(), Ok(42u8)); - -assert_eq!(255.0f32.approx(), Ok(255u8)); -assert_eq!(256.0f32.approx(), Err::(FloatError::PosOverflow(256.0))); - -// Sometimes, it can be useful to saturate the conversion from float to -// integer directly, then account for NaN as input separately. The `Saturate` -// extension trait exists for this reason. -assert_eq!((-23.0f32).approx_as::().saturate(), Ok(0)); -assert_eq!(302.0f32.approx_as::().saturate(), Ok(255u8)); -assert!(std::f32::NAN.approx_as::().saturate().is_err()); - -// If you really don't care about the specific kind of error, you can just rely -// on automatic conversion to `GeneralErrorKind`. -fn too_many_errors() -> Result<(), GeneralErrorKind> { - assert_eq!({let r: u8 = try!(0u8.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0i8.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0i16.value_into()); r}, 0u8); - assert_eq!({let r: u8 = try!(0.0f32.approx()); r}, 0u8); - Ok(()) -} -# let _ = too_many_errors(); -# } -``` - -*/ - -#![deny(missing_docs)] - -#[macro_use] extern crate custom_derive; - -// Exported macros. -pub mod macros; - -pub use errors::{ - NoError, GeneralError, GeneralErrorKind, Unrepresentable, - NegOverflow, PosOverflow, - FloatError, RangeError, RangeErrorKind, - Saturate, - UnwrapOk, UnwrapOrInf, UnwrapOrInvalid, UnwrapOrSaturate, -}; - -use std::error::Error; - -/** -Publicly re-exports the most generally useful set of items. - -Usage of the prelude should be considered **unstable**. Although items will likely *not* be removed without bumping the major version, new items *may* be added, which could potentially cause name conflicts in user code. -*/ -pub mod prelude { - pub use super::{ - ApproxFrom, ApproxInto, - ValueFrom, ValueInto, - GeneralError, GeneralErrorKind, - Saturate, - UnwrapOk, UnwrapOrInf, UnwrapOrInvalid, UnwrapOrSaturate, - ConvUtil, ConvAsUtil, - RoundToNearest, RoundToZero, Wrapping, - }; -} - -macro_rules! as_item { - ($($i:item)*) => {$($i)*}; -} - -macro_rules! item_for_each { - ( - $( ($($arg:tt)*) ),* $(,)* => { $($exp:tt)* } - ) => { - macro_rules! body { - $($exp)* - } - - $( - body! { $($arg)* } - )* - }; -} - -pub mod errors; -pub mod misc; - -mod impls; - -/** -This trait is used to perform a conversion that is permitted to approximate the result, but *not* to wrap or saturate the result to fit into the destination type's representable range. - -Where possible, prefer *implementing* this trait over `ApproxInto`, but prefer *using* `ApproxInto` for generic constraints. - -# Details - -All implementations of this trait must provide a conversion that can be separated into two logical steps: an approximation transform, and a representation transform. - -The "approximation transform" step involves transforming the input value into an approximately equivalent value which is supported by the target type *without* taking the target type's representable range into account. For example, this might involve rounding or truncating a floating point value to an integer, or reducing the accuracy of a floating point value. - -The "representation transform" step *exactly* rewrites the value from the source type's binary representation into the destination type's binary representation. This step *may not* transform the value in any way. If the result of the approximation is not representable, the conversion *must* fail. - -The major reason for this formulation is to exactly define what happens when converting between floating point and integer types. Often, it is unclear what happens to floating point values beyond the range of the target integer type. Do they saturate, wrap, or cause a failure? - -With this formulation, it is well-defined: if a floating point value is outside the representable range, the conversion fails. This allows users to distinguish between approximation and range violation, and act accordingly. -*/ -pub trait ApproxFrom: Sized where Scheme: ApproxScheme { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the given value into an approximately equivalent representation. - fn approx_from(src: Src) -> Result; -} - -impl ApproxFrom for Src where Scheme: ApproxScheme { - type Err = NoError; - fn approx_from(src: Src) -> Result { - Ok(src) - } -} - -/** -This is the dual of `ApproxFrom`; see that trait for information. - -Where possible, prefer *using* this trait over `ApproxFrom` for generic constraints, but prefer *implementing* `ApproxFrom`. -*/ -pub trait ApproxInto where Scheme: ApproxScheme { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the subject into an approximately equivalent representation. - fn approx_into(self) -> Result; -} - -impl ApproxInto for Src -where - Dst: ApproxFrom, - Scheme: ApproxScheme, -{ - type Err = Dst::Err; - fn approx_into(self) -> Result { - ApproxFrom::approx_from(self) - } -} - -/** -This trait is used to mark approximation scheme types. -*/ -pub trait ApproxScheme {} - -/** -The "default" approximation scheme. This scheme does whatever would generally be expected of a lossy conversion, assuming no additional context or instruction is given. - -This is a double-edged sword: it has the loosest semantics, but is far more likely to exist than more complicated approximation schemes. -*/ -pub enum DefaultApprox {} -impl ApproxScheme for DefaultApprox {} - -/** -This scheme is used to convert a value by "wrapping" it into a narrower range. - -In abstract, this can be viewed as the opposite of rounding: rather than preserving the most significant bits of a value, it preserves the *least* significant bits of a value. -*/ -pub enum Wrapping {} -impl ApproxScheme for Wrapping {} - -/** -This scheme is used to convert a value by rounding it to the nearest representable value, with ties rounding away from zero. -*/ -pub enum RoundToNearest {} -impl ApproxScheme for RoundToNearest {} - -/** -This scheme is used to convert a value by rounding it toward negative infinity to the nearest representable value. -*/ -pub enum RoundToNegInf {} -impl ApproxScheme for RoundToNegInf {} - -/** -This scheme is used to convert a value by rounding it toward positive infinity to the nearest representable value. -*/ -pub enum RoundToPosInf {} -impl ApproxScheme for RoundToPosInf {} - -/** -This scheme is used to convert a value by rounding it toward zero to the nearest representable value. -*/ -pub enum RoundToZero {} -impl ApproxScheme for RoundToZero {} - -/** -This trait is used to perform a conversion between different semantic types which might fail. - -Where possible, prefer *implementing* this trait over `TryInto`, but prefer *using* `TryInto` for generic constraints. - -# Details - -Typically, this should be used in cases where you are converting between values whose ranges and/or representations only partially overlap. That the conversion may fail should be a reasonably expected outcome. A standard example of this is converting from integers to enums of unitary variants. -*/ -pub trait TryFrom: Sized { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the given value into the subject type. - fn try_from(src: Src) -> Result; -} - -impl TryFrom for Src { - type Err = NoError; - fn try_from(src: Src) -> Result { - Ok(src) - } -} - -/** -This is the dual of `TryFrom`; see that trait for information. - -Where possible, prefer *using* this trait over `TryFrom` for generic constraints, but prefer *implementing* `TryFrom`. -*/ -pub trait TryInto { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the subject into the destination type. - fn try_into(self) -> Result; -} - -impl TryInto for Src where Dst: TryFrom { - type Err = Dst::Err; - fn try_into(self) -> Result { - TryFrom::try_from(self) - } -} - -/** -This trait is used to perform an exact, value-preserving conversion. - -Where possible, prefer *implementing* this trait over `ValueInto`, but prefer *using* `ValueInto` for generic constraints. - -# Details - -Implementations of this trait should be reflexive, associative and commutative (in the absence of conversion errors). That is, all possible cycles of `ValueFrom` conversions (for which each "step" has a defined implementation) should produce the same result, with a given value either being "round-tripped" exactly, or an error being produced. -*/ -pub trait ValueFrom: Sized { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the given value into an exactly equivalent representation. - fn value_from(src: Src) -> Result; -} - -impl ValueFrom for Src { - type Err = NoError; - fn value_from(src: Src) -> Result { - Ok(src) - } -} - -/** -This is the dual of `ValueFrom`; see that trait for information. - -Where possible, prefer *using* this trait over `ValueFrom` for generic constraints, but prefer *implementing* `ValueFrom`. -*/ -pub trait ValueInto { - /// The error type produced by a failed conversion. - type Err: Error; - - /// Convert the subject into an exactly equivalent representation. - fn value_into(self) -> Result; -} - -impl ValueInto for Src where Dst: ValueFrom { - type Err = Dst::Err; - fn value_into(self) -> Result { - ValueFrom::value_from(self) - } -} - -/** -This extension trait exists to simplify using various conversions. - -If there is more than one implementation for a given type/trait pair, a simple call to `*_into` may not be uniquely resolvable. Due to the position of the type parameter (on the trait itself), it is cumbersome to specify the destination type. A similar problem exists for approximation schemes. - -See also the [`ConvAsUtil`](./trait.ConvAsUtil.html) trait. - -> **Note**: There appears to be a bug in `rustdoc`'s output. This trait is implemented *for all* types, though the methods are only available for types where the appropriate conversions are defined. -*/ -pub trait ConvUtil { - /// Approximate the subject to a given type with the default scheme. - fn approx_as(self) -> Result - where Self: Sized + ApproxInto { - self.approx_into() - } - - /// Approximate the subject to a given type with a specific scheme. - fn approx_as_by(self) -> Result - where - Self: Sized + ApproxInto, - Scheme: ApproxScheme, - { - self.approx_into() - } - - /// Convert the subject to a given type. - fn into_as(self) -> Dst - where Self: Sized + Into { - self.into() - } - - /// Attempt to convert the subject to a given type. - fn try_as(self) -> Result - where Self: Sized + TryInto { - self.try_into() - } - - /// Attempt a value conversion of the subject to a given type. - fn value_as(self) -> Result - where Self: Sized + ValueInto { - self.value_into() - } -} - -impl ConvUtil for T {} - -/** -This extension trait exists to simplify using various conversions. - -If there is more than one `ApproxFrom` implementation for a given type, a simple call to `approx_into` may not be uniquely resolvable. Due to the position of the scheme parameter (on the trait itself), it is cumbersome to specify which scheme you wanted. - -The destination type is inferred from context. - -See also the [`ConvUtil`](./trait.ConvUtil.html) trait. - -> **Note**: There appears to be a bug in `rustdoc`'s output. This trait is implemented *for all* types, though the methods are only available for types where the appropriate conversions are defined. -*/ -pub trait ConvAsUtil { - /// Approximate the subject with the default scheme. - fn approx(self) -> Result - where Self: Sized + ApproxInto { - self.approx_into() - } - - /// Approximate the subject with a specific scheme. - fn approx_by(self) -> Result - where - Self: Sized + ApproxInto, - Scheme: ApproxScheme, - { - self.approx_into() - } -} - -impl ConvAsUtil for T {} diff -Nru distinst-0.1.0/vendor/conv/src/macros.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/macros.rs --- distinst-0.1.0/vendor/conv/src/macros.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/macros.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/*! -This module provides convenience macros to help with implementing the conversion traits. - -# `TryFrom!` - -```ignore -macro_rules! TryFrom { - (($target:ty) $enum:item) => { ... }; -} -``` - -This macro attempts to derive an implementation of the [`TryFrom`](../trait.TryFrom.html) trait. Specifically, it supports `enum`s consisting entirely of unitary variants, with or without explicit values. The source type can be any integer type which the variants of the enumeration can be explicitly cast to (*i.e.* using `as`). - -If a conversion fails (due to there being no matching variant for the specified integer value `src`), then the conversion returns `Err(Unrepresentable(src))` (see [`Unrepresentable`](../errors/struct.Unrepresentable.html)). - -It is compatible with the [`custom_derive!`](https://crates.io/crates/custom_derive) macro. - -## Example - -Using `custom_derive!`: - -``` -#[macro_use] extern crate conv; -#[macro_use] extern crate custom_derive; - -custom_derive! { - #[derive(Debug, PartialEq, TryFrom(i32))] - enum Colours { - Red = 0, - Green = 5, - Blue - } -} - -fn main() { - use conv::{TryFrom, Unrepresentable}; - - assert_eq!(Colours::try_from(0), Ok(Colours::Red)); - assert_eq!(Colours::try_from(1), Err(Unrepresentable(1))); - assert_eq!(Colours::try_from(5), Ok(Colours::Green)); - assert_eq!(Colours::try_from(6), Ok(Colours::Blue)); - assert_eq!(Colours::try_from(7), Err(Unrepresentable(7))); -} -``` - -The above is equivalent to the following: - -``` -#[macro_use] extern crate conv; - -#[derive(Debug, PartialEq)] -enum Colours { - Red = 0, - Green = 5, - Blue -} - -TryFrom! { (i32) enum Colours { - Red = 0, - Green = 5, - Blue -} } -# fn main() {} -``` -*/ - -/** -See the documentation for the [`macros`](./macros/index.html#tryfrom!) module for details. -*/ -#[macro_export] -macro_rules! TryFrom { - (($prim:ty) $(pub)* enum $name:ident { $($body:tt)* }) => { - TryFrom! { - @collect_variants ($name, $prim), - ($($body)*,) -> () - } - }; - - ( - @collect_variants ($name:ident, $prim:ty), - ($(,)*) -> ($($var_names:ident,)*) - ) => { - impl $crate::TryFrom<$prim> for $name { - type Err = $crate::errors::Unrepresentable<$prim>; - fn try_from(src: $prim) -> Result<$name, Self::Err> { - $( - if src == $name::$var_names as $prim { - return Ok($name::$var_names); - } - )* - Err($crate::errors::Unrepresentable(src)) - } - } - }; - - ( - @collect_variants $fixed:tt, - (#[$_attr:meta] $($tail:tt)*) -> $var_names:tt - ) => { - TryFrom! { - @skip_meta $fixed, - ($($tail)*) -> $var_names - } - }; - - ( - @collect_variants $fixed:tt, - ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - TryFrom! { - @collect_variants $fixed, - ($($tail)*) -> ($($var_names)* $var,) - } - }; - - ( - @collect_variants ($name:ident), - ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - const _error: () = concat!( - "cannot derive TryFrom for ", - stringify!($name), - ", due to non-unitary variant ", - stringify!($var), - "." - ); - }; - - ( - @skip_meta $fixed:tt, - (#[$_attr:meta] $($tail:tt)*) -> $var_names:tt - ) => { - TryFrom! { - @skip_meta $fixed, - ($($tail)*) -> $var_names - } - }; - - ( - @skip_meta $fixed:tt, - ($var:ident $($tail:tt)*) -> $var_names:tt - ) => { - TryFrom! { - @collect_variants $fixed, - ($var $($tail)*) -> $var_names - } - }; -} diff -Nru distinst-0.1.0/vendor/conv/src/misc.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/misc.rs --- distinst-0.1.0/vendor/conv/src/misc.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/src/misc.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/*! -This module defines some additional traits not *directly* tied to conversions. -*/ - -/** -This trait indicates that values of a type can be logically "saturated". - -This is used by the `errors::UnwrapOrSaturate` extension trait. -*/ -pub trait Saturated { - /// Returns the type's saturated, maximum value. - fn saturated_max() -> Self; - - /// Returns the type's saturated, minimum value. - fn saturated_min() -> Self; -} - -item_for_each! { - (i8), (i16), (i32), (i64), (u8), (u16), (u32), (u64), (isize), (usize) => { - ($ity:ident) => { - impl Saturated for $ity { - #[inline] fn saturated_max() -> Self { ::std::$ity::MAX } - #[inline] fn saturated_min() -> Self { ::std::$ity::MIN } - } - }; - } -} - -/** -This trait indicates that a type has an "invalid" sentinel value. - -This is used by the `errors::UnwrapOrInvalid` extension trait. -*/ -pub trait InvalidSentinel { - /// Returns the type's "invalid" sentinel value. - fn invalid_sentinel() -> Self; -} - -item_for_each! { - (f32), (f64) => { - ($ity:ident) => { - impl InvalidSentinel for $ity { - #[inline] fn invalid_sentinel() -> Self { ::std::$ity::NAN } - } - }; - } -} - -/** -This trait indicates that a type has positive and negative "infinity" values. - -This is used by the `errors::UnwrapOrInf` extension trait. -*/ -pub trait SignedInfinity { - /// Returns the type's positive infinity value. - fn neg_infinity() -> Self; - - /// Returns the type's negative infinity value. - fn pos_infinity() -> Self; -} - -item_for_each! { - (f32), (f64) => { - ($ity:ident) => { - impl SignedInfinity for $ity { - #[inline] fn neg_infinity() -> Self { ::std::$ity::NEG_INFINITY } - #[inline] fn pos_infinity() -> Self { ::std::$ity::INFINITY } - } - }; - } -} diff -Nru distinst-0.1.0/vendor/conv/tests/conv_utils.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/conv_utils.rs --- distinst-0.1.0/vendor/conv/tests/conv_utils.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/conv_utils.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -#[macro_use] extern crate conv; - -use conv::prelude::*; - -#[test] -fn test_approx() { - use conv::DefaultApprox; - assert_eq!((1.5f32).approx(), Ok(1i32)); - assert_eq!((1.5f32).approx_by::(), Ok(1)); - assert_eq!((1.5f32).approx_as::(), Ok(1)); - assert_eq!((1.5f32).approx_as_by::(), Ok(1)); -} - -#[test] -fn test_into() { - let v = "ABC".into_as::>(); - assert_eq!(&*v, &[0x41, 0x42, 0x43]); -} - -#[test] -fn test_try() { - #[derive(PartialEq, Debug)] enum ItAintRight { BabeNo, NoNo } - TryFrom! { (u8) enum ItAintRight { BabeNo, NoNo } } - - assert_eq!(0u8.try_as::(), Ok(ItAintRight::BabeNo)); - assert_eq!(1u8.try_as::(), Ok(ItAintRight::NoNo)); - assert_eq!(2u8.try_as::(), Err(conv::Unrepresentable(2))); -} - -#[test] -fn test_value() { - assert_eq!((123u32).value_as::(), Ok(123)); -} - -#[test] -fn test_whizzo() { - use conv::errors::Unrepresentable; - assert_eq!((-1.0f32).approx_as::().saturate(), Ok::<_, Unrepresentable<_>>(0u8)); - assert_eq!((-1i32).value_as::().saturate().unwrap_ok(), 0u8); -} diff -Nru distinst-0.1.0/vendor/conv/tests/derive_try_from.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/derive_try_from.rs --- distinst-0.1.0/vendor/conv/tests/derive_try_from.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/derive_try_from.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#[macro_use] extern crate conv; - -use conv::{TryFrom, Unrepresentable}; - -#[derive(Debug, PartialEq)] -enum Get { Up, Down, AllAround } - -TryFrom! { (u8) - enum Get { - Up, - /// And - Down, - /** And */ - AllAround - } -} - -#[derive(Debug, PartialEq)] -enum GottaGo { GetAway, Fast = 9000, Faster = 9001 } - -TryFrom! { (u16) - enum GottaGo { - GetAway, - Fast = 9000, - /// This show was stupid. - Faster = 9001 - } -} - -#[test] -fn test_try_from() { - assert_eq!(Get::try_from(0u8), Ok(Get::Up)); - assert_eq!(Get::try_from(1u8), Ok(Get::Down)); - assert_eq!(Get::try_from(2u8), Ok(Get::AllAround)); - assert_eq!(Get::try_from(3u8), Err(Unrepresentable(3u8))); - - assert_eq!(GottaGo::try_from(0u16), Ok(GottaGo::GetAway)); - assert_eq!(GottaGo::try_from(1u16), Err(Unrepresentable(1u16))); - assert_eq!(GottaGo::try_from(2u16), Err(Unrepresentable(2u16))); - assert_eq!(GottaGo::try_from(3u16), Err(Unrepresentable(3u16))); - assert_eq!(GottaGo::try_from(8999u16), Err(Unrepresentable(8999u16))); - assert_eq!(GottaGo::try_from(9000u16), Ok(GottaGo::Fast)); - assert_eq!(GottaGo::try_from(9001u16), Ok(GottaGo::Faster)); - assert_eq!(GottaGo::try_from(9002u16), Err(Unrepresentable(9002u16))); -} diff -Nru distinst-0.1.0/vendor/conv/tests/lang_char.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_char.rs --- distinst-0.1.0/vendor/conv/tests/lang_char.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_char.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -extern crate conv; - -#[macro_use] mod util; - -use conv::*; - -use conv::PosOverflow as Of; -use conv::Unrepresentable as Ur; - -macro_rules! check { - (@ $from:ty, $to:ty=> $(;)*) => {}; - - (@ $from:ty, $to:ty=> try cident; $($tail:tt)*) => { - check!(@ $from, $to=> try v: '\x00';); - check!(@ $from, $to=> try v: '\x01';); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> try uident; $($tail:tt)*) => { - check!(@ $from, $to=> try v: 0;); - check!(@ $from, $to=> try v: 1;); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> try v: $src:expr, !$dst:expr; $($tail:tt)*) => { - { - let src: $from = $src; - let dst: Result<$to, _> = src.try_into(); - assert_eq!(dst, Err($dst(src))); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> try v: $src:expr; $($tail:tt)*) => { - { - let src: $from = $src; - let dst: Result<$to, _> = src.try_into(); - assert_eq!(dst, Ok($src as $to)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qt: *; $($tail:tt)*) => { - { - extern crate quickcheck; - - fn property(v: $from) -> bool { - let dst: Result<$to, _> = v.try_into(); - dst == Ok(v as $to) - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - ($from:ty, $to:ty=> $($tail:tt)*) => { - check! { @ $from, $to=> $($tail)*; } - }; -} - -#[test] -fn test_i_to_c() { - check!(u8, char => try uident; qt: *); - - /* - `char` is a pain because `u8` is the *only* type you can cast directly from. So, the `check!` macro is *basically useless*. - - Also, `char` has a great big hole in the middle, which makes things more interesting. - - Instead, we're just going to make sure that the conversions *exist* and have the expected error type. - */ - macro_rules! check_i_to_c { - ($($ts:ty),* $(,)*) => { - $( - { - let v: $ts = 0; - let r: Result> = TryFrom::try_from(v); - assert_eq!(r, Ok('\x00')); - } - )* - }; - } - check_i_to_c!(i8, i16, i32, i64, isize, u16, u32, u64, usize); -} - -#[test] -fn test_c_to_i() { - check!(char, i8=> try cident; - try v: '\u{80}', !Of; - ); - check!(char, i16=> try cident; - try v: '\u{8000}', !Of; - ); - check!(char, i32=> try cident;); - check!(char, i64=> try cident;); - check!(char, u8=> try cident; - try v: '\u{100}', !Of; - ); - check!(char, u16=> try cident; - try v: '\u{10000}', !Of; - ); - check!(char, u32=> try cident;); - check!(char, u64=> try cident;); - for_bitness! { - 32 { - check!(char, isize=> try cident; - try v: '\u{10ffff}'; - ); - check!(char, usize=> try cident;); - } - 64 { - check!(char, i64=> try cident;); - check!(char, u64=> try cident;); - } - } -} diff -Nru distinst-0.1.0/vendor/conv/tests/lang_floats.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_floats.rs --- distinst-0.1.0/vendor/conv/tests/lang_floats.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_floats.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -extern crate conv; - -#[macro_use] mod util; - -use conv::*; - -use conv::FloatError::NegOverflow as FU; -use conv::FloatError::PosOverflow as FO; - -#[test] -fn test_f32() { - check!(f32, f32=> fident; qv: *;); - check!(f32, f64=> fident; qv: *;); -} - -#[test] -fn test_f32_to_int() { - check!(f32, i8=> sidenta; qa: i8=> a: -129.0, !FU; a: 128.0, !FO;); - check!(f32, i16=> sidenta; qa: i16=> a: -32_769.0, !FU; a: 32_768.0, !FO;); - check!(f32, i32=> sidenta; qa: i32=> - a: -2.1474836e9, -2147483648; a: 2.1474835e9, 2147483520; - a: -2_147_500_000.0, !FU; a: 2_147_500_000.0, !FO;); - check!(f32, i64=> sidenta; qa: i64=> - a: -9.223372e18, -9223372036854775808; a: 9.2233715e18, 9223371487098961920; - a: -9_223_373_000_000_000_000.0, !FU; a: 9_223_373_000_000_000_000.0, !FO;); - check!(f32, u8=> uidenta; qa: u8=> a: -1.0, !FU; a: 256.0, !FO;); - check!(f32, u16=> uidenta; qa: u16=> a: -1.0, !FU; a: 65_536.0, !FO;); - check!(f32, u32=> uidenta; qa: u32=> - a: 4.294967e9, 4294967040; - a: -1.0, !FU; a: 4_294_968_000.0, !FO;); - check!(f32, u64=> uidenta; qa: u64=> - a: 1.8446743e19, 18446742974197923840; - a: -1.0, !FU; a: 18_446_746_000_000_000_000.0, !FO;); -} - -#[test] -fn test_f64_to_int() { - check!(f64, i8=> sidenta; qa: i8=> a: -129.0, !FU; a: 128.0, !FO;); - check!(f64, i16=> sidenta; qa: i16=> a: -32_769.0, !FU; a: 32_768.0, !FO;); - check!(f64, i32=> sidenta; qa: i32=> a: -2_147_483_649.0, !FU; a: 2_147_483_648.0, !FO;); - check!(f64, i64=> sidenta; qa: i64=> - a: -9.223372036854776e18, -9223372036854775808; - a: 9.223372036854775e18, 9223372036854774784; - a: -9_223_372_036_854_778_000.0, !FU; a: 9_223_372_036_854_778_000.0, !FO;); - check!(f64, u8=> uidenta; qa: u8=> a: -1.0, !FU; a: 256.0, !FO;); - check!(f64, u16=> uidenta; qa: u16=> a: -1.0, !FU; a: 65_536.0, !FO;); - check!(f64, u32=> uidenta; qa: u32=> a: -1.0, !FU; a: 4_294_967_296.0, !FO;); - check!(f64, u64=> uidenta; qa: u64=> - a: 1.844674407370955e19; - a: -1.0, !FU; a: 18_446_744_073_709_560_000.0, !FO;); -} - -#[test] -fn test_f64() { - check!(f64, f32=> fidenta; qa: *;); - check!(f64, f64=> fident; qv: *;); -} diff -Nru distinst-0.1.0/vendor/conv/tests/lang_ints.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_ints.rs --- distinst-0.1.0/vendor/conv/tests/lang_ints.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/lang_ints.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,395 +0,0 @@ -extern crate conv; - -#[macro_use] mod util; - -use conv::*; - -use conv::NegOverflow as Uf; -use conv::PosOverflow as Of; -use conv::RangeError::NegOverflow as RU; -use conv::RangeError::PosOverflow as RO; - -#[test] -fn test_i8() { - check!(i8, i8=> sident; qv: *; qa: *; qaW: *); - check!(i8, i16=> sident; qv: *; qa: *; qaW: *); - check!(i8, i32=> sident; qv: *; qa: *; qaW: *); - check!(i8, i64=> sident; qv: *; qa: *; qaW: *); - check!(i8, u8=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i8, u16=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i8, u32=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i8, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i8, isize=> sident; qv: *; qa: *; qaW: *); - check!(i8, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); -} - -#[test] -fn test_i16() { - check!(i16, i8=> sident; qv: i8=> qa: i8=> qaW: *; - v: -129, !RU; v: 128, !RO; - ); - check!(i16, i16=> sident; qv: *; qa: *; qaW: *); - check!(i16, i32=> sident; qv: *; qa: *; qaW: *); - check!(i16, i64=> sident; qv: *; qa: *; qaW: *); - check!(i16, u8=> uident; qv: u8=> qa: +; qaW: *; - v: -1, !RU; - ); - check!(i16, u16=> uident; qv: u16, i16=> qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i16, u32=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i16, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i16, isize=> sident; qv: *; qa: *; qaW: *); - check!(i16, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); -} - -#[test] -fn test_i32() { - check!(i32, i8=> sident; qv: i8=> qa: i8=> qaW: *; - v: -129, !RU; v: 128, !RO; - ); - check!(i32, i16=> sident; qv: i16=> qa: i16=> qaW: *; - v: -32_769, !RU; v: 32_768, !RO; - ); - check!(i32, i32=> sident; qv: *; qa: *; qaW: *); - check!(i32, i64=> sident; qv: *; qa: *; qaW: *); - check!(i32, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: -1, !RU; - ); - check!(i32, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: -1, !RU; - ); - check!(i32, u32=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(i32, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - for_bitness! { - 32 { - check!(i32, isize=> sident; qv: *; qa: *; qaW: *); - check!(i32, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - } - 64 { - check!(i32, isize=> sident; qv: *; qa: *; qaW: *); - check!(i32, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - } - } -} - -#[test] -fn test_i64() { - check!(i64, i8=> sident; qv: i8=> qa: i8=> qaW: *; - v: -129, !RU; v: 128, !RO; - ); - check!(i64, i16=> sident; qv: i16=> qa: i16=> qaW: *; - v: -32_769, !RU; v: 32_768, !RO; - ); - check!(i64, i32=> sident; qv: i32=> qa: i32=> qaW: *; - v: -2_147_483_649, !RU; v: 2_147_483_648, !RO; - ); - check!(i64, i64=> sident; qv: *; qa: *; qaW: *; - ); - check!(i64, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: -1, !RU; - ); - check!(i64, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: -1, !RU; - ); - check!(i64, u32=> uident; qv: u32=> qa: u32=> qaW: *; - v: -1, !RU; - ); - check!(i64, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - for_bitness! { - 32 { - check!(i64, isize=> sident; qv: isize=> qa: isize=> qaW: *; - v: -2_147_483_649, !RU; v: 2_147_483_648, !RO; - ); - check!(i64, usize=> uident; qv: usize=> qa: usize=> qaW: *; - v: -1, !RU; v: 4_294_967_296, !RO; - ); - } - 64 { - check!(i64, isize=> sident; qv: *; qa: *; qaW: *; - ); - check!(i64, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - } - } -} - -#[test] -fn test_u8() { - check!(u8, i8=> uident; qv: +i8=> qa: +i8=> qaW: *; - v: 127; v: 128, !Of; - ); - check!(u8, i16=> uident; qv: *; qa: *; qaW: *); - check!(u8, i32=> uident; qv: *; qa: *; qaW: *); - check!(u8, i64=> uident; qv: *; qa: *; qaW: *); - check!(u8, u8=> uident; qv: *; qa: *; qaW: *); - check!(u8, u16=> uident; qv: *; qa: *; qaW: *); - check!(u8, u32=> uident; qv: *; qa: *; qaW: *); - check!(u8, u64=> uident; qv: *; qa: *; qaW: *); - check!(u8, isize=> uident; qv: *; qa: *; qaW: *); - check!(u8, usize=> uident; qv: *; qa: *; qaW: *); -} - -#[test] -fn test_u16() { - check!(u16, i8=> uident; qv: +i8=> qa: +i8=> qaW: *; - v: 128, !Of; - ); - check!(u16, i16=> uident; qv: +i16=> qa: +i16=> qaW: *; - v: 32_768, !Of; - ); - check!(u16, i32=> uident; qv: *; qa: *; qaW: *); - check!(u16, i64=> uident; qv: *; qa: *; qaW: *); - check!(u16, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: 256, !Of; - ); - check!(u16, u16=> uident; qv: *; qa: *; qaW: *); - check!(u16, u32=> uident; qv: *; qa: *; qaW: *); - check!(u16, u64=> uident; qv: *; qa: *; qaW: *); - check!(u16, isize=> uident; qv: *; qa: *; qaW: *); - check!(u16, usize=> uident; qv: *; qa: *; qaW: *); -} - -#[test] -fn test_u32() { - check!(u32, i8=> uident; qv: +i8=> qa: +i8=> qaW: *; - v: 128, !Of; - ); - check!(u32, i16=> uident; qv: +i16=> qa: +i16=> qaW: *; - v: 32_768, !Of; - ); - check!(u32, i32=> uident; qv: +i32=> qa: +i32=> qaW: *; - v: 2_147_483_648, !Of; - ); - check!(u32, i64=> uident; qv: *; qa: *; qaW: *); - check!(u32, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: 256, !Of; - ); - check!(u32, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: 65_536, !Of; - ); - check!(u32, u32=> uident; qv: *; qa: *; qaW: *); - check!(u32, u64=> uident; qv: *; qa: *; qaW: *); - for_bitness! { - 32 { - check!(u32, isize=> uident; qv: +isize=> qa: +isize=> qaW: *; - v: 2_147_483_647; v: 2_147_483_648, !Of; - ); - check!(u32, usize=> uident; qv: *; qa: *; qaW: *); - } - 64 { - check!(u32, isize=> uident; qv: *; qa: *; qaW: *); - check!(u32, usize=> uident; qv: *; qa: *; qaW: *); - } - } -} - -#[test] -fn test_u64() { - check!(u64, i8=> uident; qv: +i8=> qa: +i8=> qaW: *; - v: 128, !Of; - ); - check!(u64, i16=> uident; qv: +i16=> qa: +i16=> qaW: *; - v: 32_768, !Of; - ); - check!(u64, i32=> uident; qv: +i32=> qa: +i32=> qaW: *; - v: 2_147_483_648, !Of; - ); - check!(u64, i64=> uident; qv: +i64=> qa: +i64=> qaW: *; - v: 9_223_372_036_854_775_808, !Of; - ); - check!(u64, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: 256, !Of; - ); - check!(u64, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: 65_536, !Of; - ); - check!(u64, u32=> uident; qv: u32=> qa: u32=> qaW: *; - v: 4_294_967_296, !Of; - ); - check!(u64, u64=> uident; qv: *; qa: *; qaW: *); - for_bitness! { - 32 { - check!(u64, isize=> uident; qv: +isize=> qa: +isize=> qaW: *; - v: 2_147_483_648, !Of; - ); - check!(u64, usize=> uident; qv: usize=> qa: usize=> qaW: *; - v: 4_294_967_296, !Of; - ); - } - 64 { - check!(u64, isize=> uident; qv: +i64=> qa: +i64=> qaW: *; - v: 9_223_372_036_854_775_808, !Of; - ); - check!(u64, usize=> uident; qv: *; qa: *; qaW: *); - } - } -} - -#[test] -fn test_isize() { - check!(isize, i8=> sident; qv: i8=> qa: i8=> qaW: *; - v: -129, !RU; v: 128, !RO; - ); - check!(isize, i16=> sident; qv: i16=> qa: i16=> qaW: *; - v: -32_769, !RU; v: 32_768, !RO; - ); - check!(isize, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: -1, !RU; v: 256, !RO; - ); - check!(isize, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: -1, !RU; v: 65_536, !RO; - ); - check!(isize, isize=> sident; qv: *; qa: *; qaW: *); - for_bitness! { - 32 { - check!(isize, i32=> sident; qv: *; qa: *; qaW: *); - check!(isize, i64=> sident; qv: *; qa: *; qaW: *); - check!(isize, u32=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(isize, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(isize, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - } - 64 { - check!(isize, i32=> sident; qv: *; qa: *; qaW: *); - check!(isize, i64=> sident; qv: *; qa: *; qaW: *); - check!(isize, u32=> uident; qv: u32=> qa: u32=> qaW: *; - v: -1, !RU; v: 4_294_967_296, !RO; - ); - check!(isize, u64=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - check!(isize, usize=> uident; qv: +; qa: +; qaW: *; - v: -1, !Uf; - ); - } - } -} - -#[test] -fn test_usize() { - check!(usize, i8=> uident; qv: +i8=> qa: +i8=> qaW: *; - v: 128, !Of; - ); - check!(usize, i16=> uident; qv: +i16=> qa: +i16=> qaW: *; - v: 32_768, !Of; - ); - check!(usize, u8=> uident; qv: u8=> qa: u8=> qaW: *; - v: 256, !Of; - ); - check!(usize, u16=> uident; qv: u16=> qa: u16=> qaW: *; - v: 65_536, !Of; - ); - check!(usize, usize=> uident; qv: *; qa: *; qaW: *); - for_bitness! { - 32 { - check!(usize, i32=> uident; qv: +i32=> qa: +i32=> qaW: *); - check!(usize, i64=> uident; qv: *; qa: *; qaW: *); - check!(usize, u32=> uident; qv: *; qa: *; qaW: *); - check!(usize, u64=> uident; qv: *; qa: *; qaW: *); - check!(usize, isize=> uident; qv: +isize=> qa: +isize=> qaW: *); - } - 64 { - check!(usize, i32=> uident; qv: +i32=> qa: +i32=> qaW: *); - check!(usize, i64=> uident; qv: +i64=> qa: +i64=> qaW: *); - check!(usize, u32=> uident; qv: u32=> qa: u32=> qaW: *; - v: 4_294_967_296, !Of; - ); - check!(usize, u64=> uident; qv: *; qa: *; qaW: *); - check!(usize, isize=> uident; qv: +isize=> qa: +isize=> qaW: *); - } - } -} - -#[test] -fn test_i_to_f() { - check!(i8, f32=> sident; qv: *; qa: *); - check!(i16, f32=> sident; qv: *; qa: *); - check!(i32, f32=> sident; qv: (+-16_777_216); qa: *; - v: -16_777_217, !RU; v: 16_777_217, !RO; - ); - check!(i64, f32=> sident; qv: (+-16_777_216); qa: *; - v: -16_777_217, !RU; v: 16_777_217, !RO; - ); - check!(isize, f32=> sident; qv: (+-16_777_216); qa: *; - v: -16_777_217, !RU; v: 16_777_217, !RO; - ); - - check!(u8, f32=> uident; qv: *; qa: *); - check!(u16, f32=> uident; qv: *; qa: *); - check!(u32, f32=> uident; qv: (, 16_777_216); qa: *; - v: 16_777_217, !Of; - ); - check!(u64, f32=> uident; qv: (, 16_777_216); qa: *; - v: 16_777_217, !Of; - ); - check!(usize, f32=> uident; qv: (, 16_777_216); qa: *; - v: 16_777_217, !Of; - ); - - check!(i8, f64=> sident; qv: *; qa: *); - check!(i16, f64=> sident; qv: *; qa: *); - check!(i32, f64=> sident; qv: *; qa: *); - check!(i64, f64=> sident; qv: (+-9_007_199_254_740_992); qa: *; - v: -9_007_199_254_740_993, !RU; v: 9_007_199_254_740_993, !RO; - ); - for_bitness! { - 32 { - check!(isize, f64=> sident; qv: *; qa: *); - } - 64 { - check!(i64, f64=> sident; qv: (+-9_007_199_254_740_992); qa: *; - v: -9_007_199_254_740_993, !RU; v: 9_007_199_254_740_993, !RO; - ); - } - } - - check!(u8, f64=> uident; qv: *; qa: *); - check!(u16, f64=> uident; qv: *; qa: *); - check!(u32, f64=> uident; qv: *; qa: *); - check!(u64, f64=> uident; qv: (, 9_007_199_254_740_992); qa: *; - v: 9_007_199_254_740_993, !Of; - ); - for_bitness! { - 32 { - check!(usize, f64=> uident; qv: *; qa: *); - } - 64 { - check!(u64, f64=> uident; qv: (, 9_007_199_254_740_992); qa: *; - v: 9_007_199_254_740_993, !Of; - ); - } - } -} diff -Nru distinst-0.1.0/vendor/conv/tests/unwraps.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/unwraps.rs --- distinst-0.1.0/vendor/conv/tests/unwraps.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/unwraps.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -extern crate conv; - -#[macro_use] mod util; - -use conv::*; - -macro_rules! cty { - ($e:expr, $t:ty) => { - { let v: $t = $e; v } - }; -} - -#[test] -fn test_unwraps() { - assert_eq!(cty!(0i16.value_into().unwrap(), i32), 0); - assert_eq!(cty!(127i16.value_into().unwrap(), i8), 127); - assert_eq!(cty!(128i16.value_into().unwrap_or_saturate(), i8), 127); - assert_eq!(cty!(128i16.approx().unwrap_or_saturate(), i8), 127); - assert_eq!(cty!(128i16.approx_by::().unwrap_or_saturate(), i8), -128); - - assert_eq!(cty!(16_777_216i32.value_into().unwrap(), f32), 16_777_216.0); - assert_eq!(cty!(16_777_216i32.value_into().unwrap_or_inf(), f32), 16_777_216.0); - assert_eq!(cty!(16_777_217i32.value_into().unwrap_or_inf(), f32), std::f32::INFINITY); - assert_eq!(cty!((-16_777_217i32).value_into().unwrap_or_inf(), f32), std::f32::NEG_INFINITY); - - assert_eq!(cty!(16_777_216i32.value_into().unwrap_or_invalid(), f32), 16_777_216.0); - assert!(cty!(16_777_217i32.value_into().unwrap_or_invalid(), f32).is_nan()); - assert!(cty!((-16_777_217i32).value_into().unwrap_or_invalid(), f32).is_nan()); - - assert_eq!(cty!(0u8.value_into().unwrap_ok(), u16), 0); -} diff -Nru distinst-0.1.0/vendor/conv/tests/use_in_generics.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/use_in_generics.rs --- distinst-0.1.0/vendor/conv/tests/use_in_generics.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/use_in_generics.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -//! Are conversions easily usable in generic code? -extern crate conv; - -use conv::prelude::*; - -#[test] -fn test_generic_unwrap() { - fn do_conv(t: T) -> U - where T: ValueInto { - t.value_into().unwrap() - } - - assert_eq!({let x: u8 = do_conv(42i32); x}, 42u8); -} diff -Nru distinst-0.1.0/vendor/conv/tests/util/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/util/mod.rs --- distinst-0.1.0/vendor/conv/tests/util/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/tests/util/mod.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,509 +0,0 @@ -macro_rules! SL { - ($($tts:tt)*) => { stringify!($($tts)*) }; -} - -macro_rules! as_expr { - ($e:expr) => {$e}; -} - -macro_rules! check { - (@ $from:ty, $to:ty=> $(;)*) => {}; - - (@ $from:ty, $to:ty=> cident; $($tail:tt)*) => { - check!(@ $from, $to=> v: '\x00';); - check!(@ $from, $to=> v: '\x01';); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> uident; $($tail:tt)*) => { - check!(@ $from, $to=> v: 0;); - check!(@ $from, $to=> v: 1;); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> sident; $($tail:tt)*) => { - check!(@ $from, $to=> v: -1;); - check!(@ $from, $to=> v: 0;); - check!(@ $from, $to=> v: 1;); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> fident; $($tail:tt)*) => { - check!(@ $from, $to=> v: -1.0;); - check!(@ $from, $to=> v: 0.0;); - check!(@ $from, $to=> v: 1.0;); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> uidenta; $($tail:tt)*) => { - check!(@ $from, $to=> a: 0.0;); - check!(@ $from, $to=> a: 1.0;); - - check!(@ $from, $to=> aRTN: 0.00, 0;); - check!(@ $from, $to=> aRTN: 0.25, 0;); - check!(@ $from, $to=> aRTN: 0.50, 1;); - check!(@ $from, $to=> aRTN: 0.75, 1;); - check!(@ $from, $to=> aRTN: 1.00, 1;); - - check!(@ $from, $to=> aRNI: 0.00, 0;); - check!(@ $from, $to=> aRNI: 0.25, 0;); - check!(@ $from, $to=> aRNI: 0.50, 0;); - check!(@ $from, $to=> aRNI: 0.75, 0;); - check!(@ $from, $to=> aRNI: 1.00, 1;); - - check!(@ $from, $to=> aRPI: 0.00, 0;); - check!(@ $from, $to=> aRPI: 0.25, 1;); - check!(@ $from, $to=> aRPI: 0.50, 1;); - check!(@ $from, $to=> aRPI: 0.75, 1;); - check!(@ $from, $to=> aRPI: 1.00, 1;); - - check!(@ $from, $to=> aRTZ: 0.00, 0;); - check!(@ $from, $to=> aRTZ: 0.25, 0;); - check!(@ $from, $to=> aRTZ: 0.50, 0;); - check!(@ $from, $to=> aRTZ: 0.75, 0;); - check!(@ $from, $to=> aRTZ: 1.00, 1;); - - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> sidenta; $($tail:tt)*) => { - check!(@ $from, $to=> a: -1.0;); - check!(@ $from, $to=> a: 0.0;); - check!(@ $from, $to=> a: 1.0;); - - check!(@ $from, $to=> aRTN: -1.00, -1;); - check!(@ $from, $to=> aRTN: -0.75, -1;); - check!(@ $from, $to=> aRTN: -0.50, -1;); - check!(@ $from, $to=> aRTN: -0.25, 0;); - check!(@ $from, $to=> aRTN: 0.00, 0;); - check!(@ $from, $to=> aRTN: 0.25, 0;); - check!(@ $from, $to=> aRTN: 0.50, 1;); - check!(@ $from, $to=> aRTN: 0.75, 1;); - check!(@ $from, $to=> aRTN: 1.00, 1;); - - check!(@ $from, $to=> aRNI: -1.00, -1;); - check!(@ $from, $to=> aRNI: -0.75, -1;); - check!(@ $from, $to=> aRNI: -0.50, -1;); - check!(@ $from, $to=> aRNI: -0.25, -1;); - check!(@ $from, $to=> aRNI: 0.00, 0;); - check!(@ $from, $to=> aRNI: 0.25, 0;); - check!(@ $from, $to=> aRNI: 0.50, 0;); - check!(@ $from, $to=> aRNI: 0.75, 0;); - check!(@ $from, $to=> aRNI: 1.00, 1;); - - check!(@ $from, $to=> aRPI: -1.00, -1;); - check!(@ $from, $to=> aRPI: -0.75, 0;); - check!(@ $from, $to=> aRPI: -0.50, 0;); - check!(@ $from, $to=> aRPI: -0.25, 0;); - check!(@ $from, $to=> aRPI: 0.00, 0;); - check!(@ $from, $to=> aRPI: 0.25, 1;); - check!(@ $from, $to=> aRPI: 0.50, 1;); - check!(@ $from, $to=> aRPI: 0.75, 1;); - check!(@ $from, $to=> aRPI: 1.00, 1;); - - check!(@ $from, $to=> aRTZ: -1.00, -1;); - check!(@ $from, $to=> aRTZ: -0.75, 0;); - check!(@ $from, $to=> aRTZ: -0.50, 0;); - check!(@ $from, $to=> aRTZ: -0.25, 0;); - check!(@ $from, $to=> aRTZ: 0.00, 0;); - check!(@ $from, $to=> aRTZ: 0.25, 0;); - check!(@ $from, $to=> aRTZ: 0.50, 0;); - check!(@ $from, $to=> aRTZ: 0.75, 0;); - check!(@ $from, $to=> aRTZ: 1.00, 1;); - - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> fidenta; $($tail:tt)*) => { - check!(@ $from, $to=> a: -1.0;); - check!(@ $from, $to=> a: 0.0;); - check!(@ $from, $to=> a: 1.0;); - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> v: $src:expr, !$dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, v: {}, !{}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.value_into(); - assert_eq!(dst, Err($dst(src))); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> v: $src:expr; $($tail:tt)*) => { - { - println!("? {} => {}, v: {}", SL!($from), SL!($to), SL!($src)); - let src: $from = $src; - let dst: Result<$to, _> = src.value_into(); - assert_eq!(dst, Ok($src as $to)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: *; $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: *", SL!($from), SL!($to)); - - fn property(v: $from) -> bool { - let dst: Result<$to, _> = v.value_into(); - dst == Ok(v as $to) - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: (+-$bound:expr); $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: (+- {})", SL!($from), SL!($to), SL!($bound)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(-$bound as $from <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else if !(v <= $bound as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: (, $bound:expr); $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: (, {})", SL!($from), SL!($to), SL!($bound)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(v <= $bound as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: +; $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: +", SL!($from), SL!($to)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(0 <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: +$max:ty=> $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: +{}", SL!($from), SL!($to), SL!($max)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(v <= <$max>::max_value() as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: $bound:ty=> $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: {}", SL!($from), SL!($to), SL!($bound)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(<$bound>::min_value() as $from <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else if !(v <= <$bound>::max_value() as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qv: $min:ty, $max:ty=> $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qv: {}, {}", SL!($from), SL!($to), SL!($min), SL!($max)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from); - if !(<$min>::min_value() as $from <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else if !(v <= <$max>::max_value() as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qv {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> a: $src:expr, !$dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, a: {}, !{}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_as(); - assert_eq!(dst, Err($dst(src))); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> a: $src:expr, $dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, a: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_as(); - assert_eq!(dst, Ok($dst)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> a: $src:expr; $($tail:tt)*) => { - { - println!("? {} => {}, a: {}", SL!($from), SL!($to), SL!($src)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_as(); - assert_eq!(dst, Ok($src as $to)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qa: *; $($tail:tt)*) => { - { - println!("? {} => {}, qa: *", SL!($from), SL!($to)); - extern crate quickcheck; - - fn property(v: $from) -> bool { - let dst: Result<$to, _> = v.approx_as(); - dst == Ok(v as $to) - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qa {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qa: +; $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qa: +", SL!($from), SL!($to)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from); - if !(0 <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qa {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qa: +$max:ty=> $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qa: +{}", SL!($from), SL!($to), SL!($max)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from); - if !(v <= <$max>::max_value() as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qa {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qa: $bound:ty=> $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qa: {}", SL!($from), SL!($to), SL!($bound)); - - fn property(v: $from) -> bool { - let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from); - if !(<$bound>::min_value() as $from <= v) { - dst == Err(conv::FloatError::NegOverflow(v)) - } else if !(v <= <$bound>::max_value() as $from) { - dst == Err(conv::FloatError::PosOverflow(v)) - } else { - dst == Ok(v as $to) - } - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qa {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> qaW: *; $($tail:tt)*) => { - { - extern crate quickcheck; - println!("? {} => {}, qaW: *", SL!($from), SL!($to)); - - fn property(v: $from) -> bool { - let dst: Result<$to, _> = v.approx_as_by::<_, Wrapping>(); - dst == Ok(v as $to) - } - - let mut qc = quickcheck::QuickCheck::new(); - match qc.quicktest(property as fn($from) -> bool) { - Ok(_) => (), - Err(err) => panic!("qaW {:?}", err) - } - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> aRTN: $src:expr, $dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, aRTN: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_by::(); - assert_eq!(dst, Ok($dst)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> aRNI: $src:expr, $dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, aRNI: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_by::(); - assert_eq!(dst, Ok($dst)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> aRPI: $src:expr, $dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, aRPI: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_by::(); - assert_eq!(dst, Ok($dst)); - } - check!(@ $from, $to=> $($tail)*); - }; - - (@ $from:ty, $to:ty=> aRTZ: $src:expr, $dst:expr; $($tail:tt)*) => { - { - println!("? {} => {}, aRTZ: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst)); - let src: $from = $src; - let dst: Result<$to, _> = src.approx_by::(); - assert_eq!(dst, Ok($dst)); - } - check!(@ $from, $to=> $($tail)*); - }; - - ($from:ty, $to:ty=> $($tail:tt)*) => { - check! { @ $from, $to=> $($tail)*; } - }; -} - -macro_rules! for_bitness { - (32 {$($bits32:tt)*} 64 {$($bits64:tt)*}) => { - as_expr!( - { - #[cfg(target_pointer_width="32")] - fn for_bitness() { - $($bits32)* - } - - #[cfg(target_pointer_width="64")] - fn for_bitness() { - $($bits64)* - } - - for_bitness() - } - ) - }; -} diff -Nru distinst-0.1.0/vendor/conv/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/.travis.yml --- distinst-0.1.0/vendor/conv/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/conv/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -language: rust -script: cargo build --verbose && cargo test --verbose -rust: - - 1.2.0 - - 1.3.0 - - 1.4.0 - - 1.5.0 - - 1.6.0 - - stable - - beta - - nightly -matrix: - allow_failures: - - rust: nightly -branches: - except: - - /^issue-.*$/ diff -Nru distinst-0.1.0/vendor/custom_derive/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/.cargo-checksum.json --- distinst-0.1.0/vendor/custom_derive/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"da4c9f7564b52be1d09c3b8f21add3a758be4414a3ce87236fb703b6a56c2aa6","LICENSE":"9f95cbf09c33a40ca7e540d5adb58e8da482392af761d4785e43f0f8c3f62332","README.md":"dccbb045569494d7ab7b99c0a19eaa55d3b41672d413ae28ccd22385ef373176","src/lib.rs":"083607fa43010439264b15573100b948cf6f1bb47e5ee177d4e170b73e0b4ed4","tests/empty_bi_derives.rs":"e62f18552e20aad7f179e7dc05557d1bcf7b20e804d76f99adf1f3b243f5ded8","tests/enum_iterator.rs":"9d75cd2232bd1b89ea3057a6f1f5892bd1f47e69a76d8595c603e530a633de6b","tests/enum_try_from.rs":"40a6ca8ca16aa41e43c7ba46b62feee558b6c8ac495f6b69ae9912f7c3a68b07","tests/passthru_derive.rs":"0a41acc21c3e65e34f0cce152e9b88d5ff6e0dd6f1b9680841b93f2e8a09bf59","tests/stable_encodable.rs":"441f2c11aa60b9c6e7647f907f1134155a76cbbfa7f98d404a8be759ab0b2044","tests/trailing_comma.rs":"4b3f96014f261824cfb8e86d4ee37e721e55e25b141556df03ee16840f7fd89c"},"package":"ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/custom_derive/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/Cargo.toml --- distinst-0.1.0/vendor/custom_derive/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -[package] -name = "custom_derive" -version = "0.1.7" -authors = ["Daniel Keep "] - -description = "(Note: superseded by `macro-attr`) This crate provides a macro that enables the use of custom derive attributes." -repository = "https://github.com/DanielKeep/rust-custom-derive/tree/custom_derive-master" -documentation = "https://docs.rs/crate/custom_derive/" -license = "MIT/Apache-2.0" -keywords = ["custom", "derive", "macro"] - -exclude = [ - ".cargo/*", - "local/*", - "doc-pkg/*", - "scripts/*", - ".gitmodules", - ".travis.yml", - "update-docs.py", -] - -[workspace] -members = [ - "enum_derive", - "newtype_derive", -] - -[features] -default = ["std"] -std = [] - -[dev-dependencies] -rustc-serialize = "0.3.15" diff -Nru distinst-0.1.0/vendor/custom_derive/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/LICENSE --- distinst-0.1.0/vendor/custom_derive/LICENSE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -Copyright ⓒ 2015, 2016 rust-custom-derive contributors. - -Licensed under either of: - -* MIT license, or -* Apache License, Version 2.0 - -at your option. - -Unless you explicitly state otherwise, any contribution intentionally -submitted for inclusion in the work by you shall be dual licensed as -above, without any additional terms or conditions. - -# MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject -to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -# Apache License, Version 2.0 - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff -Nru distinst-0.1.0/vendor/custom_derive/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/README.md --- distinst-0.1.0/vendor/custom_derive/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -# `custom_derive!` - -**Note**: This crate has been superseded by `macro-attr`. - -This crate provides a macro that enables the use of custom `derive` attributes. - -**Links** - -* [Latest Release](https://crates.io/crates/custom_derive/) -* [Latest Docs](https://docs.rs/crate/custom_derive/) -* [Repository](https://github.com/DanielKeep/rust-custom-derive/tree/custom_derive-master/) - -## License - -Licensed under either of - -* MIT license (see [LICENSE](LICENSE) or ) -* Apache License, Version 2.0 (see [LICENSE](LICENSE) or ) - -at your option. - -### Contribution - -Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions. diff -Nru distinst-0.1.0/vendor/custom_derive/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/src/lib.rs --- distinst-0.1.0/vendor/custom_derive/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,462 +0,0 @@ -/* -Copyright ⓒ 2016 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -/*! -**Note**: This crate has been superseded by `macro-attr`. - -This crate provides a macro that enables the use of custom `derive` attributes. - -To use it, make sure you link to the crate like so: - -```rust -#[macro_use] extern crate custom_derive; -# macro_rules! Dummy { (() struct $name:ident;) => {}; } -# custom_derive! { #[derive(Clone, Dummy)] struct Foo; } -# fn main() { let _ = Foo; } -``` - -> **Note**: the `custom_derive!` macro itself is not documented, as the automatic documentation for it would be uselessly huge and incomprehensible. - - - - -# Usage - -The macro should be used to wrap an entire *single* `enum` or `struct` declaration, including its attributes (both `derive` and others). All derivation attributes which the macro does *not* recognise will be assumed to be custom, and treated accordingly. - -`custom_derive!` assumes that custom derivations are implemented as macros (of the same name). For example, here is a simple derivation macro: - -```rust -#[macro_use] extern crate custom_derive; - -trait TypeName { - fn type_name() -> &'static str; -} - -trait ReprType { - type Repr; -} - -macro_rules! TypeName { - (() $(pub)* enum $name:ident $($tail:tt)*) => { TypeName! { @impl $name } }; - (() $(pub)* struct $name:ident $($tail:tt)*) => { TypeName! { @impl $name } }; - - (@impl $name:ident) => { - impl TypeName for $name { - fn type_name() -> &'static str { stringify!($name) } - } - }; -} - -macro_rules! TryFrom { - (($repr:ty) $(pub)* enum $name:ident $($tail:tt)*) => { - impl ReprType for $name { - type Repr = $repr; - } - }; -} - -custom_derive! { - #[allow(dead_code)] - #[repr(u8)] - #[derive(Clone, Copy, Debug, TryFrom(u8), TypeName)] - enum Foo { A, B } -} - -fn main() { - let foo = Foo::B; - let v = foo as ::Repr; - let msg = format!("{}: {:?} ({:?})", Foo::type_name(), foo, v); - assert_eq!(msg, "Foo: B (1)"); -} -``` - -First, note that `custom_derive!` passes any arguments on the derivation attribute to the macro. In the case of attributes *without* any arguments, `()` is passed instead. - -Secondly, the macro is passed the entire item, *sans* attributes. It is the derivation macro's job to parse the item correctly. - -Third, each derivation macro is expected to result in zero or more items, not including the item itself. As a result, it is *not* possible to mutate the item in any way, or attach additional attributes to it. - -Finally, `@impl` is merely a trick to pack multiple, different functions into a single macro. The sequence has no special meaning; it is simply *distinct* from the usual invocation syntax. -*/ -#![cfg_attr(not(feature = "std"), no_std)] - -#[doc(hidden)] -#[macro_export] -macro_rules! custom_derive { - /* - - > **Convention**: a capture named `$fixed` is used for any part of a recursive rule that is needed in the terminal case, but is not actually being *used* for the recursive part. This avoids having to constantly repeat the full capture pattern (and makes changing it easier). - - # Primary Invocation Forms - - These need to catch any valid form of struct or enum. - - */ - ( - $(#[$($attrs:tt)*])* - enum $($it:tt)* - ) => { - custom_derive! { - @split_attrs - ($(#[$($attrs)*],)*), (), (), - (enum $($it)*) - } - }; - - ( - $(#[$($attrs:tt)*])* - pub $($it:tt)* - ) => { - custom_derive! { - @split_attrs - ($(#[$($attrs)*],)*), (), (), - (pub $($it)*) - } - }; - - ( - $(#[$($attrs:tt)*])* - struct $($it:tt)* - ) => { - custom_derive! { - @split_attrs - ($(#[$($attrs)*],)*), (), (), - (struct $($it)*) - } - }; - - /* - - # `@split_attrs` - - This is responsible for dividing all attributes on an item into two groups: - - - `#[derive(...)]` - - Everything else. - - As part of this, it also explodes `#[derive(A, B(..), C, ...)]` into `A, B(..), C, ...`. This is to simplify the next stage. - - */ - ( - @split_attrs - (), - $non_derives:tt, - $derives:tt, - $it:tt - ) => { - custom_derive! { - @split_derive_attrs - { $non_derives, $it }, - $derives, - (), - () - } - }; - - ( - @split_attrs - (#[derive($($new_drv:ident $(($($new_drv_args:tt)*))*),* $(,)*)], $(#[$($attrs:tt)*],)*), - $non_derives:tt, - ($($derives:ident,)*), - $it:tt - ) => { - custom_derive! { - @split_attrs - ($(#[$($attrs)*],)*), - $non_derives, - ($($derives,)* $($new_drv $(($($new_drv_args)*))*,)*), - $it - } - }; - - ( - @split_attrs - (#[$new_attr:meta], $(#[$($attrs:tt)*],)*), - ($($non_derives:tt)*), - $derives:tt, - $it:tt - ) => { - custom_derive! { - @split_attrs - ($(#[$($attrs)*],)*), - ($($non_derives)* #[$new_attr],), - $derives, - $it - } - }; - - /* - - # `@split_derive_attrs` - - This is responsible for taking the list of derivation attributes and splitting them into "built-in" and "custom" groups. - - The list of built-in derives currently supported is: Clone, Hash, RustcEncodable, RustcDecodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Send, Sync, Copy. - - Anything not on that list is considered "custom". - - And yes, as far as I can see, we *have* to have a separate rule for each of those. What I wouldn't give for an alternation pattern... - */ - - (@split_derive_attrs - { ($(#[$($non_derives:tt)*],)*), ($($it:tt)*) }, - (), (), ($($user_drvs:tt)*) - ) => { - custom_derive! { - @as_item - $(#[$($non_derives)*])* - $($it)* - } - - custom_derive! { - @expand_user_drvs - ($($user_drvs)*), ($($it)*) - } - }; - - (@split_derive_attrs - { ($(#[$($non_derives:tt)*],)*), ($($it:tt)*) }, - (), ($($bi_drvs:ident,)+), ($($user_drvs:tt)*) - ) => { - custom_derive! { - @as_item - #[derive($($bi_drvs,)+)] - $(#[$($non_derives)*])* - $($it)* - } - - custom_derive! { - @expand_user_drvs - ($($user_drvs)*), ($($it)*) - } - }; - - (@split_derive_attrs - $fixed:tt, - (Hash, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Hash,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Clone, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Clone,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (RustcEncodable, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* RustcEncodable,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (RustcDecodable, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* RustcDecodable,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (PartialEq, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* PartialEq,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Eq, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Eq,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (PartialOrd, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* PartialOrd,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Ord, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Ord,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Debug, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Debug,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Default, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Default,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Send ,$($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Send,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Sync, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Sync,), $user_drvs - } - }; - - (@split_derive_attrs - $fixed:tt, - (Copy, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt - ) => { - custom_derive! { - @split_derive_attrs - $fixed, - ($($tail)*), ($($bi_drvs,)* Copy,), $user_drvs - } - }; - - /* - - ## Custom Derivations - - Now we can handle the custom derivations. There are two forms we care about: those *with* an argument, and those *without*. - - The *reason* we care is that, in order to simplify the derivation macros, we want to detect the argument-less case and generate an empty pair of parens. - - */ - (@split_derive_attrs - $fixed:tt, - ($new_user:ident, $($tail:tt)*), $bi_drvs:tt, ($($user_drvs:tt)*) - ) => { - custom_derive! { - @split_derive_attrs - $fixed, ($($tail)*), $bi_drvs, ($($user_drvs)* $new_user(),) - } - }; - - (@split_derive_attrs - $fixed:tt, - ($new_user:ident ($($new_user_args:tt)*), $($tail:tt)*), $bi_drvs:tt, ($($user_drvs:tt)*) - ) => { - custom_derive! { - @split_derive_attrs - $fixed, ($($tail)*), $bi_drvs, ($($user_drvs)* $new_user($($new_user_args)*),) - } - }; - - /* - - # `@expand_user_drvs` - - Finally, we have a recursive rule for expanding user derivations. This is basically just using the derivation name as a macro identifier. - - This *has* to be recursive because we need to expand two independent repetition sequences simultaneously, and this causes `macro_rules!` to throw a wobbly. Don't want that. So, recursive it is. - - */ - (@expand_user_drvs - (), ($($it:tt)*) - ) => {}; - - (@expand_user_drvs - ($user_drv:ident $arg:tt, $($tail:tt)*), ($($it:tt)*) - ) => { - $user_drv! { $arg $($it)* } - custom_derive! { - @expand_user_drvs - ($($tail)*), ($($it)*) - } - }; - - /* - - # Miscellaneous Rules - - */ - (@as_item $($i:item)*) => {$($i)*}; -} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/empty_bi_derives.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/empty_bi_derives.rs --- distinst-0.1.0/vendor/custom_derive/tests/empty_bi_derives.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/empty_bi_derives.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; - -macro_rules! Dummy { - ($($tts:tt)*) => {}; -} - -custom_derive! { - #[derive(Dummy)] - enum Foo { Bar } -} - -#[test] -fn test_empty_bi_derives() { - let _ = Foo::Bar; -} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/enum_iterator.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/enum_iterator.rs --- distinst-0.1.0/vendor/custom_derive/tests/enum_iterator.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/enum_iterator.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; - -macro_rules! EnumIterator { - (() $(pub)* enum $name:ident { $($body:tt)* }) => { - EnumIterator! { - @collect_variants ($name), - ($($body)*,) -> () - } - }; - - ( - @collect_variants ($name:ident), - ($(,)*) -> ($($var_names:ident,)*) - ) => { - type NameIter = ::std::vec::IntoIter<&'static str>; - type VariantIter = ::std::vec::IntoIter<$name>; - - impl $name { - #[allow(dead_code)] - pub fn iter_variants() -> VariantIter { - vec![$($name::$var_names),*].into_iter() - } - - #[allow(dead_code)] - pub fn iter_variant_names() -> NameIter { - vec![$(stringify!($var_names)),*].into_iter() - } - } - }; - - ( - @collect_variants $fixed:tt, - ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - EnumIterator! { - @collect_variants $fixed, - ($($tail)*) -> ($($var_names)* $var,) - } - }; - - ( - @collect_variants ($name:ident), - ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - const _error: () = concat!( - "cannot derive EnumIterator for ", - stringify!($name), - ", due to non-unitary variant ", - stringify!($var), - "." - ); - }; -} - -custom_derive! { - #[derive(Debug, PartialEq, EnumIterator)] - enum Get { Up, Down, AllAround } -} - -#[test] -fn test_enum_iterator() { - let vs: Vec<_> = Get::iter_variant_names().zip(Get::iter_variants()).collect(); - assert_eq!(&*vs, &[("Up", Get::Up), ("Down", Get::Down), ("AllAround", Get::AllAround)]); -} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/enum_try_from.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/enum_try_from.rs --- distinst-0.1.0/vendor/custom_derive/tests/enum_try_from.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/enum_try_from.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; - -trait TryFrom: Sized { - type Err; - fn try_from(src: Src) -> Result; -} - -macro_rules! TryFrom { - (($prim:ty) $(pub)* enum $name:ident { $($body:tt)* }) => { - TryFrom! { - @collect_variants ($name, $prim), - ($($body)*,) -> () - } - }; - - ( - @collect_variants ($name:ident, $prim:ty), - ($(,)*) -> ($($var_names:ident,)*) - ) => { - impl TryFrom<$prim> for $name { - type Err = $prim; - fn try_from(src: $prim) -> Result<$name, $prim> { - $( - if src == $name::$var_names as $prim { - return Ok($name::$var_names); - } - )* - Err(src) - } - } - }; - - ( - @collect_variants $fixed:tt, - ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - TryFrom! { - @collect_variants $fixed, - ($($tail)*) -> ($($var_names)* $var,) - } - }; - - ( - @collect_variants ($name:ident), - ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*) - ) => { - const _error: () = concat!( - "cannot derive TryFrom for ", - stringify!($name), - ", due to non-unitary variant ", - stringify!($var), - "." - ); - }; -} - -custom_derive! { - #[derive(Debug, PartialEq, TryFrom(u8))] - enum Get { Up, Down, AllAround } -} - -#[test] -fn test_try_from() { - assert_eq!(Get::try_from(0u8), Ok(Get::Up)); - assert_eq!(Get::try_from(1u8), Ok(Get::Down)); - assert_eq!(Get::try_from(2u8), Ok(Get::AllAround)); - assert_eq!(Get::try_from(3u8), Err(3u8)); -} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/passthru_derive.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/passthru_derive.rs --- distinst-0.1.0/vendor/custom_derive/tests/passthru_derive.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/passthru_derive.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; -extern crate rustc_serialize; - -custom_derive! { - #[derive(Clone, Hash, RustcEncodable, RustcDecodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Copy)] - pub struct Dummy(u32); -} - -#[test] -fn test_passthru_derive() {} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/stable_encodable.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/stable_encodable.rs --- distinst-0.1.0/vendor/custom_derive/tests/stable_encodable.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/stable_encodable.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,378 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; -extern crate rustc_serialize; - -macro_rules! StableEncodable { - ( - () $(pub)* enum $name:ident < $($tail:tt)* - ) => { - StableEncodable! { - @extract_gen_args (enum $name), - ($($tail)*) - -> bounds(), ty_clss(where) - } - }; - - ( - () $(pub)* enum $name:ident { $($body:tt)* } - ) => { - StableEncodable! { - @impl enum $name, - bounds(), - ty_clss(), - { $($body)* } - } - }; - - ( - () $(pub)* struct $name:ident { $($body:tt)* } - ) => { - StableEncodable! { - @impl struct $name, - bounds(), - ty_clss(), - { $($body)* } - } - }; - - ( - () $(pub)* struct $name:ident < $($tail:tt)* - ) => { - StableEncodable! { - @extract_gen_args (struct $name), - ($($tail)*) - -> bounds(), ty_clss(where) - } - }; - - ( - @impl enum $name:ident, - bounds($($bounds:tt)*), - ty_clss($($ty_clss:tt)*), - { $($body:tt)* } - ) => { - StableEncodable! { - @parse_variants (enum $name, bounds($($bounds)*), ty_clss($($ty_clss)*)), - 0usize, ($($body)*,) -> () - } - }; - - ( - @impl struct $name:ident, - bounds($($bounds:tt)*), - ty_clss($($ty_clss:tt)*), - { $($fnames:ident: $_ftys:ty),* $(,)* } - ) => { - StableEncodable! { - @as_item - impl<$($bounds)*> rustc_serialize::Encodable for $name<$($bounds)*> - $($ty_clss)* { - fn encode( - &self, - s: &mut StableEncodableEncoder - ) -> Result<(), StableEncodableEncoder::Error> - where StableEncodableEncoder: rustc_serialize::Encoder { - const NUM_FIELDS: usize = StableEncodable!(@count_tts $($fnames)*); - try!(s.emit_struct(stringify!($name), NUM_FIELDS, |s| { - // Poor man's enumerate!($($fnames)): - let mut idx = 0; - $( - try!(s.emit_struct_field(stringify!($fnames), idx, |s| { - self.$fnames.encode(s) - })); - idx += 1; - )* - let _ = idx; - Ok(()) - })); - Ok(()) - } - } - } - }; - - (@as_item $i:item) => {$i}; - - ( - @extract_gen_args ($kind:ident $name:ident), - (> { $($tail:tt)* }) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @impl $kind $name, - bounds($($bounds)*), - ty_clss($($ty_clss)*), - { $($tail)* } - } - }; - - ( - @extract_gen_args $fixed:tt, - ($ty_name:ident: $($tail)*) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @skip_inline_bound $fixed, - ($($tail)*) - -> bounds($($bounds)* $ty_name:), - ty_clss($($ty_clss)* $ty_name: ::rustc_serialize::Encodable,) - } - }; - - ( - @extract_gen_args $fixed:tt, - ($ty_name:ident $($tail:tt)*) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @extract_gen_args $fixed, - ($($tail)*) - -> bounds($($bounds)* $ty_name), - ty_clss($($ty_clss)* $ty_name: ::rustc_serialize::Encodable,) - } - }; - - ( - @extract_gen_args $fixed:tt, - (, $($tail:tt)*) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @extract_gen_args $fixed, - ($($tail)*) - -> bounds($($bounds)* ,), ty_clss($($ty_clss)*) - } - }; - - ( - @extract_gen_args $fixed:tt, - ($lt:tt $($tail:tt)*) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @extract_gen_args $fixed, - ($($tail)*) - -> bounds($($bounds)* $lt), ty_clss($($ty_clss)*) - } - }; - - ( - @skip_inline_bound $fixed:tt, - (, $($tail:tt)*) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @extract_gen_args $fixed, - ($($tail)*) - -> bounds($($bounds)* ,), ty_clss($($ty_clss)*) - } - }; - - ( - @skip_inline_bound $fixed:tt, - (> { $($tail:tt)* }) - -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*) - ) => { - StableEncodable! { - @impl $fixed, - bounds($($bounds)*), - ty_clss($($ty_clss)*), - { $($tail)* } - } - }; - - ( - @parse_variants (enum $name:ident, bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)), - $_id:expr, ($(,)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @as_item - impl<$($bounds)*> rustc_serialize::Encodable for $name<$($bounds)*> - $($ty_clss)* { - fn encode( - &self, - s: &mut StableEncodableEncoder) - -> Result<(), StableEncodableEncoder::Error> - where StableEncodableEncoder: rustc_serialize::Encoder { - s.emit_enum(stringify!($name), |s| { - $( - StableEncodable!(@encode_variant $name, $variants, self, s); - )* - unreachable!(); - }) - } - } - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident, $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* ($var_name, $id)) - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident($(,)*), $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* - ($var_name, $id)) - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident($_vta:ty), $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* - ($var_name, $id, (a))) - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident($_vta:ty, $_vtb:ty), $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* - ($var_name, $id, (a, b))) - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident($_vta:ty, $_vtb:ty, $_vtc:ty), $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* - ($var_name, $id, (a, b, c))) - } - }; - - ( - @parse_variants $fixed:tt, - $id:expr, ($var_name:ident { $($vfn:ident: $_vft:ty),* $(,)* }, $($tail:tt)*) -> ($($variants:tt)*) - ) => { - StableEncodable! { - @parse_variants $fixed, - ($id + 1usize), ($($tail)*) -> ($($variants)* - ($var_name, $id, {$($vfn),*})) - } - }; - - ( - @encode_variant $name:ident, - ($var_name:ident, $var_id:expr), - $self_:expr, $s:ident - ) => { - { - if let $name::$var_name = *$self_ { - return $s.emit_enum_variant(stringify!($var_name), $var_id, 0, |_| Ok(())); - } - } - }; - - ( - @encode_variant $name:ident, - ($var_name:ident, $var_id:expr, ($($tup_elems:ident),*)), - $self_:expr, $s:ident - ) => { - { - if let $name::$var_name($(ref $tup_elems),*) = *$self_ { - return $s.emit_enum_variant( - stringify!($var_name), - $var_id, - StableEncodable!(@count_tts $($tup_elems)*), - |s| { - let mut idx = 0; - $( - try!(s.emit_enum_variant_arg(idx, |s| $tup_elems.encode(s))); - idx += 1; - )* - let _ = idx; - Ok(()) - } - ); - } - } - }; - - ( - @encode_variant $name:ident, - ($var_name:ident, $var_id:expr, {$($str_fields:ident),*}), - $self_:expr, $s:ident - ) => { - { - if let $name::$var_name { $(ref $str_fields),* } = *$self_ { - return $s.emit_enum_struct_variant( - stringify!($var_name), - $var_id, - StableEncodable!(@count_tts $($str_fields)*), - |s| { - let mut idx = 0; - $( - try!(s.emit_enum_struct_variant_field( - stringify!($str_fields), - idx, - |s| $str_fields.encode(s) - )); - idx += 1; - )* - let _ = idx; - Ok(()) - } - ); - } - } - }; - - (@count_tts) => {0usize}; - (@count_tts $_tt:tt $($tail:tt)*) => {1usize + StableEncodable!(@count_tts $($tail)*)}; -} - -custom_derive! { - #[derive(Debug, StableEncodable)] - struct LazyEg { a: A, b: i32, c: (u8, u8, u8) } -} - -custom_derive! { - #[derive(Clone, StableEncodable)] - enum Wonky { Flim, Flam, Flom(i32), Bees { say: S } } -} - -#[test] -fn test_stable_encodable() { - macro_rules! json { - ($e:expr) => (rustc_serialize::json::encode(&$e).unwrap()); - } - - let lazy_eg = LazyEg { - a: String::from("Oh hai!"), - b: 42, - c: (1, 3, 0), - }; - assert_eq!(&*json!(lazy_eg), r#"{"a":"Oh hai!","b":42,"c":[1,3,0]}"#); - - assert_eq!(&*json!(Wonky::Flim::<()>), r#""Flim""#); - assert_eq!(&*json!(Wonky::Flam::<()>), r#""Flam""#); - assert_eq!(&*json!(Wonky::Flom::<()>(42)), r#"{"variant":"Flom","fields":[42]}"#); - assert_eq!(&*json!(Wonky::Bees{say:"aaaaah!"}), r#"{"variant":"Bees","fields":["aaaaah!"]}"#); -} diff -Nru distinst-0.1.0/vendor/custom_derive/tests/trailing_comma.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/trailing_comma.rs --- distinst-0.1.0/vendor/custom_derive/tests/trailing_comma.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/custom_derive/tests/trailing_comma.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -/* -Copyright ⓒ 2015 rust-custom-derive contributors. - -Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of -), at your option. All -files in the project carrying such notice may not be copied, modified, -or distributed except according to those terms. -*/ -#[macro_use] extern crate custom_derive; - -macro_rules! Dummy { - ($($tts:tt)*) => {}; -} - -custom_derive! { - #[derive(Dummy,)] - enum Foo { Bar } -} - -#[test] -fn test_trailing_comma() { - let _ = Foo::Bar; -} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/BUILD.gn --- distinst-0.1.0/vendor/fuchsia-zircon/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/BUILD.gn 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,13 @@ +# Copyright 2017 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/rust/rust_library.gni") + +rust_library("fuchsia-zircon") { + deps = [ + "//garnet/public/rust/crates/fuchsia-zircon/fuchsia-zircon-sys", + ] + + with_tests = true +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/.cargo-checksum.json --- distinst-0.1.0/vendor/fuchsia-zircon/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +{"files":{"BUILD.gn":"1d49d75a432f5b4587b59a50a9b86a21e2a3faf1fff60876b4e486e43cffca35","Cargo.toml":"263dce41c44c34a70fb9803acbfb77c1801ff2b23f0fa46bb2c90f14f33f0ac9","LICENSE":"f82f9062a6dff28145c185f90f94c485eebdc2bb4c6f1c840513709e6d228453","README.md":"f4bff6efc5d888460e2d1eaf62fa0eaca8afe7b51df528ad7829340ec397b32c","examples/BUILD.gn":"fb7a491a26e5f3d48b8796db80d475be2d361bada7311213363dcce4efa9d4fc","src/channel.rs":"0b3c3761a831c9211e327f5332e58becc287cf2444b44164a4f680dc5bdded50","src/event.rs":"9b11c6c0c9fcdbe4e45c03f4a671ef66c31a1be540d3f50a5d0602314fdc1294","src/eventpair.rs":"aca1c6a15450badbfe71c33e287bab8aa05d6fff5968513b191436b853929ca8","src/fifo.rs":"ecc49463cc28713c1375ecafc8008b806767417da72fcc8685b42078ec0308df","src/job.rs":"827db2e4ea1bbf5ecabec9fb279f2721792032e4223b6bd15b56922d80c7ac01","src/lib.rs":"5bc01f9c7d1f3316826bf86cc5c8488523ca7f2ad2a58a8b539c3b49aed3f1a2","src/port.rs":"695aa7114d88d476954fde689180502f22ea6b70339855ebff89dce6694abb9e","src/process.rs":"0b5e42c4eb79b2a7fff9c70f0d99c8b805cefab99285e94fabf2542290b4b990","src/socket.rs":"6e8b799a8f605d42681660129989c9c6427b9039b83de9954c61aa351596218f","src/thread.rs":"d703414c440b5fa597dbafe7b8be925a94d1fe0cf8b47366c786b45eaaec4c60","src/timer.rs":"8fc50736e6a928cabccf78b18aec3e57ac7e5a57c1c519a1cd34158f59e1ff65","src/vmo.rs":"0f219777d5abffcfbc49a43f7eff3ef92b854d1d964579dc9a01d33ba57341c1","tools/BUILD.gn":"f4ce07b2906e6cde15a9d2ec253c58fbfe88ea1819083f864c154a0f1c50c14f","tools/README.md":"0217d58913c32b7e8aa231da852d96307d8387f99e2352a026196150cb180d07","tools/clang_wrapper.cc":"c62dcc1f71cab03f7e215c8800d798bd05af56fa7510ea8d59d6b15dce2b6a6f","tools/gen_status.py":"a2330db86564e12412af2dce60d4c605c0ab203fcdea8039d5c6a8e7f218a3c3"},"package":"f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/Cargo.toml --- distinst-0.1.0/vendor/fuchsia-zircon/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,21 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "fuchsia-zircon" +version = "0.2.1" +authors = ["Raph Levien "] +description = "Rust bindings for the Zircon kernel" +license = "BSD-3-Clause" +repository = "https://fuchsia.googlesource.com/garnet/" +[dependencies.fuchsia-zircon-sys] +version = "0.2.0" diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/examples/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/examples/BUILD.gn --- distinst-0.1.0/vendor/fuchsia-zircon/examples/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/examples/BUILD.gn 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,9 @@ +# Copyright 2017 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("examples") { + deps = [ + "//garnet/public/rust/crates/fuchsia-zircon/examples/zx_toy", + ] +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/LICENSE --- distinst-0.1.0/vendor/fuchsia-zircon/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/LICENSE 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/README.md --- distinst-0.1.0/vendor/fuchsia-zircon/README.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,12 @@ +Rust bindings for Zircon kernel +================================ + +This repository contains Rust language bindings for Zircon kernel syscalls. The +main crate contains type-safe wrappers, while the inner "sys" crate contains the +raw types and FFI declarations. + +There are two ways to build Rust artifacts targeting Fuchsia; using the +[Fargo](https://fuchsia.googlesource.com/fargo/) cross compiling tool or +including your [artifact in the GN +build](https://fuchsia.googlesource.com/docs/+/master/rust.md). Of the two, +Fargo is likely better for exploration and experimentation. diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/channel.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/channel.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/channel.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/channel.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,380 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon channel objects. + +use {AsHandleRef, HandleBased, Handle, HandleRef, INVALID_HANDLE, Peered, Status, Time, usize_into_u32, size_to_u32_sat}; +use {sys, handle_drop, into_result}; +use std::mem; + +/// An object representing a Zircon +/// [channel](https://fuchsia.googlesource.com/zircon/+/master/docs/objects/channel.md). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Channel(Handle); +impl_handle_based!(Channel); +impl Peered for Channel {} + +impl Channel { + /// Create a channel, resulting an a pair of `Channel` objects representing both + /// sides of the channel. Messages written into one maybe read from the opposite. + /// + /// Wraps the + /// [zx_channel_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/channel_create.md) + /// syscall. + pub fn create(opts: ChannelOpts) -> Result<(Channel, Channel), Status> { + unsafe { + let mut handle0 = 0; + let mut handle1 = 0; + let status = sys::zx_channel_create(opts as u32, &mut handle0, &mut handle1); + into_result(status, || + (Self::from(Handle(handle0)), + Self::from(Handle(handle1)))) + } + } + + /// Read a message from a channel. Wraps the + /// [zx_channel_read](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/channel_read.md) + /// syscall. + /// + /// If the `MessageBuf` lacks the capacity to hold the pending message, + /// returns an `Err` with the number of bytes and number of handles needed. + /// Otherwise returns an `Ok` with the result as usual. + pub fn read_raw(&self, opts: u32, buf: &mut MessageBuf) + -> Result, (usize, usize)> + { + unsafe { + buf.reset_handles(); + let raw_handle = self.raw_handle(); + let mut num_bytes: u32 = size_to_u32_sat(buf.bytes.capacity()); + let mut num_handles: u32 = size_to_u32_sat(buf.handles.capacity()); + let status = sys::zx_channel_read(raw_handle, opts, + buf.bytes.as_mut_ptr(), buf.handles.as_mut_ptr(), + num_bytes, num_handles, &mut num_bytes, &mut num_handles); + if status == sys::ZX_ERR_BUFFER_TOO_SMALL { + Err((num_bytes as usize, num_handles as usize)) + } else { + Ok(into_result(status, || { + buf.bytes.set_len(num_bytes as usize); + buf.handles.set_len(num_handles as usize); + })) + } + } + } + + /// Read a message from a channel. + /// + /// Note that this method can cause internal reallocations in the `MessageBuf` + /// if it is lacks capacity to hold the full message. If such reallocations + /// are not desirable, use `read_raw` instead. + pub fn read(&self, opts: u32, buf: &mut MessageBuf) -> Result<(), Status> { + loop { + match self.read_raw(opts, buf) { + Ok(result) => return result, + Err((num_bytes, num_handles)) => { + buf.ensure_capacity_bytes(num_bytes); + buf.ensure_capacity_handles(num_handles); + } + } + } + } + + /// Write a message to a channel. Wraps the + /// [zx_channel_write](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/channel_write.md) + /// syscall. + pub fn write(&self, bytes: &[u8], handles: &mut Vec, opts: u32) + -> Result<(), Status> + { + let n_bytes = try!(usize_into_u32(bytes.len()).map_err(|_| Status::ErrOutOfRange)); + let n_handles = try!(usize_into_u32(handles.len()).map_err(|_| Status::ErrOutOfRange)); + unsafe { + let status = sys::zx_channel_write(self.raw_handle(), opts, bytes.as_ptr(), n_bytes, + handles.as_ptr() as *const sys::zx_handle_t, n_handles); + into_result(status, || { + // Handles were successfully transferred, forget them on sender side + handles.set_len(0); + }) + } + } + + /// Send a message consisting of the given bytes and handles to a channel and await a reply. The + /// bytes should start with a four byte 'txid' which is used to identify the matching reply. + /// + /// Wraps the + /// [zx_channel_call](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/channel_call.md) + /// syscall. + /// + /// Note that unlike [`read`][read], the caller must ensure that the MessageBuf has enough + /// capacity for the bytes and handles which will be received, as replies which are too large + /// are discarded. + /// + /// On failure returns the both the main and read status. + /// + /// [read]: struct.Channel.html#method.read + pub fn call(&self, options: u32, timeout: Time, bytes: &[u8], handles: &mut Vec, + buf: &mut MessageBuf) -> Result<(), (Status, Status)> + { + let write_num_bytes = try!(usize_into_u32(bytes.len()).map_err( + |_| (Status::ErrOutOfRange, Status::NoError))); + let write_num_handles = try!(usize_into_u32(handles.len()).map_err( + |_| (Status::ErrOutOfRange, Status::NoError))); + buf.reset_handles(); + let read_num_bytes: u32 = size_to_u32_sat(buf.bytes.capacity()); + let read_num_handles: u32 = size_to_u32_sat(buf.handles.capacity()); + let args = sys::zx_channel_call_args_t { + wr_bytes: bytes.as_ptr(), + wr_handles: handles.as_ptr() as *const sys::zx_handle_t, + rd_bytes: buf.bytes.as_mut_ptr(), + rd_handles: buf.handles.as_mut_ptr(), + wr_num_bytes: write_num_bytes, + wr_num_handles: write_num_handles, + rd_num_bytes: read_num_bytes, + rd_num_handles: read_num_handles, + }; + let mut actual_read_bytes: u32 = 0; + let mut actual_read_handles: u32 = 0; + let mut read_status = sys::ZX_OK; + let status = unsafe { + sys::zx_channel_call(self.raw_handle(), options, timeout, &args, &mut actual_read_bytes, + &mut actual_read_handles, &mut read_status) + }; + if status == sys::ZX_OK || status == sys::ZX_ERR_TIMED_OUT || status == sys::ZX_ERR_CALL_FAILED + { + // Handles were successfully transferred, even if we didn't get a response, so forget + // them on the sender side. + unsafe { handles.set_len(0); } + } + unsafe { + buf.bytes.set_len(actual_read_bytes as usize); + buf.handles.set_len(actual_read_handles as usize); + } + if status == sys::ZX_OK { + Ok(()) + } else { + Err((Status::from_raw(status), Status::from_raw(read_status))) + } + } +} + +/// Options for creating a channel. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum ChannelOpts { + /// A normal channel. + Normal = 0, +} + +impl Default for ChannelOpts { + fn default() -> Self { + ChannelOpts::Normal + } +} + +/// A buffer for _receiving_ messages from a channel. +/// +/// A `MessageBuf` is essentially a byte buffer and a vector of +/// handles, but move semantics for "taking" handles requires special handling. +/// +/// Note that for sending messages to a channel, the caller manages the buffers, +/// using a plain byte slice and `Vec`. +#[derive(Default)] +#[derive(Debug)] +pub struct MessageBuf { + bytes: Vec, + handles: Vec, +} + +impl MessageBuf { + /// Create a new, empty, message buffer. + pub fn new() -> Self { + Default::default() + } + + /// Ensure that the buffer has the capacity to hold at least `n_bytes` bytes. + pub fn ensure_capacity_bytes(&mut self, n_bytes: usize) { + ensure_capacity(&mut self.bytes, n_bytes); + } + + /// Ensure that the buffer has the capacity to hold at least `n_handles` handles. + pub fn ensure_capacity_handles(&mut self, n_handles: usize) { + ensure_capacity(&mut self.handles, n_handles); + } + + /// Get a reference to the bytes of the message buffer, as a `&[u8]` slice. + pub fn bytes(&self) -> &[u8] { + self.bytes.as_slice() + } + + /// The number of handles in the message buffer. Note this counts the number + /// available when the message was received; `take_handle` does not affect + /// the count. + pub fn n_handles(&self) -> usize { + self.handles.len() + } + + /// Take the handle at the specified index from the message buffer. If the + /// method is called again with the same index, it will return `None`, as + /// will happen if the index exceeds the number of handles available. + pub fn take_handle(&mut self, index: usize) -> Option { + self.handles.get_mut(index).and_then(|handleref| + if *handleref == INVALID_HANDLE { + None + } else { + Some(Handle(mem::replace(handleref, INVALID_HANDLE))) + } + ) + } + + fn drop_handles(&mut self) { + for &handle in &self.handles { + if handle != 0 { + handle_drop(handle); + } + } + } + + fn reset_handles(&mut self) { + self.drop_handles(); + self.handles.clear(); + } +} + +impl Drop for MessageBuf { + fn drop(&mut self) { + self.drop_handles(); + } +} + +fn ensure_capacity(vec: &mut Vec, size: usize) { + let len = vec.len(); + if size > len { + vec.reserve(size - len); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use {Duration, ZX_CHANNEL_READABLE, ZX_CHANNEL_WRITABLE, ZX_RIGHT_SAME_RIGHTS, ZX_SIGNAL_LAST_HANDLE, Vmo, VmoOpts}; + use deadline_after; + use std::thread; + + #[test] + fn channel_basic() { + let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); + + let mut empty = vec![]; + assert!(p1.write(b"hello", &mut empty, 0).is_ok()); + + let mut buf = MessageBuf::new(); + assert!(p2.read(0, &mut buf).is_ok()); + assert_eq!(buf.bytes(), b"hello"); + } + + #[test] + fn channel_read_raw_too_small() { + let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); + + let mut empty = vec![]; + assert!(p1.write(b"hello", &mut empty, 0).is_ok()); + + let mut buf = MessageBuf::new(); + let result = p2.read_raw(0, &mut buf); + assert_eq!(result, Err((5, 0))); + assert_eq!(buf.bytes(), b""); + } + + #[test] + fn channel_send_handle() { + let hello_length: usize = 5; + + // Create a pair of channels and a virtual memory object. + let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); + let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); + + // Duplicate VMO handle and send it down the channel. + let duplicate_vmo_handle = vmo.duplicate_handle(ZX_RIGHT_SAME_RIGHTS).unwrap().into(); + let mut handles_to_send: Vec = vec![duplicate_vmo_handle]; + assert!(p1.write(b"", &mut handles_to_send, 0).is_ok()); + // Handle should be removed from vector. + assert!(handles_to_send.is_empty()); + + // Read the handle from the receiving channel. + let mut buf = MessageBuf::new(); + assert!(p2.read(0, &mut buf).is_ok()); + assert_eq!(buf.n_handles(), 1); + // Take the handle from the buffer. + let received_handle = buf.take_handle(0).unwrap(); + // Should not affect number of handles. + assert_eq!(buf.n_handles(), 1); + // Trying to take it again should fail. + assert!(buf.take_handle(0).is_none()); + + // Now to test that we got the right handle, try writing something to it... + let received_vmo = Vmo::from(received_handle); + assert_eq!(received_vmo.write(b"hello", 0).unwrap(), hello_length); + + // ... and reading it back from the original VMO. + let mut read_vec = vec![0; hello_length]; + assert_eq!(vmo.read(&mut read_vec, 0).unwrap(), hello_length); + assert_eq!(read_vec, b"hello"); + } + + #[test] + fn channel_call_timeout() { + let ten_ms: Duration = 10_000_000; + + // Create a pair of channels and a virtual memory object. + let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); + let vmo = Vmo::create(0 as u64, VmoOpts::Default).unwrap(); + + // Duplicate VMO handle and send it along with the call. + let duplicate_vmo_handle = vmo.duplicate_handle(ZX_RIGHT_SAME_RIGHTS).unwrap().into(); + let mut handles_to_send: Vec = vec![duplicate_vmo_handle]; + let mut buf = MessageBuf::new(); + assert_eq!(p1.call(0, deadline_after(ten_ms), b"call", &mut handles_to_send, &mut buf), + Err((Status::ErrTimedOut, Status::NoError))); + // Handle should be removed from vector even though we didn't get a response, as it was + // still sent over the channel. + assert!(handles_to_send.is_empty()); + + // Should be able to read call even though it timed out waiting for a response. + let mut buf = MessageBuf::new(); + assert!(p2.read(0, &mut buf).is_ok()); + assert_eq!(buf.bytes(), b"call"); + assert_eq!(buf.n_handles(), 1); + } + + #[test] + fn channel_call() { + let hundred_ms: Duration = 100_000_000; + + // Create a pair of channels + let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); + + // Start a new thread to respond to the call. + let server = thread::spawn(move || { + assert_eq!(p2.wait_handle(ZX_CHANNEL_READABLE, deadline_after(hundred_ms)), + Ok(ZX_CHANNEL_READABLE | ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE)); + let mut buf = MessageBuf::new(); + assert_eq!(p2.read(0, &mut buf), Ok(())); + assert_eq!(buf.bytes(), b"txidcall"); + assert_eq!(buf.n_handles(), 0); + let mut empty = vec![]; + assert_eq!(p2.write(b"txidresponse", &mut empty, 0), Ok(())); + }); + + // Make the call. + let mut empty = vec![]; + let mut buf = MessageBuf::new(); + buf.ensure_capacity_bytes(12); + assert_eq!(p1.call(0, deadline_after(hundred_ms), b"txidcall", &mut empty, &mut buf), + Ok(())); + assert_eq!(buf.bytes(), b"txidresponse"); + assert_eq!(buf.n_handles(), 0); + + assert!(server.join().is_ok()); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/eventpair.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/eventpair.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/eventpair.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/eventpair.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon event pairs. + +use {AsHandleRef, Cookied, HandleBased, Handle, HandleRef, Peered, Status}; +use {sys, into_result}; + +/// An object representing a Zircon +/// [event pair](https://fuchsia.googlesource.com/zircon/+/master/docs/concepts.md#Other-IPC_Events_Event-Pairs_and-User-Signals). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct EventPair(Handle); +impl_handle_based!(EventPair); +impl Peered for EventPair {} +impl Cookied for EventPair {} + +impl EventPair { + /// Create an event pair, a pair of objects which can signal each other. Wraps the + /// [zx_eventpair_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/eventpair_create.md) + /// syscall. + pub fn create(options: EventPairOpts) -> Result<(EventPair, EventPair), Status> { + let mut out0 = 0; + let mut out1 = 0; + let status = unsafe { sys::zx_eventpair_create(options as u32, &mut out0, &mut out1) }; + into_result(status, || + (Self::from(Handle(out0)), + Self::from(Handle(out1)))) + } +} + +/// Options for creating an event pair. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum EventPairOpts { + /// Default options. + Default = 0, +} + +impl Default for EventPairOpts { + fn default() -> Self { + EventPairOpts::Default + } +} + +#[cfg(test)] +mod tests { + use super::*; + use {Duration, ZX_SIGNAL_LAST_HANDLE, ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0}; + use deadline_after; + + #[test] + fn wait_and_signal_peer() { + let (p1, p2) = EventPair::create(EventPairOpts::Default).unwrap(); + let eighty_ms: Duration = 80_000_000; + + // Waiting on one without setting any signal should time out. + assert_eq!(p2.wait_handle(ZX_USER_SIGNAL_0, deadline_after(eighty_ms)), Err(Status::ErrTimedOut)); + + // If we set a signal, we should be able to wait for it. + assert!(p1.signal_peer(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + assert_eq!(p2.wait_handle(ZX_USER_SIGNAL_0, deadline_after(eighty_ms)).unwrap(), + ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + + // Should still work, signals aren't automatically cleared. + assert_eq!(p2.wait_handle(ZX_USER_SIGNAL_0, deadline_after(eighty_ms)).unwrap(), + ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + + // Now clear it, and waiting should time out again. + assert!(p1.signal_peer(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); + assert_eq!(p2.wait_handle(ZX_USER_SIGNAL_0, deadline_after(eighty_ms)), Err(Status::ErrTimedOut)); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/event.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/event.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/event.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/event.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon event objects. + +use {AsHandleRef, Cookied, HandleBased, Handle, HandleRef, Status}; +use {sys, into_result}; + +/// An object representing a Zircon +/// [event object](https://fuchsia.googlesource.com/zircon/+/master/docs/objects/event.md). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Event(Handle); +impl_handle_based!(Event); +impl Cookied for Event {} + +impl Event { + /// Create an event object, an object which is signalable but nothing else. Wraps the + /// [zx_event_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/event_create.md) + /// syscall. + pub fn create(options: EventOpts) -> Result { + let mut out = 0; + let status = unsafe { sys::zx_event_create(options as u32, &mut out) }; + into_result(status, || Self::from(Handle(out))) + } +} + +/// Options for creating an event object. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum EventOpts { + /// Default options. + Default = 0, +} + +impl Default for EventOpts { + fn default() -> Self { + EventOpts::Default + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/fifo.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/fifo.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/fifo.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/fifo.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,107 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon fifo objects. + +use {AsHandleRef, HandleBased, Handle, HandleRef, Status}; +use {sys, into_result}; + +/// An object representing a Zircon fifo. +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Fifo(Handle); +impl_handle_based!(Fifo); + +impl Fifo { + /// Create a pair of fifos and return their endpoints. Writing to one endpoint enqueues an + /// element into the fifo from which the opposing endpoint reads. Wraps the + /// [zx_fifo_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/fifo_create.md) + /// syscall. + pub fn create(elem_count: u32, elem_size: u32, options: FifoOpts) + -> Result<(Fifo, Fifo), Status> + { + let mut out0 = 0; + let mut out1 = 0; + let status = unsafe { + sys::zx_fifo_create(elem_count, elem_size, options as u32, &mut out0, &mut out1) + }; + into_result(status, || (Self::from(Handle(out0)), Self::from(Handle(out1)))) + } + + /// Attempts to write some number of elements into the fifo. The number of bytes written will be + /// rounded down to a multiple of the fifo's element size. + /// Return value (on success) is number of elements actually written. + /// + /// Wraps + /// [zx_fifo_write](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/fifo_write.md). + pub fn write(&self, bytes: &[u8]) -> Result { + let mut num_entries_written = 0; + let status = unsafe { + sys::zx_fifo_write(self.raw_handle(), bytes.as_ptr(), bytes.len(), + &mut num_entries_written) + }; + into_result(status, || num_entries_written) + } + + /// Attempts to read some number of elements out of the fifo. The number of bytes read will + /// always be a multiple of the fifo's element size. + /// Return value (on success) is number of elements actually read. + /// + /// Wraps + /// [zx_fifo_read](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/fifo_read.md). + pub fn read(&self, bytes: &mut [u8]) -> Result { + let mut num_entries_read = 0; + let status = unsafe { + sys::zx_fifo_read(self.raw_handle(), bytes.as_mut_ptr(), bytes.len(), + &mut num_entries_read) + }; + into_result(status, || num_entries_read) + } +} + +/// Options for creating a fifo pair. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum FifoOpts { + /// Default options. + Default = 0, +} + +impl Default for FifoOpts { + fn default() -> Self { + FifoOpts::Default + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn fifo_basic() { + let (fifo1, fifo2) = Fifo::create(4, 2, FifoOpts::Default).unwrap(); + + // Trying to write less than one element should fail. + assert_eq!(fifo1.write(b""), Err(Status::ErrOutOfRange)); + assert_eq!(fifo1.write(b"h"), Err(Status::ErrOutOfRange)); + + // Should write one element "he" and ignore the last half-element as it rounds down. + assert_eq!(fifo1.write(b"hex").unwrap(), 1); + + // Should write three elements "ll" "o " "wo" and drop the rest as it is full. + assert_eq!(fifo1.write(b"llo worlds").unwrap(), 3); + + // Now that the fifo is full any further attempts to write should fail. + assert_eq!(fifo1.write(b"blah blah"), Err(Status::ErrShouldWait)); + + // Read all 4 entries from the other end. + let mut read_vec = vec![0; 8]; + assert_eq!(fifo2.read(&mut read_vec).unwrap(), 4); + assert_eq!(read_vec, b"hello wo"); + + // Reading again should fail as the fifo is empty. + assert_eq!(fifo2.read(&mut read_vec), Err(Status::ErrShouldWait)); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/job.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/job.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/job.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/job.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon job. + +use {AsHandleRef, HandleBased, Handle, HandleRef}; + +/// An object representing a Zircon job. +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Job(Handle); +impl_handle_based!(Job); \ No newline at end of file diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/lib.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,911 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon kernel +//! [syscalls](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls.md). + +extern crate fuchsia_zircon_sys as zircon_sys; + +use std::io; +use std::marker::PhantomData; + +macro_rules! impl_handle_based { + ($type_name:path) => { + impl AsHandleRef for $type_name { + fn as_handle_ref(&self) -> HandleRef { + self.0.as_handle_ref() + } + } + + impl From for $type_name { + fn from(handle: Handle) -> Self { + $type_name(handle) + } + } + + impl From<$type_name> for Handle { + fn from(x: $type_name) -> Handle { + x.0 + } + } + + impl HandleBased for $type_name {} + } +} + +mod channel; +mod event; +mod eventpair; +mod fifo; +mod job; +mod port; +mod process; +mod socket; +mod timer; +mod thread; +mod vmo; + +pub use channel::{Channel, ChannelOpts, MessageBuf}; +pub use event::{Event, EventOpts}; +pub use eventpair::{EventPair, EventPairOpts}; +pub use fifo::{Fifo, FifoOpts}; +pub use job::Job; +pub use port::{Packet, PacketContents, Port, PortOpts, SignalPacket, UserPacket, WaitAsyncOpts}; +pub use process::Process; +pub use socket::{Socket, SocketOpts, SocketReadOpts, SocketWriteOpts}; +pub use timer::{Timer, TimerOpts}; +pub use thread::Thread; +pub use vmo::{Vmo, VmoCloneOpts, VmoOp, VmoOpts}; + +use zircon_sys as sys; + +type Duration = sys::zx_duration_t; +type Time = sys::zx_time_t; +pub use zircon_sys::ZX_TIME_INFINITE; + +// A placeholder value used for handles that have been taken from the message buf. +// We rely on the kernel never to produce any actual handles with this value. +const INVALID_HANDLE: sys::zx_handle_t = 0; + +/// A status code returned from the Zircon kernel. +/// +/// See +/// [errors.md](https://fuchsia.googlesource.com/zircon/+/master/docs/errors.md) +/// in the Zircon documentation for more information about the meaning of these +/// codes. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +#[repr(i32)] +// Auto-generated using tools/gen_status.py +pub enum Status { + NoError = 0, + ErrInternal = -1, + ErrNotSupported = -2, + ErrNoResources = -3, + ErrNoMemory = -4, + ErrCallFailed = -5, + ErrInterruptedRetry = -6, + ErrInvalidArgs = -10, + ErrBadHandle = -11, + ErrWrongType = -12, + ErrBadSyscall = -13, + ErrOutOfRange = -14, + ErrBufferTooSmall = -15, + ErrBadState = -20, + ErrTimedOut = -21, + ErrShouldWait = -22, + ErrCanceled = -23, + ErrPeerClosed = -24, + ErrNotFound = -25, + ErrAlreadyExists = -26, + ErrAlreadyBound = -27, + ErrUnavailable = -28, + ErrAccessDenied = -30, + ErrIo = -40, + ErrIoRefused = -41, + ErrIoDataIntegrity = -42, + ErrIoDataLoss = -43, + ErrBadPath = -50, + ErrNotDir = -51, + ErrNotFile = -52, + ErrFileBig = -53, + ErrNoSpace = -54, + ErrStop = -60, + ErrNext = -61, + + /// Any zx_status_t not in the set above will map to the following: + UnknownOther = -32768, + + // used to prevent exhaustive matching + #[doc(hidden)] + __Nonexhaustive = -32787, +} + +impl Status { + pub fn from_raw(raw: sys::zx_status_t) -> Self { + match raw { + // Auto-generated using tools/gen_status.py + sys::ZX_OK => Status::NoError, + sys::ZX_ERR_INTERNAL => Status::ErrInternal, + sys::ZX_ERR_NOT_SUPPORTED => Status::ErrNotSupported, + sys::ZX_ERR_NO_RESOURCES => Status::ErrNoResources, + sys::ZX_ERR_NO_MEMORY => Status::ErrNoMemory, + sys::ZX_ERR_CALL_FAILED => Status::ErrCallFailed, + sys::ZX_ERR_INTERRUPTED_RETRY => Status::ErrInterruptedRetry, + sys::ZX_ERR_INVALID_ARGS => Status::ErrInvalidArgs, + sys::ZX_ERR_BAD_HANDLE => Status::ErrBadHandle, + sys::ZX_ERR_WRONG_TYPE => Status::ErrWrongType, + sys::ZX_ERR_BAD_SYSCALL => Status::ErrBadSyscall, + sys::ZX_ERR_OUT_OF_RANGE => Status::ErrOutOfRange, + sys::ZX_ERR_BUFFER_TOO_SMALL => Status::ErrBufferTooSmall, + sys::ZX_ERR_BAD_STATE => Status::ErrBadState, + sys::ZX_ERR_TIMED_OUT => Status::ErrTimedOut, + sys::ZX_ERR_SHOULD_WAIT => Status::ErrShouldWait, + sys::ZX_ERR_CANCELED => Status::ErrCanceled, + sys::ZX_ERR_PEER_CLOSED => Status::ErrPeerClosed, + sys::ZX_ERR_NOT_FOUND => Status::ErrNotFound, + sys::ZX_ERR_ALREADY_EXISTS => Status::ErrAlreadyExists, + sys::ZX_ERR_ALREADY_BOUND => Status::ErrAlreadyBound, + sys::ZX_ERR_UNAVAILABLE => Status::ErrUnavailable, + sys::ZX_ERR_ACCESS_DENIED => Status::ErrAccessDenied, + sys::ZX_ERR_IO => Status::ErrIo, + sys::ZX_ERR_IO_REFUSED => Status::ErrIoRefused, + sys::ZX_ERR_IO_DATA_INTEGRITY => Status::ErrIoDataIntegrity, + sys::ZX_ERR_IO_DATA_LOSS => Status::ErrIoDataLoss, + sys::ZX_ERR_BAD_PATH => Status::ErrBadPath, + sys::ZX_ERR_NOT_DIR => Status::ErrNotDir, + sys::ZX_ERR_NOT_FILE => Status::ErrNotFile, + sys::ZX_ERR_FILE_BIG => Status::ErrFileBig, + sys::ZX_ERR_NO_SPACE => Status::ErrNoSpace, + sys::ZX_ERR_STOP => Status::ErrStop, + sys::ZX_ERR_NEXT => Status::ErrNext, + _ => Status::UnknownOther, + } + } + + pub fn into_io_err(self) -> io::Error { + self.into() + } + + // Note: no to_raw, even though it's easy to implement, partly because + // handling of UnknownOther would be tricky. +} + +impl From for Status { + fn from(kind: io::ErrorKind) -> Self { + use io::ErrorKind::*; + use Status::*; + + match kind { + NotFound => ErrNotFound, + PermissionDenied => ErrAccessDenied, + ConnectionRefused => ErrIoRefused, + ConnectionAborted => ErrPeerClosed, + AddrInUse => ErrAlreadyBound, + AddrNotAvailable => ErrUnavailable, + BrokenPipe => ErrPeerClosed, + AlreadyExists => ErrAlreadyExists, + WouldBlock => ErrShouldWait, + InvalidInput => ErrInvalidArgs, + TimedOut => ErrTimedOut, + Interrupted => ErrInterruptedRetry, + + UnexpectedEof | + WriteZero | + ConnectionReset | + NotConnected | + Other | _ => ErrIo, + } + } +} + +impl From for io::ErrorKind { + fn from(status: Status) -> io::ErrorKind { + use io::ErrorKind::*; + use Status::*; + + match status { + ErrInterruptedRetry => Interrupted, + ErrBadHandle => BrokenPipe, + ErrTimedOut => TimedOut, + ErrShouldWait => WouldBlock, + ErrPeerClosed => ConnectionAborted, + ErrNotFound => NotFound, + ErrAlreadyExists => AlreadyExists, + ErrAlreadyBound => AlreadyExists, + ErrUnavailable => AddrNotAvailable, + ErrAccessDenied => PermissionDenied, + ErrIoRefused => ConnectionRefused, + ErrIoDataIntegrity => InvalidData, + + ErrBadPath | + ErrInvalidArgs | + ErrOutOfRange | + ErrWrongType => InvalidInput, + + Status::__Nonexhaustive | + UnknownOther | + NoError | + ErrNext | + ErrStop | + ErrNoSpace | + ErrFileBig | + ErrNotFile | + ErrNotDir | + ErrIoDataLoss | + ErrIo | + ErrCanceled | + ErrBadState | + ErrBufferTooSmall | + ErrBadSyscall | + ErrInternal | + ErrNotSupported | + ErrNoResources | + ErrNoMemory | + ErrCallFailed => Other, + } + } +} + +impl From for Status { + fn from(err: io::Error) -> Status { + err.kind().into() + } +} + +impl From for io::Error { + fn from(status: Status) -> io::Error { + io::Error::from(io::ErrorKind::from(status)) + } +} + +/// Rights associated with a handle. +/// +/// See [rights.md](https://fuchsia.googlesource.com/zircon/+/master/docs/rights.md) +/// for more information. +pub type Rights = sys::zx_rights_t; +pub use zircon_sys::{ + ZX_RIGHT_NONE, + ZX_RIGHT_DUPLICATE, + ZX_RIGHT_TRANSFER, + ZX_RIGHT_READ, + ZX_RIGHT_WRITE, + ZX_RIGHT_EXECUTE, + ZX_RIGHT_MAP, + ZX_RIGHT_GET_PROPERTY, + ZX_RIGHT_SET_PROPERTY, + ZX_RIGHT_DEBUG, + ZX_RIGHT_SAME_RIGHTS, +}; + +/// Signals that can be waited upon. +/// +/// See +/// [Objects and signals](https://fuchsia.googlesource.com/zircon/+/master/docs/concepts.md#Objects-and-Signals) +/// in the Zircon kernel documentation. Note: the names of signals are still in flux. +pub type Signals = sys::zx_signals_t; + +pub use zircon_sys::{ + ZX_SIGNAL_NONE, + + ZX_SIGNAL_HANDLE_CLOSED, + ZX_SIGNAL_LAST_HANDLE, + + ZX_USER_SIGNAL_0, + ZX_USER_SIGNAL_1, + ZX_USER_SIGNAL_2, + ZX_USER_SIGNAL_3, + ZX_USER_SIGNAL_4, + ZX_USER_SIGNAL_5, + ZX_USER_SIGNAL_6, + ZX_USER_SIGNAL_7, + + // Event + ZX_EVENT_SIGNALED, + + // EventPair + ZX_EPAIR_SIGNALED, + ZX_EPAIR_CLOSED, + + // Task signals (process, thread, job) + ZX_TASK_TERMINATED, + + // Channel + ZX_CHANNEL_READABLE, + ZX_CHANNEL_WRITABLE, + ZX_CHANNEL_PEER_CLOSED, + + // Socket + ZX_SOCKET_READABLE, + ZX_SOCKET_WRITABLE, + ZX_SOCKET_PEER_CLOSED, + + // Timer + ZX_TIMER_SIGNALED, +}; + +/// A "wait item" containing a handle reference and information about what signals +/// to wait on, and, on return from `object_wait_many`, which are pending. +#[repr(C)] +#[derive(Debug)] +pub struct WaitItem<'a> { + /// The handle to wait on. + pub handle: HandleRef<'a>, + /// A set of signals to wait for. + pub waitfor: Signals, + /// The set of signals pending, on return of `object_wait_many`. + pub pending: Signals, +} + + +/// An identifier to select a particular clock. See +/// [zx_time_get](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/time_get.md) +/// for more information about the possible values. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum ClockId { + /// The number of nanoseconds since the system was powered on. Corresponds to + /// `ZX_CLOCK_MONOTONIC`. + Monotonic = 0, + /// The number of wall clock nanoseconds since the Unix epoch (midnight on January 1 1970) in + /// UTC. Corresponds to ZX_CLOCK_UTC. + UTC = 1, + /// The number of nanoseconds the current thread has been running for. Corresponds to + /// ZX_CLOCK_THREAD. + Thread = 2, +} + +/// Get the current time, from the specific clock id. +/// +/// Wraps the +/// [zx_time_get](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/time_get.md) +/// syscall. +pub fn time_get(clock_id: ClockId) -> Time { + unsafe { sys::zx_time_get(clock_id as u32) } +} + +/// Read the number of high-precision timer ticks since boot. These ticks may be processor cycles, +/// high speed timer, profiling timer, etc. They are not guaranteed to continue advancing when the +/// system is asleep. +/// +/// Wraps the +/// [zx_ticks_get](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/ticks_get.md) +/// syscall. +pub fn ticks_get() -> u64 { + unsafe { sys::zx_ticks_get() } +} + +/// Compute a deadline for the time in the future that is the given `Duration` away. +/// +/// Wraps the +/// [zx_deadline_after](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/deadline_after.md) +/// syscall. +pub fn deadline_after(nanos: Duration) -> Time { + unsafe { sys::zx_deadline_after(nanos) } +} + +/// Sleep until the given deadline. +/// +/// Wraps the +/// [zx_nanosleep](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/nanosleep.md) +/// syscall. +pub fn nanosleep(deadline: Time) { + unsafe { sys::zx_nanosleep(deadline); } +} + +/// Return the number of high-precision timer ticks in a second. +/// +/// Wraps the +/// [zx_ticks_per_second](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/ticks_per_second.md) +/// syscall. +pub fn ticks_per_second() -> u64 { + unsafe { sys::zx_ticks_per_second() } +} + +pub use zircon_sys::{ + ZX_CPRNG_DRAW_MAX_LEN, + ZX_CPRNG_ADD_ENTROPY_MAX_LEN, +}; + +/// Draw random bytes from the kernel's CPRNG to fill the given buffer. Returns the actual number of +/// bytes drawn, which may sometimes be less than the size of the buffer provided. +/// +/// The buffer must have length less than `ZX_CPRNG_DRAW_MAX_LEN`. +/// +/// Wraps the +/// [zx_cprng_draw](https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/cprng_draw.md) +/// syscall. +pub fn cprng_draw(buffer: &mut [u8]) -> Result { + let mut actual = 0; + let status = unsafe { sys::zx_cprng_draw(buffer.as_mut_ptr(), buffer.len(), &mut actual) }; + into_result(status, || actual) +} + +/// Mix the given entropy into the kernel CPRNG. +/// +/// The buffer must have length less than `ZX_CPRNG_ADD_ENTROPY_MAX_LEN`. +/// +/// Wraps the +/// [zx_cprng_add_entropy](https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/cprng_add_entropy.md) +/// syscall. +pub fn cprng_add_entropy(buffer: &[u8]) -> Result<(), Status> { + let status = unsafe { sys::zx_cprng_add_entropy(buffer.as_ptr(), buffer.len()) }; + into_result(status, || ()) +} + +fn into_result(status: sys::zx_status_t, f: F) -> Result + where F: FnOnce() -> T { + // All non-negative values are assumed successful. Note: calls that don't try + // to multiplex success values into status return could be more strict here. + if status >= 0 { + Ok(f()) + } else { + Err(Status::from_raw(status)) + } +} + +// Handles + +/// A borrowed reference to a `Handle`. +/// +/// Mostly useful as part of a `WaitItem`. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct HandleRef<'a> { + handle: sys::zx_handle_t, + phantom: PhantomData<&'a sys::zx_handle_t>, +} + +impl<'a> HandleRef<'a> { + pub fn raw_handle(&self) -> sys::zx_handle_t { + self.handle + } + + pub fn duplicate(&self, rights: Rights) -> Result { + let handle = self.handle; + let mut out = 0; + let status = unsafe { sys::zx_handle_duplicate(handle, rights, &mut out) }; + into_result(status, || Handle(out)) + } + + pub fn signal(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { + let handle = self.handle; + let status = unsafe { sys::zx_object_signal(handle, clear_mask.bits(), set_mask.bits()) }; + into_result(status, || ()) + } + + pub fn wait(&self, signals: Signals, deadline: Time) -> Result { + let handle = self.handle; + let mut pending = sys::zx_signals_t::empty(); + let status = unsafe { + sys::zx_object_wait_one(handle, signals, deadline, &mut pending) + }; + into_result(status, || pending) + } + + pub fn wait_async(&self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts) + -> Result<(), Status> + { + let handle = self.handle; + let status = unsafe { + sys::zx_object_wait_async(handle, port.raw_handle(), key, signals, options as u32) + }; + into_result(status, || ()) + } +} + +/// A trait to get a reference to the underlying handle of an object. +pub trait AsHandleRef { + /// Get a reference to the handle. One important use of such a reference is + /// for `object_wait_many`. + fn as_handle_ref(&self) -> HandleRef; + + /// Interpret the reference as a raw handle (an integer type). Two distinct + /// handles will have different raw values (so it can perhaps be used as a + /// key in a data structure). + fn raw_handle(&self) -> sys::zx_handle_t { + self.as_handle_ref().raw_handle() + } + + /// Set and clear userspace-accessible signal bits on an object. Wraps the + /// [zx_object_signal](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/object_signal.md) + /// syscall. + fn signal_handle(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { + self.as_handle_ref().signal(clear_mask, set_mask) + } + + /// Waits on a handle. Wraps the + /// [zx_object_wait_one](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/object_wait_one.md) + /// syscall. + fn wait_handle(&self, signals: Signals, deadline: Time) -> Result { + self.as_handle_ref().wait(signals, deadline) + } + + /// Causes packet delivery on the given port when the object changes state and matches signals. + /// [zx_object_wait_async](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/object_wait_async.md) + /// syscall. + fn wait_async_handle(&self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts) + -> Result<(), Status> + { + self.as_handle_ref().wait_async(port, key, signals, options) + } +} + +impl<'a> AsHandleRef for HandleRef<'a> { + fn as_handle_ref(&self) -> HandleRef { *self } +} + +/// A trait implemented by all handle-based types. +/// +/// Note: it is reasonable for user-defined objects wrapping a handle to implement +/// this trait. For example, a specific interface in some protocol might be +/// represented as a newtype of `Channel`, and implement the `as_handle_ref` +/// method and the `From` trait to facilitate conversion from and to the +/// interface. +pub trait HandleBased: AsHandleRef + From + Into { + /// Duplicate a handle, possibly reducing the rights available. Wraps the + /// [zx_handle_duplicate](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/handle_duplicate.md) + /// syscall. + fn duplicate_handle(&self, rights: Rights) -> Result { + self.as_handle_ref().duplicate(rights).map(|handle| Self::from(handle)) + } + + /// Create a replacement for a handle, possibly reducing the rights available. This invalidates + /// the original handle. Wraps the + /// [zx_handle_replace](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/handle_replace.md) + /// syscall. + fn replace_handle(self, rights: Rights) -> Result { + >::into(self) + .replace(rights).map(|handle| Self::from(handle)) + } + + /// Converts the value into its inner handle. + /// + /// This is a convenience function which simply forwards to the `Into` trait. + fn into_handle(self) -> Handle { + self.into() + } + + /// Creates an instance of this type from a handle. + /// + /// This is a convenience function which simply forwards to the `From` trait. + fn from_handle(handle: Handle) -> Self { + Self::from(handle) + } + + /// Creates an instance of another handle-based type from this value's inner handle. + fn into_handle_based(self) -> H { + H::from_handle(self.into_handle()) + } + + /// Creates an instance of this type from the inner handle of another + /// handle-based type. + fn from_handle_based(h: H) -> Self { + Self::from_handle(h.into_handle()) + } +} + +/// A trait implemented by all handles for objects which have a peer. +pub trait Peered: HandleBased { + /// Set and clear userspace-accessible signal bits on the object's peer. Wraps the + /// [zx_object_signal_peer](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/object_signal.md) + /// syscall. + fn signal_peer(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { + let handle = self.as_handle_ref().handle; + let status = unsafe { + sys::zx_object_signal_peer(handle, clear_mask.bits(), set_mask.bits()) + }; + into_result(status, || ()) + } +} + +/// A trait implemented by all handles for objects which can have a cookie attached. +pub trait Cookied: HandleBased { + /// Get the cookie attached to this object, if any. Wraps the + /// [zx_object_get_cookie](https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/object_get_cookie.md) + /// syscall. + fn get_cookie(&self, scope: &HandleRef) -> Result { + let handle = self.as_handle_ref().handle; + let mut cookie = 0; + let status = unsafe { sys::zx_object_get_cookie(handle, scope.handle, &mut cookie) }; + into_result(status, || cookie) + } + + /// Attach an opaque cookie to this object with the given scope. The cookie may be read or + /// changed in future only with the same scope. Wraps the + /// [zx_object_set_cookie](https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/object_set_cookie.md) + /// syscall. + fn set_cookie(&self, scope: &HandleRef, cookie: u64) -> Result<(), Status> { + let handle = self.as_handle_ref().handle; + let status = unsafe { sys::zx_object_set_cookie(handle, scope.handle, cookie) }; + into_result(status, || ()) + } +} + +fn handle_drop(handle: sys::zx_handle_t) { + let _ = unsafe { sys::zx_handle_close(handle) }; +} + +/// Wait on multiple handles. +/// The success return value is a bool indicating whether one or more of the +/// provided handle references was closed during the wait. +/// +/// Wraps the +/// [zx_object_wait_many](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/object_wait_many.md) +/// syscall. +pub fn object_wait_many(items: &mut [WaitItem], deadline: Time) -> Result +{ + let len = try!(usize_into_u32(items.len()).map_err(|_| Status::ErrOutOfRange)); + let items_ptr = items.as_mut_ptr() as *mut sys::zx_wait_item_t; + let status = unsafe { sys::zx_object_wait_many( items_ptr, len, deadline) }; + if status == sys::ZX_ERR_CANCELED { + return Ok((true)) + } + into_result(status, || false) +} + +// An untyped handle + +/// An object representing a Zircon +/// [handle](https://fuchsia.googlesource.com/zircon/+/master/docs/handles.md). +/// +/// Internally, it is represented as a 32-bit integer, but this wrapper enforces +/// strict ownership semantics. The `Drop` implementation closes the handle. +/// +/// This type represents the most general reference to a kernel object, and can +/// be interconverted to and from more specific types. Those conversions are not +/// enforced in the type system; attempting to use them will result in errors +/// returned by the kernel. These conversions don't change the underlying +/// representation, but do change the type and thus what operations are available. +#[derive(Debug, Eq, PartialEq, Hash)] +pub struct Handle(sys::zx_handle_t); + +impl AsHandleRef for Handle { + fn as_handle_ref(&self) -> HandleRef { + HandleRef { handle: self.0, phantom: Default::default() } + } +} + +impl HandleBased for Handle {} + +impl Drop for Handle { + fn drop(&mut self) { + handle_drop(self.0) + } +} + +impl Handle { + /// If a raw handle is obtained from some other source, this method converts + /// it into a type-safe owned handle. + pub unsafe fn from_raw(raw: sys::zx_handle_t) -> Handle { + Handle(raw) + } + + pub fn replace(self, rights: Rights) -> Result { + let handle = self.0; + let mut out = 0; + let status = unsafe { sys::zx_handle_replace(handle, rights, &mut out) }; + into_result(status, || Handle(out)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn monotonic_time_increases() { + let time1 = time_get(ClockId::Monotonic); + nanosleep(deadline_after(1_000)); + let time2 = time_get(ClockId::Monotonic); + assert!(time2 > time1); + } + + #[test] + fn utc_time_increases() { + let time1 = time_get(ClockId::UTC); + nanosleep(deadline_after(1_000)); + let time2 = time_get(ClockId::UTC); + assert!(time2 > time1); + } + + #[test] + fn thread_time_increases() { + let time1 = time_get(ClockId::Thread); + nanosleep(deadline_after(1_000)); + let time2 = time_get(ClockId::Thread); + assert!(time2 > time1); + } + + #[test] + fn ticks_increases() { + let ticks1 = ticks_get(); + nanosleep(deadline_after(1_000)); + let ticks2 = ticks_get(); + assert!(ticks2 > ticks1); + } + + #[test] + fn tick_length() { + let sleep_ns = 1_000_000; // 1ms + let one_second_ns = 1_000_000_000; // 1 second in ns + let ticks1 = ticks_get(); + nanosleep(deadline_after(sleep_ns)); + let ticks2 = ticks_get(); + // The number of ticks should have increased by at least 1 ms worth + assert!(ticks2 > ticks1 + sleep_ns * ticks_per_second() / one_second_ns); + } + + #[test] + fn sleep() { + let sleep_ns = 1_000_000; // 1ms + let time1 = time_get(ClockId::Monotonic); + nanosleep(deadline_after(sleep_ns)); + let time2 = time_get(ClockId::Monotonic); + assert!(time2 > time1 + sleep_ns); + } + + /// Test duplication by means of a VMO + #[test] + fn duplicate() { + let hello_length: usize = 5; + + // Create a VMO and write some data to it. + let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); + assert!(vmo.write(b"hello", 0).is_ok()); + + // Replace, reducing rights to read. + let readonly_vmo = vmo.duplicate_handle(ZX_RIGHT_READ).unwrap(); + // Make sure we can read but not write. + let mut read_vec = vec![0; hello_length]; + assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); + assert_eq!(read_vec, b"hello"); + assert_eq!(readonly_vmo.write(b"", 0), Err(Status::ErrAccessDenied)); + + // Write new data to the original handle, and read it from the new handle + assert!(vmo.write(b"bye", 0).is_ok()); + assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); + assert_eq!(read_vec, b"byelo"); + } + + // Test replace by means of a VMO + #[test] + fn replace() { + let hello_length: usize = 5; + + // Create a VMO and write some data to it. + let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); + assert!(vmo.write(b"hello", 0).is_ok()); + + // Replace, reducing rights to read. + let readonly_vmo = vmo.replace_handle(ZX_RIGHT_READ).unwrap(); + // Make sure we can read but not write. + let mut read_vec = vec![0; hello_length]; + assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); + assert_eq!(read_vec, b"hello"); + assert_eq!(readonly_vmo.write(b"", 0), Err(Status::ErrAccessDenied)); + } + + #[test] + fn wait_and_signal() { + let event = Event::create(EventOpts::Default).unwrap(); + let ten_ms: Duration = 10_000_000; + + // Waiting on it without setting any signal should time out. + assert_eq!(event.wait_handle( + ZX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // If we set a signal, we should be able to wait for it. + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + assert_eq!(event.wait_handle(ZX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), + ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + + // Should still work, signals aren't automatically cleared. + assert_eq!(event.wait_handle(ZX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), + ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + + // Now clear it, and waiting should time out again. + assert!(event.signal_handle(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); + assert_eq!(event.wait_handle( + ZX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + } + + #[test] + fn wait_many_and_signal() { + let ten_ms: Duration = 10_000_000; + let e1 = Event::create(EventOpts::Default).unwrap(); + let e2 = Event::create(EventOpts::Default).unwrap(); + + // Waiting on them now should time out. + let mut items = vec![ + WaitItem { handle: e1.as_handle_ref(), waitfor: ZX_USER_SIGNAL_0, pending: ZX_SIGNAL_NONE }, + WaitItem { handle: e2.as_handle_ref(), waitfor: ZX_USER_SIGNAL_1, pending: ZX_SIGNAL_NONE }, + ]; + assert_eq!(object_wait_many(&mut items, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + assert_eq!(items[0].pending, ZX_SIGNAL_LAST_HANDLE); + assert_eq!(items[1].pending, ZX_SIGNAL_LAST_HANDLE); + + // Signal one object and it should return success. + assert!(e1.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + assert!(object_wait_many(&mut items, deadline_after(ten_ms)).is_ok()); + assert_eq!(items[0].pending, ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(items[1].pending, ZX_SIGNAL_LAST_HANDLE); + + // Signal the other and it should return both. + assert!(e2.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_1).is_ok()); + assert!(object_wait_many(&mut items, deadline_after(ten_ms)).is_ok()); + assert_eq!(items[0].pending, ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(items[1].pending, ZX_USER_SIGNAL_1 | ZX_SIGNAL_LAST_HANDLE); + + // Clear signals on both; now it should time out again. + assert!(e1.signal_handle(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); + assert!(e2.signal_handle(ZX_USER_SIGNAL_1, ZX_SIGNAL_NONE).is_ok()); + assert_eq!(object_wait_many(&mut items, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + assert_eq!(items[0].pending, ZX_SIGNAL_LAST_HANDLE); + assert_eq!(items[1].pending, ZX_SIGNAL_LAST_HANDLE); + } + + #[test] + fn cookies() { + let event = Event::create(EventOpts::Default).unwrap(); + let scope = Event::create(EventOpts::Default).unwrap(); + + // Getting a cookie when none has been set should fail. + assert_eq!(event.get_cookie(&scope.as_handle_ref()), Err(Status::ErrAccessDenied)); + + // Set a cookie. + assert_eq!(event.set_cookie(&scope.as_handle_ref(), 42), Ok(())); + + // Should get it back.... + assert_eq!(event.get_cookie(&scope.as_handle_ref()), Ok(42)); + + // but not with the wrong scope! + assert_eq!(event.get_cookie(&event.as_handle_ref()), Err(Status::ErrAccessDenied)); + + // Can change it, with the same scope... + assert_eq!(event.set_cookie(&scope.as_handle_ref(), 123), Ok(())); + + // but not with a different scope. + assert_eq!(event.set_cookie(&event.as_handle_ref(), 123), Err(Status::ErrAccessDenied)); + } + + #[test] + fn cprng() { + let mut buffer = [0; 20]; + assert_eq!(cprng_draw(&mut buffer), Ok(20)); + assert_ne!(buffer[0], 0); + assert_ne!(buffer[19], 0); + } + + #[test] + fn cprng_too_large() { + let mut buffer = [0; ZX_CPRNG_DRAW_MAX_LEN + 1]; + assert_eq!(cprng_draw(&mut buffer), Err(Status::ErrInvalidArgs)); + + for mut s in buffer.chunks_mut(ZX_CPRNG_DRAW_MAX_LEN) { + assert_eq!(cprng_draw(&mut s), Ok(s.len())); + } + } + + #[test] + fn cprng_add() { + let buffer = [0, 1, 2]; + assert_eq!(cprng_add_entropy(&buffer), Ok(())); + } +} + +pub fn usize_into_u32(n: usize) -> Result { + if n > ::std::u32::MAX as usize || n < ::std::u32::MIN as usize { + return Err(()) + } + Ok(n as u32) +} + +pub fn size_to_u32_sat(n: usize) -> u32 { + if n > ::std::u32::MAX as usize { + return ::std::u32::MAX; + } + if n < ::std::u32::MIN as usize { + return ::std::u32::MIN; + } + n as u32 +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/port.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/port.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/port.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/port.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,354 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon port objects. + +use std::mem; + +use {AsHandleRef, HandleBased, Handle, HandleRef, Signals, Status, Time}; +use {sys, into_result}; + +/// An object representing a Zircon +/// [port](https://fuchsia.googlesource.com/zircon/+/master/docs/objects/port.md). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Port(Handle); +impl_handle_based!(Port); + +/// A packet sent through a port. This is a type-safe wrapper for +/// [zx_port_packet_t](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_wait2.md). +#[derive(PartialEq, Eq, Debug)] +pub struct Packet(sys::zx_port_packet_t); + +/// The contents of a `Packet`. +#[derive(Debug, Copy, Clone)] +pub enum PacketContents { + /// A user-generated packet. + User(UserPacket), + /// A one-shot signal packet generated via `object_wait_async`. + SignalOne(SignalPacket), + /// A repeating signal packet generated via `object_wait_async`. + SignalRep(SignalPacket), +} + +/// Contents of a user packet (one sent by `port_queue`). This is a type-safe wrapper for +/// [zx_packet_user_t](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_wait2.md). +#[derive(Debug, Copy, Clone)] +pub struct UserPacket(sys::zx_packet_user_t); + +/// Contents of a signal packet (one generated by the kernel). This is a type-safe wrapper for +/// [zx_packet_signal_t](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_wait2.md). +#[derive(Debug, Copy, Clone)] +pub struct SignalPacket(sys::zx_packet_signal_t); + +impl Packet { + /// Creates a new packet with `UserPacket` data. + pub fn from_user_packet(key: u64, status: i32, user: UserPacket) -> Packet { + Packet( + sys::zx_port_packet_t { + key: key, + packet_type: sys::zx_packet_type_t::ZX_PKT_TYPE_USER, + status: status, + union: user.0, + } + ) + } + + /// The packet's key. + pub fn key(&self) -> u64 { + self.0.key + } + + /// The packet's status. + // TODO: should this type be wrapped? + pub fn status(&self) -> i32 { + self.0.status + } + + /// The contents of the packet. + pub fn contents(&self) -> PacketContents { + if self.0.packet_type == sys::zx_packet_type_t::ZX_PKT_TYPE_USER { + PacketContents::User(UserPacket(self.0.union)) + } else if self.0.packet_type == sys::zx_packet_type_t::ZX_PKT_TYPE_SIGNAL_ONE { + PacketContents::SignalOne(SignalPacket(unsafe { mem::transmute_copy(&self.0.union) })) + } else if self.0.packet_type == sys::zx_packet_type_t::ZX_PKT_TYPE_SIGNAL_REP { + PacketContents::SignalRep(SignalPacket(unsafe { mem::transmute_copy(&self.0.union) })) + } else { + panic!("unexpected packet type"); + } + } +} + +impl UserPacket { + pub fn from_u8_array(val: [u8; 32]) -> UserPacket { + UserPacket(val) + } + + pub fn as_u8_array(&self) -> &[u8; 32] { + &self.0 + } + + pub fn as_mut_u8_array(&mut self) -> &mut [u8; 32] { + &mut self.0 + } +} + +impl SignalPacket { + /// The signals used in the call to `object_wait_async`. + pub fn trigger(&self) -> Signals { + self.0.trigger + } + + /// The observed signals. + pub fn observed(&self) -> Signals { + self.0.observed + } + + /// A per object count of pending operations. + pub fn count(&self) -> u64 { + self.0.count + } +} + +impl Port { + /// Create an IO port, allowing IO packets to be read and enqueued. + /// + /// Wraps the + /// [zx_port_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_create.md) + /// syscall. + pub fn create(opts: PortOpts) -> Result { + unsafe { + let mut handle = 0; + let status = sys::zx_port_create(opts as u32, &mut handle); + into_result(status, || Self::from(Handle(handle))) + } + } + + /// Attempt to queue a user packet to the IO port. + /// + /// Wraps the + /// [zx_port_queue](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_queue.md) + /// syscall. + pub fn queue(&self, packet: &Packet) -> Result<(), Status> { + let status = unsafe { + sys::zx_port_queue(self.raw_handle(), + &packet.0 as *const sys::zx_port_packet_t as *const u8, 0) + }; + into_result(status, || ()) + } + + /// Wait for a packet to arrive on a (V2) port. + /// + /// Wraps the + /// [zx_port_wait](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/port_wait2.md) + /// syscall. + pub fn wait(&self, deadline: Time) -> Result { + let mut packet = Default::default(); + let status = unsafe { + sys::zx_port_wait(self.raw_handle(), deadline, + &mut packet as *mut sys::zx_port_packet_t as *mut u8, 0) + }; + into_result(status, || Packet(packet)) + } + + /// Cancel pending wait_async calls for an object with the given key. + /// + /// Wraps the + /// [zx_port_cancel](https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/port_cancel.md) + /// syscall. + pub fn cancel(&self, source: &H, key: u64) -> Result<(), Status> where H: HandleBased { + let status = unsafe { + sys::zx_port_cancel(self.raw_handle(), source.raw_handle(), key) + }; + into_result(status, || ()) + } +} + +/// Options for creating a port. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum PortOpts { + /// Default options. + Default = 0, +} + +impl Default for PortOpts { + fn default() -> Self { + PortOpts::Default + } +} + +/// Options for wait_async. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum WaitAsyncOpts { + Once = sys::ZX_WAIT_ASYNC_ONCE, + Repeating = sys::ZX_WAIT_ASYNC_REPEATING, +} + +#[cfg(test)] +mod tests { + use super::*; + use {Duration, Event, EventOpts}; + use {ZX_SIGNAL_LAST_HANDLE, ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1}; + use deadline_after; + + #[test] + fn port_basic() { + let ten_ms: Duration = 10_000_000; + + let port = Port::create(PortOpts::Default).unwrap(); + + // Waiting now should time out. + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // Send a valid packet. + let packet = Packet::from_user_packet( + 42, + 123, + UserPacket::from_u8_array([13; 32]), + ); + assert!(port.queue(&packet).is_ok()); + + // Waiting should succeed this time. We should get back the packet we sent. + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet, packet); + } + + #[test] + fn wait_async_once() { + let ten_ms: Duration = 10_000_000; + let key = 42; + + let port = Port::create(PortOpts::Default).unwrap(); + let event = Event::create(EventOpts::Default).unwrap(); + + assert!(event.wait_async_handle(&port, key, ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1, + WaitAsyncOpts::Once).is_ok()); + + // Waiting without setting any signal should time out. + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // If we set a signal, we should be able to wait for it. + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet.key(), key); + assert_eq!(read_packet.status(), 0); + match read_packet.contents() { + PacketContents::SignalOne(sig) => { + assert_eq!(sig.trigger(), ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1); + assert_eq!(sig.observed(), ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(sig.count(), 1); + } + _ => panic!("wrong packet type"), + } + + // Shouldn't get any more packets. + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // Calling wait_async again should result in another packet. + assert!(event.wait_async_handle(&port, key, ZX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet.key(), key); + assert_eq!(read_packet.status(), 0); + match read_packet.contents() { + PacketContents::SignalOne(sig) => { + assert_eq!(sig.trigger(), ZX_USER_SIGNAL_0); + assert_eq!(sig.observed(), ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(sig.count(), 1); + } + _ => panic!("wrong packet type"), + } + + // Calling wait_async_handle then cancel, we should not get a packet as cancel will + // remove it from the queue. + assert!(event.wait_async_handle(&port, key, ZX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); + assert!(port.cancel(&event, key).is_ok()); + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // If the event is signalled after the cancel, we also shouldn't get a packet. + assert!(event.signal_handle(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); // clear signal + assert!(event.wait_async_handle(&port, key, ZX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); + assert!(port.cancel(&event, key).is_ok()); + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + } + + #[test] + fn wait_async_repeating() { + let ten_ms: Duration = 10_000_000; + let key = 42; + + let port = Port::create(PortOpts::Default).unwrap(); + let event = Event::create(EventOpts::Default).unwrap(); + + assert!(event.wait_async_handle(&port, key, ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1, + WaitAsyncOpts::Repeating).is_ok()); + + // Waiting without setting any signal should time out. + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // If we set a signal, we should be able to wait for it. + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet.key(), key); + assert_eq!(read_packet.status(), 0); + match read_packet.contents() { + PacketContents::SignalRep(sig) => { + assert_eq!(sig.trigger(), ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1); + assert_eq!(sig.observed(), ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(sig.count(), 1); + } + _ => panic!("wrong packet type"), + } + + // Should not get any more packets, as ZX_WAIT_ASYNC_REPEATING is edge triggered rather than + // level triggered. + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // If we clear and resignal, we should get the same packet again, + // even though we didn't call event.wait_async again. + assert!(event.signal_handle(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); // clear signal + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet.key(), key); + assert_eq!(read_packet.status(), 0); + match read_packet.contents() { + PacketContents::SignalRep(sig) => { + assert_eq!(sig.trigger(), ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1); + assert_eq!(sig.observed(), ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(sig.count(), 1); + } + _ => panic!("wrong packet type"), + } + + // Cancelling the wait should stop us getting packets... + assert!(port.cancel(&event, key).is_ok()); + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + // ... even if we clear and resignal + assert!(event.signal_handle(ZX_USER_SIGNAL_0, ZX_SIGNAL_NONE).is_ok()); // clear signal + assert!(event.signal_handle(ZX_SIGNAL_NONE, ZX_USER_SIGNAL_0).is_ok()); + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // Calling wait_async again should result in another packet. + assert!(event.wait_async_handle( + &port, key, ZX_USER_SIGNAL_0, WaitAsyncOpts::Repeating).is_ok()); + let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); + assert_eq!(read_packet.key(), key); + assert_eq!(read_packet.status(), 0); + match read_packet.contents() { + PacketContents::SignalRep(sig) => { + assert_eq!(sig.trigger(), ZX_USER_SIGNAL_0); + assert_eq!(sig.observed(), ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE); + assert_eq!(sig.count(), 1); + } + _ => panic!("wrong packet type"), + } + + // Closing the handle should stop us getting packets. + drop(event); + assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/process.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/process.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/process.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/process.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon process. + +use {AsHandleRef, HandleBased, Handle, HandleRef}; + +/// An object representing a Zircon process. +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Process(Handle); +impl_handle_based!(Process); \ No newline at end of file diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/socket.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/socket.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/socket.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/socket.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,162 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon sockets. + +use {AsHandleRef, HandleBased, Handle, HandleRef, Peered}; +use {sys, Status, into_result}; + +use std::ptr; + +/// An object representing a Zircon +/// [socket](https://fuchsia.googlesource.com/zircon/+/master/docs/concepts.md#Message-Passing_Sockets-and-Channels). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Socket(Handle); +impl_handle_based!(Socket); +impl Peered for Socket {} + +/// Options for creating a socket pair. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum SocketOpts { + /// Default options. + Default = 0, +} + +impl Default for SocketOpts { + fn default() -> Self { + SocketOpts::Default + } +} + +/// Options for writing into a socket. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum SocketWriteOpts { + /// Default options. + Default = 0, +} + +impl Default for SocketWriteOpts { + fn default() -> Self { + SocketWriteOpts::Default + } +} + +/// Options for reading from a socket. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum SocketReadOpts { + /// Default options. + Default = 0, +} + +impl Default for SocketReadOpts { + fn default() -> Self { + SocketReadOpts::Default + } +} + + +impl Socket { + /// Create a socket, accessed through a pair of endpoints. Data written + /// into one may be read from the other. + /// + /// Wraps + /// [zx_socket_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/socket_create.md). + pub fn create(opts: SocketOpts) -> Result<(Socket, Socket), Status> { + unsafe { + let mut out0 = 0; + let mut out1 = 0; + let status = sys::zx_socket_create(opts as u32, &mut out0, &mut out1); + into_result(status, || + (Self::from(Handle(out0)), + Self::from(Handle(out1)))) + } + } + + /// Write the given bytes into the socket. + /// Return value (on success) is number of bytes actually written. + /// + /// Wraps + /// [zx_socket_write](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/socket_write.md). + pub fn write(&self, opts: SocketWriteOpts, bytes: &[u8]) -> Result { + let mut actual = 0; + let status = unsafe { + sys::zx_socket_write(self.raw_handle(), opts as u32, bytes.as_ptr(), bytes.len(), + &mut actual) + }; + into_result(status, || actual) + } + + /// Read the given bytes from the socket. + /// Return value (on success) is number of bytes actually read. + /// + /// Wraps + /// [zx_socket_read](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/socket_read.md). + pub fn read(&self, opts: SocketReadOpts, bytes: &mut [u8]) -> Result { + let mut actual = 0; + let status = unsafe { + sys::zx_socket_read(self.raw_handle(), opts as u32, bytes.as_mut_ptr(), + bytes.len(), &mut actual) + }; + if status != sys::ZX_OK { + // If an error is returned then actual is undefined, so to be safe we set it to 0 and + // ignore any data that is set in bytes. + actual = 0; + } + into_result(status, || actual) + } + + /// Close half of the socket, so attempts by the other side to write will fail. + /// + /// Implements the `ZX_SOCKET_HALF_CLOSE` option of + /// [zx_socket_write](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/socket_write.md). + pub fn half_close(&self) -> Result<(), Status> { + let status = unsafe { sys::zx_socket_write(self.raw_handle(), sys::ZX_SOCKET_HALF_CLOSE, + ptr::null(), 0, ptr::null_mut()) }; + into_result(status, || ()) + } + + pub fn outstanding_read_bytes(&self) -> Result { + let mut outstanding = 0; + let status = unsafe { + sys::zx_socket_read(self.raw_handle(), 0, ptr::null_mut(), 0, &mut outstanding) + }; + into_result(status, || outstanding) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn socket_basic() { + let (s1, s2) = Socket::create(SocketOpts::Default).unwrap(); + + // Write in one end and read it back out the other. + assert_eq!(s1.write(SocketWriteOpts::Default, b"hello").unwrap(), 5); + + let mut read_vec = vec![0; 8]; + assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec).unwrap(), 5); + assert_eq!(&read_vec[0..5], b"hello"); + + // Try reading when there is nothing to read. + assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrShouldWait)); + + // Close the socket from one end. + assert!(s1.half_close().is_ok()); + assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrBadState)); + assert_eq!(s1.write(SocketWriteOpts::Default, b"fail"), Err(Status::ErrBadState)); + + // Writing in the other direction should still work. + assert_eq!(s1.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrShouldWait)); + assert_eq!(s2.write(SocketWriteOpts::Default, b"back").unwrap(), 4); + assert_eq!(s1.read(SocketReadOpts::Default, &mut read_vec).unwrap(), 4); + assert_eq!(&read_vec[0..4], b"back"); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/thread.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/thread.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/thread.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/thread.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon thread. + +use {AsHandleRef, HandleBased, Handle, HandleRef}; + +/// An object representing a Zircon thread. +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Thread(Handle); +impl_handle_based!(Thread); \ No newline at end of file diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/timer.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/timer.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/timer.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/timer.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,92 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon timer objects. + +use {AsHandleRef, ClockId, Duration, HandleBased, Handle, HandleRef, Status, Time}; +use {sys, into_result}; + +/// An object representing a Zircon +/// [event pair](https://fuchsia.googlesource.com/zircon/+/master/docs/concepts.md#Other-IPC_Events_Event-Pairs_and-User-Signals). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Timer(Handle); +impl_handle_based!(Timer); + +impl Timer { + /// Create a timer, an object that can signal when a specified point in time has been reached. + /// Wraps the + /// [zx_timer_create](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/timer_create.md) + /// syscall. + pub fn create(options: TimerOpts, clock_id: ClockId) -> Result { + let mut out = 0; + let status = unsafe { sys::zx_timer_create(options as u32, clock_id as u32, &mut out) }; + into_result(status, || Self::from(Handle(out))) + } + + /// Start a one-shot timer that will fire when `deadline` passes. Wraps the + /// [zx_timer_set](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/timer_set.md) + /// syscall. + pub fn set(&self, deadline: Time, slack: Duration) -> Result<(), Status> { + let status = unsafe { sys::zx_timer_set(self.raw_handle(), deadline, slack) }; + into_result(status, || ()) + } + + /// Cancels a pending timer that was started with start(). Wraps the + /// [zx_timer_cancel](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/timer_cancel.md) + /// syscall. + pub fn cancel(&self) -> Result<(), Status> { + let status = unsafe { sys::zx_timer_cancel(self.raw_handle()) }; + into_result(status, || ()) + } +} + +/// Options for creating a timer. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum TimerOpts { + /// Default options. + Default = 0, +} + +impl Default for TimerOpts { + fn default() -> Self { + TimerOpts::Default + } +} + +#[cfg(test)] +mod tests { + use super::*; + use {Duration, ZX_SIGNAL_LAST_HANDLE, ZX_TIMER_SIGNALED}; + use deadline_after; + + #[test] + fn create_timer_invalid_clock() { + assert_eq!(Timer::create(TimerOpts::Default, ClockId::UTC).unwrap_err(), Status::ErrInvalidArgs); + assert_eq!(Timer::create(TimerOpts::Default, ClockId::Thread), Err(Status::ErrInvalidArgs)); + } + + #[test] + fn timer_basic() { + let ten_ms: Duration = 10_000_000; + let twenty_ms: Duration = 20_000_000; + + // Create a timer + let timer = Timer::create(TimerOpts::Default, ClockId::Monotonic).unwrap(); + + // Should not signal yet. + assert_eq!(timer.wait_handle(ZX_TIMER_SIGNALED, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + + // Set it, and soon it should signal. + assert_eq!(timer.set(ten_ms, 0), Ok(())); + assert_eq!(timer.wait_handle(ZX_TIMER_SIGNALED, deadline_after(twenty_ms)).unwrap(), + ZX_TIMER_SIGNALED | ZX_SIGNAL_LAST_HANDLE); + + // Cancel it, and it should stop signalling. + assert_eq!(timer.cancel(), Ok(())); + assert_eq!(timer.wait_handle(ZX_TIMER_SIGNALED, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/src/vmo.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/vmo.rs --- distinst-0.1.0/vendor/fuchsia-zircon/src/vmo.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/src/vmo.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,273 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Type-safe bindings for Zircon vmo objects. + +use {AsHandleRef, Cookied, HandleBased, Handle, HandleRef, Status}; +use {sys, into_result}; +use std::{mem, ptr}; + +/// An object representing a Zircon +/// [virtual memory object](https://fuchsia.googlesource.com/zircon/+/master/docs/objects/vm_object.md). +/// +/// As essentially a subtype of `Handle`, it can be freely interconverted. +#[derive(Debug, Eq, PartialEq)] +pub struct Vmo(Handle); +impl_handle_based!(Vmo); +impl Cookied for Vmo {} + +impl Vmo { + /// Create a virtual memory object. + /// + /// Wraps the + /// `zx_vmo_create` + /// syscall. See the + /// [Shared Memory: Virtual Memory Objects (VMOs)](https://fuchsia.googlesource.com/zircon/+/master/docs/concepts.md#Shared-Memory_Virtual-Memory-Objects-VMOs) + /// for more information. + pub fn create(size: u64, options: VmoOpts) -> Result { + let mut handle = 0; + let status = unsafe { sys::zx_vmo_create(size, options as u32, &mut handle) }; + into_result(status, || + Vmo::from(Handle(handle))) + } + + /// Read from a virtual memory object. + /// + /// Wraps the `zx_vmo_read` syscall. + pub fn read(&self, data: &mut [u8], offset: u64) -> Result { + unsafe { + let mut actual = 0; + let status = sys::zx_vmo_read(self.raw_handle(), data.as_mut_ptr(), + offset, data.len(), &mut actual); + into_result(status, || actual) + } + } + + /// Write to a virtual memory object. + /// + /// Wraps the `zx_vmo_write` syscall. + pub fn write(&self, data: &[u8], offset: u64) -> Result { + unsafe { + let mut actual = 0; + let status = sys::zx_vmo_write(self.raw_handle(), data.as_ptr(), + offset, data.len(), &mut actual); + into_result(status, || actual) + } + } + + /// Get the size of a virtual memory object. + /// + /// Wraps the `zx_vmo_get_size` syscall. + pub fn get_size(&self) -> Result { + let mut size = 0; + let status = unsafe { sys::zx_vmo_get_size(self.raw_handle(), &mut size) }; + into_result(status, || size) + } + + /// Attempt to change the size of a virtual memory object. + /// + /// Wraps the `zx_vmo_set_size` syscall. + pub fn set_size(&self, size: u64) -> Result<(), Status> { + let status = unsafe { sys::zx_vmo_set_size(self.raw_handle(), size) }; + into_result(status, || ()) + } + + /// Perform an operation on a range of a virtual memory object. + /// + /// Wraps the + /// [zx_vmo_op_range](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/vmo_op_range.md) + /// syscall. + pub fn op_range(&self, op: VmoOp, offset: u64, size: u64) -> Result<(), Status> { + let status = unsafe { + sys::zx_vmo_op_range(self.raw_handle(), op as u32, offset, size, ptr::null_mut(), 0) + }; + into_result(status, || ()) + } + + /// Look up a list of physical addresses corresponding to the pages held by the VMO from + /// `offset` to `offset`+`size`, and store them in `buffer`. + /// + /// Wraps the + /// [zx_vmo_op_range](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/vmo_op_range.md) + /// syscall with ZX_VMO_OP_LOOKUP. + pub fn lookup(&self, offset: u64, size: u64, buffer: &mut [sys::zx_paddr_t]) + -> Result<(), Status> + { + let status = unsafe { + sys::zx_vmo_op_range(self.raw_handle(), sys::ZX_VMO_OP_LOOKUP, offset, size, + buffer.as_mut_ptr() as *mut u8, buffer.len() * mem::size_of::()) + }; + into_result(status, || ()) + } + + /// Create a new virtual memory object that clones a range of this one. + /// + /// Wraps the + /// [zx_vmo_clone](https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/vmo_clone.md) + /// syscall. + pub fn clone(&self, options: VmoCloneOpts, offset: u64, size: u64) -> Result { + let mut out = 0; + let status = unsafe { + sys::zx_vmo_clone(self.raw_handle(), options as u32, offset, size, &mut out) + }; + into_result(status, || Vmo::from(Handle(out))) + } +} + +/// Options for creating virtual memory objects. None supported yet. +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum VmoOpts { + /// Default options. + Default = 0, +} + +impl Default for VmoOpts { + fn default() -> Self { + VmoOpts::Default + } +} + +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum VmoOp { + /// Commit `size` bytes worth of pages starting at byte `offset` for the VMO. + Commit = sys::ZX_VMO_OP_COMMIT, + /// Release a range of pages previously committed to the VMO from `offset` to `offset`+`size`. + Decommit = sys::ZX_VMO_OP_DECOMMIT, + // Presently unsupported. + Lock = sys::ZX_VMO_OP_LOCK, + // Presently unsupported. + Unlock = sys::ZX_VMO_OP_UNLOCK, + /// Perform a cache sync operation. + CacheSync = sys::ZX_VMO_OP_CACHE_SYNC, + /// Perform a cache invalidation operation. + CacheInvalidate = sys::ZX_VMO_OP_CACHE_INVALIDATE, + /// Perform a cache clean operation. + CacheClean = sys::ZX_VMO_OP_CACHE_CLEAN, + /// Perform cache clean and invalidation operations together. + CacheCleanInvalidate = sys::ZX_VMO_OP_CACHE_CLEAN_INVALIDATE, +} + +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum VmoCloneOpts { + /// Create a copy-on-write clone. + CopyOnWrite = sys::ZX_VMO_CLONE_COPY_ON_WRITE, +} + +impl Default for VmoCloneOpts { + fn default() -> Self { + VmoCloneOpts::CopyOnWrite + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn vmo_get_size() { + let size = 16 * 1024 * 1024; + let vmo = Vmo::create(size, VmoOpts::Default).unwrap(); + assert_eq!(size, vmo.get_size().unwrap()); + } + + #[test] + fn vmo_set_size() { + let start_size = 12; + let vmo = Vmo::create(start_size, VmoOpts::Default).unwrap(); + assert_eq!(start_size, vmo.get_size().unwrap()); + + // Change the size and make sure the new size is reported + let new_size = 23; + assert!(vmo.set_size(new_size).is_ok()); + assert_eq!(new_size, vmo.get_size().unwrap()); + } + + #[test] + fn vmo_read_write() { + let mut vec1 = vec![0; 16]; + let vmo = Vmo::create(vec1.len() as u64, VmoOpts::Default).unwrap(); + assert_eq!(vmo.write(b"abcdef", 0), Ok(6)); + assert_eq!(16, vmo.read(&mut vec1, 0).unwrap()); + assert_eq!(b"abcdef", &vec1[0..6]); + assert_eq!(vmo.write(b"123", 2), Ok(3)); + assert_eq!(16, vmo.read(&mut vec1, 0).unwrap()); + assert_eq!(b"ab123f", &vec1[0..6]); + assert_eq!(15, vmo.read(&mut vec1, 1).unwrap()); + assert_eq!(b"b123f", &vec1[0..5]); + } + + #[test] + fn vmo_op_range_unsupported() { + let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); + assert_eq!(vmo.op_range(VmoOp::Lock, 0, 1), Err(Status::ErrNotSupported)); + assert_eq!(vmo.op_range(VmoOp::Unlock, 0, 1), Err(Status::ErrNotSupported)); + } + + #[test] + fn vmo_lookup() { + let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); + let mut buffer = vec![0; 2]; + + // Lookup will fail as it is not committed yet. + assert_eq!(vmo.lookup(0, 12, &mut buffer), Err(Status::ErrNoMemory)); + + // Commit and try again. + assert_eq!(vmo.op_range(VmoOp::Commit, 0, 12), Ok(())); + assert_eq!(vmo.lookup(0, 12, &mut buffer), Ok(())); + assert_ne!(buffer[0], 0); + assert_eq!(buffer[1], 0); + + // If we decommit then lookup should go back to failing. + assert_eq!(vmo.op_range(VmoOp::Decommit, 0, 12), Ok(())); + assert_eq!(vmo.lookup(0, 12, &mut buffer), Err(Status::ErrNoMemory)); + } + + #[test] + fn vmo_cache() { + let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); + + // Cache operations should all succeed. + assert_eq!(vmo.op_range(VmoOp::CacheSync, 0, 12), Ok(())); + assert_eq!(vmo.op_range(VmoOp::CacheInvalidate, 0, 12), Ok(())); + assert_eq!(vmo.op_range(VmoOp::CacheClean, 0, 12), Ok(())); + assert_eq!(vmo.op_range(VmoOp::CacheCleanInvalidate, 0, 12), Ok(())); + } + + #[test] + fn vmo_clone() { + let original = Vmo::create(12, VmoOpts::Default).unwrap(); + assert_eq!(original.write(b"one", 0), Ok(3)); + + // Clone the VMO, and make sure it contains what we expect. + let clone = original.clone(VmoCloneOpts::CopyOnWrite, 0, 10).unwrap(); + let mut read_buffer = vec![0; 16]; + assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); + assert_eq!(&read_buffer[0..3], b"one"); + + // Writing to the original will affect the clone too, surprisingly. + assert_eq!(original.write(b"two", 0), Ok(3)); + assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); + assert_eq!(&read_buffer[0..3], b"two"); + assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); + assert_eq!(&read_buffer[0..3], b"two"); + + // However, writing to the clone will not affect the original + assert_eq!(clone.write(b"three", 0), Ok(5)); + assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); + assert_eq!(&read_buffer[0..3], b"two"); + assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); + assert_eq!(&read_buffer[0..5], b"three"); + + // And now that the copy-on-write has happened, writing to the original will not affect the + // clone. How bizarre. + assert_eq!(original.write(b"four", 0), Ok(4)); + assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); + assert_eq!(&read_buffer[0..4], b"four"); + assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); + assert_eq!(&read_buffer[0..5], b"three"); + } +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/tools/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/BUILD.gn --- distinst-0.1.0/vendor/fuchsia-zircon/tools/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/BUILD.gn 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,51 @@ +# Copyright 2017 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("clang_wrapper") { + deps = [ + ":arm64_wrapper", + ":x64_wrapper", + ] +} + +executable("clang_wrapper_bin") { + output_name = "rust_clang_wrapper" + + sources = [ + "clang_wrapper.cc", + ] + + if (is_linux) { + ldflags = [ + "-pthread", + ] + } +} + +template("copy_wrapper") { + + arch = invoker.arch + + copy(target_name) { + sources = [ + "$root_out_dir/rust_clang_wrapper", + ] + + outputs = [ + "$root_out_dir/$arch-unknown-fuchsia-cc", + ] + + deps = [ + ":clang_wrapper_bin", + ] + } +} + +copy_wrapper("arm64_wrapper") { + arch = "aarch64" +} + +copy_wrapper("x64_wrapper") { + arch = "x86_64" +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/tools/clang_wrapper.cc distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/clang_wrapper.cc --- distinst-0.1.0/vendor/fuchsia-zircon/tools/clang_wrapper.cc 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/clang_wrapper.cc 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,205 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Wrap the clang toolchain to supply triple-specific configuration parameters +// as arguments. + +// Gnu-style toolchains encode the target triple in the executable name (each +// executable is specialized to a single triple), and each toolchain also knows +// how to find the corresponding sysroot. By contrast, clang uses a single +// binary, and the target is specified as a command line argument. In addition, +// in the Fuchsia world, the sysroot is not bundled with the compiler. +// +// This wrapper infers the relevant configuration parameters from the command +// name used to invoke the wrapper, and also finds the sysroot at a known +// location relative to the jiri root, then invokes clang with the additional +// arguments. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::map; +using std::string; +using std::vector; + +// Get the real path of this executable, resolving symbolic links. +string GetPath(const char* argv0) { + char* path_c = realpath(argv0, nullptr); + string path = string(path_c); + free(path_c); + return path; +} + +// Return path of Jiri root, or empty string if not found. +string FindJiriRoot(const string& self_path) { + string path = self_path; + while (true) { + size_t pos = path.rfind('/'); + if (pos == string::npos) { + return ""; + } + string basedir = path.substr(0, pos + 1); + string trial = basedir + ".jiri_root"; + struct stat stat_buf; + int status = stat(trial.c_str(), &stat_buf); + if (status == 0) { + return basedir; + } + path = path.substr(0, pos); + } +} + +// Get the basename of the command used to invoke this wrapper. +// Typical return value: "x86-64-unknown-fuchsia-cc" +string GetCmd(const char* argv0) { + string cmd = argv0; + size_t pos = cmd.rfind('/'); + if (pos != string::npos) { + cmd = cmd.substr(pos + 1); + } + return cmd; +} + +// Given the command basename, get the llvm target triple. Empty string on failure. +// Typical return value: "x86_64-unknown-fuchsia" +string TargetTriple(const string& cmd) { + size_t pos = cmd.rfind('-'); + if (pos == string::npos) { + return ""; + } + string triple = cmd.substr(0, pos); + if (triple.find("x86-64") == 0) { + triple[3] = '_'; + } + return triple; +} + +// Given the path to the command, calculate the matching sysroot +string SysrootPath(const string& triple, const string& self_path) { + const string out_dir_name = "out/"; + size_t pos = self_path.find(out_dir_name); + if (pos != string::npos) { + string out_path = self_path.substr(0, pos + out_dir_name.length()); + string zircon_name = triple == "x86_64-unknown-fuchsia" ? + "build-zircon-pc-x86-64" : "build-zircon-qemu-arm64"; + string sysroot_path = out_path + "build-zircon/" + zircon_name + "/sysroot"; + struct stat stat_buf; + int status = stat(sysroot_path.c_str(), &stat_buf); + if (status == 0) { + return sysroot_path; + } + } + return ""; +} + +// Detect the host, get the host identifier (used to select a prebuilt toolchain). +// Empty string on failure. +// Typical return value: "mac-x64" +string HostDouble() { + struct utsname name; + int status = uname(&name); + if (status != 0) { + return ""; + } + map cpumap = { + {"aarch64", "arm64"}, + {"x86_64", "x64"} + }; + map osmap = { + {"Linux", "linux"}, + {"Darwin", "mac"} + }; + return osmap[name.sysname] + "-" + cpumap[name.machine]; +} + +// Given the command baseline, get the llvm binary to invoke. +// Note: the "llvm-ar" special case should probably go away, as Rust no longer +// invokes an external "ar" tool, and the llvm-ar one probably wouldn't work. +// Typical return value: "clang" +string InferTool(const string& cmd) { + size_t pos = cmd.rfind('-'); + string base; + if (pos != string::npos) { + base = cmd.substr(pos + 1); + } else { + base = cmd; + } + if (base == "cc" || base == "gcc") { + return "clang"; + } else if (base == "ar") { + return "llvm-ar"; + } + return base; +} + +// Collect C-style argc/argv into a vector of strings. +vector CollectArgs(int argc, char** argv) { + vector result; + for (int i = 0; i < argc; i++) { + result.push_back(argv[i]); + } + return result; +} + +// Do "execv" given command path as a string and args as a vector of strings. +int DoExecv(const string& cmd, vector& args) { + vector argvec; + for (auto& it : args) { + argvec.push_back(it.c_str()); + } + argvec.push_back(nullptr); + char* const* argv = const_cast(argvec.data()); + return execv(cmd.c_str(), argv); +} + +void Die(const string& message) { + std::cerr << message << std::endl; + exit(1); +} + +int main(int argc, char** argv) { + string self_path = GetPath(argv[0]); + string root = FindJiriRoot(self_path); + if (root.empty()) { + Die("Can't find .jiri_root in any parent of " + self_path); + } + string host = HostDouble(); + if (host.empty()) { + Die("Can't detect host (uname failed)"); + } + string cmd = GetCmd(argv[0]); + string tool = InferTool(cmd); + string triple = TargetTriple(cmd); + vector args = CollectArgs(argc, argv); + + string newcmd = root + "buildtools/" + host + "/clang/bin/" + tool; + string sysroot = SysrootPath(triple, self_path); + if (sysroot.empty()) { + Die("Can't find sysroot from wrapper path"); + } + vector newargs; + newargs.push_back(newcmd); + if (tool != "llvm-ar") { + newargs.push_back("-target"); + newargs.push_back(triple); + newargs.push_back("--sysroot=" + sysroot); + } + for (auto it = args.begin() + 1; it != args.end(); ++it) { + newargs.push_back(*it); + } + int status = DoExecv(newcmd, newargs); + if (status != 0) { + Die("error invoking " + newcmd + ": " + strerror(errno)); + } + return 0; +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/tools/gen_status.py distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/gen_status.py --- distinst-0.1.0/vendor/fuchsia-zircon/tools/gen_status.py 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/gen_status.py 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# Copyright 2016 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# A tool for autogenerating the mapping between Status and zx_status_t +# Usage: python gen_status.py zircon/system/public/zircon/errors.h {sys,enum,match} +import re +import sys + +status_re = re.compile('#define\s+(ZX_\w+)\s+\((\-?\d+)\)$') + +def parse(in_filename): + result = [] + for line in file(in_filename): + m = status_re.match(line) + if m: + result.append((m.group(1), int(m.group(2)))) + return result + +def to_snake_case(name): + result = [] + for element in name.split('_'): + result.append(element[0] + element[1:].lower()) + return ''.join(result) + +def out(style, l): + print('// Auto-generated using tools/gen_status.py') + longest = max(len(name) for (name, num) in l) + if style == 'sys': + for (name, num) in l: + print('pub const %s : zx_status_t = %d;' % (name.ljust(longest), num)) + if style == 'enum': + print('pub enum Status {') + for (name, num) in l: + print(' %s = %d,' % (to_snake_case(name[3:]), num)) + print(''); + print(' /// Any zx_status_t not in the set above will map to the following:') + print(' UnknownOther = -32768,') + print('}') + if style == 'match': + for (name, num) in l: + print(' sys::%s => Status::%s,' % (name, to_snake_case(name[3:]))) + print(' _ => Status::UnknownOther,') + + +l = parse(sys.argv[1]) +out(sys.argv[2], l) diff -Nru distinst-0.1.0/vendor/fuchsia-zircon/tools/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/README.md --- distinst-0.1.0/vendor/fuchsia-zircon/tools/README.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon/tools/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,26 @@ +Build tools for Rust on Fuchsia +=============================== + +This directory contains a wrapper so that clang can be invoked using a +target-specific command line (as is typically done using Gnu tools for +cross-compiling). + +To compile standalone (not part of a build system): + +``` +clang++ -O --std=c++11 clang_wrapper.cc -o clang_wrapper +ln -s clang_wrapper x86-64-unknown-fuchsia-ar +ln -s clang_wrapper x86-64-unknown-fuchsia-cc +ln -s clang_wrapper aarch64-unknown-fuchsia-ar +ln -s clang_wrapper aarch64-unknown-fuchsia-cc +``` + +The resulting binaries (`x86-64-unknown-fuchsia-cc` and the like) must be +placed somewhere under the root of the fuchsia tree. + +The wrapper sets the target triple appropriately, and also finds the +appropriate sysroot for the given target (necessary for linking). + +Note: this wrapper is provisional, hopefully to be supplanted by a more +general config mechanism in LLVM +(see [relevant LLVM patch](https://reviews.llvm.org/D24933)). diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/BUILD.gn --- distinst-0.1.0/vendor/fuchsia-zircon-sys/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/BUILD.gn 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,11 @@ +# Copyright 2017 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/rust/rust_library.gni") + +rust_library("fuchsia-zircon-sys") { + deps = [ + "//third_party/rust-crates:bitflags-0.7.0", + ] +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/.cargo-checksum.json --- distinst-0.1.0/vendor/fuchsia-zircon-sys/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +{"files":{"BUILD.gn":"862eccf06f706db5af1e0041b10b6b637dbc77257b6c4f536a72fc7d21d3dfb9","Cargo.toml":"d05607413136805977463d1c2b979e7692ea1ac06e051d598de440c64603e886","examples/hello.rs":"66c6a147b98b913fef8e7a7da6387fb735f7f1e2c00abc8794a32a8cf0320851","src/definitions.rs":"0b13b741cad9ba42c1da5b654c6d60f03183a7c79a5843e7734a95b4f934d81f","src/lib.rs":"83c8b96c64b442d72a7b87455f182e6ffef6bf2cd7aa2c0c88db992ac9060bda"},"package":"43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/Cargo.toml --- distinst-0.1.0/vendor/fuchsia-zircon-sys/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,21 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "fuchsia-zircon-sys" +version = "0.2.0" +authors = ["Raph Levien "] +description = "Low-level Rust bindings for the Zircon kernel" +license = "BSD-3-Clause" +repository = "https://fuchsia.googlesource.com/garnet/" +[dependencies.bitflags] +version = "0.7.0" diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/examples/hello.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/examples/hello.rs --- distinst-0.1.0/vendor/fuchsia-zircon-sys/examples/hello.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/examples/hello.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +extern crate fuchsia_zircon_sys as zircon_sys; + +pub fn main() { + let time = unsafe { zircon_sys::zx_time_get(zircon_sys::ZX_CLOCK_MONOTONIC) }; + println!("before sleep, time = {}", time); + unsafe { zircon_sys::zx_nanosleep(zircon_sys::zx_deadline_after(1000_000_000)); } + let time = unsafe { zircon_sys::zx_time_get(zircon_sys::ZX_CLOCK_MONOTONIC) }; + println!("after sleep, time = {}", time); +} + diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/src/definitions.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/src/definitions.rs --- distinst-0.1.0/vendor/fuchsia-zircon-sys/src/definitions.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/src/definitions.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,903 @@ +// Copyright 2017 The Fuchsia Authors. All rights reserved. +// This is a GENERATED file, see //zircon/system/host/sysgen. +// The license governing this file can be found in the LICENSE file. + +#[link(name = "zircon")] +extern { + pub fn zx_time_get( + clock_id: u32 + ) -> zx_time_t; + + pub fn zx_nanosleep( + deadline: zx_time_t + ) -> zx_status_t; + + pub fn zx_ticks_get( + ) -> u64; + + pub fn zx_ticks_per_second( + ) -> u64; + + pub fn zx_deadline_after( + nanoseconds: zx_duration_t + ) -> zx_time_t; + + pub fn zx_clock_adjust( + handle: zx_handle_t, + clock_id: u32, + offset: i64 + ) -> zx_status_t; + + pub fn zx_system_get_num_cpus( + ) -> u32; + + pub fn zx_system_get_version( + version: *mut u8, + version_len: u32 + ) -> zx_status_t; + + pub fn zx_system_get_physmem( + ) -> u64; + + pub fn zx_cache_flush( + addr: *const u8, + len: usize, + options: u32 + ) -> zx_status_t; + + pub fn zx_handle_close( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_handle_duplicate( + handle: zx_handle_t, + rights: zx_rights_t, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_handle_replace( + handle: zx_handle_t, + rights: zx_rights_t, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_object_wait_one( + handle: zx_handle_t, + waitfor: zx_signals_t, + deadline: zx_time_t, + observed: *mut zx_signals_t + ) -> zx_status_t; + + pub fn zx_object_wait_many( + items: *mut zx_wait_item_t, + count: u32, + deadline: zx_time_t + ) -> zx_status_t; + + pub fn zx_object_wait_async( + handle: zx_handle_t, + port_handle: zx_handle_t, + key: u64, + signals: zx_signals_t, + options: u32 + ) -> zx_status_t; + + pub fn zx_object_signal( + handle: zx_handle_t, + clear_mask: u32, + set_mask: u32 + ) -> zx_status_t; + + pub fn zx_object_signal_peer( + handle: zx_handle_t, + clear_mask: u32, + set_mask: u32 + ) -> zx_status_t; + + pub fn zx_object_get_property( + handle: zx_handle_t, + property: u32, + value: *mut u8, + size: usize + ) -> zx_status_t; + + pub fn zx_object_set_property( + handle: zx_handle_t, + property: u32, + value: *const u8, + size: usize + ) -> zx_status_t; + + pub fn zx_object_set_cookie( + handle: zx_handle_t, + scope: zx_handle_t, + cookie: u64 + ) -> zx_status_t; + + pub fn zx_object_get_cookie( + handle: zx_handle_t, + scope: zx_handle_t, + cookie: *mut u64 + ) -> zx_status_t; + + pub fn zx_object_get_info( + handle: zx_handle_t, + topic: u32, + buffer: *mut u8, + buffer_size: usize, + actual_count: *mut usize, + avail_count: *mut usize + ) -> zx_status_t; + + pub fn zx_object_get_child( + handle: zx_handle_t, + koid: u64, + rights: zx_rights_t, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_channel_create( + options: u32, + out0: *mut zx_handle_t, + out1: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_channel_read( + handle: zx_handle_t, + options: u32, + bytes: *mut u8, + handles: *mut zx_handle_t, + num_bytes: u32, + num_handles: u32, + actual_bytes: *mut u32, + actual_handles: *mut u32 + ) -> zx_status_t; + + pub fn zx_channel_write( + handle: zx_handle_t, + options: u32, + bytes: *const u8, + num_bytes: u32, + handles: *const zx_handle_t, + num_handles: u32 + ) -> zx_status_t; + + pub fn zx_channel_call_noretry( + handle: zx_handle_t, + options: u32, + deadline: zx_time_t, + args: *const zx_channel_call_args_t, + actual_bytes: *mut u32, + actual_handles: *mut u32, + read_status: *mut zx_status_t + ) -> zx_status_t; + + pub fn zx_channel_call_finish( + deadline: zx_time_t, + args: *const zx_channel_call_args_t, + actual_bytes: *mut u32, + actual_handles: *mut u32, + read_status: *mut zx_status_t + ) -> zx_status_t; + + pub fn zx_channel_call( + handle: zx_handle_t, + options: u32, + deadline: zx_time_t, + args: *const zx_channel_call_args_t, + actual_bytes: *mut u32, + actual_handles: *mut u32, + read_status: *mut zx_status_t + ) -> zx_status_t; + + pub fn zx_socket_create( + options: u32, + out0: *mut zx_handle_t, + out1: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_socket_write( + handle: zx_handle_t, + options: u32, + buffer: *const u8, + size: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_socket_read( + handle: zx_handle_t, + options: u32, + buffer: *mut u8, + size: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_thread_exit( + ); + + pub fn zx_thread_create( + process: zx_handle_t, + name: *const u8, + name_len: u32, + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_thread_start( + handle: zx_handle_t, + thread_entry: usize, + stack: usize, + arg1: usize, + arg2: usize + ) -> zx_status_t; + + pub fn zx_thread_read_state( + handle: zx_handle_t, + kind: u32, + buffer: *mut u8, + len: u32, + actual: *mut u32 + ) -> zx_status_t; + + pub fn zx_thread_write_state( + handle: zx_handle_t, + kind: u32, + buffer: *const u8, + buffer_len: u32 + ) -> zx_status_t; + + pub fn zx_thread_set_priority( + prio: i32 + ) -> zx_status_t; + + pub fn zx_process_exit( + retcode: isize + ); + + pub fn zx_process_create( + job: zx_handle_t, + name: *const u8, + name_len: u32, + options: u32, + proc_handle: *mut zx_handle_t, + vmar_handle: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_process_start( + process_handle: zx_handle_t, + thread_handle: zx_handle_t, + entry: usize, + stack: usize, + arg_handle: zx_handle_t, + arg2: usize + ) -> zx_status_t; + + pub fn zx_process_read_memory( + proc_: zx_handle_t, + vaddr: usize, + buffer: *mut u8, + len: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_process_write_memory( + proc_: zx_handle_t, + vaddr: usize, + buffer: *const u8, + len: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_job_create( + parent_job: zx_handle_t, + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_job_set_policy( + job: zx_handle_t, + options: u32, + topic: u32, + policy: *const u8, + count: u32 + ) -> zx_status_t; + + pub fn zx_task_bind_exception_port( + object: zx_handle_t, + eport: zx_handle_t, + key: u64, + options: u32 + ) -> zx_status_t; + + pub fn zx_task_suspend( + task_handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_task_resume( + task_handle: zx_handle_t, + options: u32 + ) -> zx_status_t; + + pub fn zx_task_kill( + task_handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_event_create( + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_eventpair_create( + options: u32, + out0: *mut zx_handle_t, + out1: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_futex_wait( + value_ptr: *mut zx_futex_t, + current_value: isize, + deadline: zx_time_t + ) -> zx_status_t; + + pub fn zx_futex_wake( + value_ptr: *const zx_futex_t, + count: u32 + ) -> zx_status_t; + + pub fn zx_futex_requeue( + wake_ptr: *mut zx_futex_t, + wake_count: u32, + current_value: isize, + requeue_ptr: *mut zx_futex_t, + requeue_count: u32 + ) -> zx_status_t; + + pub fn zx_port_create( + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_port_queue( + handle: zx_handle_t, + packet: *const u8, + size: usize + ) -> zx_status_t; + + pub fn zx_port_wait( + handle: zx_handle_t, + deadline: zx_time_t, + packet: *mut u8, + size: usize + ) -> zx_status_t; + + pub fn zx_port_cancel( + handle: zx_handle_t, + source: zx_handle_t, + key: u64 + ) -> zx_status_t; + + pub fn zx_timer_create( + options: u32, + clock_id: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_timer_set( + handle: zx_handle_t, + deadline: zx_time_t, + slack: zx_duration_t + ) -> zx_status_t; + + pub fn zx_timer_cancel( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_vmo_create( + size: u64, + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_vmo_read( + handle: zx_handle_t, + data: *mut u8, + offset: u64, + len: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_vmo_write( + handle: zx_handle_t, + data: *const u8, + offset: u64, + len: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_vmo_get_size( + handle: zx_handle_t, + size: *mut u64 + ) -> zx_status_t; + + pub fn zx_vmo_set_size( + handle: zx_handle_t, + size: u64 + ) -> zx_status_t; + + pub fn zx_vmo_op_range( + handle: zx_handle_t, + op: u32, + offset: u64, + size: u64, + buffer: *mut u8, + buffer_size: usize + ) -> zx_status_t; + + pub fn zx_vmo_clone( + handle: zx_handle_t, + options: u32, + offset: u64, + size: u64, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_vmo_set_cache_policy( + handle: zx_handle_t, + cache_policy: u32 + ) -> zx_status_t; + + pub fn zx_vmar_allocate( + parent_vmar_handle: zx_handle_t, + offset: usize, + size: usize, + map_flags: u32, + child_vmar: *mut zx_handle_t, + child_addr: *mut usize + ) -> zx_status_t; + + pub fn zx_vmar_destroy( + vmar_handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_vmar_map( + vmar_handle: zx_handle_t, + vmar_offset: usize, + vmo_handle: zx_handle_t, + vmo_offset: u64, + len: usize, + map_flags: u32, + mapped_addr: *mut usize + ) -> zx_status_t; + + pub fn zx_vmar_unmap( + vmar_handle: zx_handle_t, + addr: usize, + len: usize + ) -> zx_status_t; + + pub fn zx_vmar_protect( + vmar_handle: zx_handle_t, + addr: usize, + len: usize, + prot_flags: u32 + ) -> zx_status_t; + + pub fn zx_vmar_root_self() -> zx_handle_t; + + pub fn zx_cprng_draw( + buffer: *mut u8, + len: usize, + actual: *mut usize + ) -> zx_status_t; + + pub fn zx_cprng_add_entropy( + buffer: *const u8, + len: usize + ) -> zx_status_t; + + pub fn zx_fifo_create( + elem_count: u32, + elem_size: u32, + options: u32, + out0: *mut zx_handle_t, + out1: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_fifo_read( + handle: zx_handle_t, + data: *mut u8, + len: usize, + num_written: *mut u32 + ) -> zx_status_t; + + pub fn zx_fifo_write( + handle: zx_handle_t, + data: *const u8, + len: usize, + num_written: *mut u32 + ) -> zx_status_t; + + pub fn zx_vmar_unmap_handle_close_thread_exit( + vmar_handle: zx_handle_t, + addr: usize, + len: usize, + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_futex_wake_handle_close_thread_exit( + value_ptr: *const zx_futex_t, + count: u32, + new_value: isize, + handle: zx_handle_t + ); + + pub fn zx_log_create( + options: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_log_write( + handle: zx_handle_t, + len: u32, + buffer: *const u8, + options: u32 + ) -> zx_status_t; + + pub fn zx_log_read( + handle: zx_handle_t, + len: u32, + buffer: *mut u8, + options: u32 + ) -> zx_status_t; + + pub fn zx_ktrace_read( + handle: zx_handle_t, + data: *mut u8, + offset: u32, + len: u32, + actual: *mut u32 + ) -> zx_status_t; + + pub fn zx_ktrace_control( + handle: zx_handle_t, + action: u32, + options: u32, + ptr: *mut u8 + ) -> zx_status_t; + + pub fn zx_ktrace_write( + handle: zx_handle_t, + id: u32, + arg0: u32, + arg1: u32 + ) -> zx_status_t; + + pub fn zx_mtrace_control( + handle: zx_handle_t, + kind: u32, + action: u32, + options: u32, + ptr: *mut u8, + size: u32 + ) -> zx_status_t; + + pub fn zx_debug_read( + handle: zx_handle_t, + buffer: *mut u8, + length: u32 + ) -> zx_status_t; + + pub fn zx_debug_write( + buffer: *const u8, + length: u32 + ) -> zx_status_t; + + pub fn zx_debug_send_command( + resource_handle: zx_handle_t, + buffer: *const u8, + length: u32 + ) -> zx_status_t; + + pub fn zx_interrupt_create( + handle: zx_handle_t, + vector: u32, + options: u32, + out_handle: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_interrupt_complete( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_interrupt_wait( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_interrupt_signal( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_mmap_device_io( + handle: zx_handle_t, + io_addr: u32, + len: u32 + ) -> zx_status_t; + + pub fn zx_vmo_create_contiguous( + rsrc_handle: zx_handle_t, + size: usize, + alignment_log2: u32, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_vmo_create_physical( + rsrc_handle: zx_handle_t, + paddr: zx_paddr_t, + size: usize, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_bootloader_fb_get_info( + format: *mut u32, + width: *mut u32, + height: *mut u32, + stride: *mut u32 + ) -> zx_status_t; + + pub fn zx_set_framebuffer( + handle: zx_handle_t, + vaddr: *mut u8, + len: u32, + format: u32, + width: u32, + height: u32, + stride: u32 + ) -> zx_status_t; + + pub fn zx_set_framebuffer_vmo( + handle: zx_handle_t, + vmo: zx_handle_t, + len: u32, + format: u32, + width: u32, + height: u32, + stride: u32 + ) -> zx_status_t; + + pub fn zx_pci_get_nth_device( + handle: zx_handle_t, + index: u32, + out_info: *mut zx_pcie_device_info_t, + out_handle: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_pci_enable_bus_master( + handle: zx_handle_t, + enable: bool + ) -> zx_status_t; + + pub fn zx_pci_enable_pio( + handle: zx_handle_t, + enable: bool + ) -> zx_status_t; + + pub fn zx_pci_reset_device( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_pci_cfg_pio_rw( + handle: zx_handle_t, + bus: u8, + dev: u8, + func: u8, + offset: u8, + val: *mut u32, + width: usize, + write: bool + ) -> zx_status_t; + + pub fn zx_pci_get_bar( + handle: zx_handle_t, + bar_num: u32, + out_bar: *mut zx_pci_resource_t + ) -> zx_status_t; + + pub fn zx_pci_get_config( + handle: zx_handle_t, + out_config: *mut zx_pci_resource_t + ) -> zx_status_t; + + pub fn zx_pci_io_write( + handle: zx_handle_t, + bar_num: u32, + offset: u32, + len: u32, + value: u32 + ) -> zx_status_t; + + pub fn zx_pci_io_read( + handle: zx_handle_t, + bar_num: u32, + offset: u32, + len: u32, + out_value: *mut u32 + ) -> zx_status_t; + + pub fn zx_pci_map_interrupt( + handle: zx_handle_t, + which_irq: i32, + out_handle: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_pci_query_irq_mode_caps( + handle: zx_handle_t, + mode: u32, + out_max_irqs: *mut u32 + ) -> zx_status_t; + + pub fn zx_pci_set_irq_mode( + handle: zx_handle_t, + mode: u32, + requested_irq_count: u32 + ) -> zx_status_t; + + pub fn zx_pci_init( + handle: zx_handle_t, + init_buf: *const zx_pci_init_arg_t, + len: u32 + ) -> zx_status_t; + + pub fn zx_pci_add_subtract_io_range( + handle: zx_handle_t, + mmio: bool, + base: u64, + len: u64, + add: bool + ) -> zx_status_t; + + pub fn zx_acpi_uefi_rsdp( + handle: zx_handle_t + ) -> u64; + + pub fn zx_acpi_cache_flush( + handle: zx_handle_t + ) -> zx_status_t; + + pub fn zx_resource_create( + parent_handle: zx_handle_t, + kind: u32, + low: u64, + high: u64, + resource_out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_guest_create( + resource: zx_handle_t, + options: u32, + physmem_vmo: zx_handle_t, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_guest_set_trap( + guest: zx_handle_t, + kind: u32, + addr: zx_vaddr_t, + len: usize, + fifo: zx_handle_t + ) -> zx_status_t; + + pub fn zx_vcpu_create( + guest: zx_handle_t, + options: u32, + args: *const zx_vcpu_create_args_t, + out: *mut zx_handle_t + ) -> zx_status_t; + + pub fn zx_vcpu_resume( + vcpu: zx_handle_t, + packet: *mut zx_guest_packet_t + ) -> zx_status_t; + + pub fn zx_vcpu_interrupt( + vcpu: zx_handle_t, + vector: u32 + ) -> zx_status_t; + + pub fn zx_vcpu_read_state( + vcpu: zx_handle_t, + kind: u32, + buffer: *mut u8, + len: u32 + ) -> zx_status_t; + + pub fn zx_vcpu_write_state( + vcpu: zx_handle_t, + kind: u32, + buffer: *const u8, + len: u32 + ) -> zx_status_t; + + pub fn zx_system_mexec( + kernel: zx_handle_t, + bootimage: zx_handle_t, + cmdline: *const u8, + cmdline_len: u32 + ) -> zx_status_t; + + pub fn zx_job_set_relative_importance( + root_resource: zx_handle_t, + job: zx_handle_t, + less_important_job: zx_handle_t + ) -> zx_status_t; + + pub fn zx_syscall_test_0( + ) -> zx_status_t; + + pub fn zx_syscall_test_1( + a: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_2( + a: isize, + b: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_3( + a: isize, + b: isize, + c: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_4( + a: isize, + b: isize, + c: isize, + d: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_5( + a: isize, + b: isize, + c: isize, + d: isize, + e: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_6( + a: isize, + b: isize, + c: isize, + d: isize, + e: isize, + f: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_7( + a: isize, + b: isize, + c: isize, + d: isize, + e: isize, + f: isize, + g: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_8( + a: isize, + b: isize, + c: isize, + d: isize, + e: isize, + f: isize, + g: isize, + h: isize + ) -> zx_status_t; + + pub fn zx_syscall_test_wrapper( + a: isize, + b: isize, + c: isize + ) -> zx_status_t; + + +} diff -Nru distinst-0.1.0/vendor/fuchsia-zircon-sys/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/src/lib.rs --- distinst-0.1.0/vendor/fuchsia-zircon-sys/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/fuchsia-zircon-sys/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,460 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#![allow(non_camel_case_types)] + +#[macro_use] +extern crate bitflags; + +use std::{cmp, fmt}; + +pub type zx_handle_t = i32; + +pub type zx_status_t = i32; + +pub type zx_futex_t = isize; +pub type zx_addr_t = usize; +pub type zx_paddr_t = usize; +pub type zx_vaddr_t = usize; +pub type zx_off_t = u64; + +// Auto-generated using tools/gen_status.py +pub const ZX_OK : zx_status_t = 0; +pub const ZX_ERR_INTERNAL : zx_status_t = -1; +pub const ZX_ERR_NOT_SUPPORTED : zx_status_t = -2; +pub const ZX_ERR_NO_RESOURCES : zx_status_t = -3; +pub const ZX_ERR_NO_MEMORY : zx_status_t = -4; +pub const ZX_ERR_CALL_FAILED : zx_status_t = -5; +pub const ZX_ERR_INTERRUPTED_RETRY : zx_status_t = -6; +pub const ZX_ERR_INVALID_ARGS : zx_status_t = -10; +pub const ZX_ERR_BAD_HANDLE : zx_status_t = -11; +pub const ZX_ERR_WRONG_TYPE : zx_status_t = -12; +pub const ZX_ERR_BAD_SYSCALL : zx_status_t = -13; +pub const ZX_ERR_OUT_OF_RANGE : zx_status_t = -14; +pub const ZX_ERR_BUFFER_TOO_SMALL : zx_status_t = -15; +pub const ZX_ERR_BAD_STATE : zx_status_t = -20; +pub const ZX_ERR_TIMED_OUT : zx_status_t = -21; +pub const ZX_ERR_SHOULD_WAIT : zx_status_t = -22; +pub const ZX_ERR_CANCELED : zx_status_t = -23; +pub const ZX_ERR_PEER_CLOSED : zx_status_t = -24; +pub const ZX_ERR_NOT_FOUND : zx_status_t = -25; +pub const ZX_ERR_ALREADY_EXISTS : zx_status_t = -26; +pub const ZX_ERR_ALREADY_BOUND : zx_status_t = -27; +pub const ZX_ERR_UNAVAILABLE : zx_status_t = -28; +pub const ZX_ERR_ACCESS_DENIED : zx_status_t = -30; +pub const ZX_ERR_IO : zx_status_t = -40; +pub const ZX_ERR_IO_REFUSED : zx_status_t = -41; +pub const ZX_ERR_IO_DATA_INTEGRITY : zx_status_t = -42; +pub const ZX_ERR_IO_DATA_LOSS : zx_status_t = -43; +pub const ZX_ERR_BAD_PATH : zx_status_t = -50; +pub const ZX_ERR_NOT_DIR : zx_status_t = -51; +pub const ZX_ERR_NOT_FILE : zx_status_t = -52; +pub const ZX_ERR_FILE_BIG : zx_status_t = -53; +pub const ZX_ERR_NO_SPACE : zx_status_t = -54; +pub const ZX_ERR_STOP : zx_status_t = -60; +pub const ZX_ERR_NEXT : zx_status_t = -61; + +pub type zx_time_t = u64; +pub type zx_duration_t = u64; +pub const ZX_TIME_INFINITE : zx_time_t = ::std::u64::MAX; + +bitflags! { + #[repr(C)] + pub flags zx_signals_t: u32 { + const ZX_SIGNAL_NONE = 0, + const ZX_OBJECT_SIGNAL_ALL = 0x00ffffff, + const ZX_USER_SIGNAL_ALL = 0xff000000, + const ZX_OBJECT_SIGNAL_0 = 1 << 0, + const ZX_OBJECT_SIGNAL_1 = 1 << 1, + const ZX_OBJECT_SIGNAL_2 = 1 << 2, + const ZX_OBJECT_SIGNAL_3 = 1 << 3, + const ZX_OBJECT_SIGNAL_4 = 1 << 4, + const ZX_OBJECT_SIGNAL_5 = 1 << 5, + const ZX_OBJECT_SIGNAL_6 = 1 << 6, + const ZX_OBJECT_SIGNAL_7 = 1 << 7, + const ZX_OBJECT_SIGNAL_8 = 1 << 8, + const ZX_OBJECT_SIGNAL_9 = 1 << 9, + const ZX_OBJECT_SIGNAL_10 = 1 << 10, + const ZX_OBJECT_SIGNAL_11 = 1 << 11, + const ZX_OBJECT_SIGNAL_12 = 1 << 12, + const ZX_OBJECT_SIGNAL_13 = 1 << 13, + const ZX_OBJECT_SIGNAL_14 = 1 << 14, + const ZX_OBJECT_SIGNAL_15 = 1 << 15, + const ZX_OBJECT_SIGNAL_16 = 1 << 16, + const ZX_OBJECT_SIGNAL_17 = 1 << 17, + const ZX_OBJECT_SIGNAL_18 = 1 << 18, + const ZX_OBJECT_SIGNAL_19 = 1 << 19, + const ZX_OBJECT_SIGNAL_20 = 1 << 20, + const ZX_OBJECT_SIGNAL_21 = 1 << 21, + const ZX_OBJECT_LAST_HANDLE = 1 << 22, + const ZX_OBJECT_HANDLE_CLOSED = 1 << 23, + const ZX_USER_SIGNAL_0 = 1 << 24, + const ZX_USER_SIGNAL_1 = 1 << 25, + const ZX_USER_SIGNAL_2 = 1 << 26, + const ZX_USER_SIGNAL_3 = 1 << 27, + const ZX_USER_SIGNAL_4 = 1 << 28, + const ZX_USER_SIGNAL_5 = 1 << 29, + const ZX_USER_SIGNAL_6 = 1 << 30, + const ZX_USER_SIGNAL_7 = 1 << 31, + + const ZX_OBJECT_READABLE = ZX_OBJECT_SIGNAL_0.bits, + const ZX_OBJECT_WRITABLE = ZX_OBJECT_SIGNAL_1.bits, + const ZX_OBJECT_PEER_CLOSED = ZX_OBJECT_SIGNAL_2.bits, + + // Cancelation (handle was closed while waiting with it) + const ZX_SIGNAL_HANDLE_CLOSED = ZX_OBJECT_HANDLE_CLOSED.bits, + + // Only one user-more reference (handle) to the object exists. + const ZX_SIGNAL_LAST_HANDLE = ZX_OBJECT_LAST_HANDLE.bits, + + // Event + const ZX_EVENT_SIGNALED = ZX_OBJECT_SIGNAL_3.bits, + + // EventPair + const ZX_EPAIR_SIGNALED = ZX_OBJECT_SIGNAL_3.bits, + const ZX_EPAIR_CLOSED = ZX_OBJECT_SIGNAL_2.bits, + + // Task signals (process, thread, job) + const ZX_TASK_TERMINATED = ZX_OBJECT_SIGNAL_3.bits, + + // Channel + const ZX_CHANNEL_READABLE = ZX_OBJECT_SIGNAL_0.bits, + const ZX_CHANNEL_WRITABLE = ZX_OBJECT_SIGNAL_1.bits, + const ZX_CHANNEL_PEER_CLOSED = ZX_OBJECT_SIGNAL_2.bits, + + // Socket + const ZX_SOCKET_READABLE = ZX_OBJECT_SIGNAL_0.bits, + const ZX_SOCKET_WRITABLE = ZX_OBJECT_SIGNAL_1.bits, + const ZX_SOCKET_PEER_CLOSED = ZX_OBJECT_SIGNAL_2.bits, + + // Port + const ZX_PORT_READABLE = ZX_OBJECT_READABLE.bits, + + // Resource + const ZX_RESOURCE_DESTROYED = ZX_OBJECT_SIGNAL_3.bits, + const ZX_RESOURCE_READABLE = ZX_OBJECT_READABLE.bits, + const ZX_RESOURCE_WRITABLE = ZX_OBJECT_WRITABLE.bits, + const ZX_RESOURCE_CHILD_ADDED = ZX_OBJECT_SIGNAL_4.bits, + + // Fifo + const ZX_FIFO_READABLE = ZX_OBJECT_READABLE.bits, + const ZX_FIFO_WRITABLE = ZX_OBJECT_WRITABLE.bits, + const ZX_FIFO_PEER_CLOSED = ZX_OBJECT_PEER_CLOSED.bits, + + // Job + const ZX_JOB_NO_PROCESSES = ZX_OBJECT_SIGNAL_3.bits, + const ZX_JOB_NO_JOBS = ZX_OBJECT_SIGNAL_4.bits, + + // Process + const ZX_PROCESS_TERMINATED = ZX_OBJECT_SIGNAL_3.bits, + + // Thread + const ZX_THREAD_TERMINATED = ZX_OBJECT_SIGNAL_3.bits, + + // Log + const ZX_LOG_READABLE = ZX_OBJECT_READABLE.bits, + const ZX_LOG_WRITABLE = ZX_OBJECT_WRITABLE.bits, + + // Timer + const ZX_TIMER_SIGNALED = ZX_OBJECT_SIGNAL_3.bits, + } +} + +pub type zx_size_t = usize; +pub type zx_ssize_t = isize; + +bitflags! { + #[repr(C)] + pub flags zx_rights_t: u32 { + const ZX_RIGHT_NONE = 0, + const ZX_RIGHT_DUPLICATE = 1 << 0, + const ZX_RIGHT_TRANSFER = 1 << 1, + const ZX_RIGHT_READ = 1 << 2, + const ZX_RIGHT_WRITE = 1 << 3, + const ZX_RIGHT_EXECUTE = 1 << 4, + const ZX_RIGHT_MAP = 1 << 5, + const ZX_RIGHT_GET_PROPERTY = 1 << 6, + const ZX_RIGHT_SET_PROPERTY = 1 << 7, + const ZX_RIGHT_DEBUG = 1 << 8, + const ZX_RIGHT_SAME_RIGHTS = 1 << 31, + } +} + +// clock ids +pub const ZX_CLOCK_MONOTONIC: u32 = 0; + +// Buffer size limits on the cprng syscalls +pub const ZX_CPRNG_DRAW_MAX_LEN: usize = 256; +pub const ZX_CPRNG_ADD_ENTROPY_MAX_LEN: usize = 256; + +// Socket flags and limits. +pub const ZX_SOCKET_HALF_CLOSE: u32 = 1; + +// VM Object opcodes +pub const ZX_VMO_OP_COMMIT: u32 = 1; +pub const ZX_VMO_OP_DECOMMIT: u32 = 2; +pub const ZX_VMO_OP_LOCK: u32 = 3; +pub const ZX_VMO_OP_UNLOCK: u32 = 4; +pub const ZX_VMO_OP_LOOKUP: u32 = 5; +pub const ZX_VMO_OP_CACHE_SYNC: u32 = 6; +pub const ZX_VMO_OP_CACHE_INVALIDATE: u32 = 7; +pub const ZX_VMO_OP_CACHE_CLEAN: u32 = 8; +pub const ZX_VMO_OP_CACHE_CLEAN_INVALIDATE: u32 = 9; + +// VM Object clone flags +pub const ZX_VMO_CLONE_COPY_ON_WRITE: u32 = 1; + +// Mapping flags to vmar routines +bitflags! { + #[repr(C)] + pub flags zx_vmar_flags_t: u32 { + // flags to vmar routines + const ZX_VM_FLAG_PERM_READ = 1 << 0, + const ZX_VM_FLAG_PERM_WRITE = 1 << 1, + const ZX_VM_FLAG_PERM_EXECUTE = 1 << 2, + const ZX_VM_FLAG_COMPACT = 1 << 3, + const ZX_VM_FLAG_SPECIFIC = 1 << 4, + const ZX_VM_FLAG_SPECIFIC_OVERWRITE = 1 << 5, + const ZX_VM_FLAG_CAN_MAP_SPECIFIC = 1 << 6, + const ZX_VM_FLAG_CAN_MAP_READ = 1 << 7, + const ZX_VM_FLAG_CAN_MAP_WRITE = 1 << 8, + const ZX_VM_FLAG_CAN_MAP_EXECUTE = 1 << 9, + } +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum zx_cache_policy_t { + ZX_CACHE_POLICY_CACHED = 0, + ZX_CACHE_POLICY_UNCACHED = 1, + ZX_CACHE_POLICY_UNCACHED_DEVICE = 2, + ZX_CACHE_POLICY_WRITE_COMBINING = 3, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_wait_item_t { + pub handle: zx_handle_t, + pub waitfor: zx_signals_t, + pub pending: zx_signals_t, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_waitset_result_t { + pub cookie: u64, + pub status: zx_status_t, + pub observed: zx_signals_t, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_channel_call_args_t { + pub wr_bytes: *const u8, + pub wr_handles: *const zx_handle_t, + pub rd_bytes: *mut u8, + pub rd_handles: *mut zx_handle_t, + pub wr_num_bytes: u32, + pub wr_num_handles: u32, + pub rd_num_bytes: u32, + pub rd_num_handles: u32, +} + +pub type zx_pci_irq_swizzle_lut_t = [[[u32; 4]; 8]; 32]; + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_pci_init_arg_t { + pub dev_pin_to_global_irq: zx_pci_irq_swizzle_lut_t, + pub num_irqs: u32, + pub irqs: [zx_irq_t; 32], + pub ecam_window_count: u32, + // Note: the ecam_windows field is actually a variable size array. + // We use a fixed size array to match the C repr. + pub ecam_windows: [zx_ecam_window_t; 1], +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_irq_t { + pub global_irq: u32, + pub level_triggered: bool, + pub active_high: bool, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_ecam_window_t { + pub base: u64, + pub size: usize, + pub bus_start: u8, + pub bus_end: u8, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_pcie_device_info_t { + pub vendor_id: u16, + pub device_id: u16, + pub base_class: u8, + pub sub_class: u8, + pub program_interface: u8, + pub revision_id: u8, + pub bus_id: u8, + pub dev_id: u8, + pub func_id: u8, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_pci_resource_t { + pub type_: u32, + pub size: usize, + // TODO: Actually a union + pub pio_addr: usize, +} + +// TODO: Actually a union +pub type zx_rrec_t = [u8; 64]; + +// Ports V2 +#[repr(u32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum zx_packet_type_t { + ZX_PKT_TYPE_USER = 0, + ZX_PKT_TYPE_SIGNAL_ONE = 1, + ZX_PKT_TYPE_SIGNAL_REP = 2, +} + +impl Default for zx_packet_type_t { + fn default() -> Self { + zx_packet_type_t::ZX_PKT_TYPE_USER + } +} + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct zx_packet_signal_t { + pub trigger: zx_signals_t, + pub observed: zx_signals_t, + pub count: u64, +} + +pub const ZX_WAIT_ASYNC_ONCE: u32 = 0; +pub const ZX_WAIT_ASYNC_REPEATING: u32 = 1; + +// Actually a union of different integer types, but this should be good enough. +pub type zx_packet_user_t = [u8; 32]; + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Eq, PartialEq)] +pub struct zx_port_packet_t { + pub key: u64, + pub packet_type: zx_packet_type_t, + pub status: i32, + pub union: [u8; 32], +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_guest_io_t { + port: u16, + access_size: u8, + input: bool, + // TODO: Actually a union + data: [u8; 4], +} + +#[cfg(target_arch="aarch64")] +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_guest_memory_t { + addr: zx_vaddr_t, + inst: u32, +} + +pub const X86_MAX_INST_LEN: usize = 15; + +#[cfg(target_arch="x86_64")] +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_guest_memory_t { + addr: zx_vaddr_t, + inst_len: u8, + inst_buf: [u8; X86_MAX_INST_LEN], +} + +#[repr(u8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum zx_guest_packet_t_type { + ZX_GUEST_PKT_MEMORY = 1, + ZX_GUEST_PKT_IO = 2, +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub union zx_guest_packet_t_union { + // ZX_GUEST_PKT_MEMORY + memory: zx_guest_memory_t, + // ZX_GUEST_PKT_IO + io: zx_guest_io_t, +} + +// Note: values of this type must maintain the invariant that +// `packet_type` correctly indicates the type of `contents`. +// Failure to do so will result in unsafety. +#[repr(C)] +#[derive(Copy, Clone)] +pub struct zx_guest_packet_t { + packet_type: zx_guest_packet_t_type, + contents: zx_guest_packet_t_union, +} + +impl fmt::Debug for zx_guest_packet_t { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + write!(f, "zx_guest_packet_t {{ packet_type: {:?}, contents: ", self.packet_type)?; + match self.packet_type { + zx_guest_packet_t_type::ZX_GUEST_PKT_MEMORY => + write!(f, "zx_guest_packet_t_union {{ memory: {:?} }} }}", + unsafe { self.contents.memory } + ), + zx_guest_packet_t_type::ZX_GUEST_PKT_IO => + write!(f, "zx_guest_packet_t_union {{ io: {:?} }} }}", + unsafe { self.contents.io } + ), + } + } +} + +impl cmp::PartialEq for zx_guest_packet_t { + fn eq(&self, other: &Self) -> bool { + (self.packet_type == other.packet_type) && + match self.packet_type { + zx_guest_packet_t_type::ZX_GUEST_PKT_MEMORY => + unsafe { self.contents.memory == other.contents.memory }, + zx_guest_packet_t_type::ZX_GUEST_PKT_IO => + unsafe { self.contents.io == other.contents.io }, + } + } +} + +impl cmp::Eq for zx_guest_packet_t {} + +#[cfg(target_arch="x86_64")] +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_vcpu_create_args_t { + pub ip: zx_vaddr_t, + pub cr3: zx_vaddr_t, + pub apic_vmo: zx_handle_t, +} + +#[cfg(not(target_arch="x86_64"))] +#[repr(C)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct zx_vcpu_create_args_t { + pub ip: zx_vaddr_t, +} + +include!("definitions.rs"); \ No newline at end of file diff -Nru distinst-0.1.0/vendor/kernel32-sys/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/kernel32-sys/.cargo-checksum.json --- distinst-0.1.0/vendor/kernel32-sys/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/kernel32-sys/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"79c920ca9323e28acd5f5a80f2ce0ab81aa6227584397a9f742e78dce36a2117","README.md":"00afb50f0a5a7d548e40feb1f09ce8fa678b46e04c9a72d909fa36fb85fb2200","build.rs":"89e77c6e9e79dcd782fd006431b948d093ec4aeda3b69a280ec857077b7f2020","src/lib.rs":"ab0a8a104a6f747f6389a70d26a62e156ab97cc7c8f4daf1de99b820024da993"},"package":"7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"} \ No newline at end of file +{"files":{"Cargo.toml":"79c920ca9323e28acd5f5a80f2ce0ab81aa6227584397a9f742e78dce36a2117","README.md":"00afb50f0a5a7d548e40feb1f09ce8fa678b46e04c9a72d909fa36fb85fb2200","build.rs":"89e77c6e9e79dcd782fd006431b948d093ec4aeda3b69a280ec857077b7f2020","src/lib.rs":"ab0a8a104a6f747f6389a70d26a62e156ab97cc7c8f4daf1de99b820024da993"},"package":"7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/libc/appveyor.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/appveyor.yml --- distinst-0.1.0/vendor/libc/appveyor.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/appveyor.yml 2017-12-21 19:00:07.000000000 +0000 @@ -25,7 +25,3 @@ test_script: - cargo test --target %TARGET% - cargo test --manifest-path libc-test/Cargo.toml --target %TARGET% - -cache: - - target - - C:\Users\appveyor\.cargo\registry diff -Nru distinst-0.1.0/vendor/libc/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/.cargo-checksum.json --- distinst-0.1.0/vendor/libc/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"33e3da6639246eb3212ea9bd97faef5e79e62e5a3d5f99645c4db09ad2a5765b","Cargo.toml":"f9db49bdc868dfb8cd96896e7d7f3cdd3bb565f8dd771d4ac91fb41817fa4444","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"c8e2baa0e92a1760d9141c9542723e19748f241fd523014b1eee289cd467650b","appveyor.yml":"7e6d9391c542881ed2a471cb80c4be2d1ce9aff313a7b5e432f899bf00e99ecc","ci/README.md":"be804f15e2128e5fd4b160cb0b13cff5f19e7d77b55ec5254aa6fd8731c84f0d","ci/android-accept-licenses.sh":"84ad00815f628005ed22c5d6cd14990ebc97812a7163bd275b2877904eddab53","ci/android-install-ndk.sh":"725db9025c5905849916bf7c910f98ff0e753484397c2a1f836d48a576d10890","ci/android-install-sdk.sh":"891900fe4e4ceb04717b91a253753858270defc6d6401936d08c09801c1de178","ci/android-sysimage.sh":"901415631752827454c827e8c51906ba4260612e4021eda98eb7fff771c7d0e8","ci/docker/aarch64-linux-android/Dockerfile":"65e4a517d4f46b8104ea3e7a322912161dec4c7c1cce1fb0d6ef3ea8ad56c7e2","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"5f430271941e1eecdf9d1a5fb701dd5622e2c4b9da03140fd829bf216e55529d","ci/docker/arm-linux-androideabi/Dockerfile":"3ea1cded5b2950abcd75d59a7ee81ef8c3de66af822c510f787ac7ead0ead4ab","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"dbb025b53b27e406893184290836a50133ecae8295711d5e05b4e41fac9bd262","ci/docker/asmjs-unknown-emscripten/Dockerfile":"0d9aea5119c2cd136cc2c0a578105d91210e45901ac49b17c5e45f458b1c7551","ci/docker/i686-linux-android/Dockerfile":"015b2188c8baacb24eeba7cdfbe2852134a0f43d99feb859657cebce6a4959b1","ci/docker/i686-unknown-linux-gnu/Dockerfile":"c3ba1da87558ba31889a60742b938f4162c17383929da6a8d8fbcf0bbfa9dcb7","ci/docker/i686-unknown-linux-musl/Dockerfile":"4ac86fe9e159d454616396a9f3f07ce0f5d99cc4b49898b8d2486e6bdbfed9e9","ci/docker/mips-unknown-linux-gnu/Dockerfile":"6d2a9daa299003497c1d441d07b69f730ad75ee49f34520f959b5158e60072e0","ci/docker/mips-unknown-linux-musl/Dockerfile":"f9e198c21b37b930758178a1a923c9478218c49c375b01d805b339b7a458b632","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"7c4d26232f1c1553a6612d9b0b3faac9887e139eaffa025f70d34113dcee812f","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"519c5468e223784809de41292480ffc5d7a141c8abe0457664d38af5f49969f7","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"4b247dcc399395815ec9153c1247cc03d764896c484eddcb196d0bf8650d6311","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"e949717a8ba5e123940729ff47ce1c45989c8b8247c576f1488f698b534e0283","ci/docker/s390x-unknown-linux-gnu/Dockerfile":"63bb605e333b8351ee2366def0cfb77f206c66f43bc2d5d9ca18ee0119fa5672","ci/docker/wasm32-unknown-emscripten/Dockerfile":"bd072d6ae91a9160693e402dd77462d3c9dd0716711e719a62af330ae479eb4e","ci/docker/wasm32-unknown-emscripten/node-wrapper.sh":"6ec19745e08690b7b5d7f882004a8a63b69ac815d66e3f8c5a38d2c3e78b962e","ci/docker/x86_64-linux-android/Dockerfile":"aeeaa540189ca712369c564c9a14cbace63217dadcfaf879a2cb40fbdeb08199","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"e8f9287b267c6058eec42d1bca0007cb9a78a1d244dd8e11088368cb61fb17d6","ci/docker/x86_64-rumprun-netbsd/runtest.rs":"53302e9ed39293c1ec68ab56287593907d4aaf5bac9c1c2857b29f754a71d62b","ci/docker/x86_64-unknown-freebsd/Dockerfile":"ef0f9f63065218728d2daafaa5ba71b17e4ccc23d72e859e0a7133fc64c0815e","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"72e629004d5e1f12ed13056e91ea8a767ff3139b9ba929532a52f2163b12710b","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"e145784741473150473b1bef7cc3c2cf0c6339d4fc480113ac41b4247a9b38ec","ci/dox.sh":"9ea240a4a607036235fd68c01b5d2a59f365768d103d3be774dcf34aa3ff563e","ci/emscripten-entry.sh":"1c1384b4a8b0c055d8095d9d9b2c9dccbdcdb2d5f90fdca34a1976ca8fc379c6","ci/emscripten.sh":"6f66c7b5c3d34a41afc59ceb0a8c3b0880cd6fd9a6344b874ae80bac0639ccb2","ci/ios/deploy_and_run_on_ios_simulator.rs":"3175066fd7f82390f6226d881e1a1dda9767ea2705656870e0d7774e2731800e","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"be83bc5a8b5ef913a7c9941ffca24734716028650c9a876123c4c160672c18de","ci/run-qemu.sh":"bb859421170871ef23a8940c5e150efec0c01b95e32d2ce2d37b79a45d9d346c","ci/run.sh":"60588b98057151522d0717b6e7f1c740b12c88630984a3aaf1b3c768f84ebc2e","ci/runtest-android.rs":"a07ddbdd276aedda7876c7e676774178a60d9aeab95df01275a4ee95f59e3044","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"bb9a85519e0d4a8d3bfb81301759b9b938435d79da9ce2918248fb2b0df19638","src/lib.rs":"d748ddb88f68a78de6b5c7582bd048372882ac43fa7db5b3459ece84871ee0c4","src/macros.rs":"e1b0bf5db89faa8fcb39a3fd46cdb5fdcfabb7f3524eb2192157f0188b8a764b","src/redox.rs":"40b3eb15c9fcbd3b636c8f647d0b83624359f0cc10776db944303ee35c28bfc6","src/unix/bsd/apple/b32.rs":"d107376452f731f5d8a1e6b544bdcaac826c95a383d4b20e2032f115eb9f3256","src/unix/bsd/apple/b64.rs":"ab141ad0c8c58342c06858f6f34b75eef70e58cb58e7375d460a9be6739b5e6a","src/unix/bsd/apple/mod.rs":"62113d95e0fb5463a0410d0ac2cd67c2744e629021af98908bb903a22abf55fa","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"ec88ddec5253b8dba3d56a31d8c12767c5c3e2e471e6467fde642bae868a1193","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/freebsd/mod.rs":"6a1f7dbe5b31eb9038b4e69f90c2597e37138dfb623c35786e8dd8f7ce5c8592","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/mod.rs":"c9895c61e4b01f0b397cbd9d40c977e71774888cad85455bbb23eded85311284","src/unix/bsd/mod.rs":"d76857a17ce882ca2937105c81dd654a54ea22f69f8bb81b614a96f36dbe0bb8","src/unix/bsd/netbsdlike/mod.rs":"1b5519578130b8a525778406b6f51e783e5c8f7e4382503fb0427559967753e6","src/unix/bsd/netbsdlike/netbsd/mod.rs":"1c3c1668258762d28358000a28f68ec0f37688762bcdb373946349c531e354dc","src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/netbsd/other/mod.rs":"4d9f7091af8e166943ac6f42ce85558909e5b6e61325039bff7adfbcf4b90212","src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs":"f8cd05dacd3a3136c58da5a2fbe26f703767823b28e74fe8a2b57a7bd98d6d5c","src/unix/bsd/netbsdlike/openbsdlike/mod.rs":"b1db1069f6c088fb3149e17d700c4f1cb1d969e950044044d9295916c755ec6f","src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs":"302817036aa7e7afbc82248cf66b040ef1edfbcb136c9ad243fe20f98df8d6f8","src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs":"f5d8db6f54efd05520b31b764a6bacbf612e1aebce097d2d5bfaaef3b91f37b5","src/unix/haiku/b32.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/haiku/b64.rs":"b422430c550c0ba833c9206d1350861e344e3a2eb33d7d58693efb35044be1cc","src/unix/haiku/mod.rs":"7a5332562caf7c2d0cc17ad1947505b6ec7c1a887c53332cec0da25e7475d8b5","src/unix/mod.rs":"e7f50e86b7e32c4d4857fc5e05e64bfe9ff9a7b09b543514b22808c6096e9e7f","src/unix/newlib/arm/mod.rs":"2b6dba2e697ab9b4f4bc4dd5f28057249e9b596d1cb395a9322ec87605c4a5c4","src/unix/newlib/mod.rs":"5f10bb7d8d180bdd975f8aa2a4bd05d4d810970c6a7d1251ae46948213867ebc","src/unix/notbsd/android/b32/arm.rs":"a81acfebb008ad7a717539929dd204cfac4f82b2cffbbb665b57686ad692db64","src/unix/notbsd/android/b32/mod.rs":"e9ec6f08e20ea235cd7095604ea6e37c739c1276e9f40fa31a4db4951fa005af","src/unix/notbsd/android/b32/x86.rs":"ae2b7f1d6278caddc007749bb1d09ca33f7593478a0fd7fe98b457dae86c7814","src/unix/notbsd/android/b64/aarch64.rs":"0d8aa97b80f7790baf6f2f43defb5028fbf91cea6564bb28ed114a4e2d68bfbd","src/unix/notbsd/android/b64/mod.rs":"63290adc8122c040f9be369ef4180975bcf1a967a717aa75d30371162d5d5fa9","src/unix/notbsd/android/b64/x86_64.rs":"5547aef8dcbaa5a932559f34606fd8d89f6c9c15173d2b1412c12d39b3c1045f","src/unix/notbsd/android/mod.rs":"c642848963d685f236d57427a4a2be503e286142eca0bede8799c133be56ff1d","src/unix/notbsd/emscripten.rs":"f8d8acf5cef1acd1a6bdd41299054120820865d072c4c2e3c740fbd0c6e9b3e7","src/unix/notbsd/linux/mips/mips32.rs":"121a585f9189b28fff35c7345083dff9cc0f2dd5dadc9fa00f1669399ec7ca24","src/unix/notbsd/linux/mips/mips64.rs":"d3c232e548445eb96da07b262dd5ada4a1305e20b296c452c903803202971c27","src/unix/notbsd/linux/mips/mod.rs":"8ab59f91ac112bc4cf3f616fe4bcdb17869636e2c39f142ede9eab4fba842ebf","src/unix/notbsd/linux/mod.rs":"2508d5cb77c29fc04aa52b27dd2c287e1cfd570385fa753f6ef218aa47c95551","src/unix/notbsd/linux/musl/b32/arm.rs":"16b3aa4be930223cf7c6017ddc935638f8324d35680fa3736702a6eccdc26899","src/unix/notbsd/linux/musl/b32/mips.rs":"b1c198e9076933624de92ff3059283df863ad69aaa200160ac2c9c6a62822bc2","src/unix/notbsd/linux/musl/b32/mod.rs":"2f4d5fb5c0a93e2c572d4e86be06e240e3cd95357dd8b8cee799f0d1de588694","src/unix/notbsd/linux/musl/b32/x86.rs":"b4e8b810d694a12ccb4a9df9896b5a0ed6ebf2a69ff450c3940daa4a2bb60778","src/unix/notbsd/linux/musl/b64/aarch64.rs":"1afb00c4ebb1dfacf2b3b051ffa1ccb248a6645879ec044f0b34688104a3f173","src/unix/notbsd/linux/musl/b64/mod.rs":"3482855b3af80b665846b712ecca92c64aa345de1301f1a02e25fed2a0bf4cb6","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"c5a432d9e8e2c2620d738b123d85934da16c09c1002ce0473464aba638fc3731","src/unix/notbsd/linux/musl/b64/x86_64.rs":"8156abebf9446ed90c007c72e7f0d56f831f26e601e6fe81dc07abbec3ac057d","src/unix/notbsd/linux/musl/mod.rs":"fa917a4023255e9e741553155a89a13300a2cda71489c3f4edbea5698857e9eb","src/unix/notbsd/linux/other/b32/arm.rs":"5164bc8942eb6b58bfaaf77e5b420697bea5dfe0d94072d01cc51c59fe06d053","src/unix/notbsd/linux/other/b32/mod.rs":"2c9ee30b16e469bf9e0248ab3c18cfb263f38ee802570b7fed7a85ccd8df62d7","src/unix/notbsd/linux/other/b32/powerpc.rs":"99a2dd72974d9cd32d2c308f789788c062660b883f723744e0a10db4ef234b57","src/unix/notbsd/linux/other/b32/x86.rs":"7cd050575d8b468070e69555b5e5efeee947edfaa38a2b31a6d38be396cc1214","src/unix/notbsd/linux/other/b64/aarch64.rs":"7e47143b7c06f03d644a98887f0787e48f0db1bc915e5a092f9552c7b1c70713","src/unix/notbsd/linux/other/b64/mod.rs":"c8f8ecbe6ef3edf90ddab38f8449d86f482972fa07aaa82cc9a0f78e8b63b3e2","src/unix/notbsd/linux/other/b64/powerpc64.rs":"63173445e6c463da04aeacc91ef2e83b83695f9c9be31f8634be4cd33a835c70","src/unix/notbsd/linux/other/b64/sparc64.rs":"3d5106c11130af83d022e7b265b18964069f69bbfc56d4c9cf1f449dd4a5e1bb","src/unix/notbsd/linux/other/b64/x86_64.rs":"0193dbc33521074e408360b77a9e30f242c13117138f6882695e07b334f65724","src/unix/notbsd/linux/other/mod.rs":"53a83ca2512f8c34529c6e897c26c7f06b162e3000970992645198e56f8b05bf","src/unix/notbsd/linux/s390x.rs":"5184beecb8180713664e367748050a08fd67970469340d892453f7e629822c07","src/unix/notbsd/mod.rs":"a18d1389ee1cd34752174c451f62e307ec391924d6f70f0993f3dc52de40e871","src/unix/solaris/mod.rs":"9b367b10f736b7d59b63ea4022719229331a9e081c42990d44ad8292052a275d","src/unix/uclibc/mips/mips32.rs":"31b23e466cffb86116421ec9240b86e7419aacd84b0b1b04d23c7142c8717566","src/unix/uclibc/mips/mips64.rs":"e67eec1636a998b047d89a4cda1c99cb6bc3071db017762675179a68201c4438","src/unix/uclibc/mips/mod.rs":"74817a9b1ee3998d8e0b751a555d57225f70fd979c283c94ada344a162a8b856","src/unix/uclibc/mod.rs":"7043abc1b1db74c05a73a59d853c9541c6743641575426c6cc60883e002222f4","src/unix/uclibc/x86_64/l4re.rs":"54b4e58ce5a671348c32bc41c1607dbc5c13fa6818cc3e0e0e2b409c300a305e","src/unix/uclibc/x86_64/mod.rs":"963aedbcf87972d7ac0dd3abf1e795476e13dd80a8382ef9b09c72831fc6a868","src/windows.rs":"6a79e13e727b8c7277ebcc65b390ad5494d70c65b6578cb468c5565a166048d0"},"package":"2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915"} \ No newline at end of file +{"files":{".travis.yml":"d323dad8a4a6a7f88471a3a671478ee56ef1a6b26472358650a0e7597b239c65","Cargo.toml":"3642623f8dc43de106c0f1e53ba38c09a06e709713360ac45ab661bab95527ed","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"00fbfd7e989de6ecc270aed1f1c2c20560ac67e6c1564833622b8e34385c6170","appveyor.yml":"fec0ac820d19c40534301966f82524372e4855e4f61eeec486d42bf850d77f71","ci/README.md":"b8debdd9044a773dbccc85e574eed21008784117d77c24a15f207d4b2a173a14","ci/android-install-ndk.sh":"725db9025c5905849916bf7c910f98ff0e753484397c2a1f836d48a576d10890","ci/android-install-sdk.sh":"5c3fbe402ac611239ac7715a61f247d1c55fa012f33a5be0b0127dfc196965cf","ci/android-sysimage.sh":"901415631752827454c827e8c51906ba4260612e4021eda98eb7fff771c7d0e8","ci/docker/aarch64-linux-android/Dockerfile":"e17945fba1786dfe766006f50e79baf3f4151ca0c0c14ae96f91483bf345afd7","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"5f430271941e1eecdf9d1a5fb701dd5622e2c4b9da03140fd829bf216e55529d","ci/docker/aarch64-unknown-linux-musl/Dockerfile":"3e1cbf0fa728571b9be9769e5a6281c964fa5b26d586265117ccee017ca4022c","ci/docker/arm-linux-androideabi/Dockerfile":"4e0bdc13254f99bd0db195f91331c634050426e3e4a0fcc63ef25ab795fe2d46","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"dbb025b53b27e406893184290836a50133ecae8295711d5e05b4e41fac9bd262","ci/docker/arm-unknown-linux-musleabihf/Dockerfile":"7cb6e0f8fb91c97f142a9c827687bbbc1a5e7643a3081160025d0365593a596c","ci/docker/asmjs-unknown-emscripten/Dockerfile":"0d9aea5119c2cd136cc2c0a578105d91210e45901ac49b17c5e45f458b1c7551","ci/docker/i686-linux-android/Dockerfile":"4e8377ec0bd9ad2df23bf2c5373200a12750dc9f28c4f10bc83a0150fe1623ee","ci/docker/i686-unknown-linux-gnu/Dockerfile":"ca61f403bd3eaec7f3e51165ae7f74cd559a65ce657aed4700d726a2aabea648","ci/docker/i686-unknown-linux-musl/Dockerfile":"4ac86fe9e159d454616396a9f3f07ce0f5d99cc4b49898b8d2486e6bdbfed9e9","ci/docker/mips-unknown-linux-gnu/Dockerfile":"6d2a9daa299003497c1d441d07b69f730ad75ee49f34520f959b5158e60072e0","ci/docker/mips-unknown-linux-musl/Dockerfile":"4773b2656a7dd6a3b106fcb737428436652edf3d1f48181de3f62c16bf5bd49d","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"7c4d26232f1c1553a6612d9b0b3faac9887e139eaffa025f70d34113dcee812f","ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile":"edb4144c07ade1a8bd65272ec1d3672ad794e9e6b7d01197896e159a70175b58","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"0ca9c12b5618c6d2df04ff820d56fb28e05b43e45eaa506480126b03c5072d48","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"4b247dcc399395815ec9153c1247cc03d764896c484eddcb196d0bf8650d6311","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"e949717a8ba5e123940729ff47ce1c45989c8b8247c576f1488f698b534e0283","ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile":"018591017f499414a9f79477e1c39baa6a47f71fce6812fb1868fb0fcdfb8cea","ci/docker/s390x-unknown-linux-gnu/Dockerfile":"63bb605e333b8351ee2366def0cfb77f206c66f43bc2d5d9ca18ee0119fa5672","ci/docker/sparc64-unknown-linux-gnu/Dockerfile":"6eae4d575de47aefc429dfb1957856bc7107fc7456883563acdfb9886154e5bb","ci/docker/wasm32-unknown-emscripten/Dockerfile":"bd072d6ae91a9160693e402dd77462d3c9dd0716711e719a62af330ae479eb4e","ci/docker/wasm32-unknown-emscripten/node-wrapper.sh":"6ec19745e08690b7b5d7f882004a8a63b69ac815d66e3f8c5a38d2c3e78b962e","ci/docker/x86_64-linux-android/Dockerfile":"aeeaa540189ca712369c564c9a14cbace63217dadcfaf879a2cb40fbdeb08199","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"e8f9287b267c6058eec42d1bca0007cb9a78a1d244dd8e11088368cb61fb17d6","ci/docker/x86_64-rumprun-netbsd/runtest.rs":"53302e9ed39293c1ec68ab56287593907d4aaf5bac9c1c2857b29f754a71d62b","ci/docker/x86_64-unknown-freebsd/Dockerfile":"dfc00fa7d5dbb24e6864fb62cdbd48536c14c0be2d40fd02de53d1374e4b760a","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"342e16d6d1dd3c23b735b0705aa04e48261401746edcf24170910d5650eeda56","ci/docker/x86_64-unknown-linux-gnux32/Dockerfile":"ca61f403bd3eaec7f3e51165ae7f74cd559a65ce657aed4700d726a2aabea648","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"e145784741473150473b1bef7cc3c2cf0c6339d4fc480113ac41b4247a9b38ec","ci/dox.sh":"9ea240a4a607036235fd68c01b5d2a59f365768d103d3be774dcf34aa3ff563e","ci/emscripten-entry.sh":"1c1384b4a8b0c055d8095d9d9b2c9dccbdcdb2d5f90fdca34a1976ca8fc379c6","ci/emscripten.sh":"6f66c7b5c3d34a41afc59ceb0a8c3b0880cd6fd9a6344b874ae80bac0639ccb2","ci/ios/deploy_and_run_on_ios_simulator.rs":"3175066fd7f82390f6226d881e1a1dda9767ea2705656870e0d7774e2731800e","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"be83bc5a8b5ef913a7c9941ffca24734716028650c9a876123c4c160672c18de","ci/run-qemu.sh":"bb859421170871ef23a8940c5e150efec0c01b95e32d2ce2d37b79a45d9d346c","ci/run.sh":"f78a0aff66c19002b9a39ef557adb28dcf0a73e18c3eb4934943a4745df8b8fa","ci/runtest-android.rs":"a07ddbdd276aedda7876c7e676774178a60d9aeab95df01275a4ee95f59e3044","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"a2b4907054e260e2db31415379d4db87acd91a8d02fb2178679628079910404f","src/lib.rs":"5f6bee7224a6131862e6cba9dfff57a6340329694b97da9d9f30a668271c0f78","src/macros.rs":"e1b0bf5db89faa8fcb39a3fd46cdb5fdcfabb7f3524eb2192157f0188b8a764b","src/redox/mod.rs":"07ae6652bc6f7fe276255bda210eae7a197d3d64d9dede6dadce0478e8890e2b","src/redox/net.rs":"a1e9d2291e2c12833333ac8706b23f388ce5dbe1718bdd7b38fd68c74559f0b4","src/unix/bsd/apple/b32.rs":"d107376452f731f5d8a1e6b544bdcaac826c95a383d4b20e2032f115eb9f3256","src/unix/bsd/apple/b64.rs":"ab141ad0c8c58342c06858f6f34b75eef70e58cb58e7375d460a9be6739b5e6a","src/unix/bsd/apple/mod.rs":"a7e48a4e3edb132c433e76a3f60f85ae2fd3f28f48e79b41f7461076c7233859","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"62689b8aa80d308d425385daf9b4ea2ed20b19e0590dc57b6efa08b266945bbd","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/freebsd/mod.rs":"9a8cb662cb2cbe5facba1b3519748f657b18b3eee30fa43b75125012745a5cb1","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/mod.rs":"c9895c61e4b01f0b397cbd9d40c977e71774888cad85455bbb23eded85311284","src/unix/bsd/mod.rs":"1546c73fd87103a7282c3ceaa2d1e55f91b8bab2ec705c733351f715722e6b2f","src/unix/bsd/netbsdlike/mod.rs":"edbc1ff82f6a71999cc8664a4e10e43302d33f93b925649b52d97be3821c63d5","src/unix/bsd/netbsdlike/netbsd/mod.rs":"a20d0283670a6a700fa56d12c8a4285ff75ae5a2603706bc17c4cf9799ffd8c3","src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/netbsd/other/mod.rs":"4d9f7091af8e166943ac6f42ce85558909e5b6e61325039bff7adfbcf4b90212","src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs":"f8cd05dacd3a3136c58da5a2fbe26f703767823b28e74fe8a2b57a7bd98d6d5c","src/unix/bsd/netbsdlike/openbsdlike/mod.rs":"3ba4790618db8308e74f8fec16587ae7d584773eefb619948a25a7330b832b3f","src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs":"302817036aa7e7afbc82248cf66b040ef1edfbcb136c9ad243fe20f98df8d6f8","src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs":"f5d8db6f54efd05520b31b764a6bacbf612e1aebce097d2d5bfaaef3b91f37b5","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"f3c940954b2a404e07afc512e78b4e496628b9a9036bd9221ee265b67c618f16","src/unix/mod.rs":"1d95051294ac738f852fc6bb85921618efd911b5772a321f7465a73dabb930e9","src/unix/newlib/arm/mod.rs":"2b6dba2e697ab9b4f4bc4dd5f28057249e9b596d1cb395a9322ec87605c4a5c4","src/unix/newlib/mod.rs":"49227cd0ec18911a91b6ab8a278da3b430321c562b393fbfac92edd354b0a7ee","src/unix/notbsd/android/b32/arm.rs":"3625a32c7e58cfe683a53486fbe3d42d4e28f00bea31e19cb46ed2bb0b6a140b","src/unix/notbsd/android/b32/mod.rs":"e9ec6f08e20ea235cd7095604ea6e37c739c1276e9f40fa31a4db4951fa005af","src/unix/notbsd/android/b32/x86.rs":"ae2b7f1d6278caddc007749bb1d09ca33f7593478a0fd7fe98b457dae86c7814","src/unix/notbsd/android/b64/aarch64.rs":"63d65629d79371814910f691672ef593d20244ee09be26f1ebe07ee6212d0163","src/unix/notbsd/android/b64/mod.rs":"63290adc8122c040f9be369ef4180975bcf1a967a717aa75d30371162d5d5fa9","src/unix/notbsd/android/b64/x86_64.rs":"5547aef8dcbaa5a932559f34606fd8d89f6c9c15173d2b1412c12d39b3c1045f","src/unix/notbsd/android/mod.rs":"7fa19bd63dc3582f12769be51e9a1b355d24744e17ea9aef67380f535b58e2b1","src/unix/notbsd/emscripten.rs":"f8d8acf5cef1acd1a6bdd41299054120820865d072c4c2e3c740fbd0c6e9b3e7","src/unix/notbsd/linux/mips/mips32.rs":"f769bbe5c48f77e6bc94e37deccd2866e7e52e7eb1b3cd7611dbad95574e82f8","src/unix/notbsd/linux/mips/mips64.rs":"ef678b48b571428d46fef5b2ca9bef7251b5f27fcd2c38d987d1b80f2ad3ece0","src/unix/notbsd/linux/mips/mod.rs":"515eb57ee1798fadb6654ce845fb49098593815c2130a30010959f36565e65f9","src/unix/notbsd/linux/mod.rs":"1e1a96e85a9ffcd618f7b459ef2a2ccf9487b3eb97c74cff6c7ce83bb115815e","src/unix/notbsd/linux/musl/b32/arm.rs":"d2998b13648696304bb34f0793715d821178baf8e88a45b532764a20b5294232","src/unix/notbsd/linux/musl/b32/mips.rs":"340be794362a4532d709ef23542b10762f710f7bfd0c4fafa5166a3fb9a15b4f","src/unix/notbsd/linux/musl/b32/mod.rs":"3cc7979546258a47df6b0fcd7ad64571826623671857633a7acafe87e05e56a1","src/unix/notbsd/linux/musl/b32/x86.rs":"df114102dcf35bc32f891d4a9e09ce02fbe4c096a196c6b98b10ff87b29dbe4d","src/unix/notbsd/linux/musl/b64/aarch64.rs":"12c590fde2a1450c08934234c4f5bcd94ee7b58ca21f8e93bc930148c15fb0b0","src/unix/notbsd/linux/musl/b64/mod.rs":"b1991ef46a00d2db7ce3e36f6596685c1d508786c4dd4e62cbbf65ac3c256cc0","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"239c5754811e2d75723bd0d540e732630c9817c5f24513d1f02b63e6b27a3a57","src/unix/notbsd/linux/musl/b64/x86_64.rs":"bf8fc10a09bf700084db0381c484ddec3add79aa1726954cb14d21802ff7d199","src/unix/notbsd/linux/musl/mod.rs":"60cf407596bc7b369d2e6a4d8f2e821d203f6a4284cc5e71312d1fb141a81f1d","src/unix/notbsd/linux/other/b32/arm.rs":"d9892f7350b2978335f734f1cd2d7fed60f0f2e66aa05bee3f69549c031f8b14","src/unix/notbsd/linux/other/b32/mod.rs":"ea91ffe90cd71d45a6e00e7d001cfcfafc8a840aa2b372078798b160968bdaf6","src/unix/notbsd/linux/other/b32/powerpc.rs":"253fcd2f9978525285be1903cc08f3fec2dc3b12d1660a33e2995b4f6b810d1c","src/unix/notbsd/linux/other/b32/x86.rs":"49376e3ed0f3ff95c230ac20751911fe3c608dfe15c7c118b069fd7a954d8db9","src/unix/notbsd/linux/other/b64/aarch64.rs":"cd04a0c1f8d090753600143495b975d8fa4eacc96fc6eeacd8f378ba70d8c838","src/unix/notbsd/linux/other/b64/mod.rs":"63e1a3fdf5f4d1b9820934ab344c91aed5e458e7e05908535d2e942d51a08bf8","src/unix/notbsd/linux/other/b64/not_x32.rs":"e1cf87b9dbe89e9fff667c6fc8eff0166a02565ef65aae3dc9304dc70f7a5624","src/unix/notbsd/linux/other/b64/powerpc64.rs":"25de66d04d2200f00a2e6e0eb97484b43c466897cc789598c728323ee311000b","src/unix/notbsd/linux/other/b64/sparc64.rs":"f26439fa0506ffc5efb0314fcef63cd69964bb5602baec2a0bd1439444dac5e3","src/unix/notbsd/linux/other/b64/x32.rs":"e521bd43a2d66f09f03a045b2e1f69f2ca91cff37922ac5b7c437d888799cee6","src/unix/notbsd/linux/other/b64/x86_64.rs":"924d0282f549507ce46bddc4ac2c489641f883c0620438eea1f6d9fbbbdbbe4b","src/unix/notbsd/linux/other/mod.rs":"5b62146535521c1e7730ea7cba53fd9285831616318abcf5134af992d6cca4a3","src/unix/notbsd/linux/s390x.rs":"f11f595427393a90803a180fa9ca77b048d1d76da0634b92f4b038db07f5623b","src/unix/notbsd/mod.rs":"d2643df7dc6c4affb0ea43ff4471558df317e788942dfde5096c2479f6d42f08","src/unix/solaris/mod.rs":"972b7847f7a67135a93f7604928645103e13f2cf00d1b8bc82994a620101a145","src/unix/uclibc/mips/mips32.rs":"31b23e466cffb86116421ec9240b86e7419aacd84b0b1b04d23c7142c8717566","src/unix/uclibc/mips/mips64.rs":"e67eec1636a998b047d89a4cda1c99cb6bc3071db017762675179a68201c4438","src/unix/uclibc/mips/mod.rs":"74817a9b1ee3998d8e0b751a555d57225f70fd979c283c94ada344a162a8b856","src/unix/uclibc/mod.rs":"89429fbdca93bcdd84a35a36583a143dd67d3e282d7dcb6b7f73fd9a9c038108","src/unix/uclibc/x86_64/l4re.rs":"54b4e58ce5a671348c32bc41c1607dbc5c13fa6818cc3e0e0e2b409c300a305e","src/unix/uclibc/x86_64/mod.rs":"bd569360c45a6f2b585cfb47544d223e92243a2ff4f8429b78fecac6b889f9fd","src/windows.rs":"e41357d610608bad81abf285306ad8b127b6f02d5132f63c4942861980b47d59"},"package":"5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/libc/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/Cargo.toml --- distinst-0.1.0/vendor/libc/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -12,7 +12,7 @@ [package] name = "libc" -version = "0.2.30" +version = "0.2.33" authors = ["The Rust Project Developers"] description = "A library for types and bindings to native C functions often found in libc or\nother common platform libraries.\n" homepage = "https://github.com/rust-lang/libc" @@ -24,8 +24,9 @@ [features] default = ["use_std"] use_std = [] -[badges.travis-ci] +[badges.appveyor] repository = "rust-lang/libc" +project_name = "rust-lang-libs/libc" -[badges.appveyor] -repository = "rust-lang-libs/libc" +[badges.travis-ci] +repository = "rust-lang/libc" diff -Nru distinst-0.1.0/vendor/libc/ci/android-accept-licenses.sh distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/android-accept-licenses.sh --- distinst-0.1.0/vendor/libc/ci/android-accept-licenses.sh 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/android-accept-licenses.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/expect -f -# ignore-license - -set timeout 1800 -set cmd [lindex $argv 0] -set licenses [lindex $argv 1] - -spawn {*}$cmd -expect { - "Do you accept the license '*'*" { - exp_send "y\r" - exp_continue - } - eof -} diff -Nru distinst-0.1.0/vendor/libc/ci/android-install-sdk.sh distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/android-install-sdk.sh --- distinst-0.1.0/vendor/libc/ci/android-install-sdk.sh 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/android-install-sdk.sh 2017-12-21 19:00:07.000000000 +0000 @@ -19,10 +19,8 @@ # which apparently magically accepts the licenses. mkdir sdk -curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O -unzip -d sdk tools_r25.2.5-linux.zip - -filter="platform-tools,android-24" +curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O +unzip -d sdk sdk-tools-linux-3859397.zip case "$1" in arm | armv7) @@ -47,11 +45,16 @@ ;; esac; -filter="$filter,sys-img-$abi-android-24" - -./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter" - -echo "no" | android create avd \ - --name $1 \ - --target android-24 \ - --abi $abi +# --no_https avoids +# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found +echo "yes" | \ + ./sdk/tools/bin/sdkmanager --no_https \ + "emulator" \ + "platform-tools" \ + "platforms;android-24" \ + "system-images;android-24;default;$abi" + +echo "no" | + ./sdk/tools/bin/avdmanager create avd \ + --name $1 \ + --package "system-images;android-24;default;$abi" diff -Nru distinst-0.1.0/vendor/libc/ci/docker/aarch64-linux-android/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/aarch64-linux-android/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/aarch64-linux-android/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/aarch64-linux-android/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -25,7 +25,7 @@ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \ @@ -38,7 +38,7 @@ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @aarch64 -no-window & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ diff -Nru distinst-0.1.0/vendor/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,27 @@ +FROM ubuntu:17.10 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc make libc6-dev git curl ca-certificates \ + gcc-aarch64-linux-gnu qemu-user +RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | \ + tar xzf - && \ + cd musl-1.1.16 && \ + CC=aarch64-linux-gnu-gcc \ + ./configure --prefix=/musl-aarch64 --enable-wrapper=yes && \ + make install -j4 && \ + cd .. && \ + rm -rf musl-1.1.16 && \ +# Install linux kernel headers sanitized for use with musl + curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \ + tar xzf - && \ + cd kernel-headers-3.12.6-5 && \ + make ARCH=arm64 prefix=/musl-aarch64 install -j4 && \ + cd .. && \ + rm -rf kernel-headers-3.12.6-5 + +# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd? +ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \ + CC_aarch64_unknown_linux_musl=musl-gcc \ + RUSTFLAGS='-Clink-args=-lgcc' \ + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \ + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-aarch64 -L /musl-aarch64" diff -Nru distinst-0.1.0/vendor/libc/ci/docker/arm-linux-androideabi/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/arm-linux-androideabi/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/arm-linux-androideabi/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/arm-linux-androideabi/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -25,7 +25,7 @@ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ @@ -38,7 +38,7 @@ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @arm -no-window & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ diff -Nru distinst-0.1.0/vendor/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,25 @@ +FROM ubuntu:17.10 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc make libc6-dev git curl ca-certificates \ + gcc-arm-linux-gnueabihf qemu-user + +RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | tar xzf - +WORKDIR /musl-1.1.16 +RUN CC=arm-linux-gnueabihf-gcc \ + CFLAGS="-march=armv6 -marm" \ + ./configure --prefix=/musl-arm --enable-wrapper=yes +RUN make install -j4 + +# Install linux kernel headers sanitized for use with musl +RUN \ + curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \ + tar xzf - && \ + cd kernel-headers-3.12.6-5 && \ + make ARCH=arm prefix=/musl-arm install -j4 && \ + cd .. && \ + rm -rf kernel-headers-3.12.6-5 +ENV PATH=$PATH:/musl-arm/bin:/rust/bin \ + CC_arm_unknown_linux_musleabihf=musl-gcc \ + CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \ + CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm" diff -Nru distinst-0.1.0/vendor/libc/ci/docker/i686-linux-android/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/i686-linux-android/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/i686-linux-android/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/i686-linux-android/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -25,7 +25,7 @@ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \ @@ -38,7 +38,7 @@ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @i686 -no-window -no-accel & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ diff -Nru distinst-0.1.0/vendor/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:17.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc-multilib libc6-dev ca-certificates diff -Nru distinst-0.1.0/vendor/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,11 @@ +FROM ubuntu:17.10 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc libc6-dev qemu-user ca-certificates \ + gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \ + qemu-system-mips64el + +ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \ + CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \ + CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \ + PATH=$PATH:/rust/bin diff -Nru distinst-0.1.0/vendor/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -8,7 +8,7 @@ # Note that this originally came from: # https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 -RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \ +RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \ tar xjf - -C /toolchain --strip-components=2 ENV PATH=$PATH:/rust/bin:/toolchain/bin \ diff -Nru distinst-0.1.0/vendor/libc/ci/docker/mips-unknown-linux-musl/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mips-unknown-linux-musl/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/mips-unknown-linux-musl/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/mips-unknown-linux-musl/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -8,7 +8,7 @@ # Note that this originally came from: # https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 -RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \ +RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \ tar xjf - -C /toolchain --strip-components=1 ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/bin \ diff -Nru distinst-0.1.0/vendor/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,11 @@ +FROM ubuntu:17.10 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc libc6-dev qemu-user ca-certificates \ + gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \ + qemu-system-ppc + +ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \ + CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" \ + CC=powerpc64le-linux-gnu-gcc \ + PATH=$PATH:/rust/bin diff -Nru distinst-0.1.0/vendor/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +# link fails on 17.10 +FROM ubuntu:17.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc libc6-dev qemu-user ca-certificates \ + gcc-sparc64-linux-gnu libc6-dev-sparc64-cross + +ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \ + # TODO: in theory we should execute this, but qemu segfaults immediately + # see https://github.com/rust-lang/libc/issues/822 + # CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-sparc64 -L /usr/sparc64-linux-gnu" \ + CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER=true \ + CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \ + PATH=$PATH:/rust/bin diff -Nru distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -1,9 +1,9 @@ -FROM alexcrichton/rust-slave-linux-cross:2016-04-15 -USER root +FROM alexcrichton/port-prebuilt-freebsd:2017-09-16 RUN apt-get update RUN apt-get install -y --no-install-recommends \ qemu genext2fs +RUN apt-get install -y curl ca-certificates gcc ENTRYPOINT ["sh"] diff -Nru distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:17.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates diff -Nru distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile --- distinst-0.1.0/vendor/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,5 @@ +FROM ubuntu:17.04 +RUN apt-get update +RUN apt-get install -y --no-install-recommends \ + gcc-multilib libc6-dev ca-certificates +ENV PATH=$PATH:/rust/bin diff -Nru distinst-0.1.0/vendor/libc/ci/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/README.md --- distinst-0.1.0/vendor/libc/ci/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -39,7 +39,7 @@ * `{i686,x86_64}-pc-windows-{msvc,gnu}` * Travis * `{i686,x86_64,mips,aarch64}-unknown-linux-gnu` - * `x86_64-unknown-linux-musl` + * `{x86_64,aarch64}-unknown-linux-musl` * `arm-unknown-linux-gnueabihf` * `arm-linux-androideabi` * `{i686,x86_64}-apple-{darwin,ios}` diff -Nru distinst-0.1.0/vendor/libc/ci/run.sh distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/run.sh --- distinst-0.1.0/vendor/libc/ci/run.sh 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/ci/run.sh 2017-12-21 19:00:07.000000000 +0000 @@ -21,14 +21,14 @@ # image is .gz : download and uncompress it qemufile=$(echo ${QEMU%.gz} | sed 's/\//__/g') if [ ! -f $tmpdir/$qemufile ]; then - curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU | \ + curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU | \ gunzip -d > $tmpdir/$qemufile fi else # plain qcow2 image: just download it qemufile=$(echo ${QEMU} | sed 's/\//__/g') if [ ! -f $tmpdir/$qemufile ]; then - curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU \ + curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU \ > $tmpdir/$qemufile fi fi @@ -41,8 +41,8 @@ # Do the standard rigamarole of cross-compiling an executable and then the # script to run just executes the binary. - cargo build --manifest-path libc-test/Cargo.toml --target $TARGET - cp $CARGO_TARGET_DIR/$TARGET/debug/libc-test $tmpdir/mount/ + cargo build --manifest-path libc-test/Cargo.toml --target $TARGET --tests + cp $CARGO_TARGET_DIR/$TARGET/debug/main-* $tmpdir/mount/libc-test echo 'exec $1/libc-test' > $tmpdir/mount/run.sh du -sh $tmpdir/mount @@ -68,4 +68,11 @@ exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log fi -exec cargo test --manifest-path libc-test/Cargo.toml --target $TARGET +# FIXME: x86_64-unknown-linux-gnux32 fail to compile wihout --release +# See https://github.com/rust-lang/rust/issues/45417 +opt= +if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then + opt="--release" +fi + +exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET diff -Nru distinst-0.1.0/vendor/libc/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/README.md --- distinst-0.1.0/vendor/libc/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -138,6 +138,9 @@ * [`x86_64-unknown-linux-musl`](https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/) (Linux MUSL) * [`aarch64-unknown-linux-gnu`](https://doc.rust-lang.org/libc/aarch64-unknown-linux-gnu/libc/) + (Linux) + * [`aarch64-unknown-linux-musl`](https://doc.rust-lang.org/libc/aarch64-unknown-linux-musl/libc/) + (Linux MUSL) * [`mips-unknown-linux-gnu`](https://doc.rust-lang.org/libc/mips-unknown-linux-gnu/libc/) * [`arm-unknown-linux-gnueabihf`](https://doc.rust-lang.org/libc/arm-unknown-linux-gnueabihf/libc/) * [`arm-linux-androideabi`](https://doc.rust-lang.org/libc/arm-linux-androideabi/libc/) diff -Nru distinst-0.1.0/vendor/libc/src/dox.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/dox.rs --- distinst-0.1.0/vendor/libc/src/dox.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/dox.rs 2017-12-21 19:00:07.000000000 +0000 @@ -63,111 +63,86 @@ fn div(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_div { - ($($i:ident)*) => ($( - impl Div<$i> for $i { - type Output = $i; - fn div(self, rhs: $i) -> $i { self / rhs } - } - )*) - } - each_int!(impl_div); - #[lang = "shl"] pub trait Shl { type Output; fn shl(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_shl { - ($($i:ident)*) => ($( - impl Shl<$i> for $i { - type Output = $i; - fn shl(self, rhs: $i) -> $i { self << rhs } - } - )*) - } - each_int!(impl_shl); - #[lang = "mul"] pub trait Mul { type Output; fn mul(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_mul { - ($($i:ident)*) => ($( - impl Mul for $i { - type Output = $i; - fn mul(self, rhs: $i) -> $i { self * rhs } - } - )*) - } - each_int!(impl_mul); - #[lang = "sub"] pub trait Sub { type Output; fn sub(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_sub { - ($($i:ident)*) => ($( - impl Sub for $i { - type Output = $i; - fn sub(self, rhs: $i) -> $i { self - rhs } - } - )*) - } - each_int!(impl_sub); - #[lang = "bitor"] pub trait Bitor { type Output; fn bitor(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_bitor { - ($($i:ident)*) => ($( - impl Bitor for $i { - type Output = $i; - fn bitor(self, rhs: $i) -> $i { self | rhs } - } - )*) - } - each_int!(impl_bitor); - #[lang = "neg"] pub trait Neg { type Output; fn neg(self) -> Self::Output; } - macro_rules! impl_neg { - ($($i:ident)*) => ($( - impl Neg for $i { - type Output = $i; - fn neg(self) -> $i { -self } - } - )*) - } - each_signed_int!(impl_neg); - #[lang = "not"] pub trait Not { type Output; fn not(self) -> Self::Output; } - macro_rules! impl_not { + #[lang = "add"] + pub trait Add { + type Output; + fn add(self, r: RHS) -> Self::Output; + } + + macro_rules! impl_traits { ($($i:ident)*) => ($( + impl Div<$i> for $i { + type Output = $i; + fn div(self, rhs: $i) -> $i { self / rhs } + } + impl Shl<$i> for $i { + type Output = $i; + fn shl(self, rhs: $i) -> $i { self << rhs } + } + impl Mul for $i { + type Output = $i; + fn mul(self, rhs: $i) -> $i { self * rhs } + } + + impl Sub for $i { + type Output = $i; + fn sub(self, rhs: $i) -> $i { self - rhs } + } + impl Bitor for $i { + type Output = $i; + fn bitor(self, rhs: $i) -> $i { self | rhs } + } + impl Neg for $i { + type Output = $i; + fn neg(self) -> $i { -self } + } impl Not for $i { type Output = $i; fn not(self) -> $i { !self } } + impl Add<$i> for $i { + type Output = $i; + fn add(self, other: $i) -> $i { self + other } + } )*) } - each_int!(impl_not); + each_int!(impl_traits); pub mod mem { pub fn size_of_val(_: &T) -> usize { 4 } diff -Nru distinst-0.1.0/vendor/libc/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/lib.rs --- distinst-0.1.0/vendor/libc/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -78,20 +78,23 @@ #![cfg_attr(all(target_os = "emscripten", target_arch = "wasm32"), doc( html_root_url = "https://doc.rust-lang.org/libc/wasm32-unknown-emscripten" ))] +#![cfg_attr(all(target_os = "linux", target_arch = "xparc64"), doc( + html_root_url = "https://doc.rust-lang.org/libc/sparc64-unknown-linux-gnu" +))] // Attributes needed when building as part of the standard library -#![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute, cfg_target_vendor))] -#![cfg_attr(stdbuild, feature(link_cfg))] -#![cfg_attr(stdbuild, no_std)] -#![cfg_attr(stdbuild, staged_api)] -#![cfg_attr(stdbuild, allow(warnings))] -#![cfg_attr(stdbuild, unstable(feature = "libc", +#![cfg_attr(feature = "stdbuild", feature(no_std, staged_api, custom_attribute, cfg_target_vendor))] +#![cfg_attr(feature = "stdbuild", feature(link_cfg))] +#![cfg_attr(feature = "stdbuild", no_std)] +#![cfg_attr(feature = "stdbuild", staged_api)] +#![cfg_attr(feature = "stdbuild", allow(warnings))] +#![cfg_attr(feature = "stdbuild", unstable(feature = "libc", reason = "use `libc` from crates.io", issue = "27783"))] #![cfg_attr(not(feature = "use_std"), no_std)] -#[cfg(all(not(stdbuild), not(dox), feature = "use_std"))] +#[cfg(all(not(dox), feature = "use_std"))] extern crate std as core; #[macro_use] mod macros; diff -Nru distinst-0.1.0/vendor/libc/src/redox/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox/mod.rs --- distinst-0.1.0/vendor/libc/src/redox/mod.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,104 @@ +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; + +pub type wchar_t = i16; + +pub type off_t = c_long; +pub type mode_t = u16; +pub type time_t = i64; +pub type pid_t = usize; +pub type gid_t = usize; +pub type uid_t = usize; + +pub type suseconds_t = i64; + +s! { + pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + } + + pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: c_long, + } +} + +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; + +pub const S_ISUID: ::c_int = 0x800; +pub const S_ISGID: ::c_int = 0x400; +pub const S_ISVTX: ::c_int = 0x200; + +pub const S_IFIFO: mode_t = 0x1000; +pub const S_IFCHR: mode_t = 0x2000; +pub const S_IFBLK: mode_t = 0x6000; +pub const S_IFDIR: mode_t = 0x4000; +pub const S_IFREG: mode_t = 0x8000; +pub const S_IFLNK: mode_t = 0xA000; +pub const S_IFSOCK: mode_t = 0xC000; +pub const S_IFMT: mode_t = 0xF000; +pub const S_IEXEC: mode_t = 0x40; +pub const S_IWRITE: mode_t = 0x80; +pub const S_IREAD: mode_t = 0x100; +pub const S_IRWXU: mode_t = 0x1C0; +pub const S_IXUSR: mode_t = 0x40; +pub const S_IWUSR: mode_t = 0x80; +pub const S_IRUSR: mode_t = 0x100; +pub const S_IRWXG: mode_t = 0x38; +pub const S_IXGRP: mode_t = 0x8; +pub const S_IWGRP: mode_t = 0x10; +pub const S_IRGRP: mode_t = 0x20; +pub const S_IRWXO: mode_t = 0x7; +pub const S_IXOTH: mode_t = 0x1; +pub const S_IWOTH: mode_t = 0x2; +pub const S_IROTH: mode_t = 0x4; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; + +pub const O_RDONLY: ::c_int = 0x0001_0000; +pub const O_WRONLY: ::c_int = 0x0002_0000; +pub const O_RDWR: ::c_int = 0x0003_0000; +pub const O_NONBLOCK: ::c_int = 0x0004_0000; +pub const O_APPEND: ::c_int = 0x0008_0000; +pub const O_SHLOCK: ::c_int = 0x0010_0000; +pub const O_EXLOCK: ::c_int = 0x0020_0000; +pub const O_ASYNC: ::c_int = 0x0040_0000; +pub const O_FSYNC: ::c_int = 0x0080_0000; +pub const O_CLOEXEC: ::c_int = 0x0100_0000; +pub const O_CREAT: ::c_int = 0x0200_0000; +pub const O_TRUNC: ::c_int = 0x0400_0000; +pub const O_EXCL: ::c_int = 0x0800_0000; +pub const O_DIRECTORY: ::c_int = 0x1000_0000; +pub const O_STAT: ::c_int = 0x2000_0000; +pub const O_SYMLINK: ::c_int = 0x4000_0000; +pub const O_NOFOLLOW: ::c_int = 0x8000_0000; +pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR; + +extern { + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) + -> ::ssize_t; + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) + -> ::ssize_t; + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn close(fd: ::c_int) -> ::c_int; +} + +#[link(name = "c")] +#[link(name = "m")] +extern {} + +pub use self::net::*; + +mod net; diff -Nru distinst-0.1.0/vendor/libc/src/redox/net.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox/net.rs --- distinst-0.1.0/vendor/libc/src/redox/net.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox/net.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,110 @@ +pub type in_addr_t = u32; +pub type in_port_t = u16; + +pub type socklen_t = u32; +pub type sa_family_t = u16; + +s! { + pub struct in_addr { + pub s_addr: in_addr_t, + } + + pub struct in6_addr { + pub s6_addr: [u8; 16], + __align: [u32; 0], + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + pub ipv6mr_interface: ::c_uint, + } + + pub struct linger { + pub l_onoff: ::c_int, + pub l_linger: ::c_int, + } + + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct sockaddr_storage { + pub ss_family: sa_family_t, + pub __ss_padding: [u8; 26], + } +} + +pub const AF_INET: ::c_int = 2; +pub const AF_INET6: ::c_int = 23; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const IPPROTO_TCP: ::c_int = 6; +pub const IPPROTO_IP: ::c_int = 0; +pub const IPPROTO_IPV6: ::c_int = 41; + +pub const TCP_KEEPIDLE: ::c_int = 4; +pub const TCP_NODELAY: ::c_int = 8193; + +pub const IP_TTL: ::c_int = 8; +pub const IP_MULTICAST_LOOP: ::c_int = 9; +pub const IP_MULTICAST_TTL: ::c_int = 10; +pub const IP_ADD_MEMBERSHIP: ::c_int = 11; +pub const IP_DROP_MEMBERSHIP: ::c_int = 12; + +pub const IPV6_MULTICAST_LOOP: ::c_int = 19; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; +pub const IPV6_V6ONLY: ::c_int = 26; + +pub const SOL_SOCKET: ::c_int = 65535; + +pub const SO_REUSEADDR: ::c_int = 4; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_KEEPALIVE: ::c_int = 8; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_LINGER: ::c_int = 128; +pub const SO_SNDBUF: ::c_int = 4097; +pub const SO_RCVBUF: ::c_int = 4098; +pub const SO_ERROR: ::c_int = 4105; + +extern { + pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int; + pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int; + pub fn connect(socket: ::c_int, address: *const sockaddr, + len: socklen_t) -> ::c_int; + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; + pub fn getsockname(socket: ::c_int, address: *mut sockaddr, + address_len: *mut socklen_t) -> ::c_int; + pub fn getsockopt(sockfd: ::c_int, + level: ::c_int, + optname: ::c_int, + optval: *mut ::c_void, + optlen: *mut ::socklen_t) -> ::c_int; + pub fn setsockopt(socket: ::c_int, level: ::c_int, name: ::c_int, + value: *const ::c_void, + option_len: socklen_t) -> ::c_int; +} diff -Nru distinst-0.1.0/vendor/libc/src/redox.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox.rs --- distinst-0.1.0/vendor/libc/src/redox.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/redox.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -pub type c_char = i8; -pub type c_long = i64; -pub type c_ulong = u64; - -pub type wchar_t = i16; - -pub type off_t = c_long; -pub type mode_t = u16; -pub type time_t = i64; -pub type pid_t = usize; -pub type gid_t = usize; -pub type uid_t = usize; - -pub type in_addr_t = u32; -pub type in_port_t = u16; - -pub type socklen_t = u32; -pub type sa_family_t = u16; - -s! { - pub struct in_addr { - pub s_addr: in_addr_t, - } - - pub struct in6_addr { - pub s6_addr: [u8; 16], - __align: [u32; 0], - } - - pub struct sockaddr { - pub sa_family: sa_family_t, - pub sa_data: [::c_char; 14], - } - - pub struct sockaddr_in { - pub sin_family: sa_family_t, - pub sin_port: ::in_port_t, - pub sin_addr: ::in_addr, - pub sin_zero: [u8; 8], - } - - pub struct sockaddr_in6 { - pub sin6_family: sa_family_t, - pub sin6_port: in_port_t, - pub sin6_flowinfo: u32, - pub sin6_addr: ::in6_addr, - pub sin6_scope_id: u32, - } -} - -pub const STDIN_FILENO: ::c_int = 0; -pub const STDOUT_FILENO: ::c_int = 1; -pub const STDERR_FILENO: ::c_int = 2; - -pub const EXIT_FAILURE: ::c_int = 1; -pub const EXIT_SUCCESS: ::c_int = 0; - -pub const S_ISUID: ::c_int = 0x800; -pub const S_ISGID: ::c_int = 0x400; -pub const S_ISVTX: ::c_int = 0x200; - -pub const S_IFIFO: mode_t = 0x1000; -pub const S_IFCHR: mode_t = 0x2000; -pub const S_IFBLK: mode_t = 0x6000; -pub const S_IFDIR: mode_t = 0x4000; -pub const S_IFREG: mode_t = 0x8000; -pub const S_IFLNK: mode_t = 0xA000; -pub const S_IFSOCK: mode_t = 0xC000; -pub const S_IFMT: mode_t = 0xF000; -pub const S_IEXEC: mode_t = 0x40; -pub const S_IWRITE: mode_t = 0x80; -pub const S_IREAD: mode_t = 0x100; -pub const S_IRWXU: mode_t = 0x1C0; -pub const S_IXUSR: mode_t = 0x40; -pub const S_IWUSR: mode_t = 0x80; -pub const S_IRUSR: mode_t = 0x100; -pub const S_IRWXG: mode_t = 0x38; -pub const S_IXGRP: mode_t = 0x8; -pub const S_IWGRP: mode_t = 0x10; -pub const S_IRGRP: mode_t = 0x20; -pub const S_IRWXO: mode_t = 0x7; -pub const S_IXOTH: mode_t = 0x1; -pub const S_IWOTH: mode_t = 0x2; -pub const S_IROTH: mode_t = 0x4; - -extern { - pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; - pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) - -> ::ssize_t; - pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) - -> ::ssize_t; -} - -#[link(name = "c")] -#[link(name = "m")] -extern {} diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/apple/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/apple/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/apple/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/apple/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -14,6 +14,7 @@ pub type mach_timebase_info_data_t = mach_timebase_info; pub type pthread_key_t = c_ulong; pub type sigset_t = u32; +pub type clockid_t = ::c_uint; pub type fsblkcnt_t = ::c_uint; pub type fsfilcnt_t = ::c_uint; pub type speed_t = ::c_ulong; @@ -410,6 +411,13 @@ pub xsu_pagesize: u32, pub xsu_encrypted: ::boolean_t, } + + pub struct xucred { + pub cr_version: ::c_uint, + pub cr_uid: ::uid_t, + pub cr_ngroups: ::c_short, + pub cr_groups: [::gid_t;16] + } } pub const _UTX_USERSIZE: usize = 256; @@ -493,6 +501,11 @@ pub const ABMON_11: ::nl_item = 43; pub const ABMON_12: ::nl_item = 44; +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 6; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16; + pub const ERA: ::nl_item = 45; pub const ERA_D_FMT: ::nl_item = 46; pub const ERA_D_T_FMT: ::nl_item = 47; @@ -601,6 +614,112 @@ pub const MAP_FIXED: ::c_int = 0x0010; pub const MAP_ANON: ::c_int = 0x1000; +pub const VM_FLAGS_FIXED: ::c_int = 0x0000; +pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001; +pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002; +pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008; +pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010; +pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020; +pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040; +pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000; +pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; +pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; +pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; +pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; +pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | + VM_FLAGS_PURGABLE | + VM_FLAGS_RANDOM_ADDR | + VM_FLAGS_NO_CACHE | + VM_FLAGS_OVERWRITE | + VM_FLAGS_SUPERPAGE_MASK | + VM_FLAGS_ALIAS_MASK; +pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE | + VM_FLAGS_RETURN_4K_DATA_ADDR | + VM_FLAGS_RETURN_DATA_ADDR; +pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | + VM_FLAGS_RANDOM_ADDR | + VM_FLAGS_OVERWRITE | + VM_FLAGS_RETURN_DATA_ADDR | + VM_FLAGS_RESILIENT_CODESIGN; + +pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16; +pub const SUPERPAGE_NONE: ::c_int = 0; +pub const SUPERPAGE_SIZE_ANY: ::c_int = 1; +pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE << + VM_FLAGS_SUPERPAGE_SHIFT; +pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY << + VM_FLAGS_SUPERPAGE_SHIFT; +pub const SUPERPAGE_SIZE_2MB: ::c_int = 2; +pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB << + VM_FLAGS_SUPERPAGE_SHIFT; + +pub const VM_MEMORY_MALLOC: ::c_int = 1; +pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2; +pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3; +pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4; +pub const VM_MEMORY_SBRK: ::c_int = 5; +pub const VM_MEMORY_REALLOC: ::c_int = 6; +pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7; +pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8; +pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9; +pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10; +pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11; +pub const VM_MEMORY_MACH_MSG: ::c_int = 20; +pub const VM_MEMORY_IOKIT: ::c_int = 21; +pub const VM_MEMORY_STACK: ::c_int = 30; +pub const VM_MEMORY_GUARD: ::c_int = 31; +pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32; +pub const VM_MEMORY_DYLIB: ::c_int = 33; +pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34; +pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35; +pub const VM_MEMORY_APPKIT: ::c_int = 40; +pub const VM_MEMORY_FOUNDATION: ::c_int = 41; +pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42; +pub const VM_MEMORY_CORESERVICES: ::c_int = 43; +pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES; +pub const VM_MEMORY_JAVA: ::c_int = 44; +pub const VM_MEMORY_COREDATA: ::c_int = 45; +pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46; +pub const VM_MEMORY_ATS: ::c_int = 50; +pub const VM_MEMORY_LAYERKIT: ::c_int = 51; +pub const VM_MEMORY_CGIMAGE: ::c_int = 52; +pub const VM_MEMORY_TCMALLOC: ::c_int = 53; +pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54; +pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55; +pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56; +pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57; +pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58; +pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS; +pub const VM_MEMORY_DYLD: ::c_int = 60; +pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61; +pub const VM_MEMORY_SQLITE: ::c_int = 62; +pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63; +pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64; +pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65; +pub const VM_MEMORY_GLSL: ::c_int = 66; +pub const VM_MEMORY_OPENCL: ::c_int = 67; +pub const VM_MEMORY_COREIMAGE: ::c_int = 68; +pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69; +pub const VM_MEMORY_IMAGEIO: ::c_int = 70; +pub const VM_MEMORY_COREPROFILE: ::c_int = 71; +pub const VM_MEMORY_ASSETSD: ::c_int = 72; +pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73; +pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74; +pub const VM_MEMORY_ACCELERATE: ::c_int = 75; +pub const VM_MEMORY_COREUI: ::c_int = 76; +pub const VM_MEMORY_COREUIFILE: ::c_int = 77; +pub const VM_MEMORY_GENEALOGY: ::c_int = 78; +pub const VM_MEMORY_RAWCAMERA: ::c_int = 79; +pub const VM_MEMORY_CORPSEINFO: ::c_int = 80; +pub const VM_MEMORY_ASL: ::c_int = 81; +pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82; +pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83; +pub const VM_MEMORY_DHMM: ::c_int = 84; +pub const VM_MEMORY_SCENEKIT: ::c_int = 86; +pub const VM_MEMORY_SKYWALK: ::c_int = 87; +pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240; +pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255; + pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; pub const MCL_CURRENT: ::c_int = 0x0001; @@ -933,6 +1052,223 @@ pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; +// +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +/// Sequential Exchange +pub const IPPROTO_SEP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/* 55-57: Unassigned */ +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion */ +/// divert pseudo-protocol +pub const IPPROTO_DIVERT: ::c_int = 254; +/// raw IP packet +pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + pub const AF_UNSPEC: ::c_int = 0; pub const AF_LOCAL: ::c_int = 1; pub const AF_UNIX: ::c_int = AF_LOCAL; @@ -1042,6 +1378,15 @@ pub const TCP_NODELAY: ::c_int = 0x01; pub const TCP_KEEPALIVE: ::c_int = 0x10; + +pub const SOL_LOCAL: ::c_int = 0; + +pub const LOCAL_PEERCRED: ::c_int = 0x001; +pub const LOCAL_PEERPID: ::c_int = 0x002; +pub const LOCAL_PEEREPID: ::c_int = 0x003; +pub const LOCAL_PEERUUID: ::c_int = 0x004; +pub const LOCAL_PEEREUUID: ::c_int = 0x005; + pub const SOL_SOCKET: ::c_int = 0xffff; pub const SO_DEBUG: ::c_int = 0x01; @@ -1117,8 +1462,6 @@ pub const MAP_NOCACHE: ::c_int = 0x0400; pub const MAP_JIT: ::c_int = 0x0800; -pub const IPPROTO_RAW: ::c_int = 255; - pub const _SC_ARG_MAX: ::c_int = 1; pub const _SC_CHILD_MAX: ::c_int = 2; pub const _SC_CLK_TCK: ::c_int = 3; @@ -1622,6 +1965,8 @@ pub const MAXCOMLEN: usize = 16; pub const MAXTHREADNAMESIZE: usize = 64; +pub const XUCRED_VERSION: ::c_uint = 0; + f! { pub fn WSTOPSIG(status: ::c_int) -> ::c_int { status >> 8 @@ -1655,6 +2000,8 @@ pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec) -> ::c_int; pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent) -> ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -386,6 +386,231 @@ pub const SO_SNDSPACE: ::c_int = 0x100a; pub const SO_CPUHINT: ::c_int = 0x1030; +// +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +/// Sequential Exchange +pub const IPPROTO_SEP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/// IP Mobility +pub const IPPROTO_MOBILE: ::c_int = 55; +/// Transport Layer Security +pub const IPPROTO_TLSP: ::c_int = 56; +/// SKIP +pub const IPPROTO_SKIP: ::c_int = 57; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion, no longer used */ +/// divert pseudo-protocol +pub const IPPROTO_DIVERT: ::c_int = 254; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/// Used by RSS: the layer3 protocol is unknown +pub const IPPROTO_UNKNOWN: ::c_int = 258; + pub const AF_BLUETOOTH: ::c_int = 33; pub const AF_MPLS: ::c_int = 34; pub const AF_IEEE80211: ::c_int = 35; diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -127,6 +127,14 @@ pub shm_dtime: ::time_t, pub shm_ctime: ::time_t, } + + pub struct xucred { + pub cr_version: ::c_uint, + pub cr_uid: ::uid_t, + pub cr_ngroups: ::c_short, + pub cr_groups: [::gid_t;16], + __cr_unused1: *mut ::c_void, + } } pub const SIGEV_THREAD_ID: ::c_int = 4; @@ -402,6 +410,11 @@ pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; pub const SO_VENDOR: ::c_int = 0x80000000; +pub const LOCAL_PEERCRED: ::c_int = 1; +pub const LOCAL_CREDS: ::c_int = 2; +pub const LOCAL_CONNWAIT: ::c_int = 4; +pub const LOCAL_VENDOR: ::c_int = SO_VENDOR; + pub const AF_SLOW: ::c_int = 33; pub const AF_SCLUSTER: ::c_int = 34; pub const AF_ARP: ::c_int = 35; @@ -412,7 +425,246 @@ #[doc(hidden)] pub const AF_MAX: ::c_int = 42; +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +/// Sequential Exchange +pub const IPPROTO_SEP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/// IP Mobility +pub const IPPROTO_MOBILE: ::c_int = 55; +/// Transport Layer Security +pub const IPPROTO_TLSP: ::c_int = 56; +/// SKIP +pub const IPPROTO_SKIP: ::c_int = 57; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +/// IPv6 Mobility Header +pub const IPPROTO_MH: ::c_int = 135; +/// UDP-Lite +pub const IPPROTO_UDPLITE: ::c_int = 136; +/// IP6 Host Identity Protocol +pub const IPPROTO_HIP: ::c_int = 139; +/// IP6 Shim6 Protocol +pub const IPPROTO_SHIM6: ::c_int = 140; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// MPLS-in-IP +pub const IPPROTO_MPLS: ::c_int = 137; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion, no longer used */ +/// OLD divert pseudo-proto +pub const IPPROTO_OLD_DIVERT: ::c_int = 254; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/* Only used internally, so can be outside the range of valid IP protocols. */ +/// divert pseudo-protocol pub const IPPROTO_DIVERT: ::c_int = 258; +/// SeND pseudo-protocol +pub const IPPROTO_SEND: ::c_int = 259; + +pub const IP_BINDANY: ::c_int = 24; pub const PF_SLOW: ::c_int = AF_SLOW; pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER; @@ -527,6 +779,9 @@ pub const _SC_CPUSET_SIZE: ::c_int = 122; +pub const XU_NGROUPS: ::c_int = 16; +pub const XUCRED_VERSION: ::c_uint = 0; + extern { pub fn __error() -> *mut ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -299,6 +299,7 @@ pub const WNOHANG: ::c_int = 0x00000001; pub const WUNTRACED: ::c_int = 0x00000002; +pub const RTLD_LAZY: ::c_int = 0x1; pub const RTLD_NOW: ::c_int = 0x2; pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void; pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void; @@ -313,6 +314,12 @@ pub const PIPE_BUF: usize = 512; +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; pub const POLLRDNORM: ::c_short = 0x040; pub const POLLWRNORM: ::c_short = 0x004; pub const POLLRDBAND: ::c_short = 0x080; @@ -360,6 +367,10 @@ pub fn WCOREDUMP(status: ::c_int) -> bool { (status & 0o200) != 0 } + + pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } } extern { @@ -480,6 +491,9 @@ oldset: *mut sigset_t) -> ::c_int; pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_cancel$UNIX2003")] + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; pub fn sem_unlink(name: *const ::c_char) -> ::c_int; pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -589,6 +589,8 @@ iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, + times: *const ::timespec, flag: ::c_int) -> ::c_int; pub fn fdatasync(fd: ::c_int) -> ::c_int; pub fn openpty(amaster: *mut ::c_int, aslave: *mut ::c_int, diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -346,6 +346,85 @@ pub const SO_OVERFLOWED: ::c_int = 0x1009; pub const SO_NOHEADER: ::c_int = 0x100a; +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// IP Mobility RFC 2004 +pub const IPPROTO_MOBILE: ::c_int = 55; +/// IPv6 ICMP +pub const IPPROTO_IPV6_ICMP: ::c_int = 58; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// Ethernet-in-IP +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// VRRP RFC 2338 +pub const IPPROTO_VRRP: ::c_int = 112; +/// Common Address Resolution Protocol +pub const IPPROTO_CARP: ::c_int = 112; +/// L2TPv3 +// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16, +// but isn't yet supported by the NetBSD rumprun kernel image used for +// libc testing. +//pub const IPPROTO_L2TP: ::c_int = 115; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; +pub const IPPROTO_MAX: ::c_int = 256; + +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/// sysctl placeholder for (FAST_)IPSEC +pub const CTL_IPPROTO_IPSEC: ::c_int = 258; + pub const AF_OROUTE: ::c_int = 17; pub const AF_ARP: ::c_int = 28; pub const pseudo_AF_KEY: ::c_int = 29; @@ -386,6 +465,65 @@ pub const MAP_HASSEMAPHORE : ::c_int = 0x200; pub const MAP_WIRED: ::c_int = 0x800; +pub const DCCP_TYPE_REQUEST: ::c_int = 0; +pub const DCCP_TYPE_RESPONSE: ::c_int = 1; +pub const DCCP_TYPE_DATA: ::c_int = 2; +pub const DCCP_TYPE_ACK: ::c_int = 3; +pub const DCCP_TYPE_DATAACK: ::c_int = 4; +pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5; +pub const DCCP_TYPE_CLOSE: ::c_int = 6; +pub const DCCP_TYPE_RESET: ::c_int = 7; +pub const DCCP_TYPE_MOVE: ::c_int = 8; + +pub const DCCP_FEATURE_CC: ::c_int = 1; +pub const DCCP_FEATURE_ECN: ::c_int = 2; +pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3; +pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4; +pub const DCCP_FEATURE_MOBILITY: ::c_int = 5; +pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6; +pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8; +pub const DCCP_FEATURE_IDENTREG: ::c_int = 7; + +pub const DCCP_OPT_PADDING: ::c_int = 0; +pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1; +pub const DCCP_OPT_SLOW_RECV: ::c_int = 2; +pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3; +pub const DCCP_OPT_CHANGE_L: ::c_int = 32; +pub const DCCP_OPT_CONFIRM_L: ::c_int = 33; +pub const DCCP_OPT_CHANGE_R: ::c_int = 34; +pub const DCCP_OPT_CONFIRM_R: ::c_int = 35; +pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36; +pub const DCCP_OPT_NDP_COUNT: ::c_int = 37; +pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38; +pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39; +pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40; +pub const DCCP_OPT_TIMESTAMP: ::c_int = 41; +pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42; +pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43; +pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44; + +pub const DCCP_REASON_UNSPEC: ::c_int = 0; +pub const DCCP_REASON_CLOSED: ::c_int = 1; +pub const DCCP_REASON_INVALID: ::c_int = 2; +pub const DCCP_REASON_OPTION_ERR: ::c_int = 3; +pub const DCCP_REASON_FEA_ERR: ::c_int = 4; +pub const DCCP_REASON_CONN_REF: ::c_int = 5; +pub const DCCP_REASON_BAD_SNAME: ::c_int = 6; +pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7; +pub const DCCP_REASON_INV_MOVE: ::c_int = 8; +pub const DCCP_REASON_UNANSW_CH: ::c_int = 10; +pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11; + +pub const DCCP_CCID: ::c_int = 1; +pub const DCCP_CSLEN: ::c_int = 2; +pub const DCCP_MAXSEG: ::c_int = 4; +pub const DCCP_SERVICE: ::c_int = 8; + +pub const DCCP_NDP_LIMIT: ::c_int = 16; +pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216; +pub const DCCP_MAX_OPTIONS: ::c_int = 32; +pub const DCCP_MAX_PKTS: ::c_int = 100; + pub const _PC_LINK_MAX : ::c_int = 1; pub const _PC_MAX_CANON : ::c_int = 2; pub const _PC_MAX_INPUT : ::c_int = 3; @@ -511,13 +649,13 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; -pub const EVFILT_AIO: ::int32_t = 2; -pub const EVFILT_PROC: ::int32_t = 4; -pub const EVFILT_READ: ::int32_t = 0; -pub const EVFILT_SIGNAL: ::int32_t = 5; -pub const EVFILT_TIMER: ::int32_t = 6; -pub const EVFILT_VNODE: ::int32_t = 3; -pub const EVFILT_WRITE: ::int32_t = 1; +pub const EVFILT_AIO: ::uint32_t = 2; +pub const EVFILT_PROC: ::uint32_t = 4; +pub const EVFILT_READ: ::uint32_t = 0; +pub const EVFILT_SIGNAL: ::uint32_t = 5; +pub const EVFILT_TIMER: ::uint32_t = 6; +pub const EVFILT_VNODE: ::uint32_t = 3; +pub const EVFILT_WRITE: ::uint32_t = 1; pub const EV_ADD: ::uint32_t = 0x1; pub const EV_DELETE: ::uint32_t = 0x2; @@ -700,6 +838,11 @@ pub const KERN_PROC_RUID: ::c_int = 6; pub const KERN_PROC_GID: ::c_int = 7; pub const KERN_PROC_RGID: ::c_int = 8; +pub const KERN_PROC_ARGV: ::c_int = 1; +pub const KERN_PROC_NARGV: ::c_int = 2; +pub const KERN_PROC_ENV: ::c_int = 3; +pub const KERN_PROC_NENV: ::c_int = 4; +pub const KERN_PROC_PATHNAME: ::c_int = 5; pub const EAI_SYSTEM: ::c_int = 11; diff -Nru distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -221,6 +221,72 @@ pub const SO_PEERCRED: ::c_int = 0x1022; pub const SO_SPLICE: ::c_int = 0x1023; +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// IP Mobility RFC 2004 +pub const IPPROTO_MOBILE: ::c_int = 55; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// Ethernet-in-IP +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// unicast MPLS packet +pub const IPPROTO_MPLS: ::c_int = 137; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; +pub const IPPROTO_MAX: ::c_int = 256; + +/* Only used internally, so it can be outside the range of valid IP protocols */ +/// Divert sockets +pub const IPPROTO_DIVERT: ::c_int = 258; + pub const AF_ECMA: ::c_int = 8; pub const AF_ROUTE: ::c_int = 17; pub const AF_ENCAP: ::c_int = 28; diff -Nru distinst-0.1.0/vendor/libc/src/unix/haiku/b32.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/b32.rs --- distinst-0.1.0/vendor/libc/src/unix/haiku/b32.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/b32.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,2 +1,3 @@ pub type c_long = i32; pub type c_ulong = u32; +pub type time_t = i32; diff -Nru distinst-0.1.0/vendor/libc/src/unix/haiku/b64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/b64.rs --- distinst-0.1.0/vendor/libc/src/unix/haiku/b64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/b64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,2 +1,3 @@ pub type c_ulong = u64; pub type c_long = i64; +pub type time_t = i64; diff -Nru distinst-0.1.0/vendor/libc/src/unix/haiku/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/haiku/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/haiku/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -9,7 +9,6 @@ pub type c_char = i8; pub type clock_t = i32; pub type clockid_t = i32; -pub type time_t = i32; pub type suseconds_t = i32; pub type wchar_t = i32; pub type off_t = i64; @@ -170,6 +169,14 @@ pub c_cc: [::cc_t; ::NCCS], } + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + pub struct stat { pub st_dev: dev_t, pub st_ino: ino_t, @@ -291,6 +298,14 @@ sa_userdata: *mut ::c_void, } + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + __unused1: *mut ::c_void, // actually a function pointer + pub sigev_notify_attributes: *mut ::pthread_attr_t, + } + pub struct sem_t { pub se_type: i32, pub se_named_id: i32, // this is actually a union @@ -331,6 +346,27 @@ pub const F_SETFD: ::c_int = 0x0004; pub const F_GETFL: ::c_int = 0x0008; pub const F_SETFL: ::c_int = 0x0010; +pub const F_GETLK: ::c_int = 0x0020; +pub const F_SETLK: ::c_int = 0x0080; +pub const F_SETLKW: ::c_int = 0x0100; +pub const F_DUPFD_CLOEXEC: ::c_int = 0x0200; + +pub const AT_FDCWD: ::c_int = -1; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x01; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x02; +pub const AT_REMOVEDIR: ::c_int = 0x04; +pub const AT_EACCESS: ::c_int = 0x08; + +pub const POLLIN: ::c_short = 0x0001; +pub const POLLOUT: ::c_short = 0x0002; +pub const POLLRDNORM: ::c_short = POLLIN; +pub const POLLWRNORM: ::c_short = POLLOUT; +pub const POLLRDBAND: ::c_short = 0x0008; +pub const POLLWRBAND: ::c_short = 0x0010; +pub const POLLPRI: ::c_short = 0x0020; +pub const POLLERR: ::c_short = 0x0004; +pub const POLLHUP: ::c_short = 0x0080; +pub const POLLNVAL: ::c_short = 0x1000; pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; @@ -350,6 +386,8 @@ pub const RUSAGE_SELF: ::c_int = 0; +pub const RTLD_LAXY: ::c_int = 0; + pub const NCCS: usize = 11; pub const O_RDONLY: ::c_int = 0x0000; @@ -432,6 +470,14 @@ pub const SIGXFSZ: ::c_int = 29; pub const SIGBUS: ::c_int = 30; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; +pub const SIG_SETMASK: ::c_int = 3; + +pub const SIGEV_NONE: ::c_int = 0; +pub const SIGEV_SIGNAL: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; + pub const EAI_SYSTEM: ::c_int = 11; pub const PROT_NONE: ::c_int = 0; @@ -451,7 +497,9 @@ pub const MAP_FILE: ::c_int = 0x00; pub const MAP_SHARED: ::c_int = 0x01; pub const MAP_PRIVATE: ::c_int = 0x02; -pub const MAP_FIXED: ::c_int = 0x004; +pub const MAP_FIXED: ::c_int = 0x04; +pub const MAP_ANONYMOUS: ::c_int = 0x08; +pub const MAP_ANON: ::c_int = MAP_ANONYMOUS; pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; @@ -459,86 +507,95 @@ pub const MS_INVALIDATE: ::c_int = 0x04; pub const MS_SYNC: ::c_int = 0x02; -pub const EPERM : ::c_int = -2147483633; -pub const ENOENT : ::c_int = -2147459069; -pub const ESRCH : ::c_int = -2147454963; -pub const EINTR : ::c_int = -2147483638; -pub const EIO : ::c_int = -2147483647; -pub const ENXIO : ::c_int = -2147454965; pub const E2BIG : ::c_int = -2147454975; -pub const ENOEXEC : ::c_int = -2147478782; -pub const EBADF : ::c_int = -2147459072; pub const ECHILD : ::c_int = -2147454974; pub const EDEADLK : ::c_int = -2147454973; -pub const ENOMEM : ::c_int = -2147454976; -pub const EACCES : ::c_int = -2147483646; -pub const EFAULT : ::c_int = -2147478783; -// pub const ENOTBLK : ::c_int = 15; -pub const EBUSY : ::c_int = -2147483634; -pub const EEXIST : ::c_int = -2147459070; -pub const EXDEV : ::c_int = -2147459061; -pub const ENODEV : ::c_int = -2147454969; -pub const ENOTDIR : ::c_int = -2147459067; -pub const EISDIR : ::c_int = -2147459063; -pub const EINVAL : ::c_int = -2147483643; +pub const EFBIG : ::c_int = -2147454972; +pub const EMLINK : ::c_int = -2147454971; pub const ENFILE : ::c_int = -2147454970; -pub const EMFILE : ::c_int = -2147459062; +pub const ENODEV : ::c_int = -2147454969; +pub const ENOLCK : ::c_int = -2147454968; +pub const ENOSYS : ::c_int = -2147454967; pub const ENOTTY : ::c_int = -2147454966; -pub const ETXTBSY : ::c_int = -2147454917; -pub const EFBIG : ::c_int = -2147454972; -pub const ENOSPC : ::c_int = -2147459065; +pub const ENXIO : ::c_int = -2147454965; pub const ESPIPE : ::c_int = -2147454964; -pub const EROFS : ::c_int = -2147459064; -pub const EMLINK : ::c_int = -2147454971; -pub const EPIPE : ::c_int = -2147459059; +pub const ESRCH : ::c_int = -2147454963; +pub const EFPOS : ::c_int = -2147457962; +pub const ESIGPARM : ::c_int = -2147457961; pub const EDOM : ::c_int = -2147454960; pub const ERANGE : ::c_int = -2147454959; -pub const EAGAIN : ::c_int = -2147483637; -pub const EWOULDBLOCK : ::c_int = -2147483637; - -pub const EINPROGRESS : ::c_int = -2147454940; -pub const EALREADY : ::c_int = -2147454939; -pub const ENOTSOCK : ::c_int = -2147454932; -pub const EDESTADDRREQ : ::c_int = -2147454928; -pub const EMSGSIZE : ::c_int = -2147454934; pub const EPROTOTYPE : ::c_int = -2147454958; -pub const ENOPROTOOPT : ::c_int = -2147454942; pub const EPROTONOSUPPORT : ::c_int = -2147454957; -pub const EOPNOTSUPP : ::c_int = -2147454933; pub const EPFNOSUPPORT : ::c_int = -2147454956; pub const EAFNOSUPPORT : ::c_int = -2147454955; pub const EADDRINUSE : ::c_int = -2147454954; pub const EADDRNOTAVAIL : ::c_int = -2147454953; -pub const ENETDOWN : ::c_int = -2147454953; +pub const ENETDOWN : ::c_int = -2147454952; pub const ENETUNREACH : ::c_int = -2147454951; pub const ENETRESET : ::c_int = -2147454950; pub const ECONNABORTED : ::c_int = -2147454949; pub const ECONNRESET : ::c_int = -2147454948; -pub const ENOBUFS : ::c_int = -2147454941; pub const EISCONN : ::c_int = -2147454947; pub const ENOTCONN : ::c_int = -2147454946; pub const ESHUTDOWN : ::c_int = -2147454945; -pub const ETIMEDOUT : ::c_int = -2147483639; pub const ECONNREFUSED : ::c_int = -2147454944; -pub const ELOOP : ::c_int = -2147459060; -pub const ENAMETOOLONG : ::c_int = -2147459068; -pub const EHOSTDOWN : ::c_int = -2147454931; pub const EHOSTUNREACH : ::c_int = -2147454943; -pub const ENOTEMPTY : ::c_int = -2147459066; -pub const EDQUOT : ::c_int = -2147454927; -pub const ESTALE : ::c_int = -2147454936; -pub const ENOLCK : ::c_int = -2147454968; -pub const ENOSYS : ::c_int = -2147454967; -pub const EIDRM : ::c_int = -2147454926; +pub const ENOPROTOOPT : ::c_int = -2147454942; +pub const ENOBUFS : ::c_int = -2147454941; +pub const EINPROGRESS : ::c_int = -2147454940; +pub const EALREADY : ::c_int = -2147454939; +pub const EILSEQ : ::c_int = -2147454938; pub const ENOMSG : ::c_int = -2147454937; +pub const ESTALE : ::c_int = -2147454936; pub const EOVERFLOW : ::c_int = -2147454935; -pub const ECANCELED : ::c_int = -2147454929; -pub const EILSEQ : ::c_int = -2147454938; -pub const ENOATTR : ::c_int = -2147454916; +pub const EMSGSIZE : ::c_int = -2147454934; +pub const EOPNOTSUPP : ::c_int = -2147454933; +pub const ENOTSOCK : ::c_int = -2147454932; +pub const EHOSTDOWN : ::c_int = -2147454931; pub const EBADMSG : ::c_int = -2147454930; +pub const ECANCELED : ::c_int = -2147454929; +pub const EDESTADDRREQ : ::c_int = -2147454928; +pub const EDQUOT : ::c_int = -2147454927; +pub const EIDRM : ::c_int = -2147454926; pub const EMULTIHOP : ::c_int = -2147454925; +pub const ENODATA : ::c_int = -2147454924; pub const ENOLINK : ::c_int = -2147454923; +pub const ENOSR : ::c_int = -2147454922; +pub const ENOSTR : ::c_int = -2147454921; +pub const ENOTSUP : ::c_int = -2147454920; pub const EPROTO : ::c_int = -2147454919; +pub const ETIME : ::c_int = -2147454918; +pub const ETXTBSY : ::c_int = -2147454917; +pub const ENOATTR : ::c_int = -2147454916; + +// INT_MIN +pub const ENOMEM : ::c_int = -2147454976; + +// POSIX errors that can be mapped to BeOS error codes +pub const EACCES : ::c_int = -2147483646; +pub const EINTR : ::c_int = -2147483638; +pub const EIO : ::c_int = -2147483647; +pub const EBUSY : ::c_int = -2147483634; +pub const EFAULT : ::c_int = -2147478783; +pub const ETIMEDOUT : ::c_int = -2147483639; +pub const EAGAIN : ::c_int = -2147483637; +pub const EWOULDBLOCK : ::c_int = -2147483637; +pub const EBADF : ::c_int = -2147459072; +pub const EEXIST : ::c_int = -2147459070; +pub const EINVAL : ::c_int = -2147483643; +pub const ENAMETOOLONG : ::c_int = -2147459068; +pub const ENOENT : ::c_int = -2147459069; +pub const EPERM : ::c_int = -2147483633; +pub const ENOTDIR : ::c_int = -2147459067; +pub const EISDIR : ::c_int = -2147459063; +pub const ENOTEMPTY : ::c_int = -2147459066; +pub const ENOSPC : ::c_int = -2147459065; +pub const EROFS : ::c_int = -2147459064; +pub const EMFILE : ::c_int = -2147459062; +pub const EXDEV : ::c_int = -2147459061; +pub const ELOOP : ::c_int = -2147459060; +pub const ENOEXEC : ::c_int = -2147478782; +pub const EPIPE : ::c_int = -2147459059; pub const IPPROTO_RAW: ::c_int = 255; @@ -551,10 +608,20 @@ pub const IFF_LOOPBACK: ::c_int = 0x0008; -pub const AF_UNIX: ::c_int = 9; +pub const AF_UNSEC: ::c_int = 0; pub const AF_INET: ::c_int = 1; -pub const AF_INET6: ::c_int = 6; -pub const SOCK_RAW: ::c_int = 3; +pub const AF_APPLETALK: ::c_int = 2; +pub const AF_ROUTE: ::c_int = 3; +pub const AF_LINK: ::c_int = 4; +pub const AF_INET6: ::c_int = 5; +pub const AF_DLI: ::c_int = 6; +pub const AF_IPX: ::c_int = 7; +pub const AF_NOTIFY: ::c_int = 8; +pub const AF_LOCAL: ::c_int = 9; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_BLUETOOTH: ::c_int = 10; +pub const AF_MAX: ::c_int = 11; + pub const IP_MULTICAST_TTL: ::c_int = 10; pub const IP_MULTICAST_LOOP: ::c_int = 11; pub const IP_TTL: ::c_int = 4; @@ -572,9 +639,17 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 29; pub const IPV6_V6ONLY: ::c_int = 30; -pub const SO_DEBUG: ::c_int = 0x00000004; - -pub const MSG_PEEK: ::c_int = 0x2; +pub const MSG_OOB: ::c_int = 0x0001; +pub const MSG_PEEK: ::c_int = 0x0002; +pub const MSG_DONTROUTE: ::c_int = 0x0004; +pub const MSG_EOR: ::c_int = 0x0008; +pub const MSG_TRUNC: ::c_int = 0x0010; +pub const MSG_CTRUNC: ::c_int = 0x0020; +pub const MSG_WAITALL: ::c_int = 0x0040; +pub const MSG_DONTWAIT: ::c_int = 0x0080; +pub const MSG_BCAST: ::c_int = 0x0100; +pub const MSG_MCAST: ::c_int = 0x0200; +pub const MSG_EOF: ::c_int = 0x0400; pub const MSG_NOSIGNAL: ::c_int = 0x0800; pub const SHUT_RD: ::c_int = 0; @@ -588,10 +663,18 @@ pub const SIGSTKSZ: ::size_t = 16384; -pub const SA_NODEFER: ::c_int = 0x08; +pub const PATH_MAX: ::c_int = 1024; + +pub const SA_NOCLDSTOP: ::c_int = 0x01; +pub const SA_NOCLDWAIT: ::c_int = 0x02; pub const SA_RESETHAND: ::c_int = 0x04; +pub const SA_NODEFER: ::c_int = 0x08; pub const SA_RESTART: ::c_int = 0x10; -pub const SA_NOCLDSTOP: ::c_int = 0x01; +pub const SA_ONSTACK: ::c_int = 0x20; +pub const SA_SIGINFO: ::c_int = 0x40; +pub const SA_NOMASK: ::c_int = SA_NODEFER; +pub const SA_STACK: ::c_int = SA_ONSTACK; +pub const SA_ONESHOT: ::c_int = SA_RESETHAND; pub const FD_SETSIZE: usize = 1024; @@ -603,21 +686,78 @@ pub const FOPEN_MAX: ::c_uint = 128; pub const L_tmpnam: ::c_uint = 512; pub const TMP_MAX: ::c_uint = 32768; + +pub const _PC_CHOWN_RESTRICTED: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_NO_TRUNC: ::c_int = 5; +pub const _PC_PATH_MAX: ::c_int = 6; +pub const _PC_PIPE_BUF: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_LINK_MAX: ::c_int = 25; +pub const _PC_SYNC_IO: ::c_int = 26; +pub const _PC_ASYNC_IO: ::c_int = 27; +pub const _PC_PRIO_IO: ::c_int = 28; +pub const _PC_SOCK_MAXBUF: ::c_int = 29; +pub const _PC_FILESIZEBITS: ::c_int = 30; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 31; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 32; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 33; +pub const _PC_REC_XFER_ALIGN: ::c_int = 34; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 35; +pub const _PC_SYMLINK_MAX: ::c_int = 36; +pub const _PC_2_SYMLINKS: ::c_int = 37; +pub const _PC_XATTR_EXISTS: ::c_int = 38; +pub const _PC_XATTR_ENABLED: ::c_int = 39; pub const FIONBIO: ::c_int = 0xbe000000; -pub const _SC_IOV_MAX : ::c_int = 32; +pub const _SC_ARG_MAX : ::c_int = 15; +pub const _SC_CHILD_MAX : ::c_int = 16; +pub const _SC_CLK_TCK : ::c_int = 17; +pub const _SC_JOB_CONTROL : ::c_int = 18; +pub const _SC_NGROUPS_MAX : ::c_int = 19; +pub const _SC_OPEN_MAX : ::c_int = 20; +pub const _SC_SAVED_IDS : ::c_int = 21; +pub const _SC_STREAM_MAX : ::c_int = 22; +pub const _SC_TZNAME_MAX : ::c_int = 23; +pub const _SC_VERSION : ::c_int = 24; pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 25; pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 26; pub const _SC_PAGESIZE : ::c_int = 27; +pub const _SC_PAGE_SIZE : ::c_int = 27; +pub const _SC_SEM_NSEMS_MAX : ::c_int = 28; +pub const _SC_SEM_VALUE_MAX : ::c_int = 29; +pub const _SC_SEMAPHORES : ::c_int = 30; +pub const _SC_THREADS : ::c_int = 31; +pub const _SC_IOV_MAX : ::c_int = 32; +pub const _SC_UIO_MAXIOV : ::c_int = 32; +pub const _SC_NPROCESSORS_CONF : ::c_int = 34; +pub const _SC_NPROCESSORS_ONLN : ::c_int = 35; +pub const _SC_ATEXIT_MAX : ::c_int = 37; +pub const _SC_PASS_MAX : ::c_int = 39; +pub const _SC_PHYS_PAGES : ::c_int = 40; +pub const _SC_AVPHYS_PAGES : ::c_int = 41; +pub const _SC_PIPE : ::c_int = 42; +pub const _SC_SELECT : ::c_int = 43; +pub const _SC_POLL : ::c_int = 44; +pub const _SC_MAPPED_FILES : ::c_int = 45; +pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46; +pub const _SC_THREAD_STACK_MIN : ::c_int = 47; pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 48; pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 49; pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 50; -pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46; -pub const _SC_THREAD_STACK_MIN : ::c_int = 47; -pub const _SC_THREADS : ::c_int = 31; -pub const _SC_ATEXIT_MAX : ::c_int = 37; +pub const _SC_REALTIME_SIGNALS : ::c_int = 51; +pub const _SC_MEMORY_PROTECTION : ::c_int = 52; +pub const _SC_SIGQUEUE_MAX : ::c_int = 53; +pub const _SC_RTSIG_MAX : ::c_int = 54; +pub const _SC_MONOTONIC_CLOCK : ::c_int = 55; +pub const _SC_DELAYTIMER_MAX : ::c_int = 56; +pub const _SC_TIMER_MAX : ::c_int = 57; +pub const _SC_TIMERS : ::c_int = 58; +pub const _SC_CPUTIME : ::c_int = 59; +pub const _SC_THREAD_CPUTIME : ::c_int = 60; pub const PTHREAD_STACK_MIN: ::size_t = 8192; @@ -637,7 +777,7 @@ }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { flags: 0, - owner: 0, + owner: -1, lock_sem: 0, lock_count: 0, reader_count: 0, @@ -652,20 +792,17 @@ pub const FIOCLEX: c_ulong = 0; // TODO: does not exist on Haiku! -pub const SA_ONSTACK: c_ulong = 0x20; -pub const SA_SIGINFO: c_ulong = 0x40; -pub const SA_NOCLDWAIT: c_ulong = 0x02; - -pub const SIG_SETMASK: ::c_int = 3; - pub const RUSAGE_CHILDREN: ::c_int = -1; pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_SEQPACKET: ::c_int = 5; pub const SOL_SOCKET: ::c_int = -1; pub const SO_ACCEPTCONN: ::c_int = 0x00000001; pub const SO_BROADCAST: ::c_int = 0x00000002; +pub const SO_DEBUG: ::c_int = 0x00000004; pub const SO_DONTROUTE: ::c_int = 0x00000008; pub const SO_KEEPALIVE: ::c_int = 0x00000010; pub const SO_OOBINLINE: ::c_int = 0x00000020; @@ -685,6 +822,8 @@ pub const SO_BINDTODEVICE: ::c_int = 0x4000000a; pub const SO_PEERCRED: ::c_int = 0x4000000b; +pub const SCM_RIGHTS: ::c_int = 0x01; + pub const NI_MAXHOST: ::size_t = 1025; pub const WNOHANG: ::c_int = 0x01; @@ -711,34 +850,83 @@ pub const VSTART: usize = 8; pub const VSTOP: usize = 9; pub const VSUSP: usize = 10; -pub const OLCUC: ::tcflag_t = 0o000002; -pub const OCRNL: ::tcflag_t = 0o000010; -pub const ONOCR: ::tcflag_t = 0o000020; -pub const ONLRET: ::tcflag_t = 0o000040; -pub const OFILL: ::tcflag_t = 0o000100; -pub const OFDEL: ::tcflag_t = 0o000200; -pub const NLDLY: ::tcflag_t = 0o000400; -pub const NL0: ::tcflag_t = 0o000000; -pub const NL1: ::tcflag_t = 0o000400; -pub const CRDLY: ::tcflag_t = 0o003000; -pub const CR0: ::tcflag_t = 0o000000; -pub const CR1: ::tcflag_t = 0o001000; -pub const CR2: ::tcflag_t = 0o002000; -pub const CR3: ::tcflag_t = 0o003000; -pub const TABDLY: ::tcflag_t = 0o014000; -pub const TAB0: ::tcflag_t = 0o000000; -pub const TAB1: ::tcflag_t = 0o004000; -pub const TAB2: ::tcflag_t = 0o010000; -pub const TAB3: ::tcflag_t = 0o014000; -pub const BSDLY: ::tcflag_t = 0o020000; -pub const BS0: ::tcflag_t = 0o000000; -pub const BS1: ::tcflag_t = 0o020000; -pub const FFDLY: ::tcflag_t = 0o100000; -pub const FF0: ::tcflag_t = 0o000000; -pub const FF1: ::tcflag_t = 0o100000; -pub const VTDLY: ::tcflag_t = 0o040000; -pub const VT0: ::tcflag_t = 0o000000; -pub const VT1: ::tcflag_t = 0o040000; + +pub const IGNBRK: ::tcflag_t = 0x01; +pub const BRKINT: ::tcflag_t = 0x02; +pub const IGNPAR: ::tcflag_t = 0x04; +pub const PARMRK: ::tcflag_t = 0x08; +pub const INPCK: ::tcflag_t = 0x10; +pub const ISTRIP: ::tcflag_t = 0x20; +pub const INLCR: ::tcflag_t = 0x40; +pub const IGNCR: ::tcflag_t = 0x80; +pub const ICRNL: ::tcflag_t = 0x100; +pub const IUCLC: ::tcflag_t = 0x200; +pub const IXON: ::tcflag_t = 0x400; +pub const IXANY: ::tcflag_t = 0x800; +pub const IXOFF: ::tcflag_t = 0x1000; + +pub const OPOST: ::tcflag_t = 0x00000001; +pub const OLCUC: ::tcflag_t = 0x00000002; +pub const ONLCR: ::tcflag_t = 0x00000004; +pub const OCRNL: ::tcflag_t = 0x00000008; +pub const ONOCR: ::tcflag_t = 0x00000010; +pub const ONLRET: ::tcflag_t = 0x00000020; +pub const OFILL: ::tcflag_t = 0x00000040; +pub const OFDEL: ::tcflag_t = 0x00000080; +pub const NLDLY: ::tcflag_t = 0x00000100; +pub const NL0: ::tcflag_t = 0x00000000; +pub const NL1: ::tcflag_t = 0x00000100; +pub const CRDLY: ::tcflag_t = 0x00000600; +pub const CR0: ::tcflag_t = 0x00000000; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const TABDLY: ::tcflag_t = 0x00001800; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const BSDLY: ::tcflag_t = 0x00002000; +pub const BS0: ::tcflag_t = 0x00000000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VTDLY: ::tcflag_t = 0x00004000; +pub const VT0: ::tcflag_t = 0x00000000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const FFDLY: ::tcflag_t = 0x00008000; +pub const FF0: ::tcflag_t = 0x00000000; +pub const FF1: ::tcflag_t = 0x00008000; + +pub const CSIZE: ::tcflag_t = 0x00000020; +pub const CS5: ::tcflag_t = 0x00000000; +pub const CS6: ::tcflag_t = 0x00000000; +pub const CS7: ::tcflag_t = 0x00000000; +pub const CS8: ::tcflag_t = 0x00000020; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const XLOBLK: ::tcflag_t = 0x00001000; +pub const CTSFLOW: ::tcflag_t = 0x00002000; +pub const RTSFLOW: ::tcflag_t = 0x00004000; +pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW; + +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const XCASE: ::tcflag_t = 0x00000004; +pub const ECHO: ::tcflag_t = 0x00000008; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const IEXTEN: ::tcflag_t = 0x00000200; +pub const ECHOCTL: ::tcflag_t = 0x00000400; +pub const ECHOPRT: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00001000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const PENDIN: ::tcflag_t = 0x00004000; pub const TCGB_CTS: ::c_int = 0x01; pub const TCGB_DSR: ::c_int = 0x02; @@ -752,6 +940,40 @@ pub const TIOCM_DTR: ::c_int = 0x10; pub const TIOCM_RTS: ::c_int = 0x20; +pub const B0: speed_t = 0x00; +pub const B50: speed_t = 0x01; +pub const B75: speed_t = 0x02; +pub const B110: speed_t = 0x03; +pub const B134: speed_t = 0x04; +pub const B150: speed_t = 0x05; +pub const B200: speed_t = 0x06; +pub const B300: speed_t = 0x07; +pub const B600: speed_t = 0x08; +pub const B1200: speed_t = 0x09; +pub const B1800: speed_t = 0x0A; +pub const B2400: speed_t = 0x0B; +pub const B4800: speed_t = 0x0C; +pub const B9600: speed_t = 0x0D; +pub const B19200: speed_t = 0x0E; +pub const B38400: speed_t = 0x0F; +pub const B57600: speed_t = 0x10; +pub const B115200: speed_t = 0x11; +pub const B230400: speed_t = 0x12; +pub const B31250: speed_t = 0x13; + +pub const TCSANOW: ::c_int = 0x01; +pub const TCSADRAIN: ::c_int = 0x02; +pub const TCSAFLUSH: ::c_int = 0x04; + +pub const TCOOFF: ::c_int = 0x01; +pub const TCOON: ::c_int = 0x02; +pub const TCIOFF: ::c_int = 0x04; +pub const TCION: ::c_int = 0x08; + +pub const TCIFLUSH: ::c_int = 0x01; +pub const TCOFLUSH: ::c_int = 0x02; +pub const TCIOFLUSH: ::c_int = 0x03; + f! { pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; @@ -780,21 +1002,47 @@ } pub fn WIFEXITED(status: ::c_int) -> bool { - (status >> 8) == 0 + (status & !0xff) == 0 } pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { (status & 0xff) } + pub fn WIFSIGNALED(status: ::c_int) -> bool { + ((status >> 8) & 0xff) != 0 + } + pub fn WTERMSIG(status: ::c_int) -> ::c_int { (status >> 8) & 0xff } + + pub fn WIFSTOPPED(status: ::c_int) -> bool { + ((status >> 16) & 0xff) != 0 + } + + pub fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 16) & 0xff + } + + // actually WIFCORED, but this is used everywhere else + pub fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x10000) != 0 + } + + pub fn WIFCONTINUED(status: ::c_int) -> bool { + (status & 0x20000) != 0 + } } +#[link(name = "bsd")] extern { pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int; pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int; + pub fn pthread_create(thread: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void) -> ::c_int; pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t, guardsize: *mut ::size_t) -> ::c_int; pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t, @@ -834,6 +1082,8 @@ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) + -> ::c_int; pub fn shm_unlink(name: *const ::c_char) -> ::c_int; pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); @@ -923,6 +1173,16 @@ link_name = "popen$UNIX2003")] pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn openpty(amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize) -> ::c_int; + pub fn forkpty(amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize) -> ::pid_t; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; } cfg_if! { diff -Nru distinst-0.1.0/vendor/libc/src/unix/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -34,9 +34,14 @@ pub tv_usec: suseconds_t, } + // linux x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 pub struct timespec { pub tv_sec: time_t, - pub tv_nsec: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tv_nsec: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tv_nsec: ::c_long, } pub struct rlimit { @@ -48,19 +53,47 @@ pub ru_utime: timeval, pub ru_stime: timeval, pub ru_maxrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad1: u32, pub ru_ixrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad2: u32, pub ru_idrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad3: u32, pub ru_isrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad4: u32, pub ru_minflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad5: u32, pub ru_majflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad6: u32, pub ru_nswap: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad7: u32, pub ru_inblock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad8: u32, pub ru_oublock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad9: u32, pub ru_msgsnd: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad10: u32, pub ru_msgrcv: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad11: u32, pub ru_nsignals: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad12: u32, pub ru_nvcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad13: u32, pub ru_nivcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad14: u32, #[cfg(any(target_env = "musl", target_os = "emscripten"))] __reserved: [c_long; 16], @@ -138,6 +171,19 @@ pub tms_cutime: ::clock_t, pub tms_cstime: ::clock_t, } + + pub struct servent { + pub s_name: *mut ::c_char, + pub s_aliases: *mut *mut ::c_char, + pub s_port: ::c_int, + pub s_proto: *mut ::c_char, + } + + pub struct protoent { + pub p_name: *mut ::c_char, + pub p_aliases: *mut *mut ::c_char, + pub p_proto: ::c_int, + } } pub const SIG_DFL: sighandler_t = 0 as sighandler_t; @@ -163,17 +209,8 @@ pub const S_ISGID: ::c_int = 0x400; pub const S_ISVTX: ::c_int = 0x200; -pub const POLLIN: ::c_short = 0x1; -pub const POLLPRI: ::c_short = 0x2; -pub const POLLOUT: ::c_short = 0x4; -pub const POLLERR: ::c_short = 0x8; -pub const POLLHUP: ::c_short = 0x10; -pub const POLLNVAL: ::c_short = 0x20; - pub const IF_NAMESIZE: ::size_t = 16; -pub const RTLD_LAZY: ::c_int = 0x1; - pub const LOG_EMERG: ::c_int = 0; pub const LOG_ALERT: ::c_int = 1; pub const LOG_CRIT: ::c_int = 2; @@ -234,8 +271,8 @@ // on dox builds don't pull in anything } else if #[cfg(target_os = "l4re")] { // required libraries for L4Re are linked externally, ATM - } else if #[cfg(all(not(stdbuild), feature = "use_std"))] { - // cargo build, don't pull in anything extra as the libstd dep + } else if #[cfg(feature = "use_std")] { + // cargo build, don't pull in anything extra as the libstd dep // already pulls in all libs. } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] { #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))] @@ -264,7 +301,7 @@ extern {} } else if #[cfg(target_os = "fuchsia")] { #[link(name = "c")] - #[link(name = "mxio")] + #[link(name = "fdio")] extern {} } else if #[cfg(target_env = "newlib")] { #[link(name = "c")] @@ -708,7 +745,8 @@ #[cfg_attr(any( all(target_os = "linux", not(target_env = "musl")), target_os = "freebsd", - target_os = "dragonfly"), + target_os = "dragonfly", + target_os = "haiku"), link_name = "__res_init")] #[cfg_attr(any(target_os = "macos", target_os = "ios"), link_name = "res_9_init")] @@ -734,6 +772,10 @@ dev: ::dev_t) -> ::c_int; pub fn uname(buf: *mut ::utsname) -> ::c_int; pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn getservbyname(name: *const ::c_char, + proto: *const ::c_char) -> *mut servent; + pub fn getprotobyname(name: *const ::c_char) -> *mut protoent; + pub fn getprotobynumber(proto: ::c_int) -> *mut protoent; pub fn chroot(name: *const ::c_char) -> ::c_int; #[cfg_attr(all(target_os = "macos", target_arch = "x86"), link_name = "usleep$UNIX2003")] diff -Nru distinst-0.1.0/vendor/libc/src/unix/newlib/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/newlib/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/newlib/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/newlib/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -435,6 +435,15 @@ pub const O_ACCMODE: ::c_int = 3; pub const O_CLOEXEC: ::c_int = 0x80000; +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + +pub const RTLD_LAZY: ::c_int = 0x1; + pub const STDIN_FILENO: ::c_int = 0; pub const STDOUT_FILENO: ::c_int = 1; pub const STDERR_FILENO: ::c_int = 2; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/android/b32/arm.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/b32/arm.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/android/b32/arm.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/b32/arm.rs 2017-12-21 19:00:07.000000000 +0000 @@ -6,7 +6,352 @@ pub const O_NOFOLLOW: ::c_int = 0x8000; pub const O_LARGEFILE: ::c_int = 0o400000; +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS_getdents: ::c_long = 141; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_arm_fadvise64_64: ::c_long = 270; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_arm_sync_file_range: ::c_long = 341; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/android/b64/aarch64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/b64/aarch64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/android/b64/aarch64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/b64/aarch64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -54,10 +54,272 @@ pub const O_NOFOLLOW: ::c_int = 0x8000; pub const O_LARGEFILE: ::c_int = 0o400000; +pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 5120; + +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_arch_specific_syscall: ::c_long = 244; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; pub const SYS_memfd_create: ::c_long = 279; - -pub const SIGSTKSZ: ::size_t = 16384; -pub const MINSIGSTKSZ: ::size_t = 5120; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_syscalls: ::c_long = 291; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/android/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/android/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/android/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -84,6 +84,17 @@ pub c_cc: [::cc_t; ::NCCS], } + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + pub struct flock { pub l_type: ::c_short, pub l_whence: ::c_short, @@ -168,6 +179,12 @@ pub ssi_addr_lsb: ::uint16_t, _pad: [::uint8_t; 46], } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } } pub const O_TRUNC: ::c_int = 512; @@ -485,6 +502,8 @@ pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; pub const SOL_SOCKET: ::c_int = 1; pub const SOL_SCTP: ::c_int = 132; @@ -499,6 +518,27 @@ #[doc(hidden)] pub const PF_MAX: ::c_int = AF_MAX; +/* DCCP socket options */ +pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; +pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; +pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; +pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; +pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; +pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; +pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; +pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; +pub const DCCP_SOCKOPT_CCID: ::c_int = 13; +pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; +pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; +pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; +pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; +pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; +pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; + +/// maximum number of services provided on the same listening port +pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; + pub const SO_REUSEADDR: ::c_int = 2; pub const SO_TYPE: ::c_int = 3; pub const SO_ERROR: ::c_int = 4; @@ -734,6 +774,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -1009,6 +1050,8 @@ in_fd: ::c_int, offset: *mut off_t, count: ::size_t) -> ::ssize_t; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] pub fn getgrgid_r(uid: ::uid_t, @@ -1065,6 +1108,7 @@ group: ::gid_t, groups: *mut ::gid_t, ngroups: *mut ::c_int) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, pshared: *mut ::c_int) -> ::c_int; #[cfg_attr(all(target_os = "macos", target_arch = "x86"), diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mips32.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mips32.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mips32.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mips32.rs 2017-12-21 19:00:07.000000000 +0000 @@ -269,8 +269,369 @@ pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; -// Valid for O32 -pub const SYS_pivot_root: ::c_long = 4216; -pub const SYS_gettid: ::c_long = 4222; -pub const SYS_perf_event_open: ::c_long = 4333; -pub const SYS_memfd_create: ::c_long = 4354; +pub const SYS_syscall: ::c_long = 4000 + 0; +pub const SYS_exit: ::c_long = 4000 + 1; +pub const SYS_fork: ::c_long = 4000 + 2; +pub const SYS_read: ::c_long = 4000 + 3; +pub const SYS_write: ::c_long = 4000 + 4; +pub const SYS_open: ::c_long = 4000 + 5; +pub const SYS_close: ::c_long = 4000 + 6; +pub const SYS_waitpid: ::c_long = 4000 + 7; +pub const SYS_creat: ::c_long = 4000 + 8; +pub const SYS_link: ::c_long = 4000 + 9; +pub const SYS_unlink: ::c_long = 4000 + 10; +pub const SYS_execve: ::c_long = 4000 + 11; +pub const SYS_chdir: ::c_long = 4000 + 12; +pub const SYS_time: ::c_long = 4000 + 13; +pub const SYS_mknod: ::c_long = 4000 + 14; +pub const SYS_chmod: ::c_long = 4000 + 15; +pub const SYS_lchown: ::c_long = 4000 + 16; +pub const SYS_break: ::c_long = 4000 + 17; +pub const SYS_unused18: ::c_long = 4000 + 18; +pub const SYS_lseek: ::c_long = 4000 + 19; +pub const SYS_getpid: ::c_long = 4000 + 20; +pub const SYS_mount: ::c_long = 4000 + 21; +pub const SYS_umount: ::c_long = 4000 + 22; +pub const SYS_setuid: ::c_long = 4000 + 23; +pub const SYS_getuid: ::c_long = 4000 + 24; +pub const SYS_stime: ::c_long = 4000 + 25; +pub const SYS_ptrace: ::c_long = 4000 + 26; +pub const SYS_alarm: ::c_long = 4000 + 27; +pub const SYS_unused28: ::c_long = 4000 + 28; +pub const SYS_pause: ::c_long = 4000 + 29; +pub const SYS_utime: ::c_long = 4000 + 30; +pub const SYS_stty: ::c_long = 4000 + 31; +pub const SYS_gtty: ::c_long = 4000 + 32; +pub const SYS_access: ::c_long = 4000 + 33; +pub const SYS_nice: ::c_long = 4000 + 34; +pub const SYS_ftime: ::c_long = 4000 + 35; +pub const SYS_sync: ::c_long = 4000 + 36; +pub const SYS_kill: ::c_long = 4000 + 37; +pub const SYS_rename: ::c_long = 4000 + 38; +pub const SYS_mkdir: ::c_long = 4000 + 39; +pub const SYS_rmdir: ::c_long = 4000 + 40; +pub const SYS_dup: ::c_long = 4000 + 41; +pub const SYS_pipe: ::c_long = 4000 + 42; +pub const SYS_times: ::c_long = 4000 + 43; +pub const SYS_prof: ::c_long = 4000 + 44; +pub const SYS_brk: ::c_long = 4000 + 45; +pub const SYS_setgid: ::c_long = 4000 + 46; +pub const SYS_getgid: ::c_long = 4000 + 47; +pub const SYS_signal: ::c_long = 4000 + 48; +pub const SYS_geteuid: ::c_long = 4000 + 49; +pub const SYS_getegid: ::c_long = 4000 + 50; +pub const SYS_acct: ::c_long = 4000 + 51; +pub const SYS_umount2: ::c_long = 4000 + 52; +pub const SYS_lock: ::c_long = 4000 + 53; +pub const SYS_ioctl: ::c_long = 4000 + 54; +pub const SYS_fcntl: ::c_long = 4000 + 55; +pub const SYS_mpx: ::c_long = 4000 + 56; +pub const SYS_setpgid: ::c_long = 4000 + 57; +pub const SYS_ulimit: ::c_long = 4000 + 58; +pub const SYS_unused59: ::c_long = 4000 + 59; +pub const SYS_umask: ::c_long = 4000 + 60; +pub const SYS_chroot: ::c_long = 4000 + 61; +pub const SYS_ustat: ::c_long = 4000 + 62; +pub const SYS_dup2: ::c_long = 4000 + 63; +pub const SYS_getppid: ::c_long = 4000 + 64; +pub const SYS_getpgrp: ::c_long = 4000 + 65; +pub const SYS_setsid: ::c_long = 4000 + 66; +pub const SYS_sigaction: ::c_long = 4000 + 67; +pub const SYS_sgetmask: ::c_long = 4000 + 68; +pub const SYS_ssetmask: ::c_long = 4000 + 69; +pub const SYS_setreuid: ::c_long = 4000 + 70; +pub const SYS_setregid: ::c_long = 4000 + 71; +pub const SYS_sigsuspend: ::c_long = 4000 + 72; +pub const SYS_sigpending: ::c_long = 4000 + 73; +pub const SYS_sethostname: ::c_long = 4000 + 74; +pub const SYS_setrlimit: ::c_long = 4000 + 75; +pub const SYS_getrlimit: ::c_long = 4000 + 76; +pub const SYS_getrusage: ::c_long = 4000 + 77; +pub const SYS_gettimeofday: ::c_long = 4000 + 78; +pub const SYS_settimeofday: ::c_long = 4000 + 79; +pub const SYS_getgroups: ::c_long = 4000 + 80; +pub const SYS_setgroups: ::c_long = 4000 + 81; +pub const SYS_reserved82: ::c_long = 4000 + 82; +pub const SYS_symlink: ::c_long = 4000 + 83; +pub const SYS_unused84: ::c_long = 4000 + 84; +pub const SYS_readlink: ::c_long = 4000 + 85; +pub const SYS_uselib: ::c_long = 4000 + 86; +pub const SYS_swapon: ::c_long = 4000 + 87; +pub const SYS_reboot: ::c_long = 4000 + 88; +pub const SYS_readdir: ::c_long = 4000 + 89; +pub const SYS_mmap: ::c_long = 4000 + 90; +pub const SYS_munmap: ::c_long = 4000 + 91; +pub const SYS_truncate: ::c_long = 4000 + 92; +pub const SYS_ftruncate: ::c_long = 4000 + 93; +pub const SYS_fchmod: ::c_long = 4000 + 94; +pub const SYS_fchown: ::c_long = 4000 + 95; +pub const SYS_getpriority: ::c_long = 4000 + 96; +pub const SYS_setpriority: ::c_long = 4000 + 97; +pub const SYS_profil: ::c_long = 4000 + 98; +pub const SYS_statfs: ::c_long = 4000 + 99; +pub const SYS_fstatfs: ::c_long = 4000 + 100; +pub const SYS_ioperm: ::c_long = 4000 + 101; +pub const SYS_socketcall: ::c_long = 4000 + 102; +pub const SYS_syslog: ::c_long = 4000 + 103; +pub const SYS_setitimer: ::c_long = 4000 + 104; +pub const SYS_getitimer: ::c_long = 4000 + 105; +pub const SYS_stat: ::c_long = 4000 + 106; +pub const SYS_lstat: ::c_long = 4000 + 107; +pub const SYS_fstat: ::c_long = 4000 + 108; +pub const SYS_unused109: ::c_long = 4000 + 109; +pub const SYS_iopl: ::c_long = 4000 + 110; +pub const SYS_vhangup: ::c_long = 4000 + 111; +pub const SYS_idle: ::c_long = 4000 + 112; +pub const SYS_vm86: ::c_long = 4000 + 113; +pub const SYS_wait4: ::c_long = 4000 + 114; +pub const SYS_swapoff: ::c_long = 4000 + 115; +pub const SYS_sysinfo: ::c_long = 4000 + 116; +pub const SYS_ipc: ::c_long = 4000 + 117; +pub const SYS_fsync: ::c_long = 4000 + 118; +pub const SYS_sigreturn: ::c_long = 4000 + 119; +pub const SYS_clone: ::c_long = 4000 + 120; +pub const SYS_setdomainname: ::c_long = 4000 + 121; +pub const SYS_uname: ::c_long = 4000 + 122; +pub const SYS_modify_ldt: ::c_long = 4000 + 123; +pub const SYS_adjtimex: ::c_long = 4000 + 124; +pub const SYS_mprotect: ::c_long = 4000 + 125; +pub const SYS_sigprocmask: ::c_long = 4000 + 126; +pub const SYS_create_module: ::c_long = 4000 + 127; +pub const SYS_init_module: ::c_long = 4000 + 128; +pub const SYS_delete_module: ::c_long = 4000 + 129; +pub const SYS_get_kernel_syms: ::c_long = 4000 + 130; +pub const SYS_quotactl: ::c_long = 4000 + 131; +pub const SYS_getpgid: ::c_long = 4000 + 132; +pub const SYS_fchdir: ::c_long = 4000 + 133; +pub const SYS_bdflush: ::c_long = 4000 + 134; +pub const SYS_sysfs: ::c_long = 4000 + 135; +pub const SYS_personality: ::c_long = 4000 + 136; +pub const SYS_afs_syscall: ::c_long = 4000 + 137; +pub const SYS_setfsuid: ::c_long = 4000 + 138; +pub const SYS_setfsgid: ::c_long = 4000 + 139; +pub const SYS__llseek: ::c_long = 4000 + 140; +pub const SYS_getdents: ::c_long = 4000 + 141; +pub const SYS__newselect: ::c_long = 4000 + 142; +pub const SYS_flock: ::c_long = 4000 + 143; +pub const SYS_msync: ::c_long = 4000 + 144; +pub const SYS_readv: ::c_long = 4000 + 145; +pub const SYS_writev: ::c_long = 4000 + 146; +pub const SYS_cacheflush: ::c_long = 4000 + 147; +pub const SYS_cachectl: ::c_long = 4000 + 148; +pub const SYS_sysmips: ::c_long = 4000 + 149; +pub const SYS_unused150: ::c_long = 4000 + 150; +pub const SYS_getsid: ::c_long = 4000 + 151; +pub const SYS_fdatasync: ::c_long = 4000 + 152; +pub const SYS__sysctl: ::c_long = 4000 + 153; +pub const SYS_mlock: ::c_long = 4000 + 154; +pub const SYS_munlock: ::c_long = 4000 + 155; +pub const SYS_mlockall: ::c_long = 4000 + 156; +pub const SYS_munlockall: ::c_long = 4000 + 157; +pub const SYS_sched_setparam: ::c_long = 4000 + 158; +pub const SYS_sched_getparam: ::c_long = 4000 + 159; +pub const SYS_sched_setscheduler: ::c_long = 4000 + 160; +pub const SYS_sched_getscheduler: ::c_long = 4000 + 161; +pub const SYS_sched_yield: ::c_long = 4000 + 162; +pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163; +pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164; +pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165; +pub const SYS_nanosleep: ::c_long = 4000 + 166; +pub const SYS_mremap: ::c_long = 4000 + 167; +pub const SYS_accept: ::c_long = 4000 + 168; +pub const SYS_bind: ::c_long = 4000 + 169; +pub const SYS_connect: ::c_long = 4000 + 170; +pub const SYS_getpeername: ::c_long = 4000 + 171; +pub const SYS_getsockname: ::c_long = 4000 + 172; +pub const SYS_getsockopt: ::c_long = 4000 + 173; +pub const SYS_listen: ::c_long = 4000 + 174; +pub const SYS_recv: ::c_long = 4000 + 175; +pub const SYS_recvfrom: ::c_long = 4000 + 176; +pub const SYS_recvmsg: ::c_long = 4000 + 177; +pub const SYS_send: ::c_long = 4000 + 178; +pub const SYS_sendmsg: ::c_long = 4000 + 179; +pub const SYS_sendto: ::c_long = 4000 + 180; +pub const SYS_setsockopt: ::c_long = 4000 + 181; +pub const SYS_shutdown: ::c_long = 4000 + 182; +pub const SYS_socket: ::c_long = 4000 + 183; +pub const SYS_socketpair: ::c_long = 4000 + 184; +pub const SYS_setresuid: ::c_long = 4000 + 185; +pub const SYS_getresuid: ::c_long = 4000 + 186; +pub const SYS_query_module: ::c_long = 4000 + 187; +pub const SYS_poll: ::c_long = 4000 + 188; +pub const SYS_nfsservctl: ::c_long = 4000 + 189; +pub const SYS_setresgid: ::c_long = 4000 + 190; +pub const SYS_getresgid: ::c_long = 4000 + 191; +pub const SYS_prctl: ::c_long = 4000 + 192; +pub const SYS_rt_sigreturn: ::c_long = 4000 + 193; +pub const SYS_rt_sigaction: ::c_long = 4000 + 194; +pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195; +pub const SYS_rt_sigpending: ::c_long = 4000 + 196; +pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197; +pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198; +pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199; +pub const SYS_pread64: ::c_long = 4000 + 200; +pub const SYS_pwrite64: ::c_long = 4000 + 201; +pub const SYS_chown: ::c_long = 4000 + 202; +pub const SYS_getcwd: ::c_long = 4000 + 203; +pub const SYS_capget: ::c_long = 4000 + 204; +pub const SYS_capset: ::c_long = 4000 + 205; +pub const SYS_sigaltstack: ::c_long = 4000 + 206; +pub const SYS_sendfile: ::c_long = 4000 + 207; +pub const SYS_getpmsg: ::c_long = 4000 + 208; +pub const SYS_putpmsg: ::c_long = 4000 + 209; +pub const SYS_mmap2: ::c_long = 4000 + 210; +pub const SYS_truncate64: ::c_long = 4000 + 211; +pub const SYS_ftruncate64: ::c_long = 4000 + 212; +pub const SYS_stat64: ::c_long = 4000 + 213; +pub const SYS_lstat64: ::c_long = 4000 + 214; +pub const SYS_fstat64: ::c_long = 4000 + 215; +pub const SYS_pivot_root: ::c_long = 4000 + 216; +pub const SYS_mincore: ::c_long = 4000 + 217; +pub const SYS_madvise: ::c_long = 4000 + 218; +pub const SYS_getdents64: ::c_long = 4000 + 219; +pub const SYS_fcntl64: ::c_long = 4000 + 220; +pub const SYS_reserved221: ::c_long = 4000 + 221; +pub const SYS_gettid: ::c_long = 4000 + 222; +pub const SYS_readahead: ::c_long = 4000 + 223; +pub const SYS_setxattr: ::c_long = 4000 + 224; +pub const SYS_lsetxattr: ::c_long = 4000 + 225; +pub const SYS_fsetxattr: ::c_long = 4000 + 226; +pub const SYS_getxattr: ::c_long = 4000 + 227; +pub const SYS_lgetxattr: ::c_long = 4000 + 228; +pub const SYS_fgetxattr: ::c_long = 4000 + 229; +pub const SYS_listxattr: ::c_long = 4000 + 230; +pub const SYS_llistxattr: ::c_long = 4000 + 231; +pub const SYS_flistxattr: ::c_long = 4000 + 232; +pub const SYS_removexattr: ::c_long = 4000 + 233; +pub const SYS_lremovexattr: ::c_long = 4000 + 234; +pub const SYS_fremovexattr: ::c_long = 4000 + 235; +pub const SYS_tkill: ::c_long = 4000 + 236; +pub const SYS_sendfile64: ::c_long = 4000 + 237; +pub const SYS_futex: ::c_long = 4000 + 238; +pub const SYS_sched_setaffinity: ::c_long = 4000 + 239; +pub const SYS_sched_getaffinity: ::c_long = 4000 + 240; +pub const SYS_io_setup: ::c_long = 4000 + 241; +pub const SYS_io_destroy: ::c_long = 4000 + 242; +pub const SYS_io_getevents: ::c_long = 4000 + 243; +pub const SYS_io_submit: ::c_long = 4000 + 244; +pub const SYS_io_cancel: ::c_long = 4000 + 245; +pub const SYS_exit_group: ::c_long = 4000 + 246; +pub const SYS_lookup_dcookie: ::c_long = 4000 + 247; +pub const SYS_epoll_create: ::c_long = 4000 + 248; +pub const SYS_epoll_ctl: ::c_long = 4000 + 249; +pub const SYS_epoll_wait: ::c_long = 4000 + 250; +pub const SYS_remap_file_pages: ::c_long = 4000 + 251; +pub const SYS_set_tid_address: ::c_long = 4000 + 252; +pub const SYS_restart_syscall: ::c_long = 4000 + 253; +pub const SYS_fadvise64: ::c_long = 4000 + 254; +pub const SYS_statfs64: ::c_long = 4000 + 255; +pub const SYS_fstatfs64: ::c_long = 4000 + 256; +pub const SYS_timer_create: ::c_long = 4000 + 257; +pub const SYS_timer_settime: ::c_long = 4000 + 258; +pub const SYS_timer_gettime: ::c_long = 4000 + 259; +pub const SYS_timer_getoverrun: ::c_long = 4000 + 260; +pub const SYS_timer_delete: ::c_long = 4000 + 261; +pub const SYS_clock_settime: ::c_long = 4000 + 262; +pub const SYS_clock_gettime: ::c_long = 4000 + 263; +pub const SYS_clock_getres: ::c_long = 4000 + 264; +pub const SYS_clock_nanosleep: ::c_long = 4000 + 265; +pub const SYS_tgkill: ::c_long = 4000 + 266; +pub const SYS_utimes: ::c_long = 4000 + 267; +pub const SYS_mbind: ::c_long = 4000 + 268; +pub const SYS_get_mempolicy: ::c_long = 4000 + 269; +pub const SYS_set_mempolicy: ::c_long = 4000 + 270; +pub const SYS_mq_open: ::c_long = 4000 + 271; +pub const SYS_mq_unlink: ::c_long = 4000 + 272; +pub const SYS_mq_timedsend: ::c_long = 4000 + 273; +pub const SYS_mq_timedreceive: ::c_long = 4000 + 274; +pub const SYS_mq_notify: ::c_long = 4000 + 275; +pub const SYS_mq_getsetattr: ::c_long = 4000 + 276; +pub const SYS_vserver: ::c_long = 4000 + 277; +pub const SYS_waitid: ::c_long = 4000 + 278; +/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */ +pub const SYS_add_key: ::c_long = 4000 + 280; +pub const SYS_request_key: ::c_long = 4000 + 281; +pub const SYS_keyctl: ::c_long = 4000 + 282; +pub const SYS_set_thread_area: ::c_long = 4000 + 283; +pub const SYS_inotify_init: ::c_long = 4000 + 284; +pub const SYS_inotify_add_watch: ::c_long = 4000 + 285; +pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286; +pub const SYS_migrate_pages: ::c_long = 4000 + 287; +pub const SYS_openat: ::c_long = 4000 + 288; +pub const SYS_mkdirat: ::c_long = 4000 + 289; +pub const SYS_mknodat: ::c_long = 4000 + 290; +pub const SYS_fchownat: ::c_long = 4000 + 291; +pub const SYS_futimesat: ::c_long = 4000 + 292; +pub const SYS_fstatat64: ::c_long = 4000 + 293; +pub const SYS_unlinkat: ::c_long = 4000 + 294; +pub const SYS_renameat: ::c_long = 4000 + 295; +pub const SYS_linkat: ::c_long = 4000 + 296; +pub const SYS_symlinkat: ::c_long = 4000 + 297; +pub const SYS_readlinkat: ::c_long = 4000 + 298; +pub const SYS_fchmodat: ::c_long = 4000 + 299; +pub const SYS_faccessat: ::c_long = 4000 + 300; +pub const SYS_pselect6: ::c_long = 4000 + 301; +pub const SYS_ppoll: ::c_long = 4000 + 302; +pub const SYS_unshare: ::c_long = 4000 + 303; +pub const SYS_splice: ::c_long = 4000 + 304; +pub const SYS_sync_file_range: ::c_long = 4000 + 305; +pub const SYS_tee: ::c_long = 4000 + 306; +pub const SYS_vmsplice: ::c_long = 4000 + 307; +pub const SYS_move_pages: ::c_long = 4000 + 308; +pub const SYS_set_robust_list: ::c_long = 4000 + 309; +pub const SYS_get_robust_list: ::c_long = 4000 + 310; +pub const SYS_kexec_load: ::c_long = 4000 + 311; +pub const SYS_getcpu: ::c_long = 4000 + 312; +pub const SYS_epoll_pwait: ::c_long = 4000 + 313; +pub const SYS_ioprio_set: ::c_long = 4000 + 314; +pub const SYS_ioprio_get: ::c_long = 4000 + 315; +pub const SYS_utimensat: ::c_long = 4000 + 316; +pub const SYS_signalfd: ::c_long = 4000 + 317; +pub const SYS_timerfd: ::c_long = 4000 + 318; +pub const SYS_eventfd: ::c_long = 4000 + 319; +pub const SYS_fallocate: ::c_long = 4000 + 320; +pub const SYS_timerfd_create: ::c_long = 4000 + 321; +pub const SYS_timerfd_gettime: ::c_long = 4000 + 322; +pub const SYS_timerfd_settime: ::c_long = 4000 + 323; +pub const SYS_signalfd4: ::c_long = 4000 + 324; +pub const SYS_eventfd2: ::c_long = 4000 + 325; +pub const SYS_epoll_create1: ::c_long = 4000 + 326; +pub const SYS_dup3: ::c_long = 4000 + 327; +pub const SYS_pipe2: ::c_long = 4000 + 328; +pub const SYS_inotify_init1: ::c_long = 4000 + 329; +pub const SYS_preadv: ::c_long = 4000 + 330; +pub const SYS_pwritev: ::c_long = 4000 + 331; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332; +pub const SYS_perf_event_open: ::c_long = 4000 + 333; +pub const SYS_accept4: ::c_long = 4000 + 334; +pub const SYS_recvmmsg: ::c_long = 4000 + 335; +pub const SYS_fanotify_init: ::c_long = 4000 + 336; +pub const SYS_fanotify_mark: ::c_long = 4000 + 337; +pub const SYS_prlimit64: ::c_long = 4000 + 338; +pub const SYS_name_to_handle_at: ::c_long = 4000 + 339; +pub const SYS_open_by_handle_at: ::c_long = 4000 + 340; +pub const SYS_clock_adjtime: ::c_long = 4000 + 341; +pub const SYS_syncfs: ::c_long = 4000 + 342; +pub const SYS_sendmmsg: ::c_long = 4000 + 343; +pub const SYS_setns: ::c_long = 4000 + 344; +pub const SYS_process_vm_readv: ::c_long = 4000 + 345; +pub const SYS_process_vm_writev: ::c_long = 4000 + 346; +pub const SYS_kcmp: ::c_long = 4000 + 347; +pub const SYS_finit_module: ::c_long = 4000 + 348; +pub const SYS_sched_setattr: ::c_long = 4000 + 349; +pub const SYS_sched_getattr: ::c_long = 4000 + 350; +pub const SYS_renameat2: ::c_long = 4000 + 351; +pub const SYS_seccomp: ::c_long = 4000 + 352; +pub const SYS_getrandom: ::c_long = 4000 + 353; +pub const SYS_memfd_create: ::c_long = 4000 + 354; +pub const SYS_bpf: ::c_long = 4000 + 355; +pub const SYS_execveat: ::c_long = 4000 + 356; +pub const SYS_userfaultfd: ::c_long = 4000 + 357; +pub const SYS_membarrier: ::c_long = 4000 + 358; +pub const SYS_mlock2: ::c_long = 4000 + 359; +pub const SYS_copy_file_range: ::c_long = 4000 + 360; +pub const SYS_preadv2: ::c_long = 4000 + 361; +pub const SYS_pwritev2: ::c_long = 4000 + 362; +pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; +pub const SYS_pkey_alloc: ::c_long = 4000 + 364; +pub const SYS_pkey_free: ::c_long = 4000 + 365; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mips64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mips64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mips64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mips64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -251,7 +251,329 @@ pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff; -// Valid for n64 -pub const SYS_pivot_root: ::c_long = 5151; -pub const SYS_gettid: ::c_long = 5178; -pub const SYS_memfd_create: ::c_long = 5314; +pub const SYS_read: ::c_long = 5000 + 0; +pub const SYS_write: ::c_long = 5000 + 1; +pub const SYS_open: ::c_long = 5000 + 2; +pub const SYS_close: ::c_long = 5000 + 3; +pub const SYS_stat: ::c_long = 5000 + 4; +pub const SYS_fstat: ::c_long = 5000 + 5; +pub const SYS_lstat: ::c_long = 5000 + 6; +pub const SYS_poll: ::c_long = 5000 + 7; +pub const SYS_lseek: ::c_long = 5000 + 8; +pub const SYS_mmap: ::c_long = 5000 + 9; +pub const SYS_mprotect: ::c_long = 5000 + 10; +pub const SYS_munmap: ::c_long = 5000 + 11; +pub const SYS_brk: ::c_long = 5000 + 12; +pub const SYS_rt_sigaction: ::c_long = 5000 + 13; +pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; +pub const SYS_ioctl: ::c_long = 5000 + 15; +pub const SYS_pread64: ::c_long = 5000 + 16; +pub const SYS_pwrite64: ::c_long = 5000 + 17; +pub const SYS_readv: ::c_long = 5000 + 18; +pub const SYS_writev: ::c_long = 5000 + 19; +pub const SYS_access: ::c_long = 5000 + 20; +pub const SYS_pipe: ::c_long = 5000 + 21; +pub const SYS__newselect: ::c_long = 5000 + 22; +pub const SYS_sched_yield: ::c_long = 5000 + 23; +pub const SYS_mremap: ::c_long = 5000 + 24; +pub const SYS_msync: ::c_long = 5000 + 25; +pub const SYS_mincore: ::c_long = 5000 + 26; +pub const SYS_madvise: ::c_long = 5000 + 27; +pub const SYS_shmget: ::c_long = 5000 + 28; +pub const SYS_shmat: ::c_long = 5000 + 29; +pub const SYS_shmctl: ::c_long = 5000 + 30; +pub const SYS_dup: ::c_long = 5000 + 31; +pub const SYS_dup2: ::c_long = 5000 + 32; +pub const SYS_pause: ::c_long = 5000 + 33; +pub const SYS_nanosleep: ::c_long = 5000 + 34; +pub const SYS_getitimer: ::c_long = 5000 + 35; +pub const SYS_setitimer: ::c_long = 5000 + 36; +pub const SYS_alarm: ::c_long = 5000 + 37; +pub const SYS_getpid: ::c_long = 5000 + 38; +pub const SYS_sendfile: ::c_long = 5000 + 39; +pub const SYS_socket: ::c_long = 5000 + 40; +pub const SYS_connect: ::c_long = 5000 + 41; +pub const SYS_accept: ::c_long = 5000 + 42; +pub const SYS_sendto: ::c_long = 5000 + 43; +pub const SYS_recvfrom: ::c_long = 5000 + 44; +pub const SYS_sendmsg: ::c_long = 5000 + 45; +pub const SYS_recvmsg: ::c_long = 5000 + 46; +pub const SYS_shutdown: ::c_long = 5000 + 47; +pub const SYS_bind: ::c_long = 5000 + 48; +pub const SYS_listen: ::c_long = 5000 + 49; +pub const SYS_getsockname: ::c_long = 5000 + 50; +pub const SYS_getpeername: ::c_long = 5000 + 51; +pub const SYS_socketpair: ::c_long = 5000 + 52; +pub const SYS_setsockopt: ::c_long = 5000 + 53; +pub const SYS_getsockopt: ::c_long = 5000 + 54; +pub const SYS_clone: ::c_long = 5000 + 55; +pub const SYS_fork: ::c_long = 5000 + 56; +pub const SYS_execve: ::c_long = 5000 + 57; +pub const SYS_exit: ::c_long = 5000 + 58; +pub const SYS_wait4: ::c_long = 5000 + 59; +pub const SYS_kill: ::c_long = 5000 + 60; +pub const SYS_uname: ::c_long = 5000 + 61; +pub const SYS_semget: ::c_long = 5000 + 62; +pub const SYS_semop: ::c_long = 5000 + 63; +pub const SYS_semctl: ::c_long = 5000 + 64; +pub const SYS_shmdt: ::c_long = 5000 + 65; +pub const SYS_msgget: ::c_long = 5000 + 66; +pub const SYS_msgsnd: ::c_long = 5000 + 67; +pub const SYS_msgrcv: ::c_long = 5000 + 68; +pub const SYS_msgctl: ::c_long = 5000 + 69; +pub const SYS_fcntl: ::c_long = 5000 + 70; +pub const SYS_flock: ::c_long = 5000 + 71; +pub const SYS_fsync: ::c_long = 5000 + 72; +pub const SYS_fdatasync: ::c_long = 5000 + 73; +pub const SYS_truncate: ::c_long = 5000 + 74; +pub const SYS_ftruncate: ::c_long = 5000 + 75; +pub const SYS_getdents: ::c_long = 5000 + 76; +pub const SYS_getcwd: ::c_long = 5000 + 77; +pub const SYS_chdir: ::c_long = 5000 + 78; +pub const SYS_fchdir: ::c_long = 5000 + 79; +pub const SYS_rename: ::c_long = 5000 + 80; +pub const SYS_mkdir: ::c_long = 5000 + 81; +pub const SYS_rmdir: ::c_long = 5000 + 82; +pub const SYS_creat: ::c_long = 5000 + 83; +pub const SYS_link: ::c_long = 5000 + 84; +pub const SYS_unlink: ::c_long = 5000 + 85; +pub const SYS_symlink: ::c_long = 5000 + 86; +pub const SYS_readlink: ::c_long = 5000 + 87; +pub const SYS_chmod: ::c_long = 5000 + 88; +pub const SYS_fchmod: ::c_long = 5000 + 89; +pub const SYS_chown: ::c_long = 5000 + 90; +pub const SYS_fchown: ::c_long = 5000 + 91; +pub const SYS_lchown: ::c_long = 5000 + 92; +pub const SYS_umask: ::c_long = 5000 + 93; +pub const SYS_gettimeofday: ::c_long = 5000 + 94; +pub const SYS_getrlimit: ::c_long = 5000 + 95; +pub const SYS_getrusage: ::c_long = 5000 + 96; +pub const SYS_sysinfo: ::c_long = 5000 + 97; +pub const SYS_times: ::c_long = 5000 + 98; +pub const SYS_ptrace: ::c_long = 5000 + 99; +pub const SYS_getuid: ::c_long = 5000 + 100; +pub const SYS_syslog: ::c_long = 5000 + 101; +pub const SYS_getgid: ::c_long = 5000 + 102; +pub const SYS_setuid: ::c_long = 5000 + 103; +pub const SYS_setgid: ::c_long = 5000 + 104; +pub const SYS_geteuid: ::c_long = 5000 + 105; +pub const SYS_getegid: ::c_long = 5000 + 106; +pub const SYS_setpgid: ::c_long = 5000 + 107; +pub const SYS_getppid: ::c_long = 5000 + 108; +pub const SYS_getpgrp: ::c_long = 5000 + 109; +pub const SYS_setsid: ::c_long = 5000 + 110; +pub const SYS_setreuid: ::c_long = 5000 + 111; +pub const SYS_setregid: ::c_long = 5000 + 112; +pub const SYS_getgroups: ::c_long = 5000 + 113; +pub const SYS_setgroups: ::c_long = 5000 + 114; +pub const SYS_setresuid: ::c_long = 5000 + 115; +pub const SYS_getresuid: ::c_long = 5000 + 116; +pub const SYS_setresgid: ::c_long = 5000 + 117; +pub const SYS_getresgid: ::c_long = 5000 + 118; +pub const SYS_getpgid: ::c_long = 5000 + 119; +pub const SYS_setfsuid: ::c_long = 5000 + 120; +pub const SYS_setfsgid: ::c_long = 5000 + 121; +pub const SYS_getsid: ::c_long = 5000 + 122; +pub const SYS_capget: ::c_long = 5000 + 123; +pub const SYS_capset: ::c_long = 5000 + 124; +pub const SYS_rt_sigpending: ::c_long = 5000 + 125; +pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126; +pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127; +pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128; +pub const SYS_sigaltstack: ::c_long = 5000 + 129; +pub const SYS_utime: ::c_long = 5000 + 130; +pub const SYS_mknod: ::c_long = 5000 + 131; +pub const SYS_personality: ::c_long = 5000 + 132; +pub const SYS_ustat: ::c_long = 5000 + 133; +pub const SYS_statfs: ::c_long = 5000 + 134; +pub const SYS_fstatfs: ::c_long = 5000 + 135; +pub const SYS_sysfs: ::c_long = 5000 + 136; +pub const SYS_getpriority: ::c_long = 5000 + 137; +pub const SYS_setpriority: ::c_long = 5000 + 138; +pub const SYS_sched_setparam: ::c_long = 5000 + 139; +pub const SYS_sched_getparam: ::c_long = 5000 + 140; +pub const SYS_sched_setscheduler: ::c_long = 5000 + 141; +pub const SYS_sched_getscheduler: ::c_long = 5000 + 142; +pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143; +pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144; +pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145; +pub const SYS_mlock: ::c_long = 5000 + 146; +pub const SYS_munlock: ::c_long = 5000 + 147; +pub const SYS_mlockall: ::c_long = 5000 + 148; +pub const SYS_munlockall: ::c_long = 5000 + 149; +pub const SYS_vhangup: ::c_long = 5000 + 150; +pub const SYS_pivot_root: ::c_long = 5000 + 151; +pub const SYS__sysctl: ::c_long = 5000 + 152; +pub const SYS_prctl: ::c_long = 5000 + 153; +pub const SYS_adjtimex: ::c_long = 5000 + 154; +pub const SYS_setrlimit: ::c_long = 5000 + 155; +pub const SYS_chroot: ::c_long = 5000 + 156; +pub const SYS_sync: ::c_long = 5000 + 157; +pub const SYS_acct: ::c_long = 5000 + 158; +pub const SYS_settimeofday: ::c_long = 5000 + 159; +pub const SYS_mount: ::c_long = 5000 + 160; +pub const SYS_umount2: ::c_long = 5000 + 161; +pub const SYS_swapon: ::c_long = 5000 + 162; +pub const SYS_swapoff: ::c_long = 5000 + 163; +pub const SYS_reboot: ::c_long = 5000 + 164; +pub const SYS_sethostname: ::c_long = 5000 + 165; +pub const SYS_setdomainname: ::c_long = 5000 + 166; +pub const SYS_create_module: ::c_long = 5000 + 167; +pub const SYS_init_module: ::c_long = 5000 + 168; +pub const SYS_delete_module: ::c_long = 5000 + 169; +pub const SYS_get_kernel_syms: ::c_long = 5000 + 170; +pub const SYS_query_module: ::c_long = 5000 + 171; +pub const SYS_quotactl: ::c_long = 5000 + 172; +pub const SYS_nfsservctl: ::c_long = 5000 + 173; +pub const SYS_getpmsg: ::c_long = 5000 + 174; +pub const SYS_putpmsg: ::c_long = 5000 + 175; +pub const SYS_afs_syscall: ::c_long = 5000 + 176; +pub const SYS_reserved177: ::c_long = 5000 + 177; +pub const SYS_gettid: ::c_long = 5000 + 178; +pub const SYS_readahead: ::c_long = 5000 + 179; +pub const SYS_setxattr: ::c_long = 5000 + 180; +pub const SYS_lsetxattr: ::c_long = 5000 + 181; +pub const SYS_fsetxattr: ::c_long = 5000 + 182; +pub const SYS_getxattr: ::c_long = 5000 + 183; +pub const SYS_lgetxattr: ::c_long = 5000 + 184; +pub const SYS_fgetxattr: ::c_long = 5000 + 185; +pub const SYS_listxattr: ::c_long = 5000 + 186; +pub const SYS_llistxattr: ::c_long = 5000 + 187; +pub const SYS_flistxattr: ::c_long = 5000 + 188; +pub const SYS_removexattr: ::c_long = 5000 + 189; +pub const SYS_lremovexattr: ::c_long = 5000 + 190; +pub const SYS_fremovexattr: ::c_long = 5000 + 191; +pub const SYS_tkill: ::c_long = 5000 + 192; +pub const SYS_reserved193: ::c_long = 5000 + 193; +pub const SYS_futex: ::c_long = 5000 + 194; +pub const SYS_sched_setaffinity: ::c_long = 5000 + 195; +pub const SYS_sched_getaffinity: ::c_long = 5000 + 196; +pub const SYS_cacheflush: ::c_long = 5000 + 197; +pub const SYS_cachectl: ::c_long = 5000 + 198; +pub const SYS_sysmips: ::c_long = 5000 + 199; +pub const SYS_io_setup: ::c_long = 5000 + 200; +pub const SYS_io_destroy: ::c_long = 5000 + 201; +pub const SYS_io_getevents: ::c_long = 5000 + 202; +pub const SYS_io_submit: ::c_long = 5000 + 203; +pub const SYS_io_cancel: ::c_long = 5000 + 204; +pub const SYS_exit_group: ::c_long = 5000 + 205; +pub const SYS_lookup_dcookie: ::c_long = 5000 + 206; +pub const SYS_epoll_create: ::c_long = 5000 + 207; +pub const SYS_epoll_ctl: ::c_long = 5000 + 208; +pub const SYS_epoll_wait: ::c_long = 5000 + 209; +pub const SYS_remap_file_pages: ::c_long = 5000 + 210; +pub const SYS_rt_sigreturn: ::c_long = 5000 + 211; +pub const SYS_set_tid_address: ::c_long = 5000 + 212; +pub const SYS_restart_syscall: ::c_long = 5000 + 213; +pub const SYS_semtimedop: ::c_long = 5000 + 214; +pub const SYS_fadvise64: ::c_long = 5000 + 215; +pub const SYS_timer_create: ::c_long = 5000 + 216; +pub const SYS_timer_settime: ::c_long = 5000 + 217; +pub const SYS_timer_gettime: ::c_long = 5000 + 218; +pub const SYS_timer_getoverrun: ::c_long = 5000 + 219; +pub const SYS_timer_delete: ::c_long = 5000 + 220; +pub const SYS_clock_settime: ::c_long = 5000 + 221; +pub const SYS_clock_gettime: ::c_long = 5000 + 222; +pub const SYS_clock_getres: ::c_long = 5000 + 223; +pub const SYS_clock_nanosleep: ::c_long = 5000 + 224; +pub const SYS_tgkill: ::c_long = 5000 + 225; +pub const SYS_utimes: ::c_long = 5000 + 226; +pub const SYS_mbind: ::c_long = 5000 + 227; +pub const SYS_get_mempolicy: ::c_long = 5000 + 228; +pub const SYS_set_mempolicy: ::c_long = 5000 + 229; +pub const SYS_mq_open: ::c_long = 5000 + 230; +pub const SYS_mq_unlink: ::c_long = 5000 + 231; +pub const SYS_mq_timedsend: ::c_long = 5000 + 232; +pub const SYS_mq_timedreceive: ::c_long = 5000 + 233; +pub const SYS_mq_notify: ::c_long = 5000 + 234; +pub const SYS_mq_getsetattr: ::c_long = 5000 + 235; +pub const SYS_vserver: ::c_long = 5000 + 236; +pub const SYS_waitid: ::c_long = 5000 + 237; +/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */ +pub const SYS_add_key: ::c_long = 5000 + 239; +pub const SYS_request_key: ::c_long = 5000 + 240; +pub const SYS_keyctl: ::c_long = 5000 + 241; +pub const SYS_set_thread_area: ::c_long = 5000 + 242; +pub const SYS_inotify_init: ::c_long = 5000 + 243; +pub const SYS_inotify_add_watch: ::c_long = 5000 + 244; +pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245; +pub const SYS_migrate_pages: ::c_long = 5000 + 246; +pub const SYS_openat: ::c_long = 5000 + 247; +pub const SYS_mkdirat: ::c_long = 5000 + 248; +pub const SYS_mknodat: ::c_long = 5000 + 249; +pub const SYS_fchownat: ::c_long = 5000 + 250; +pub const SYS_futimesat: ::c_long = 5000 + 251; +pub const SYS_newfstatat: ::c_long = 5000 + 252; +pub const SYS_unlinkat: ::c_long = 5000 + 253; +pub const SYS_renameat: ::c_long = 5000 + 254; +pub const SYS_linkat: ::c_long = 5000 + 255; +pub const SYS_symlinkat: ::c_long = 5000 + 256; +pub const SYS_readlinkat: ::c_long = 5000 + 257; +pub const SYS_fchmodat: ::c_long = 5000 + 258; +pub const SYS_faccessat: ::c_long = 5000 + 259; +pub const SYS_pselect6: ::c_long = 5000 + 260; +pub const SYS_ppoll: ::c_long = 5000 + 261; +pub const SYS_unshare: ::c_long = 5000 + 262; +pub const SYS_splice: ::c_long = 5000 + 263; +pub const SYS_sync_file_range: ::c_long = 5000 + 264; +pub const SYS_tee: ::c_long = 5000 + 265; +pub const SYS_vmsplice: ::c_long = 5000 + 266; +pub const SYS_move_pages: ::c_long = 5000 + 267; +pub const SYS_set_robust_list: ::c_long = 5000 + 268; +pub const SYS_get_robust_list: ::c_long = 5000 + 269; +pub const SYS_kexec_load: ::c_long = 5000 + 270; +pub const SYS_getcpu: ::c_long = 5000 + 271; +pub const SYS_epoll_pwait: ::c_long = 5000 + 272; +pub const SYS_ioprio_set: ::c_long = 5000 + 273; +pub const SYS_ioprio_get: ::c_long = 5000 + 274; +pub const SYS_utimensat: ::c_long = 5000 + 275; +pub const SYS_signalfd: ::c_long = 5000 + 276; +pub const SYS_timerfd: ::c_long = 5000 + 277; +pub const SYS_eventfd: ::c_long = 5000 + 278; +pub const SYS_fallocate: ::c_long = 5000 + 279; +pub const SYS_timerfd_create: ::c_long = 5000 + 280; +pub const SYS_timerfd_gettime: ::c_long = 5000 + 281; +pub const SYS_timerfd_settime: ::c_long = 5000 + 282; +pub const SYS_signalfd4: ::c_long = 5000 + 283; +pub const SYS_eventfd2: ::c_long = 5000 + 284; +pub const SYS_epoll_create1: ::c_long = 5000 + 285; +pub const SYS_dup3: ::c_long = 5000 + 286; +pub const SYS_pipe2: ::c_long = 5000 + 287; +pub const SYS_inotify_init1: ::c_long = 5000 + 288; +pub const SYS_preadv: ::c_long = 5000 + 289; +pub const SYS_pwritev: ::c_long = 5000 + 290; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291; +pub const SYS_perf_event_open: ::c_long = 5000 + 292; +pub const SYS_accept4: ::c_long = 5000 + 293; +pub const SYS_recvmmsg: ::c_long = 5000 + 294; +pub const SYS_fanotify_init: ::c_long = 5000 + 295; +pub const SYS_fanotify_mark: ::c_long = 5000 + 296; +pub const SYS_prlimit64: ::c_long = 5000 + 297; +pub const SYS_name_to_handle_at: ::c_long = 5000 + 298; +pub const SYS_open_by_handle_at: ::c_long = 5000 + 299; +pub const SYS_clock_adjtime: ::c_long = 5000 + 300; +pub const SYS_syncfs: ::c_long = 5000 + 301; +pub const SYS_sendmmsg: ::c_long = 5000 + 302; +pub const SYS_setns: ::c_long = 5000 + 303; +pub const SYS_process_vm_readv: ::c_long = 5000 + 304; +pub const SYS_process_vm_writev: ::c_long = 5000 + 305; +pub const SYS_kcmp: ::c_long = 5000 + 306; +pub const SYS_finit_module: ::c_long = 5000 + 307; +pub const SYS_getdents64: ::c_long = 5000 + 308; +pub const SYS_sched_setattr: ::c_long = 5000 + 309; +pub const SYS_sched_getattr: ::c_long = 5000 + 310; +pub const SYS_renameat2: ::c_long = 5000 + 311; +pub const SYS_seccomp: ::c_long = 5000 + 312; +pub const SYS_getrandom: ::c_long = 5000 + 313; +pub const SYS_memfd_create: ::c_long = 5000 + 314; +pub const SYS_bpf: ::c_long = 5000 + 315; +pub const SYS_execveat: ::c_long = 5000 + 316; +pub const SYS_userfaultfd: ::c_long = 5000 + 317; +pub const SYS_membarrier: ::c_long = 5000 + 318; +pub const SYS_mlock2: ::c_long = 5000 + 319; +pub const SYS_copy_file_range: ::c_long = 5000 + 320; +pub const SYS_preadv2: ::c_long = 5000 + 321; +pub const SYS_pwritev2: ::c_long = 5000 + 322; +pub const SYS_pkey_mprotect: ::c_long = 5000 + 323; +pub const SYS_pkey_alloc: ::c_long = 5000 + 324; +pub const SYS_pkey_free: ::c_long = 5000 + 325; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mips/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mips/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,6 @@ +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; pub type fsblkcnt_t = ::c_ulong; pub type fsfilcnt_t = ::c_ulong; pub type rlim_t = c_ulong; @@ -25,6 +28,17 @@ __size: [::c_char; 32], __align: [::c_long; 0], } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 23], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const SFD_CLOEXEC: ::c_int = 0x080000; @@ -294,6 +308,8 @@ pub const SOCK_STREAM: ::c_int = 2; pub const SOCK_DGRAM: ::c_int = 1; pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; pub const SOL_SOCKET: ::c_int = 0xffff; @@ -353,6 +369,27 @@ pub const SO_ATTACH_BPF: ::c_int = 50; pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; +/* DCCP socket options */ +pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; +pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; +pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; +pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; +pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; +pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; +pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; +pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; +pub const DCCP_SOCKOPT_CCID: ::c_int = 13; +pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; +pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; +pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; +pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; +pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; +pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; + +/// maximum number of services provided on the same listening port +pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; + pub const FIOCLEX: ::c_ulong = 0x6601; pub const FIONBIO: ::c_ulong = 0x667e; @@ -591,6 +628,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -623,6 +661,11 @@ pub const SIGEV_THREAD_ID: ::c_int = 4; pub const EPOLLWAKEUP: ::c_int = 0x20000000; +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; + #[link(name = "util")] extern { pub fn sysctl(name: *mut ::c_int, diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -11,10 +11,7 @@ pub type off64_t = i64; pub type blkcnt64_t = i64; pub type rlim64_t = u64; -pub type shmatt_t = ::c_ulong; pub type mqd_t = ::c_int; -pub type msgqnum_t = ::c_ulong; -pub type msglen_t = ::c_ulong; pub type nfds_t = ::c_ulong; pub type nl_item = ::c_int; pub type idtype_t = ::c_uint; @@ -74,21 +71,33 @@ } pub struct pthread_mutex_t { - #[cfg(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc"))] + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] __align: [::c_long; 0], - #[cfg(not(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc")))] + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] __align: [::c_longlong; 0], size: [u8; __SIZEOF_PTHREAD_MUTEX_T], } pub struct pthread_rwlock_t { - #[cfg(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc"))] + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] __align: [::c_long; 0], - #[cfg(not(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc")))] + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] __align: [::c_longlong; 0], size: [u8; __SIZEOF_PTHREAD_RWLOCK_T], } @@ -100,8 +109,12 @@ __align: [::c_int; 0], #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", target_arch = "mips64", target_arch = "s390x", - target_arch = "sparc64")))] + target_arch = "sparc64", target_arch = "aarch64")))] __align: [::c_long; 0], + #[cfg(all(target_arch = "aarch64", target_env = "gnu"))] + __align: [::c_long; 0], + #[cfg(all(target_arch = "aarch64", target_env = "musl"))] + __align: [::c_int; 0], size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T], } @@ -159,7 +172,7 @@ pub f_favail: ::fsfilcnt_t, #[cfg(target_endian = "little")] pub f_fsid: ::c_ulong, - #[cfg(target_pointer_width = "32")] + #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] __f_unused: ::c_int, #[cfg(target_endian = "big")] pub f_fsid: ::c_ulong, @@ -200,22 +213,47 @@ _pad: [::uint8_t; 48], } + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + pub struct fsid_t { __val: [::c_int; 2], } + // x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 pub struct mq_attr { + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_flags: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_maxmsg: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_msgsize: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_curmsgs: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pad: [i64; 4], + + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] pub mq_flags: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] pub mq_maxmsg: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] pub mq_msgsize: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] pub mq_curmsgs: ::c_long, - pad: [::c_long; 4] + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pad: [::c_long; 4], } pub struct cpu_set_t { - #[cfg(target_pointer_width = "32")] + #[cfg(all(target_pointer_width = "32", + not(target_arch = "x86_64")))] bits: [u32; 32], - #[cfg(target_pointer_width = "64")] + #[cfg(not(all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] bits: [u64; 16], } @@ -621,6 +659,10 @@ pub const F_TLOCK: ::c_int = 2; pub const F_ULOCK: ::c_int = 0; +pub const IFF_LOWER_UP: ::c_int = 0x10000; +pub const IFF_DORMANT: ::c_int = 0x20000; +pub const IFF_ECHO: ::c_int = 0x40000; + pub const ST_RDONLY: ::c_ulong = 1; pub const ST_NOSUID: ::c_ulong = 2; pub const ST_NODEV: ::c_ulong = 4; @@ -660,24 +702,82 @@ pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; pub const __SIZEOF_PTHREAD_COND_T: usize = 48; +pub const RENAME_NOREPLACE: ::c_int = 1; +pub const RENAME_EXCHANGE: ::c_int = 2; +pub const RENAME_WHITEOUT: ::c_int = 4; + pub const SCHED_OTHER: ::c_int = 0; pub const SCHED_FIFO: ::c_int = 1; pub const SCHED_RR: ::c_int = 2; pub const SCHED_BATCH: ::c_int = 3; pub const SCHED_IDLE: ::c_int = 5; +// netinet/in.h +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +pub const IPPROTO_MTP: ::c_int = 92; +pub const IPPROTO_BEETPH: ::c_int = 94; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_COMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +pub const IPPROTO_MH: ::c_int = 135; +pub const IPPROTO_UDPLITE: ::c_int = 136; +pub const IPPROTO_MPLS: ::c_int = 137; +/// raw IP packet +pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_MAX: ::c_int = 256; + pub const AF_IB: ::c_int = 27; pub const AF_MPLS: ::c_int = 28; pub const AF_NFC: ::c_int = 39; pub const AF_VSOCK: ::c_int = 40; -#[doc(hidden)] -pub const AF_MAX: ::c_int = 42; pub const PF_IB: ::c_int = AF_IB; pub const PF_MPLS: ::c_int = AF_MPLS; pub const PF_NFC: ::c_int = AF_NFC; pub const PF_VSOCK: ::c_int = AF_VSOCK; -#[doc(hidden)] -pub const PF_MAX: ::c_int = AF_MAX; // System V IPC pub const IPC_PRIVATE: ::key_t = 0; @@ -717,6 +817,7 @@ pub const QFMT_VFS_OLD: ::c_int = 1; pub const QFMT_VFS_V0: ::c_int = 2; +pub const QFMT_VFS_V1: ::c_int = 4; pub const EFD_SEMAPHORE: ::c_int = 0x1; @@ -899,6 +1000,10 @@ pub const ITIMER_VIRTUAL: ::c_int = 1; pub const ITIMER_PROF: ::c_int = 2; +pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; +pub const TFD_TIMER_ABSTIME: ::c_int = 1; + pub const XATTR_CREATE: ::c_int = 0x1; pub const XATTR_REPLACE: ::c_int = 0x2; @@ -961,7 +1066,7 @@ pub fn minor(dev: ::dev_t) -> ::c_uint { let mut minor = 0; - minor |= (dev & 0xfffff00000000000) >> 0; + minor |= (dev & 0x00000000000000ff) >> 0; minor |= (dev & 0x00000ffffff00000) >> 12; minor as ::c_uint } @@ -1073,6 +1178,13 @@ pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int; + pub fn timerfd_gettime(fd: ::c_int, + curr_value: *mut itimerspec) -> ::c_int; + pub fn timerfd_settime(fd: ::c_int, + flags: ::c_int, + new_value: *const itimerspec, + old_value: *mut itimerspec) -> ::c_int; pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, @@ -1321,12 +1433,14 @@ buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; #[cfg_attr(all(target_os = "macos", target_arch = "x86"), link_name = "pthread_sigmask$UNIX2003")] pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; pub fn sem_unlink(name: *const ::c_char) -> ::c_int; pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/arm.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/arm.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/arm.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/arm.rs 2017-12-21 19:00:07.000000000 +0000 @@ -138,11 +138,22 @@ pub f_namemax: ::c_ulong, __f_spare: [::c_int; 6], } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } -pub const O_DIRECT: ::c_int = 0x4000; -pub const O_DIRECTORY: ::c_int = 0x10000; -pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; pub const O_ASYNC: ::c_int = 0x2000; pub const O_LARGEFILE: ::c_int = 0o400000; @@ -371,11 +382,6 @@ pub const FIONREAD: ::c_int = 0x541B; pub const TIOCCONS: ::c_int = 0x541D; -pub const SYS_pivot_root: ::c_long = 218; -pub const SYS_gettid: ::c_long = 224; -pub const SYS_perf_event_open: ::c_long = 364; -pub const SYS_memfd_create: ::c_long = 385; - pub const POLLWRNORM: ::c_short = 0x100; pub const POLLWRBAND: ::c_short = 0x200; @@ -390,3 +396,360 @@ pub const TIOCM_DSR: ::c_int = 0x100; pub const TIOCM_CD: ::c_int = TIOCM_CAR; pub const TIOCM_RI: ::c_int = TIOCM_RNG; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; + +#[doc(hidden)] +pub const AF_MAX: ::c_int = 43; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/mips.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/mips.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/mips.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/mips.rs 2017-12-21 19:00:07.000000000 +0000 @@ -149,6 +149,17 @@ pub f_namemax: ::c_ulong, __f_spare: [::c_int; 6], } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 23], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const O_DIRECT: ::c_int = 0o100000; @@ -382,12 +393,6 @@ pub const FIONREAD: ::c_int = 0x467F; pub const TIOCCONS: ::c_int = 0x80047478; -// Valid for O32 -pub const SYS_pivot_root: ::c_long = 4216; -pub const SYS_gettid: ::c_long = 4222; -pub const SYS_perf_event_open: ::c_long = 4333; -pub const SYS_memfd_create: ::c_long = 4354; - pub const POLLWRNORM: ::c_short = 0x4; pub const POLLWRBAND: ::c_short = 0x100; @@ -402,3 +407,367 @@ pub const TIOCM_RNG: ::c_int = 0x200; pub const TIOCM_RI: ::c_int = TIOCM_RNG; pub const TIOCM_DSR: ::c_int = 0x400; + +pub const SYS_syscall: ::c_long = 4000 + 0; +pub const SYS_exit: ::c_long = 4000 + 1; +pub const SYS_fork: ::c_long = 4000 + 2; +pub const SYS_read: ::c_long = 4000 + 3; +pub const SYS_write: ::c_long = 4000 + 4; +pub const SYS_open: ::c_long = 4000 + 5; +pub const SYS_close: ::c_long = 4000 + 6; +pub const SYS_waitpid: ::c_long = 4000 + 7; +pub const SYS_creat: ::c_long = 4000 + 8; +pub const SYS_link: ::c_long = 4000 + 9; +pub const SYS_unlink: ::c_long = 4000 + 10; +pub const SYS_execve: ::c_long = 4000 + 11; +pub const SYS_chdir: ::c_long = 4000 + 12; +pub const SYS_time: ::c_long = 4000 + 13; +pub const SYS_mknod: ::c_long = 4000 + 14; +pub const SYS_chmod: ::c_long = 4000 + 15; +pub const SYS_lchown: ::c_long = 4000 + 16; +pub const SYS_break: ::c_long = 4000 + 17; +pub const SYS_unused18: ::c_long = 4000 + 18; +pub const SYS_lseek: ::c_long = 4000 + 19; +pub const SYS_getpid: ::c_long = 4000 + 20; +pub const SYS_mount: ::c_long = 4000 + 21; +pub const SYS_umount: ::c_long = 4000 + 22; +pub const SYS_setuid: ::c_long = 4000 + 23; +pub const SYS_getuid: ::c_long = 4000 + 24; +pub const SYS_stime: ::c_long = 4000 + 25; +pub const SYS_ptrace: ::c_long = 4000 + 26; +pub const SYS_alarm: ::c_long = 4000 + 27; +pub const SYS_unused28: ::c_long = 4000 + 28; +pub const SYS_pause: ::c_long = 4000 + 29; +pub const SYS_utime: ::c_long = 4000 + 30; +pub const SYS_stty: ::c_long = 4000 + 31; +pub const SYS_gtty: ::c_long = 4000 + 32; +pub const SYS_access: ::c_long = 4000 + 33; +pub const SYS_nice: ::c_long = 4000 + 34; +pub const SYS_ftime: ::c_long = 4000 + 35; +pub const SYS_sync: ::c_long = 4000 + 36; +pub const SYS_kill: ::c_long = 4000 + 37; +pub const SYS_rename: ::c_long = 4000 + 38; +pub const SYS_mkdir: ::c_long = 4000 + 39; +pub const SYS_rmdir: ::c_long = 4000 + 40; +pub const SYS_dup: ::c_long = 4000 + 41; +pub const SYS_pipe: ::c_long = 4000 + 42; +pub const SYS_times: ::c_long = 4000 + 43; +pub const SYS_prof: ::c_long = 4000 + 44; +pub const SYS_brk: ::c_long = 4000 + 45; +pub const SYS_setgid: ::c_long = 4000 + 46; +pub const SYS_getgid: ::c_long = 4000 + 47; +pub const SYS_signal: ::c_long = 4000 + 48; +pub const SYS_geteuid: ::c_long = 4000 + 49; +pub const SYS_getegid: ::c_long = 4000 + 50; +pub const SYS_acct: ::c_long = 4000 + 51; +pub const SYS_umount2: ::c_long = 4000 + 52; +pub const SYS_lock: ::c_long = 4000 + 53; +pub const SYS_ioctl: ::c_long = 4000 + 54; +pub const SYS_fcntl: ::c_long = 4000 + 55; +pub const SYS_mpx: ::c_long = 4000 + 56; +pub const SYS_setpgid: ::c_long = 4000 + 57; +pub const SYS_ulimit: ::c_long = 4000 + 58; +pub const SYS_unused59: ::c_long = 4000 + 59; +pub const SYS_umask: ::c_long = 4000 + 60; +pub const SYS_chroot: ::c_long = 4000 + 61; +pub const SYS_ustat: ::c_long = 4000 + 62; +pub const SYS_dup2: ::c_long = 4000 + 63; +pub const SYS_getppid: ::c_long = 4000 + 64; +pub const SYS_getpgrp: ::c_long = 4000 + 65; +pub const SYS_setsid: ::c_long = 4000 + 66; +pub const SYS_sigaction: ::c_long = 4000 + 67; +pub const SYS_sgetmask: ::c_long = 4000 + 68; +pub const SYS_ssetmask: ::c_long = 4000 + 69; +pub const SYS_setreuid: ::c_long = 4000 + 70; +pub const SYS_setregid: ::c_long = 4000 + 71; +pub const SYS_sigsuspend: ::c_long = 4000 + 72; +pub const SYS_sigpending: ::c_long = 4000 + 73; +pub const SYS_sethostname: ::c_long = 4000 + 74; +pub const SYS_setrlimit: ::c_long = 4000 + 75; +pub const SYS_getrlimit: ::c_long = 4000 + 76; +pub const SYS_getrusage: ::c_long = 4000 + 77; +pub const SYS_gettimeofday: ::c_long = 4000 + 78; +pub const SYS_settimeofday: ::c_long = 4000 + 79; +pub const SYS_getgroups: ::c_long = 4000 + 80; +pub const SYS_setgroups: ::c_long = 4000 + 81; +pub const SYS_reserved82: ::c_long = 4000 + 82; +pub const SYS_symlink: ::c_long = 4000 + 83; +pub const SYS_unused84: ::c_long = 4000 + 84; +pub const SYS_readlink: ::c_long = 4000 + 85; +pub const SYS_uselib: ::c_long = 4000 + 86; +pub const SYS_swapon: ::c_long = 4000 + 87; +pub const SYS_reboot: ::c_long = 4000 + 88; +pub const SYS_readdir: ::c_long = 4000 + 89; +pub const SYS_mmap: ::c_long = 4000 + 90; +pub const SYS_munmap: ::c_long = 4000 + 91; +pub const SYS_truncate: ::c_long = 4000 + 92; +pub const SYS_ftruncate: ::c_long = 4000 + 93; +pub const SYS_fchmod: ::c_long = 4000 + 94; +pub const SYS_fchown: ::c_long = 4000 + 95; +pub const SYS_getpriority: ::c_long = 4000 + 96; +pub const SYS_setpriority: ::c_long = 4000 + 97; +pub const SYS_profil: ::c_long = 4000 + 98; +pub const SYS_statfs: ::c_long = 4000 + 99; +pub const SYS_fstatfs: ::c_long = 4000 + 100; +pub const SYS_ioperm: ::c_long = 4000 + 101; +pub const SYS_socketcall: ::c_long = 4000 + 102; +pub const SYS_syslog: ::c_long = 4000 + 103; +pub const SYS_setitimer: ::c_long = 4000 + 104; +pub const SYS_getitimer: ::c_long = 4000 + 105; +pub const SYS_stat: ::c_long = 4000 + 106; +pub const SYS_lstat: ::c_long = 4000 + 107; +pub const SYS_fstat: ::c_long = 4000 + 108; +pub const SYS_unused109: ::c_long = 4000 + 109; +pub const SYS_iopl: ::c_long = 4000 + 110; +pub const SYS_vhangup: ::c_long = 4000 + 111; +pub const SYS_idle: ::c_long = 4000 + 112; +pub const SYS_vm86: ::c_long = 4000 + 113; +pub const SYS_wait4: ::c_long = 4000 + 114; +pub const SYS_swapoff: ::c_long = 4000 + 115; +pub const SYS_sysinfo: ::c_long = 4000 + 116; +pub const SYS_ipc: ::c_long = 4000 + 117; +pub const SYS_fsync: ::c_long = 4000 + 118; +pub const SYS_sigreturn: ::c_long = 4000 + 119; +pub const SYS_clone: ::c_long = 4000 + 120; +pub const SYS_setdomainname: ::c_long = 4000 + 121; +pub const SYS_uname: ::c_long = 4000 + 122; +pub const SYS_modify_ldt: ::c_long = 4000 + 123; +pub const SYS_adjtimex: ::c_long = 4000 + 124; +pub const SYS_mprotect: ::c_long = 4000 + 125; +pub const SYS_sigprocmask: ::c_long = 4000 + 126; +pub const SYS_create_module: ::c_long = 4000 + 127; +pub const SYS_init_module: ::c_long = 4000 + 128; +pub const SYS_delete_module: ::c_long = 4000 + 129; +pub const SYS_get_kernel_syms: ::c_long = 4000 + 130; +pub const SYS_quotactl: ::c_long = 4000 + 131; +pub const SYS_getpgid: ::c_long = 4000 + 132; +pub const SYS_fchdir: ::c_long = 4000 + 133; +pub const SYS_bdflush: ::c_long = 4000 + 134; +pub const SYS_sysfs: ::c_long = 4000 + 135; +pub const SYS_personality: ::c_long = 4000 + 136; +pub const SYS_afs_syscall: ::c_long = 4000 + 137; +pub const SYS_setfsuid: ::c_long = 4000 + 138; +pub const SYS_setfsgid: ::c_long = 4000 + 139; +pub const SYS__llseek: ::c_long = 4000 + 140; +pub const SYS_getdents: ::c_long = 4000 + 141; +pub const SYS_flock: ::c_long = 4000 + 143; +pub const SYS_msync: ::c_long = 4000 + 144; +pub const SYS_readv: ::c_long = 4000 + 145; +pub const SYS_writev: ::c_long = 4000 + 146; +pub const SYS_cacheflush: ::c_long = 4000 + 147; +pub const SYS_cachectl: ::c_long = 4000 + 148; +pub const SYS_sysmips: ::c_long = 4000 + 149; +pub const SYS_unused150: ::c_long = 4000 + 150; +pub const SYS_getsid: ::c_long = 4000 + 151; +pub const SYS_fdatasync: ::c_long = 4000 + 152; +pub const SYS__sysctl: ::c_long = 4000 + 153; +pub const SYS_mlock: ::c_long = 4000 + 154; +pub const SYS_munlock: ::c_long = 4000 + 155; +pub const SYS_mlockall: ::c_long = 4000 + 156; +pub const SYS_munlockall: ::c_long = 4000 + 157; +pub const SYS_sched_setparam: ::c_long = 4000 + 158; +pub const SYS_sched_getparam: ::c_long = 4000 + 159; +pub const SYS_sched_setscheduler: ::c_long = 4000 + 160; +pub const SYS_sched_getscheduler: ::c_long = 4000 + 161; +pub const SYS_sched_yield: ::c_long = 4000 + 162; +pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163; +pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164; +pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165; +pub const SYS_nanosleep: ::c_long = 4000 + 166; +pub const SYS_mremap: ::c_long = 4000 + 167; +pub const SYS_accept: ::c_long = 4000 + 168; +pub const SYS_bind: ::c_long = 4000 + 169; +pub const SYS_connect: ::c_long = 4000 + 170; +pub const SYS_getpeername: ::c_long = 4000 + 171; +pub const SYS_getsockname: ::c_long = 4000 + 172; +pub const SYS_getsockopt: ::c_long = 4000 + 173; +pub const SYS_listen: ::c_long = 4000 + 174; +pub const SYS_recv: ::c_long = 4000 + 175; +pub const SYS_recvfrom: ::c_long = 4000 + 176; +pub const SYS_recvmsg: ::c_long = 4000 + 177; +pub const SYS_send: ::c_long = 4000 + 178; +pub const SYS_sendmsg: ::c_long = 4000 + 179; +pub const SYS_sendto: ::c_long = 4000 + 180; +pub const SYS_setsockopt: ::c_long = 4000 + 181; +pub const SYS_shutdown: ::c_long = 4000 + 182; +pub const SYS_socket: ::c_long = 4000 + 183; +pub const SYS_socketpair: ::c_long = 4000 + 184; +pub const SYS_setresuid: ::c_long = 4000 + 185; +pub const SYS_getresuid: ::c_long = 4000 + 186; +pub const SYS_query_module: ::c_long = 4000 + 187; +pub const SYS_poll: ::c_long = 4000 + 188; +pub const SYS_nfsservctl: ::c_long = 4000 + 189; +pub const SYS_setresgid: ::c_long = 4000 + 190; +pub const SYS_getresgid: ::c_long = 4000 + 191; +pub const SYS_prctl: ::c_long = 4000 + 192; +pub const SYS_rt_sigreturn: ::c_long = 4000 + 193; +pub const SYS_rt_sigaction: ::c_long = 4000 + 194; +pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195; +pub const SYS_rt_sigpending: ::c_long = 4000 + 196; +pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197; +pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198; +pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199; +pub const SYS_chown: ::c_long = 4000 + 202; +pub const SYS_getcwd: ::c_long = 4000 + 203; +pub const SYS_capget: ::c_long = 4000 + 204; +pub const SYS_capset: ::c_long = 4000 + 205; +pub const SYS_sigaltstack: ::c_long = 4000 + 206; +pub const SYS_sendfile: ::c_long = 4000 + 207; +pub const SYS_getpmsg: ::c_long = 4000 + 208; +pub const SYS_putpmsg: ::c_long = 4000 + 209; +pub const SYS_mmap2: ::c_long = 4000 + 210; +pub const SYS_truncate64: ::c_long = 4000 + 211; +pub const SYS_ftruncate64: ::c_long = 4000 + 212; +pub const SYS_stat64: ::c_long = 4000 + 213; +pub const SYS_lstat64: ::c_long = 4000 + 214; +pub const SYS_fstat64: ::c_long = 4000 + 215; +pub const SYS_pivot_root: ::c_long = 4000 + 216; +pub const SYS_mincore: ::c_long = 4000 + 217; +pub const SYS_madvise: ::c_long = 4000 + 218; +pub const SYS_getdents64: ::c_long = 4000 + 219; +pub const SYS_fcntl64: ::c_long = 4000 + 220; +pub const SYS_reserved221: ::c_long = 4000 + 221; +pub const SYS_gettid: ::c_long = 4000 + 222; +pub const SYS_readahead: ::c_long = 4000 + 223; +pub const SYS_setxattr: ::c_long = 4000 + 224; +pub const SYS_lsetxattr: ::c_long = 4000 + 225; +pub const SYS_fsetxattr: ::c_long = 4000 + 226; +pub const SYS_getxattr: ::c_long = 4000 + 227; +pub const SYS_lgetxattr: ::c_long = 4000 + 228; +pub const SYS_fgetxattr: ::c_long = 4000 + 229; +pub const SYS_listxattr: ::c_long = 4000 + 230; +pub const SYS_llistxattr: ::c_long = 4000 + 231; +pub const SYS_flistxattr: ::c_long = 4000 + 232; +pub const SYS_removexattr: ::c_long = 4000 + 233; +pub const SYS_lremovexattr: ::c_long = 4000 + 234; +pub const SYS_fremovexattr: ::c_long = 4000 + 235; +pub const SYS_tkill: ::c_long = 4000 + 236; +pub const SYS_sendfile64: ::c_long = 4000 + 237; +pub const SYS_futex: ::c_long = 4000 + 238; +pub const SYS_sched_setaffinity: ::c_long = 4000 + 239; +pub const SYS_sched_getaffinity: ::c_long = 4000 + 240; +pub const SYS_io_setup: ::c_long = 4000 + 241; +pub const SYS_io_destroy: ::c_long = 4000 + 242; +pub const SYS_io_getevents: ::c_long = 4000 + 243; +pub const SYS_io_submit: ::c_long = 4000 + 244; +pub const SYS_io_cancel: ::c_long = 4000 + 245; +pub const SYS_exit_group: ::c_long = 4000 + 246; +pub const SYS_lookup_dcookie: ::c_long = 4000 + 247; +pub const SYS_epoll_create: ::c_long = 4000 + 248; +pub const SYS_epoll_ctl: ::c_long = 4000 + 249; +pub const SYS_epoll_wait: ::c_long = 4000 + 250; +pub const SYS_remap_file_pages: ::c_long = 4000 + 251; +pub const SYS_set_tid_address: ::c_long = 4000 + 252; +pub const SYS_restart_syscall: ::c_long = 4000 + 253; +pub const SYS_statfs64: ::c_long = 4000 + 255; +pub const SYS_fstatfs64: ::c_long = 4000 + 256; +pub const SYS_timer_create: ::c_long = 4000 + 257; +pub const SYS_timer_settime: ::c_long = 4000 + 258; +pub const SYS_timer_gettime: ::c_long = 4000 + 259; +pub const SYS_timer_getoverrun: ::c_long = 4000 + 260; +pub const SYS_timer_delete: ::c_long = 4000 + 261; +pub const SYS_clock_settime: ::c_long = 4000 + 262; +pub const SYS_clock_gettime: ::c_long = 4000 + 263; +pub const SYS_clock_getres: ::c_long = 4000 + 264; +pub const SYS_clock_nanosleep: ::c_long = 4000 + 265; +pub const SYS_tgkill: ::c_long = 4000 + 266; +pub const SYS_utimes: ::c_long = 4000 + 267; +pub const SYS_mbind: ::c_long = 4000 + 268; +pub const SYS_get_mempolicy: ::c_long = 4000 + 269; +pub const SYS_set_mempolicy: ::c_long = 4000 + 270; +pub const SYS_mq_open: ::c_long = 4000 + 271; +pub const SYS_mq_unlink: ::c_long = 4000 + 272; +pub const SYS_mq_timedsend: ::c_long = 4000 + 273; +pub const SYS_mq_timedreceive: ::c_long = 4000 + 274; +pub const SYS_mq_notify: ::c_long = 4000 + 275; +pub const SYS_mq_getsetattr: ::c_long = 4000 + 276; +pub const SYS_vserver: ::c_long = 4000 + 277; +pub const SYS_waitid: ::c_long = 4000 + 278; +/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */ +pub const SYS_add_key: ::c_long = 4000 + 280; +pub const SYS_request_key: ::c_long = 4000 + 281; +pub const SYS_keyctl: ::c_long = 4000 + 282; +pub const SYS_set_thread_area: ::c_long = 4000 + 283; +pub const SYS_inotify_init: ::c_long = 4000 + 284; +pub const SYS_inotify_add_watch: ::c_long = 4000 + 285; +pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286; +pub const SYS_migrate_pages: ::c_long = 4000 + 287; +pub const SYS_openat: ::c_long = 4000 + 288; +pub const SYS_mkdirat: ::c_long = 4000 + 289; +pub const SYS_mknodat: ::c_long = 4000 + 290; +pub const SYS_fchownat: ::c_long = 4000 + 291; +pub const SYS_futimesat: ::c_long = 4000 + 292; +pub const SYS_unlinkat: ::c_long = 4000 + 294; +pub const SYS_renameat: ::c_long = 4000 + 295; +pub const SYS_linkat: ::c_long = 4000 + 296; +pub const SYS_symlinkat: ::c_long = 4000 + 297; +pub const SYS_readlinkat: ::c_long = 4000 + 298; +pub const SYS_fchmodat: ::c_long = 4000 + 299; +pub const SYS_faccessat: ::c_long = 4000 + 300; +pub const SYS_pselect6: ::c_long = 4000 + 301; +pub const SYS_ppoll: ::c_long = 4000 + 302; +pub const SYS_unshare: ::c_long = 4000 + 303; +pub const SYS_splice: ::c_long = 4000 + 304; +pub const SYS_sync_file_range: ::c_long = 4000 + 305; +pub const SYS_tee: ::c_long = 4000 + 306; +pub const SYS_vmsplice: ::c_long = 4000 + 307; +pub const SYS_move_pages: ::c_long = 4000 + 308; +pub const SYS_set_robust_list: ::c_long = 4000 + 309; +pub const SYS_get_robust_list: ::c_long = 4000 + 310; +pub const SYS_kexec_load: ::c_long = 4000 + 311; +pub const SYS_getcpu: ::c_long = 4000 + 312; +pub const SYS_epoll_pwait: ::c_long = 4000 + 313; +pub const SYS_ioprio_set: ::c_long = 4000 + 314; +pub const SYS_ioprio_get: ::c_long = 4000 + 315; +pub const SYS_utimensat: ::c_long = 4000 + 316; +pub const SYS_signalfd: ::c_long = 4000 + 317; +pub const SYS_timerfd: ::c_long = 4000 + 318; +pub const SYS_eventfd: ::c_long = 4000 + 319; +pub const SYS_fallocate: ::c_long = 4000 + 320; +pub const SYS_timerfd_create: ::c_long = 4000 + 321; +pub const SYS_timerfd_gettime: ::c_long = 4000 + 322; +pub const SYS_timerfd_settime: ::c_long = 4000 + 323; +pub const SYS_signalfd4: ::c_long = 4000 + 324; +pub const SYS_eventfd2: ::c_long = 4000 + 325; +pub const SYS_epoll_create1: ::c_long = 4000 + 326; +pub const SYS_dup3: ::c_long = 4000 + 327; +pub const SYS_pipe2: ::c_long = 4000 + 328; +pub const SYS_inotify_init1: ::c_long = 4000 + 329; +pub const SYS_preadv: ::c_long = 4000 + 330; +pub const SYS_pwritev: ::c_long = 4000 + 331; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332; +pub const SYS_perf_event_open: ::c_long = 4000 + 333; +pub const SYS_accept4: ::c_long = 4000 + 334; +pub const SYS_recvmmsg: ::c_long = 4000 + 335; +pub const SYS_fanotify_init: ::c_long = 4000 + 336; +pub const SYS_fanotify_mark: ::c_long = 4000 + 337; +pub const SYS_prlimit64: ::c_long = 4000 + 338; +pub const SYS_name_to_handle_at: ::c_long = 4000 + 339; +pub const SYS_open_by_handle_at: ::c_long = 4000 + 340; +pub const SYS_clock_adjtime: ::c_long = 4000 + 341; +pub const SYS_syncfs: ::c_long = 4000 + 342; +pub const SYS_sendmmsg: ::c_long = 4000 + 343; +pub const SYS_setns: ::c_long = 4000 + 344; +pub const SYS_process_vm_readv: ::c_long = 4000 + 345; +pub const SYS_process_vm_writev: ::c_long = 4000 + 346; +pub const SYS_kcmp: ::c_long = 4000 + 347; +pub const SYS_finit_module: ::c_long = 4000 + 348; +pub const SYS_sched_setattr: ::c_long = 4000 + 349; +pub const SYS_sched_getattr: ::c_long = 4000 + 350; +pub const SYS_renameat2: ::c_long = 4000 + 351; +pub const SYS_seccomp: ::c_long = 4000 + 352; +pub const SYS_getrandom: ::c_long = 4000 + 353; +pub const SYS_memfd_create: ::c_long = 4000 + 354; +pub const SYS_bpf: ::c_long = 4000 + 355; +pub const SYS_execveat: ::c_long = 4000 + 356; +pub const SYS_userfaultfd: ::c_long = 4000 + 357; +pub const SYS_membarrier: ::c_long = 4000 + 358; +pub const SYS_mlock2: ::c_long = 4000 + 359; +pub const SYS_copy_file_range: ::c_long = 4000 + 360; +pub const SYS_preadv2: ::c_long = 4000 + 361; +pub const SYS_pwritev2: ::c_long = 4000 + 362; + +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,7 @@ pub type c_long = i32; pub type c_ulong = u32; pub type nlink_t = u32; +pub type blksize_t = ::c_long; pub type __u64 = ::c_ulonglong; s! { @@ -31,8 +32,23 @@ pub struct sem_t { __val: [::c_int; 4], } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } } +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/x86.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/x86.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b32/x86.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b32/x86.rs 2017-12-21 19:00:07.000000000 +0000 @@ -151,6 +151,17 @@ pub f_namemax: ::c_ulong, __f_spare: [::c_int; 6], } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const O_DIRECT: ::c_int = 0x4000; @@ -798,3 +809,8 @@ pub const EFL: ::c_int = 14; pub const UESP: ::c_int = 15; pub const SS: ::c_int = 16; + +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,341 @@ pub type c_char = u8; pub type __u64 = ::c_ulonglong; +pub type wchar_t = u32; +pub type nlink_t = u32; +pub type blksize_t = ::c_int; +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } +} + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_LARGEFILE: ::c_int = 0x20000; +pub const O_NOFOLLOW: ::c_int = 0x8000; + +pub const MINSIGSTKSZ: ::size_t = 6144; +pub const SIGSTKSZ: ::size_t = 12288; + +#[doc(hidden)] +pub const PF_MAX: ::c_int = 43; +#[doc(hidden)] +pub const AF_MAX: ::c_int = PF_MAX; + +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,51 +1,7 @@ -pub type wchar_t = i32; pub type c_long = i64; pub type c_ulong = u64; -pub type nlink_t = u64; s! { - pub struct stat { - pub st_dev: ::dev_t, - pub st_ino: ::ino_t, - pub st_nlink: ::nlink_t, - pub st_mode: ::mode_t, - pub st_uid: ::uid_t, - pub st_gid: ::gid_t, - __pad0: ::c_int, - pub st_rdev: ::dev_t, - pub st_size: ::off_t, - pub st_blksize: ::blksize_t, - pub st_blocks: ::blkcnt_t, - pub st_atime: ::time_t, - pub st_atime_nsec: ::c_long, - pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_long, - pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_long, - __unused: [::c_long; 3], - } - - pub struct stat64 { - pub st_dev: ::dev_t, - pub st_ino: ::ino64_t, - pub st_nlink: ::nlink_t, - pub st_mode: ::mode_t, - pub st_uid: ::uid_t, - pub st_gid: ::gid_t, - __pad0: ::c_int, - pub st_rdev: ::dev_t, - pub st_size: ::off_t, - pub st_blksize: ::blksize_t, - pub st_blocks: ::blkcnt64_t, - pub st_atime: ::time_t, - pub st_atime_nsec: ::c_long, - pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_long, - pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_long, - __reserved: [::c_long; 3], - } - pub struct statfs64 { pub f_type: ::c_ulong, pub f_bsize: ::c_ulong, @@ -162,16 +118,23 @@ pub _pad: [::c_int; 29], _align: [usize; 0], } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; -pub const O_DIRECT: ::c_int = 0x4000; -pub const O_DIRECTORY: ::c_int = 0x10000; -pub const O_NOFOLLOW: ::c_int = 0x20000; pub const O_ASYNC: ::c_int = 0x2000; -pub const O_LARGEFILE: ::c_int = 0; pub const FIOCLEX: ::c_int = 0x5451; pub const FIONBIO: ::c_int = 0x5421; @@ -202,7 +165,6 @@ pub const MAP_POPULATE: ::c_int = 0x08000; pub const MAP_NONBLOCK: ::c_int = 0x010000; pub const MAP_STACK: ::c_int = 0x020000; -pub const MAP_32BIT: ::c_int = 0x0040; pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,83 @@ pub type c_char = u8; +pub type wchar_t = i32; pub type __u64 = ::c_ulong; +pub type nlink_t = u64; +pub type blksize_t = ::c_long; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } +} pub const SYS_pivot_root: ::c_long = 203; pub const SYS_gettid: ::c_long = 207; pub const SYS_perf_event_open: ::c_long = 319; pub const SYS_memfd_create: ::c_long = 360; + +pub const MAP_32BIT: ::c_int = 0x0040; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_LARGEFILE: ::c_int = 0; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; + +// Syscall table +pub const SYS_renameat2: ::c_long = 357; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,52 @@ pub type c_char = i8; +pub type wchar_t = i32; +pub type nlink_t = u64; +pub type blksize_t = ::c_long; pub type __u64 = ::c_ulonglong; s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + pub struct mcontext_t { __private: [u64; 32], } @@ -14,6 +59,18 @@ pub uc_sigmask: ::sigset_t, __private: [u8; 512], } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } } // Syscall table @@ -378,3 +435,17 @@ pub const ES: ::c_int = 24; pub const FS: ::c_int = 25; pub const GS: ::c_int = 26; + +pub const MAP_32BIT: ::c_int = 0x0040; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_LARGEFILE: ::c_int = 0; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/musl/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/musl/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -5,7 +5,9 @@ pub type off_t = i64; pub type blkcnt_t = i64; -pub type blksize_t = c_long; +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; pub type fsblkcnt_t = ::c_ulonglong; pub type fsfilcnt_t = ::c_ulonglong; pub type rlim_t = ::c_ulonglong; @@ -38,18 +40,6 @@ pub sa_restorer: ::dox::Option, } - pub struct ipc_perm { - pub __ipc_perm_key: ::key_t, - pub uid: ::uid_t, - pub gid: ::gid_t, - pub cuid: ::uid_t, - pub cgid: ::gid_t, - pub mode: ::mode_t, - pub __seq: ::c_int, - __unused1: ::c_long, - __unused2: ::c_long - } - pub struct termios { pub c_iflag: ::tcflag_t, pub c_oflag: ::tcflag_t, @@ -85,6 +75,12 @@ pub mem_unit: ::c_uint, pub __reserved: [::c_char; 256], } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } } pub const SFD_CLOEXEC: ::c_int = 0x080000; @@ -140,6 +136,9 @@ pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; + pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; pub const TCP_THIN_DUPACK: ::c_int = 17; @@ -159,8 +158,6 @@ pub const CPU_SETSIZE: ::c_int = 128; -pub const QFMT_VFS_V1: ::c_int = 4; - pub const PTRACE_TRACEME: ::c_int = 0; pub const PTRACE_PEEKTEXT: ::c_int = 1; pub const PTRACE_PEEKDATA: ::c_int = 2; @@ -214,8 +211,6 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; -pub const SIGSTKSZ: ::size_t = 8192; -pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; @@ -317,7 +312,9 @@ } cfg_if! { - if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "powerpc64"))] { mod b64; pub use self::b64::*; } else if #[cfg(any(target_arch = "x86", diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/arm.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/arm.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/arm.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/arm.rs 2017-12-21 19:00:07.000000000 +0000 @@ -101,6 +101,17 @@ __glibc_reserved4: ::c_ulong, __glibc_reserved5: ::c_ulong, } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const O_DIRECT: ::c_int = 0x10000; @@ -125,11 +136,6 @@ pub const FIOCLEX: ::c_ulong = 0x5451; pub const FIONBIO: ::c_ulong = 0x5421; -pub const SYS_pivot_root: ::c_long = 218; -pub const SYS_gettid: ::c_long = 224; -pub const SYS_perf_event_open: ::c_long = 364; -pub const SYS_memfd_create: ::c_long = 385; - pub const PTRACE_GETFPXREGS: ::c_uint = 18; pub const PTRACE_SETFPXREGS: ::c_uint = 19; @@ -208,6 +214,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -249,3 +256,357 @@ pub const TIOCGWINSZ: ::c_ulong = 0x5413; pub const TIOCSWINSZ: ::c_ulong = 0x5414; pub const FIONREAD: ::c_ulong = 0x541B; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_arm_fadvise64_64: ::c_long = 270; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_arm_sync_file_range: ::c_long = 341; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -10,6 +10,12 @@ pub type blkcnt_t = i32; pub type __fsword_t = i32; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type rlim_t = c_ulong; +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; pub type blksize_t = i32; pub type nlink_t = u32; pub type __u64 = ::c_ulonglong; @@ -281,6 +287,17 @@ pub const PTRACE_GETREGS: ::c_uint = 12; pub const PTRACE_SETREGS: ::c_uint = 13; +#[link(name = "util")] +extern { + pub fn sysctl(name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t) + -> ::c_int; +} + cfg_if! { if #[cfg(target_arch = "x86")] { mod x86; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/powerpc.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/powerpc.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/powerpc.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/powerpc.rs 2017-12-21 19:00:07.000000000 +0000 @@ -126,11 +126,6 @@ pub const FIOCLEX: ::c_ulong = 0x20006601; pub const FIONBIO: ::c_ulong = 0x8004667e; -pub const SYS_pivot_root: ::c_long = 203; -pub const SYS_gettid: ::c_long = 207; -pub const SYS_perf_event_open: ::c_long = 319; -pub const SYS_memfd_create: ::c_long = 360; - pub const MCL_CURRENT: ::c_int = 0x2000; pub const MCL_FUTURE: ::c_int = 0x4000; @@ -220,6 +215,7 @@ pub const B3000000: ::speed_t = 0o0034; pub const B3500000: ::speed_t = 0o0035; pub const B4000000: ::speed_t = 0o0036; +pub const BOTHER: ::speed_t = 0o0037; pub const VEOL: usize = 6; pub const VEOL2: usize = 8; @@ -246,3 +242,373 @@ pub const TIOCGWINSZ: ::c_ulong = 0x40087468; pub const TIOCSWINSZ: ::c_ulong = 0x80087467; pub const FIONREAD: ::c_ulong = 0x4004667f; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */ +pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */ +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */ +pub const SYS_readahead: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_fcntl64: ::c_long = 204; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_sendfile64: ::c_long = 226; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_fadvise64: ::c_long = 233; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_fadvise64_64: ::c_long = 254; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_fstatat64: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/x86.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/x86.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b32/x86.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b32/x86.rs 2017-12-21 19:00:07.000000000 +0000 @@ -200,6 +200,17 @@ __glibc_reserved4: ::c_ulong, __glibc_reserved5: ::c_ulong, } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } pub const O_DIRECT: ::c_int = 0x4000; @@ -304,6 +315,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/aarch64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/aarch64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/aarch64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/aarch64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,7 @@ //! AArch64-specific definitions for 64-bit linux-like values +pub type c_long = i64; +pub type c_ulong = u64; pub type c_char = u8; pub type wchar_t = u32; pub type nlink_t = u32; @@ -111,8 +113,21 @@ __unused4: ::c_ulong, __unused5: ::c_ulong } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; @@ -367,11 +382,6 @@ pub const FIOCLEX: ::c_ulong = 0x5451; pub const FIONBIO: ::c_ulong = 0x5421; -pub const SYS_pivot_root: ::c_long = 41; -pub const SYS_gettid: ::c_long = 178; -pub const SYS_perf_event_open: ::c_long = 241; -pub const SYS_memfd_create: ::c_long = 279; - pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; @@ -447,6 +457,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -488,3 +499,282 @@ pub const TIOCGWINSZ: ::c_ulong = 0x5413; pub const TIOCSWINSZ: ::c_ulong = 0x5414; pub const FIONREAD: ::c_ulong = 0x541B; + +// Syscall table +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_arch_specific_syscall: ::c_long = 244; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_syscalls: ::c_long = 291; + +#[link(name = "util")] +extern { + pub fn sysctl(name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t) + -> ::c_int; +} diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,32 +1,39 @@ //! 64-bit specific definitions for linux-like values -pub type c_long = i64; -pub type c_ulong = u64; pub type clock_t = i64; pub type time_t = i64; pub type ino_t = u64; pub type off_t = i64; pub type blkcnt_t = i64; -pub type __fsword_t = ::c_long; +pub type __fsword_t = i64; +pub type shmatt_t = u64; +pub type msgqnum_t = u64; +pub type msglen_t = u64; +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type rlim_t = u64; s! { pub struct sigset_t { - __val: [::c_ulong; 16], + #[cfg(target_pointer_width = "32")] + __val: [u32; 32], + #[cfg(target_pointer_width = "64")] + __val: [u64; 16], } pub struct sysinfo { - pub uptime: ::c_long, - pub loads: [::c_ulong; 3], - pub totalram: ::c_ulong, - pub freeram: ::c_ulong, - pub sharedram: ::c_ulong, - pub bufferram: ::c_ulong, - pub totalswap: ::c_ulong, - pub freeswap: ::c_ulong, + pub uptime: i64, + pub loads: [u64; 3], + pub totalram: u64, + pub freeram: u64, + pub sharedram: u64, + pub bufferram: u64, + pub totalswap: u64, + pub freeswap: u64, pub procs: ::c_ushort, pub pad: ::c_ushort, - pub totalhigh: ::c_ulong, - pub freehigh: ::c_ulong, + pub totalhigh: u64, + pub freehigh: u64, pub mem_unit: ::c_uint, pub _f: [::c_char; 0], } @@ -36,17 +43,16 @@ pub msg_stime: ::time_t, pub msg_rtime: ::time_t, pub msg_ctime: ::time_t, - __msg_cbytes: ::c_ulong, + __msg_cbytes: u64, pub msg_qnum: ::msgqnum_t, pub msg_qbytes: ::msglen_t, pub msg_lspid: ::pid_t, pub msg_lrpid: ::pid_t, - __glibc_reserved4: ::c_ulong, - __glibc_reserved5: ::c_ulong, + __glibc_reserved4: u64, + __glibc_reserved5: u64, } } -pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; pub const O_LARGEFILE: ::c_int = 0; @@ -64,6 +70,15 @@ } else if #[cfg(any(target_arch = "x86_64"))] { mod x86_64; pub use self::x86_64::*; + cfg_if! { + if #[cfg(target_pointer_width = "32")] { + mod x32; + pub use self::x32::*; + } else { + mod not_x32; + pub use self::not_x32::*; + } + } } else { // Unknown target_arch } diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/not_x32.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/not_x32.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/not_x32.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/not_x32.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,351 @@ +pub type c_long = i64; +pub type c_ulong = u64; + +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +// Syscall table + +pub const SYS_read: ::c_long = 0; +pub const SYS_write: ::c_long = 1; +pub const SYS_open: ::c_long = 2; +pub const SYS_close: ::c_long = 3; +pub const SYS_stat: ::c_long = 4; +pub const SYS_fstat: ::c_long = 5; +pub const SYS_lstat: ::c_long = 6; +pub const SYS_poll: ::c_long = 7; +pub const SYS_lseek: ::c_long = 8; +pub const SYS_mmap: ::c_long = 9; +pub const SYS_mprotect: ::c_long = 10; +pub const SYS_munmap: ::c_long = 11; +pub const SYS_brk: ::c_long = 12; +pub const SYS_rt_sigaction: ::c_long = 13; +pub const SYS_rt_sigprocmask: ::c_long = 14; +pub const SYS_rt_sigreturn: ::c_long = 15; +pub const SYS_ioctl: ::c_long = 16; +pub const SYS_pread64: ::c_long = 17; +pub const SYS_pwrite64: ::c_long = 18; +pub const SYS_readv: ::c_long = 19; +pub const SYS_writev: ::c_long = 20; +pub const SYS_access: ::c_long = 21; +pub const SYS_pipe: ::c_long = 22; +pub const SYS_select: ::c_long = 23; +pub const SYS_sched_yield: ::c_long = 24; +pub const SYS_mremap: ::c_long = 25; +pub const SYS_msync: ::c_long = 26; +pub const SYS_mincore: ::c_long = 27; +pub const SYS_madvise: ::c_long = 28; +pub const SYS_shmget: ::c_long = 29; +pub const SYS_shmat: ::c_long = 30; +pub const SYS_shmctl: ::c_long = 31; +pub const SYS_dup: ::c_long = 32; +pub const SYS_dup2: ::c_long = 33; +pub const SYS_pause: ::c_long = 34; +pub const SYS_nanosleep: ::c_long = 35; +pub const SYS_getitimer: ::c_long = 36; +pub const SYS_alarm: ::c_long = 37; +pub const SYS_setitimer: ::c_long = 38; +pub const SYS_getpid: ::c_long = 39; +pub const SYS_sendfile: ::c_long = 40; +pub const SYS_socket: ::c_long = 41; +pub const SYS_connect: ::c_long = 42; +pub const SYS_accept: ::c_long = 43; +pub const SYS_sendto: ::c_long = 44; +pub const SYS_recvfrom: ::c_long = 45; +pub const SYS_sendmsg: ::c_long = 46; +pub const SYS_recvmsg: ::c_long = 47; +pub const SYS_shutdown: ::c_long = 48; +pub const SYS_bind: ::c_long = 49; +pub const SYS_listen: ::c_long = 50; +pub const SYS_getsockname: ::c_long = 51; +pub const SYS_getpeername: ::c_long = 52; +pub const SYS_socketpair: ::c_long = 53; +pub const SYS_setsockopt: ::c_long = 54; +pub const SYS_getsockopt: ::c_long = 55; +pub const SYS_clone: ::c_long = 56; +pub const SYS_fork: ::c_long = 57; +pub const SYS_vfork: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_exit: ::c_long = 60; +pub const SYS_wait4: ::c_long = 61; +pub const SYS_kill: ::c_long = 62; +pub const SYS_uname: ::c_long = 63; +pub const SYS_semget: ::c_long = 64; +pub const SYS_semop: ::c_long = 65; +pub const SYS_semctl: ::c_long = 66; +pub const SYS_shmdt: ::c_long = 67; +pub const SYS_msgget: ::c_long = 68; +pub const SYS_msgsnd: ::c_long = 69; +pub const SYS_msgrcv: ::c_long = 70; +pub const SYS_msgctl: ::c_long = 71; +pub const SYS_fcntl: ::c_long = 72; +pub const SYS_flock: ::c_long = 73; +pub const SYS_fsync: ::c_long = 74; +pub const SYS_fdatasync: ::c_long = 75; +pub const SYS_truncate: ::c_long = 76; +pub const SYS_ftruncate: ::c_long = 77; +pub const SYS_getdents: ::c_long = 78; +pub const SYS_getcwd: ::c_long = 79; +pub const SYS_chdir: ::c_long = 80; +pub const SYS_fchdir: ::c_long = 81; +pub const SYS_rename: ::c_long = 82; +pub const SYS_mkdir: ::c_long = 83; +pub const SYS_rmdir: ::c_long = 84; +pub const SYS_creat: ::c_long = 85; +pub const SYS_link: ::c_long = 86; +pub const SYS_unlink: ::c_long = 87; +pub const SYS_symlink: ::c_long = 88; +pub const SYS_readlink: ::c_long = 89; +pub const SYS_chmod: ::c_long = 90; +pub const SYS_fchmod: ::c_long = 91; +pub const SYS_chown: ::c_long = 92; +pub const SYS_fchown: ::c_long = 93; +pub const SYS_lchown: ::c_long = 94; +pub const SYS_umask: ::c_long = 95; +pub const SYS_gettimeofday: ::c_long = 96; +pub const SYS_getrlimit: ::c_long = 97; +pub const SYS_getrusage: ::c_long = 98; +pub const SYS_sysinfo: ::c_long = 99; +pub const SYS_times: ::c_long = 100; +pub const SYS_ptrace: ::c_long = 101; +pub const SYS_getuid: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_getgid: ::c_long = 104; +pub const SYS_setuid: ::c_long = 105; +pub const SYS_setgid: ::c_long = 106; +pub const SYS_geteuid: ::c_long = 107; +pub const SYS_getegid: ::c_long = 108; +pub const SYS_setpgid: ::c_long = 109; +pub const SYS_getppid: ::c_long = 110; +pub const SYS_getpgrp: ::c_long = 111; +pub const SYS_setsid: ::c_long = 112; +pub const SYS_setreuid: ::c_long = 113; +pub const SYS_setregid: ::c_long = 114; +pub const SYS_getgroups: ::c_long = 115; +pub const SYS_setgroups: ::c_long = 116; +pub const SYS_setresuid: ::c_long = 117; +pub const SYS_getresuid: ::c_long = 118; +pub const SYS_setresgid: ::c_long = 119; +pub const SYS_getresgid: ::c_long = 120; +pub const SYS_getpgid: ::c_long = 121; +pub const SYS_setfsuid: ::c_long = 122; +pub const SYS_setfsgid: ::c_long = 123; +pub const SYS_getsid: ::c_long = 124; +pub const SYS_capget: ::c_long = 125; +pub const SYS_capset: ::c_long = 126; +pub const SYS_rt_sigpending: ::c_long = 127; +pub const SYS_rt_sigtimedwait: ::c_long = 128; +pub const SYS_rt_sigqueueinfo: ::c_long = 129; +pub const SYS_rt_sigsuspend: ::c_long = 130; +pub const SYS_sigaltstack: ::c_long = 131; +pub const SYS_utime: ::c_long = 132; +pub const SYS_mknod: ::c_long = 133; +pub const SYS_uselib: ::c_long = 134; +pub const SYS_personality: ::c_long = 135; +pub const SYS_ustat: ::c_long = 136; +pub const SYS_statfs: ::c_long = 137; +pub const SYS_fstatfs: ::c_long = 138; +pub const SYS_sysfs: ::c_long = 139; +pub const SYS_getpriority: ::c_long = 140; +pub const SYS_setpriority: ::c_long = 141; +pub const SYS_sched_setparam: ::c_long = 142; +pub const SYS_sched_getparam: ::c_long = 143; +pub const SYS_sched_setscheduler: ::c_long = 144; +pub const SYS_sched_getscheduler: ::c_long = 145; +pub const SYS_sched_get_priority_max: ::c_long = 146; +pub const SYS_sched_get_priority_min: ::c_long = 147; +pub const SYS_sched_rr_get_interval: ::c_long = 148; +pub const SYS_mlock: ::c_long = 149; +pub const SYS_munlock: ::c_long = 150; +pub const SYS_mlockall: ::c_long = 151; +pub const SYS_munlockall: ::c_long = 152; +pub const SYS_vhangup: ::c_long = 153; +pub const SYS_modify_ldt: ::c_long = 154; +pub const SYS_pivot_root: ::c_long = 155; +pub const SYS__sysctl: ::c_long = 156; +pub const SYS_prctl: ::c_long = 157; +pub const SYS_arch_prctl: ::c_long = 158; +pub const SYS_adjtimex: ::c_long = 159; +pub const SYS_setrlimit: ::c_long = 160; +pub const SYS_chroot: ::c_long = 161; +pub const SYS_sync: ::c_long = 162; +pub const SYS_acct: ::c_long = 163; +pub const SYS_settimeofday: ::c_long = 164; +pub const SYS_mount: ::c_long = 165; +pub const SYS_umount2: ::c_long = 166; +pub const SYS_swapon: ::c_long = 167; +pub const SYS_swapoff: ::c_long = 168; +pub const SYS_reboot: ::c_long = 169; +pub const SYS_sethostname: ::c_long = 170; +pub const SYS_setdomainname: ::c_long = 171; +pub const SYS_iopl: ::c_long = 172; +pub const SYS_ioperm: ::c_long = 173; +pub const SYS_create_module: ::c_long = 174; +pub const SYS_init_module: ::c_long = 175; +pub const SYS_delete_module: ::c_long = 176; +pub const SYS_get_kernel_syms: ::c_long = 177; +pub const SYS_query_module: ::c_long = 178; +pub const SYS_quotactl: ::c_long = 179; +pub const SYS_nfsservctl: ::c_long = 180; +pub const SYS_getpmsg: ::c_long = 181; +pub const SYS_putpmsg: ::c_long = 182; +pub const SYS_afs_syscall: ::c_long = 183; +pub const SYS_tuxcall: ::c_long = 184; +pub const SYS_security: ::c_long = 185; +pub const SYS_gettid: ::c_long = 186; +pub const SYS_readahead: ::c_long = 187; +pub const SYS_setxattr: ::c_long = 188; +pub const SYS_lsetxattr: ::c_long = 189; +pub const SYS_fsetxattr: ::c_long = 190; +pub const SYS_getxattr: ::c_long = 191; +pub const SYS_lgetxattr: ::c_long = 192; +pub const SYS_fgetxattr: ::c_long = 193; +pub const SYS_listxattr: ::c_long = 194; +pub const SYS_llistxattr: ::c_long = 195; +pub const SYS_flistxattr: ::c_long = 196; +pub const SYS_removexattr: ::c_long = 197; +pub const SYS_lremovexattr: ::c_long = 198; +pub const SYS_fremovexattr: ::c_long = 199; +pub const SYS_tkill: ::c_long = 200; +pub const SYS_time: ::c_long = 201; +pub const SYS_futex: ::c_long = 202; +pub const SYS_sched_setaffinity: ::c_long = 203; +pub const SYS_sched_getaffinity: ::c_long = 204; +pub const SYS_set_thread_area: ::c_long = 205; +pub const SYS_io_setup: ::c_long = 206; +pub const SYS_io_destroy: ::c_long = 207; +pub const SYS_io_getevents: ::c_long = 208; +pub const SYS_io_submit: ::c_long = 209; +pub const SYS_io_cancel: ::c_long = 210; +pub const SYS_get_thread_area: ::c_long = 211; +pub const SYS_lookup_dcookie: ::c_long = 212; +pub const SYS_epoll_create: ::c_long = 213; +pub const SYS_epoll_ctl_old: ::c_long = 214; +pub const SYS_epoll_wait_old: ::c_long = 215; +pub const SYS_remap_file_pages: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_set_tid_address: ::c_long = 218; +pub const SYS_restart_syscall: ::c_long = 219; +pub const SYS_semtimedop: ::c_long = 220; +pub const SYS_fadvise64: ::c_long = 221; +pub const SYS_timer_create: ::c_long = 222; +pub const SYS_timer_settime: ::c_long = 223; +pub const SYS_timer_gettime: ::c_long = 224; +pub const SYS_timer_getoverrun: ::c_long = 225; +pub const SYS_timer_delete: ::c_long = 226; +pub const SYS_clock_settime: ::c_long = 227; +pub const SYS_clock_gettime: ::c_long = 228; +pub const SYS_clock_getres: ::c_long = 229; +pub const SYS_clock_nanosleep: ::c_long = 230; +pub const SYS_exit_group: ::c_long = 231; +pub const SYS_epoll_wait: ::c_long = 232; +pub const SYS_epoll_ctl: ::c_long = 233; +pub const SYS_tgkill: ::c_long = 234; +pub const SYS_utimes: ::c_long = 235; +pub const SYS_vserver: ::c_long = 236; +pub const SYS_mbind: ::c_long = 237; +pub const SYS_set_mempolicy: ::c_long = 238; +pub const SYS_get_mempolicy: ::c_long = 239; +pub const SYS_mq_open: ::c_long = 240; +pub const SYS_mq_unlink: ::c_long = 241; +pub const SYS_mq_timedsend: ::c_long = 242; +pub const SYS_mq_timedreceive: ::c_long = 243; +pub const SYS_mq_notify: ::c_long = 244; +pub const SYS_mq_getsetattr: ::c_long = 245; +pub const SYS_kexec_load: ::c_long = 246; +pub const SYS_waitid: ::c_long = 247; +pub const SYS_add_key: ::c_long = 248; +pub const SYS_request_key: ::c_long = 249; +pub const SYS_keyctl: ::c_long = 250; +pub const SYS_ioprio_set: ::c_long = 251; +pub const SYS_ioprio_get: ::c_long = 252; +pub const SYS_inotify_init: ::c_long = 253; +pub const SYS_inotify_add_watch: ::c_long = 254; +pub const SYS_inotify_rm_watch: ::c_long = 255; +pub const SYS_migrate_pages: ::c_long = 256; +pub const SYS_openat: ::c_long = 257; +pub const SYS_mkdirat: ::c_long = 258; +pub const SYS_mknodat: ::c_long = 259; +pub const SYS_fchownat: ::c_long = 260; +pub const SYS_futimesat: ::c_long = 261; +pub const SYS_newfstatat: ::c_long = 262; +pub const SYS_unlinkat: ::c_long = 263; +pub const SYS_renameat: ::c_long = 264; +pub const SYS_linkat: ::c_long = 265; +pub const SYS_symlinkat: ::c_long = 266; +pub const SYS_readlinkat: ::c_long = 267; +pub const SYS_fchmodat: ::c_long = 268; +pub const SYS_faccessat: ::c_long = 269; +pub const SYS_pselect6: ::c_long = 270; +pub const SYS_ppoll: ::c_long = 271; +pub const SYS_unshare: ::c_long = 272; +pub const SYS_set_robust_list: ::c_long = 273; +pub const SYS_get_robust_list: ::c_long = 274; +pub const SYS_splice: ::c_long = 275; +pub const SYS_tee: ::c_long = 276; +pub const SYS_sync_file_range: ::c_long = 277; +pub const SYS_vmsplice: ::c_long = 278; +pub const SYS_move_pages: ::c_long = 279; +pub const SYS_utimensat: ::c_long = 280; +pub const SYS_epoll_pwait: ::c_long = 281; +pub const SYS_signalfd: ::c_long = 282; +pub const SYS_timerfd_create: ::c_long = 283; +pub const SYS_eventfd: ::c_long = 284; +pub const SYS_fallocate: ::c_long = 285; +pub const SYS_timerfd_settime: ::c_long = 286; +pub const SYS_timerfd_gettime: ::c_long = 287; +pub const SYS_accept4: ::c_long = 288; +pub const SYS_signalfd4: ::c_long = 289; +pub const SYS_eventfd2: ::c_long = 290; +pub const SYS_epoll_create1: ::c_long = 291; +pub const SYS_dup3: ::c_long = 292; +pub const SYS_pipe2: ::c_long = 293; +pub const SYS_inotify_init1: ::c_long = 294; +pub const SYS_preadv: ::c_long = 295; +pub const SYS_pwritev: ::c_long = 296; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; +pub const SYS_perf_event_open: ::c_long = 298; +pub const SYS_recvmmsg: ::c_long = 299; +pub const SYS_fanotify_init: ::c_long = 300; +pub const SYS_fanotify_mark: ::c_long = 301; +pub const SYS_prlimit64: ::c_long = 302; +pub const SYS_name_to_handle_at: ::c_long = 303; +pub const SYS_open_by_handle_at: ::c_long = 304; +pub const SYS_clock_adjtime: ::c_long = 305; +pub const SYS_syncfs: ::c_long = 306; +pub const SYS_sendmmsg: ::c_long = 307; +pub const SYS_setns: ::c_long = 308; +pub const SYS_getcpu: ::c_long = 309; +pub const SYS_process_vm_readv: ::c_long = 310; +pub const SYS_process_vm_writev: ::c_long = 311; +pub const SYS_kcmp: ::c_long = 312; +pub const SYS_finit_module: ::c_long = 313; +pub const SYS_sched_setattr: ::c_long = 314; +pub const SYS_sched_getattr: ::c_long = 315; +pub const SYS_renameat2: ::c_long = 316; +pub const SYS_seccomp: ::c_long = 317; +pub const SYS_getrandom: ::c_long = 318; +pub const SYS_memfd_create: ::c_long = 319; +pub const SYS_kexec_file_load: ::c_long = 320; +pub const SYS_bpf: ::c_long = 321; +pub const SYS_execveat: ::c_long = 322; +pub const SYS_userfaultfd: ::c_long = 323; +pub const SYS_membarrier: ::c_long = 324; +pub const SYS_mlock2: ::c_long = 325; +pub const SYS_copy_file_range: ::c_long = 326; +pub const SYS_preadv2: ::c_long = 327; +pub const SYS_pwritev2: ::c_long = 328; +pub const SYS_pkey_mprotect: ::c_long = 329; +pub const SYS_pkey_alloc: ::c_long = 330; +pub const SYS_pkey_free: ::c_long = 331; + +#[link(name = "util")] +extern { + pub fn sysctl(name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t) + -> ::c_int; +} diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,7 @@ //! PowerPC64-specific definitions for 64-bit linux-like values +pub type c_long = i64; +pub type c_ulong = u64; pub type c_char = u8; pub type wchar_t = i32; pub type nlink_t = u64; @@ -111,6 +113,8 @@ } } +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; @@ -365,11 +369,6 @@ pub const FIOCLEX: ::c_ulong = 0x20006601; pub const FIONBIO: ::c_ulong = 0x8004667e; -pub const SYS_pivot_root: ::c_long = 203; -pub const SYS_gettid: ::c_long = 207; -pub const SYS_perf_event_open: ::c_long = 319; -pub const SYS_memfd_create: ::c_long = 360; - pub const MCL_CURRENT: ::c_int = 0x2000; pub const MCL_FUTURE: ::c_int = 0x4000; @@ -459,6 +458,7 @@ pub const B3000000: ::speed_t = 0o0034; pub const B3500000: ::speed_t = 0o0035; pub const B4000000: ::speed_t = 0o0036; +pub const BOTHER: ::speed_t = 0o0037; pub const VEOL: usize = 6; pub const VEOL2: usize = 8; @@ -485,3 +485,375 @@ pub const TIOCGWINSZ: ::c_ulong = 0x40087468; pub const TIOCSWINSZ: ::c_ulong = 0x80087467; pub const FIONREAD: ::c_ulong = 0x4004667f; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */ +pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */ +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */ +pub const SYS_readahead: ::c_long = 191; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_newfstatat: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; + +#[link(name = "util")] +extern { + pub fn sysctl(name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t) + -> ::c_int; +} diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/sparc64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/sparc64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/sparc64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/sparc64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,7 @@ //! SPARC64-specific definitions for 64-bit linux-like values +pub type c_long = i64; +pub type c_ulong = u64; pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u32; @@ -52,6 +54,36 @@ __reserved: [::c_long; 2], } + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + pub struct pthread_attr_t { __size: [u64; 7] } @@ -81,8 +113,21 @@ __reserved1: ::c_ulong, __reserved2: ::c_ulong } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } } +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464; pub const TIOCSSOFTCAR: ::c_ulong = 0x80047465; @@ -389,3 +434,14 @@ pub const TIOCGWINSZ: ::c_ulong = 0x40087468; pub const TIOCSWINSZ: ::c_ulong = 0x80087467; pub const FIONREAD: ::c_ulong = 0x4004667f; + +#[link(name = "util")] +extern { + pub fn sysctl(name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t) + -> ::c_int; +} diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/x32.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/x32.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/x32.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/x32.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,331 @@ +pub type c_long = i32; +pub type c_ulong = u32; + +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44; + +// Syscall table + +pub const __X32_SYSCALL_BIT: ::c_long = 0x40000000; + +pub const SYS_read: ::c_long = __X32_SYSCALL_BIT + 0; +pub const SYS_write: ::c_long = __X32_SYSCALL_BIT + 1; +pub const SYS_open: ::c_long = __X32_SYSCALL_BIT + 2; +pub const SYS_close: ::c_long = __X32_SYSCALL_BIT + 3; +pub const SYS_stat: ::c_long = __X32_SYSCALL_BIT + 4; +pub const SYS_fstat: ::c_long = __X32_SYSCALL_BIT + 5; +pub const SYS_lstat: ::c_long = __X32_SYSCALL_BIT + 6; +pub const SYS_poll: ::c_long = __X32_SYSCALL_BIT + 7; +pub const SYS_lseek: ::c_long = __X32_SYSCALL_BIT + 8; +pub const SYS_mmap: ::c_long = __X32_SYSCALL_BIT + 9; +pub const SYS_mprotect: ::c_long = __X32_SYSCALL_BIT + 10; +pub const SYS_munmap: ::c_long = __X32_SYSCALL_BIT + 11; +pub const SYS_brk: ::c_long = __X32_SYSCALL_BIT + 12; +pub const SYS_rt_sigprocmask: ::c_long = __X32_SYSCALL_BIT + 14; +pub const SYS_pread64: ::c_long = __X32_SYSCALL_BIT + 17; +pub const SYS_pwrite64: ::c_long = __X32_SYSCALL_BIT + 18; +pub const SYS_access: ::c_long = __X32_SYSCALL_BIT + 21; +pub const SYS_pipe: ::c_long = __X32_SYSCALL_BIT + 22; +pub const SYS_select: ::c_long = __X32_SYSCALL_BIT + 23; +pub const SYS_sched_yield: ::c_long = __X32_SYSCALL_BIT + 24; +pub const SYS_mremap: ::c_long = __X32_SYSCALL_BIT + 25; +pub const SYS_msync: ::c_long = __X32_SYSCALL_BIT + 26; +pub const SYS_mincore: ::c_long = __X32_SYSCALL_BIT + 27; +pub const SYS_madvise: ::c_long = __X32_SYSCALL_BIT + 28; +pub const SYS_shmget: ::c_long = __X32_SYSCALL_BIT + 29; +pub const SYS_shmat: ::c_long = __X32_SYSCALL_BIT + 30; +pub const SYS_shmctl: ::c_long = __X32_SYSCALL_BIT + 31; +pub const SYS_dup: ::c_long = __X32_SYSCALL_BIT + 32; +pub const SYS_dup2: ::c_long = __X32_SYSCALL_BIT + 33; +pub const SYS_pause: ::c_long = __X32_SYSCALL_BIT + 34; +pub const SYS_nanosleep: ::c_long = __X32_SYSCALL_BIT + 35; +pub const SYS_getitimer: ::c_long = __X32_SYSCALL_BIT + 36; +pub const SYS_alarm: ::c_long = __X32_SYSCALL_BIT + 37; +pub const SYS_setitimer: ::c_long = __X32_SYSCALL_BIT + 38; +pub const SYS_getpid: ::c_long = __X32_SYSCALL_BIT + 39; +pub const SYS_sendfile: ::c_long = __X32_SYSCALL_BIT + 40; +pub const SYS_socket: ::c_long = __X32_SYSCALL_BIT + 41; +pub const SYS_connect: ::c_long = __X32_SYSCALL_BIT + 42; +pub const SYS_accept: ::c_long = __X32_SYSCALL_BIT + 43; +pub const SYS_sendto: ::c_long = __X32_SYSCALL_BIT + 44; +pub const SYS_shutdown: ::c_long = __X32_SYSCALL_BIT + 48; +pub const SYS_bind: ::c_long = __X32_SYSCALL_BIT + 49; +pub const SYS_listen: ::c_long = __X32_SYSCALL_BIT + 50; +pub const SYS_getsockname: ::c_long = __X32_SYSCALL_BIT + 51; +pub const SYS_getpeername: ::c_long = __X32_SYSCALL_BIT + 52; +pub const SYS_socketpair: ::c_long = __X32_SYSCALL_BIT + 53; +pub const SYS_clone: ::c_long = __X32_SYSCALL_BIT + 56; +pub const SYS_fork: ::c_long = __X32_SYSCALL_BIT + 57; +pub const SYS_vfork: ::c_long = __X32_SYSCALL_BIT + 58; +pub const SYS_exit: ::c_long = __X32_SYSCALL_BIT + 60; +pub const SYS_wait4: ::c_long = __X32_SYSCALL_BIT + 61; +pub const SYS_kill: ::c_long = __X32_SYSCALL_BIT + 62; +pub const SYS_uname: ::c_long = __X32_SYSCALL_BIT + 63; +pub const SYS_semget: ::c_long = __X32_SYSCALL_BIT + 64; +pub const SYS_semop: ::c_long = __X32_SYSCALL_BIT + 65; +pub const SYS_semctl: ::c_long = __X32_SYSCALL_BIT + 66; +pub const SYS_shmdt: ::c_long = __X32_SYSCALL_BIT + 67; +pub const SYS_msgget: ::c_long = __X32_SYSCALL_BIT + 68; +pub const SYS_msgsnd: ::c_long = __X32_SYSCALL_BIT + 69; +pub const SYS_msgrcv: ::c_long = __X32_SYSCALL_BIT + 70; +pub const SYS_msgctl: ::c_long = __X32_SYSCALL_BIT + 71; +pub const SYS_fcntl: ::c_long = __X32_SYSCALL_BIT + 72; +pub const SYS_flock: ::c_long = __X32_SYSCALL_BIT + 73; +pub const SYS_fsync: ::c_long = __X32_SYSCALL_BIT + 74; +pub const SYS_fdatasync: ::c_long = __X32_SYSCALL_BIT + 75; +pub const SYS_truncate: ::c_long = __X32_SYSCALL_BIT + 76; +pub const SYS_ftruncate: ::c_long = __X32_SYSCALL_BIT + 77; +pub const SYS_getdents: ::c_long = __X32_SYSCALL_BIT + 78; +pub const SYS_getcwd: ::c_long = __X32_SYSCALL_BIT + 79; +pub const SYS_chdir: ::c_long = __X32_SYSCALL_BIT + 80; +pub const SYS_fchdir: ::c_long = __X32_SYSCALL_BIT + 81; +pub const SYS_rename: ::c_long = __X32_SYSCALL_BIT + 82; +pub const SYS_mkdir: ::c_long = __X32_SYSCALL_BIT + 83; +pub const SYS_rmdir: ::c_long = __X32_SYSCALL_BIT + 84; +pub const SYS_creat: ::c_long = __X32_SYSCALL_BIT + 85; +pub const SYS_link: ::c_long = __X32_SYSCALL_BIT + 86; +pub const SYS_unlink: ::c_long = __X32_SYSCALL_BIT + 87; +pub const SYS_symlink: ::c_long = __X32_SYSCALL_BIT + 88; +pub const SYS_readlink: ::c_long = __X32_SYSCALL_BIT + 89; +pub const SYS_chmod: ::c_long = __X32_SYSCALL_BIT + 90; +pub const SYS_fchmod: ::c_long = __X32_SYSCALL_BIT + 91; +pub const SYS_chown: ::c_long = __X32_SYSCALL_BIT + 92; +pub const SYS_fchown: ::c_long = __X32_SYSCALL_BIT + 93; +pub const SYS_lchown: ::c_long = __X32_SYSCALL_BIT + 94; +pub const SYS_umask: ::c_long = __X32_SYSCALL_BIT + 95; +pub const SYS_gettimeofday: ::c_long = __X32_SYSCALL_BIT + 96; +pub const SYS_getrlimit: ::c_long = __X32_SYSCALL_BIT + 97; +pub const SYS_getrusage: ::c_long = __X32_SYSCALL_BIT + 98; +pub const SYS_sysinfo: ::c_long = __X32_SYSCALL_BIT + 99; +pub const SYS_times: ::c_long = __X32_SYSCALL_BIT + 100; +pub const SYS_getuid: ::c_long = __X32_SYSCALL_BIT + 102; +pub const SYS_syslog: ::c_long = __X32_SYSCALL_BIT + 103; +pub const SYS_getgid: ::c_long = __X32_SYSCALL_BIT + 104; +pub const SYS_setuid: ::c_long = __X32_SYSCALL_BIT + 105; +pub const SYS_setgid: ::c_long = __X32_SYSCALL_BIT + 106; +pub const SYS_geteuid: ::c_long = __X32_SYSCALL_BIT + 107; +pub const SYS_getegid: ::c_long = __X32_SYSCALL_BIT + 108; +pub const SYS_setpgid: ::c_long = __X32_SYSCALL_BIT + 109; +pub const SYS_getppid: ::c_long = __X32_SYSCALL_BIT + 110; +pub const SYS_getpgrp: ::c_long = __X32_SYSCALL_BIT + 111; +pub const SYS_setsid: ::c_long = __X32_SYSCALL_BIT + 112; +pub const SYS_setreuid: ::c_long = __X32_SYSCALL_BIT + 113; +pub const SYS_setregid: ::c_long = __X32_SYSCALL_BIT + 114; +pub const SYS_getgroups: ::c_long = __X32_SYSCALL_BIT + 115; +pub const SYS_setgroups: ::c_long = __X32_SYSCALL_BIT + 116; +pub const SYS_setresuid: ::c_long = __X32_SYSCALL_BIT + 117; +pub const SYS_getresuid: ::c_long = __X32_SYSCALL_BIT + 118; +pub const SYS_setresgid: ::c_long = __X32_SYSCALL_BIT + 119; +pub const SYS_getresgid: ::c_long = __X32_SYSCALL_BIT + 120; +pub const SYS_getpgid: ::c_long = __X32_SYSCALL_BIT + 121; +pub const SYS_setfsuid: ::c_long = __X32_SYSCALL_BIT + 122; +pub const SYS_setfsgid: ::c_long = __X32_SYSCALL_BIT + 123; +pub const SYS_getsid: ::c_long = __X32_SYSCALL_BIT + 124; +pub const SYS_capget: ::c_long = __X32_SYSCALL_BIT + 125; +pub const SYS_capset: ::c_long = __X32_SYSCALL_BIT + 126; +pub const SYS_rt_sigsuspend: ::c_long = __X32_SYSCALL_BIT + 130; +pub const SYS_utime: ::c_long = __X32_SYSCALL_BIT + 132; +pub const SYS_mknod: ::c_long = __X32_SYSCALL_BIT + 133; +pub const SYS_personality: ::c_long = __X32_SYSCALL_BIT + 135; +pub const SYS_ustat: ::c_long = __X32_SYSCALL_BIT + 136; +pub const SYS_statfs: ::c_long = __X32_SYSCALL_BIT + 137; +pub const SYS_fstatfs: ::c_long = __X32_SYSCALL_BIT + 138; +pub const SYS_sysfs: ::c_long = __X32_SYSCALL_BIT + 139; +pub const SYS_getpriority: ::c_long = __X32_SYSCALL_BIT + 140; +pub const SYS_setpriority: ::c_long = __X32_SYSCALL_BIT + 141; +pub const SYS_sched_setparam: ::c_long = __X32_SYSCALL_BIT + 142; +pub const SYS_sched_getparam: ::c_long = __X32_SYSCALL_BIT + 143; +pub const SYS_sched_setscheduler: ::c_long = __X32_SYSCALL_BIT + 144; +pub const SYS_sched_getscheduler: ::c_long = __X32_SYSCALL_BIT + 145; +pub const SYS_sched_get_priority_max: ::c_long = __X32_SYSCALL_BIT + 146; +pub const SYS_sched_get_priority_min: ::c_long = __X32_SYSCALL_BIT + 147; +pub const SYS_sched_rr_get_interval: ::c_long = __X32_SYSCALL_BIT + 148; +pub const SYS_mlock: ::c_long = __X32_SYSCALL_BIT + 149; +pub const SYS_munlock: ::c_long = __X32_SYSCALL_BIT + 150; +pub const SYS_mlockall: ::c_long = __X32_SYSCALL_BIT + 151; +pub const SYS_munlockall: ::c_long = __X32_SYSCALL_BIT + 152; +pub const SYS_vhangup: ::c_long = __X32_SYSCALL_BIT + 153; +pub const SYS_modify_ldt: ::c_long = __X32_SYSCALL_BIT + 154; +pub const SYS_pivot_root: ::c_long = __X32_SYSCALL_BIT + 155; +pub const SYS_prctl: ::c_long = __X32_SYSCALL_BIT + 157; +pub const SYS_arch_prctl: ::c_long = __X32_SYSCALL_BIT + 158; +pub const SYS_adjtimex: ::c_long = __X32_SYSCALL_BIT + 159; +pub const SYS_setrlimit: ::c_long = __X32_SYSCALL_BIT + 160; +pub const SYS_chroot: ::c_long = __X32_SYSCALL_BIT + 161; +pub const SYS_sync: ::c_long = __X32_SYSCALL_BIT + 162; +pub const SYS_acct: ::c_long = __X32_SYSCALL_BIT + 163; +pub const SYS_settimeofday: ::c_long = __X32_SYSCALL_BIT + 164; +pub const SYS_mount: ::c_long = __X32_SYSCALL_BIT + 165; +pub const SYS_umount2: ::c_long = __X32_SYSCALL_BIT + 166; +pub const SYS_swapon: ::c_long = __X32_SYSCALL_BIT + 167; +pub const SYS_swapoff: ::c_long = __X32_SYSCALL_BIT + 168; +pub const SYS_reboot: ::c_long = __X32_SYSCALL_BIT + 169; +pub const SYS_sethostname: ::c_long = __X32_SYSCALL_BIT + 170; +pub const SYS_setdomainname: ::c_long = __X32_SYSCALL_BIT + 171; +pub const SYS_iopl: ::c_long = __X32_SYSCALL_BIT + 172; +pub const SYS_ioperm: ::c_long = __X32_SYSCALL_BIT + 173; +pub const SYS_init_module: ::c_long = __X32_SYSCALL_BIT + 175; +pub const SYS_delete_module: ::c_long = __X32_SYSCALL_BIT + 176; +pub const SYS_quotactl: ::c_long = __X32_SYSCALL_BIT + 179; +pub const SYS_getpmsg: ::c_long = __X32_SYSCALL_BIT + 181; +pub const SYS_putpmsg: ::c_long = __X32_SYSCALL_BIT + 182; +pub const SYS_afs_syscall: ::c_long = __X32_SYSCALL_BIT + 183; +pub const SYS_tuxcall: ::c_long = __X32_SYSCALL_BIT + 184; +pub const SYS_security: ::c_long = __X32_SYSCALL_BIT + 185; +pub const SYS_gettid: ::c_long = __X32_SYSCALL_BIT + 186; +pub const SYS_readahead: ::c_long = __X32_SYSCALL_BIT + 187; +pub const SYS_setxattr: ::c_long = __X32_SYSCALL_BIT + 188; +pub const SYS_lsetxattr: ::c_long = __X32_SYSCALL_BIT + 189; +pub const SYS_fsetxattr: ::c_long = __X32_SYSCALL_BIT + 190; +pub const SYS_getxattr: ::c_long = __X32_SYSCALL_BIT + 191; +pub const SYS_lgetxattr: ::c_long = __X32_SYSCALL_BIT + 192; +pub const SYS_fgetxattr: ::c_long = __X32_SYSCALL_BIT + 193; +pub const SYS_listxattr: ::c_long = __X32_SYSCALL_BIT + 194; +pub const SYS_llistxattr: ::c_long = __X32_SYSCALL_BIT + 195; +pub const SYS_flistxattr: ::c_long = __X32_SYSCALL_BIT + 196; +pub const SYS_removexattr: ::c_long = __X32_SYSCALL_BIT + 197; +pub const SYS_lremovexattr: ::c_long = __X32_SYSCALL_BIT + 198; +pub const SYS_fremovexattr: ::c_long = __X32_SYSCALL_BIT + 199; +pub const SYS_tkill: ::c_long = __X32_SYSCALL_BIT + 200; +pub const SYS_time: ::c_long = __X32_SYSCALL_BIT + 201; +pub const SYS_futex: ::c_long = __X32_SYSCALL_BIT + 202; +pub const SYS_sched_setaffinity: ::c_long = __X32_SYSCALL_BIT + 203; +pub const SYS_sched_getaffinity: ::c_long = __X32_SYSCALL_BIT + 204; +pub const SYS_io_destroy: ::c_long = __X32_SYSCALL_BIT + 207; +pub const SYS_io_getevents: ::c_long = __X32_SYSCALL_BIT + 208; +pub const SYS_io_cancel: ::c_long = __X32_SYSCALL_BIT + 210; +pub const SYS_lookup_dcookie: ::c_long = __X32_SYSCALL_BIT + 212; +pub const SYS_epoll_create: ::c_long = __X32_SYSCALL_BIT + 213; +pub const SYS_remap_file_pages: ::c_long = __X32_SYSCALL_BIT + 216; +pub const SYS_getdents64: ::c_long = __X32_SYSCALL_BIT + 217; +pub const SYS_set_tid_address: ::c_long = __X32_SYSCALL_BIT + 218; +pub const SYS_restart_syscall: ::c_long = __X32_SYSCALL_BIT + 219; +pub const SYS_semtimedop: ::c_long = __X32_SYSCALL_BIT + 220; +pub const SYS_fadvise64: ::c_long = __X32_SYSCALL_BIT + 221; +pub const SYS_timer_settime: ::c_long = __X32_SYSCALL_BIT + 223; +pub const SYS_timer_gettime: ::c_long = __X32_SYSCALL_BIT + 224; +pub const SYS_timer_getoverrun: ::c_long = __X32_SYSCALL_BIT + 225; +pub const SYS_timer_delete: ::c_long = __X32_SYSCALL_BIT + 226; +pub const SYS_clock_settime: ::c_long = __X32_SYSCALL_BIT + 227; +pub const SYS_clock_gettime: ::c_long = __X32_SYSCALL_BIT + 228; +pub const SYS_clock_getres: ::c_long = __X32_SYSCALL_BIT + 229; +pub const SYS_clock_nanosleep: ::c_long = __X32_SYSCALL_BIT + 230; +pub const SYS_exit_group: ::c_long = __X32_SYSCALL_BIT + 231; +pub const SYS_epoll_wait: ::c_long = __X32_SYSCALL_BIT + 232; +pub const SYS_epoll_ctl: ::c_long = __X32_SYSCALL_BIT + 233; +pub const SYS_tgkill: ::c_long = __X32_SYSCALL_BIT + 234; +pub const SYS_utimes: ::c_long = __X32_SYSCALL_BIT + 235; +pub const SYS_mbind: ::c_long = __X32_SYSCALL_BIT + 237; +pub const SYS_set_mempolicy: ::c_long = __X32_SYSCALL_BIT + 238; +pub const SYS_get_mempolicy: ::c_long = __X32_SYSCALL_BIT + 239; +pub const SYS_mq_open: ::c_long = __X32_SYSCALL_BIT + 240; +pub const SYS_mq_unlink: ::c_long = __X32_SYSCALL_BIT + 241; +pub const SYS_mq_timedsend: ::c_long = __X32_SYSCALL_BIT + 242; +pub const SYS_mq_timedreceive: ::c_long = __X32_SYSCALL_BIT + 243; +pub const SYS_mq_getsetattr: ::c_long = __X32_SYSCALL_BIT + 245; +pub const SYS_add_key: ::c_long = __X32_SYSCALL_BIT + 248; +pub const SYS_request_key: ::c_long = __X32_SYSCALL_BIT + 249; +pub const SYS_keyctl: ::c_long = __X32_SYSCALL_BIT + 250; +pub const SYS_ioprio_set: ::c_long = __X32_SYSCALL_BIT + 251; +pub const SYS_ioprio_get: ::c_long = __X32_SYSCALL_BIT + 252; +pub const SYS_inotify_init: ::c_long = __X32_SYSCALL_BIT + 253; +pub const SYS_inotify_add_watch: ::c_long = __X32_SYSCALL_BIT + 254; +pub const SYS_inotify_rm_watch: ::c_long = __X32_SYSCALL_BIT + 255; +pub const SYS_migrate_pages: ::c_long = __X32_SYSCALL_BIT + 256; +pub const SYS_openat: ::c_long = __X32_SYSCALL_BIT + 257; +pub const SYS_mkdirat: ::c_long = __X32_SYSCALL_BIT + 258; +pub const SYS_mknodat: ::c_long = __X32_SYSCALL_BIT + 259; +pub const SYS_fchownat: ::c_long = __X32_SYSCALL_BIT + 260; +pub const SYS_futimesat: ::c_long = __X32_SYSCALL_BIT + 261; +pub const SYS_newfstatat: ::c_long = __X32_SYSCALL_BIT + 262; +pub const SYS_unlinkat: ::c_long = __X32_SYSCALL_BIT + 263; +pub const SYS_renameat: ::c_long = __X32_SYSCALL_BIT + 264; +pub const SYS_linkat: ::c_long = __X32_SYSCALL_BIT + 265; +pub const SYS_symlinkat: ::c_long = __X32_SYSCALL_BIT + 266; +pub const SYS_readlinkat: ::c_long = __X32_SYSCALL_BIT + 267; +pub const SYS_fchmodat: ::c_long = __X32_SYSCALL_BIT + 268; +pub const SYS_faccessat: ::c_long = __X32_SYSCALL_BIT + 269; +pub const SYS_pselect6: ::c_long = __X32_SYSCALL_BIT + 270; +pub const SYS_ppoll: ::c_long = __X32_SYSCALL_BIT + 271; +pub const SYS_unshare: ::c_long = __X32_SYSCALL_BIT + 272; +pub const SYS_splice: ::c_long = __X32_SYSCALL_BIT + 275; +pub const SYS_tee: ::c_long = __X32_SYSCALL_BIT + 276; +pub const SYS_sync_file_range: ::c_long = __X32_SYSCALL_BIT + 277; +pub const SYS_utimensat: ::c_long = __X32_SYSCALL_BIT + 280; +pub const SYS_epoll_pwait: ::c_long = __X32_SYSCALL_BIT + 281; +pub const SYS_signalfd: ::c_long = __X32_SYSCALL_BIT + 282; +pub const SYS_timerfd_create: ::c_long = __X32_SYSCALL_BIT + 283; +pub const SYS_eventfd: ::c_long = __X32_SYSCALL_BIT + 284; +pub const SYS_fallocate: ::c_long = __X32_SYSCALL_BIT + 285; +pub const SYS_timerfd_settime: ::c_long = __X32_SYSCALL_BIT + 286; +pub const SYS_timerfd_gettime: ::c_long = __X32_SYSCALL_BIT + 287; +pub const SYS_accept4: ::c_long = __X32_SYSCALL_BIT + 288; +pub const SYS_signalfd4: ::c_long = __X32_SYSCALL_BIT + 289; +pub const SYS_eventfd2: ::c_long = __X32_SYSCALL_BIT + 290; +pub const SYS_epoll_create1: ::c_long = __X32_SYSCALL_BIT + 291; +pub const SYS_dup3: ::c_long = __X32_SYSCALL_BIT + 292; +pub const SYS_pipe2: ::c_long = __X32_SYSCALL_BIT + 293; +pub const SYS_inotify_init1: ::c_long = __X32_SYSCALL_BIT + 294; +pub const SYS_perf_event_open: ::c_long = __X32_SYSCALL_BIT + 298; +pub const SYS_fanotify_init: ::c_long = __X32_SYSCALL_BIT + 300; +pub const SYS_fanotify_mark: ::c_long = __X32_SYSCALL_BIT + 301; +pub const SYS_prlimit64: ::c_long = __X32_SYSCALL_BIT + 302; +pub const SYS_name_to_handle_at: ::c_long = __X32_SYSCALL_BIT + 303; +pub const SYS_open_by_handle_at: ::c_long = __X32_SYSCALL_BIT + 304; +pub const SYS_clock_adjtime: ::c_long = __X32_SYSCALL_BIT + 305; +pub const SYS_syncfs: ::c_long = __X32_SYSCALL_BIT + 306; +pub const SYS_setns: ::c_long = __X32_SYSCALL_BIT + 308; +pub const SYS_getcpu: ::c_long = __X32_SYSCALL_BIT + 309; +pub const SYS_kcmp: ::c_long = __X32_SYSCALL_BIT + 312; +pub const SYS_finit_module: ::c_long = __X32_SYSCALL_BIT + 313; +pub const SYS_sched_setattr: ::c_long = __X32_SYSCALL_BIT + 314; +pub const SYS_sched_getattr: ::c_long = __X32_SYSCALL_BIT + 315; +pub const SYS_renameat2: ::c_long = __X32_SYSCALL_BIT + 316; +pub const SYS_seccomp: ::c_long = __X32_SYSCALL_BIT + 317; +pub const SYS_getrandom: ::c_long = __X32_SYSCALL_BIT + 318; +pub const SYS_memfd_create: ::c_long = __X32_SYSCALL_BIT + 319; +pub const SYS_kexec_file_load: ::c_long = __X32_SYSCALL_BIT + 320; +pub const SYS_bpf: ::c_long = __X32_SYSCALL_BIT + 321; +pub const SYS_userfaultfd: ::c_long = __X32_SYSCALL_BIT + 323; +pub const SYS_membarrier: ::c_long = __X32_SYSCALL_BIT + 324; +pub const SYS_mlock2: ::c_long = __X32_SYSCALL_BIT + 325; +pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326; +pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329; +pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330; +pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331; +pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512; +pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513; +pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514; +pub const SYS_readv: ::c_long = __X32_SYSCALL_BIT + 515; +pub const SYS_writev: ::c_long = __X32_SYSCALL_BIT + 516; +pub const SYS_recvfrom: ::c_long = __X32_SYSCALL_BIT + 517; +pub const SYS_sendmsg: ::c_long = __X32_SYSCALL_BIT + 518; +pub const SYS_recvmsg: ::c_long = __X32_SYSCALL_BIT + 519; +pub const SYS_execve: ::c_long = __X32_SYSCALL_BIT + 520; +pub const SYS_ptrace: ::c_long = __X32_SYSCALL_BIT + 521; +pub const SYS_rt_sigpending: ::c_long = __X32_SYSCALL_BIT + 522; +pub const SYS_rt_sigtimedwait: ::c_long = __X32_SYSCALL_BIT + 523; +pub const SYS_rt_sigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 524; +pub const SYS_sigaltstack: ::c_long = __X32_SYSCALL_BIT + 525; +pub const SYS_timer_create: ::c_long = __X32_SYSCALL_BIT + 526; +pub const SYS_mq_notify: ::c_long = __X32_SYSCALL_BIT + 527; +pub const SYS_kexec_load: ::c_long = __X32_SYSCALL_BIT + 528; +pub const SYS_waitid: ::c_long = __X32_SYSCALL_BIT + 529; +pub const SYS_set_robust_list: ::c_long = __X32_SYSCALL_BIT + 530; +pub const SYS_get_robust_list: ::c_long = __X32_SYSCALL_BIT + 531; +pub const SYS_vmsplice: ::c_long = __X32_SYSCALL_BIT + 532; +pub const SYS_move_pages: ::c_long = __X32_SYSCALL_BIT + 533; +pub const SYS_preadv: ::c_long = __X32_SYSCALL_BIT + 534; +pub const SYS_pwritev: ::c_long = __X32_SYSCALL_BIT + 535; +pub const SYS_rt_tgsigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 536; +pub const SYS_recvmmsg: ::c_long = __X32_SYSCALL_BIT + 537; +pub const SYS_sendmmsg: ::c_long = __X32_SYSCALL_BIT + 538; +pub const SYS_process_vm_readv: ::c_long = __X32_SYSCALL_BIT + 539; +pub const SYS_process_vm_writev: ::c_long = __X32_SYSCALL_BIT + 540; +pub const SYS_setsockopt: ::c_long = __X32_SYSCALL_BIT + 541; +pub const SYS_getsockopt: ::c_long = __X32_SYSCALL_BIT + 542; +pub const SYS_io_setup: ::c_long = __X32_SYSCALL_BIT + 543; +pub const SYS_io_submit: ::c_long = __X32_SYSCALL_BIT + 544; +pub const SYS_execveat: ::c_long = __X32_SYSCALL_BIT + 545; +pub const SYS_preadv2: ::c_long = __X32_SYSCALL_BIT + 546; +pub const SYS_pwritev2: ::c_long = __X32_SYSCALL_BIT + 547; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/x86_64.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/x86_64.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/b64/x86_64.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/b64/x86_64.rs 2017-12-21 19:00:07.000000000 +0000 @@ -22,12 +22,12 @@ pub st_blksize: ::blksize_t, pub st_blocks: ::blkcnt_t, pub st_atime: ::time_t, - pub st_atime_nsec: ::c_long, + pub st_atime_nsec: i64, pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_long, + pub st_mtime_nsec: i64, pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_long, - __unused: [::c_long; 3], + pub st_ctime_nsec: i64, + __unused: [i64; 3], } pub struct stat64 { @@ -43,12 +43,12 @@ pub st_blksize: ::blksize_t, pub st_blocks: ::blkcnt64_t, pub st_atime: ::time_t, - pub st_atime_nsec: ::c_long, + pub st_atime_nsec: i64, pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_long, + pub st_mtime_nsec: i64, pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_long, - __reserved: [::c_long; 3], + pub st_ctime_nsec: i64, + __reserved: [i64; 3], } pub struct statfs64 { @@ -82,6 +82,9 @@ } pub struct pthread_attr_t { + #[cfg(target_pointer_width = "32")] + __size: [u32; 8], + #[cfg(target_pointer_width = "64")] __size: [u64; 7] } @@ -164,7 +167,11 @@ pub start_stack: ::c_ulonglong, pub signal: ::c_longlong, __reserved: ::c_int, + #[cfg(target_pointer_width = "32")] + __pad1: u32, pub u_ar0: *mut user_regs_struct, + #[cfg(target_pointer_width = "32")] + __pad2: u32, pub u_fpstate: *mut user_fpregs_struct, pub magic: ::c_ulonglong, pub u_comm: [::c_char; 32], @@ -196,8 +203,8 @@ __pad1: ::c_ushort, pub __seq: ::c_ushort, __pad2: ::c_ushort, - __unused1: ::c_ulong, - __unused2: ::c_ulong + __unused1: u64, + __unused2: u64 } pub struct shmid_ds { @@ -209,8 +216,19 @@ pub shm_cpid: ::pid_t, pub shm_lpid: ::pid_t, pub shm_nattch: ::shmatt_t, - __unused4: ::c_ulong, - __unused5: ::c_ulong + __unused4: u64, + __unused5: u64 + } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, } } @@ -453,7 +471,6 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000; pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; -pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; pub const O_DIRECT: ::c_int = 0x4000; @@ -552,6 +569,7 @@ pub const B38400: ::speed_t = 0o000017; pub const EXTA: ::speed_t = B19200; pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -594,341 +612,6 @@ pub const TIOCSWINSZ: ::c_ulong = 0x5414; pub const FIONREAD: ::c_ulong = 0x541B; -// Syscall table - -pub const SYS_read: ::c_long = 0; -pub const SYS_write: ::c_long = 1; -pub const SYS_open: ::c_long = 2; -pub const SYS_close: ::c_long = 3; -pub const SYS_stat: ::c_long = 4; -pub const SYS_fstat: ::c_long = 5; -pub const SYS_lstat: ::c_long = 6; -pub const SYS_poll: ::c_long = 7; -pub const SYS_lseek: ::c_long = 8; -pub const SYS_mmap: ::c_long = 9; -pub const SYS_mprotect: ::c_long = 10; -pub const SYS_munmap: ::c_long = 11; -pub const SYS_brk: ::c_long = 12; -pub const SYS_rt_sigaction: ::c_long = 13; -pub const SYS_rt_sigprocmask: ::c_long = 14; -pub const SYS_rt_sigreturn: ::c_long = 15; -pub const SYS_ioctl: ::c_long = 16; -pub const SYS_pread64: ::c_long = 17; -pub const SYS_pwrite64: ::c_long = 18; -pub const SYS_readv: ::c_long = 19; -pub const SYS_writev: ::c_long = 20; -pub const SYS_access: ::c_long = 21; -pub const SYS_pipe: ::c_long = 22; -pub const SYS_select: ::c_long = 23; -pub const SYS_sched_yield: ::c_long = 24; -pub const SYS_mremap: ::c_long = 25; -pub const SYS_msync: ::c_long = 26; -pub const SYS_mincore: ::c_long = 27; -pub const SYS_madvise: ::c_long = 28; -pub const SYS_shmget: ::c_long = 29; -pub const SYS_shmat: ::c_long = 30; -pub const SYS_shmctl: ::c_long = 31; -pub const SYS_dup: ::c_long = 32; -pub const SYS_dup2: ::c_long = 33; -pub const SYS_pause: ::c_long = 34; -pub const SYS_nanosleep: ::c_long = 35; -pub const SYS_getitimer: ::c_long = 36; -pub const SYS_alarm: ::c_long = 37; -pub const SYS_setitimer: ::c_long = 38; -pub const SYS_getpid: ::c_long = 39; -pub const SYS_sendfile: ::c_long = 40; -pub const SYS_socket: ::c_long = 41; -pub const SYS_connect: ::c_long = 42; -pub const SYS_accept: ::c_long = 43; -pub const SYS_sendto: ::c_long = 44; -pub const SYS_recvfrom: ::c_long = 45; -pub const SYS_sendmsg: ::c_long = 46; -pub const SYS_recvmsg: ::c_long = 47; -pub const SYS_shutdown: ::c_long = 48; -pub const SYS_bind: ::c_long = 49; -pub const SYS_listen: ::c_long = 50; -pub const SYS_getsockname: ::c_long = 51; -pub const SYS_getpeername: ::c_long = 52; -pub const SYS_socketpair: ::c_long = 53; -pub const SYS_setsockopt: ::c_long = 54; -pub const SYS_getsockopt: ::c_long = 55; -pub const SYS_clone: ::c_long = 56; -pub const SYS_fork: ::c_long = 57; -pub const SYS_vfork: ::c_long = 58; -pub const SYS_execve: ::c_long = 59; -pub const SYS_exit: ::c_long = 60; -pub const SYS_wait4: ::c_long = 61; -pub const SYS_kill: ::c_long = 62; -pub const SYS_uname: ::c_long = 63; -pub const SYS_semget: ::c_long = 64; -pub const SYS_semop: ::c_long = 65; -pub const SYS_semctl: ::c_long = 66; -pub const SYS_shmdt: ::c_long = 67; -pub const SYS_msgget: ::c_long = 68; -pub const SYS_msgsnd: ::c_long = 69; -pub const SYS_msgrcv: ::c_long = 70; -pub const SYS_msgctl: ::c_long = 71; -pub const SYS_fcntl: ::c_long = 72; -pub const SYS_flock: ::c_long = 73; -pub const SYS_fsync: ::c_long = 74; -pub const SYS_fdatasync: ::c_long = 75; -pub const SYS_truncate: ::c_long = 76; -pub const SYS_ftruncate: ::c_long = 77; -pub const SYS_getdents: ::c_long = 78; -pub const SYS_getcwd: ::c_long = 79; -pub const SYS_chdir: ::c_long = 80; -pub const SYS_fchdir: ::c_long = 81; -pub const SYS_rename: ::c_long = 82; -pub const SYS_mkdir: ::c_long = 83; -pub const SYS_rmdir: ::c_long = 84; -pub const SYS_creat: ::c_long = 85; -pub const SYS_link: ::c_long = 86; -pub const SYS_unlink: ::c_long = 87; -pub const SYS_symlink: ::c_long = 88; -pub const SYS_readlink: ::c_long = 89; -pub const SYS_chmod: ::c_long = 90; -pub const SYS_fchmod: ::c_long = 91; -pub const SYS_chown: ::c_long = 92; -pub const SYS_fchown: ::c_long = 93; -pub const SYS_lchown: ::c_long = 94; -pub const SYS_umask: ::c_long = 95; -pub const SYS_gettimeofday: ::c_long = 96; -pub const SYS_getrlimit: ::c_long = 97; -pub const SYS_getrusage: ::c_long = 98; -pub const SYS_sysinfo: ::c_long = 99; -pub const SYS_times: ::c_long = 100; -pub const SYS_ptrace: ::c_long = 101; -pub const SYS_getuid: ::c_long = 102; -pub const SYS_syslog: ::c_long = 103; -pub const SYS_getgid: ::c_long = 104; -pub const SYS_setuid: ::c_long = 105; -pub const SYS_setgid: ::c_long = 106; -pub const SYS_geteuid: ::c_long = 107; -pub const SYS_getegid: ::c_long = 108; -pub const SYS_setpgid: ::c_long = 109; -pub const SYS_getppid: ::c_long = 110; -pub const SYS_getpgrp: ::c_long = 111; -pub const SYS_setsid: ::c_long = 112; -pub const SYS_setreuid: ::c_long = 113; -pub const SYS_setregid: ::c_long = 114; -pub const SYS_getgroups: ::c_long = 115; -pub const SYS_setgroups: ::c_long = 116; -pub const SYS_setresuid: ::c_long = 117; -pub const SYS_getresuid: ::c_long = 118; -pub const SYS_setresgid: ::c_long = 119; -pub const SYS_getresgid: ::c_long = 120; -pub const SYS_getpgid: ::c_long = 121; -pub const SYS_setfsuid: ::c_long = 122; -pub const SYS_setfsgid: ::c_long = 123; -pub const SYS_getsid: ::c_long = 124; -pub const SYS_capget: ::c_long = 125; -pub const SYS_capset: ::c_long = 126; -pub const SYS_rt_sigpending: ::c_long = 127; -pub const SYS_rt_sigtimedwait: ::c_long = 128; -pub const SYS_rt_sigqueueinfo: ::c_long = 129; -pub const SYS_rt_sigsuspend: ::c_long = 130; -pub const SYS_sigaltstack: ::c_long = 131; -pub const SYS_utime: ::c_long = 132; -pub const SYS_mknod: ::c_long = 133; -pub const SYS_uselib: ::c_long = 134; -pub const SYS_personality: ::c_long = 135; -pub const SYS_ustat: ::c_long = 136; -pub const SYS_statfs: ::c_long = 137; -pub const SYS_fstatfs: ::c_long = 138; -pub const SYS_sysfs: ::c_long = 139; -pub const SYS_getpriority: ::c_long = 140; -pub const SYS_setpriority: ::c_long = 141; -pub const SYS_sched_setparam: ::c_long = 142; -pub const SYS_sched_getparam: ::c_long = 143; -pub const SYS_sched_setscheduler: ::c_long = 144; -pub const SYS_sched_getscheduler: ::c_long = 145; -pub const SYS_sched_get_priority_max: ::c_long = 146; -pub const SYS_sched_get_priority_min: ::c_long = 147; -pub const SYS_sched_rr_get_interval: ::c_long = 148; -pub const SYS_mlock: ::c_long = 149; -pub const SYS_munlock: ::c_long = 150; -pub const SYS_mlockall: ::c_long = 151; -pub const SYS_munlockall: ::c_long = 152; -pub const SYS_vhangup: ::c_long = 153; -pub const SYS_modify_ldt: ::c_long = 154; -pub const SYS_pivot_root: ::c_long = 155; -pub const SYS__sysctl: ::c_long = 156; -pub const SYS_prctl: ::c_long = 157; -pub const SYS_arch_prctl: ::c_long = 158; -pub const SYS_adjtimex: ::c_long = 159; -pub const SYS_setrlimit: ::c_long = 160; -pub const SYS_chroot: ::c_long = 161; -pub const SYS_sync: ::c_long = 162; -pub const SYS_acct: ::c_long = 163; -pub const SYS_settimeofday: ::c_long = 164; -pub const SYS_mount: ::c_long = 165; -pub const SYS_umount2: ::c_long = 166; -pub const SYS_swapon: ::c_long = 167; -pub const SYS_swapoff: ::c_long = 168; -pub const SYS_reboot: ::c_long = 169; -pub const SYS_sethostname: ::c_long = 170; -pub const SYS_setdomainname: ::c_long = 171; -pub const SYS_iopl: ::c_long = 172; -pub const SYS_ioperm: ::c_long = 173; -pub const SYS_create_module: ::c_long = 174; -pub const SYS_init_module: ::c_long = 175; -pub const SYS_delete_module: ::c_long = 176; -pub const SYS_get_kernel_syms: ::c_long = 177; -pub const SYS_query_module: ::c_long = 178; -pub const SYS_quotactl: ::c_long = 179; -pub const SYS_nfsservctl: ::c_long = 180; -pub const SYS_getpmsg: ::c_long = 181; -pub const SYS_putpmsg: ::c_long = 182; -pub const SYS_afs_syscall: ::c_long = 183; -pub const SYS_tuxcall: ::c_long = 184; -pub const SYS_security: ::c_long = 185; -pub const SYS_gettid: ::c_long = 186; -pub const SYS_readahead: ::c_long = 187; -pub const SYS_setxattr: ::c_long = 188; -pub const SYS_lsetxattr: ::c_long = 189; -pub const SYS_fsetxattr: ::c_long = 190; -pub const SYS_getxattr: ::c_long = 191; -pub const SYS_lgetxattr: ::c_long = 192; -pub const SYS_fgetxattr: ::c_long = 193; -pub const SYS_listxattr: ::c_long = 194; -pub const SYS_llistxattr: ::c_long = 195; -pub const SYS_flistxattr: ::c_long = 196; -pub const SYS_removexattr: ::c_long = 197; -pub const SYS_lremovexattr: ::c_long = 198; -pub const SYS_fremovexattr: ::c_long = 199; -pub const SYS_tkill: ::c_long = 200; -pub const SYS_time: ::c_long = 201; -pub const SYS_futex: ::c_long = 202; -pub const SYS_sched_setaffinity: ::c_long = 203; -pub const SYS_sched_getaffinity: ::c_long = 204; -pub const SYS_set_thread_area: ::c_long = 205; -pub const SYS_io_setup: ::c_long = 206; -pub const SYS_io_destroy: ::c_long = 207; -pub const SYS_io_getevents: ::c_long = 208; -pub const SYS_io_submit: ::c_long = 209; -pub const SYS_io_cancel: ::c_long = 210; -pub const SYS_get_thread_area: ::c_long = 211; -pub const SYS_lookup_dcookie: ::c_long = 212; -pub const SYS_epoll_create: ::c_long = 213; -pub const SYS_epoll_ctl_old: ::c_long = 214; -pub const SYS_epoll_wait_old: ::c_long = 215; -pub const SYS_remap_file_pages: ::c_long = 216; -pub const SYS_getdents64: ::c_long = 217; -pub const SYS_set_tid_address: ::c_long = 218; -pub const SYS_restart_syscall: ::c_long = 219; -pub const SYS_semtimedop: ::c_long = 220; -pub const SYS_fadvise64: ::c_long = 221; -pub const SYS_timer_create: ::c_long = 222; -pub const SYS_timer_settime: ::c_long = 223; -pub const SYS_timer_gettime: ::c_long = 224; -pub const SYS_timer_getoverrun: ::c_long = 225; -pub const SYS_timer_delete: ::c_long = 226; -pub const SYS_clock_settime: ::c_long = 227; -pub const SYS_clock_gettime: ::c_long = 228; -pub const SYS_clock_getres: ::c_long = 229; -pub const SYS_clock_nanosleep: ::c_long = 230; -pub const SYS_exit_group: ::c_long = 231; -pub const SYS_epoll_wait: ::c_long = 232; -pub const SYS_epoll_ctl: ::c_long = 233; -pub const SYS_tgkill: ::c_long = 234; -pub const SYS_utimes: ::c_long = 235; -pub const SYS_vserver: ::c_long = 236; -pub const SYS_mbind: ::c_long = 237; -pub const SYS_set_mempolicy: ::c_long = 238; -pub const SYS_get_mempolicy: ::c_long = 239; -pub const SYS_mq_open: ::c_long = 240; -pub const SYS_mq_unlink: ::c_long = 241; -pub const SYS_mq_timedsend: ::c_long = 242; -pub const SYS_mq_timedreceive: ::c_long = 243; -pub const SYS_mq_notify: ::c_long = 244; -pub const SYS_mq_getsetattr: ::c_long = 245; -pub const SYS_kexec_load: ::c_long = 246; -pub const SYS_waitid: ::c_long = 247; -pub const SYS_add_key: ::c_long = 248; -pub const SYS_request_key: ::c_long = 249; -pub const SYS_keyctl: ::c_long = 250; -pub const SYS_ioprio_set: ::c_long = 251; -pub const SYS_ioprio_get: ::c_long = 252; -pub const SYS_inotify_init: ::c_long = 253; -pub const SYS_inotify_add_watch: ::c_long = 254; -pub const SYS_inotify_rm_watch: ::c_long = 255; -pub const SYS_migrate_pages: ::c_long = 256; -pub const SYS_openat: ::c_long = 257; -pub const SYS_mkdirat: ::c_long = 258; -pub const SYS_mknodat: ::c_long = 259; -pub const SYS_fchownat: ::c_long = 260; -pub const SYS_futimesat: ::c_long = 261; -pub const SYS_newfstatat: ::c_long = 262; -pub const SYS_unlinkat: ::c_long = 263; -pub const SYS_renameat: ::c_long = 264; -pub const SYS_linkat: ::c_long = 265; -pub const SYS_symlinkat: ::c_long = 266; -pub const SYS_readlinkat: ::c_long = 267; -pub const SYS_fchmodat: ::c_long = 268; -pub const SYS_faccessat: ::c_long = 269; -pub const SYS_pselect6: ::c_long = 270; -pub const SYS_ppoll: ::c_long = 271; -pub const SYS_unshare: ::c_long = 272; -pub const SYS_set_robust_list: ::c_long = 273; -pub const SYS_get_robust_list: ::c_long = 274; -pub const SYS_splice: ::c_long = 275; -pub const SYS_tee: ::c_long = 276; -pub const SYS_sync_file_range: ::c_long = 277; -pub const SYS_vmsplice: ::c_long = 278; -pub const SYS_move_pages: ::c_long = 279; -pub const SYS_utimensat: ::c_long = 280; -pub const SYS_epoll_pwait: ::c_long = 281; -pub const SYS_signalfd: ::c_long = 282; -pub const SYS_timerfd_create: ::c_long = 283; -pub const SYS_eventfd: ::c_long = 284; -pub const SYS_fallocate: ::c_long = 285; -pub const SYS_timerfd_settime: ::c_long = 286; -pub const SYS_timerfd_gettime: ::c_long = 287; -pub const SYS_accept4: ::c_long = 288; -pub const SYS_signalfd4: ::c_long = 289; -pub const SYS_eventfd2: ::c_long = 290; -pub const SYS_epoll_create1: ::c_long = 291; -pub const SYS_dup3: ::c_long = 292; -pub const SYS_pipe2: ::c_long = 293; -pub const SYS_inotify_init1: ::c_long = 294; -pub const SYS_preadv: ::c_long = 295; -pub const SYS_pwritev: ::c_long = 296; -pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; -pub const SYS_perf_event_open: ::c_long = 298; -pub const SYS_recvmmsg: ::c_long = 299; -pub const SYS_fanotify_init: ::c_long = 300; -pub const SYS_fanotify_mark: ::c_long = 301; -pub const SYS_prlimit64: ::c_long = 302; -pub const SYS_name_to_handle_at: ::c_long = 303; -pub const SYS_open_by_handle_at: ::c_long = 304; -pub const SYS_clock_adjtime: ::c_long = 305; -pub const SYS_syncfs: ::c_long = 306; -pub const SYS_sendmmsg: ::c_long = 307; -pub const SYS_setns: ::c_long = 308; -pub const SYS_getcpu: ::c_long = 309; -pub const SYS_process_vm_readv: ::c_long = 310; -pub const SYS_process_vm_writev: ::c_long = 311; -pub const SYS_kcmp: ::c_long = 312; -pub const SYS_finit_module: ::c_long = 313; -pub const SYS_sched_setattr: ::c_long = 314; -pub const SYS_sched_getattr: ::c_long = 315; -pub const SYS_renameat2: ::c_long = 316; -pub const SYS_seccomp: ::c_long = 317; -pub const SYS_getrandom: ::c_long = 318; -pub const SYS_memfd_create: ::c_long = 319; -pub const SYS_kexec_file_load: ::c_long = 320; -pub const SYS_bpf: ::c_long = 321; -pub const SYS_execveat: ::c_long = 322; -pub const SYS_userfaultfd: ::c_long = 323; -pub const SYS_membarrier: ::c_long = 324; -pub const SYS_mlock2: ::c_long = 325; -pub const SYS_copy_file_range: ::c_long = 326; -pub const SYS_preadv2: ::c_long = 327; -pub const SYS_pwritev2: ::c_long = 328; -pub const SYS_pkey_mprotect: ::c_long = 329; -pub const SYS_pkey_alloc: ::c_long = 330; -pub const SYS_pkey_free: ::c_long = 331; - // offsets in user_regs_structs, from sys/reg.h pub const R15: ::c_int = 0; pub const R14: ::c_int = 1; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/other/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/other/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,3 @@ -pub type fsblkcnt_t = ::c_ulong; -pub type fsfilcnt_t = ::c_ulong; -pub type rlim_t = c_ulong; pub type __priority_which_t = ::c_uint; s! { @@ -17,7 +14,7 @@ __error_code: ::c_int, __return_value: ::ssize_t, pub aio_offset: off_t, - #[cfg(target_pointer_width = "32")] + #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] __unused1: [::c_char; 4], __glibc_reserved: [::c_char; 32] } @@ -44,20 +41,24 @@ #[cfg(any(target_arch = "aarch64", target_arch = "sparc64", - target_pointer_width = "32"))] + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] pub ut_session: ::c_long, #[cfg(any(target_arch = "aarch64", target_arch = "sparc64", - target_pointer_width = "32"))] + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] pub ut_tv: ::timeval, #[cfg(not(any(target_arch = "aarch64", target_arch = "sparc64", - target_pointer_width = "32")))] + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] pub ut_session: ::int32_t, #[cfg(not(any(target_arch = "aarch64", target_arch = "sparc64", - target_pointer_width = "32")))] + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] pub ut_tv: __timeval, pub ut_addr_v6: [::int32_t; 4], @@ -84,6 +85,9 @@ pub si_errno: ::c_int, pub si_code: ::c_int, pub _pad: [::c_int; 29], + #[cfg(target_arch = "x86_64")] + _align: [u64; 0], + #[cfg(not(target_arch = "x86_64"))] _align: [usize; 0], } @@ -247,6 +251,8 @@ pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; @@ -259,6 +265,27 @@ pub const TCP_FASTOPEN: ::c_int = 23; pub const TCP_TIMESTAMP: ::c_int = 24; +/* DCCP socket options */ +pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; +pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; +pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; +pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; +pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; +pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; +pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; +pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; +pub const DCCP_SOCKOPT_CCID: ::c_int = 13; +pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; +pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; +pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; +pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; +pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; +pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; + +/// maximum number of services provided on the same listening port +pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; + pub const SIGTTIN: ::c_int = 21; pub const SIGTTOU: ::c_int = 22; pub const SIGXCPU: ::c_int = 24; @@ -385,8 +412,6 @@ pub const CPU_SETSIZE: ::c_int = 0x400; -pub const QFMT_VFS_V1: ::c_int = 4; - pub const PTRACE_TRACEME: ::c_uint = 0; pub const PTRACE_PEEKTEXT: ::c_uint = 1; pub const PTRACE_PEEKDATA: ::c_uint = 2; @@ -518,6 +543,11 @@ pub const TIOCM_CD: ::c_int = TIOCM_CAR; pub const TIOCM_RI: ::c_int = TIOCM_RNG; +#[doc(hidden)] +pub const AF_MAX: ::c_int = 42; +#[doc(hidden)] +pub const PF_MAX: ::c_int = AF_MAX; + cfg_if! { if #[cfg(any(target_arch = "arm", target_arch = "x86", target_arch = "x86_64"))] { @@ -542,13 +572,6 @@ #[link(name = "util")] extern { - pub fn sysctl(name: *mut ::c_int, - namelen: ::c_int, - oldp: *mut ::c_void, - oldlenp: *mut ::size_t, - newp: *mut ::c_void, - newlen: ::size_t) - -> ::c_int; pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/s390x.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/s390x.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/linux/s390x.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/linux/s390x.rs 2017-12-21 19:00:07.000000000 +0000 @@ -14,6 +14,9 @@ pub type wchar_t = i32; pub type greg_t = u64; pub type clock_t = i64; +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; pub type __fsword_t = ::c_long; pub type __priority_which_t = ::c_uint; pub type __u64 = u64; @@ -177,6 +180,17 @@ pub c_ospeed: ::speed_t, } + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + pub struct sysinfo { pub uptime: ::c_long, pub loads: [::c_ulong; 3], @@ -698,8 +712,6 @@ pub const EXTPROC: ::tcflag_t = 0x00010000; -pub const QFMT_VFS_V1: ::c_int = 4; - pub const PTRACE_TRACEME: ::c_uint = 0; pub const PTRACE_PEEKTEXT: ::c_uint = 1; pub const PTRACE_PEEKDATA: ::c_uint = 2; @@ -800,11 +812,6 @@ pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; -pub const SYS_pivot_root: ::c_long = 217; -pub const SYS_gettid: ::c_long = 236; -pub const SYS_perf_event_open: ::c_long = 331; -pub const SYS_memfd_create: ::c_long = 350; - pub const VTIME: usize = 5; pub const VSWTC: usize = 7; pub const VSTART: usize = 8; @@ -876,6 +883,7 @@ pub const HUPCL: ::tcflag_t = 0o002000; pub const CLOCAL: ::tcflag_t = 0o004000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const BOTHER: ::speed_t = 0o010000; pub const B57600: ::speed_t = 0o010001; pub const B115200: ::speed_t = 0o010002; pub const B230400: ::speed_t = 0o010003; @@ -911,6 +919,329 @@ pub const IXON: ::tcflag_t = 0o002000; pub const IXOFF: ::tcflag_t = 0o010000; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_restart_syscall: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_signal: ::c_long = 48; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_lookup_dcookie: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_getdents: ::c_long = 141; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_readahead: ::c_long = 222; +pub const SYS_setxattr: ::c_long = 224; +pub const SYS_lsetxattr: ::c_long = 225; +pub const SYS_fsetxattr: ::c_long = 226; +pub const SYS_getxattr: ::c_long = 227; +pub const SYS_lgetxattr: ::c_long = 228; +pub const SYS_fgetxattr: ::c_long = 229; +pub const SYS_listxattr: ::c_long = 230; +pub const SYS_llistxattr: ::c_long = 231; +pub const SYS_flistxattr: ::c_long = 232; +pub const SYS_removexattr: ::c_long = 233; +pub const SYS_lremovexattr: ::c_long = 234; +pub const SYS_fremovexattr: ::c_long = 235; +pub const SYS_gettid: ::c_long = 236; +pub const SYS_tkill: ::c_long = 237; +pub const SYS_futex: ::c_long = 238; +pub const SYS_sched_setaffinity: ::c_long = 239; +pub const SYS_sched_getaffinity: ::c_long = 240; +pub const SYS_tgkill: ::c_long = 241; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_epoll_create: ::c_long = 249; +pub const SYS_epoll_ctl: ::c_long = 250; +pub const SYS_epoll_wait: ::c_long = 251; +pub const SYS_set_tid_address: ::c_long = 252; +pub const SYS_fadvise64: ::c_long = 253; +pub const SYS_timer_create: ::c_long = 254; +pub const SYS_timer_settime: ::c_long = 255; +pub const SYS_timer_gettime: ::c_long = 256; +pub const SYS_timer_getoverrun: ::c_long = 257; +pub const SYS_timer_delete: ::c_long = 258; +pub const SYS_clock_settime: ::c_long = 259; +pub const SYS_clock_gettime: ::c_long = 260; +pub const SYS_clock_getres: ::c_long = 261; +pub const SYS_clock_nanosleep: ::c_long = 262; +pub const SYS_statfs64: ::c_long = 265; +pub const SYS_fstatfs64: ::c_long = 266; +pub const SYS_remap_file_pages: ::c_long = 267; +pub const SYS_mbind: ::c_long = 268; +pub const SYS_get_mempolicy: ::c_long = 269; +pub const SYS_set_mempolicy: ::c_long = 270; +pub const SYS_mq_open: ::c_long = 271; +pub const SYS_mq_unlink: ::c_long = 272; +pub const SYS_mq_timedsend: ::c_long = 273; +pub const SYS_mq_timedreceive: ::c_long = 274; +pub const SYS_mq_notify: ::c_long = 275; +pub const SYS_mq_getsetattr: ::c_long = 276; +pub const SYS_kexec_load: ::c_long = 277; +pub const SYS_add_key: ::c_long = 278; +pub const SYS_request_key: ::c_long = 279; +pub const SYS_keyctl: ::c_long = 280; +pub const SYS_waitid: ::c_long = 281; +pub const SYS_ioprio_set: ::c_long = 282; +pub const SYS_ioprio_get: ::c_long = 283; +pub const SYS_inotify_init: ::c_long = 284; +pub const SYS_inotify_add_watch: ::c_long = 285; +pub const SYS_inotify_rm_watch: ::c_long = 286; +pub const SYS_migrate_pages: ::c_long = 287; +pub const SYS_openat: ::c_long = 288; +pub const SYS_mkdirat: ::c_long = 289; +pub const SYS_mknodat: ::c_long = 290; +pub const SYS_fchownat: ::c_long = 291; +pub const SYS_futimesat: ::c_long = 292; +pub const SYS_unlinkat: ::c_long = 294; +pub const SYS_renameat: ::c_long = 295; +pub const SYS_linkat: ::c_long = 296; +pub const SYS_symlinkat: ::c_long = 297; +pub const SYS_readlinkat: ::c_long = 298; +pub const SYS_fchmodat: ::c_long = 299; +pub const SYS_faccessat: ::c_long = 300; +pub const SYS_pselect6: ::c_long = 301; +pub const SYS_ppoll: ::c_long = 302; +pub const SYS_unshare: ::c_long = 303; +pub const SYS_set_robust_list: ::c_long = 304; +pub const SYS_get_robust_list: ::c_long = 305; +pub const SYS_splice: ::c_long = 306; +pub const SYS_sync_file_range: ::c_long = 307; +pub const SYS_tee: ::c_long = 308; +pub const SYS_vmsplice: ::c_long = 309; +pub const SYS_move_pages: ::c_long = 310; +pub const SYS_getcpu: ::c_long = 311; +pub const SYS_epoll_pwait: ::c_long = 312; +pub const SYS_utimes: ::c_long = 313; +pub const SYS_fallocate: ::c_long = 314; +pub const SYS_utimensat: ::c_long = 315; +pub const SYS_signalfd: ::c_long = 316; +pub const SYS_timerfd: ::c_long = 317; +pub const SYS_eventfd: ::c_long = 318; +pub const SYS_timerfd_create: ::c_long = 319; +pub const SYS_timerfd_settime: ::c_long = 320; +pub const SYS_timerfd_gettime: ::c_long = 321; +pub const SYS_signalfd4: ::c_long = 322; +pub const SYS_eventfd2: ::c_long = 323; +pub const SYS_inotify_init1: ::c_long = 324; +pub const SYS_pipe2: ::c_long = 325; +pub const SYS_dup3: ::c_long = 326; +pub const SYS_epoll_create1: ::c_long = 327; +pub const SYS_preadv: ::c_long = 328; +pub const SYS_pwritev: ::c_long = 329; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 330; +pub const SYS_perf_event_open: ::c_long = 331; +pub const SYS_fanotify_init: ::c_long = 332; +pub const SYS_fanotify_mark: ::c_long = 333; +pub const SYS_prlimit64: ::c_long = 334; +pub const SYS_name_to_handle_at: ::c_long = 335; +pub const SYS_open_by_handle_at: ::c_long = 336; +pub const SYS_clock_adjtime: ::c_long = 337; +pub const SYS_syncfs: ::c_long = 338; +pub const SYS_setns: ::c_long = 339; +pub const SYS_process_vm_readv: ::c_long = 340; +pub const SYS_process_vm_writev: ::c_long = 341; +pub const SYS_s390_runtime_instr: ::c_long = 342; +pub const SYS_kcmp: ::c_long = 343; +pub const SYS_finit_module: ::c_long = 344; +pub const SYS_sched_setattr: ::c_long = 345; +pub const SYS_sched_getattr: ::c_long = 346; +pub const SYS_renameat2: ::c_long = 347; +pub const SYS_seccomp: ::c_long = 348; +pub const SYS_getrandom: ::c_long = 349; +pub const SYS_memfd_create: ::c_long = 350; +pub const SYS_bpf: ::c_long = 351; +pub const SYS_s390_pci_mmio_write: ::c_long = 352; +pub const SYS_s390_pci_mmio_read: ::c_long = 353; +pub const SYS_execveat: ::c_long = 354; +pub const SYS_userfaultfd: ::c_long = 355; +pub const SYS_membarrier: ::c_long = 356; +pub const SYS_recvmmsg: ::c_long = 357; +pub const SYS_sendmmsg: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_mlock2: ::c_long = 374; +pub const SYS_copy_file_range: ::c_long = 375; +pub const SYS_preadv2: ::c_long = 376; +pub const SYS_pwritev2: ::c_long = 377; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_select: ::c_long = 142; +pub const SYS_getegid: ::c_long = 202; +pub const SYS_setgroups: ::c_long = 206; +pub const SYS_getresuid: ::c_long = 209; +pub const SYS_chown: ::c_long = 212; +pub const SYS_setfsuid: ::c_long = 215; +pub const SYS_setfsgid: ::c_long = 216; +pub const SYS_newfstatat: ::c_long = 293; + #[link(name = "util")] extern { pub fn sysctl(name: *mut ::c_int, diff -Nru distinst-0.1.0/vendor/libc/src/unix/notbsd/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/notbsd/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/notbsd/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -405,8 +405,6 @@ pub const SCM_RIGHTS: ::c_int = 0x01; pub const SCM_CREDENTIALS: ::c_int = 0x02; -pub const IPPROTO_RAW: ::c_int = 255; - pub const PROT_GROWSDOWN: ::c_int = 0x1000000; pub const PROT_GROWSUP: ::c_int = 0x2000000; @@ -762,6 +760,7 @@ pub const SPLICE_F_GIFT: ::c_uint = 0x08; pub const RTLD_LOCAL: ::c_int = 0; +pub const RTLD_LAZY: ::c_int = 1; pub const POSIX_FADV_NORMAL: ::c_int = 0; pub const POSIX_FADV_RANDOM: ::c_int = 1; @@ -795,6 +794,12 @@ pub const UTIME_OMIT: c_long = 1073741822; pub const UTIME_NOW: c_long = 1073741823; +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; pub const POLLRDNORM: ::c_short = 0x040; pub const POLLRDBAND: ::c_short = 0x080; @@ -856,6 +861,10 @@ pub fn WCOREDUMP(status: ::c_int) -> bool { (status & 0x80) != 0 } + + pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } } extern { @@ -899,6 +908,8 @@ pub fn uselocale(loc: ::locale_t) -> ::locale_t; pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; + pub fn fstatat64(dirfd: ::c_int, pathname: *const c_char, + buf: *mut stat64, flags: ::c_int) -> ::c_int; pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; @@ -916,8 +927,16 @@ oflag: ::c_int, ...) -> ::c_int; pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; + pub fn preadv64(fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t) -> ::ssize_t; pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; + pub fn pwritev64(fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t) -> ::ssize_t; pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64, result: *mut *mut ::dirent64) -> ::c_int; @@ -993,4 +1012,3 @@ // name: *mut ::c_char, // termp: *const termios, // winp: *const ::winsize) -> ::pid_t; - // pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; diff -Nru distinst-0.1.0/vendor/libc/src/unix/solaris/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/solaris/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/solaris/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/solaris/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -591,6 +591,9 @@ pub const WCONTINUED: ::c_int = 0x08; pub const WNOWAIT: ::c_int = 0x80; +pub const AT_FDCWD: ::c_int = 0xffd19553; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000; + // Solaris defines a great many more of these; we only expose the // standardized ones. pub const P_PID: idtype_t = 0; @@ -766,6 +769,13 @@ pub const GLOB_ABORTED : ::c_int = -1; pub const GLOB_NOMATCH : ::c_int = -3; +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + pub const POSIX_MADV_NORMAL: ::c_int = 0; pub const POSIX_MADV_RANDOM: ::c_int = 1; pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; @@ -1100,6 +1110,7 @@ pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void; pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void; +pub const RTLD_LAZY: ::c_int = 0x1; pub const RTLD_NOW: ::c_int = 0x2; pub const RTLD_NOLOAD: ::c_int = 0x4; pub const RTLD_GLOBAL: ::c_int = 0x100; @@ -1213,6 +1224,10 @@ pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; pub fn if_nameindex() -> *mut if_nameindex; pub fn if_freenameindex(ptr: *mut if_nameindex); + pub fn pthread_create(native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void) -> ::c_int; pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t, clock_id: *mut clockid_t) -> ::c_int; pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, @@ -1245,11 +1260,15 @@ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t) -> ::ssize_t; pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, + times: *const ::timespec, flag: ::c_int) -> ::c_int; pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; pub fn bind(socket: ::c_int, address: *const ::sockaddr, diff -Nru distinst-0.1.0/vendor/libc/src/unix/uclibc/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/uclibc/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/uclibc/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/uclibc/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -578,7 +578,63 @@ pub const SCM_RIGHTS: ::c_int = 0x01; pub const SCM_CREDENTIALS: ::c_int = 0x02; +// netinet/in.h +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +pub const IPPROTO_MTP: ::c_int = 92; +pub const IPPROTO_BEETPH: ::c_int = 94; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_COMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +pub const IPPROTO_MH: ::c_int = 135; +pub const IPPROTO_UDPLITE: ::c_int = 136; +pub const IPPROTO_MPLS: ::c_int = 137; +/// raw IP packet pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_MAX: ::c_int = 256; pub const PROT_GROWSDOWN: ::c_int = 0x1000000; pub const PROT_GROWSUP: ::c_int = 0x2000000; @@ -872,6 +928,7 @@ pub const SPLICE_F_GIFT: ::c_uint = 0x08; pub const RTLD_LOCAL: ::c_int = 0; +pub const RTLD_LAZY: ::c_int = 1; pub const POSIX_FADV_NORMAL: ::c_int = 0; pub const POSIX_FADV_RANDOM: ::c_int = 1; @@ -888,6 +945,13 @@ pub const LOG_FTP: ::c_int = 11 << 3; pub const LOG_PERROR: ::c_int = 0x20; +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + pub const PIPE_BUF: usize = 4096; pub const SI_LOAD_SHIFT: ::c_uint = 16; @@ -1419,6 +1483,10 @@ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { set1.bits == set2.bits } + + pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } } extern { @@ -1805,6 +1873,10 @@ pub fn pthread_atfork(prepare: Option, parent: Option, child: Option) -> ::c_int; + pub fn pthread_create(native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void) -> ::c_int; pub fn getgrgid(gid: ::gid_t) -> *mut ::group; #[cfg_attr(all(target_os = "macos", target_arch = "x86"), link_name = "popen$UNIX2003")] @@ -1823,3 +1895,4 @@ pub use unsupported_target; } } + diff -Nru distinst-0.1.0/vendor/libc/src/unix/uclibc/x86_64/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/uclibc/x86_64/mod.rs --- distinst-0.1.0/vendor/libc/src/unix/uclibc/x86_64/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/unix/uclibc/x86_64/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -327,6 +327,14 @@ pub const PTHREAD_STACK_MIN: usize = 16384; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const SO_BROADCAST: ::c_int = 6; +pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams +pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h +pub const SO_ERROR: ::c_int = 4; +pub const SOL_SOCKET: ::c_int = 1; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_SNDTIMEO: ::c_int = 21; pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; diff -Nru distinst-0.1.0/vendor/libc/src/windows.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/windows.rs --- distinst-0.1.0/vendor/libc/src/windows.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/src/windows.rs 2017-12-21 19:00:07.000000000 +0000 @@ -158,7 +158,8 @@ pub const EILSEQ: ::c_int = 42; pub const STRUNCATE: ::c_int = 80; -#[cfg(all(target_env = "msvc", stdbuild))] // " if " -- appease style checker +// inline comment below appeases style checker +#[cfg(all(target_env = "msvc", feature = "stdbuild"))] // " if " #[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] #[link(name = "libcmt", cfg(target_feature = "crt-static"))] extern {} diff -Nru distinst-0.1.0/vendor/libc/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/.travis.yml --- distinst-0.1.0/vendor/libc/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/libc/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -7,8 +7,8 @@ install: - if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi script: - - cargo build - - cargo build --no-default-features + - cargo build $OPT + - cargo build $OPT --no-default-features - cargo generate-lockfile --manifest-path libc-test/Cargo.toml - if [[ $TRAVIS_OS_NAME = "linux" ]]; then sh ci/run-docker.sh $TARGET; @@ -25,7 +25,7 @@ # 1.0.0 compat - env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1 rust: 1.0.0 - script: cargo build + script: rm -f Cargo.lock && cargo build install: # build documentation @@ -38,16 +38,22 @@ - env: TARGET=i686-unknown-linux-gnu - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 + osx_image: xcode8.3 - os: osx env: TARGET=i686-apple-darwin + osx_image: xcode8.3 - env: TARGET=arm-linux-androideabi - env: TARGET=aarch64-linux-android - - env: TARGET=i686-linux-android + # FIXME(#826) should reenable + #- env: TARGET=i686-linux-android - env: TARGET=x86_64-linux-android - env: TARGET=x86_64-unknown-linux-musl - env: TARGET=i686-unknown-linux-musl - env: TARGET=arm-unknown-linux-gnueabihf + - env: TARGET=arm-unknown-linux-musleabihf - env: TARGET=aarch64-unknown-linux-gnu + - env: TARGET=aarch64-unknown-linux-musl + rust: beta - os: osx osx_image: xcode8.2 env: TARGET=i386-apple-ios @@ -65,11 +71,14 @@ - env: TARGET=x86_64-rumprun-netbsd - env: TARGET=powerpc-unknown-linux-gnu - env: TARGET=powerpc64-unknown-linux-gnu + - env: TARGET=powerpc64le-unknown-linux-gnu - env: TARGET=mips-unknown-linux-musl - env: TARGET=mipsel-unknown-linux-musl - env: TARGET=mips64-unknown-linux-gnuabi64 + - env: TARGET=mips64el-unknown-linux-gnuabi64 - env: TARGET=mips-unknown-linux-gnu - env: TARGET=s390x-unknown-linux-gnu + - env: TARGET=sparc64-unknown-linux-gnu - env: TARGET=asmjs-unknown-emscripten - env: TARGET=wasm32-unknown-emscripten @@ -78,6 +87,7 @@ rust: beta - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 + osx_image: xcode8.3 rust: beta # nightly @@ -85,13 +95,17 @@ rust: nightly - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 + osx_image: xcode8.3 + rust: nightly + # not available on stable + # without --release the build fails + # see https://github.com/rust-lang/rust/issues/45417 + - env: TARGET=x86_64-unknown-linux-gnux32 OPT="--release" rust: nightly # QEMU based targets that compile in an emulator - env: TARGET=x86_64-unknown-freebsd -cache: cargo - notifications: email: on_success: never diff -Nru distinst-0.1.0/vendor/log/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/log/.cargo-checksum.json --- distinst-0.1.0/vendor/log/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/log/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"985cf95c79f32c65766927fd6ef5079f8c14f235ddb4213e6410d90a86a95811","Cargo.toml":"0a4a756f7ef47f5dfa221a173b21f9ec496b448aafcd9bde08d9d16935b55007","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"aa8356455efcc3d49f66e7fa394eac292c9158164dff074e32c699b64891cb4b","appveyor.yml":"c61473b8c780ad2626282ce2b2ba0ef278082b6afe151a62ff419f33eaf90221","src/lib.rs":"75b44acfc9627b821cd725649db07693a43b2e44b2fac19b79354c6d950c4038","src/macros.rs":"3953610da3ee2dc393262b753f2406d1864a1cbd74d2bd20d279e09aabfe7131","tests/filters.rs":"cc61ed41a6cd77e5aef91cc8c76216b492d8de34f00635254f3835a3d964ce22"},"package":"880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"} \ No newline at end of file +{"files":{".travis.yml":"985cf95c79f32c65766927fd6ef5079f8c14f235ddb4213e6410d90a86a95811","Cargo.toml":"0a4a756f7ef47f5dfa221a173b21f9ec496b448aafcd9bde08d9d16935b55007","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"aa8356455efcc3d49f66e7fa394eac292c9158164dff074e32c699b64891cb4b","appveyor.yml":"c61473b8c780ad2626282ce2b2ba0ef278082b6afe151a62ff419f33eaf90221","src/lib.rs":"75b44acfc9627b821cd725649db07693a43b2e44b2fac19b79354c6d950c4038","src/macros.rs":"3953610da3ee2dc393262b753f2406d1864a1cbd74d2bd20d279e09aabfe7131","tests/filters.rs":"cc61ed41a6cd77e5aef91cc8c76216b492d8de34f00635254f3835a3d964ce22"},"package":"880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/magenta/AUTHORS distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/AUTHORS --- distinst-0.1.0/vendor/magenta/AUTHORS 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/AUTHORS 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# This is the list of Fuchsia Authors. - -# Names should be added to this file as one of -# Organization's name -# Individual's name -# Individual's name - -Google Inc. diff -Nru distinst-0.1.0/vendor/magenta/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/BUILD.gn --- distinst-0.1.0/vendor/magenta/BUILD.gn 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Copyright 2017 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/rust/rust_library.gni") - -rust_library("magenta") { - deps = [ - "//rust/magenta-rs/magenta-sys", - "//third_party/rust-crates:num-traits-0.1.39", - ] - - with_tests = true -} diff -Nru distinst-0.1.0/vendor/magenta/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/.cargo-checksum.json --- distinst-0.1.0/vendor/magenta/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","AUTHORS":"5a976de4480e5cedbd6e40f2612acac9b09b1260d878d5e87cdc7a026c3ee660","BUILD.gn":"73301bfcc39779fabce05bca05598a38d7032935b512d904d1ddf2460c7d5cd5","CONTRIBUTING.md":"138ec0e92fda76ea07b68654a61fb5f1b18f2e872980123d847d622d36bdefc8","Cargo.toml":"9aa588cee78a7bf3c1a7785422a16bb1b17983eb9c1a23628e19a0c28dafccc0","GETTING_STARTED.md":"34bc54859b97e2c643ac234ae0770c4ae94512a662586350d3f40a213e1309f5","LICENSE":"f82f9062a6dff28145c185f90f94c485eebdc2bb4c6f1c840513709e6d228453","PATENTS":"52beb3ac72a0e7f5060384d16e4e6f91573016448fbff363c0b01a66fe99f547","README.md":"f039b679be219078d3c001c902780b7c94e4cb0e087429669779d89a25485449","examples/BUILD.gn":"18573d93faa3fa265fa7e00f6c3c78692ff2ceee66cfa39f96b8c49072941e33","src/channel.rs":"35e3d0668f5429241d7b3748da74766df4395e2fb6371a8c6b80722d8c52b8c7","src/event.rs":"dc5077740a2b33cbcd7a9f5ea4732a334d23a2cef6974dae8f0d82e4774834e7","src/eventpair.rs":"7add2fa58d50bd604d62c364d0177766e99e5a081e280b9e514383d249b062e5","src/fifo.rs":"8b1098adacd000371f5c1b38eafe8a5d70cb6ac91664f74ebcb0e3dd09bbae90","src/job.rs":"31419adbcdfe66c5684c56bbc03faf2ea8cae444018349db040c4d8d6c0f68ce","src/lib.rs":"8cc2c756ede26490cab5f11379721458c2b94fa7f8494bc2047a7bff4aba4dc7","src/port.rs":"2de9f5a1cef450c322a13f96c07d0ea0c7d9e7b8feba3f95f341197bca473452","src/process.rs":"e2d3e519d4b7ffe7ccb3dfda27a2d874f2797210fc6a26c3b1c3ef4076c3f348","src/socket.rs":"208ea6f805402d70e916f63dff06763ada030e101fc7f790ec19aef22fc80b32","src/thread.rs":"6d973c0e4e7b8875ff89246e9047e13101ba96dd3c3b0bedef5fdccbfc158ce7","src/timer.rs":"431a1ce98b7012e1a4d846fcd4e73d31a8827f202809614f3c543ccd9140931a","src/vmo.rs":"8129eacc7a5f4d2a8e472c2c02dc1d5364fe3ef79d50e2c8c973b513cb05ad96","tools/BUILD.gn":"f4ce07b2906e6cde15a9d2ec253c58fbfe88ea1819083f864c154a0f1c50c14f","tools/README.md":"0217d58913c32b7e8aa231da852d96307d8387f99e2352a026196150cb180d07","tools/clang_wrapper.cc":"28414196172a8a8c296b25ff72183e3abc8cf89b0fbe79262e114078604ed54c","tools/gen_status.py":"aa44eb29209fa475786094078f57a2de878f891fe52f3ed9a462d194aab86065"},"package":"4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/magenta/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/Cargo.toml --- distinst-0.1.0/vendor/magenta/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -[package] -name = "magenta" -version = "0.1.1" -license = "BSD-3-Clause" -authors = ["Raph Levien "] -description = "Rust bindings for the Magenta kernel" -repository = "https://fuchsia.googlesource.com/magenta-rs/" - -[dependencies] -conv = "0.3.3" -magenta-sys = { path = "magenta-sys", version = "0.1.1" } diff -Nru distinst-0.1.0/vendor/magenta/CONTRIBUTING.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/CONTRIBUTING.md --- distinst-0.1.0/vendor/magenta/CONTRIBUTING.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -This repository accepts contributions using Gerrit. - -Instructions for using Gerrit: - - * https://gerrit-review.googlesource.com/Documentation/ - -Before we can land your change, you need to sign the Google CLA: - - * https://cla.developers.google.com/ diff -Nru distinst-0.1.0/vendor/magenta/examples/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/examples/BUILD.gn --- distinst-0.1.0/vendor/magenta/examples/BUILD.gn 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/examples/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# Copyright 2017 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("examples") { - deps = [ - "//rust/magenta-rs/examples/mx_toy", - ] -} diff -Nru distinst-0.1.0/vendor/magenta/GETTING_STARTED.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/GETTING_STARTED.md --- distinst-0.1.0/vendor/magenta/GETTING_STARTED.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/GETTING_STARTED.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -Getting started with Rust on Fuchsia -==================================== - -This page contains instructions for how to obtain a Rust toolchain -that can be used to build binaries suitable for running on Fuchsia. - -Building the compiler ---------------------- - -Note: almost all the steps in this section are now automated in a shell script, -just run this from your Fuchsia root: - -``` -sh build/rust/prelude.sh -``` - -The detailed instructions remain below, for those who might want to customize -their build process. - -First, build the [clang wrapper](tools/). It helps if you check out this repo -under your fuchsia root, but it's not necessary. We'll call the directory -where you created the symlinks `${RUST_TOOLS}`. In any case, the created -symlinks do need to be under your Fuchsia root, which we will refer to as -`${FUCHSIA_ROOT}`. - -You can sanity-check the clang wrapper: - -``` -${RUST_TOOLS}/x86-64-unknown-fuchsia-cc -clang-4.0: error: no input files -``` - -Check out a fresh copy of the Rust compiler: - -``` -git clone https://github.com/rust-lang/rust.git -cd rust -``` - -Henceforth, we'll call this directory `${RUST_ROOT}`. - -Create a config.toml file (in the `${RUST_ROOT}`) from the following template. -Expand the `${RUST_TOOLS}` paths out to the actual absolute path. - -``` -# Config file for fuchsia target for building Rust. -# See `src/bootstrap/config.toml.example` for other settings. - -[rust] - -# Disable backtrace, as it requires additional lib support. -backtrace = false - -[target.x86_64-unknown-fuchsia] - -cc = "${RUST_TOOLS}/x86-64-unknown-fuchsia-cc" - -[target.aarch64-unknown-fuchsia] - -# Path to the clang wrapper -cc = "${RUST_TOOLS}/aarch64-unknown-fuchsia-cc" -``` - -Run: - -``` -cd ${FUCHSIA_ROOT} -./scripts/build-sysroot.sh -cd ${RUST_ROOT} -./configure --enable-rustbuild --target=x86_64-unknown-fuchsia -./x.py build --stage 1 -``` - -(If your cmake installation is too old (e.g., Ubuntu 14.04), you can use the -prebuilt in Fuchsia: -``` -PATH=${FUCHSIA_ROOT}/buildtools/cmake/bin:$PATH ./x.py build --stage 1 -``` - -You should now have a working Rust compiler under `build/x86_64-apple-darwin/stage1/bin/rustc` -(adjust your host triple as necessary). - -You can adjust exactly what gets built using the --stage and --step flags to `bootstrap.py`. -If you're building a compiler for release, you'll want the stage2 compiler. Conversely, -if you're hacking on the compiler or libraries, you might want to build less to reduce -your edit-compile-test cycle (for example `--step libstd`). - -Building code with rustc and cargo ----------------------------------- - -To build a single binary, run: - -``` -./build/x86_64-apple-darwin/stage1/bin/rustc --target x86_64-unknown-fuchsia hello.rs \ - -Clinker=${RUST_TOOLS}/x86-64-unknown-fuchsia-cc -``` - -To build with cargo, create a config file in ${RUST_ROOT}/.cargo/config. -As above, expand the absolute path. - -``` -[target.x86_64-unknown-fuchsia] -linker = "${RUST_TOOLS}/x86-64-unknown-fuchsia-cc" - -[target.aarch64-unknown-fuchsia] -linker = "${RUST_TOOLS}/aarch64-unknown-fuchsia-cc" -``` - -Then, invoke cargo as follows: - -``` -RUSTC=${RUST_ROOT}/build/x86_64-apple-darwin/stage1/bin/rustc cargo build --target=x86_64-unknown-fuchsia --example mx_toy -``` - -This will produce a binary as `target/x86_64-unknown-fuchsia/debug/examples/mx_toy`. -A common error at this point is a link failure due to the linker not pointing to -the clang wrapper (different failure mode depending on your default setup). A -telltale sign is that the link command line begins with "cc" instead of -"x86-unknown-fuchsia-cc". Make sure the cargo/.config is correct and in the right -place (root directory of the crate to build). - -Running binaries on Fuchsia ---------------------------- - -First, of course, you'll need [Fuchsia](https://fuchsia.googlesource.com/fuchsia/). -You probably already have this if your rust wrappers work. - -There are a few ways to get binaries into the file system (and this is rapidly -evolving to become more flexible), but the most straightforward is to manually -edit the manifest for creating the bootfs image. - -Edit `out/debug-x86-64/gen/packages/gn/user.bootfs.manifest` and manually add a line like: - -``` -bin/mx_toy=${YOUR_CRATE_ROOT}/target/x86_64-unknown-fuchsia/debug/examples/mx_toy -``` - -Then, rebuild the bootfs (in your fuchsia root as cwd): - -``` -./out/build-magenta/tools/mkbootfs -o ./out/debug-x86-64/user.bootfs out/debug-x86-64/gen/packages/gn/user.bootfs.manifest -``` - -Now you can start the system, and run your binary: - -``` -cd magenta -./scripts/run-magenta-x86-64 -g -x ../out/debug-x86-64/user.bootfs -mx_toy -``` - -Running tests -------------- - -Running tests is possible but somewhat clunky. - -First, build your test executable: - -``` -RUSTC=${RUST_ROOT}/build/x86_64-apple-darwin/stage1/bin/rustc cargo test --target=x86_64-unknown-fuchsia --no-run -``` - -This will generate a test executable with a name like -`target/x86_64-unknown-fuchsia/debug/magenta-523728a3f134326a`. Run this -binary as above. - -Notes ------ - -General instructions on cross-compiling Rust can be found at -[japaric/rust-cross](https://github.com/japaric/rust-cross). At some point soon -it will be possible to build fuchsia targets using nightly Rust (and then stable -at the appropriate time), but it still requires a `std` crate for your target. -Prebuilt versions are not yet available. - diff -Nru distinst-0.1.0/vendor/magenta/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/LICENSE --- distinst-0.1.0/vendor/magenta/LICENSE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru distinst-0.1.0/vendor/magenta/PATENTS distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/PATENTS --- distinst-0.1.0/vendor/magenta/PATENTS 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/PATENTS 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Fuchsia project. - -Google hereby grants to you a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this -section) patent license to make, have made, use, offer to sell, sell, -import, transfer, and otherwise run, modify and propagate the contents -of this implementation of Fuchsia, where such license applies only to -those patent claims, both currently owned by Google and acquired in -the future, licensable by Google that are necessarily infringed by -this implementation. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute -or order or agree to the institution of patent litigation or any other -patent enforcement activity against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that this -implementation of Fuchsia constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of -Fuchsia shall terminate as of the date such litigation is filed. diff -Nru distinst-0.1.0/vendor/magenta/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/README.md --- distinst-0.1.0/vendor/magenta/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -Rust bindings for Magenta kernel -================================ - -This repository contains Rust language bindings for Magenta kernel syscalls. The -main crate contains type-safe wrappers, while the inner "sys" crate contains the -raw types and FFI declarations. - -To get started, see the [GETTING_STARTED](GETTING_STARTED.md) documentation. diff -Nru distinst-0.1.0/vendor/magenta/src/channel.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/channel.rs --- distinst-0.1.0/vendor/magenta/src/channel.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/channel.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,392 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta channel objects. - -use {HandleBase, Handle, HandleRef, INVALID_HANDLE, Peered, Status, Time}; -use {sys, handle_drop, into_result, size_to_u32_sat}; -use conv::{ValueInto}; -use std::mem; - -/// An object representing a Magenta -/// [channel](https://fuchsia.googlesource.com/magenta/+/master/docs/objects/channel.md). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Channel(Handle); - -impl HandleBase for Channel { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Channel(handle) - } -} - -impl Peered for Channel { -} - -impl Channel { - /// Create a channel, resulting an a pair of `Channel` objects representing both - /// sides of the channel. Messages written into one maybe read from the opposite. - /// - /// Wraps the - /// [mx_channel_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/channel_create.md) - /// syscall. - pub fn create(opts: ChannelOpts) -> Result<(Channel, Channel), Status> { - unsafe { - let mut handle0 = 0; - let mut handle1 = 0; - let status = sys::mx_channel_create(opts as u32, &mut handle0, &mut handle1); - into_result(status, || - (Self::from_handle(Handle(handle0)), - Self::from_handle(Handle(handle1)))) - } - } - - /// Read a message from a channel. Wraps the - /// [mx_channel_read](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/channel_read.md) - /// syscall. - /// - /// If the `MessageBuf` lacks the capacity to hold the pending message, - /// returns an `Err` with the number of bytes and number of handles needed. - /// Otherwise returns an `Ok` with the result as usual. - pub fn read_raw(&self, opts: u32, buf: &mut MessageBuf) - -> Result, (usize, usize)> - { - unsafe { - buf.reset_handles(); - let raw_handle = self.raw_handle(); - let mut num_bytes: u32 = size_to_u32_sat(buf.bytes.capacity()); - let mut num_handles: u32 = size_to_u32_sat(buf.handles.capacity()); - let status = sys::mx_channel_read(raw_handle, opts, - buf.bytes.as_mut_ptr(), buf.handles.as_mut_ptr(), - num_bytes, num_handles, &mut num_bytes, &mut num_handles); - if status == sys::MX_ERR_BUFFER_TOO_SMALL { - Err((num_bytes as usize, num_handles as usize)) - } else { - Ok(into_result(status, || { - buf.bytes.set_len(num_bytes as usize); - buf.handles.set_len(num_handles as usize); - })) - } - } - } - - /// Read a message from a channel. - /// - /// Note that this method can cause internal reallocations in the `MessageBuf` - /// if it is lacks capacity to hold the full message. If such reallocations - /// are not desirable, use `read_raw` instead. - pub fn read(&self, opts: u32, buf: &mut MessageBuf) -> Result<(), Status> { - loop { - match self.read_raw(opts, buf) { - Ok(result) => return result, - Err((num_bytes, num_handles)) => { - buf.ensure_capacity_bytes(num_bytes); - buf.ensure_capacity_handles(num_handles); - } - } - } - } - - /// Write a message to a channel. Wraps the - /// [mx_channel_write](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/channel_write.md) - /// syscall. - pub fn write(&self, bytes: &[u8], handles: &mut Vec, opts: u32) - -> Result<(), Status> - { - let n_bytes = try!(bytes.len().value_into().map_err(|_| Status::ErrOutOfRange)); - let n_handles = try!(handles.len().value_into().map_err(|_| Status::ErrOutOfRange)); - unsafe { - let status = sys::mx_channel_write(self.raw_handle(), opts, bytes.as_ptr(), n_bytes, - handles.as_ptr() as *const sys::mx_handle_t, n_handles); - into_result(status, || { - // Handles were successfully transferred, forget them on sender side - handles.set_len(0); - }) - } - } - - /// Send a message consisting of the given bytes and handles to a channel and await a reply. The - /// bytes should start with a four byte 'txid' which is used to identify the matching reply. - /// - /// Wraps the - /// [mx_channel_call](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/channel_call.md) - /// syscall. - /// - /// Note that unlike [`read`][read], the caller must ensure that the MessageBuf has enough - /// capacity for the bytes and handles which will be received, as replies which are too large - /// are discarded. - /// - /// On failure returns the both the main and read status. - /// - /// [read]: struct.Channel.html#method.read - pub fn call(&self, options: u32, timeout: Time, bytes: &[u8], handles: &mut Vec, - buf: &mut MessageBuf) -> Result<(), (Status, Status)> - { - let write_num_bytes = try!(bytes.len().value_into().map_err( - |_| (Status::ErrOutOfRange, Status::NoError))); - let write_num_handles = try!(handles.len().value_into().map_err( - |_| (Status::ErrOutOfRange, Status::NoError))); - buf.reset_handles(); - let read_num_bytes: u32 = size_to_u32_sat(buf.bytes.capacity()); - let read_num_handles: u32 = size_to_u32_sat(buf.handles.capacity()); - let args = sys::mx_channel_call_args_t { - wr_bytes: bytes.as_ptr(), - wr_handles: handles.as_ptr() as *const sys::mx_handle_t, - rd_bytes: buf.bytes.as_mut_ptr(), - rd_handles: buf.handles.as_mut_ptr(), - wr_num_bytes: write_num_bytes, - wr_num_handles: write_num_handles, - rd_num_bytes: read_num_bytes, - rd_num_handles: read_num_handles, - }; - let mut actual_read_bytes: u32 = 0; - let mut actual_read_handles: u32 = 0; - let mut read_status = sys::MX_OK; - let status = unsafe { - sys::mx_channel_call(self.raw_handle(), options, timeout, &args, &mut actual_read_bytes, - &mut actual_read_handles, &mut read_status) - }; - if status == sys::MX_OK || status == sys::MX_ERR_TIMED_OUT || status == sys::MX_ERR_CALL_FAILED - { - // Handles were successfully transferred, even if we didn't get a response, so forget - // them on the sender side. - unsafe { handles.set_len(0); } - } - unsafe { - buf.bytes.set_len(actual_read_bytes as usize); - buf.handles.set_len(actual_read_handles as usize); - } - if status == sys::MX_OK { - Ok(()) - } else { - Err((Status::from_raw(status), Status::from_raw(read_status))) - } - } -} - -/// Options for creating a channel. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum ChannelOpts { - /// A normal channel. - Normal = 0, -} - -impl Default for ChannelOpts { - fn default() -> Self { - ChannelOpts::Normal - } -} - -/// A buffer for _receiving_ messages from a channel. -/// -/// A `MessageBuf` is essentially a byte buffer and a vector of -/// handles, but move semantics for "taking" handles requires special handling. -/// -/// Note that for sending messages to a channel, the caller manages the buffers, -/// using a plain byte slice and `Vec`. -#[derive(Default)] -#[derive(Debug)] -pub struct MessageBuf { - bytes: Vec, - handles: Vec, -} - -impl MessageBuf { - /// Create a new, empty, message buffer. - pub fn new() -> Self { - Default::default() - } - - /// Ensure that the buffer has the capacity to hold at least `n_bytes` bytes. - pub fn ensure_capacity_bytes(&mut self, n_bytes: usize) { - ensure_capacity(&mut self.bytes, n_bytes); - } - - /// Ensure that the buffer has the capacity to hold at least `n_handles` handles. - pub fn ensure_capacity_handles(&mut self, n_handles: usize) { - ensure_capacity(&mut self.handles, n_handles); - } - - /// Get a reference to the bytes of the message buffer, as a `&[u8]` slice. - pub fn bytes(&self) -> &[u8] { - self.bytes.as_slice() - } - - /// The number of handles in the message buffer. Note this counts the number - /// available when the message was received; `take_handle` does not affect - /// the count. - pub fn n_handles(&self) -> usize { - self.handles.len() - } - - /// Take the handle at the specified index from the message buffer. If the - /// method is called again with the same index, it will return `None`, as - /// will happen if the index exceeds the number of handles available. - pub fn take_handle(&mut self, index: usize) -> Option { - self.handles.get_mut(index).and_then(|handleref| - if *handleref == INVALID_HANDLE { - None - } else { - Some(Handle(mem::replace(handleref, INVALID_HANDLE))) - } - ) - } - - fn drop_handles(&mut self) { - for &handle in &self.handles { - if handle != 0 { - handle_drop(handle); - } - } - } - - fn reset_handles(&mut self) { - self.drop_handles(); - self.handles.clear(); - } -} - -impl Drop for MessageBuf { - fn drop(&mut self) { - self.drop_handles(); - } -} - -fn ensure_capacity(vec: &mut Vec, size: usize) { - let len = vec.len(); - if size > len { - vec.reserve(size - len); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use {Duration, MX_CHANNEL_READABLE, MX_CHANNEL_WRITABLE, MX_RIGHT_SAME_RIGHTS, MX_SIGNAL_LAST_HANDLE, Vmo, VmoOpts}; - use deadline_after; - use std::thread; - - #[test] - fn channel_basic() { - let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); - - let mut empty = vec![]; - assert!(p1.write(b"hello", &mut empty, 0).is_ok()); - - let mut buf = MessageBuf::new(); - assert!(p2.read(0, &mut buf).is_ok()); - assert_eq!(buf.bytes(), b"hello"); - } - - #[test] - fn channel_read_raw_too_small() { - let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); - - let mut empty = vec![]; - assert!(p1.write(b"hello", &mut empty, 0).is_ok()); - - let mut buf = MessageBuf::new(); - let result = p2.read_raw(0, &mut buf); - assert_eq!(result, Err((5, 0))); - assert_eq!(buf.bytes(), b""); - } - - #[test] - fn channel_send_handle() { - let hello_length: usize = 5; - - // Create a pair of channels and a virtual memory object. - let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); - let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); - - // Duplicate VMO handle and send it down the channel. - let duplicate_vmo_handle = vmo.duplicate(MX_RIGHT_SAME_RIGHTS).unwrap().into_handle(); - let mut handles_to_send: Vec = vec![duplicate_vmo_handle]; - assert!(p1.write(b"", &mut handles_to_send, 0).is_ok()); - // Handle should be removed from vector. - assert!(handles_to_send.is_empty()); - - // Read the handle from the receiving channel. - let mut buf = MessageBuf::new(); - assert!(p2.read(0, &mut buf).is_ok()); - assert_eq!(buf.n_handles(), 1); - // Take the handle from the buffer. - let received_handle = buf.take_handle(0).unwrap(); - // Should not affect number of handles. - assert_eq!(buf.n_handles(), 1); - // Trying to take it again should fail. - assert!(buf.take_handle(0).is_none()); - - // Now to test that we got the right handle, try writing something to it... - let received_vmo = Vmo::from_handle(received_handle); - assert_eq!(received_vmo.write(b"hello", 0).unwrap(), hello_length); - - // ... and reading it back from the original VMO. - let mut read_vec = vec![0; hello_length]; - assert_eq!(vmo.read(&mut read_vec, 0).unwrap(), hello_length); - assert_eq!(read_vec, b"hello"); - } - - #[test] - fn channel_call_timeout() { - let ten_ms: Duration = 10_000_000; - - // Create a pair of channels and a virtual memory object. - let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); - let vmo = Vmo::create(0 as u64, VmoOpts::Default).unwrap(); - - // Duplicate VMO handle and send it along with the call. - let duplicate_vmo_handle = vmo.duplicate(MX_RIGHT_SAME_RIGHTS).unwrap().into_handle(); - let mut handles_to_send: Vec = vec![duplicate_vmo_handle]; - let mut buf = MessageBuf::new(); - assert_eq!(p1.call(0, deadline_after(ten_ms), b"call", &mut handles_to_send, &mut buf), - Err((Status::ErrTimedOut, Status::NoError))); - // Handle should be removed from vector even though we didn't get a response, as it was - // still sent over the channel. - assert!(handles_to_send.is_empty()); - - // Should be able to read call even though it timed out waiting for a response. - let mut buf = MessageBuf::new(); - assert!(p2.read(0, &mut buf).is_ok()); - assert_eq!(buf.bytes(), b"call"); - assert_eq!(buf.n_handles(), 1); - } - - #[test] - fn channel_call() { - let hundred_ms: Duration = 100_000_000; - - // Create a pair of channels - let (p1, p2) = Channel::create(ChannelOpts::Normal).unwrap(); - - // Start a new thread to respond to the call. - let server = thread::spawn(move || { - assert_eq!(p2.wait(MX_CHANNEL_READABLE, deadline_after(hundred_ms)), - Ok(MX_CHANNEL_READABLE | MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE)); - let mut buf = MessageBuf::new(); - assert_eq!(p2.read(0, &mut buf), Ok(())); - assert_eq!(buf.bytes(), b"txidcall"); - assert_eq!(buf.n_handles(), 0); - let mut empty = vec![]; - assert_eq!(p2.write(b"txidresponse", &mut empty, 0), Ok(())); - }); - - // Make the call. - let mut empty = vec![]; - let mut buf = MessageBuf::new(); - buf.ensure_capacity_bytes(12); - assert_eq!(p1.call(0, deadline_after(hundred_ms), b"txidcall", &mut empty, &mut buf), - Ok(())); - assert_eq!(buf.bytes(), b"txidresponse"); - assert_eq!(buf.n_handles(), 0); - - assert!(server.join().is_ok()); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/eventpair.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/eventpair.rs --- distinst-0.1.0/vendor/magenta/src/eventpair.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/eventpair.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta event pairs. - -use {Cookied, HandleBase, Handle, HandleRef, Peered, Status}; -use {sys, into_result}; - -/// An object representing a Magenta -/// [event pair](https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md#Other-IPC_Events_Event-Pairs_and-User-Signals). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct EventPair(Handle); - -impl HandleBase for EventPair { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - EventPair(handle) - } -} - -impl Peered for EventPair { -} - -impl Cookied for EventPair { -} - -impl EventPair { - /// Create an event pair, a pair of objects which can signal each other. Wraps the - /// [mx_eventpair_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/eventpair_create.md) - /// syscall. - pub fn create(options: EventPairOpts) -> Result<(EventPair, EventPair), Status> { - let mut out0 = 0; - let mut out1 = 0; - let status = unsafe { sys::mx_eventpair_create(options as u32, &mut out0, &mut out1) }; - into_result(status, || - (Self::from_handle(Handle(out0)), - Self::from_handle(Handle(out1)))) - } -} - -/// Options for creating an event pair. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum EventPairOpts { - /// Default options. - Default = 0, -} - -impl Default for EventPairOpts { - fn default() -> Self { - EventPairOpts::Default - } -} - -#[cfg(test)] -mod tests { - use super::*; - use {Duration, MX_SIGNAL_LAST_HANDLE, MX_SIGNAL_NONE, MX_USER_SIGNAL_0}; - use deadline_after; - - #[test] - fn wait_and_signal_peer() { - let (p1, p2) = EventPair::create(EventPairOpts::Default).unwrap(); - let ten_ms: Duration = 10_000_000; - - // Waiting on one without setting any signal should time out. - assert_eq!(p2.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If we set a signal, we should be able to wait for it. - assert!(p1.signal_peer(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - assert_eq!(p2.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), - MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - - // Should still work, signals aren't automatically cleared. - assert_eq!(p2.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), - MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - - // Now clear it, and waiting should time out again. - assert!(p1.signal_peer(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); - assert_eq!(p2.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/event.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/event.rs --- distinst-0.1.0/vendor/magenta/src/event.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/event.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta event objects. - -use {Cookied, HandleBase, Handle, HandleRef, Status}; -use {sys, into_result}; - -/// An object representing a Magenta -/// [event object](https://fuchsia.googlesource.com/magenta/+/master/docs/objects/event.md). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Event(Handle); - -impl HandleBase for Event { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Event(handle) - } -} - -impl Cookied for Event { -} - -impl Event { - /// Create an event object, an object which is signalable but nothing else. Wraps the - /// [mx_event_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/event_create.md) - /// syscall. - pub fn create(options: EventOpts) -> Result { - let mut out = 0; - let status = unsafe { sys::mx_event_create(options as u32, &mut out) }; - into_result(status, || Self::from_handle(Handle(out))) - } -} - -/// Options for creating an event object. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum EventOpts { - /// Default options. - Default = 0, -} - -impl Default for EventOpts { - fn default() -> Self { - EventOpts::Default - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/fifo.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/fifo.rs --- distinst-0.1.0/vendor/magenta/src/fifo.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/fifo.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta fifo objects. - -use {HandleBase, Handle, HandleRef, Status}; -use {sys, into_result}; - -/// An object representing a Magenta fifo. -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Fifo(Handle); - -impl HandleBase for Fifo { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Fifo(handle) - } -} - -impl Fifo { - /// Create a pair of fifos and return their endpoints. Writing to one endpoint enqueues an - /// element into the fifo from which the opposing endpoint reads. Wraps the - /// [mx_fifo_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/fifo_create.md) - /// syscall. - pub fn create(elem_count: u32, elem_size: u32, options: FifoOpts) - -> Result<(Fifo, Fifo), Status> - { - let mut out0 = 0; - let mut out1 = 0; - let status = unsafe { - sys::mx_fifo_create(elem_count, elem_size, options as u32, &mut out0, &mut out1) - }; - into_result(status, || (Self::from_handle(Handle(out0)), Self::from_handle(Handle(out1)))) - } - - /// Attempts to write some number of elements into the fifo. The number of bytes written will be - /// rounded down to a multiple of the fifo's element size. - /// Return value (on success) is number of elements actually written. - /// - /// Wraps - /// [mx_fifo_write](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/fifo_write.md). - pub fn write(&self, bytes: &[u8]) -> Result { - let mut num_entries_written = 0; - let status = unsafe { - sys::mx_fifo_write(self.raw_handle(), bytes.as_ptr(), bytes.len(), - &mut num_entries_written) - }; - into_result(status, || num_entries_written) - } - - /// Attempts to read some number of elements out of the fifo. The number of bytes read will - /// always be a multiple of the fifo's element size. - /// Return value (on success) is number of elements actually read. - /// - /// Wraps - /// [mx_fifo_read](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/fifo_read.md). - pub fn read(&self, bytes: &mut [u8]) -> Result { - let mut num_entries_read = 0; - let status = unsafe { - sys::mx_fifo_read(self.raw_handle(), bytes.as_mut_ptr(), bytes.len(), - &mut num_entries_read) - }; - into_result(status, || num_entries_read) - } -} - -/// Options for creating a fifo pair. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum FifoOpts { - /// Default options. - Default = 0, -} - -impl Default for FifoOpts { - fn default() -> Self { - FifoOpts::Default - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn fifo_basic() { - let (fifo1, fifo2) = Fifo::create(4, 2, FifoOpts::Default).unwrap(); - - // Trying to write less than one element should fail. - assert_eq!(fifo1.write(b""), Err(Status::ErrOutOfRange)); - assert_eq!(fifo1.write(b"h"), Err(Status::ErrOutOfRange)); - - // Should write one element "he" and ignore the last half-element as it rounds down. - assert_eq!(fifo1.write(b"hex").unwrap(), 1); - - // Should write three elements "ll" "o " "wo" and drop the rest as it is full. - assert_eq!(fifo1.write(b"llo worlds").unwrap(), 3); - - // Now that the fifo is full any further attempts to write should fail. - assert_eq!(fifo1.write(b"blah blah"), Err(Status::ErrShouldWait)); - - // Read all 4 entries from the other end. - let mut read_vec = vec![0; 8]; - assert_eq!(fifo2.read(&mut read_vec).unwrap(), 4); - assert_eq!(read_vec, b"hello wo"); - - // Reading again should fail as the fifo is empty. - assert_eq!(fifo2.read(&mut read_vec), Err(Status::ErrShouldWait)); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/job.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/job.rs --- distinst-0.1.0/vendor/magenta/src/job.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/job.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta job. - -use {HandleBase, Handle, HandleRef}; - -/// An object representing a Magenta job. -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Job(Handle); - -impl HandleBase for Job { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Job(handle) - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/lib.rs --- distinst-0.1.0/vendor/magenta/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,758 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta kernel -//! [syscalls](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls.md). - -extern crate core; -extern crate magenta_sys; -extern crate conv; - -use std::marker::PhantomData; - -use conv::{ValueInto, ValueFrom, UnwrapOrSaturate}; - -mod channel; -mod event; -mod eventpair; -mod fifo; -mod job; -mod port; -mod process; -mod socket; -mod timer; -mod thread; -mod vmo; - -pub use channel::{Channel, ChannelOpts, MessageBuf}; -pub use event::{Event, EventOpts}; -pub use eventpair::{EventPair, EventPairOpts}; -pub use fifo::{Fifo, FifoOpts}; -pub use job::Job; -pub use port::{Packet, PacketContents, Port, PortOpts, SignalPacket, UserPacket, WaitAsyncOpts}; -pub use process::Process; -pub use socket::{Socket, SocketOpts, SocketReadOpts, SocketWriteOpts}; -pub use timer::{Timer, TimerOpts}; -pub use thread::Thread; -pub use vmo::{Vmo, VmoCloneOpts, VmoOp, VmoOpts}; - -use magenta_sys as sys; - -type Duration = sys::mx_duration_t; -type Time = sys::mx_time_t; -pub use magenta_sys::MX_TIME_INFINITE; - -// A placeholder value used for handles that have been taken from the message buf. -// We rely on the kernel never to produce any actual handles with this value. -const INVALID_HANDLE: sys::mx_handle_t = 0; - -/// A status code returned from the Magenta kernel. -/// -/// See -/// [errors.md](https://fuchsia.googlesource.com/magenta/+/master/docs/errors.md) -/// in the Magenta documentation for more information about the meaning of these -/// codes. -#[derive(Debug, PartialEq, Eq, Clone, Copy)] -#[repr(i32)] -// Auto-generated using tools/gen_status.py -pub enum Status { - NoError = 0, - ErrInternal = -1, - ErrNotSupported = -2, - ErrNoResources = -3, - ErrNoMemory = -4, - ErrCallFailed = -5, - ErrInterruptedRetry = -6, - ErrInvalidArgs = -10, - ErrBadHandle = -11, - ErrWrongType = -12, - ErrBadSyscall = -13, - ErrOutOfRange = -14, - ErrBufferTooSmall = -15, - ErrBadState = -20, - ErrTimedOut = -21, - ErrShouldWait = -22, - ErrCanceled = -23, - ErrPeerClosed = -24, - ErrNotFound = -25, - ErrAlreadyExists = -26, - ErrAlreadyBound = -27, - ErrUnavailable = -28, - ErrAccessDenied = -30, - ErrIo = -40, - ErrIoRefused = -41, - ErrIoDataIntegrity = -42, - ErrIoDataLoss = -43, - ErrBadPath = -50, - ErrNotDir = -51, - ErrNotFile = -52, - ErrFileBig = -53, - ErrNoSpace = -54, - ErrStop = -60, - ErrNext = -61, - - /// Any mx_status_t not in the set above will map to the following: - UnknownOther = -32768, -} - -impl Status { - pub fn from_raw(raw: sys::mx_status_t) -> Self { - match raw { - // Auto-generated using tools/gen_status.py - sys::MX_OK => Status::NoError, - sys::MX_ERR_INTERNAL => Status::ErrInternal, - sys::MX_ERR_NOT_SUPPORTED => Status::ErrNotSupported, - sys::MX_ERR_NO_RESOURCES => Status::ErrNoResources, - sys::MX_ERR_NO_MEMORY => Status::ErrNoMemory, - sys::MX_ERR_CALL_FAILED => Status::ErrCallFailed, - sys::MX_ERR_INTERRUPTED_RETRY => Status::ErrInterruptedRetry, - sys::MX_ERR_INVALID_ARGS => Status::ErrInvalidArgs, - sys::MX_ERR_BAD_HANDLE => Status::ErrBadHandle, - sys::MX_ERR_WRONG_TYPE => Status::ErrWrongType, - sys::MX_ERR_BAD_SYSCALL => Status::ErrBadSyscall, - sys::MX_ERR_OUT_OF_RANGE => Status::ErrOutOfRange, - sys::MX_ERR_BUFFER_TOO_SMALL => Status::ErrBufferTooSmall, - sys::MX_ERR_BAD_STATE => Status::ErrBadState, - sys::MX_ERR_TIMED_OUT => Status::ErrTimedOut, - sys::MX_ERR_SHOULD_WAIT => Status::ErrShouldWait, - sys::MX_ERR_CANCELED => Status::ErrCanceled, - sys::MX_ERR_PEER_CLOSED => Status::ErrPeerClosed, - sys::MX_ERR_NOT_FOUND => Status::ErrNotFound, - sys::MX_ERR_ALREADY_EXISTS => Status::ErrAlreadyExists, - sys::MX_ERR_ALREADY_BOUND => Status::ErrAlreadyBound, - sys::MX_ERR_UNAVAILABLE => Status::ErrUnavailable, - sys::MX_ERR_ACCESS_DENIED => Status::ErrAccessDenied, - sys::MX_ERR_IO => Status::ErrIo, - sys::MX_ERR_IO_REFUSED => Status::ErrIoRefused, - sys::MX_ERR_IO_DATA_INTEGRITY => Status::ErrIoDataIntegrity, - sys::MX_ERR_IO_DATA_LOSS => Status::ErrIoDataLoss, - sys::MX_ERR_BAD_PATH => Status::ErrBadPath, - sys::MX_ERR_NOT_DIR => Status::ErrNotDir, - sys::MX_ERR_NOT_FILE => Status::ErrNotFile, - sys::MX_ERR_FILE_BIG => Status::ErrFileBig, - sys::MX_ERR_NO_SPACE => Status::ErrNoSpace, - sys::MX_ERR_STOP => Status::ErrStop, - sys::MX_ERR_NEXT => Status::ErrNext, - _ => Status::UnknownOther, - } - } - - // Note: no to_raw, even though it's easy to implement, partly because - // handling of UnknownOther would be tricky. -} - -/// Rights associated with a handle. -/// -/// See [rights.md](https://fuchsia.googlesource.com/magenta/+/master/docs/rights.md) -/// for more information. -pub type Rights = sys::mx_rights_t; - -pub use magenta_sys::{ - MX_RIGHT_NONE, - MX_RIGHT_DUPLICATE, - MX_RIGHT_TRANSFER, - MX_RIGHT_READ, - MX_RIGHT_WRITE, - MX_RIGHT_EXECUTE, - MX_RIGHT_MAP, - MX_RIGHT_GET_PROPERTY, - MX_RIGHT_SET_PROPERTY, - MX_RIGHT_DEBUG, - MX_RIGHT_SAME_RIGHTS, -}; - -/// Signals that can be waited upon. -/// -/// See -/// [Objects and signals](https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md#Objects-and-Signals) -/// in the Magenta kernel documentation. Note: the names of signals are still in flux. -pub type Signals = sys::mx_signals_t; - -pub use magenta_sys::{ - MX_SIGNAL_NONE, - - MX_SIGNAL_HANDLE_CLOSED, - MX_SIGNAL_LAST_HANDLE, - - MX_USER_SIGNAL_0, - MX_USER_SIGNAL_1, - MX_USER_SIGNAL_2, - MX_USER_SIGNAL_3, - MX_USER_SIGNAL_4, - MX_USER_SIGNAL_5, - MX_USER_SIGNAL_6, - MX_USER_SIGNAL_7, - - // Event - MX_EVENT_SIGNALED, - - // EventPair - MX_EPAIR_SIGNALED, - MX_EPAIR_CLOSED, - - // Task signals (process, thread, job) - MX_TASK_TERMINATED, - - // Channel - MX_CHANNEL_READABLE, - MX_CHANNEL_WRITABLE, - MX_CHANNEL_PEER_CLOSED, - - // Socket - MX_SOCKET_READABLE, - MX_SOCKET_WRITABLE, - MX_SOCKET_PEER_CLOSED, - - // Timer - MX_TIMER_SIGNALED, -}; - -/// A "wait item" containing a handle reference and information about what signals -/// to wait on, and, on return from `object_wait_many`, which are pending. -#[repr(C)] -#[derive(Debug)] -pub struct WaitItem<'a> { - /// The handle to wait on. - pub handle: HandleRef<'a>, - /// A set of signals to wait for. - pub waitfor: Signals, - /// The set of signals pending, on return of `object_wait_many`. - pub pending: Signals, -} - - -/// An identifier to select a particular clock. See -/// [mx_time_get](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/time_get.md) -/// for more information about the possible values. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum ClockId { - /// The number of nanoseconds since the system was powered on. Corresponds to - /// `MX_CLOCK_MONOTONIC`. - Monotonic = 0, - /// The number of wall clock nanoseconds since the Unix epoch (midnight on January 1 1970) in - /// UTC. Corresponds to MX_CLOCK_UTC. - UTC = 1, - /// The number of nanoseconds the current thread has been running for. Corresponds to - /// MX_CLOCK_THREAD. - Thread = 2, -} - -/// Get the current time, from the specific clock id. -/// -/// Wraps the -/// [mx_time_get](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/time_get.md) -/// syscall. -pub fn time_get(clock_id: ClockId) -> Time { - unsafe { sys::mx_time_get(clock_id as u32) } -} - -/// Read the number of high-precision timer ticks since boot. These ticks may be processor cycles, -/// high speed timer, profiling timer, etc. They are not guaranteed to continue advancing when the -/// system is asleep. -/// -/// Wraps the -/// [mx_ticks_get](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/ticks_get.md) -/// syscall. -pub fn ticks_get() -> u64 { - unsafe { sys::mx_ticks_get() } -} - -/// Compute a deadline for the time in the future that is the given `Duration` away. -/// -/// Wraps the -/// [mx_deadline_after](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/deadline_after.md) -/// syscall. -pub fn deadline_after(nanos: Duration) -> Time { - unsafe { sys::mx_deadline_after(nanos) } -} - -/// Sleep until the given deadline. -/// -/// Wraps the -/// [mx_nanosleep](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/nanosleep.md) -/// syscall. -pub fn nanosleep(deadline: Time) { - unsafe { sys::mx_nanosleep(deadline); } -} - -/// Return the number of high-precision timer ticks in a second. -/// -/// Wraps the -/// [mx_ticks_per_second](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/ticks_per_second.md) -/// syscall. -pub fn ticks_per_second() -> u64 { - unsafe { sys::mx_ticks_per_second() } -} - -pub use magenta_sys::{ - MX_CPRNG_DRAW_MAX_LEN, - MX_CPRNG_ADD_ENTROPY_MAX_LEN, -}; - -/// Draw random bytes from the kernel's CPRNG to fill the given buffer. Returns the actual number of -/// bytes drawn, which may sometimes be less than the size of the buffer provided. -/// -/// The buffer must have length less than `MX_CPRNG_DRAW_MAX_LEN`. -/// -/// Wraps the -/// [mx_cprng_draw](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/syscalls/cprng_draw.md) -/// syscall. -pub fn cprng_draw(buffer: &mut [u8]) -> Result { - let mut actual = 0; - let status = unsafe { sys::mx_cprng_draw(buffer.as_mut_ptr(), buffer.len(), &mut actual) }; - into_result(status, || actual) -} - -/// Mix the given entropy into the kernel CPRNG. -/// -/// The buffer must have length less than `MX_CPRNG_ADD_ENTROPY_MAX_LEN`. -/// -/// Wraps the -/// [mx_cprng_add_entropy](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/syscalls/cprng_add_entropy.md) -/// syscall. -pub fn cprng_add_entropy(buffer: &[u8]) -> Result<(), Status> { - let status = unsafe { sys::mx_cprng_add_entropy(buffer.as_ptr(), buffer.len()) }; - into_result(status, || ()) -} - -fn into_result(status: sys::mx_status_t, f: F) -> Result - where F: FnOnce() -> T { - // All non-negative values are assumed successful. Note: calls that don't try - // to multiplex success values into status return could be more strict here. - if status >= 0 { - Ok(f()) - } else { - Err(Status::from_raw(status)) - } -} - -// Handles - -/// A borrowed reference to a `Handle`. -/// -/// Mostly useful as part of a `WaitItem`. -#[derive(Debug)] -pub struct HandleRef<'a> { - handle: sys::mx_handle_t, - phantom: PhantomData<&'a sys::mx_handle_t>, -} - -impl<'a> HandleRef<'a> { - fn duplicate(&self, rights: Rights) -> Result { - let handle = self.handle; - let mut out = 0; - let status = unsafe { sys::mx_handle_duplicate(handle, rights, &mut out) }; - into_result(status, || Handle(out)) - } - - fn replace(self, rights: Rights) -> Result { - let handle = self.handle; - let mut out = 0; - let status = unsafe { sys::mx_handle_replace(handle, rights, &mut out) }; - into_result(status, || Handle(out)) - } - - fn signal(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { - let handle = self.handle; - let status = unsafe { sys::mx_object_signal(handle, clear_mask.bits(), set_mask.bits()) }; - into_result(status, || ()) - } - - fn wait(&self, signals: Signals, deadline: Time) -> Result { - let handle = self.handle; - let mut pending = sys::mx_signals_t::empty(); - let status = unsafe { - sys::mx_object_wait_one(handle, signals, deadline, &mut pending) - }; - into_result(status, || pending) - } - - fn wait_async(&self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts) - -> Result<(), Status> - { - let handle = self.handle; - let status = unsafe { - sys::mx_object_wait_async(handle, port.raw_handle(), key, signals, options as u32) - }; - into_result(status, || ()) - } -} - -/// A trait implemented by all handle objects. -/// -/// Note: it is reasonable for user-defined objects wrapping a handle to implement -/// this trait. For example, a specific interface in some protocol might be -/// represented as a newtype of `Channel`, and implement the `get_ref` and -/// `from_handle` methods to facilitate conversion from and to the interface. -pub trait HandleBase: Sized { - /// Get a reference to the handle. One important use of such a reference is - /// for `object_wait_many`. - fn get_ref(&self) -> HandleRef; - - /// Interpret the reference as a raw handle (an integer type). Two distinct - /// handles will have different raw values (so it can perhaps be used as a - /// key in a data structure). - fn raw_handle(&self) -> sys::mx_handle_t { - self.get_ref().handle - } - - /// Duplicate a handle, possibly reducing the rights available. Wraps the - /// [mx_handle_duplicate](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/handle_duplicate.md) - /// syscall. - fn duplicate(&self, rights: Rights) -> Result { - self.get_ref().duplicate(rights).map(|handle| - Self::from_handle(handle)) - } - - /// Create a replacement for a handle, possibly reducing the rights available. This invalidates - /// the original handle. Wraps the - /// [mx_handle_replace](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/handle_replace.md) - /// syscall. - fn replace(self, rights: Rights) -> Result { - self.get_ref().replace(rights).map(|handle| Self::from_handle(handle)) - } - - /// Set and clear userspace-accessible signal bits on an object. Wraps the - /// [mx_object_signal](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/object_signal.md) - /// syscall. - fn signal(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { - self.get_ref().signal(clear_mask, set_mask) - } - - /// Waits on a handle. Wraps the - /// [mx_object_wait_one](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/object_wait_one.md) - /// syscall. - fn wait(&self, signals: Signals, deadline: Time) -> Result { - self.get_ref().wait(signals, deadline) - } - - /// Causes packet delivery on the given port when the object changes state and matches signals. - /// [mx_object_wait_async](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/object_wait_async.md) - /// syscall. - fn wait_async(&self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts) - -> Result<(), Status> - { - self.get_ref().wait_async(port, key, signals, options) - } - - /// A method for converting an untyped `Handle` into a more specific reference. - fn from_handle(handle: Handle) -> Self; - - /// A method for converting the object into a generic Handle. - // Not implemented as "From" because it would conflict in From case - fn into_handle(self) -> Handle { - let raw_handle = self.get_ref().handle; - std::mem::forget(self); - Handle(raw_handle) - } -} - -/// A trait implemented by all handles for objects which have a peer. -pub trait Peered: HandleBase { - /// Set and clear userspace-accessible signal bits on the object's peer. Wraps the - /// [mx_object_signal_peer](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/object_signal.md) - /// syscall. - fn signal_peer(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status> { - let handle = self.get_ref().handle; - let status = unsafe { - sys::mx_object_signal_peer(handle, clear_mask.bits(), set_mask.bits()) - }; - into_result(status, || ()) - } -} - -/// A trait implemented by all handles for objects which can have a cookie attached. -pub trait Cookied: HandleBase { - /// Get the cookie attached to this object, if any. Wraps the - /// [mx_object_get_cookie](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/syscalls/object_get_cookie.md) - /// syscall. - fn get_cookie(&self, scope: &HandleRef) -> Result { - let handle = self.get_ref().handle; - let mut cookie = 0; - let status = unsafe { sys::mx_object_get_cookie(handle, scope.handle, &mut cookie) }; - into_result(status, || cookie) - } - - /// Attach an opaque cookie to this object with the given scope. The cookie may be read or - /// changed in future only with the same scope. Wraps the - /// [mx_object_set_cookie](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/syscalls/object_set_cookie.md) - /// syscall. - fn set_cookie(&self, scope: &HandleRef, cookie: u64) -> Result<(), Status> { - let handle = self.get_ref().handle; - let status = unsafe { sys::mx_object_set_cookie(handle, scope.handle, cookie) }; - into_result(status, || ()) - } -} - -fn handle_drop(handle: sys::mx_handle_t) { - let _ = unsafe { sys::mx_handle_close(handle) }; -} - -/// Wait on multiple handles. -/// The success return value is a bool indicating whether one or more of the -/// provided handle references was closed during the wait. -/// -/// Wraps the -/// [mx_object_wait_many](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/object_wait_many.md) -/// syscall. -pub fn object_wait_many(items: &mut [WaitItem], deadline: Time) -> Result -{ - let len = try!(items.len().value_into().map_err(|_| Status::ErrOutOfRange)); - let items_ptr = items.as_mut_ptr() as *mut sys::mx_wait_item_t; - let status = unsafe { sys::mx_object_wait_many( items_ptr, len, deadline) }; - if status == sys::MX_ERR_CANCELED { - return Ok((true)) - } - into_result(status, || false) -} - -// An untyped handle - -/// An object representing a Magenta -/// [handle](https://fuchsia.googlesource.com/magenta/+/master/docs/handles.md). -/// -/// Internally, it is represented as a 32-bit integer, but this wrapper enforces -/// strict ownership semantics. The `Drop` implementation closes the handle. -/// -/// This type represents the most general reference to a kernel object, and can -/// be interconverted to and from more specific types. Those conversions are not -/// enforced in the type system; attempting to use them will result in errors -/// returned by the kernel. These conversions don't change the underlying -/// representation, but do change the type and thus what operations are available. -#[derive(Debug, Eq, PartialEq)] -pub struct Handle(sys::mx_handle_t); - -impl HandleBase for Handle { - fn get_ref(&self) -> HandleRef { - HandleRef { handle: self.0, phantom: Default::default() } - } - - fn from_handle(handle: Handle) -> Self { - handle - } -} - -impl Drop for Handle { - fn drop(&mut self) { - handle_drop(self.0) - } -} - -impl Handle { - /// If a raw handle is obtained from some other source, this method converts - /// it into a type-safe owned handle. - pub unsafe fn from_raw(raw: sys::mx_handle_t) -> Handle { - Handle(raw) - } -} - -fn size_to_u32_sat(size: usize) -> u32 { - u32::value_from(size).unwrap_or_saturate() -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn monotonic_time_increases() { - let time1 = time_get(ClockId::Monotonic); - nanosleep(deadline_after(1_000)); - let time2 = time_get(ClockId::Monotonic); - assert!(time2 > time1); - } - - #[test] - fn utc_time_increases() { - let time1 = time_get(ClockId::UTC); - nanosleep(deadline_after(1_000)); - let time2 = time_get(ClockId::UTC); - assert!(time2 > time1); - } - - #[test] - fn thread_time_increases() { - let time1 = time_get(ClockId::Thread); - nanosleep(deadline_after(1_000)); - let time2 = time_get(ClockId::Thread); - assert!(time2 > time1); - } - - #[test] - fn ticks_increases() { - let ticks1 = ticks_get(); - nanosleep(deadline_after(1_000)); - let ticks2 = ticks_get(); - assert!(ticks2 > ticks1); - } - - #[test] - fn tick_length() { - let sleep_ns = 1_000_000; // 1ms - let one_second_ns = 1_000_000_000; // 1 second in ns - let ticks1 = ticks_get(); - nanosleep(deadline_after(sleep_ns)); - let ticks2 = ticks_get(); - // The number of ticks should have increased by at least 1 ms worth - assert!(ticks2 > ticks1 + sleep_ns * ticks_per_second() / one_second_ns); - // And not more than 4 ms worth - assert!(ticks2 < ticks1 + 4 * sleep_ns * ticks_per_second() / one_second_ns); - } - - #[test] - fn sleep() { - let sleep_ns = 1_000_000; // 1ms - let time1 = time_get(ClockId::Monotonic); - nanosleep(deadline_after(sleep_ns)); - let time2 = time_get(ClockId::Monotonic); - assert!(time2 > time1 + sleep_ns); - } - - /// Test duplication by means of a VMO - #[test] - fn duplicate() { - let hello_length: usize = 5; - - // Create a VMO and write some data to it. - let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); - assert!(vmo.write(b"hello", 0).is_ok()); - - // Replace, reducing rights to read. - let readonly_vmo = vmo.duplicate(MX_RIGHT_READ).unwrap(); - // Make sure we can read but not write. - let mut read_vec = vec![0; hello_length]; - assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); - assert_eq!(read_vec, b"hello"); - assert_eq!(readonly_vmo.write(b"", 0), Err(Status::ErrAccessDenied)); - - // Write new data to the original handle, and read it from the new handle - assert!(vmo.write(b"bye", 0).is_ok()); - assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); - assert_eq!(read_vec, b"byelo"); - } - - // Test replace by means of a VMO - #[test] - fn replace() { - let hello_length: usize = 5; - - // Create a VMO and write some data to it. - let vmo = Vmo::create(hello_length as u64, VmoOpts::Default).unwrap(); - assert!(vmo.write(b"hello", 0).is_ok()); - - // Replace, reducing rights to read. - let readonly_vmo = vmo.replace(MX_RIGHT_READ).unwrap(); - // Make sure we can read but not write. - let mut read_vec = vec![0; hello_length]; - assert_eq!(readonly_vmo.read(&mut read_vec, 0).unwrap(), hello_length); - assert_eq!(read_vec, b"hello"); - assert_eq!(readonly_vmo.write(b"", 0), Err(Status::ErrAccessDenied)); - } - - #[test] - fn wait_and_signal() { - let event = Event::create(EventOpts::Default).unwrap(); - let ten_ms: Duration = 10_000_000; - - // Waiting on it without setting any signal should time out. - assert_eq!(event.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If we set a signal, we should be able to wait for it. - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - assert_eq!(event.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), - MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - - // Should still work, signals aren't automatically cleared. - assert_eq!(event.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)).unwrap(), - MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - - // Now clear it, and waiting should time out again. - assert!(event.signal(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); - assert_eq!(event.wait(MX_USER_SIGNAL_0, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - } - - #[test] - fn wait_many_and_signal() { - let ten_ms: Duration = 10_000_000; - let e1 = Event::create(EventOpts::Default).unwrap(); - let e2 = Event::create(EventOpts::Default).unwrap(); - - // Waiting on them now should time out. - let mut items = vec![ - WaitItem { handle: e1.get_ref(), waitfor: MX_USER_SIGNAL_0, pending: MX_SIGNAL_NONE }, - WaitItem { handle: e2.get_ref(), waitfor: MX_USER_SIGNAL_1, pending: MX_SIGNAL_NONE }, - ]; - assert_eq!(object_wait_many(&mut items, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - assert_eq!(items[0].pending, MX_SIGNAL_LAST_HANDLE); - assert_eq!(items[1].pending, MX_SIGNAL_LAST_HANDLE); - - // Signal one object and it should return success. - assert!(e1.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - assert!(object_wait_many(&mut items, deadline_after(ten_ms)).is_ok()); - assert_eq!(items[0].pending, MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(items[1].pending, MX_SIGNAL_LAST_HANDLE); - - // Signal the other and it should return both. - assert!(e2.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_1).is_ok()); - assert!(object_wait_many(&mut items, deadline_after(ten_ms)).is_ok()); - assert_eq!(items[0].pending, MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(items[1].pending, MX_USER_SIGNAL_1 | MX_SIGNAL_LAST_HANDLE); - - // Clear signals on both; now it should time out again. - assert!(e1.signal(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); - assert!(e2.signal(MX_USER_SIGNAL_1, MX_SIGNAL_NONE).is_ok()); - assert_eq!(object_wait_many(&mut items, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - assert_eq!(items[0].pending, MX_SIGNAL_LAST_HANDLE); - assert_eq!(items[1].pending, MX_SIGNAL_LAST_HANDLE); - } - - #[test] - fn cookies() { - let event = Event::create(EventOpts::Default).unwrap(); - let scope = Event::create(EventOpts::Default).unwrap(); - - // Getting a cookie when none has been set should fail. - assert_eq!(event.get_cookie(&scope.get_ref()), Err(Status::ErrAccessDenied)); - - // Set a cookie. - assert_eq!(event.set_cookie(&scope.get_ref(), 42), Ok(())); - - // Should get it back.... - assert_eq!(event.get_cookie(&scope.get_ref()), Ok(42)); - - // but not with the wrong scope! - assert_eq!(event.get_cookie(&event.get_ref()), Err(Status::ErrAccessDenied)); - - // Can change it, with the same scope... - assert_eq!(event.set_cookie(&scope.get_ref(), 123), Ok(())); - - // but not with a different scope. - assert_eq!(event.set_cookie(&event.get_ref(), 123), Err(Status::ErrAccessDenied)); - } - - #[test] - fn cprng() { - let mut buffer = [0; 20]; - assert_eq!(cprng_draw(&mut buffer), Ok(20)); - assert_ne!(buffer[0], 0); - assert_ne!(buffer[19], 0); - } - - #[test] - fn cprng_too_large() { - let mut buffer = [0; MX_CPRNG_DRAW_MAX_LEN + 1]; - assert_eq!(cprng_draw(&mut buffer), Err(Status::ErrInvalidArgs)); - - for mut s in buffer.chunks_mut(MX_CPRNG_DRAW_MAX_LEN) { - assert_eq!(cprng_draw(&mut s), Ok(s.len())); - } - } - - #[test] - fn cprng_add() { - let buffer = [0, 1, 2]; - assert_eq!(cprng_add_entropy(&buffer), Ok(())); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/port.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/port.rs --- distinst-0.1.0/vendor/magenta/src/port.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/port.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,362 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta port objects. - -use std::mem; - -use {HandleBase, Handle, HandleRef, Signals, Status, Time}; -use {sys, into_result}; - -/// An object representing a Magenta -/// [port](https://fuchsia.googlesource.com/magenta/+/master/docs/objects/port.md). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Port(Handle); - -impl HandleBase for Port { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Port(handle) - } -} - -/// A packet sent through a port. This is a type-safe wrapper for -/// [mx_port_packet_t](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_wait2.md). -#[derive(PartialEq, Eq, Debug)] -pub struct Packet(sys::mx_port_packet_t); - -/// The contents of a `Packet`. -#[derive(Debug, Copy, Clone)] -pub enum PacketContents { - /// A user-generated packet. - User(UserPacket), - /// A one-shot signal packet generated via `object_wait_async`. - SignalOne(SignalPacket), - /// A repeating signal packet generated via `object_wait_async`. - SignalRep(SignalPacket), -} - -/// Contents of a user packet (one sent by `port_queue`). This is a type-safe wrapper for -/// [mx_packet_user_t](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_wait2.md). -#[derive(Debug, Copy, Clone)] -pub struct UserPacket(sys::mx_packet_user_t); - -/// Contents of a signal packet (one generated by the kernel). This is a type-safe wrapper for -/// [mx_packet_signal_t](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_wait2.md). -#[derive(Debug, Copy, Clone)] -pub struct SignalPacket(sys::mx_packet_signal_t); - -impl Packet { - /// Creates a new packet with `UserPacket` data. - pub fn from_user_packet(key: u64, status: i32, user: UserPacket) -> Packet { - Packet( - sys::mx_port_packet_t { - key: key, - packet_type: sys::mx_packet_type_t::MX_PKT_TYPE_USER, - status: status, - union: user.0, - } - ) - } - - /// The packet's key. - pub fn key(&self) -> u64 { - self.0.key - } - - /// The packet's status. - // TODO: should this type be wrapped? - pub fn status(&self) -> i32 { - self.0.status - } - - /// The contents of the packet. - pub fn contents(&self) -> PacketContents { - if self.0.packet_type == sys::mx_packet_type_t::MX_PKT_TYPE_USER { - PacketContents::User(UserPacket(self.0.union)) - } else if self.0.packet_type == sys::mx_packet_type_t::MX_PKT_TYPE_SIGNAL_ONE { - PacketContents::SignalOne(SignalPacket(unsafe { mem::transmute_copy(&self.0.union) })) - } else if self.0.packet_type == sys::mx_packet_type_t::MX_PKT_TYPE_SIGNAL_REP { - PacketContents::SignalRep(SignalPacket(unsafe { mem::transmute_copy(&self.0.union) })) - } else { - panic!("unexpected packet type"); - } - } -} - -impl UserPacket { - pub fn from_u8_array(val: [u8; 32]) -> UserPacket { - UserPacket(val) - } - - pub fn as_u8_array(&self) -> &[u8; 32] { - &self.0 - } - - pub fn as_mut_u8_array(&mut self) -> &mut [u8; 32] { - &mut self.0 - } -} - -impl SignalPacket { - /// The signals used in the call to `object_wait_async`. - pub fn trigger(&self) -> Signals { - self.0.trigger - } - - /// The observed signals. - pub fn observed(&self) -> Signals { - self.0.observed - } - - /// A per object count of pending operations. - pub fn count(&self) -> u64 { - self.0.count - } -} - -impl Port { - /// Create an IO port, allowing IO packets to be read and enqueued. - /// - /// Wraps the - /// [mx_port_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_create.md) - /// syscall. - pub fn create(opts: PortOpts) -> Result { - unsafe { - let mut handle = 0; - let status = sys::mx_port_create(opts as u32, &mut handle); - into_result(status, || Self::from_handle(Handle(handle))) - } - } - - /// Attempt to queue a user packet to the IO port. - /// - /// Wraps the - /// [mx_port_queue](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_queue.md) - /// syscall. - pub fn queue(&self, packet: &Packet) -> Result<(), Status> { - let status = unsafe { - sys::mx_port_queue(self.raw_handle(), - &packet.0 as *const sys::mx_port_packet_t as *const u8, 0) - }; - into_result(status, || ()) - } - - /// Wait for a packet to arrive on a (V2) port. - /// - /// Wraps the - /// [mx_port_wait](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/port_wait2.md) - /// syscall. - pub fn wait(&self, deadline: Time) -> Result { - let mut packet = Default::default(); - let status = unsafe { - sys::mx_port_wait(self.raw_handle(), deadline, - &mut packet as *mut sys::mx_port_packet_t as *mut u8, 0) - }; - into_result(status, || Packet(packet)) - } - - /// Cancel pending wait_async calls for an object with the given key. - /// - /// Wraps the - /// [mx_port_cancel](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/syscalls/port_cancel.md) - /// syscall. - pub fn cancel(&self, source: &H, key: u64) -> Result<(), Status> where H: HandleBase { - let status = unsafe { - sys::mx_port_cancel(self.raw_handle(), source.raw_handle(), key) - }; - into_result(status, || ()) - } -} - -/// Options for creating a port. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum PortOpts { - /// Default options. - Default = 0, -} - -impl Default for PortOpts { - fn default() -> Self { - PortOpts::Default - } -} - -/// Options for wait_async. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum WaitAsyncOpts { - Once = sys::MX_WAIT_ASYNC_ONCE, - Repeating = sys::MX_WAIT_ASYNC_REPEATING, -} - -#[cfg(test)] -mod tests { - use super::*; - use {Duration, Event, EventOpts}; - use {MX_SIGNAL_LAST_HANDLE, MX_SIGNAL_NONE, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1}; - use deadline_after; - - #[test] - fn port_basic() { - let ten_ms: Duration = 10_000_000; - - let port = Port::create(PortOpts::Default).unwrap(); - - // Waiting now should time out. - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // Send a valid packet. - let packet = Packet::from_user_packet( - 42, - 123, - UserPacket::from_u8_array([13; 32]), - ); - assert!(port.queue(&packet).is_ok()); - - // Waiting should succeed this time. We should get back the packet we sent. - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet, packet); - } - - #[test] - fn wait_async_once() { - let ten_ms: Duration = 10_000_000; - let key = 42; - - let port = Port::create(PortOpts::Default).unwrap(); - let event = Event::create(EventOpts::Default).unwrap(); - - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1, - WaitAsyncOpts::Once).is_ok()); - - // Waiting without setting any signal should time out. - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If we set a signal, we should be able to wait for it. - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet.key(), key); - assert_eq!(read_packet.status(), 0); - match read_packet.contents() { - PacketContents::SignalOne(sig) => { - assert_eq!(sig.trigger(), MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1); - assert_eq!(sig.observed(), MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(sig.count(), 1); - } - _ => panic!("wrong packet type"), - } - - // Shouldn't get any more packets. - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // Calling wait_async again should result in another packet. - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet.key(), key); - assert_eq!(read_packet.status(), 0); - match read_packet.contents() { - PacketContents::SignalOne(sig) => { - assert_eq!(sig.trigger(), MX_USER_SIGNAL_0); - assert_eq!(sig.observed(), MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(sig.count(), 1); - } - _ => panic!("wrong packet type"), - } - - // Calling wait_async then cancel, we should not get a packet as cancel will remove it from - // the queue. - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); - assert!(port.cancel(&event, key).is_ok()); - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If the event is signalled after the cancel, we also shouldn't get a packet. - assert!(event.signal(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); // clear signal - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0, WaitAsyncOpts::Once).is_ok()); - assert!(port.cancel(&event, key).is_ok()); - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - } - - #[test] - fn wait_async_repeating() { - let ten_ms: Duration = 10_000_000; - let key = 42; - - let port = Port::create(PortOpts::Default).unwrap(); - let event = Event::create(EventOpts::Default).unwrap(); - - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1, - WaitAsyncOpts::Repeating).is_ok()); - - // Waiting without setting any signal should time out. - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If we set a signal, we should be able to wait for it. - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet.key(), key); - assert_eq!(read_packet.status(), 0); - match read_packet.contents() { - PacketContents::SignalRep(sig) => { - assert_eq!(sig.trigger(), MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1); - assert_eq!(sig.observed(), MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(sig.count(), 1); - } - _ => panic!("wrong packet type"), - } - - // Should not get any more packets, as MX_WAIT_ASYNC_REPEATING is edge triggered rather than - // level triggered. - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // If we clear and resignal, we should get the same packet again, - // even though we didn't call event.wait_async again. - assert!(event.signal(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); // clear signal - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet.key(), key); - assert_eq!(read_packet.status(), 0); - match read_packet.contents() { - PacketContents::SignalRep(sig) => { - assert_eq!(sig.trigger(), MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1); - assert_eq!(sig.observed(), MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(sig.count(), 1); - } - _ => panic!("wrong packet type"), - } - - // Cancelling the wait should stop us getting packets... - assert!(port.cancel(&event, key).is_ok()); - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - // ... even if we clear and resignal - assert!(event.signal(MX_USER_SIGNAL_0, MX_SIGNAL_NONE).is_ok()); // clear signal - assert!(event.signal(MX_SIGNAL_NONE, MX_USER_SIGNAL_0).is_ok()); - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // Calling wait_async again should result in another packet. - assert!(event.wait_async(&port, key, MX_USER_SIGNAL_0, WaitAsyncOpts::Repeating).is_ok()); - let read_packet = port.wait(deadline_after(ten_ms)).unwrap(); - assert_eq!(read_packet.key(), key); - assert_eq!(read_packet.status(), 0); - match read_packet.contents() { - PacketContents::SignalRep(sig) => { - assert_eq!(sig.trigger(), MX_USER_SIGNAL_0); - assert_eq!(sig.observed(), MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE); - assert_eq!(sig.count(), 1); - } - _ => panic!("wrong packet type"), - } - - // Closing the handle should stop us getting packets. - drop(event); - assert_eq!(port.wait(deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/process.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/process.rs --- distinst-0.1.0/vendor/magenta/src/process.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/process.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta process. - -use {HandleBase, Handle, HandleRef}; - -/// An object representing a Magenta process. -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Process(Handle); - -impl HandleBase for Process { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Process(handle) - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/socket.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/socket.rs --- distinst-0.1.0/vendor/magenta/src/socket.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/socket.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta sockets. - -use {HandleBase, Handle, HandleRef, Peered}; -use {sys, Status, into_result}; - -use std::ptr; - -/// An object representing a Magenta -/// [socket](https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md#Message-Passing_Sockets-and-Channels). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Socket(Handle); - -impl HandleBase for Socket { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Socket(handle) - } -} - -impl Peered for Socket { -} - -/// Options for creating a socket pair. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum SocketOpts { - /// Default options. - Default = 0, -} - -impl Default for SocketOpts { - fn default() -> Self { - SocketOpts::Default - } -} - -/// Options for writing into a socket. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum SocketWriteOpts { - /// Default options. - Default = 0, -} - -impl Default for SocketWriteOpts { - fn default() -> Self { - SocketWriteOpts::Default - } -} - -/// Options for reading from a socket. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum SocketReadOpts { - /// Default options. - Default = 0, -} - -impl Default for SocketReadOpts { - fn default() -> Self { - SocketReadOpts::Default - } -} - - -impl Socket { - /// Create a socket, accessed through a pair of endpoints. Data written - /// into one may be read from the other. - /// - /// Wraps - /// [mx_socket_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/socket_create.md). - pub fn create(opts: SocketOpts) -> Result<(Socket, Socket), Status> { - unsafe { - let mut out0 = 0; - let mut out1 = 0; - let status = sys::mx_socket_create(opts as u32, &mut out0, &mut out1); - into_result(status, || - (Self::from_handle(Handle(out0)), - Self::from_handle(Handle(out1)))) - } - } - - /// Write the given bytes into the socket. - /// Return value (on success) is number of bytes actually written. - /// - /// Wraps - /// [mx_socket_write](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/socket_write.md). - pub fn write(&self, opts: SocketWriteOpts, bytes: &[u8]) -> Result { - let mut actual = 0; - let status = unsafe { - sys::mx_socket_write(self.raw_handle(), opts as u32, bytes.as_ptr(), bytes.len(), - &mut actual) - }; - into_result(status, || actual) - } - - /// Read the given bytes from the socket. - /// Return value (on success) is number of bytes actually read. - /// - /// Wraps - /// [mx_socket_read](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/socket_read.md). - pub fn read(&self, opts: SocketReadOpts, bytes: &mut [u8]) -> Result { - let mut actual = 0; - let status = unsafe { - sys::mx_socket_read(self.raw_handle(), opts as u32, bytes.as_mut_ptr(), - bytes.len(), &mut actual) - }; - if status != sys::MX_OK { - // If an error is returned then actual is undefined, so to be safe we set it to 0 and - // ignore any data that is set in bytes. - actual = 0; - } - into_result(status, || actual) - } - - /// Close half of the socket, so attempts by the other side to write will fail. - /// - /// Implements the `MX_SOCKET_HALF_CLOSE` option of - /// [mx_socket_write](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/socket_write.md). - pub fn half_close(&self) -> Result<(), Status> { - let status = unsafe { sys::mx_socket_write(self.raw_handle(), sys::MX_SOCKET_HALF_CLOSE, - ptr::null(), 0, ptr::null_mut()) }; - into_result(status, || ()) - } - - pub fn outstanding_read_bytes(&self) -> Result { - let mut outstanding = 0; - let status = unsafe { - sys::mx_socket_read(self.raw_handle(), 0, ptr::null_mut(), 0, &mut outstanding) - }; - into_result(status, || outstanding) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn socket_basic() { - let (s1, s2) = Socket::create(SocketOpts::Default).unwrap(); - - // Write in one end and read it back out the other. - assert_eq!(s1.write(SocketWriteOpts::Default, b"hello").unwrap(), 5); - - let mut read_vec = vec![0; 8]; - assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec).unwrap(), 5); - assert_eq!(&read_vec[0..5], b"hello"); - - // Try reading when there is nothing to read. - assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrShouldWait)); - - // Close the socket from one end. - assert!(s1.half_close().is_ok()); - assert_eq!(s2.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrPeerClosed)); - assert_eq!(s1.write(SocketWriteOpts::Default, b"fail"), Err(Status::ErrBadState)); - - // Writing in the other direction should still work. - assert_eq!(s1.read(SocketReadOpts::Default, &mut read_vec), Err(Status::ErrShouldWait)); - assert_eq!(s2.write(SocketWriteOpts::Default, b"back").unwrap(), 4); - assert_eq!(s1.read(SocketReadOpts::Default, &mut read_vec).unwrap(), 4); - assert_eq!(&read_vec[0..4], b"back"); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/thread.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/thread.rs --- distinst-0.1.0/vendor/magenta/src/thread.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/thread.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta thread. - -use {HandleBase, Handle, HandleRef}; - -/// An object representing a Magenta thread. -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Thread(Handle); - -impl HandleBase for Thread { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Thread(handle) - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/timer.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/timer.rs --- distinst-0.1.0/vendor/magenta/src/timer.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/timer.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta timer objects. - -use {ClockId, Duration, HandleBase, Handle, HandleRef, Status, Time}; -use {sys, into_result}; - -/// An object representing a Magenta -/// [event pair](https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md#Other-IPC_Events_Event-Pairs_and-User-Signals). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Timer(Handle); - -impl HandleBase for Timer { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Timer(handle) - } -} - -impl Timer { - /// Create a timer, an object that can signal when a specified point in time has been reached. - /// Wraps the - /// [mx_timer_create](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/timer_create.md) - /// syscall. - pub fn create(options: TimerOpts, clock_id: ClockId) -> Result { - let mut out = 0; - let status = unsafe { sys::mx_timer_create(options as u32, clock_id as u32, &mut out) }; - into_result(status, || Self::from_handle(Handle(out))) - } - - /// Starts a timer which will fire when `deadline` passes. Wraps the - /// [mx_timer_start](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/timer_start.md) - /// syscall. - pub fn start(&self, deadline: Time, period: Duration, slack: Duration) -> Result<(), Status> { - let status = unsafe { sys::mx_timer_start(self.raw_handle(), deadline, period, slack) }; - into_result(status, || ()) - } - - /// Cancels a pending timer that was started with start(). Wraps the - /// [mx_timer_cancel](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/timer_cancel.md) - /// syscall. - pub fn cancel(&self) -> Result<(), Status> { - let status = unsafe { sys::mx_timer_cancel(self.raw_handle()) }; - into_result(status, || ()) - } -} - -/// Options for creating a timer. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum TimerOpts { - /// Default options. - Default = 0, -} - -impl Default for TimerOpts { - fn default() -> Self { - TimerOpts::Default - } -} - -#[cfg(test)] -mod tests { - use super::*; - use {Duration, MX_SIGNAL_LAST_HANDLE, MX_TIMER_SIGNALED}; - use deadline_after; - - #[test] - fn create_timer_invalid_clock() { - assert_eq!(Timer::create(TimerOpts::Default, ClockId::UTC).unwrap_err(), Status::ErrInvalidArgs); - assert_eq!(Timer::create(TimerOpts::Default, ClockId::Thread), Err(Status::ErrInvalidArgs)); - } - - #[test] - fn timer_basic() { - let ten_ms: Duration = 10_000_000; - let twenty_ms: Duration = 20_000_000; - - // Create a timer - let timer = Timer::create(TimerOpts::Default, ClockId::Monotonic).unwrap(); - - // Should not signal yet. - assert_eq!(timer.wait(MX_TIMER_SIGNALED, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - - // Start it, and soon it should signal. - assert_eq!(timer.start(ten_ms, 0, 0), Ok(())); - assert_eq!(timer.wait(MX_TIMER_SIGNALED, deadline_after(twenty_ms)).unwrap(), - MX_TIMER_SIGNALED | MX_SIGNAL_LAST_HANDLE); - - // Cancel it, and it should stop signalling. - assert_eq!(timer.cancel(), Ok(())); - assert_eq!(timer.wait(MX_TIMER_SIGNALED, deadline_after(ten_ms)), Err(Status::ErrTimedOut)); - } -} diff -Nru distinst-0.1.0/vendor/magenta/src/vmo.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/vmo.rs --- distinst-0.1.0/vendor/magenta/src/vmo.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/src/vmo.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,284 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Type-safe bindings for Magenta vmo objects. - -use {Cookied, HandleBase, Handle, HandleRef, Status}; -use {sys, into_result}; -use std::{mem, ptr}; - -/// An object representing a Magenta -/// [virtual memory object](https://fuchsia.googlesource.com/magenta/+/master/docs/objects/vm_object.md). -/// -/// As essentially a subtype of `Handle`, it can be freely interconverted. -#[derive(Debug, Eq, PartialEq)] -pub struct Vmo(Handle); - -impl HandleBase for Vmo { - fn get_ref(&self) -> HandleRef { - self.0.get_ref() - } - - fn from_handle(handle: Handle) -> Self { - Vmo(handle) - } -} - -impl Cookied for Vmo { -} - -impl Vmo { - /// Create a virtual memory object. - /// - /// Wraps the - /// `mx_vmo_create` - /// syscall. See the - /// [Shared Memory: Virtual Memory Objects (VMOs)](https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md#Shared-Memory_Virtual-Memory-Objects-VMOs) - /// for more information. - pub fn create(size: u64, options: VmoOpts) -> Result { - let mut handle = 0; - let status = unsafe { sys::mx_vmo_create(size, options as u32, &mut handle) }; - into_result(status, || - Vmo::from_handle(Handle(handle))) - } - - /// Read from a virtual memory object. - /// - /// Wraps the `mx_vmo_read` syscall. - pub fn read(&self, data: &mut [u8], offset: u64) -> Result { - unsafe { - let mut actual = 0; - let status = sys::mx_vmo_read(self.raw_handle(), data.as_mut_ptr(), - offset, data.len(), &mut actual); - into_result(status, || actual) - } - } - - /// Write to a virtual memory object. - /// - /// Wraps the `mx_vmo_write` syscall. - pub fn write(&self, data: &[u8], offset: u64) -> Result { - unsafe { - let mut actual = 0; - let status = sys::mx_vmo_write(self.raw_handle(), data.as_ptr(), - offset, data.len(), &mut actual); - into_result(status, || actual) - } - } - - /// Get the size of a virtual memory object. - /// - /// Wraps the `mx_vmo_get_size` syscall. - pub fn get_size(&self) -> Result { - let mut size = 0; - let status = unsafe { sys::mx_vmo_get_size(self.raw_handle(), &mut size) }; - into_result(status, || size) - } - - /// Attempt to change the size of a virtual memory object. - /// - /// Wraps the `mx_vmo_set_size` syscall. - pub fn set_size(&self, size: u64) -> Result<(), Status> { - let status = unsafe { sys::mx_vmo_set_size(self.raw_handle(), size) }; - into_result(status, || ()) - } - - /// Perform an operation on a range of a virtual memory object. - /// - /// Wraps the - /// [mx_vmo_op_range](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/vmo_op_range.md) - /// syscall. - pub fn op_range(&self, op: VmoOp, offset: u64, size: u64) -> Result<(), Status> { - let status = unsafe { - sys::mx_vmo_op_range(self.raw_handle(), op as u32, offset, size, ptr::null_mut(), 0) - }; - into_result(status, || ()) - } - - /// Look up a list of physical addresses corresponding to the pages held by the VMO from - /// `offset` to `offset`+`size`, and store them in `buffer`. - /// - /// Wraps the - /// [mx_vmo_op_range](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/vmo_op_range.md) - /// syscall with MX_VMO_OP_LOOKUP. - pub fn lookup(&self, offset: u64, size: u64, buffer: &mut [sys::mx_paddr_t]) - -> Result<(), Status> - { - let status = unsafe { - sys::mx_vmo_op_range(self.raw_handle(), sys::MX_VMO_OP_LOOKUP, offset, size, - buffer.as_mut_ptr() as *mut u8, buffer.len() * mem::size_of::()) - }; - into_result(status, || ()) - } - - /// Create a new virtual memory object that clones a range of this one. - /// - /// Wraps the - /// [mx_vmo_clone](https://fuchsia.googlesource.com/magenta/+/master/docs/syscalls/vmo_clone.md) - /// syscall. - pub fn clone(&self, options: VmoCloneOpts, offset: u64, size: u64) -> Result { - let mut out = 0; - let status = unsafe { - sys::mx_vmo_clone(self.raw_handle(), options as u32, offset, size, &mut out) - }; - into_result(status, || Vmo::from_handle(Handle(out))) - } -} - -/// Options for creating virtual memory objects. None supported yet. -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum VmoOpts { - /// Default options. - Default = 0, -} - -impl Default for VmoOpts { - fn default() -> Self { - VmoOpts::Default - } -} - -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum VmoOp { - /// Commit `size` bytes worth of pages starting at byte `offset` for the VMO. - Commit = sys::MX_VMO_OP_COMMIT, - /// Release a range of pages previously committed to the VMO from `offset` to `offset`+`size`. - Decommit = sys::MX_VMO_OP_DECOMMIT, - // Presently unsupported. - Lock = sys::MX_VMO_OP_LOCK, - // Presently unsupported. - Unlock = sys::MX_VMO_OP_UNLOCK, - /// Perform a cache sync operation. - CacheSync = sys::MX_VMO_OP_CACHE_SYNC, - /// Perform a cache invalidation operation. - CacheInvalidate = sys::MX_VMO_OP_CACHE_INVALIDATE, - /// Perform a cache clean operation. - CacheClean = sys::MX_VMO_OP_CACHE_CLEAN, - /// Perform cache clean and invalidation operations together. - CacheCleanInvalidate = sys::MX_VMO_OP_CACHE_CLEAN_INVALIDATE, -} - -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum VmoCloneOpts { - /// Create a copy-on-write clone. - CopyOnWrite = sys::MX_VMO_CLONE_COPY_ON_WRITE, -} - -impl Default for VmoCloneOpts { - fn default() -> Self { - VmoCloneOpts::CopyOnWrite - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn vmo_get_size() { - let size = 16 * 1024 * 1024; - let vmo = Vmo::create(size, VmoOpts::Default).unwrap(); - assert_eq!(size, vmo.get_size().unwrap()); - } - - #[test] - fn vmo_set_size() { - let start_size = 12; - let vmo = Vmo::create(start_size, VmoOpts::Default).unwrap(); - assert_eq!(start_size, vmo.get_size().unwrap()); - - // Change the size and make sure the new size is reported - let new_size = 23; - assert!(vmo.set_size(new_size).is_ok()); - assert_eq!(new_size, vmo.get_size().unwrap()); - } - - #[test] - fn vmo_read_write() { - let mut vec1 = vec![0; 16]; - let vmo = Vmo::create(vec1.len() as u64, VmoOpts::Default).unwrap(); - assert_eq!(vmo.write(b"abcdef", 0), Ok(6)); - assert_eq!(16, vmo.read(&mut vec1, 0).unwrap()); - assert_eq!(b"abcdef", &vec1[0..6]); - assert_eq!(vmo.write(b"123", 2), Ok(3)); - assert_eq!(16, vmo.read(&mut vec1, 0).unwrap()); - assert_eq!(b"ab123f", &vec1[0..6]); - assert_eq!(15, vmo.read(&mut vec1, 1).unwrap()); - assert_eq!(b"b123f", &vec1[0..5]); - } - - #[test] - fn vmo_op_range_unsupported() { - let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); - assert_eq!(vmo.op_range(VmoOp::Lock, 0, 1), Err(Status::ErrNotSupported)); - assert_eq!(vmo.op_range(VmoOp::Unlock, 0, 1), Err(Status::ErrNotSupported)); - } - - #[test] - fn vmo_lookup() { - let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); - let mut buffer = vec![0; 2]; - - // Lookup will fail as it is not committed yet. - assert_eq!(vmo.lookup(0, 12, &mut buffer), Err(Status::ErrNoMemory)); - - // Commit and try again. - assert_eq!(vmo.op_range(VmoOp::Commit, 0, 12), Ok(())); - assert_eq!(vmo.lookup(0, 12, &mut buffer), Ok(())); - assert_ne!(buffer[0], 0); - assert_eq!(buffer[1], 0); - - // If we decommit then lookup should go back to failing. - assert_eq!(vmo.op_range(VmoOp::Decommit, 0, 12), Ok(())); - assert_eq!(vmo.lookup(0, 12, &mut buffer), Err(Status::ErrNoMemory)); - } - - #[test] - fn vmo_cache() { - let vmo = Vmo::create(12, VmoOpts::Default).unwrap(); - - // Cache operations should all succeed. - assert_eq!(vmo.op_range(VmoOp::CacheSync, 0, 12), Ok(())); - assert_eq!(vmo.op_range(VmoOp::CacheInvalidate, 0, 12), Ok(())); - assert_eq!(vmo.op_range(VmoOp::CacheClean, 0, 12), Ok(())); - assert_eq!(vmo.op_range(VmoOp::CacheCleanInvalidate, 0, 12), Ok(())); - } - - #[test] - fn vmo_clone() { - let original = Vmo::create(12, VmoOpts::Default).unwrap(); - assert_eq!(original.write(b"one", 0), Ok(3)); - - // Clone the VMO, and make sure it contains what we expect. - let clone = original.clone(VmoCloneOpts::CopyOnWrite, 0, 10).unwrap(); - let mut read_buffer = vec![0; 16]; - assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); - assert_eq!(&read_buffer[0..3], b"one"); - - // Writing to the original will affect the clone too, surprisingly. - assert_eq!(original.write(b"two", 0), Ok(3)); - assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); - assert_eq!(&read_buffer[0..3], b"two"); - assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); - assert_eq!(&read_buffer[0..3], b"two"); - - // However, writing to the clone will not affect the original - assert_eq!(clone.write(b"three", 0), Ok(5)); - assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); - assert_eq!(&read_buffer[0..3], b"two"); - assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); - assert_eq!(&read_buffer[0..5], b"three"); - - // And now that the copy-on-write has happened, writing to the original will not affect the - // clone. How bizarre. - assert_eq!(original.write(b"four", 0), Ok(4)); - assert_eq!(original.read(&mut read_buffer, 0), Ok(12)); - assert_eq!(&read_buffer[0..4], b"four"); - assert_eq!(clone.read(&mut read_buffer, 0), Ok(10)); - assert_eq!(&read_buffer[0..5], b"three"); - } -} diff -Nru distinst-0.1.0/vendor/magenta/tools/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/BUILD.gn --- distinst-0.1.0/vendor/magenta/tools/BUILD.gn 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -# Copyright 2017 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("clang_wrapper") { - deps = [ - ":arm64_wrapper", - ":x64_wrapper", - ] -} - -executable("clang_wrapper_bin") { - output_name = "rust_clang_wrapper" - - sources = [ - "clang_wrapper.cc", - ] - - if (is_linux) { - ldflags = [ - "-pthread", - ] - } -} - -template("copy_wrapper") { - - arch = invoker.arch - - copy(target_name) { - sources = [ - "$root_out_dir/rust_clang_wrapper", - ] - - outputs = [ - "$root_out_dir/$arch-unknown-fuchsia-cc", - ] - - deps = [ - ":clang_wrapper_bin", - ] - } -} - -copy_wrapper("arm64_wrapper") { - arch = "aarch64" -} - -copy_wrapper("x64_wrapper") { - arch = "x86_64" -} diff -Nru distinst-0.1.0/vendor/magenta/tools/clang_wrapper.cc distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/clang_wrapper.cc --- distinst-0.1.0/vendor/magenta/tools/clang_wrapper.cc 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/clang_wrapper.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Wrap the clang toolchain to supply triple-specific configuration parameters -// as arguments. - -// Gnu-style toolchains encode the target triple in the executable name (each -// executable is specialized to a single triple), and each toolchain also knows -// how to find the corresponding sysroot. By contrast, clang uses a single -// binary, and the target is specified as a command line argument. In addition, -// in the Fuchsia world, the sysroot is not bundled with the compiler. -// -// This wrapper infers the relevant configuration parameters from the command -// name used to invoke the wrapper, and also finds the sysroot at a known -// location relative to the jiri root, then invokes clang with the additional -// arguments. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using std::string; -using std::vector; - -// Get the real path of this executable, resolving symbolic links. -string GetPath(const char* argv0) { - char* path_c = realpath(argv0, nullptr); - string path = string(path_c); - free(path_c); - return path; -} - -// Return path of Jiri root, or empty string if not found. -string FindJiriRoot(const string& self_path) { - string path = self_path; - while (true) { - size_t pos = path.rfind('/'); - if (pos == string::npos) { - return ""; - } - string basedir = path.substr(0, pos + 1); - string trial = basedir + ".jiri_root"; - struct stat stat_buf; - int status = stat(trial.c_str(), &stat_buf); - if (status == 0) { - return basedir; - } - path = path.substr(0, pos); - } -} - -// Get the basename of the command used to invoke this wrapper. -// Typical return value: "x86-64-unknown-fuchsia-cc" -string GetCmd(const char* argv0) { - string cmd = argv0; - size_t pos = cmd.rfind('/'); - if (pos != string::npos) { - cmd = cmd.substr(pos + 1); - } - return cmd; -} - -// Given the command basename, get the llvm target triple. Empty string on failure. -// Typical return value: "x86_64-unknown-fuchsia" -string TargetTriple(const string& cmd) { - size_t pos = cmd.rfind('-'); - if (pos == string::npos) { - return ""; - } - string triple = cmd.substr(0, pos); - if (triple.find("x86-64") == 0) { - triple[3] = '_'; - } - return triple; -} - -// Given the path to the command, calculate the matching sysroot -string SysrootPath(const string& self_path) { - const string out_dir_name = "out/"; - size_t pos = self_path.find(out_dir_name); - if (pos != string::npos) { - size_t end_pos = self_path.find("/", pos+out_dir_name.length() + 1); - if (end_pos != string::npos) { - string sysroot_path = self_path.substr(0, end_pos) + "/sysroot"; - struct stat stat_buf; - int status = stat(sysroot_path.c_str(), &stat_buf); - if (status == 0) { - return sysroot_path; - } - } - } - return ""; -} - -// Detect the host, get the host identifier (used to select a prebuilt toolchain). -// Empty string on failure. -// Typical return value: "x86_64-darwin" -string HostDouble() { - struct utsname name; - int status = uname(&name); - if (status != 0) { - return ""; - } - string dbl = string(name.machine) + "-" + string(name.sysname); - std::transform(dbl.begin(), dbl.end(), dbl.begin(), ::tolower); - return dbl; -} - -// Given the command baseline, get the llvm binary to invoke. -// Note: the "llvm-ar" special case should probably go away, as Rust no longer -// invokes an external "ar" tool, and the llvm-ar one probably wouldn't work. -// Typical return value: "clang" -string InferTool(const string& cmd) { - size_t pos = cmd.rfind('-'); - string base; - if (pos != string::npos) { - base = cmd.substr(pos + 1); - } else { - base = cmd; - } - if (base == "cc" || base == "gcc") { - return "clang"; - } else if (base == "ar") { - return "llvm-ar"; - } - return base; -} - -// Collect C-style argc/argv into a vector of strings. -vector CollectArgs(int argc, char** argv) { - vector result; - for (int i = 0; i < argc; i++) { - result.push_back(argv[i]); - } - return result; -} - -// Do "execv" given command path as a string and args as a vector of strings. -int DoExecv(const string& cmd, vector& args) { - vector argvec; - for (auto& it : args) { - argvec.push_back(it.c_str()); - } - argvec.push_back(nullptr); - char* const* argv = const_cast(argvec.data()); - return execv(cmd.c_str(), argv); -} - -void Die(const string& message) { - std::cerr << message << std::endl; - exit(1); -} - -int main(int argc, char** argv) { - string self_path = GetPath(argv[0]); - string root = FindJiriRoot(self_path); - if (root.empty()) { - Die("Can't find .jiri_root in any parent of " + self_path); - } - string host = HostDouble(); - if (host.empty()) { - Die("Can't detect host (uname failed)"); - } - string cmd = GetCmd(argv[0]); - string tool = InferTool(cmd); - string triple = TargetTriple(cmd); - vector args = CollectArgs(argc, argv); - - string newcmd = root + "buildtools/toolchain/clang+llvm-" + host + "/bin/" + tool; - string sysroot = SysrootPath(self_path); - if (sysroot.empty()) { - Die("Can't find sysroot from wrapper path"); - } - vector newargs; - newargs.push_back(newcmd); - if (tool != "llvm-ar") { - newargs.push_back("-target"); - newargs.push_back(triple); - newargs.push_back("--sysroot=" + sysroot); - } - for (auto it = args.begin() + 1; it != args.end(); ++it) { - newargs.push_back(*it); - } - int status = DoExecv(newcmd, newargs); - if (status != 0) { - Die("error invoking " + newcmd + ": " + strerror(errno)); - } - return 0; -} diff -Nru distinst-0.1.0/vendor/magenta/tools/gen_status.py distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/gen_status.py --- distinst-0.1.0/vendor/magenta/tools/gen_status.py 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/gen_status.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2016 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# A tool for autogenerating the mapping between Status and mx_status_t -# Usage: python gen_status.py magenta/system/public/magenta/errors.h {sys,enum,match} -import re -import sys - -status_re = re.compile('#define\s+(MX_\w+)\s+\((\-?\d+)\)$') - -def parse(in_filename): - result = [] - for line in file(in_filename): - m = status_re.match(line) - if m: - result.append((m.group(1), int(m.group(2)))) - return result - -def to_snake_case(name): - result = [] - for element in name.split('_'): - result.append(element[0] + element[1:].lower()) - return ''.join(result) - -def out(style, l): - print('// Auto-generated using tools/gen_status.py') - longest = max(len(name) for (name, num) in l) - if style == 'sys': - for (name, num) in l: - print('pub const %s : mx_status_t = %d;' % (name.ljust(longest), num)) - if style == 'enum': - print('pub enum Status {') - for (name, num) in l: - print(' %s = %d,' % (to_snake_case(name[3:]), num)) - print(''); - print(' /// Any mx_status_t not in the set above will map to the following:') - print(' UnknownOther = -32768,') - print('}') - if style == 'match': - for (name, num) in l: - print(' sys::%s => Status::%s,' % (name, to_snake_case(name[3:]))) - print(' _ => Status::UnknownOther,') - - -l = parse(sys.argv[1]) -out(sys.argv[2], l) diff -Nru distinst-0.1.0/vendor/magenta/tools/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/README.md --- distinst-0.1.0/vendor/magenta/tools/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta/tools/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Build tools for Rust on Fuchsia -=============================== - -This directory contains a wrapper so that clang can be invoked using a -target-specific command line (as is typically done using Gnu tools for -cross-compiling). - -To compile standalone (not part of a build system): - -``` -clang++ -O --std=c++11 clang_wrapper.cc -o clang_wrapper -ln -s clang_wrapper x86-64-unknown-fuchsia-ar -ln -s clang_wrapper x86-64-unknown-fuchsia-cc -ln -s clang_wrapper aarch64-unknown-fuchsia-ar -ln -s clang_wrapper aarch64-unknown-fuchsia-cc -``` - -The resulting binaries (`x86-64-unknown-fuchsia-cc` and the like) must be -placed somewhere under the root of the fuchsia tree. - -The wrapper sets the target triple appropriately, and also finds the -appropriate sysroot for the given target (necessary for linking). - -Note: this wrapper is provisional, hopefully to be supplanted by a more -general config mechanism in LLVM -(see [relevant LLVM patch](https://reviews.llvm.org/D24933)). diff -Nru distinst-0.1.0/vendor/magenta-sys/BUILD.gn distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/BUILD.gn --- distinst-0.1.0/vendor/magenta-sys/BUILD.gn 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/BUILD.gn 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# Copyright 2017 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/rust/rust_library.gni") - -rust_library("magenta-sys") { - deps = [ - "//third_party/rust-crates:bitflags-0.7.0", - ] -} diff -Nru distinst-0.1.0/vendor/magenta-sys/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/.cargo-checksum.json --- distinst-0.1.0/vendor/magenta-sys/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","BUILD.gn":"82ba43cb5fe3207bf054ac3dad473f4d38c1e80cb76f4c2da2f8a0010128143f","Cargo.toml":"b192e1e0a2813bb1abe96e43d2d8d77775925e03aad9fc319e749f77419f72b5","examples/hello.rs":"7787ee44bfa8a0780f089c1eddeddba94b74e38c5c397ed4a619a8e988cb34b2","src/definitions.rs":"5b561773646ae04e5f63bf58120cb521ac2b7d2557a973f04b12fdbfbc9783ed","src/lib.rs":"9a892c4f5a01ac19402c2e9caaf499829795e1cf95028a975b165de11d3291a0"},"package":"40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/magenta-sys/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/Cargo.toml --- distinst-0.1.0/vendor/magenta-sys/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -[package] -name = "magenta-sys" -version = "0.1.1" -license = "BSD-3-Clause" -authors = ["Raph Levien "] -description = "Low-level Rust bindings for the Magenta kernel" -repository = "https://fuchsia.googlesource.com/magenta-rs/" - -[dependencies] -bitflags = "0.7.0" diff -Nru distinst-0.1.0/vendor/magenta-sys/examples/hello.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/examples/hello.rs --- distinst-0.1.0/vendor/magenta-sys/examples/hello.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/examples/hello.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -extern crate magenta_sys; - -pub fn main() { - let time = unsafe { magenta_sys::mx_time_get(magenta_sys::MX_CLOCK_MONOTONIC) }; - println!("before sleep, time = {}", time); - unsafe { magenta_sys::mx_nanosleep(magenta_sys::mx_deadline_after(1000_000_000)); } - let time = unsafe { magenta_sys::mx_time_get(magenta_sys::MX_CLOCK_MONOTONIC) }; - println!("after sleep, time = {}", time); -} - diff -Nru distinst-0.1.0/vendor/magenta-sys/src/definitions.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/src/definitions.rs --- distinst-0.1.0/vendor/magenta-sys/src/definitions.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/src/definitions.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,882 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// This is a GENERATED file, see //magenta/system/host/sysgen. -// The license governing this file can be found in the LICENSE file. - -#[link(name = "magenta")] -extern { - pub fn mx_time_get( - clock_id: u32 - ) -> mx_time_t; - - pub fn mx_nanosleep( - deadline: mx_time_t - ) -> mx_status_t; - - pub fn mx_ticks_get( - ) -> u64; - - pub fn mx_ticks_per_second( - ) -> u64; - - pub fn mx_deadline_after( - nanoseconds: mx_duration_t - ) -> mx_time_t; - - pub fn mx_system_get_num_cpus( - ) -> u32; - - pub fn mx_system_get_version( - version: *mut u8, - version_len: u32 - ) -> mx_status_t; - - pub fn mx_system_get_physmem( - ) -> u64; - - pub fn mx_cache_flush( - addr: *const u8, - len: usize, - options: u32 - ) -> mx_status_t; - - pub fn mx_handle_close( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_handle_duplicate( - handle: mx_handle_t, - rights: mx_rights_t, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_handle_replace( - handle: mx_handle_t, - rights: mx_rights_t, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_object_wait_one( - handle: mx_handle_t, - waitfor: mx_signals_t, - deadline: mx_time_t, - observed: *mut mx_signals_t - ) -> mx_status_t; - - pub fn mx_object_wait_many( - items: *mut mx_wait_item_t, - count: u32, - deadline: mx_time_t - ) -> mx_status_t; - - pub fn mx_object_wait_async( - handle: mx_handle_t, - port_handle: mx_handle_t, - key: u64, - signals: mx_signals_t, - options: u32 - ) -> mx_status_t; - - pub fn mx_object_signal( - handle: mx_handle_t, - clear_mask: u32, - set_mask: u32 - ) -> mx_status_t; - - pub fn mx_object_signal_peer( - handle: mx_handle_t, - clear_mask: u32, - set_mask: u32 - ) -> mx_status_t; - - pub fn mx_object_get_property( - handle: mx_handle_t, - property: u32, - value: *mut u8, - size: usize - ) -> mx_status_t; - - pub fn mx_object_set_property( - handle: mx_handle_t, - property: u32, - value: *const u8, - size: usize - ) -> mx_status_t; - - pub fn mx_object_set_cookie( - handle: mx_handle_t, - scope: mx_handle_t, - cookie: u64 - ) -> mx_status_t; - - pub fn mx_object_get_cookie( - handle: mx_handle_t, - scope: mx_handle_t, - cookie: *mut u64 - ) -> mx_status_t; - - pub fn mx_object_get_info( - handle: mx_handle_t, - topic: u32, - buffer: *mut u8, - buffer_size: usize, - actual_count: *mut usize, - avail_count: *mut usize - ) -> mx_status_t; - - pub fn mx_object_get_child( - handle: mx_handle_t, - koid: u64, - rights: mx_rights_t, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_channel_create( - options: u32, - out0: *mut mx_handle_t, - out1: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_channel_read( - handle: mx_handle_t, - options: u32, - bytes: *mut u8, - handles: *mut mx_handle_t, - num_bytes: u32, - num_handles: u32, - actual_bytes: *mut u32, - actual_handles: *mut u32 - ) -> mx_status_t; - - pub fn mx_channel_write( - handle: mx_handle_t, - options: u32, - bytes: *const u8, - num_bytes: u32, - handles: *const mx_handle_t, - num_handles: u32 - ) -> mx_status_t; - - pub fn mx_channel_call_noretry( - handle: mx_handle_t, - options: u32, - deadline: mx_time_t, - args: *const mx_channel_call_args_t, - actual_bytes: *mut u32, - actual_handles: *mut u32, - read_status: *mut mx_status_t - ) -> mx_status_t; - - pub fn mx_channel_call_finish( - handle: mx_handle_t, - deadline: mx_time_t, - args: *const mx_channel_call_args_t, - actual_bytes: *mut u32, - actual_handles: *mut u32, - read_status: *mut mx_status_t - ) -> mx_status_t; - - pub fn mx_channel_call( - handle: mx_handle_t, - options: u32, - deadline: mx_time_t, - args: *const mx_channel_call_args_t, - actual_bytes: *mut u32, - actual_handles: *mut u32, - read_status: *mut mx_status_t - ) -> mx_status_t; - - pub fn mx_socket_create( - options: u32, - out0: *mut mx_handle_t, - out1: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_socket_write( - handle: mx_handle_t, - options: u32, - buffer: *const u8, - size: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_socket_read( - handle: mx_handle_t, - options: u32, - buffer: *mut u8, - size: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_thread_exit( - ); - - pub fn mx_thread_create( - process: mx_handle_t, - name: *const u8, - name_len: u32, - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_thread_start( - handle: mx_handle_t, - thread_entry: usize, - stack: usize, - arg1: usize, - arg2: usize - ) -> mx_status_t; - - pub fn mx_thread_read_state( - handle: mx_handle_t, - kind: u32, - buffer: *mut u8, - len: u32, - actual: *mut u32 - ) -> mx_status_t; - - pub fn mx_thread_write_state( - handle: mx_handle_t, - kind: u32, - buffer: *const u8, - buffer_len: u32 - ) -> mx_status_t; - - pub fn mx_process_exit( - retcode: isize - ); - - pub fn mx_process_create( - job: mx_handle_t, - name: *const u8, - name_len: u32, - options: u32, - proc_handle: *mut mx_handle_t, - vmar_handle: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_process_start( - process_handle: mx_handle_t, - thread_handle: mx_handle_t, - entry: usize, - stack: usize, - arg_handle: mx_handle_t, - arg2: usize - ) -> mx_status_t; - - pub fn mx_process_read_memory( - proc_: mx_handle_t, - vaddr: usize, - buffer: *mut u8, - len: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_process_write_memory( - proc_: mx_handle_t, - vaddr: usize, - buffer: *const u8, - len: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_job_create( - parent_job: mx_handle_t, - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_job_set_policy( - job: mx_handle_t, - options: u32, - topic: u32, - policy: *const u8, - count: u32 - ) -> mx_status_t; - - pub fn mx_task_bind_exception_port( - object: mx_handle_t, - eport: mx_handle_t, - key: u64, - options: u32 - ) -> mx_status_t; - - pub fn mx_task_suspend( - task_handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_task_resume( - task_handle: mx_handle_t, - options: u32 - ) -> mx_status_t; - - pub fn mx_task_kill( - task_handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_event_create( - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_eventpair_create( - options: u32, - out0: *mut mx_handle_t, - out1: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_futex_wait( - value_ptr: *mut mx_futex_t, - current_value: isize, - deadline: mx_time_t - ) -> mx_status_t; - - pub fn mx_futex_wake( - value_ptr: *const mx_futex_t, - count: u32 - ) -> mx_status_t; - - pub fn mx_futex_requeue( - wake_ptr: *mut mx_futex_t, - wake_count: u32, - current_value: isize, - requeue_ptr: *mut mx_futex_t, - requeue_count: u32 - ) -> mx_status_t; - - pub fn mx_port_create( - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_port_queue( - handle: mx_handle_t, - packet: *const u8, - size: usize - ) -> mx_status_t; - - pub fn mx_port_wait( - handle: mx_handle_t, - deadline: mx_time_t, - packet: *mut u8, - size: usize - ) -> mx_status_t; - - pub fn mx_port_cancel( - handle: mx_handle_t, - source: mx_handle_t, - key: u64 - ) -> mx_status_t; - - pub fn mx_timer_create( - options: u32, - clock_id: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_timer_start( - handle: mx_handle_t, - deadline: mx_time_t, - period: mx_duration_t, - slack: mx_duration_t - ) -> mx_status_t; - - pub fn mx_timer_cancel( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_vmo_create( - size: u64, - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_vmo_read( - handle: mx_handle_t, - data: *mut u8, - offset: u64, - len: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_vmo_write( - handle: mx_handle_t, - data: *const u8, - offset: u64, - len: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_vmo_get_size( - handle: mx_handle_t, - size: *mut u64 - ) -> mx_status_t; - - pub fn mx_vmo_set_size( - handle: mx_handle_t, - size: u64 - ) -> mx_status_t; - - pub fn mx_vmo_op_range( - handle: mx_handle_t, - op: u32, - offset: u64, - size: u64, - buffer: *mut u8, - buffer_size: usize - ) -> mx_status_t; - - pub fn mx_vmo_clone( - handle: mx_handle_t, - options: u32, - offset: u64, - size: u64, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_vmo_set_cache_policy( - handle: mx_handle_t, - cache_policy: u32 - ) -> mx_status_t; - - pub fn mx_vmar_allocate( - parent_vmar_handle: mx_handle_t, - offset: usize, - size: usize, - map_flags: u32, - child_vmar: *mut mx_handle_t, - child_addr: *mut usize - ) -> mx_status_t; - - pub fn mx_vmar_destroy( - vmar_handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_vmar_map( - vmar_handle: mx_handle_t, - vmar_offset: usize, - vmo_handle: mx_handle_t, - vmo_offset: u64, - len: usize, - map_flags: u32, - mapped_addr: *mut usize - ) -> mx_status_t; - - pub fn mx_vmar_unmap( - vmar_handle: mx_handle_t, - addr: usize, - len: usize - ) -> mx_status_t; - - pub fn mx_vmar_protect( - vmar_handle: mx_handle_t, - addr: usize, - len: usize, - prot_flags: u32 - ) -> mx_status_t; - - pub fn mx_cprng_draw( - buffer: *mut u8, - len: usize, - actual: *mut usize - ) -> mx_status_t; - - pub fn mx_cprng_add_entropy( - buffer: *const u8, - len: usize - ) -> mx_status_t; - - pub fn mx_fifo_create( - elem_count: u32, - elem_size: u32, - options: u32, - out0: *mut mx_handle_t, - out1: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_fifo_read( - handle: mx_handle_t, - data: *mut u8, - len: usize, - num_written: *mut u32 - ) -> mx_status_t; - - pub fn mx_fifo_write( - handle: mx_handle_t, - data: *const u8, - len: usize, - num_written: *mut u32 - ) -> mx_status_t; - - pub fn mx_vmar_unmap_handle_close_thread_exit( - vmar_handle: mx_handle_t, - addr: usize, - len: usize, - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_futex_wake_handle_close_thread_exit( - value_ptr: *const mx_futex_t, - count: u32, - new_value: isize, - handle: mx_handle_t - ); - - pub fn mx_log_create( - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_log_write( - handle: mx_handle_t, - len: u32, - buffer: *const u8, - options: u32 - ) -> mx_status_t; - - pub fn mx_log_read( - handle: mx_handle_t, - len: u32, - buffer: *mut u8, - options: u32 - ) -> mx_status_t; - - pub fn mx_ktrace_read( - handle: mx_handle_t, - data: *mut u8, - offset: u32, - len: u32, - actual: *mut u32 - ) -> mx_status_t; - - pub fn mx_ktrace_control( - handle: mx_handle_t, - action: u32, - options: u32, - ptr: *mut u8 - ) -> mx_status_t; - - pub fn mx_ktrace_write( - handle: mx_handle_t, - id: u32, - arg0: u32, - arg1: u32 - ) -> mx_status_t; - - pub fn mx_mtrace_control( - handle: mx_handle_t, - kind: u32, - action: u32, - options: u32, - ptr: *mut u8, - size: u32 - ) -> mx_status_t; - - pub fn mx_debug_read( - handle: mx_handle_t, - buffer: *mut u8, - length: u32 - ) -> mx_status_t; - - pub fn mx_debug_write( - buffer: *const u8, - length: u32 - ) -> mx_status_t; - - pub fn mx_debug_send_command( - resource_handle: mx_handle_t, - buffer: *const u8, - length: u32 - ) -> mx_status_t; - - pub fn mx_interrupt_create( - handle: mx_handle_t, - vector: u32, - options: u32 - ) -> mx_handle_t; - - pub fn mx_interrupt_complete( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_interrupt_wait( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_interrupt_signal( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_mmap_device_io( - handle: mx_handle_t, - io_addr: u32, - len: u32 - ) -> mx_status_t; - - pub fn mx_mmap_device_memory( - handle: mx_handle_t, - paddr: mx_paddr_t, - len: u32, - cache_policy: mx_cache_policy_t, - out_vaddr: *mut usize - ) -> mx_status_t; - - pub fn mx_io_mapping_get_info( - handle: mx_handle_t, - out_vaddr: *mut usize, - out_size: *mut u64 - ) -> mx_status_t; - - pub fn mx_vmo_create_contiguous( - rsrc_handle: mx_handle_t, - size: usize, - alignment_log2: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_bootloader_fb_get_info( - format: *mut u32, - width: *mut u32, - height: *mut u32, - stride: *mut u32 - ) -> mx_status_t; - - pub fn mx_set_framebuffer( - handle: mx_handle_t, - vaddr: *mut u8, - len: u32, - format: u32, - width: u32, - height: u32, - stride: u32 - ) -> mx_status_t; - - pub fn mx_set_framebuffer_vmo( - handle: mx_handle_t, - vmo: mx_handle_t, - len: u32, - format: u32, - width: u32, - height: u32, - stride: u32 - ) -> mx_status_t; - - pub fn mx_clock_adjust( - handle: mx_handle_t, - clock_id: u32, - offset: i64 - ) -> mx_status_t; - - pub fn mx_pci_get_nth_device( - handle: mx_handle_t, - index: u32, - out_info: *mut mx_pcie_device_info_t - ) -> mx_handle_t; - - pub fn mx_pci_enable_bus_master( - handle: mx_handle_t, - enable: bool - ) -> mx_status_t; - - pub fn mx_pci_enable_pio( - handle: mx_handle_t, - enable: bool - ) -> mx_status_t; - - pub fn mx_pci_reset_device( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_pci_get_bar( - handle: mx_handle_t, - bar_num: u32, - out_bar: *mut mx_pci_resource_t - ) -> mx_status_t; - - pub fn mx_pci_get_config( - handle: mx_handle_t, - out_config: *mut mx_pci_resource_t - ) -> mx_status_t; - - pub fn mx_pci_io_write( - handle: mx_handle_t, - bar_num: u32, - offset: u32, - len: u32, - value: u32 - ) -> mx_status_t; - - pub fn mx_pci_io_read( - handle: mx_handle_t, - bar_num: u32, - offset: u32, - len: u32, - out_value: *mut u32 - ) -> mx_status_t; - - pub fn mx_pci_map_interrupt( - handle: mx_handle_t, - which_irq: i32, - out_handle: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_pci_query_irq_mode_caps( - handle: mx_handle_t, - mode: u32, - out_max_irqs: *mut u32 - ) -> mx_status_t; - - pub fn mx_pci_set_irq_mode( - handle: mx_handle_t, - mode: u32, - requested_irq_count: u32 - ) -> mx_status_t; - - pub fn mx_pci_init( - handle: mx_handle_t, - init_buf: *const mx_pci_init_arg_t, - len: u32 - ) -> mx_status_t; - - pub fn mx_pci_add_subtract_io_range( - handle: mx_handle_t, - mmio: bool, - base: u64, - len: u64, - add: bool - ) -> mx_status_t; - - pub fn mx_acpi_uefi_rsdp( - handle: mx_handle_t - ) -> u64; - - pub fn mx_acpi_cache_flush( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_resource_create( - parent_handle: mx_handle_t, - records: *const mx_rrec_t, - count: u32, - resource_out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_resource_destroy( - handle: mx_handle_t - ) -> mx_status_t; - - pub fn mx_resource_get_handle( - handle: mx_handle_t, - index: u32, - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_resource_do_action( - handle: mx_handle_t, - index: u32, - action: u32, - arg0: u32, - arg1: u32 - ) -> mx_status_t; - - pub fn mx_resource_connect( - handle: mx_handle_t, - channel: mx_handle_t - ) -> mx_status_t; - - pub fn mx_resource_accept( - handle: mx_handle_t, - channel: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_hypervisor_create( - handle: mx_handle_t, - options: u32, - out: *mut mx_handle_t - ) -> mx_status_t; - - pub fn mx_hypervisor_op( - handle: mx_handle_t, - opcode: u32, - args: *const u8, - args_len: u32, - result: *mut u8, - result_len: u32 - ) -> mx_status_t; - - pub fn mx_system_mexec( - kernel: mx_handle_t, - bootimage: mx_handle_t - ) -> mx_status_t; - - pub fn mx_syscall_test_0( - ) -> mx_status_t; - - pub fn mx_syscall_test_1( - a: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_2( - a: isize, - b: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_3( - a: isize, - b: isize, - c: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_4( - a: isize, - b: isize, - c: isize, - d: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_5( - a: isize, - b: isize, - c: isize, - d: isize, - e: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_6( - a: isize, - b: isize, - c: isize, - d: isize, - e: isize, - f: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_7( - a: isize, - b: isize, - c: isize, - d: isize, - e: isize, - f: isize, - g: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_8( - a: isize, - b: isize, - c: isize, - d: isize, - e: isize, - f: isize, - g: isize, - h: isize - ) -> mx_status_t; - - pub fn mx_syscall_test_wrapper( - a: isize, - b: isize, - c: isize - ) -> mx_status_t; - - -} diff -Nru distinst-0.1.0/vendor/magenta-sys/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/src/lib.rs --- distinst-0.1.0/vendor/magenta-sys/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/magenta-sys/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,330 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#![allow(non_camel_case_types)] - -extern crate core; - -#[macro_use] -extern crate bitflags; - -pub type mx_handle_t = i32; - -pub type mx_status_t = i32; - -pub type mx_futex_t = isize; -pub type mx_paddr_t = usize; - -// Auto-generated using tools/gen_status.py -pub const MX_OK : mx_status_t = 0; -pub const MX_ERR_INTERNAL : mx_status_t = -1; -pub const MX_ERR_NOT_SUPPORTED : mx_status_t = -2; -pub const MX_ERR_NO_RESOURCES : mx_status_t = -3; -pub const MX_ERR_NO_MEMORY : mx_status_t = -4; -pub const MX_ERR_CALL_FAILED : mx_status_t = -5; -pub const MX_ERR_INTERRUPTED_RETRY : mx_status_t = -6; -pub const MX_ERR_INVALID_ARGS : mx_status_t = -10; -pub const MX_ERR_BAD_HANDLE : mx_status_t = -11; -pub const MX_ERR_WRONG_TYPE : mx_status_t = -12; -pub const MX_ERR_BAD_SYSCALL : mx_status_t = -13; -pub const MX_ERR_OUT_OF_RANGE : mx_status_t = -14; -pub const MX_ERR_BUFFER_TOO_SMALL : mx_status_t = -15; -pub const MX_ERR_BAD_STATE : mx_status_t = -20; -pub const MX_ERR_TIMED_OUT : mx_status_t = -21; -pub const MX_ERR_SHOULD_WAIT : mx_status_t = -22; -pub const MX_ERR_CANCELED : mx_status_t = -23; -pub const MX_ERR_PEER_CLOSED : mx_status_t = -24; -pub const MX_ERR_NOT_FOUND : mx_status_t = -25; -pub const MX_ERR_ALREADY_EXISTS : mx_status_t = -26; -pub const MX_ERR_ALREADY_BOUND : mx_status_t = -27; -pub const MX_ERR_UNAVAILABLE : mx_status_t = -28; -pub const MX_ERR_ACCESS_DENIED : mx_status_t = -30; -pub const MX_ERR_IO : mx_status_t = -40; -pub const MX_ERR_IO_REFUSED : mx_status_t = -41; -pub const MX_ERR_IO_DATA_INTEGRITY : mx_status_t = -42; -pub const MX_ERR_IO_DATA_LOSS : mx_status_t = -43; -pub const MX_ERR_BAD_PATH : mx_status_t = -50; -pub const MX_ERR_NOT_DIR : mx_status_t = -51; -pub const MX_ERR_NOT_FILE : mx_status_t = -52; -pub const MX_ERR_FILE_BIG : mx_status_t = -53; -pub const MX_ERR_NO_SPACE : mx_status_t = -54; -pub const MX_ERR_STOP : mx_status_t = -60; -pub const MX_ERR_NEXT : mx_status_t = -61; - -pub type mx_time_t = u64; -pub type mx_duration_t = u64; -pub const MX_TIME_INFINITE : mx_time_t = core::u64::MAX; - -bitflags! { - #[repr(C)] - pub flags mx_signals_t: u32 { - const MX_SIGNAL_NONE = 0, - const MX_OBJECT_SIGNAL_ALL = 0x00ffffff, - const MX_USER_SIGNAL_ALL = 0xff000000, - const MX_OBJECT_SIGNAL_0 = 1 << 0, - const MX_OBJECT_SIGNAL_1 = 1 << 1, - const MX_OBJECT_SIGNAL_2 = 1 << 2, - const MX_OBJECT_SIGNAL_3 = 1 << 3, - const MX_OBJECT_SIGNAL_4 = 1 << 4, - const MX_OBJECT_SIGNAL_5 = 1 << 5, - const MX_OBJECT_SIGNAL_6 = 1 << 6, - const MX_OBJECT_SIGNAL_7 = 1 << 7, - const MX_OBJECT_SIGNAL_8 = 1 << 8, - const MX_OBJECT_SIGNAL_9 = 1 << 9, - const MX_OBJECT_SIGNAL_10 = 1 << 10, - const MX_OBJECT_SIGNAL_11 = 1 << 11, - const MX_OBJECT_SIGNAL_12 = 1 << 12, - const MX_OBJECT_SIGNAL_13 = 1 << 13, - const MX_OBJECT_SIGNAL_14 = 1 << 14, - const MX_OBJECT_SIGNAL_15 = 1 << 15, - const MX_OBJECT_SIGNAL_16 = 1 << 16, - const MX_OBJECT_SIGNAL_17 = 1 << 17, - const MX_OBJECT_SIGNAL_18 = 1 << 18, - const MX_OBJECT_SIGNAL_19 = 1 << 19, - const MX_OBJECT_SIGNAL_20 = 1 << 20, - const MX_OBJECT_SIGNAL_21 = 1 << 21, - const MX_OBJECT_LAST_HANDLE = 1 << 22, - const MX_OBJECT_HANDLE_CLOSED = 1 << 23, - const MX_USER_SIGNAL_0 = 1 << 24, - const MX_USER_SIGNAL_1 = 1 << 25, - const MX_USER_SIGNAL_2 = 1 << 26, - const MX_USER_SIGNAL_3 = 1 << 27, - const MX_USER_SIGNAL_4 = 1 << 28, - const MX_USER_SIGNAL_5 = 1 << 29, - const MX_USER_SIGNAL_6 = 1 << 30, - const MX_USER_SIGNAL_7 = 1 << 31, - - const MX_OBJECT_READABLE = MX_OBJECT_SIGNAL_0.bits, - const MX_OBJECT_WRITABLE = MX_OBJECT_SIGNAL_1.bits, - const MX_OBJECT_PEER_CLOSED = MX_OBJECT_SIGNAL_2.bits, - - // Cancelation (handle was closed while waiting with it) - const MX_SIGNAL_HANDLE_CLOSED = MX_OBJECT_HANDLE_CLOSED.bits, - - // Only one user-more reference (handle) to the object exists. - const MX_SIGNAL_LAST_HANDLE = MX_OBJECT_LAST_HANDLE.bits, - - // Event - const MX_EVENT_SIGNALED = MX_OBJECT_SIGNAL_3.bits, - - // EventPair - const MX_EPAIR_SIGNALED = MX_OBJECT_SIGNAL_3.bits, - const MX_EPAIR_CLOSED = MX_OBJECT_SIGNAL_2.bits, - - // Task signals (process, thread, job) - const MX_TASK_TERMINATED = MX_OBJECT_SIGNAL_3.bits, - - // Channel - const MX_CHANNEL_READABLE = MX_OBJECT_SIGNAL_0.bits, - const MX_CHANNEL_WRITABLE = MX_OBJECT_SIGNAL_1.bits, - const MX_CHANNEL_PEER_CLOSED = MX_OBJECT_SIGNAL_2.bits, - - // Socket - const MX_SOCKET_READABLE = MX_OBJECT_SIGNAL_0.bits, - const MX_SOCKET_WRITABLE = MX_OBJECT_SIGNAL_1.bits, - const MX_SOCKET_PEER_CLOSED = MX_OBJECT_SIGNAL_2.bits, - - // Port - const MX_PORT_READABLE = MX_OBJECT_READABLE.bits, - - // Resource - const MX_RESOURCE_DESTROYED = MX_OBJECT_SIGNAL_3.bits, - const MX_RESOURCE_READABLE = MX_OBJECT_READABLE.bits, - const MX_RESOURCE_WRITABLE = MX_OBJECT_WRITABLE.bits, - const MX_RESOURCE_CHILD_ADDED = MX_OBJECT_SIGNAL_4.bits, - - // Fifo - const MX_FIFO_READABLE = MX_OBJECT_READABLE.bits, - const MX_FIFO_WRITABLE = MX_OBJECT_WRITABLE.bits, - const MX_FIFO_PEER_CLOSED = MX_OBJECT_PEER_CLOSED.bits, - - // Job - const MX_JOB_NO_PROCESSES = MX_OBJECT_SIGNAL_3.bits, - const MX_JOB_NO_JOBS = MX_OBJECT_SIGNAL_4.bits, - - // Process - const MX_PROCESS_TERMINATED = MX_OBJECT_SIGNAL_3.bits, - - // Thread - const MX_THREAD_TERMINATED = MX_OBJECT_SIGNAL_3.bits, - - // Log - const MX_LOG_READABLE = MX_OBJECT_READABLE.bits, - const MX_LOG_WRITABLE = MX_OBJECT_WRITABLE.bits, - - // Timer - const MX_TIMER_SIGNALED = MX_OBJECT_SIGNAL_3.bits, - } -} - -pub type mx_size_t = usize; -pub type mx_ssize_t = isize; - -bitflags! { - #[repr(C)] - pub flags mx_rights_t: u32 { - const MX_RIGHT_NONE = 0, - const MX_RIGHT_DUPLICATE = 1 << 0, - const MX_RIGHT_TRANSFER = 1 << 1, - const MX_RIGHT_READ = 1 << 2, - const MX_RIGHT_WRITE = 1 << 3, - const MX_RIGHT_EXECUTE = 1 << 4, - const MX_RIGHT_MAP = 1 << 5, - const MX_RIGHT_GET_PROPERTY = 1 << 6, - const MX_RIGHT_SET_PROPERTY = 1 << 7, - const MX_RIGHT_DEBUG = 1 << 8, - const MX_RIGHT_SAME_RIGHTS = 1 << 31, - } -} - -// clock ids -pub const MX_CLOCK_MONOTONIC: u32 = 0; - -// Buffer size limits on the cprng syscalls -pub const MX_CPRNG_DRAW_MAX_LEN: usize = 256; -pub const MX_CPRNG_ADD_ENTROPY_MAX_LEN: usize = 256; - -// Socket flags and limits. -pub const MX_SOCKET_HALF_CLOSE: u32 = 1; - -// VM Object opcodes -pub const MX_VMO_OP_COMMIT: u32 = 1; -pub const MX_VMO_OP_DECOMMIT: u32 = 2; -pub const MX_VMO_OP_LOCK: u32 = 3; -pub const MX_VMO_OP_UNLOCK: u32 = 4; -pub const MX_VMO_OP_LOOKUP: u32 = 5; -pub const MX_VMO_OP_CACHE_SYNC: u32 = 6; -pub const MX_VMO_OP_CACHE_INVALIDATE: u32 = 7; -pub const MX_VMO_OP_CACHE_CLEAN: u32 = 8; -pub const MX_VMO_OP_CACHE_CLEAN_INVALIDATE: u32 = 9; - -// VM Object clone flags -pub const MX_VMO_CLONE_COPY_ON_WRITE: u32 = 1; - -#[repr(C)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum mx_cache_policy_t { - MX_CACHE_POLICY_CACHED = 0, - MX_CACHE_POLICY_UNCACHED = 1, - MX_CACHE_POLICY_UNCACHED_DEVICE = 2, - MX_CACHE_POLICY_WRITE_COMBINING = 3, -} - -#[repr(C)] -pub struct mx_wait_item_t { - pub handle: mx_handle_t, - pub waitfor: mx_signals_t, - pub pending: mx_signals_t, -} - -#[repr(C)] -pub struct mx_waitset_result_t { - pub cookie: u64, - pub status: mx_status_t, - pub observed: mx_signals_t, -} - -#[repr(C)] -pub struct mx_channel_call_args_t { - pub wr_bytes: *const u8, - pub wr_handles: *const mx_handle_t, - pub rd_bytes: *mut u8, - pub rd_handles: *mut mx_handle_t, - pub wr_num_bytes: u32, - pub wr_num_handles: u32, - pub rd_num_bytes: u32, - pub rd_num_handles: u32, -} - -pub type mx_pci_irq_swizzle_lut_t = [[[u32; 4]; 8]; 32]; - -#[repr(C)] -pub struct mx_pci_init_arg_t { - pub dev_pin_to_global_irq: mx_pci_irq_swizzle_lut_t, - pub num_irqs: u32, - pub irqs: [mx_irq_t; 32], - pub ecam_window_count: u32, - // Note: the ecam_windows field is actually a variable size array. - // We use a fixed size array to match the C repr. - pub ecam_windows: [mx_ecam_window_t; 1], -} - -#[repr(C)] -pub struct mx_irq_t { - pub global_irq: u32, - pub level_triggered: bool, - pub active_high: bool, -} - -#[repr(C)] -pub struct mx_ecam_window_t { - pub base: u64, - pub size: usize, - pub bus_start: u8, - pub bus_end: u8, -} - -#[repr(C)] -pub struct mx_pcie_device_info_t { - pub vendor_id: u16, - pub device_id: u16, - pub base_class: u8, - pub sub_class: u8, - pub program_interface: u8, - pub revision_id: u8, - pub bus_id: u8, - pub dev_id: u8, - pub func_id: u8, -} - -#[repr(C)] -pub struct mx_pci_resource_t { - pub type_: u32, - pub size: usize, - // TODO: Actually a union - pub pio_addr: usize, -} - -// TODO: Actually a union -pub type mx_rrec_t = [u8; 64]; - -// Ports V2 -#[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub enum mx_packet_type_t { - MX_PKT_TYPE_USER = 0, - MX_PKT_TYPE_SIGNAL_ONE = 1, - MX_PKT_TYPE_SIGNAL_REP = 2, -} - -impl Default for mx_packet_type_t { - fn default() -> Self { - mx_packet_type_t::MX_PKT_TYPE_USER - } -} - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mx_packet_signal_t { - pub trigger: mx_signals_t, - pub observed: mx_signals_t, - pub count: u64, -} - -pub const MX_WAIT_ASYNC_ONCE: u32 = 0; -pub const MX_WAIT_ASYNC_REPEATING: u32 = 1; - -// Actually a union of different integer types, but this should be good enough. -pub type mx_packet_user_t = [u8; 32]; - -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, Eq, PartialEq)] -pub struct mx_port_packet_t { - pub key: u64, - pub packet_type: mx_packet_type_t, - pub status: i32, - pub union: [u8; 32], -} - -include!("definitions.rs"); diff -Nru distinst-0.1.0/vendor/moz-cheddar/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/.cargo-checksum.json --- distinst-0.1.0/vendor/moz-cheddar/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"1a4ca81ee819190aa0ccdf3d96f50a570a4f91b80f3dee8a243aa56aaa36b34c","CHANGELOG.md":"1824a42e2ef90dfb6d82370297639fad38441e12d705190f0afcc66491e35b03","Cargo.toml":"75ec109e0c1ca9744468e5ed375cea08a47889cb2099edc3cea6c818e566cc7d","README.md":"69b719555c7ca44ba15ae75ff04008aeb9e41d12c24ee93e5bf9ed7bdd7f0732","README.tpl":"d59c4c69495c1f52cf185ad832744d61c11c0cfc76fc78eb4ee0ba3e7d74baff","examples/pointer.rs":"25ab2c672a5a0d4e7a237c138fa02532d535fcb7413b815f62c4467edbc38aab","examples/stack.rs":"377f229794333353a3e558d395d967d42836104567b642fa342aa80bd22b3959","on-nightly":"a71426acb58acb75ea02df7eb883c94d33506251ea414e0d72aac5a1e4397cd6","src/bin/cheddar.rs":"499397f31dc14ea66874f5524570f86e6f5047b9b7ddc718853c4a36f2df97e8","src/lib.rs":"21abeef012d52cc86a4c456a070b54d0783bef6669999f6eb3e11b8fc4871bcf","src/parse.rs":"0fecb96f25c7abe0b976fcaa9b768a7721c932a991c756e16be309643d6adb97","src/types.rs":"e76613bb289a1a64a670776fa05f685215e6445190e9141e006b77afd6a77d30","tests/cmp_header.py":"656737152b66da8bbdf361b3d899620dec2efff1a8023340637b16fc58dc7cec","tests/lib.rs":"363321ac6c3e801aa9566c30a64f97009f7f4f27fb43d2573dc3903373faab3a"},"package":"e2ea88fbe82964741aa3b57ec5c34d8808aa5c7e058bb9781add200d391063ab"} \ No newline at end of file +{"files":{".travis.yml":"1a4ca81ee819190aa0ccdf3d96f50a570a4f91b80f3dee8a243aa56aaa36b34c","CHANGELOG.md":"9349f0b10543790ce065d66e614b268b3e9d5efabc7c5497d8aa1caa1a60f296","Cargo.toml":"ee458158252d1ae01a2ea3a398efa6fd0d64af92f40a24ea3f0897c391ede929","README.md":"69b719555c7ca44ba15ae75ff04008aeb9e41d12c24ee93e5bf9ed7bdd7f0732","README.tpl":"d59c4c69495c1f52cf185ad832744d61c11c0cfc76fc78eb4ee0ba3e7d74baff","examples/pointer.rs":"25ab2c672a5a0d4e7a237c138fa02532d535fcb7413b815f62c4467edbc38aab","examples/stack.rs":"377f229794333353a3e558d395d967d42836104567b642fa342aa80bd22b3959","on-nightly":"a71426acb58acb75ea02df7eb883c94d33506251ea414e0d72aac5a1e4397cd6","src/bin/cheddar.rs":"499397f31dc14ea66874f5524570f86e6f5047b9b7ddc718853c4a36f2df97e8","src/lib.rs":"21abeef012d52cc86a4c456a070b54d0783bef6669999f6eb3e11b8fc4871bcf","src/parse.rs":"0fecb96f25c7abe0b976fcaa9b768a7721c932a991c756e16be309643d6adb97","src/types.rs":"e76613bb289a1a64a670776fa05f685215e6445190e9141e006b77afd6a77d30","tests/cmp_header.py":"656737152b66da8bbdf361b3d899620dec2efff1a8023340637b16fc58dc7cec","tests/lib.rs":"363321ac6c3e801aa9566c30a64f97009f7f4f27fb43d2573dc3903373faab3a"},"package":"43b29fdad80b06f38d959105a138ab8ca8c5a57c3435f5bfbd770fa73e625015"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/moz-cheddar/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/Cargo.toml --- distinst-0.1.0/vendor/moz-cheddar/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,25 +1,26 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + [package] name = "moz-cheddar" -version = "0.4.1" -authors = ["Sean Marshallsay ", - "Matthew Gregan "] - +version = "0.4.2" +authors = ["Sean Marshallsay ", "Matthew Gregan "] description = "A library to automatically generate C header files from Rust source files." -readme = "README.md" -keywords = ["c", "header", "ffi"] - homepage = "https://github.com/mozilla/moz-cheddar" -repository = "https://github.com/mozilla/moz-cheddar" documentation = "https://docs.rs/moz-cheddar" - +readme = "README.md" +keywords = ["c", "header", "ffi"] license = "MIT" - -[features] -default = ["with-syntex"] -with-syntex = [ - "syntex_errors", - "syntex_syntax", -] +repository = "https://github.com/mozilla/moz-cheddar" [lib] name = "cheddar" @@ -27,11 +28,22 @@ [[bin]] name = "cheddar" -doc = false path = "src/bin/cheddar.rs" +doc = false +[dependencies.syntex_errors] +version = "0.58.1" +optional = true + +[dependencies.toml] +version = "0.4" + +[dependencies.syntex_syntax] +version = "0.58.1" +optional = true + +[dependencies.clap] +version = "2" -[dependencies] -syntex_errors = {version = "0.58.1", optional = true} -syntex_syntax = {version = "0.58.1", optional = true} -toml = "0.3.2" -clap = "2" +[features] +with-syntex = ["syntex_errors", "syntex_syntax"] +default = ["with-syntex"] diff -Nru distinst-0.1.0/vendor/moz-cheddar/CHANGELOG.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/CHANGELOG.md --- distinst-0.1.0/vendor/moz-cheddar/CHANGELOG.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/moz-cheddar/CHANGELOG.md 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,11 @@ # [master] +# [0.4.2] - 2017-11-08 + +## Fixed + +- Bump toml dependency version to 0.4. + # [0.4.1] - 2017-04-11 ## Fixed diff -Nru distinst-0.1.0/vendor/pbr/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/pbr/.cargo-checksum.json --- distinst-0.1.0/vendor/pbr/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/pbr/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"c997e5eaf84bfb89c8c81cbf924d52a79b57f0ca7eef67514b780520f1d7fdfc","LICENSE.md":"7e1519685956c3d84d4d0ef36c8b00836e8f3d20c5c6c3770634875f8ae32555","README.md":"82513a6044ab8423c0c90b4ba1554079e32e533cdffbcdf531d1272407511a69","examples/max_refresh_rate.rs":"4560e672fb37797909cf0d20a1359a1bd739ec55dd4b13cab5eadddf42fc63b1","examples/multi.rs":"e2c70e27cd9c1e34914ea8aadc7f08520b8e0c56af196b5013f95e411a5e14d3","examples/npm_bar.rs":"c0dcfce0f6787ce0bcdd4c7705e1208b6c158e393a956349d56a33f5a8601038","examples/simple.rs":"4104c0ddb17520b155083d040576c3fe34218b8d7483a1985a8d5f4cf9f2ba91","gif/rec_v1.gif":"acae2075fe432076df121ed554fbb21941460aa18c42a1c7e8c9fea694914c6f","gif/rec_v2.gif":"f9c23e7d0e598cf0b6426a347cfba7be998e808638344fd2809f40c836ea7a7d","gif/rec_v3.gif":"bce28f9f1c5eb0c7377071dae42fd2281531ad93a847af8e476e88cbc2601989","src/lib.rs":"c3cbb0748cd46ff363e2c92fed413e33b42dc912a7888d5529d840d356feb31f","src/multi.rs":"cfb5b2e8364d944b910d44e861abe9760808e6a786bb61ae6624e80000ae2917","src/pb.rs":"0133e26d99e7db4ef5038846c8ae70a9b3d6003e22a7bccc845fb9f16aeab6b7","src/tty/mod.rs":"c730e1cf919a6efb118f3b2e337c92630a184b7ca31d1fa900f1ecb969b9c1be","src/tty/unix.rs":"385a164cd823e4064944c84a1eb3fb96360d8068ffddf2bfdd13ea5375e40a25","src/tty/windows.rs":"1276d18dea93691a41514db9e91160811006c4892d4d53bf804935a8c745fdc6","tests/lib.rs":"a51355e95e712055b79cfe99ba63438d5869fc8275534ea55c840f2926e581dc"},"package":"e048e3afebb6c454bb1c5d0fe73fda54698b4715d78ed8e7302447c37736d23a"} \ No newline at end of file +{"files":{"Cargo.toml":"c997e5eaf84bfb89c8c81cbf924d52a79b57f0ca7eef67514b780520f1d7fdfc","LICENSE.md":"7e1519685956c3d84d4d0ef36c8b00836e8f3d20c5c6c3770634875f8ae32555","README.md":"82513a6044ab8423c0c90b4ba1554079e32e533cdffbcdf531d1272407511a69","examples/max_refresh_rate.rs":"4560e672fb37797909cf0d20a1359a1bd739ec55dd4b13cab5eadddf42fc63b1","examples/multi.rs":"e2c70e27cd9c1e34914ea8aadc7f08520b8e0c56af196b5013f95e411a5e14d3","examples/npm_bar.rs":"c0dcfce0f6787ce0bcdd4c7705e1208b6c158e393a956349d56a33f5a8601038","examples/simple.rs":"4104c0ddb17520b155083d040576c3fe34218b8d7483a1985a8d5f4cf9f2ba91","gif/rec_v1.gif":"acae2075fe432076df121ed554fbb21941460aa18c42a1c7e8c9fea694914c6f","gif/rec_v2.gif":"f9c23e7d0e598cf0b6426a347cfba7be998e808638344fd2809f40c836ea7a7d","gif/rec_v3.gif":"bce28f9f1c5eb0c7377071dae42fd2281531ad93a847af8e476e88cbc2601989","src/lib.rs":"c3cbb0748cd46ff363e2c92fed413e33b42dc912a7888d5529d840d356feb31f","src/multi.rs":"cfb5b2e8364d944b910d44e861abe9760808e6a786bb61ae6624e80000ae2917","src/pb.rs":"0133e26d99e7db4ef5038846c8ae70a9b3d6003e22a7bccc845fb9f16aeab6b7","src/tty/mod.rs":"c730e1cf919a6efb118f3b2e337c92630a184b7ca31d1fa900f1ecb969b9c1be","src/tty/unix.rs":"385a164cd823e4064944c84a1eb3fb96360d8068ffddf2bfdd13ea5375e40a25","src/tty/windows.rs":"1276d18dea93691a41514db9e91160811006c4892d4d53bf804935a8c745fdc6","tests/lib.rs":"a51355e95e712055b79cfe99ba63438d5869fc8275534ea55c840f2926e581dc"},"package":"e048e3afebb6c454bb1c5d0fe73fda54698b4715d78ed8e7302447c37736d23a"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/rand/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/.cargo-checksum.json --- distinst-0.1.0/vendor/rand/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"c5edd03cb5679918a6d85f64c0a634ed83022ff85ea78f440f39fd281bd29c02","Cargo.toml":"779bc46f20c1aa25ffc135304a16ff094fe82cbadd11b3d994c0063763968c60","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"2dae44d53781dd79658039fb115e58a2052136ded4272e31fdee5313263270bc","appveyor.yml":"6bf2f0c8f17d2dc4957dd39aba9a88ced3130200cf847a76d47b6c8fdcc2cbd8","benches/bench.rs":"2d3481c524841c532b9b9705073b223fd4b308c86ed7c9188b7fcd8e595ad459","benches/distributions/exponential.rs":"99cb59c013a0b6bb390d34c5649b341fc3b88ea7df0caf2470bdda8798f9fe3d","benches/distributions/gamma.rs":"3533f311e4b55d743c5b01a7eb6529c94fd97726ef6702a6372f914f5f33666b","benches/distributions/mod.rs":"0028f1cb96f61152ed5b49a4fe91227d809ef6d19035592c36032a538af7f95e","benches/distributions/normal.rs":"4e10c18cb583ccb96301ea953c8e0aa9ee3b6662060271d1b8d19ca23364dc6b","src/chacha.rs":"529c20ca1eff845da4cdca9ac995bcb8e698e48a61fbae91f09e3b4600ac57c3","src/distributions/exponential.rs":"103c8412c8a581b71835f1c00e40f6370e7702adf9d499243933a793d132d4e7","src/distributions/gamma.rs":"8403bce8e78a42eda20578329d4f5e7ccbb86139a39d6efbd2d37b698d36e946","src/distributions/mod.rs":"2c042ad7d0d53f9c54c02d11e1e623bca8906785cf4264ad708fa05420724f52","src/distributions/normal.rs":"1562b43f80e4d5f83a8deb5af18de5a18dfeeeeda11fefc577da26672b14c949","src/distributions/range.rs":"c0ac6858d6a3979de7996feca22d190fde0bfb6f758d43030efa04a1a0fdcc17","src/distributions/ziggurat_tables.rs":"4eacf94fc352c91c455a6623de6a721e53842e1690f13a5662b6a79c7fbb73de","src/isaac.rs":"1725114b2d63c6fe4c0f4f7e0c36fc993a47f0322350d13abc631b0806bb71ed","src/lib.rs":"e3470f49b8ba85b590bd4375ff0d90874916cf0296637a6639a22c2a4301c3bf","src/os.rs":"7c217445373e19d64710e3d0257b9dd6d94ddaabfa52712272bd9c2908bc775d","src/rand_impls.rs":"cf411028341f67fd196ccde6200eea563c993f59d360a030b3d7d3ee15447a7d","src/read.rs":"bd0eb508a6b659dc578d546fc2f231484aed80c73cfe8c475e0d65c8d699a769","src/reseeding.rs":"73b2539b86b4cb8068e54716c7fd53e0d70b6c0de787a0749431b17019c9d826"},"package":"eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf"} \ No newline at end of file +{"files":{".travis.yml":"c5edd03cb5679918a6d85f64c0a634ed83022ff85ea78f440f39fd281bd29c02","Cargo.toml":"3dbce5caad1d0265badcfe385d578ac29d4e9b755f1909b1c2b67dc498d39d71","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"51831128477b9c9db0ec632ed6b6164f4e70e2d5f21eb5b3a391ecb9ab35e727","appveyor.yml":"6bf2f0c8f17d2dc4957dd39aba9a88ced3130200cf847a76d47b6c8fdcc2cbd8","benches/bench.rs":"2d3481c524841c532b9b9705073b223fd4b308c86ed7c9188b7fcd8e595ad459","benches/distributions/exponential.rs":"99cb59c013a0b6bb390d34c5649b341fc3b88ea7df0caf2470bdda8798f9fe3d","benches/distributions/gamma.rs":"3533f311e4b55d743c5b01a7eb6529c94fd97726ef6702a6372f914f5f33666b","benches/distributions/mod.rs":"0028f1cb96f61152ed5b49a4fe91227d809ef6d19035592c36032a538af7f95e","benches/distributions/normal.rs":"4e10c18cb583ccb96301ea953c8e0aa9ee3b6662060271d1b8d19ca23364dc6b","src/chacha.rs":"529c20ca1eff845da4cdca9ac995bcb8e698e48a61fbae91f09e3b4600ac57c3","src/distributions/exponential.rs":"103c8412c8a581b71835f1c00e40f6370e7702adf9d499243933a793d132d4e7","src/distributions/gamma.rs":"7a3f85c8daad4e56e334586ddb9fc9d83df3b0699738ed681a6c41e4ed455be9","src/distributions/mod.rs":"c3188ec234261ceba8b0231450f1bcfa486bdb7ad6a5aa9e1880aca4f4e02c74","src/distributions/normal.rs":"1562b43f80e4d5f83a8deb5af18de5a18dfeeeeda11fefc577da26672b14c949","src/distributions/range.rs":"c0ac6858d6a3979de7996feca22d190fde0bfb6f758d43030efa04a1a0fdcc17","src/distributions/ziggurat_tables.rs":"4eacf94fc352c91c455a6623de6a721e53842e1690f13a5662b6a79c7fbb73de","src/isaac.rs":"1725114b2d63c6fe4c0f4f7e0c36fc993a47f0322350d13abc631b0806bb71ed","src/lib.rs":"60ecdc3088993488df0a1914bd090fe00e4ea13272d1f3d51fd887e29e4cda3e","src/os.rs":"a27abd65bc29296e447961977c0ce5b44469d6231990783751a84dba36fe1044","src/rand_impls.rs":"cf411028341f67fd196ccde6200eea563c993f59d360a030b3d7d3ee15447a7d","src/read.rs":"bd0eb508a6b659dc578d546fc2f231484aed80c73cfe8c475e0d65c8d699a769","src/reseeding.rs":"73b2539b86b4cb8068e54716c7fd53e0d70b6c0de787a0749431b17019c9d826"},"package":"6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/rand/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/Cargo.toml --- distinst-0.1.0/vendor/rand/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -12,7 +12,7 @@ [package] name = "rand" -version = "0.3.16" +version = "0.3.18" authors = ["The Rust Project Developers"] description = "Random number generators and other randomness functionality.\n" homepage = "https://github.com/rust-lang-nursery/rand" @@ -30,5 +30,5 @@ [features] nightly = ["i128_support"] i128_support = [] -[target."cfg(target_os = \"fuchsia\")".dependencies.magenta] -version = "^0.1.1" +[target."cfg(target_os = \"fuchsia\")".dependencies.fuchsia-zircon] +version = "^0.2.1" diff -Nru distinst-0.1.0/vendor/rand/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/README.md --- distinst-0.1.0/vendor/rand/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -57,7 +57,7 @@ ```toml rand = "0.3" -rand-derive = "0.3" +rand_derive = "0.3" ``` Next in your crate: @@ -82,7 +82,6 @@ # License `rand` is primarily distributed under the terms of both the MIT -license and the Apache License (Version 2.0), with portions covered by various -BSD-like licenses. +license and the Apache License (Version 2.0). See LICENSE-APACHE, and LICENSE-MIT for details. diff -Nru distinst-0.1.0/vendor/rand/src/distributions/gamma.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/distributions/gamma.rs --- distinst-0.1.0/vendor/rand/src/distributions/gamma.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/distributions/gamma.rs 2017-12-21 19:00:07.000000000 +0000 @@ -185,8 +185,8 @@ /// /// For `k > 0` integral, this distribution is the sum of the squares /// of `k` independent standard normal random variables. For other -/// `k`, this uses the equivalent characterisation `χ²(k) = Gamma(k/2, -/// 2)`. +/// `k`, this uses the equivalent characterisation +/// `χ²(k) = Gamma(k/2, 2)`. /// /// # Example /// diff -Nru distinst-0.1.0/vendor/rand/src/distributions/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/distributions/mod.rs --- distinst-0.1.0/vendor/rand/src/distributions/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/distributions/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -123,6 +123,7 @@ /// Create a new `WeightedChoice`. /// /// Panics if: + /// /// - `v` is empty /// - the total weight is 0 /// - the total weight is larger than a `u32` can contain. diff -Nru distinst-0.1.0/vendor/rand/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/lib.rs --- distinst-0.1.0/vendor/rand/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -254,6 +254,7 @@ use std::io; use std::rc::Rc; use std::num::Wrapping as w; +use std::time; pub use os::OsRng; @@ -354,8 +355,9 @@ /// See: /// A PRNG specialized in double precision floating point numbers using /// an affine transition - /// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/dSFMT.pdf - /// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-slide-e.pdf + /// + /// * + /// * /// /// By default this is implemented in terms of `next_u32`, but a /// random number generator which can generate numbers satisfying @@ -890,13 +892,9 @@ /// seeded `Rng` for consistency over time you should pick one algorithm and /// create the `Rng` yourself. /// -/// This will read randomness from the operating system to seed the -/// generator. +/// This will seed the generator with randomness from thread_rng. pub fn weak_rng() -> XorShiftRng { - match OsRng::new() { - Ok(mut r) => r.gen(), - Err(e) => panic!("weak_rng: failed to create seeded RNG: {:?}", e) - } + thread_rng().gen() } /// Controls how the thread-local RNG is reseeded. @@ -905,9 +903,9 @@ impl reseeding::Reseeder for ThreadRngReseeder { fn reseed(&mut self, rng: &mut StdRng) { - *rng = match StdRng::new() { - Ok(r) => r, - Err(e) => panic!("could not reseed thread_rng: {}", e) + match StdRng::new() { + Ok(r) => *rng = r, + Err(_) => rng.reseed(&weak_seed()) } } } @@ -924,8 +922,9 @@ /// generator, seeded by the system. Intended to be used in method /// chaining style, e.g. `thread_rng().gen::()`. /// -/// The RNG provided will reseed itself from the operating system -/// after generating a certain amount of randomness. +/// After generating a certain amount of randomness, the RNG will reseed itself +/// from the operating system or, if the operating system RNG returns an error, +/// a seed based on the current system time. /// /// The internal RNG used is platform and architecture dependent, even /// if the operating system random number generator is rigged to give @@ -936,7 +935,7 @@ thread_local!(static THREAD_RNG_KEY: Rc> = { let r = match StdRng::new() { Ok(r) => r, - Err(e) => panic!("could not initialize thread_rng: {}", e) + Err(_) => StdRng::from_seed(&weak_seed()) }; let rng = reseeding::ReseedingRng::new(r, THREAD_RNG_RESEED_THRESHOLD, @@ -947,6 +946,14 @@ ThreadRng { rng: THREAD_RNG_KEY.with(|t| t.clone()) } } +fn weak_seed() -> [usize; 2] { + let now = time::SystemTime::now(); + let unix_time = now.duration_since(time::UNIX_EPOCH).unwrap(); + let seconds = unix_time.as_secs() as usize; + let nanoseconds = unix_time.subsec_nanos() as usize; + [seconds, nanoseconds] +} + impl Rng for ThreadRng { fn next_u32(&mut self) -> u32 { self.rng.borrow_mut().next_u32() @@ -1041,7 +1048,8 @@ #[cfg(test)] mod test { - use super::{Rng, thread_rng, random, SeedableRng, StdRng, sample}; + use super::{Rng, thread_rng, random, SeedableRng, StdRng, sample, + weak_rng}; use std::iter::repeat; pub struct MyRng { inner: R } @@ -1285,4 +1293,13 @@ let string2 = r.gen_ascii_chars().take(100).collect::(); assert_eq!(string1, string2); } + + #[test] + fn test_weak_rng() { + let s = weak_rng().gen_iter::().take(256).collect::>(); + let mut ra: StdRng = SeedableRng::from_seed(&s[..]); + let mut rb: StdRng = SeedableRng::from_seed(&s[..]); + assert!(iter_eq(ra.gen_ascii_chars().take(100), + rb.gen_ascii_chars().take(100))); + } } diff -Nru distinst-0.1.0/vendor/rand/src/os.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/os.rs --- distinst-0.1.0/vendor/rand/src/os.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rand/src/os.rs 2017-12-21 19:00:07.000000000 +0000 @@ -30,8 +30,8 @@ /// Max OS X, and modern Linux) this may block very early in the init /// process, if the CSPRNG has not been seeded yet.[1] /// -/// [1] See https://www.python.org/dev/peps/pep-0524/ for a more in-depth -/// discussion. +/// [1] See for a more +/// in-depth discussion. pub struct OsRng(imp::OsRng); impl OsRng { @@ -383,7 +383,7 @@ #[cfg(target_os = "fuchsia")] mod imp { - extern crate magenta; + extern crate fuchsia_zircon; use std::io; use Rng; @@ -407,10 +407,10 @@ next_u64(&mut |v| self.fill_bytes(v)) } fn fill_bytes(&mut self, v: &mut [u8]) { - for s in v.chunks_mut(magenta::MX_CPRNG_DRAW_MAX_LEN) { + for s in v.chunks_mut(fuchsia_zircon::ZX_CPRNG_DRAW_MAX_LEN) { let mut filled = 0; while filled < s.len() { - match magenta::cprng_draw(&mut s[filled..]) { + match fuchsia_zircon::cprng_draw(&mut s[filled..]) { Ok(actual) => filled += actual, Err(e) => panic!("cprng_draw failed: {:?}", e), }; diff -Nru distinst-0.1.0/vendor/redox_syscall/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_syscall/.cargo-checksum.json --- distinst-0.1.0/vendor/redox_syscall/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_syscall/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"c725f317bb27871da237c88ca08a137e2dbe1f2864d48ffd9fe65e545cd9207a","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"f2aabeb00e422ebe0f5ccdde1449fca7e8da5e563fb84024db83742ca12633fc","src/arch/arm.rs":"44ed9097879fce0ebe85d29e25ba378fb3ee7fcd649b569207495ed601c42a1c","src/arch/x86.rs":"e72a7f653c25b1ea5595af7ce991fe0e5c96547e127fc67e4967d60abbe1d3bd","src/arch/x86_64.rs":"499a0c997756c1cac5f4b4b98cff474a4e759695d3664712bd1a92d5d4a4a5f1","src/call.rs":"9b8517947298b82f0ccde0e97288856fee20d484470996d4bd19b725ecb7892b","src/data.rs":"8602d05b437216e6774658902f2d5fb030edc7510754ce7277fd299ab53a6b8b","src/error.rs":"b23c12db8cafb64f3b909a95bdd47cf03f62f6fa1201b40892febf46ec56bcb4","src/flag.rs":"4e10f5aeeba8406d50155332d59f7933c933dd7a03cc0a8316237e389c30e278","src/io/dma.rs":"4ab65016b3bc9121f0844dc4b8de77608eba327c0e0d930900254242b2c204b0","src/io/io.rs":"1bcb36d1867e9bab6a8186cd6928efe70ae2655e9f9d0dd3def20bc0fb6a82f6","src/io/mmio.rs":"bd475c815d483cc2b187348c32e10f94df0ca756ee8d14260b6ca3c660b2a73a","src/io/mod.rs":"4df12af3e82e6b5fe22112c9f51552112ee4811b7d1131d2a43d608d8d1cac09","src/io/pio.rs":"219fcd317d6c490a14794ec4db9de3e305c722dda720043c67076bda60632bb8","src/lib.rs":"988fb0b0bd3b396345f11ef46617072aeaf9307d3fa05a4d2a2ee9d590598bba","src/number.rs":"f9779b8abf0473ffbc81614746eb6ef5648129984a69eb43e4890a5b4c0aaedf","src/scheme.rs":"fe4cfac446eb1951795f588648afa0f6014566a7e2aa423f5f6f1dad45fe8583"},"package":"8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"} \ No newline at end of file +{"files":{"Cargo.toml":"c725f317bb27871da237c88ca08a137e2dbe1f2864d48ffd9fe65e545cd9207a","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"f2aabeb00e422ebe0f5ccdde1449fca7e8da5e563fb84024db83742ca12633fc","src/arch/arm.rs":"44ed9097879fce0ebe85d29e25ba378fb3ee7fcd649b569207495ed601c42a1c","src/arch/x86.rs":"e72a7f653c25b1ea5595af7ce991fe0e5c96547e127fc67e4967d60abbe1d3bd","src/arch/x86_64.rs":"499a0c997756c1cac5f4b4b98cff474a4e759695d3664712bd1a92d5d4a4a5f1","src/call.rs":"9b8517947298b82f0ccde0e97288856fee20d484470996d4bd19b725ecb7892b","src/data.rs":"8602d05b437216e6774658902f2d5fb030edc7510754ce7277fd299ab53a6b8b","src/error.rs":"b23c12db8cafb64f3b909a95bdd47cf03f62f6fa1201b40892febf46ec56bcb4","src/flag.rs":"4e10f5aeeba8406d50155332d59f7933c933dd7a03cc0a8316237e389c30e278","src/io/dma.rs":"4ab65016b3bc9121f0844dc4b8de77608eba327c0e0d930900254242b2c204b0","src/io/io.rs":"1bcb36d1867e9bab6a8186cd6928efe70ae2655e9f9d0dd3def20bc0fb6a82f6","src/io/mmio.rs":"bd475c815d483cc2b187348c32e10f94df0ca756ee8d14260b6ca3c660b2a73a","src/io/mod.rs":"4df12af3e82e6b5fe22112c9f51552112ee4811b7d1131d2a43d608d8d1cac09","src/io/pio.rs":"219fcd317d6c490a14794ec4db9de3e305c722dda720043c67076bda60632bb8","src/lib.rs":"988fb0b0bd3b396345f11ef46617072aeaf9307d3fa05a4d2a2ee9d590598bba","src/number.rs":"f9779b8abf0473ffbc81614746eb6ef5648129984a69eb43e4890a5b4c0aaedf","src/scheme.rs":"fe4cfac446eb1951795f588648afa0f6014566a7e2aa423f5f6f1dad45fe8583"},"package":"8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/redox_termios/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/.cargo-checksum.json --- distinst-0.1.0/vendor/redox_termios/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"e7d20b4132bf22e2c98a5f846f8c16e7628a9181d485fd131b97127ea8719130","LICENSE":"cb46b697c3fd9d27d7bfe1b1ad48f8a58a284984504c6eb215ae2164538df7cb","README.md":"c62ac3d33174db7977cfc7fc77605885f5445c0c9c7d1310dcbe3564c2854edb","src/lib.rs":"af5bc7c59c695880fef0352f9e0f9e9f8682c262a9b1c0fce725b10553647b4e"},"package":"7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/redox_termios/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/Cargo.toml --- distinst-0.1.0/vendor/redox_termios/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,26 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "redox_termios" +version = "0.1.1" +authors = ["Jeremy Soller "] +description = "A Rust library to access Redox termios functions" +documentation = "https://docs.rs/redox_termios" +license = "MIT" +repository = "https://github.com/redox-os/termios" + +[lib] +name = "redox_termios" +path = "src/lib.rs" +[dependencies.redox_syscall] +version = "0.1" diff -Nru distinst-0.1.0/vendor/redox_termios/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/LICENSE --- distinst-0.1.0/vendor/redox_termios/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/LICENSE 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Redox OS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -Nru distinst-0.1.0/vendor/redox_termios/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/README.md --- distinst-0.1.0/vendor/redox_termios/README.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,2 @@ +# termios +Redox Rust termios library diff -Nru distinst-0.1.0/vendor/redox_termios/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/src/lib.rs --- distinst-0.1.0/vendor/redox_termios/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/redox_termios/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,218 @@ +#![allow(non_camel_case_types)] +#![no_std] + +extern crate syscall; + +use core::{mem, slice}; +use core::ops::{Deref, DerefMut}; + +pub type tcflag_t = u32; +pub type cc_t = u8; + +/* c_cc { */ +pub const VEOF: usize = 0; +pub const VEOL: usize = 1; +pub const VEOL2: usize = 2; +pub const VERASE: usize = 3; +pub const VWERASE: usize = 4; +pub const VKILL: usize = 5; +pub const VREPRINT: usize = 6; +pub const VSWTC: usize = 7; +pub const VINTR: usize = 8; +pub const VQUIT: usize = 9; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 12; +pub const VSTOP: usize = 13; +pub const VLNEXT: usize = 14; +pub const VDISCARD: usize = 15; +pub const VMIN: usize = 16; +pub const VTIME: usize = 17; +pub const NCCS: usize = 32; +/* } c_cc */ + +/* c_iflag { */ +pub const IGNBRK: tcflag_t = 0o000001; +pub const BRKINT: tcflag_t = 0o000002; +pub const IGNPAR: tcflag_t = 0o000004; +pub const PARMRK: tcflag_t = 0o000010; +pub const INPCK: tcflag_t = 0o000020; +pub const ISTRIP: tcflag_t = 0o000040; +pub const INLCR: tcflag_t = 0o000100; +pub const IGNCR: tcflag_t = 0o000200; +pub const ICRNL: tcflag_t = 0o000400; +pub const IXON: tcflag_t = 0o001000; +pub const IXOFF: tcflag_t = 0o002000; +/* } c_iflag */ + +/* c_oflag { */ +pub const OPOST: tcflag_t = 0o000001; +pub const ONLCR: tcflag_t = 0o000002; +pub const OLCUC: tcflag_t = 0o000004; + +pub const OCRNL: tcflag_t = 0o000010; +pub const ONOCR: tcflag_t = 0o000020; +pub const ONLRET: tcflag_t = 0o000040; + +pub const OFILL: tcflag_t = 0o0000100; +pub const OFDEL: tcflag_t = 0o0000200; +/* } c_oflag */ + +/* c_cflag { */ +pub const B0: tcflag_t = 0o000000; +pub const B50: tcflag_t = 0o000001; +pub const B75: tcflag_t = 0o000002; +pub const B110: tcflag_t = 0o000003; +pub const B134: tcflag_t = 0o000004; +pub const B150: tcflag_t = 0o000005; +pub const B200: tcflag_t = 0o000006; +pub const B300: tcflag_t = 0o000007; +pub const B600: tcflag_t = 0o000010; +pub const B1200: tcflag_t = 0o000011; +pub const B1800: tcflag_t = 0o000012; +pub const B2400: tcflag_t = 0o000013; +pub const B4800: tcflag_t = 0o000014; +pub const B9600: tcflag_t = 0o000015; +pub const B19200: tcflag_t = 0o000016; +pub const B38400: tcflag_t = 0o000017; +pub const B57600: tcflag_t = 0o0020; +pub const B115200: tcflag_t = 0o0021; +pub const B230400: tcflag_t = 0o0022; +pub const B460800: tcflag_t = 0o0023; +pub const B500000: tcflag_t = 0o0024; +pub const B576000: tcflag_t = 0o0025; +pub const B921600: tcflag_t = 0o0026; +pub const B1000000: tcflag_t = 0o0027; +pub const B1152000: tcflag_t = 0o0030; +pub const B1500000: tcflag_t = 0o0031; +pub const B2000000: tcflag_t = 0o0032; +pub const B2500000: tcflag_t = 0o0033; +pub const B3000000: tcflag_t = 0o0034; +pub const B3500000: tcflag_t = 0o0035; +pub const B4000000: tcflag_t = 0o0036; + +pub const __MAX_BAUD: tcflag_t = B4000000; + +pub const CSIZE: tcflag_t = 0o0001400; +pub const CS5: tcflag_t = 0o0000000; +pub const CS6: tcflag_t = 0o0000400; +pub const CS7: tcflag_t = 0o0001000; +pub const CS8: tcflag_t = 0o0001400; + +pub const CSTOPB: tcflag_t = 0o0002000; +pub const CREAD: tcflag_t = 0o0004000; +pub const PARENB: tcflag_t = 0o0010000; +pub const PARODD: tcflag_t = 0o0020000; +pub const HUPCL: tcflag_t = 0o0040000; + +pub const CLOCAL: tcflag_t = 0o0100000; +/* } c_clfag */ + +/* c_lflag { */ +pub const ISIG: tcflag_t = 0x00000080; +pub const ICANON: tcflag_t = 0x00000100; +pub const ECHO: tcflag_t = 0x00000008; +pub const ECHOE: tcflag_t = 0x00000002; +pub const ECHOK: tcflag_t = 0x00000004; +pub const ECHONL: tcflag_t = 0x00000010; +pub const NOFLSH: tcflag_t = 0x80000000; +pub const TOSTOP: tcflag_t = 0x00400000; +pub const IEXTEN: tcflag_t = 0x00000400; +/* } c_lflag */ + +#[derive(Clone, Copy, Debug)] +#[repr(C)] +pub struct Termios { + pub c_iflag: tcflag_t, + pub c_oflag: tcflag_t, + pub c_cflag: tcflag_t, + pub c_lflag: tcflag_t, + pub c_cc: [cc_t; 32] +} + +impl Default for Termios { + fn default() -> Termios { + let mut termios = Termios { + c_iflag: ICRNL | IXON, + c_oflag: OPOST | ONLCR, + c_cflag: B38400 | CS8 | CREAD | HUPCL, + c_lflag: ISIG | ICANON | ECHO | ECHOE | ECHOK | IEXTEN, + c_cc: [0; 32] + }; + + { + let mut cc = |i: usize, b: cc_t| { + termios.c_cc[i] = b; + }; + + cc(VEOF, 0o004); // CTRL-D + cc(VEOL, 0o000); // NUL + cc(VEOL2, 0o000); // NUL + cc(VERASE, 0o177); // DEL + cc(VWERASE, 0o027); // CTRL-W + cc(VKILL, 0o025); // CTRL-U + cc(VREPRINT, 0o022);// CTRL-R + cc(VINTR, 0o003); // CTRL-C + cc(VQUIT, 0o034); // CTRL-\ + cc(VSUSP, 0o032); // CTRL-Z + cc(VSTART, 0o021); // CTRL-Q + cc(VSTOP, 0o023); // CTRL-S + cc(VLNEXT, 0o026); // CTRL-V + cc(VDISCARD, 0o017);// CTRL-U + cc(VMIN, 1); + cc(VTIME, 0); + } + + termios + } +} + +impl Termios { + pub fn make_raw(&mut self) { + self.c_iflag &= !(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + self.c_oflag &= !OPOST; + self.c_cflag &= !(CSIZE | PARENB); + self.c_cflag |= CS8; + self.c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + } +} + +impl Deref for Termios { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Termios as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Termios { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Termios as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Clone, Copy, Debug, Default)] +#[repr(C)] +pub struct Winsize { + pub ws_row: u16, + pub ws_col: u16 +} + +impl Deref for Winsize { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Winsize as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Winsize { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Winsize as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} diff -Nru distinst-0.1.0/vendor/rustc-serialize/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rustc-serialize/.cargo-checksum.json --- distinst-0.1.0/vendor/rustc-serialize/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/rustc-serialize/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"03dcea6dcd54625b42d91176e86718626dfd911744a343dee3edefa001e87dc5","Cargo.toml":"01199fa6ca6337a7513e9ef8951268b8882347e5affaa50e710ac4960d9c65e0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"0aebc3beb6fc32d6073582d5fea170761689a2c83cddb5436aa26e57b7d04e7b","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","benches/base64.rs":"96f7d0c7d260362e41b8cefb4839f1e1b3c18c2f10344f6ccafac7c434f99ca9","benches/hex.rs":"057821307b4b7de02f2c267f9248457386035382916c5afe4b72d6f2e905062c","benches/json.rs":"659f2ae2e1ad5ed022fafce6418d17dfe09c3dcb3f054857dce0effc907da850","src/base64.rs":"57649c590c1fba643ff955910f1d4427feda43414bb0863cd279bea56c3ff178","src/collection_impls.rs":"8ae6bc0d61a4777d834c2b24fa987550cb13c570e1564f87ee32eceff3cb2d5b","src/hex.rs":"a2ba86cf47035b5d9cbf4adf8dc3e941d4e0a6ce1a61a29cbb14ea1fdabac6bb","src/json.rs":"75a788a46612c73bfd14af20fb48855dc8c930747c5255a288d2d09de25ea960","src/lib.rs":"a0e4a368a609f019434e7584f54448cf33ebf3e37e3fb1dd5537d300088184b1","src/serialize.rs":"7ddcc3c32843850e30d05b82a8cda8ae63ec0016e2b0bfbcc46a03ea3ea986e8"},"package":"dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"} \ No newline at end of file +{"files":{".travis.yml":"03dcea6dcd54625b42d91176e86718626dfd911744a343dee3edefa001e87dc5","Cargo.toml":"01199fa6ca6337a7513e9ef8951268b8882347e5affaa50e710ac4960d9c65e0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"0aebc3beb6fc32d6073582d5fea170761689a2c83cddb5436aa26e57b7d04e7b","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","benches/base64.rs":"96f7d0c7d260362e41b8cefb4839f1e1b3c18c2f10344f6ccafac7c434f99ca9","benches/hex.rs":"057821307b4b7de02f2c267f9248457386035382916c5afe4b72d6f2e905062c","benches/json.rs":"659f2ae2e1ad5ed022fafce6418d17dfe09c3dcb3f054857dce0effc907da850","src/base64.rs":"57649c590c1fba643ff955910f1d4427feda43414bb0863cd279bea56c3ff178","src/collection_impls.rs":"8ae6bc0d61a4777d834c2b24fa987550cb13c570e1564f87ee32eceff3cb2d5b","src/hex.rs":"a2ba86cf47035b5d9cbf4adf8dc3e941d4e0a6ce1a61a29cbb14ea1fdabac6bb","src/json.rs":"75a788a46612c73bfd14af20fb48855dc8c930747c5255a288d2d09de25ea960","src/lib.rs":"a0e4a368a609f019434e7584f54448cf33ebf3e37e3fb1dd5537d300088184b1","src/serialize.rs":"7ddcc3c32843850e30d05b82a8cda8ae63ec0016e2b0bfbcc46a03ea3ea986e8"},"package":"dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/serde/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/.cargo-checksum.json --- distinst-0.1.0/vendor/serde/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"c71542adb7717ea07c4f8c150eb5d8c8561ed9a819c558590b3d0cb964080e3f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"213afbe4b2ef4033e8c40d11925ae1effff5a11fb5cdae7ca978e26564ca4880","src/bytes.rs":"2b6a9c2c3d6eabe8633adee6655a3b94f0d1e931e740e72699b6965bee21e226","src/de/content.rs":"11ce91ca6a5644e3338d683b8268485195341751b51731b9b48e2c452e10db66","src/de/from_primitive.rs":"b1bd165e343a4380965551709119ef9ed895e4b025045a810dabd671511ba3ab","src/de/impls.rs":"5c8031cf33ad510f5bb1a75069bb1e1d558f74deb762f5da92bbf005a047a9a3","src/de/mod.rs":"34841a85df55bafb7ba64a972d0a0c966d7a9dce8b21f740f739ec9d8aaea784","src/de/private.rs":"2578dbc89c2f2a852caed3fdc40f710d4828d085c4e954dd96789d678583424e","src/de/value.rs":"1bf57858a42a987a697b876a96a4765069422a6bb60f2d8dc69c360686b7c280","src/error.rs":"3af5286c1daad9bfd504693f8a8587f7044c9b9520e23e072549c43a72e4821d","src/export.rs":"85e7a5cb5e3c5a36717bb53187b14ee55ae1ec114e2da538c11d68bbbccc8253","src/iter.rs":"af3c43712c240b3a06870e0b0b6e837b142d5a65c62742fa358fe36a9d9319a7","src/lib.rs":"ca38922d87bdab2a09d13e0e7804d85256118f9b7e8cfc54f4064b499a44fb04","src/macros.rs":"6da960dd67285e47721724871ce5594ba90feeba304f083a0378677db6e6cbcb","src/ser/content.rs":"585febe877e59b43bcc66a60c88e5661560917e824bc4cf251c71168b6673c98","src/ser/impls.rs":"98a5f7cadec2798bceee5dbfe9af25b30861ac5c308c7d3d4a61358b345789d8","src/ser/impossible.rs":"f1332a1250f9c1d85d679653ade502cf99bdff0344b9f864e6cf1a1789d7c597","src/ser/mod.rs":"96a65af2ce0aedf4592f096896e1ee23fcc2a16aa1bb839cd781c667a75b7f48","src/ser/private.rs":"d2a98eeda64e7d203e435b885dd56d03fb69888ccf6c70cc938a9b81e0794ebf","src/utils.rs":"cceeac48898b5dceff934befc5b9685997221cbba5b3e17d80b640bd2229fe86"},"package":"34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af"} \ No newline at end of file +{"files":{"Cargo.toml":"abf19cbbd19c84bc4f7ee63bad88474aacb5cbc8b74b57271f4fd55d9b1a0369","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"7dc6376a88195594cd6b43cb891aad10f57144ff737178b55d046aa04739b43a","src/de/from_primitive.rs":"28ec3ab1c430cf27d632b642ccfccb6d055eeb9fb576e7e446ba24c66f507fb4","src/de/ignored_any.rs":"1b5ee592f5ae58d69e321144d4397f149c047e327529d0b880e1a5285e781a35","src/de/impls.rs":"6a879dd2093ae482bebdc0bd7a4339ced994449715b582523a1c233870c790cc","src/de/mod.rs":"2ebbe708c7166da251ae2820b42bcf38006378f589429154df854289e3d28a2d","src/de/utf8.rs":"956b124b7ce98353cb781b56e43a6fed2e67f1389d35b7a468d5be75b1485853","src/de/value.rs":"fe31174cc41035a1b53d4657b6cae6f3bcb660be39eccaae281a6e3705655578","src/export.rs":"7477f5bd345ca9e0b8d56bccdc62484e42a92fc6cd909bf17fb6e05cd1eb7946","src/lib.rs":"9d9e47506d7881bec105f70cb05d78624a05b42ee0b360103d0aa3140045d296","src/macros.rs":"e1d542b1dac2c1d1f9d5ada7cc5b6639767fc67851421cc3adfb942a7cf750b6","src/private/de.rs":"153c0673c2f7ba1849846f13b3e6aa7180520dd852e663c6c9f27abcd783d647","src/private/macros.rs":"6861a4f332ea24d0ed5db1c28fe3105d2716523902f045c0bbbd439ebf9e44de","src/private/mod.rs":"bcd7c54838e139475c23a323678e20eccbe88c0be93f7977f7675cead4d3b6ed","src/private/ser.rs":"eec5aecf077cebf4dc3fdbe83780f716bf33d311806ee59ce42a0c53c2f92211","src/ser/impls.rs":"dc5219e898d67c9422fef81d1f36d25ea92341c5ad3d976c0017886f371a8d51","src/ser/impossible.rs":"35bd09bb517b28eda0048b0622eb5a0313d5aebf37c03b5a44dbca200d0a9ac8","src/ser/mod.rs":"3d92794f13c8d90c2ebc33716bd6e4d4dde552c6f7de42dfaf9967d8a9ab7d10"},"package":"6eda663e865517ee783b0891a3f6eb3a253e0b0dabb46418969ee9635beadd9e"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/serde/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/Cargo.toml --- distinst-0.1.0/vendor/serde/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,35 +1,44 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + [package] name = "serde" -version = "0.9.15" -authors = ["Erick Tryzelaar "] -license = "MIT/Apache-2.0" +version = "1.0.21" +authors = ["Erick Tryzelaar ", "David Tolnay "] +include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] description = "A generic serialization/deserialization framework" homepage = "https://serde.rs" -repository = "https://github.com/serde-rs/serde" documentation = "https://docs.serde.rs/serde/" +readme = "README.md" keywords = ["serde", "serialization", "no_std"] categories = ["encoding"] -readme = "../README.md" -include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] - -[badges] -travis-ci = { repository = "serde-rs/serde" } +license = "MIT/Apache-2.0" +repository = "https://github.com/serde-rs/serde" +[dependencies.serde_derive] +version = "1.0" +optional = true +[dev-dependencies.serde_derive] +version = "1.0" [features] +alloc = ["unstable"] default = ["std"] derive = ["serde_derive"] - +playground = ["serde_derive"] +rc = [] std = [] unstable = [] -alloc = ["unstable"] -collections = ["alloc"] -unstable-testing = ["unstable", "std"] - -# to get serde_derive picked up by play.integer32.com -playground = ["serde_derive"] - -[dependencies] -serde_derive = { version = "0.9", optional = true, path = "../serde_derive" } +[badges.appveyor] +repository = "serde-rs/serde" -[dev-dependencies] -serde_derive = { version = "0.9", path = "../serde_derive" } +[badges.travis-ci] +repository = "serde-rs/serde" diff -Nru distinst-0.1.0/vendor/serde/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/README.md --- distinst-0.1.0/vendor/serde/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,9 @@ -# Serde   [![Build Status](https://api.travis-ci.org/serde-rs/serde.svg?branch=master)](https://travis-ci.org/serde-rs/serde) [![Latest Version](https://img.shields.io/crates/v/serde.svg)](https://crates.io/crates/serde) +# Serde   [![Build Status]][travis] [![Latest Version]][crates.io] + +[Build Status]: https://api.travis-ci.org/serde-rs/serde.svg?branch=master +[travis]: https://travis-ci.org/serde-rs/serde +[Latest Version]: https://img.shields.io/crates/v/serde.svg +[crates.io]: https://crates.io/crates/serde **Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** @@ -15,9 +20,30 @@ ## Serde in action - - - +
+ +Click to show Cargo.toml. +Run this code in the playground. + + +```toml +[dependencies] + +# The core APIs, including the Serialize and Deserialize traits. Always +# required when using Serde. +serde = "1.0" + +# Support for #[derive(Serialize, Deserialize)]. Required if you want Serde +# to work for structs and enums defined in your crate. +serde_derive = "1.0" + +# Each data format lives in its own crate; the sample code below uses JSON +# but you may be using a different one. +serde_json = "1.0" +``` + +
+

```rust #[macro_use] diff -Nru distinst-0.1.0/vendor/serde/src/bytes.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/bytes.rs --- distinst-0.1.0/vendor/serde/src/bytes.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/bytes.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,315 +0,0 @@ -//! Wrapper types to enable optimized handling of `&[u8]` and `Vec`. -//! -//! Without specialization, Rust forces us to treat `&[u8]` just like any other -//! slice and `Vec` just like any other vector. In reality this particular -//! slice and vector can often be serialized and deserialized in a more -//! efficient, compact representation in many formats. -//! -//! When working with such a format, you can opt into specialized handling of -//! `&[u8]` by wrapping it in `bytes::Bytes` and `Vec` by wrapping it in -//! `bytes::ByteBuf`. -//! -//! Rust support for specialization is being tracked in -//! [rust-lang/rust#31844][specialization]. Once it lands in the stable compiler -//! we will be deprecating these wrapper types in favor of optimizing `&[u8]` -//! and `Vec` out of the box. -//! -//! [specialization]: https://github.com/rust-lang/rust/issues/31844 - -use core::{ops, fmt, char, iter, slice}; -use core::fmt::Write; - -use ser; - -#[cfg(any(feature = "std", feature = "collections"))] -pub use self::bytebuf::ByteBuf; - -#[cfg(any(feature = "std", feature = "collections"))] -#[doc(hidden)] // does anybody need this? -pub use self::bytebuf::ByteBufVisitor; - -#[cfg(feature = "collections")] -use collections::Vec; - -/////////////////////////////////////////////////////////////////////////////// - -/// Wraps a `&[u8]` in order to serialize in an efficient way. Does not support -/// deserialization. -/// -/// ```rust -/// # #[macro_use] extern crate serde_derive; -/// # extern crate serde; -/// # use std::net::IpAddr; -/// # -/// use serde::bytes::Bytes; -/// -/// # #[allow(dead_code)] -/// #[derive(Serialize)] -/// struct Packet<'a> { -/// destination: IpAddr, -/// payload: Bytes<'a>, -/// } -/// # -/// # fn main() {} -/// ``` -#[derive(Clone, Copy, Eq, Hash, PartialEq, PartialOrd, Ord)] -pub struct Bytes<'a> { - bytes: &'a [u8], -} - -impl<'a> Bytes<'a> { - /// Wrap an existing `&[u8]`. - pub fn new(bytes: &'a [u8]) -> Self { - Bytes { bytes: bytes } - } -} - -impl<'a> fmt::Debug for Bytes<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(f.write_str("b\"")); - for c in escape_bytestring(self.bytes) { - try!(f.write_char(c)); - } - f.write_char('"') - } -} - -impl<'a> From<&'a [u8]> for Bytes<'a> { - fn from(bytes: &'a [u8]) -> Self { - Bytes::new(bytes) - } -} - -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a> From<&'a Vec> for Bytes<'a> { - fn from(bytes: &'a Vec) -> Self { - Bytes::new(bytes) - } -} - -impl<'a> Into<&'a [u8]> for Bytes<'a> { - fn into(self) -> &'a [u8] { - self.bytes - } -} - -impl<'a> ops::Deref for Bytes<'a> { - type Target = [u8]; - - fn deref(&self) -> &[u8] { - self.bytes - } -} - -impl<'a> ser::Serialize for Bytes<'a> { - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: ser::Serializer - { - serializer.serialize_bytes(self.bytes) - } -} - -/////////////////////////////////////////////////////////////////////////////// - -#[cfg(any(feature = "std", feature = "collections"))] -mod bytebuf { - use core::cmp; - use core::ops; - use core::fmt; - use core::fmt::Write; - - use ser; - use de; - - #[cfg(feature = "collections")] - use collections::{String, Vec}; - - /// Wraps a `Vec` in order to serialize and deserialize in an efficient - /// way. - /// - /// ```rust - /// # #[macro_use] extern crate serde_derive; - /// # extern crate serde; - /// # use std::net::IpAddr; - /// # - /// use serde::bytes::ByteBuf; - /// - /// # #[allow(dead_code)] - /// #[derive(Serialize, Deserialize)] - /// struct Packet { - /// destination: IpAddr, - /// payload: ByteBuf, - /// } - /// # - /// # fn main() {} - /// ``` - #[derive(Clone, Default, Eq, Hash, PartialEq, PartialOrd, Ord)] - pub struct ByteBuf { - bytes: Vec, - } - - impl ByteBuf { - /// Construct a new, empty `ByteBuf`. - pub fn new() -> Self { - ByteBuf::from(Vec::new()) - } - - /// Construct a new, empty `ByteBuf` with the specified capacity. - pub fn with_capacity(cap: usize) -> Self { - ByteBuf::from(Vec::with_capacity(cap)) - } - - /// Wrap existing bytes in a `ByteBuf`. - pub fn from>>(bytes: T) -> Self { - ByteBuf { bytes: bytes.into() } - } - } - - impl fmt::Debug for ByteBuf { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(f.write_str("b\"")); - for c in super::escape_bytestring(self.bytes.as_ref()) { - try!(f.write_char(c)); - } - f.write_char('"') - } - } - - impl Into> for ByteBuf { - fn into(self) -> Vec { - self.bytes - } - } - - impl From> for ByteBuf { - fn from(bytes: Vec) -> Self { - ByteBuf::from(bytes) - } - } - - impl AsRef> for ByteBuf { - fn as_ref(&self) -> &Vec { - &self.bytes - } - } - - impl AsRef<[u8]> for ByteBuf { - fn as_ref(&self) -> &[u8] { - &self.bytes - } - } - - impl AsMut> for ByteBuf { - fn as_mut(&mut self) -> &mut Vec { - &mut self.bytes - } - } - - impl AsMut<[u8]> for ByteBuf { - fn as_mut(&mut self) -> &mut [u8] { - &mut self.bytes - } - } - - impl ops::Deref for ByteBuf { - type Target = [u8]; - - fn deref(&self) -> &[u8] { - &self.bytes[..] - } - } - - impl ops::DerefMut for ByteBuf { - fn deref_mut(&mut self) -> &mut [u8] { - &mut self.bytes[..] - } - } - - impl ser::Serialize for ByteBuf { - fn serialize(&self, serializer: S) -> Result - where S: ser::Serializer - { - serializer.serialize_bytes(self) - } - } - - /// This type implements the `serde::de::Visitor` trait for a `ByteBuf`. - pub struct ByteBufVisitor; - - impl de::Visitor for ByteBufVisitor { - type Value = ByteBuf; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("byte array") - } - - #[inline] - fn visit_unit(self) -> Result - where E: de::Error - { - Ok(ByteBuf::new()) - } - - #[inline] - fn visit_seq(self, mut visitor: V) -> Result - where V: de::SeqVisitor - { - let len = cmp::min(visitor.size_hint().0, 4096); - let mut values = Vec::with_capacity(len); - - while let Some(value) = try!(visitor.visit()) { - values.push(value); - } - - Ok(ByteBuf::from(values)) - } - - #[inline] - fn visit_bytes(self, v: &[u8]) -> Result - where E: de::Error - { - Ok(ByteBuf::from(v)) - } - - #[inline] - fn visit_byte_buf(self, v: Vec) -> Result - where E: de::Error - { - Ok(ByteBuf::from(v)) - } - - fn visit_str(self, v: &str) -> Result - where E: de::Error - { - Ok(ByteBuf::from(v)) - } - - fn visit_string(self, v: String) -> Result - where E: de::Error - { - Ok(ByteBuf::from(v)) - } - } - - impl de::Deserialize for ByteBuf { - #[inline] - fn deserialize(deserializer: D) -> Result - where D: de::Deserializer - { - deserializer.deserialize_byte_buf(ByteBufVisitor) - } - } -} - -/////////////////////////////////////////////////////////////////////////////// - -#[inline] -fn escape_bytestring<'a> - (bytes: &'a [u8]) - -> iter::FlatMap, char::EscapeDefault, fn(&u8) -> char::EscapeDefault> { - fn f(b: &u8) -> char::EscapeDefault { - char::from_u32(*b as u32).unwrap().escape_default() - } - bytes.iter().flat_map(f as fn(&u8) -> char::EscapeDefault) -} diff -Nru distinst-0.1.0/vendor/serde/src/de/content.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/content.rs --- distinst-0.1.0/vendor/serde/src/de/content.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/content.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,1338 +0,0 @@ -// This module is doc(hidden) and nothing here should be used outside of -// generated code. -// -// We will iterate on the implementation for a few releases and only have to -// worry about backward compatibility for the `untagged` and `tag` attributes -// rather than for this entire mechanism. -// -// This issue is tracking making some of this stuff public: -// https://github.com/serde-rs/serde/issues/741 - -#![doc(hidden)] - -use core::cmp; -use core::fmt; -use core::marker::PhantomData; - -#[cfg(all(not(feature = "std"), feature = "collections"))] -use collections::{String, Vec}; - -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::boxed::Box; - -use de::{self, Deserialize, DeserializeSeed, Deserializer, Visitor, SeqVisitor, MapVisitor, - EnumVisitor, Unexpected}; - -/// Used from generated code to buffer the contents of the Deserializer when -/// deserializing untagged enums and internally tagged enums. -/// -/// Not public API. Use serde-value instead. -#[derive(Debug)] -pub enum Content { - Bool(bool), - - U8(u8), - U16(u16), - U32(u32), - U64(u64), - - I8(i8), - I16(i16), - I32(i32), - I64(i64), - - F32(f32), - F64(f64), - - Char(char), - String(String), - Bytes(Vec), - - None, - Some(Box), - - Unit, - Newtype(Box), - Seq(Vec), - Map(Vec<(Content, Content)>), -} - -impl Content { - fn unexpected(&self) -> Unexpected { - match *self { - Content::Bool(b) => Unexpected::Bool(b), - Content::U8(n) => Unexpected::Unsigned(n as u64), - Content::U16(n) => Unexpected::Unsigned(n as u64), - Content::U32(n) => Unexpected::Unsigned(n as u64), - Content::U64(n) => Unexpected::Unsigned(n), - Content::I8(n) => Unexpected::Signed(n as i64), - Content::I16(n) => Unexpected::Signed(n as i64), - Content::I32(n) => Unexpected::Signed(n as i64), - Content::I64(n) => Unexpected::Signed(n), - Content::F32(f) => Unexpected::Float(f as f64), - Content::F64(f) => Unexpected::Float(f), - Content::Char(c) => Unexpected::Char(c), - Content::String(ref s) => Unexpected::Str(s), - Content::Bytes(ref b) => Unexpected::Bytes(b), - Content::None | Content::Some(_) => Unexpected::Option, - Content::Unit => Unexpected::Unit, - Content::Newtype(_) => Unexpected::NewtypeStruct, - Content::Seq(_) => Unexpected::Seq, - Content::Map(_) => Unexpected::Map, - } - } -} - -impl Deserialize for Content { - fn deserialize(deserializer: D) -> Result { - // Untagged and internally tagged enums are only supported in - // self-describing formats. - deserializer.deserialize(ContentVisitor) - } -} - -struct ContentVisitor; - -impl Visitor for ContentVisitor { - type Value = Content; - - fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.write_str("any value") - } - - fn visit_bool(self, value: bool) -> Result - where F: de::Error - { - Ok(Content::Bool(value)) - } - - fn visit_i8(self, value: i8) -> Result - where F: de::Error - { - Ok(Content::I8(value)) - } - - fn visit_i16(self, value: i16) -> Result - where F: de::Error - { - Ok(Content::I16(value)) - } - - fn visit_i32(self, value: i32) -> Result - where F: de::Error - { - Ok(Content::I32(value)) - } - - fn visit_i64(self, value: i64) -> Result - where F: de::Error - { - Ok(Content::I64(value)) - } - - fn visit_u8(self, value: u8) -> Result - where F: de::Error - { - Ok(Content::U8(value)) - } - - fn visit_u16(self, value: u16) -> Result - where F: de::Error - { - Ok(Content::U16(value)) - } - - fn visit_u32(self, value: u32) -> Result - where F: de::Error - { - Ok(Content::U32(value)) - } - - fn visit_u64(self, value: u64) -> Result - where F: de::Error - { - Ok(Content::U64(value)) - } - - fn visit_f32(self, value: f32) -> Result - where F: de::Error - { - Ok(Content::F32(value)) - } - - fn visit_f64(self, value: f64) -> Result - where F: de::Error - { - Ok(Content::F64(value)) - } - - fn visit_char(self, value: char) -> Result - where F: de::Error - { - Ok(Content::Char(value)) - } - - fn visit_str(self, value: &str) -> Result - where F: de::Error - { - Ok(Content::String(value.into())) - } - - fn visit_string(self, value: String) -> Result - where F: de::Error - { - Ok(Content::String(value)) - } - - fn visit_bytes(self, value: &[u8]) -> Result - where F: de::Error - { - Ok(Content::Bytes(value.into())) - } - - fn visit_byte_buf(self, value: Vec) -> Result - where F: de::Error - { - Ok(Content::Bytes(value)) - } - - fn visit_unit(self) -> Result - where F: de::Error - { - Ok(Content::Unit) - } - - fn visit_none(self) -> Result - where F: de::Error - { - Ok(Content::None) - } - - fn visit_some(self, deserializer: D) -> Result - where D: Deserializer - { - Deserialize::deserialize(deserializer).map(|v| Content::Some(Box::new(v))) - } - - fn visit_newtype_struct(self, deserializer: D) -> Result - where D: Deserializer - { - Deserialize::deserialize(deserializer).map(|v| Content::Newtype(Box::new(v))) - } - - fn visit_seq(self, mut visitor: V) -> Result - where V: SeqVisitor - { - let mut vec = Vec::with_capacity(cmp::min(visitor.size_hint().0, 4096)); - while let Some(e) = try!(visitor.visit()) { - vec.push(e); - } - Ok(Content::Seq(vec)) - } - - fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor - { - let mut vec = Vec::with_capacity(cmp::min(visitor.size_hint().0, 4096)); - while let Some(kv) = try!(visitor.visit()) { - vec.push(kv); - } - Ok(Content::Map(vec)) - } - - fn visit_enum(self, _visitor: V) -> Result - where V: EnumVisitor - { - Err(de::Error::custom("untagged and internally tagged enums do not support enum input")) - } -} - -/// This is the type of the map keys in an internally tagged enum. -/// -/// Not public API. -pub enum TagOrContent { - Tag, - Content(Content), -} - -struct TagOrContentVisitor { - name: &'static str, -} - -impl TagOrContentVisitor { - fn new(name: &'static str) -> Self { - TagOrContentVisitor { name: name } - } -} - -impl DeserializeSeed for TagOrContentVisitor { - type Value = TagOrContent; - - fn deserialize(self, deserializer: D) -> Result - where D: Deserializer - { - // Internally tagged enums are only supported in self-describing - // formats. - deserializer.deserialize(self) - } -} - -impl Visitor for TagOrContentVisitor { - type Value = TagOrContent; - - fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - write!(fmt, "a type tag `{}` or any other value", self.name) - } - - fn visit_bool(self, value: bool) -> Result - where F: de::Error - { - ContentVisitor.visit_bool(value).map(TagOrContent::Content) - } - - fn visit_i8(self, value: i8) -> Result - where F: de::Error - { - ContentVisitor.visit_i8(value).map(TagOrContent::Content) - } - - fn visit_i16(self, value: i16) -> Result - where F: de::Error - { - ContentVisitor.visit_i16(value).map(TagOrContent::Content) - } - - fn visit_i32(self, value: i32) -> Result - where F: de::Error - { - ContentVisitor.visit_i32(value).map(TagOrContent::Content) - } - - fn visit_i64(self, value: i64) -> Result - where F: de::Error - { - ContentVisitor.visit_i64(value).map(TagOrContent::Content) - } - - fn visit_u8(self, value: u8) -> Result - where F: de::Error - { - ContentVisitor.visit_u8(value).map(TagOrContent::Content) - } - - fn visit_u16(self, value: u16) -> Result - where F: de::Error - { - ContentVisitor.visit_u16(value).map(TagOrContent::Content) - } - - fn visit_u32(self, value: u32) -> Result - where F: de::Error - { - ContentVisitor.visit_u32(value).map(TagOrContent::Content) - } - - fn visit_u64(self, value: u64) -> Result - where F: de::Error - { - ContentVisitor.visit_u64(value).map(TagOrContent::Content) - } - - fn visit_f32(self, value: f32) -> Result - where F: de::Error - { - ContentVisitor.visit_f32(value).map(TagOrContent::Content) - } - - fn visit_f64(self, value: f64) -> Result - where F: de::Error - { - ContentVisitor.visit_f64(value).map(TagOrContent::Content) - } - - fn visit_char(self, value: char) -> Result - where F: de::Error - { - ContentVisitor.visit_char(value).map(TagOrContent::Content) - } - - fn visit_str(self, value: &str) -> Result - where F: de::Error - { - if value == self.name { - Ok(TagOrContent::Tag) - } else { - ContentVisitor.visit_str(value).map(TagOrContent::Content) - } - } - - fn visit_string(self, value: String) -> Result - where F: de::Error - { - if value == self.name { - Ok(TagOrContent::Tag) - } else { - ContentVisitor.visit_string(value).map(TagOrContent::Content) - } - } - - fn visit_bytes(self, value: &[u8]) -> Result - where F: de::Error - { - if value == self.name.as_bytes() { - Ok(TagOrContent::Tag) - } else { - ContentVisitor.visit_bytes(value).map(TagOrContent::Content) - } - } - - fn visit_byte_buf(self, value: Vec) -> Result - where F: de::Error - { - if value == self.name.as_bytes() { - Ok(TagOrContent::Tag) - } else { - ContentVisitor.visit_byte_buf(value).map(TagOrContent::Content) - } - } - - fn visit_unit(self) -> Result - where F: de::Error - { - ContentVisitor.visit_unit().map(TagOrContent::Content) - } - - fn visit_none(self) -> Result - where F: de::Error - { - ContentVisitor.visit_none().map(TagOrContent::Content) - } - - fn visit_some(self, deserializer: D) -> Result - where D: Deserializer - { - ContentVisitor.visit_some(deserializer).map(TagOrContent::Content) - } - - fn visit_newtype_struct(self, deserializer: D) -> Result - where D: Deserializer - { - ContentVisitor.visit_newtype_struct(deserializer).map(TagOrContent::Content) - } - - fn visit_seq(self, visitor: V) -> Result - where V: SeqVisitor - { - ContentVisitor.visit_seq(visitor).map(TagOrContent::Content) - } - - fn visit_map(self, visitor: V) -> Result - where V: MapVisitor - { - ContentVisitor.visit_map(visitor).map(TagOrContent::Content) - } - - fn visit_enum(self, visitor: V) -> Result - where V: EnumVisitor - { - ContentVisitor.visit_enum(visitor).map(TagOrContent::Content) - } -} - -/// Used by generated code to deserialize an internally tagged enum. -/// -/// Not public API. -pub struct TaggedContent { - pub tag: T, - pub content: Content, -} - -/// Not public API. -pub struct TaggedContentVisitor { - tag_name: &'static str, - tag: PhantomData, -} - -impl TaggedContentVisitor { - /// Visitor for the content of an internally tagged enum with the given tag - /// name. - pub fn new(name: &'static str) -> Self { - TaggedContentVisitor { - tag_name: name, - tag: PhantomData, - } - } -} - -impl DeserializeSeed for TaggedContentVisitor - where T: Deserialize -{ - type Value = TaggedContent; - - fn deserialize(self, deserializer: D) -> Result - where D: Deserializer - { - // Internally tagged enums are only supported in self-describing - // formats. - deserializer.deserialize(self) - } -} - -impl Visitor for TaggedContentVisitor - where T: Deserialize -{ - type Value = TaggedContent; - - fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.write_str("any value") - } - - fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor - { - let mut tag = None; - let mut vec = Vec::with_capacity(cmp::min(visitor.size_hint().0, 4096)); - while let Some(k) = try!(visitor.visit_key_seed(TagOrContentVisitor::new(self.tag_name))) { - match k { - TagOrContent::Tag => { - if tag.is_some() { - return Err(de::Error::duplicate_field(self.tag_name)); - } - tag = Some(try!(visitor.visit_value())); - } - TagOrContent::Content(k) => { - let v = try!(visitor.visit_value()); - vec.push((k, v)); - } - } - } - match tag { - None => Err(de::Error::missing_field(self.tag_name)), - Some(tag) => { - Ok(TaggedContent { - tag: tag, - content: Content::Map(vec), - }) - } - } - } -} - -/// Used by generated code to deserialize an adjacently tagged enum. -/// -/// Not public API. -pub enum TagOrContentField { - Tag, - Content, -} - -/// Not public API. -pub struct TagOrContentFieldVisitor { - pub tag: &'static str, - pub content: &'static str, -} - -impl DeserializeSeed for TagOrContentFieldVisitor { - type Value = TagOrContentField; - - fn deserialize(self, deserializer: D) -> Result - where D: Deserializer - { - deserializer.deserialize_str(self) - } -} - -impl Visitor for TagOrContentFieldVisitor { - type Value = TagOrContentField; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "{:?} or {:?}", self.tag, self.content) - } - - fn visit_str(self, field: &str) -> Result - where E: de::Error - { - if field == self.tag { - Ok(TagOrContentField::Tag) - } else if field == self.content { - Ok(TagOrContentField::Content) - } else { - Err(de::Error::invalid_value(Unexpected::Str(field), &self)) - } - } -} - -/// Not public API -pub struct ContentDeserializer { - content: Content, - err: PhantomData, -} - -/// Used when deserializing an internally tagged enum because the content will -/// be used exactly once. -impl Deserializer for ContentDeserializer - where E: de::Error -{ - type Error = E; - - fn deserialize(self, visitor: V) -> Result - where V: Visitor - { - match self.content { - Content::Bool(v) => visitor.visit_bool(v), - Content::U8(v) => visitor.visit_u8(v), - Content::U16(v) => visitor.visit_u16(v), - Content::U32(v) => visitor.visit_u32(v), - Content::U64(v) => visitor.visit_u64(v), - Content::I8(v) => visitor.visit_i8(v), - Content::I16(v) => visitor.visit_i16(v), - Content::I32(v) => visitor.visit_i32(v), - Content::I64(v) => visitor.visit_i64(v), - Content::F32(v) => visitor.visit_f32(v), - Content::F64(v) => visitor.visit_f64(v), - Content::Char(v) => visitor.visit_char(v), - Content::String(v) => visitor.visit_string(v), - Content::Unit => visitor.visit_unit(), - Content::None => visitor.visit_none(), - Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), - Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)), - Content::Seq(v) => { - let seq = v.into_iter().map(ContentDeserializer::new); - let mut seq_visitor = de::value::SeqDeserializer::new(seq); - let value = try!(visitor.visit_seq(&mut seq_visitor)); - try!(seq_visitor.end()); - Ok(value) - } - Content::Map(v) => { - let map = v.into_iter().map(|(k, v)| { - (ContentDeserializer::new(k), - ContentDeserializer::new(v)) - }); - let mut map_visitor = de::value::MapDeserializer::new(map); - let value = try!(visitor.visit_map(&mut map_visitor)); - try!(map_visitor.end()); - Ok(value) - } - Content::Bytes(v) => visitor.visit_byte_buf(v), - } - } - - fn deserialize_option(self, visitor: V) -> Result - where V: Visitor - { - match self.content { - Content::None => visitor.visit_none(), - Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), - Content::Unit => visitor.visit_unit(), - _ => visitor.visit_some(self), - } - } - - fn deserialize_newtype_struct(self, _name: &str, visitor: V) -> Result - where V: Visitor - { - visitor.visit_newtype_struct(self) - } - - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: Visitor - { - let (variant, value) = match self.content { - Content::Map(value) => { - let mut iter = value.into_iter(); - let (variant, value) = match iter.next() { - Some(v) => v, - None => { - return Err(de::Error::invalid_value(de::Unexpected::Map, - &"map with a single key")); - } - }; - // enums are encoded in json as maps with a single key:value pair - if iter.next().is_some() { - return Err(de::Error::invalid_value(de::Unexpected::Map, - &"map with a single key")); - } - (variant, Some(value)) - } - Content::String(variant) => (Content::String(variant), None), - other => { - return Err(de::Error::invalid_type(other.unexpected(), &"string or map")); - } - }; - - visitor.visit_enum(EnumDeserializer { - variant: variant, - value: value, - err: PhantomData, - }) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct tuple_struct struct - struct_field tuple ignored_any - } -} - -impl ContentDeserializer { - /// private API, don't use - pub fn new(content: Content) -> Self { - ContentDeserializer { - content: content, - err: PhantomData, - } - } -} - -struct EnumDeserializer - where E: de::Error -{ - variant: Content, - value: Option, - err: PhantomData, -} - -impl de::EnumVisitor for EnumDeserializer - where E: de::Error -{ - type Error = E; - type Variant = VariantDeserializer; - - fn visit_variant_seed(self, - seed: V) - -> Result<(V::Value, VariantDeserializer), Self::Error> - where V: de::DeserializeSeed - { - let visitor = VariantDeserializer { - value: self.value, - err: PhantomData, - }; - seed.deserialize(ContentDeserializer::new(self.variant)).map(|v| (v, visitor)) - } -} - -struct VariantDeserializer - where E: de::Error -{ - value: Option, - err: PhantomData, -} - -impl de::VariantVisitor for VariantDeserializer - where E: de::Error -{ - type Error = E; - - fn visit_unit(self) -> Result<(), E> { - match self.value { - Some(value) => de::Deserialize::deserialize(ContentDeserializer::new(value)), - None => Ok(()), - } - } - - fn visit_newtype_seed(self, seed: T) -> Result - where T: de::DeserializeSeed - { - match self.value { - Some(value) => seed.deserialize(ContentDeserializer::new(value)), - None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"newtype variant")), - } - } - - fn visit_tuple(self, _len: usize, visitor: V) -> Result - where V: de::Visitor - { - match self.value { - Some(Content::Seq(v)) => { - de::Deserializer::deserialize(SeqDeserializer::new(v), visitor) - } - Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"tuple variant")), - None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"tuple variant")), - } - } - - fn visit_struct(self, - _fields: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor - { - match self.value { - Some(Content::Map(v)) => { - de::Deserializer::deserialize(MapDeserializer::new(v), visitor) - } - Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"struct variant")), - _ => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"struct variant")), - } - } -} - -struct SeqDeserializer - where E: de::Error -{ - iter: as IntoIterator>::IntoIter, - err: PhantomData, -} - -impl SeqDeserializer - where E: de::Error -{ - fn new(vec: Vec) -> Self { - SeqDeserializer { - iter: vec.into_iter(), - err: PhantomData, - } - } -} - -impl de::Deserializer for SeqDeserializer - where E: de::Error -{ - type Error = E; - - #[inline] - fn deserialize(mut self, visitor: V) -> Result - where V: de::Visitor - { - let len = self.iter.len(); - if len == 0 { - visitor.visit_unit() - } else { - let ret = try!(visitor.visit_seq(&mut self)); - let remaining = self.iter.len(); - if remaining == 0 { - Ok(ret) - } else { - Err(de::Error::invalid_length(len, &"fewer elements in array")) - } - } - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any - } -} - -impl de::SeqVisitor for SeqDeserializer - where E: de::Error -{ - type Error = E; - - fn visit_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed - { - match self.iter.next() { - Some(value) => seed.deserialize(ContentDeserializer::new(value)).map(Some), - None => Ok(None), - } - } - - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -struct MapDeserializer - where E: de::Error -{ - iter: as IntoIterator>::IntoIter, - value: Option, - err: PhantomData, -} - -impl MapDeserializer - where E: de::Error -{ - fn new(map: Vec<(Content, Content)>) -> Self { - MapDeserializer { - iter: map.into_iter(), - value: None, - err: PhantomData, - } - } -} - -impl de::MapVisitor for MapDeserializer - where E: de::Error -{ - type Error = E; - - fn visit_key_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed - { - match self.iter.next() { - Some((key, value)) => { - self.value = Some(value); - seed.deserialize(ContentDeserializer::new(key)).map(Some) - } - None => Ok(None), - } - } - - fn visit_value_seed(&mut self, seed: T) -> Result - where T: de::DeserializeSeed - { - match self.value.take() { - Some(value) => seed.deserialize(ContentDeserializer::new(value)), - None => Err(de::Error::custom("value is missing")), - } - } - - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -impl de::Deserializer for MapDeserializer - where E: de::Error -{ - type Error = E; - - #[inline] - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor - { - visitor.visit_map(self) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any - } -} - - -/// Not public API. -pub struct ContentRefDeserializer<'a, E> { - content: &'a Content, - err: PhantomData, -} - -/// Used when deserializing an untagged enum because the content may need to be -/// used more than once. -impl<'a, E> Deserializer for ContentRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - fn deserialize(self, visitor: V) -> Result - where V: Visitor - { - match *self.content { - Content::Bool(v) => visitor.visit_bool(v), - Content::U8(v) => visitor.visit_u8(v), - Content::U16(v) => visitor.visit_u16(v), - Content::U32(v) => visitor.visit_u32(v), - Content::U64(v) => visitor.visit_u64(v), - Content::I8(v) => visitor.visit_i8(v), - Content::I16(v) => visitor.visit_i16(v), - Content::I32(v) => visitor.visit_i32(v), - Content::I64(v) => visitor.visit_i64(v), - Content::F32(v) => visitor.visit_f32(v), - Content::F64(v) => visitor.visit_f64(v), - Content::Char(v) => visitor.visit_char(v), - Content::String(ref v) => visitor.visit_str(v), - Content::Unit => visitor.visit_unit(), - Content::None => visitor.visit_none(), - Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), - Content::Newtype(ref v) => visitor.visit_newtype_struct(ContentRefDeserializer::new(v)), - Content::Seq(ref v) => { - let seq = v.into_iter().map(ContentRefDeserializer::new); - let mut seq_visitor = de::value::SeqDeserializer::new(seq); - let value = try!(visitor.visit_seq(&mut seq_visitor)); - try!(seq_visitor.end()); - Ok(value) - } - Content::Map(ref v) => { - let map = v.into_iter().map(|&(ref k, ref v)| { - (ContentRefDeserializer::new(k), - ContentRefDeserializer::new(v)) - }); - let mut map_visitor = de::value::MapDeserializer::new(map); - let value = try!(visitor.visit_map(&mut map_visitor)); - try!(map_visitor.end()); - Ok(value) - } - Content::Bytes(ref v) => visitor.visit_bytes(v), - } - } - - fn deserialize_option(self, visitor: V) -> Result - where V: Visitor - { - match *self.content { - Content::None => visitor.visit_none(), - Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), - Content::Unit => visitor.visit_unit(), - _ => visitor.visit_some(self), - } - } - - fn deserialize_newtype_struct(self, _name: &str, visitor: V) -> Result - where V: Visitor - { - visitor.visit_newtype_struct(self) - } - - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: Visitor - { - let (variant, value) = match *self.content { - Content::Map(ref value) => { - let mut iter = value.into_iter(); - let &(ref variant, ref value) = match iter.next() { - Some(v) => v, - None => { - return Err(de::Error::invalid_value(de::Unexpected::Map, - &"map with a single key")); - } - }; - // enums are encoded in json as maps with a single key:value pair - if iter.next().is_some() { - return Err(de::Error::invalid_value(de::Unexpected::Map, - &"map with a single key")); - } - (variant, Some(value)) - } - ref s @ Content::String(_) => (s, None), - ref other => { - return Err(de::Error::invalid_type(other.unexpected(), &"string or map")); - } - }; - - visitor.visit_enum(EnumRefDeserializer { - variant: variant, - value: value, - err: PhantomData, - }) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct tuple_struct struct - struct_field tuple ignored_any - } -} - -impl<'a, E> ContentRefDeserializer<'a, E> { - /// private API, don't use - pub fn new(content: &'a Content) -> Self { - ContentRefDeserializer { - content: content, - err: PhantomData, - } - } -} - -struct EnumRefDeserializer<'a, E> - where E: de::Error -{ - variant: &'a Content, - value: Option<&'a Content>, - err: PhantomData, -} - -impl<'a, E> de::EnumVisitor for EnumRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - type Variant = VariantRefDeserializer<'a, Self::Error>; - - fn visit_variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> - where V: de::DeserializeSeed - { - let visitor = VariantRefDeserializer { - value: self.value, - err: PhantomData, - }; - seed.deserialize(ContentRefDeserializer::new(self.variant)).map(|v| (v, visitor)) - } -} - -struct VariantRefDeserializer<'a, E> - where E: de::Error -{ - value: Option<&'a Content>, - err: PhantomData, -} - -impl<'a, E> de::VariantVisitor for VariantRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - fn visit_unit(self) -> Result<(), E> { - match self.value { - Some(value) => de::Deserialize::deserialize(ContentRefDeserializer::new(value)), - None => Ok(()), - } - } - - fn visit_newtype_seed(self, seed: T) -> Result - where T: de::DeserializeSeed - { - match self.value { - Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), - None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"newtype variant")), - } - } - - fn visit_tuple(self, _len: usize, visitor: V) -> Result - where V: de::Visitor - { - match self.value { - Some(&Content::Seq(ref v)) => { - de::Deserializer::deserialize(SeqRefDeserializer::new(v), visitor) - } - Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"tuple variant")), - None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"tuple variant")), - } - } - - fn visit_struct(self, - _fields: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor - { - match self.value { - Some(&Content::Map(ref v)) => { - de::Deserializer::deserialize(MapRefDeserializer::new(v), visitor) - } - Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"struct variant")), - _ => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"struct variant")), - } - } -} - -struct SeqRefDeserializer<'a, E> - where E: de::Error -{ - iter: <&'a [Content] as IntoIterator>::IntoIter, - err: PhantomData, -} - -impl<'a, E> SeqRefDeserializer<'a, E> - where E: de::Error -{ - fn new(vec: &'a [Content]) -> Self { - SeqRefDeserializer { - iter: vec.into_iter(), - err: PhantomData, - } - } -} - -impl<'a, E> de::Deserializer for SeqRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - #[inline] - fn deserialize(mut self, visitor: V) -> Result - where V: de::Visitor - { - let len = self.iter.len(); - if len == 0 { - visitor.visit_unit() - } else { - let ret = try!(visitor.visit_seq(&mut self)); - let remaining = self.iter.len(); - if remaining == 0 { - Ok(ret) - } else { - Err(de::Error::invalid_length(len, &"fewer elements in array")) - } - } - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any - } -} - -impl<'a, E> de::SeqVisitor for SeqRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - fn visit_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed - { - match self.iter.next() { - Some(value) => seed.deserialize(ContentRefDeserializer::new(value)).map(Some), - None => Ok(None), - } - } - - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -struct MapRefDeserializer<'a, E> - where E: de::Error -{ - iter: <&'a [(Content, Content)] as IntoIterator>::IntoIter, - value: Option<&'a Content>, - err: PhantomData, -} - -impl<'a, E> MapRefDeserializer<'a, E> - where E: de::Error -{ - fn new(map: &'a [(Content, Content)]) -> Self { - MapRefDeserializer { - iter: map.into_iter(), - value: None, - err: PhantomData, - } - } -} - -impl<'a, E> de::MapVisitor for MapRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - fn visit_key_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed - { - match self.iter.next() { - Some(&(ref key, ref value)) => { - self.value = Some(value); - seed.deserialize(ContentRefDeserializer::new(key)).map(Some) - } - None => Ok(None), - } - } - - fn visit_value_seed(&mut self, seed: T) -> Result - where T: de::DeserializeSeed - { - match self.value.take() { - Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), - None => Err(de::Error::custom("value is missing")), - } - } - - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -impl<'a, E> de::Deserializer for MapRefDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - #[inline] - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor - { - visitor.visit_map(self) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any - } -} - -impl de::value::ValueDeserializer for ContentDeserializer - where E: de::Error -{ - type Deserializer = Self; - - fn into_deserializer(self) -> Self { - self - } -} - -impl<'a, E> de::value::ValueDeserializer for ContentRefDeserializer<'a, E> - where E: de::Error -{ - type Deserializer = Self; - - fn into_deserializer(self) -> Self { - self - } -} - -/// Visitor for deserializing an internally tagged unit variant. -/// -/// Not public API. -pub struct InternallyTaggedUnitVisitor<'a> { - type_name: &'a str, - variant_name: &'a str, -} - -impl<'a> InternallyTaggedUnitVisitor<'a> { - /// Not public API. - pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { - InternallyTaggedUnitVisitor { - type_name: type_name, - variant_name: variant_name, - } - } -} - -impl<'a> Visitor for InternallyTaggedUnitVisitor<'a> { - type Value = (); - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "unit variant {}::{}", self.type_name, self.variant_name) - } - - fn visit_map(self, _: V) -> Result<(), V::Error> - where V: MapVisitor - { - Ok(()) - } -} - -/// Visitor for deserializing an untagged unit variant. -/// -/// Not public API. -pub struct UntaggedUnitVisitor<'a> { - type_name: &'a str, - variant_name: &'a str, -} - -impl<'a> UntaggedUnitVisitor<'a> { - /// Not public API. - pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { - UntaggedUnitVisitor { - type_name: type_name, - variant_name: variant_name, - } - } -} - -impl<'a> Visitor for UntaggedUnitVisitor<'a> { - type Value = (); - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "unit variant {}::{}", self.type_name, self.variant_name) - } - - fn visit_unit(self) -> Result<(), E> - where E: de::Error - { - Ok(()) - } -} diff -Nru distinst-0.1.0/vendor/serde/src/de/from_primitive.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/from_primitive.rs --- distinst-0.1.0/vendor/serde/src/de/from_primitive.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/from_primitive.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,4 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. +// Copyright 2017 Serde Developers // // Licensed under the Apache License, Version 2.0 or the MIT license @@ -8,402 +6,111 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Extracted from https://github.com/rust-num/num. +use lib::*; -// Rust 1.5 is unhappy that this private module is undocumented. -#![allow(missing_docs)] - -use core::{usize, u8, u16, u32, u64}; -use core::{isize, i8, i16, i32, i64}; -use core::{f32, f64}; -use core::mem::size_of; - -/// Numbers which have upper and lower bounds -pub trait Bounded { - // FIXME (#5527): These should be associated constants - /// returns the smallest finite number this type can represent - fn min_value() -> Self; - /// returns the largest finite number this type can represent - fn max_value() -> Self; -} - -macro_rules! bounded_impl { - ($t:ty, $min:expr, $max:expr) => { - impl Bounded for $t { - #[inline] - fn min_value() -> $t { $min } - - #[inline] - fn max_value() -> $t { $max } - } - } -} - -bounded_impl!(usize, usize::MIN, usize::MAX); -bounded_impl!(u8, u8::MIN, u8::MAX); -bounded_impl!(u16, u16::MIN, u16::MAX); -bounded_impl!(u32, u32::MIN, u32::MAX); -bounded_impl!(u64, u64::MIN, u64::MAX); - -bounded_impl!(isize, isize::MIN, isize::MAX); -bounded_impl!(i8, i8::MIN, i8::MAX); -bounded_impl!(i16, i16::MIN, i16::MAX); -bounded_impl!(i32, i32::MIN, i32::MAX); -bounded_impl!(i64, i64::MIN, i64::MAX); - -bounded_impl!(f32, f32::MIN, f32::MAX); -bounded_impl!(f64, f64::MIN, f64::MAX); - -/// A generic trait for converting a value to a number. -pub trait ToPrimitive { - /// Converts the value of `self` to an `isize`. - #[inline] - fn to_isize(&self) -> Option { - self.to_i64().and_then(|x| x.to_isize()) - } - - /// Converts the value of `self` to an `i8`. - #[inline] - fn to_i8(&self) -> Option { - self.to_i64().and_then(|x| x.to_i8()) - } - - /// Converts the value of `self` to an `i16`. - #[inline] - fn to_i16(&self) -> Option { - self.to_i64().and_then(|x| x.to_i16()) - } - - /// Converts the value of `self` to an `i32`. - #[inline] - fn to_i32(&self) -> Option { - self.to_i64().and_then(|x| x.to_i32()) - } - - /// Converts the value of `self` to an `i64`. - fn to_i64(&self) -> Option; - - /// Converts the value of `self` to a `usize`. - #[inline] - fn to_usize(&self) -> Option { - self.to_u64().and_then(|x| x.to_usize()) - } - - /// Converts the value of `self` to an `u8`. - #[inline] - fn to_u8(&self) -> Option { - self.to_u64().and_then(|x| x.to_u8()) - } - - /// Converts the value of `self` to an `u16`. - #[inline] - fn to_u16(&self) -> Option { - self.to_u64().and_then(|x| x.to_u16()) - } - - /// Converts the value of `self` to an `u32`. - #[inline] - fn to_u32(&self) -> Option { - self.to_u64().and_then(|x| x.to_u32()) - } - - /// Converts the value of `self` to an `u64`. - #[inline] - fn to_u64(&self) -> Option; - - /// Converts the value of `self` to an `f32`. - #[inline] - fn to_f32(&self) -> Option { - self.to_f64().and_then(|x| x.to_f32()) - } - - /// Converts the value of `self` to an `f64`. - #[inline] - fn to_f64(&self) -> Option { - self.to_i64().and_then(|x| x.to_f64()) - } -} - -macro_rules! impl_to_primitive_int_to_int { - ($SrcT:ty, $DstT:ty, $slf:expr) => ( - { - if size_of::<$SrcT>() <= size_of::<$DstT>() { - Some($slf as $DstT) - } else { - let n = $slf as i64; - let min_value: $DstT = Bounded::min_value(); - let max_value: $DstT = Bounded::max_value(); - if min_value as i64 <= n && n <= max_value as i64 { - Some($slf as $DstT) - } else { - None - } - } - } - ) -} - -macro_rules! impl_to_primitive_int_to_uint { - ($SrcT:ty, $DstT:ty, $slf:expr) => ( - { - let zero: $SrcT = 0; - let max_value: $DstT = Bounded::max_value(); - if zero <= $slf && $slf as u64 <= max_value as u64 { - Some($slf as $DstT) - } else { - None - } - } - ) -} - -macro_rules! impl_to_primitive_int { - ($T:ty) => ( - impl ToPrimitive for $T { - #[inline] - fn to_isize(&self) -> Option { impl_to_primitive_int_to_int!($T, isize, *self) } - #[inline] - fn to_i8(&self) -> Option { impl_to_primitive_int_to_int!($T, i8, *self) } - #[inline] - fn to_i16(&self) -> Option { impl_to_primitive_int_to_int!($T, i16, *self) } - #[inline] - fn to_i32(&self) -> Option { impl_to_primitive_int_to_int!($T, i32, *self) } - #[inline] - fn to_i64(&self) -> Option { impl_to_primitive_int_to_int!($T, i64, *self) } - - #[inline] - fn to_usize(&self) -> Option { impl_to_primitive_int_to_uint!($T, usize, *self) } - #[inline] - fn to_u8(&self) -> Option { impl_to_primitive_int_to_uint!($T, u8, *self) } - #[inline] - fn to_u16(&self) -> Option { impl_to_primitive_int_to_uint!($T, u16, *self) } - #[inline] - fn to_u32(&self) -> Option { impl_to_primitive_int_to_uint!($T, u32, *self) } - #[inline] - fn to_u64(&self) -> Option { impl_to_primitive_int_to_uint!($T, u64, *self) } - - #[inline] - fn to_f32(&self) -> Option { Some(*self as f32) } - #[inline] - fn to_f64(&self) -> Option { Some(*self as f64) } +macro_rules! int_to_int { + ($dst:ident, $n:ident) => ( + if $dst::MIN as i64 <= $n as i64 && $n as i64 <= $dst::MAX as i64 { + Some($n as $dst) + } else { + None } ) } -impl_to_primitive_int! { isize } -impl_to_primitive_int! { i8 } -impl_to_primitive_int! { i16 } -impl_to_primitive_int! { i32 } -impl_to_primitive_int! { i64 } - -macro_rules! impl_to_primitive_uint_to_int { - ($DstT:ty, $slf:expr) => ( - { - let max_value: $DstT = Bounded::max_value(); - if $slf as u64 <= max_value as u64 { - Some($slf as $DstT) - } else { - None - } +macro_rules! int_to_uint { + ($dst:ident, $n:ident) => ( + if 0 <= $n && $n as u64 <= $dst::MAX as u64 { + Some($n as $dst) + } else { + None } ) } -macro_rules! impl_to_primitive_uint_to_uint { - ($SrcT:ty, $DstT:ty, $slf:expr) => ( - { - if size_of::<$SrcT>() <= size_of::<$DstT>() { - Some($slf as $DstT) - } else { - let zero: $SrcT = 0; - let max_value: $DstT = Bounded::max_value(); - if zero <= $slf && $slf as u64 <= max_value as u64 { - Some($slf as $DstT) - } else { - None - } - } +macro_rules! uint_to { + ($dst:ident, $n:ident) => ( + if $n as u64 <= $dst::MAX as u64 { + Some($n as $dst) + } else { + None } ) } -macro_rules! impl_to_primitive_uint { - ($T:ty) => ( - impl ToPrimitive for $T { - #[inline] - fn to_isize(&self) -> Option { impl_to_primitive_uint_to_int!(isize, *self) } - #[inline] - fn to_i8(&self) -> Option { impl_to_primitive_uint_to_int!(i8, *self) } - #[inline] - fn to_i16(&self) -> Option { impl_to_primitive_uint_to_int!(i16, *self) } - #[inline] - fn to_i32(&self) -> Option { impl_to_primitive_uint_to_int!(i32, *self) } - #[inline] - fn to_i64(&self) -> Option { impl_to_primitive_uint_to_int!(i64, *self) } - - #[inline] - fn to_usize(&self) -> Option { - impl_to_primitive_uint_to_uint!($T, usize, *self) - } - #[inline] - fn to_u8(&self) -> Option { impl_to_primitive_uint_to_uint!($T, u8, *self) } - #[inline] - fn to_u16(&self) -> Option { impl_to_primitive_uint_to_uint!($T, u16, *self) } - #[inline] - fn to_u32(&self) -> Option { impl_to_primitive_uint_to_uint!($T, u32, *self) } - #[inline] - fn to_u64(&self) -> Option { impl_to_primitive_uint_to_uint!($T, u64, *self) } - - #[inline] - fn to_f32(&self) -> Option { Some(*self as f32) } - #[inline] - fn to_f64(&self) -> Option { Some(*self as f64) } - } - ) +pub trait FromPrimitive: Sized { + fn from_isize(n: isize) -> Option; + fn from_i8(n: i8) -> Option; + fn from_i16(n: i16) -> Option; + fn from_i32(n: i32) -> Option; + fn from_i64(n: i64) -> Option; + fn from_usize(n: usize) -> Option; + fn from_u8(n: u8) -> Option; + fn from_u16(n: u16) -> Option; + fn from_u32(n: u32) -> Option; + fn from_u64(n: u64) -> Option; } -impl_to_primitive_uint! { usize } -impl_to_primitive_uint! { u8 } -impl_to_primitive_uint! { u16 } -impl_to_primitive_uint! { u32 } -impl_to_primitive_uint! { u64 } - -macro_rules! impl_to_primitive_float_to_float { - ($SrcT:ident, $DstT:ident, $slf:expr) => ( - if size_of::<$SrcT>() <= size_of::<$DstT>() { - Some($slf as $DstT) - } else { - let n = $slf as f64; - let max_value: $SrcT = ::core::$SrcT::MAX; - if -max_value as f64 <= n && n <= max_value as f64 { - Some($slf as $DstT) - } else { - None - } +macro_rules! impl_from_primitive_for_int { + ($t:ident) => ( + impl FromPrimitive for $t { + #[inline] fn from_isize(n: isize) -> Option { int_to_int!($t, n) } + #[inline] fn from_i8(n: i8) -> Option { int_to_int!($t, n) } + #[inline] fn from_i16(n: i16) -> Option { int_to_int!($t, n) } + #[inline] fn from_i32(n: i32) -> Option { int_to_int!($t, n) } + #[inline] fn from_i64(n: i64) -> Option { int_to_int!($t, n) } + #[inline] fn from_usize(n: usize) -> Option { uint_to!($t, n) } + #[inline] fn from_u8(n: u8) -> Option { uint_to!($t, n) } + #[inline] fn from_u16(n: u16) -> Option { uint_to!($t, n) } + #[inline] fn from_u32(n: u32) -> Option { uint_to!($t, n) } + #[inline] fn from_u64(n: u64) -> Option { uint_to!($t, n) } } ) } -macro_rules! impl_to_primitive_float { - ($T:ident) => ( - impl ToPrimitive for $T { - #[inline] - fn to_isize(&self) -> Option { Some(*self as isize) } - #[inline] - fn to_i8(&self) -> Option { Some(*self as i8) } - #[inline] - fn to_i16(&self) -> Option { Some(*self as i16) } - #[inline] - fn to_i32(&self) -> Option { Some(*self as i32) } - #[inline] - fn to_i64(&self) -> Option { Some(*self as i64) } - - #[inline] - fn to_usize(&self) -> Option { Some(*self as usize) } - #[inline] - fn to_u8(&self) -> Option { Some(*self as u8) } - #[inline] - fn to_u16(&self) -> Option { Some(*self as u16) } - #[inline] - fn to_u32(&self) -> Option { Some(*self as u32) } - #[inline] - fn to_u64(&self) -> Option { Some(*self as u64) } - - #[inline] - fn to_f32(&self) -> Option { impl_to_primitive_float_to_float!($T, f32, *self) } - #[inline] - fn to_f64(&self) -> Option { impl_to_primitive_float_to_float!($T, f64, *self) } +macro_rules! impl_from_primitive_for_uint { + ($t:ident) => ( + impl FromPrimitive for $t { + #[inline] fn from_isize(n: isize) -> Option { int_to_uint!($t, n) } + #[inline] fn from_i8(n: i8) -> Option { int_to_uint!($t, n) } + #[inline] fn from_i16(n: i16) -> Option { int_to_uint!($t, n) } + #[inline] fn from_i32(n: i32) -> Option { int_to_uint!($t, n) } + #[inline] fn from_i64(n: i64) -> Option { int_to_uint!($t, n) } + #[inline] fn from_usize(n: usize) -> Option { uint_to!($t, n) } + #[inline] fn from_u8(n: u8) -> Option { uint_to!($t, n) } + #[inline] fn from_u16(n: u16) -> Option { uint_to!($t, n) } + #[inline] fn from_u32(n: u32) -> Option { uint_to!($t, n) } + #[inline] fn from_u64(n: u64) -> Option { uint_to!($t, n) } } ) } -impl_to_primitive_float! { f32 } -impl_to_primitive_float! { f64 } - -pub trait FromPrimitive: Sized { - #[inline] - fn from_isize(n: isize) -> Option { - FromPrimitive::from_i64(n as i64) - } - - #[inline] - fn from_i8(n: i8) -> Option { - FromPrimitive::from_i64(n as i64) - } - - #[inline] - fn from_i16(n: i16) -> Option { - FromPrimitive::from_i64(n as i64) - } - - #[inline] - fn from_i32(n: i32) -> Option { - FromPrimitive::from_i64(n as i64) - } - - fn from_i64(n: i64) -> Option; - - #[inline] - fn from_usize(n: usize) -> Option { - FromPrimitive::from_u64(n as u64) - } - - #[inline] - fn from_u8(n: u8) -> Option { - FromPrimitive::from_u64(n as u64) - } - - #[inline] - fn from_u16(n: u16) -> Option { - FromPrimitive::from_u64(n as u64) - } - - #[inline] - fn from_u32(n: u32) -> Option { - FromPrimitive::from_u64(n as u64) - } - - fn from_u64(n: u64) -> Option; - - #[inline] - fn from_f32(n: f32) -> Option { - FromPrimitive::from_f64(n as f64) - } - - #[inline] - fn from_f64(n: f64) -> Option { - FromPrimitive::from_i64(n as i64) - } -} - -macro_rules! impl_from_primitive { - ($T:ty, $to_ty:ident) => ( - impl FromPrimitive for $T { - #[inline] fn from_i8(n: i8) -> Option<$T> { n.$to_ty() } - #[inline] fn from_i16(n: i16) -> Option<$T> { n.$to_ty() } - #[inline] fn from_i32(n: i32) -> Option<$T> { n.$to_ty() } - #[inline] fn from_i64(n: i64) -> Option<$T> { n.$to_ty() } - - #[inline] fn from_u8(n: u8) -> Option<$T> { n.$to_ty() } - #[inline] fn from_u16(n: u16) -> Option<$T> { n.$to_ty() } - #[inline] fn from_u32(n: u32) -> Option<$T> { n.$to_ty() } - #[inline] fn from_u64(n: u64) -> Option<$T> { n.$to_ty() } - - #[inline] fn from_f32(n: f32) -> Option<$T> { n.$to_ty() } - #[inline] fn from_f64(n: f64) -> Option<$T> { n.$to_ty() } +macro_rules! impl_from_primitive_for_float { + ($t:ident) => ( + impl FromPrimitive for $t { + #[inline] fn from_isize(n: isize) -> Option { Some(n as Self) } + #[inline] fn from_i8(n: i8) -> Option { Some(n as Self) } + #[inline] fn from_i16(n: i16) -> Option { Some(n as Self) } + #[inline] fn from_i32(n: i32) -> Option { Some(n as Self) } + #[inline] fn from_i64(n: i64) -> Option { Some(n as Self) } + #[inline] fn from_usize(n: usize) -> Option { Some(n as Self) } + #[inline] fn from_u8(n: u8) -> Option { Some(n as Self) } + #[inline] fn from_u16(n: u16) -> Option { Some(n as Self) } + #[inline] fn from_u32(n: u32) -> Option { Some(n as Self) } + #[inline] fn from_u64(n: u64) -> Option { Some(n as Self) } } ) } -impl_from_primitive! { isize, to_isize } -impl_from_primitive! { i8, to_i8 } -impl_from_primitive! { i16, to_i16 } -impl_from_primitive! { i32, to_i32 } -impl_from_primitive! { i64, to_i64 } -impl_from_primitive! { usize, to_usize } -impl_from_primitive! { u8, to_u8 } -impl_from_primitive! { u16, to_u16 } -impl_from_primitive! { u32, to_u32 } -impl_from_primitive! { u64, to_u64 } -impl_from_primitive! { f32, to_f32 } -impl_from_primitive! { f64, to_f64 } +impl_from_primitive_for_int!(isize); +impl_from_primitive_for_int!(i8); +impl_from_primitive_for_int!(i16); +impl_from_primitive_for_int!(i32); +impl_from_primitive_for_int!(i64); +impl_from_primitive_for_uint!(usize); +impl_from_primitive_for_uint!(u8); +impl_from_primitive_for_uint!(u16); +impl_from_primitive_for_uint!(u32); +impl_from_primitive_for_uint!(u64); +impl_from_primitive_for_float!(f32); +impl_from_primitive_for_float!(f64); diff -Nru distinst-0.1.0/vendor/serde/src/de/ignored_any.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/ignored_any.rs --- distinst-0.1.0/vendor/serde/src/de/ignored_any.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/ignored_any.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,215 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use lib::*; + +use de::{Deserialize, Deserializer, Visitor, SeqAccess, MapAccess, Error}; + +/// An efficient way of discarding data from a deserializer. +/// +/// Think of this like `serde_json::Value` in that it can be deserialized from +/// any type, except that it does not store any information about the data that +/// gets deserialized. +/// +/// ```rust +/// use std::fmt; +/// use std::marker::PhantomData; +/// +/// use serde::de::{self, Deserialize, DeserializeSeed, Deserializer, Visitor, SeqAccess, IgnoredAny}; +/// +/// /// A seed that can be used to deserialize only the `n`th element of a sequence +/// /// while efficiently discarding elements of any type before or after index `n`. +/// /// +/// /// For example to deserialize only the element at index 3: +/// /// +/// /// ```rust +/// /// NthElement::new(3).deserialize(deserializer) +/// /// ``` +/// pub struct NthElement { +/// n: usize, +/// marker: PhantomData, +/// } +/// +/// impl NthElement { +/// pub fn new(n: usize) -> Self { +/// NthElement { +/// n: n, +/// marker: PhantomData, +/// } +/// } +/// } +/// +/// impl<'de, T> Visitor<'de> for NthElement +/// where T: Deserialize<'de> +/// { +/// type Value = T; +/// +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "a sequence in which we care about element {}", self.n) +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result +/// where A: SeqAccess<'de> +/// { +/// // Skip over the first `n` elements. +/// for i in 0..self.n { +/// // It is an error if the sequence ends before we get to element `n`. +/// if seq.next_element::()?.is_none() { +/// return Err(de::Error::invalid_length(i, &self)); +/// } +/// } +/// +/// // Deserialize the one we care about. +/// let nth = match seq.next_element()? { +/// Some(nth) => nth, +/// None => { +/// return Err(de::Error::invalid_length(self.n, &self)); +/// } +/// }; +/// +/// // Skip over any remaining elements in the sequence after `n`. +/// while let Some(IgnoredAny) = seq.next_element()? { +/// // ignore +/// } +/// +/// Ok(nth) +/// } +/// } +/// +/// impl<'de, T> DeserializeSeed<'de> for NthElement +/// where T: Deserialize<'de> +/// { +/// type Value = T; +/// +/// fn deserialize(self, deserializer: D) -> Result +/// where D: Deserializer<'de> +/// { +/// deserializer.deserialize_seq(self) +/// } +/// } +/// +/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error> +/// # where D: Deserializer<'de> +/// # { +/// // Deserialize only the sequence element at index 3 from this deserializer. +/// // The element at index 3 is required to be a string. Elements before and +/// // after index 3 are allowed to be of any type. +/// let s: String = NthElement::new(3).deserialize(deserializer)?; +/// # Ok(()) +/// # } +/// ``` +#[derive(Copy, Clone, Debug, Default)] +pub struct IgnoredAny; + +impl<'de> Visitor<'de> for IgnoredAny { + type Value = IgnoredAny; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("anything at all") + } + + #[inline] + fn visit_bool(self, x: bool) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_i64(self, x: i64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_u64(self, x: u64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_f64(self, x: f64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + let _ = s; + Ok(IgnoredAny) + } + + #[inline] + fn visit_none(self) -> Result { + Ok(IgnoredAny) + } + + #[inline] + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + IgnoredAny::deserialize(deserializer) + } + + #[inline] + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + IgnoredAny::deserialize(deserializer) + } + + #[inline] + fn visit_unit(self) -> Result { + Ok(IgnoredAny) + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + while let Some(IgnoredAny) = try!(seq.next_element()) { + // Gobble + } + Ok(IgnoredAny) + } + + #[inline] + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + while let Some((IgnoredAny, IgnoredAny)) = try!(map.next_entry()) { + // Gobble + } + Ok(IgnoredAny) + } + + #[inline] + fn visit_bytes(self, bytes: &[u8]) -> Result + where + E: Error, + { + let _ = bytes; + Ok(IgnoredAny) + } +} + +impl<'de> Deserialize<'de> for IgnoredAny { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_ignored_any(IgnoredAny) + } +} diff -Nru distinst-0.1.0/vendor/serde/src/de/impls.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/impls.rs --- distinst-0.1.0/vendor/serde/src/de/impls.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/impls.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,79 +1,29 @@ -//! This module contains `Deserialize` and `Visitor` implementations. - -#[cfg(feature = "std")] -use std::borrow::Cow; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::borrow::Cow; - -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque, Vec, String}; - -#[cfg(feature = "std")] -use std::collections::{HashMap, HashSet, BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque}; - -#[cfg(feature = "collections")] -use collections::borrow::ToOwned; - -#[cfg(any(feature = "std", feature = "collections"))] -use core::cmp; -use core::fmt; -#[cfg(feature = "std")] -use core::hash::{Hash, BuildHasher}; -use core::marker::PhantomData; -#[cfg(all(feature="unstable"))] -use core::mem; -#[cfg(feature = "std")] -use std::net; -#[cfg(feature = "std")] -use std::path; -#[cfg(all(feature="unstable"))] -use core::slice; -use core::str; -#[cfg(feature = "std")] -use std::ffi::{CString, OsString}; -#[cfg(all(feature = "std", feature="unstable"))] -use std::ffi::CStr; - -#[cfg(feature = "std")] -use std::rc::Rc; -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::rc::Rc; - -#[cfg(feature = "std")] -use std::sync::Arc; -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::arc::Arc; - -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::boxed::Box; - -use core::cell::{Cell, RefCell}; - -#[cfg(feature = "std")] -use std::sync::{Mutex, RwLock}; +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. -#[cfg(feature = "std")] -use std::time::Duration; +use lib::*; -#[cfg(feature = "std")] -use std; +use de::{Deserialize, Deserializer, EnumAccess, Error, SeqAccess, Unexpected, VariantAccess, + Visitor}; -#[cfg(feature = "unstable")] -use core::nonzero::{NonZero, Zeroable}; +#[cfg(any(feature = "std", feature = "alloc"))] +use de::MapAccess; -use de::{Deserialize, Deserializer, EnumVisitor, Error, MapVisitor, SeqVisitor, Unexpected, - VariantVisitor, Visitor}; use de::from_primitive::FromPrimitive; -#[cfg(feature = "std")] -use bytes::ByteBuf; +#[cfg(any(feature = "std", feature = "alloc"))] +use private::de::size_hint; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A visitor that produces a `()`. -pub struct UnitVisitor; +struct UnitVisitor; -impl Visitor for UnitVisitor { +impl<'de> Visitor<'de> for UnitVisitor { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -81,32 +31,27 @@ } fn visit_unit(self) -> Result<(), E> - where E: Error - { - Ok(()) - } - - fn visit_seq(self, _: V) -> Result<(), V::Error> - where V: SeqVisitor + where + E: Error, { Ok(()) } } -impl Deserialize for () { +impl<'de> Deserialize<'de> for () { fn deserialize(deserializer: D) -> Result<(), D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_unit(UnitVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A visitor that produces a `bool`. -pub struct BoolVisitor; +struct BoolVisitor; -impl Visitor for BoolVisitor { +impl<'de> Visitor<'de> for BoolVisitor { type Value = bool; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -114,37 +59,30 @@ } fn visit_bool(self, v: bool) -> Result - where E: Error + where + E: Error, { Ok(v) } - - fn visit_str(self, s: &str) -> Result - where E: Error - { - match s.trim_matches(::utils::Pattern_White_Space) { - "true" => Ok(true), - "false" => Ok(false), - _ => Err(Error::invalid_type(Unexpected::Str(s), &self)), - } - } } -impl Deserialize for bool { +impl<'de> Deserialize<'de> for bool { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_bool(BoolVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -macro_rules! impl_deserialize_num_method { - ($ty:ident, $src_ty:ident, $method:ident, $from_method:ident, $group:ident, $group_ty:ident) => { +macro_rules! visit_integer_method { + ($src_ty:ident, $method:ident, $from_method:ident, $group:ident, $group_ty:ident) => { #[inline] - fn $method(self, v: $src_ty) -> Result<$ty, E> - where E: Error, + fn $method(self, v: $src_ty) -> Result + where + E: Error, { match FromPrimitive::$from_method(v) { Some(v) => Ok(v), @@ -154,67 +92,83 @@ } } +macro_rules! visit_float_method { + ($src_ty:ident, $method:ident) => { + #[inline] + fn $method(self, v: $src_ty) -> Result + where + E: Error, + { + Ok(v as Self::Value) + } + } +} + macro_rules! impl_deserialize_num { - ($ty:ident, $method:ident) => { - impl Deserialize for $ty { + ($ty:ident, $method:ident, $($visit:ident),*) => { + impl<'de> Deserialize<'de> for $ty { #[inline] fn deserialize(deserializer: D) -> Result<$ty, D::Error> - where D: Deserializer, + where + D: Deserializer<'de>, { struct PrimitiveVisitor; - impl Visitor for PrimitiveVisitor { + impl<'de> Visitor<'de> for PrimitiveVisitor { type Value = $ty; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str(stringify!($ty)) } - impl_deserialize_num_method!($ty, i8, visit_i8, from_i8, Signed, i64); - impl_deserialize_num_method!($ty, i16, visit_i16, from_i16, Signed, i64); - impl_deserialize_num_method!($ty, i32, visit_i32, from_i32, Signed, i64); - impl_deserialize_num_method!($ty, i64, visit_i64, from_i64, Signed, i64); - impl_deserialize_num_method!($ty, u8, visit_u8, from_u8, Unsigned, u64); - impl_deserialize_num_method!($ty, u16, visit_u16, from_u16, Unsigned, u64); - impl_deserialize_num_method!($ty, u32, visit_u32, from_u32, Unsigned, u64); - impl_deserialize_num_method!($ty, u64, visit_u64, from_u64, Unsigned, u64); - impl_deserialize_num_method!($ty, f32, visit_f32, from_f32, Float, f64); - impl_deserialize_num_method!($ty, f64, visit_f64, from_f64, Float, f64); - - #[inline] - fn visit_str(self, s: &str) -> Result<$ty, E> - where E: Error, - { - str::FromStr::from_str(s.trim_matches(::utils::Pattern_White_Space)).or_else(|_| { - Err(Error::invalid_type(Unexpected::Str(s), &self)) - }) - } + $( + impl_deserialize_num!($visit $ty); + )* } deserializer.$method(PrimitiveVisitor) } } - } -} + }; + + (integer $ty:ident) => { + visit_integer_method!(i8, visit_i8, from_i8, Signed, i64); + visit_integer_method!(i16, visit_i16, from_i16, Signed, i64); + visit_integer_method!(i32, visit_i32, from_i32, Signed, i64); + visit_integer_method!(i64, visit_i64, from_i64, Signed, i64); + + visit_integer_method!(u8, visit_u8, from_u8, Unsigned, u64); + visit_integer_method!(u16, visit_u16, from_u16, Unsigned, u64); + visit_integer_method!(u32, visit_u32, from_u32, Unsigned, u64); + visit_integer_method!(u64, visit_u64, from_u64, Unsigned, u64); + }; + + (float $ty:ident) => { + visit_float_method!(f32, visit_f32); + visit_float_method!(f64, visit_f64); + }; +} + +impl_deserialize_num!(i8, deserialize_i8, integer); +impl_deserialize_num!(i16, deserialize_i16, integer); +impl_deserialize_num!(i32, deserialize_i32, integer); +impl_deserialize_num!(i64, deserialize_i64, integer); +impl_deserialize_num!(isize, deserialize_i64, integer); + +impl_deserialize_num!(u8, deserialize_u8, integer); +impl_deserialize_num!(u16, deserialize_u16, integer); +impl_deserialize_num!(u32, deserialize_u32, integer); +impl_deserialize_num!(u64, deserialize_u64, integer); +impl_deserialize_num!(usize, deserialize_u64, integer); -impl_deserialize_num!(isize, deserialize_i64); -impl_deserialize_num!(i8, deserialize_i8); -impl_deserialize_num!(i16, deserialize_i16); -impl_deserialize_num!(i32, deserialize_i32); -impl_deserialize_num!(i64, deserialize_i64); -impl_deserialize_num!(usize, deserialize_u64); -impl_deserialize_num!(u8, deserialize_u8); -impl_deserialize_num!(u16, deserialize_u16); -impl_deserialize_num!(u32, deserialize_u32); -impl_deserialize_num!(u64, deserialize_u64); -impl_deserialize_num!(f32, deserialize_f32); -impl_deserialize_num!(f64, deserialize_f64); +impl_deserialize_num!(f32, deserialize_f32, integer, float); +impl_deserialize_num!(f64, deserialize_f64, integer, float); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// struct CharVisitor; -impl Visitor for CharVisitor { +impl<'de> Visitor<'de> for CharVisitor { type Value = char; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -223,14 +177,16 @@ #[inline] fn visit_char(self, v: char) -> Result - where E: Error + where + E: Error, { Ok(v) } #[inline] fn visit_str(self, v: &str) -> Result - where E: Error + where + E: Error, { let mut iter = v.chars(); match (iter.next(), iter.next()) { @@ -240,22 +196,23 @@ } } -impl Deserialize for char { +impl<'de> Deserialize<'de> for char { #[inline] fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_char(CharVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] struct StringVisitor; -#[cfg(any(feature = "std", feature = "collections"))] -impl Visitor for StringVisitor { +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de> Visitor<'de> for StringVisitor { type Value = String; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -263,25 +220,22 @@ } fn visit_str(self, v: &str) -> Result - where E: Error + where + E: Error, { Ok(v.to_owned()) } fn visit_string(self, v: String) -> Result - where E: Error + where + E: Error, { Ok(v) } - fn visit_unit(self) -> Result - where E: Error - { - Ok(String::new()) - } - fn visit_bytes(self, v: &[u8]) -> Result - where E: Error + where + E: Error, { match str::from_utf8(v) { Ok(s) => Ok(s.to_owned()), @@ -290,53 +244,188 @@ } fn visit_byte_buf(self, v: Vec) -> Result - where E: Error + where + E: Error, { match String::from_utf8(v) { Ok(s) => Ok(s), - Err(e) => Err(Error::invalid_value(Unexpected::Bytes(&e.into_bytes()), &self)), + Err(e) => Err(Error::invalid_value(Unexpected::Bytes(&e.into_bytes()), &self),), } } } -#[cfg(any(feature = "std", feature = "collections"))] -impl Deserialize for String { +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de> Deserialize<'de> for String { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_string(StringVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +struct StrVisitor; + +impl<'a> Visitor<'a> for StrVisitor { + type Value = &'a str; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a borrowed string") + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(v) // so easy + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + str::from_utf8(v).map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self)) + } +} + +impl<'de: 'a, 'a> Deserialize<'de> for &'a str { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(StrVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct BytesVisitor; + +impl<'a> Visitor<'a> for BytesVisitor { + type Value = &'a [u8]; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a borrowed byte array") + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + Ok(v) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(v.as_bytes()) + } +} -#[cfg(all(feature = "std", feature="unstable"))] -impl Deserialize for Box { +impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8] { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { - let s = try!(CString::deserialize(deserializer)); - Ok(s.into_boxed_c_str()) + deserializer.deserialize_bytes(BytesVisitor) } } +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +struct CStringVisitor; + #[cfg(feature = "std")] -impl Deserialize for CString { +impl<'de> Visitor<'de> for CStringVisitor { + type Value = CString; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("byte array") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let len = size_hint::cautious(seq.size_hint()); + let mut values = Vec::with_capacity(len); + + while let Some(value) = try!(seq.next_element()) { + values.push(value); + } + + CString::new(values).map_err(Error::custom) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for CString { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { - let bytes = try!(ByteBuf::deserialize(deserializer)); - CString::new(bytes).map_err(Error::custom) + deserializer.deserialize_byte_buf(CStringVisitor) + } +} + +macro_rules! forwarded_impl { + (( $($id: ident),* ), $ty: ty, $func: expr) => { + impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map($func) + } + } } } -/////////////////////////////////////////////////////////////////////////////// +#[cfg(all(feature = "std", feature = "unstable"))] +forwarded_impl!((), Box, CString::into_boxed_c_str); + +//////////////////////////////////////////////////////////////////////////////// struct OptionVisitor { marker: PhantomData, } -impl Visitor for OptionVisitor { +impl<'de, T> Visitor<'de> for OptionVisitor +where + T: Deserialize<'de>, +{ type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -345,44 +434,48 @@ #[inline] fn visit_unit(self) -> Result, E> - where E: Error + where + E: Error, { Ok(None) } #[inline] fn visit_none(self) -> Result, E> - where E: Error + where + E: Error, { Ok(None) } #[inline] fn visit_some(self, deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { - Ok(Some(try!(Deserialize::deserialize(deserializer)))) + T::deserialize(deserializer).map(Some) } } -impl Deserialize for Option - where T: Deserialize +impl<'de, T> Deserialize<'de> for Option +where + T: Deserialize<'de>, { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_option(OptionVisitor { marker: PhantomData }) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A visitor that produces a `PhantomData`. -pub struct PhantomDataVisitor { +struct PhantomDataVisitor { marker: PhantomData, } -impl Visitor for PhantomDataVisitor { +impl<'de, T> Visitor<'de> for PhantomDataVisitor { type Value = PhantomData; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -391,160 +484,141 @@ #[inline] fn visit_unit(self) -> Result, E> - where E: Error + where + E: Error, { Ok(PhantomData) } } -impl Deserialize for PhantomData { +impl<'de, T> Deserialize<'de> for PhantomData { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { let visitor = PhantomDataVisitor { marker: PhantomData }; deserializer.deserialize_unit_struct("PhantomData", visitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +#[cfg(any(feature = "std", feature = "alloc"))] macro_rules! seq_impl { ( - $ty:ty, - $visitor_ty:ident < $($typaram:ident : $bound1:ident $(+ $bound2:ident)*),* >, - $visitor:ident, + $ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $access:ident, $ctor:expr, $with_capacity:expr, $insert:expr ) => { - /// A visitor that produces a sequence. - pub struct $visitor_ty<$($typaram),*> { - marker: PhantomData<$ty>, - } - - impl<$($typaram),*> $visitor_ty<$($typaram),*> - where $($typaram: $bound1 $(+ $bound2)*),* + impl<'de, T $(, $typaram)*> Deserialize<'de> for $ty + where + T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound1 $(+ $bound2)*,)* { - /// Construct a new sequence visitor. - pub fn new() -> Self { - $visitor_ty { - marker: PhantomData, + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SeqVisitor { + marker: PhantomData<$ty>, } - } - } - impl<$($typaram),*> Visitor for $visitor_ty<$($typaram),*> - where $($typaram: $bound1 $(+ $bound2)*),* - { - type Value = $ty; + impl<'de, T $(, $typaram)*> Visitor<'de> for SeqVisitor + where + T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound1 $(+ $bound2)*,)* + { + type Value = $ty; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("a sequence") - } + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a sequence") + } - #[inline] - fn visit_unit(self) -> Result<$ty, E> - where E: Error, - { - Ok($ctor) - } + #[inline] + fn visit_seq(self, mut $access: A) -> Result + where + A: SeqAccess<'de>, + { + let mut values = $with_capacity; - #[inline] - fn visit_seq(self, mut $visitor: V) -> Result<$ty, V::Error> - where V: SeqVisitor, - { - let mut values = $with_capacity; + while let Some(value) = try!($access.next_element()) { + $insert(&mut values, value); + } - while let Some(value) = try!($visitor.visit()) { - $insert(&mut values, value); + Ok(values) + } } - Ok(values) - } - } - - impl<$($typaram),*> Deserialize for $ty - where $($typaram: $bound1 $(+ $bound2)*),* - { - fn deserialize(deserializer: D) -> Result<$ty, D::Error> - where D: Deserializer, - { - deserializer.deserialize_seq($visitor_ty::new()) + let visitor = SeqVisitor { marker: PhantomData }; + deserializer.deserialize_seq(visitor) } } } } -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] seq_impl!( - BinaryHeap, - BinaryHeapVisitor, - visitor, + BinaryHeap, + seq, BinaryHeap::new(), - BinaryHeap::with_capacity(cmp::min(visitor.size_hint().0, 4096)), + BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())), BinaryHeap::push); -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] seq_impl!( - BTreeSet, - BTreeSetVisitor, - visitor, + BTreeSet, + seq, BTreeSet::new(), BTreeSet::new(), BTreeSet::insert); -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] seq_impl!( LinkedList, - LinkedListVisitor, - visitor, + seq, LinkedList::new(), LinkedList::new(), LinkedList::push_back); #[cfg(feature = "std")] seq_impl!( - HashSet, - HashSetVisitor, - visitor, + HashSet, + seq, HashSet::with_hasher(S::default()), - HashSet::with_capacity_and_hasher(cmp::min(visitor.size_hint().0, 4096), S::default()), + HashSet::with_capacity_and_hasher(size_hint::cautious(seq.size_hint()), S::default()), HashSet::insert); -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] seq_impl!( Vec, - VecVisitor, - visitor, + seq, Vec::new(), - Vec::with_capacity(cmp::min(visitor.size_hint().0, 4096)), + Vec::with_capacity(size_hint::cautious(seq.size_hint())), Vec::push); -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] seq_impl!( VecDeque, - VecDequeVisitor, - visitor, + seq, VecDeque::new(), - VecDeque::with_capacity(cmp::min(visitor.size_hint().0, 4096)), + VecDeque::with_capacity(size_hint::cautious(seq.size_hint())), VecDeque::push_back); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// struct ArrayVisitor { marker: PhantomData, } impl ArrayVisitor { - pub fn new() -> Self { + fn new() -> Self { ArrayVisitor { marker: PhantomData } } } -impl Visitor for ArrayVisitor<[T; 0]> - where T: Deserialize -{ +impl<'de, T> Visitor<'de> for ArrayVisitor<[T; 0]> { type Value = [T; 0]; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -552,34 +626,31 @@ } #[inline] - fn visit_unit(self) -> Result<[T; 0], E> - where E: Error - { - Ok([]) - } - - #[inline] - fn visit_seq(self, _: V) -> Result<[T; 0], V::Error> - where V: SeqVisitor + fn visit_seq(self, _: A) -> Result<[T; 0], A::Error> + where + A: SeqAccess<'de>, { Ok([]) } } -impl Deserialize for [T; 0] - where T: Deserialize -{ +// Does not require T: Deserialize<'de>. +impl<'de, T> Deserialize<'de> for [T; 0] { fn deserialize(deserializer: D) -> Result<[T; 0], D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { - deserializer.deserialize_seq_fixed_size(0, ArrayVisitor::<[T; 0]>::new()) + deserializer.deserialize_tuple(0, ArrayVisitor::<[T; 0]>::new()) } } macro_rules! array_impls { ($($len:expr => ($($n:tt $name:ident)+))+) => { $( - impl Visitor for ArrayVisitor<[T; $len]> where T: Deserialize { + impl<'de, T> Visitor<'de> for ArrayVisitor<[T; $len]> + where + T: Deserialize<'de>, + { type Value = [T; $len]; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -587,11 +658,12 @@ } #[inline] - fn visit_seq(self, mut visitor: V) -> Result<[T; $len], V::Error> - where V: SeqVisitor, + fn visit_seq(self, mut seq: A) -> Result<[T; $len], A::Error> + where + A: SeqAccess<'de>, { $( - let $name = match try!(visitor.visit()) { + let $name = match try!(seq.next_element()) { Some(val) => val, None => return Err(Error::invalid_length($n, &self)), }; @@ -601,13 +673,15 @@ } } - impl Deserialize for [T; $len] - where T: Deserialize, + impl<'de, T> Deserialize<'de> for [T; $len] + where + T: Deserialize<'de>, { fn deserialize(deserializer: D) -> Result<[T; $len], D::Error> - where D: Deserializer, + where + D: Deserializer<'de>, { - deserializer.deserialize_seq_fixed_size($len, ArrayVisitor::<[T; $len]>::new()) + deserializer.deserialize_tuple($len, ArrayVisitor::<[T; $len]>::new()) } } )+ @@ -649,24 +723,22 @@ 32 => (0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10 k 11 l 12 m 13 n 14 o 15 p 16 q 17 r 18 s 19 t 20 u 21 v 22 w 23 x 24 y 25 z 26 aa 27 ab 28 ac 29 ad 30 ae 31 af) } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// macro_rules! tuple_impls { - ($($len:expr => $visitor:ident => ($($n:tt $name:ident)+))+) => { + ($($len:tt $visitor:ident => ($($n:tt $name:ident)+))+) => { $( - /// Construct a tuple visitor. - pub struct $visitor<$($name,)+> { + struct $visitor<$($name,)+> { marker: PhantomData<($($name,)+)>, } - impl<$($name: Deserialize,)+> $visitor<$($name,)+> { - /// Construct a `TupleVisitor*`. - pub fn new() -> Self { + impl<$($name,)+> $visitor<$($name,)+> { + fn new() -> Self { $visitor { marker: PhantomData } } } - impl<$($name: Deserialize),+> Visitor for $visitor<$($name,)+> { + impl<'de, $($name: Deserialize<'de>),+> Visitor<'de> for $visitor<$($name,)+> { type Value = ($($name,)+); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -675,11 +747,12 @@ #[inline] #[allow(non_snake_case)] - fn visit_seq(self, mut visitor: V) -> Result<($($name,)+), V::Error> - where V: SeqVisitor, + fn visit_seq(self, mut seq: A) -> Result<($($name,)+), A::Error> + where + A: SeqAccess<'de>, { $( - let $name = match try!(visitor.visit()) { + let $name = match try!(seq.next_element()) { Some(value) => value, None => return Err(Error::invalid_length($n, &self)), }; @@ -689,10 +762,11 @@ } } - impl<$($name: Deserialize),+> Deserialize for ($($name,)+) { + impl<'de, $($name: Deserialize<'de>),+> Deserialize<'de> for ($($name,)+) { #[inline] fn deserialize(deserializer: D) -> Result<($($name,)+), D::Error> - where D: Deserializer, + where + D: Deserializer<'de>, { deserializer.deserialize_tuple($len, $visitor::new()) } @@ -702,301 +776,394 @@ } tuple_impls! { - 1 => TupleVisitor1 => (0 T0) - 2 => TupleVisitor2 => (0 T0 1 T1) - 3 => TupleVisitor3 => (0 T0 1 T1 2 T2) - 4 => TupleVisitor4 => (0 T0 1 T1 2 T2 3 T3) - 5 => TupleVisitor5 => (0 T0 1 T1 2 T2 3 T3 4 T4) - 6 => TupleVisitor6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5) - 7 => TupleVisitor7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6) - 8 => TupleVisitor8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7) - 9 => TupleVisitor9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8) - 10 => TupleVisitor10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9) - 11 => TupleVisitor11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10) - 12 => TupleVisitor12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11) - 13 => TupleVisitor13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12) - 14 => TupleVisitor14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13) - 15 => TupleVisitor15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14) - 16 => TupleVisitor16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15) + 1 TupleVisitor1 => (0 T0) + 2 TupleVisitor2 => (0 T0 1 T1) + 3 TupleVisitor3 => (0 T0 1 T1 2 T2) + 4 TupleVisitor4 => (0 T0 1 T1 2 T2 3 T3) + 5 TupleVisitor5 => (0 T0 1 T1 2 T2 3 T3 4 T4) + 6 TupleVisitor6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5) + 7 TupleVisitor7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6) + 8 TupleVisitor8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7) + 9 TupleVisitor9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8) + 10 TupleVisitor10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9) + 11 TupleVisitor11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10) + 12 TupleVisitor12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11) + 13 TupleVisitor13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12) + 14 TupleVisitor14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13) + 15 TupleVisitor15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14) + 16 TupleVisitor16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15) } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +#[cfg(any(feature = "std", feature = "alloc"))] macro_rules! map_impl { ( - $ty:ty, - $visitor_ty:ident < $($typaram:ident : $bound1:ident $(+ $bound2:ident)*),* >, - $visitor:ident, + $ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $access:ident, $ctor:expr, $with_capacity:expr ) => { - /// A visitor that produces a map. - pub struct $visitor_ty<$($typaram),*> { - marker: PhantomData<$ty>, - } - - impl<$($typaram),*> $visitor_ty<$($typaram),*> - where $($typaram: $bound1 $(+ $bound2)*),* + impl<'de, K, V $(, $typaram)*> Deserialize<'de> for $ty + where + K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*, + V: Deserialize<'de>, + $($typaram: $bound1 $(+ $bound2)*),* { - /// Construct a `MapVisitor*`. - pub fn new() -> Self { - $visitor_ty { - marker: PhantomData, + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct MapVisitor { + marker: PhantomData<$ty>, } - } - } - impl<$($typaram),*> Visitor for $visitor_ty<$($typaram),*> - where $($typaram: $bound1 $(+ $bound2)*),* - { - type Value = $ty; + impl<'de, K, V $(, $typaram)*> Visitor<'de> for MapVisitor + where + K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*, + V: Deserialize<'de>, + $($typaram: $bound1 $(+ $bound2)*),* + { + type Value = $ty; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("a map") - } + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a map") + } - #[inline] - fn visit_unit(self) -> Result<$ty, E> - where E: Error, - { - Ok($ctor) - } + #[inline] + fn visit_map(self, mut $access: A) -> Result + where + A: MapAccess<'de>, + { + let mut values = $with_capacity; - #[inline] - fn visit_map(self, mut $visitor: Visitor) -> Result<$ty, Visitor::Error> - where Visitor: MapVisitor, - { - let mut values = $with_capacity; + while let Some((key, value)) = try!($access.next_entry()) { + values.insert(key, value); + } - while let Some((key, value)) = try!($visitor.visit()) { - values.insert(key, value); + Ok(values) + } } - Ok(values) - } - } - - impl<$($typaram),*> Deserialize for $ty - where $($typaram: $bound1 $(+ $bound2)*),* - { - fn deserialize(deserializer: D) -> Result<$ty, D::Error> - where D: Deserializer, - { - deserializer.deserialize_map($visitor_ty::new()) + let visitor = MapVisitor { marker: PhantomData }; + deserializer.deserialize_map(visitor) } } } } -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] map_impl!( - BTreeMap, - BTreeMapVisitor, - visitor, + BTreeMap, + map, BTreeMap::new(), BTreeMap::new()); #[cfg(feature = "std")] map_impl!( - HashMap, - HashMapVisitor, - visitor, + HashMap, + map, HashMap::with_hasher(S::default()), - HashMap::with_capacity_and_hasher(cmp::min(visitor.size_hint().0, 4096), S::default())); + HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default())); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "std")] -impl Deserialize for net::IpAddr { - fn deserialize(deserializer: D) -> Result - where D: Deserializer - { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), +macro_rules! parse_ip_impl { + ($ty:ty; $size: expr) => { + impl<'de> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + let s = try!(String::deserialize(deserializer)); + s.parse().map_err(Error::custom) + } else { + <[u8; $size]>::deserialize(deserializer).map(<$ty>::from) + } + } } } } #[cfg(feature = "std")] -impl Deserialize for net::Ipv4Addr { - fn deserialize(deserializer: D) -> Result - where D: Deserializer - { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), +macro_rules! variant_identifier { + ( + $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) + $expecting_message: expr, + $variants_name: ident + ) => { + enum $name_kind { + $( $variant ),* + } + + static $variants_name: &'static [&'static str] = &[ $( stringify!($variant) ),*]; + + impl<'de> Deserialize<'de> for $name_kind { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct KindVisitor; + + impl<'de> Visitor<'de> for KindVisitor { + type Value = $name_kind; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str($expecting_message) + } + + fn visit_u32(self, value: u32) -> Result + where + E: Error, + { + match value { + $( + $index => Ok($name_kind :: $variant), + )* + _ => Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self),), + } + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + $( + stringify!($variant) => Ok($name_kind :: $variant), + )* + _ => Err(Error::unknown_variant(value, $variants_name)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + $( + $bytes => Ok($name_kind :: $variant), + )* + _ => { + match str::from_utf8(value) { + Ok(value) => Err(Error::unknown_variant(value, $variants_name)), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(value), &self)), + } + } + } + } + } + + deserializer.deserialize_identifier(KindVisitor) + } } } } #[cfg(feature = "std")] -impl Deserialize for net::Ipv6Addr { - fn deserialize(deserializer: D) -> Result - where D: Deserializer - { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), +macro_rules! deserialize_enum { + ( + $name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) + $expecting_message: expr, + $deserializer: expr + ) => { + variant_identifier!{ + $name_kind ( $($variant; $bytes; $index),* ) + $expecting_message, + VARIANTS } + + struct EnumVisitor; + impl<'de> Visitor<'de> for EnumVisitor { + type Value = $name; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("a ", stringify!($name))) + } + + + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + match try!(data.variant()) { + $( + ($name_kind :: $variant, v) => v.newtype_variant().map($name :: $variant), + )* + } + } + } + $deserializer.deserialize_enum(stringify!($name), VARIANTS, EnumVisitor) } } -/////////////////////////////////////////////////////////////////////////////// - #[cfg(feature = "std")] -impl Deserialize for net::SocketAddr { +impl<'de> Deserialize<'de> for net::IpAddr { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), + if deserializer.is_human_readable() { + let s = try!(String::deserialize(deserializer)); + s.parse().map_err(Error::custom) + } else { + use lib::net::IpAddr; + deserialize_enum!{ + IpAddr IpAddrKind (V4; b"V4"; 0, V6; b"V6"; 1) + "`V4` or `V6`", + deserializer + } } } } #[cfg(feature = "std")] -impl Deserialize for net::SocketAddrV4 { - fn deserialize(deserializer: D) -> Result - where D: Deserializer - { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), +parse_ip_impl!(net::Ipv4Addr; 4); + +#[cfg(feature = "std")] +parse_ip_impl!(net::Ipv6Addr; 16); + +#[cfg(feature = "std")] +macro_rules! parse_socket_impl { + ($ty:ty, $new: expr) => { + impl<'de> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + let s = try!(String::deserialize(deserializer)); + s.parse().map_err(Error::custom) + } else { + <(_, u16)>::deserialize(deserializer).map(|(ip, port)| $new(ip, port)) + } + } } } } #[cfg(feature = "std")] -impl Deserialize for net::SocketAddrV6 { +impl<'de> Deserialize<'de> for net::SocketAddr { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { - let s = try!(String::deserialize(deserializer)); - match s.parse() { - Ok(s) => Ok(s), - Err(err) => Err(D::Error::custom(err)), + if deserializer.is_human_readable() { + let s = try!(String::deserialize(deserializer)); + s.parse().map_err(Error::custom) + } else { + use lib::net::SocketAddr; + deserialize_enum!{ + SocketAddr SocketAddrKind (V4; b"V4"; 0, V6; b"V6"; 1) + "`V4` or `V6`", + deserializer + } } } } -/////////////////////////////////////////////////////////////////////////////// +#[cfg(feature = "std")] +parse_socket_impl!(net::SocketAddrV4, net::SocketAddrV4::new); #[cfg(feature = "std")] -struct PathBufVisitor; +parse_socket_impl!(net::SocketAddrV6, |ip, port| net::SocketAddrV6::new(ip, port, 0, 0)); + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +struct PathVisitor; #[cfg(feature = "std")] -impl Visitor for PathBufVisitor { - type Value = path::PathBuf; +impl<'a> Visitor<'a> for PathVisitor { + type Value = &'a Path; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("path string") + formatter.write_str("a borrowed path") } - fn visit_str(self, v: &str) -> Result - where E: Error + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, { - Ok(From::from(v)) + Ok(v.as_ref()) } - fn visit_string(self, v: String) -> Result - where E: Error + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, { - Ok(From::from(v)) + str::from_utf8(v) + .map(AsRef::as_ref) + .map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self)) } } - #[cfg(feature = "std")] -impl Deserialize for path::PathBuf { - fn deserialize(deserializer: D) -> Result - where D: Deserializer +impl<'de: 'a, 'a> Deserialize<'de> for &'a Path { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, { - deserializer.deserialize_string(PathBufVisitor) + deserializer.deserialize_str(PathVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +#[cfg(feature = "std")] +struct PathBufVisitor; -#[cfg(all(feature = "std", any(unix, windows)))] -enum OsStringKind { - Unix, - Windows, -} +#[cfg(feature = "std")] +impl<'de> Visitor<'de> for PathBufVisitor { + type Value = PathBuf; -#[cfg(all(feature = "std", any(unix, windows)))] -static OSSTR_VARIANTS: &'static [&'static str] = &["Unix", "Windows"]; + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("path string") + } -#[cfg(all(feature = "std", any(unix, windows)))] -impl Deserialize for OsStringKind { - fn deserialize(deserializer: D) -> Result - where D: Deserializer + fn visit_str(self, v: &str) -> Result + where + E: Error, { - struct KindVisitor; - - impl Visitor for KindVisitor { - type Value = OsStringKind; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("`Unix` or `Windows`") - } + Ok(From::from(v)) + } - fn visit_u32(self, value: u32) -> Result - where E: Error, - { - match value { - 0 => Ok(OsStringKind::Unix), - 1 => Ok(OsStringKind::Windows), - _ => Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self)) - } - } + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(From::from(v)) + } +} - fn visit_str(self, value: &str) -> Result - where E: Error, - { - match value { - "Unix" => Ok(OsStringKind::Unix), - "Windows" => Ok(OsStringKind::Windows), - _ => Err(Error::unknown_variant(value, OSSTR_VARIANTS)), - } - } +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for PathBuf { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_string(PathBufVisitor) + } +} - fn visit_bytes(self, value: &[u8]) -> Result - where E: Error, - { - match value { - b"Unix" => Ok(OsStringKind::Unix), - b"Windows" => Ok(OsStringKind::Windows), - _ => { - match str::from_utf8(value) { - Ok(value) => Err(Error::unknown_variant(value, OSSTR_VARIANTS)), - Err(_) => { - Err(Error::invalid_value(Unexpected::Bytes(value), &self)) - } - } - } - } - } - } +//////////////////////////////////////////////////////////////////////////////// - deserializer.deserialize(KindVisitor) - } +// If this were outside of the serde crate, it would just use: +// +// #[derive(Deserialize)] +// #[serde(variant_identifier)] +#[cfg(all(feature = "std", any(unix, windows)))] +variant_identifier!{ + OsStringKind (Unix; b"Unix"; 0, Windows; b"Windows"; 1) + "`Unix` or `Windows`", + OSSTR_VARIANTS } #[cfg(all(feature = "std", any(unix, windows)))] struct OsStringVisitor; #[cfg(all(feature = "std", any(unix, windows)))] -impl Visitor for OsStringVisitor { +impl<'de> Visitor<'de> for OsStringVisitor { type Value = OsString; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1004,152 +1171,125 @@ } #[cfg(unix)] - fn visit_enum(self, visitor: V) -> Result - where V: EnumVisitor, + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, { use std::os::unix::ffi::OsStringExt; - match try!(visitor.visit_variant()) { - (OsStringKind::Unix, variant) => { - variant.visit_newtype().map(OsString::from_vec) - } - (OsStringKind::Windows, _) => { - Err(Error::custom("cannot deserialize Windows OS string on Unix")) - } + match try!(data.variant()) { + (OsStringKind::Unix, v) => v.newtype_variant().map(OsString::from_vec), + (OsStringKind::Windows, _) => Err(Error::custom("cannot deserialize Windows OS string on Unix",),), } } #[cfg(windows)] - fn visit_enum(self, visitor: V) -> Result - where V: EnumVisitor, + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, { use std::os::windows::ffi::OsStringExt; - match try!(visitor.visit_variant()) { - (OsStringKind::Windows, variant) => { - variant.visit_newtype::>().map(|vec| OsString::from_wide(&vec)) - } - (OsStringKind::Unix, _) => { - Err(Error::custom("cannot deserialize Unix OS string on Windows")) + match try!(data.variant()) { + (OsStringKind::Windows, v) => { + v.newtype_variant::>() + .map(|vec| OsString::from_wide(&vec)) } + (OsStringKind::Unix, _) => Err(Error::custom("cannot deserialize Unix OS string on Windows",),), } } } #[cfg(all(feature = "std", any(unix, windows)))] -impl Deserialize for OsString { +impl<'de> Deserialize<'de> for OsString { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { deserializer.deserialize_enum("OsString", OSSTR_VARIANTS, OsStringVisitor) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(any(feature = "std", feature = "alloc"))] -impl Deserialize for Box { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Box::new(val)) - } -} - -#[cfg(any(feature = "std", feature = "collections"))] -impl Deserialize for Box<[T]> { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let v: Vec = try!(Deserialize::deserialize(deserializer)); - Ok(v.into_boxed_slice()) - } -} - -#[cfg(any(feature = "std", feature = "collections"))] -impl Deserialize for Box { - fn deserialize(deserializer: D) -> Result - where D: Deserializer - { - let s = try!(String::deserialize(deserializer)); - Ok(s.into_boxed_str()) - } -} +forwarded_impl!((T), Box, Box::new); #[cfg(any(feature = "std", feature = "alloc"))] -impl Deserialize for Arc { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Arc::new(val)) - } -} +forwarded_impl!((T), Box<[T]>, Vec::into_boxed_slice); #[cfg(any(feature = "std", feature = "alloc"))] -impl Deserialize for Rc { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Rc::new(val)) - } -} +forwarded_impl!((), Box, String::into_boxed_str); -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, T: ?Sized> Deserialize for Cow<'a, T> - where T: ToOwned, - T::Owned: Deserialize +#[cfg(all(not(feature = "unstable"), feature = "rc", any(feature = "std", feature = "alloc")))] +forwarded_impl!((T), Arc, Arc::new); + +#[cfg(all(not(feature = "unstable"), feature = "rc", any(feature = "std", feature = "alloc")))] +forwarded_impl!((T), Rc, Rc::new); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T> +where + T: ToOwned, + T::Owned: Deserialize<'de>, { #[inline] fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Cow::Owned(val)) + T::Owned::deserialize(deserializer).map(Cow::Owned) } } -impl Deserialize for Cell { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Cell::new(val)) +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))] +macro_rules! box_forwarded_impl { + ($t:ident) => { + impl<'de, T: ?Sized> Deserialize<'de> for $t + where + Box: Deserialize<'de>, + { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Box::deserialize(deserializer).map(Into::into) + } + } } } -impl Deserialize for RefCell { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer +#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))] +box_forwarded_impl!(Rc); + +#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))] +box_forwarded_impl!(Arc); + +//////////////////////////////////////////////////////////////////////////////// + +impl<'de, T> Deserialize<'de> for Cell +where + T: Deserialize<'de> + Copy, +{ + fn deserialize(deserializer: D) -> Result, D::Error> + where + D: Deserializer<'de>, { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(RefCell::new(val)) + T::deserialize(deserializer).map(Cell::new) } } +forwarded_impl!((T), RefCell, RefCell::new); + #[cfg(feature = "std")] -impl Deserialize for Mutex { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(Mutex::new(val)) - } -} +forwarded_impl!((T), Mutex, Mutex::new); #[cfg(feature = "std")] -impl Deserialize for RwLock { - fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer - { - let val = try!(Deserialize::deserialize(deserializer)); - Ok(RwLock::new(val)) - } -} +forwarded_impl!((T), RwLock, RwLock::new); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // This is a cleaned-up version of the impl generated by: // @@ -1160,22 +1300,28 @@ // nanos: u32, // } #[cfg(feature = "std")] -impl Deserialize for Duration { +impl<'de> Deserialize<'de> for Duration { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(field_identifier, rename_all = "lowercase")] enum Field { Secs, Nanos, }; - impl Deserialize for Field { + impl<'de> Deserialize<'de> for Field { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { struct FieldVisitor; - impl Visitor for FieldVisitor { + impl<'de> Visitor<'de> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1183,7 +1329,8 @@ } fn visit_str(self, value: &str) -> Result - where E: Error + where + E: Error, { match value { "secs" => Ok(Field::Secs), @@ -1193,7 +1340,8 @@ } fn visit_bytes(self, value: &[u8]) -> Result - where E: Error + where + E: Error, { match value { b"secs" => Ok(Field::Secs), @@ -1206,29 +1354,30 @@ } } - deserializer.deserialize_struct_field(FieldVisitor) + deserializer.deserialize_identifier(FieldVisitor) } } struct DurationVisitor; - impl Visitor for DurationVisitor { + impl<'de> Visitor<'de> for DurationVisitor { type Value = Duration; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("struct Duration") } - fn visit_seq(self, mut visitor: V) -> Result - where V: SeqVisitor + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, { - let secs: u64 = match try!(visitor.visit()) { + let secs: u64 = match try!(seq.next_element()) { Some(value) => value, None => { return Err(Error::invalid_length(0, &self)); } }; - let nanos: u32 = match try!(visitor.visit()) { + let nanos: u32 = match try!(seq.next_element()) { Some(value) => value, None => { return Err(Error::invalid_length(1, &self)); @@ -1237,34 +1386,35 @@ Ok(Duration::new(secs, nanos)) } - fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, { let mut secs: Option = None; let mut nanos: Option = None; - while let Some(key) = try!(visitor.visit_key::()) { + while let Some(key) = try!(map.next_key()) { match key { Field::Secs => { if secs.is_some() { - return Err(::duplicate_field("secs")); + return Err(::duplicate_field("secs")); } - secs = Some(try!(visitor.visit_value())); + secs = Some(try!(map.next_value())); } Field::Nanos => { if nanos.is_some() { - return Err(::duplicate_field("nanos")); + return Err(::duplicate_field("nanos")); } - nanos = Some(try!(visitor.visit_value())); + nanos = Some(try!(map.next_value())); } } } let secs = match secs { Some(secs) => secs, - None => return Err(::missing_field("secs")), + None => return Err(::missing_field("secs")), }; let nanos = match nanos { Some(nanos) => nanos, - None => return Err(::missing_field("nanos")), + None => return Err(::missing_field("nanos")), }; Ok(Duration::new(secs, nanos)) } @@ -1275,7 +1425,133 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for SystemTime { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Reuse duration + enum Field { + Secs, + Nanos, + }; + + impl<'de> Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`secs_since_epoch` or `nanos_since_epoch`") + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "secs_since_epoch" => Ok(Field::Secs), + "nanos_since_epoch" => Ok(Field::Nanos), + _ => Err(Error::unknown_field(value, FIELDS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"secs_since_epoch" => Ok(Field::Secs), + b"nanos_since_epoch" => Ok(Field::Nanos), + _ => { + let value = String::from_utf8_lossy(value); + Err(Error::unknown_field(&value, FIELDS)) + } + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + struct DurationVisitor; + + impl<'de> Visitor<'de> for DurationVisitor { + type Value = Duration; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("struct SystemTime") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let secs: u64 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(0, &self)); + } + }; + let nanos: u32 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(1, &self)); + } + }; + Ok(Duration::new(secs, nanos)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut secs: Option = None; + let mut nanos: Option = None; + while let Some(key) = try!(map.next_key()) { + match key { + Field::Secs => { + if secs.is_some() { + return Err(::duplicate_field("secs_since_epoch")); + } + secs = Some(try!(map.next_value())); + } + Field::Nanos => { + if nanos.is_some() { + return Err(::duplicate_field("nanos_since_epoch")); + } + nanos = Some(try!(map.next_value())); + } + } + } + let secs = match secs { + Some(secs) => secs, + None => return Err(::missing_field("secs_since_epoch")), + }; + let nanos = match nanos { + Some(nanos) => nanos, + None => return Err(::missing_field("nanos_since_epoch")), + }; + Ok(Duration::new(secs, nanos)) + } + } + + const FIELDS: &'static [&'static str] = &["secs_since_epoch", "nanos_since_epoch"]; + let duration = try!(deserializer.deserialize_struct("SystemTime", FIELDS, DurationVisitor)); + Ok(UNIX_EPOCH + duration) + } +} + +//////////////////////////////////////////////////////////////////////////////// // Similar to: // @@ -1286,22 +1562,31 @@ // end: u32, // } #[cfg(feature = "std")] -impl Deserialize for std::ops::Range { +impl<'de, Idx> Deserialize<'de> for ops::Range +where + Idx: Deserialize<'de>, +{ fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(field_identifier, rename_all = "lowercase")] enum Field { Start, End, }; - impl Deserialize for Field { + impl<'de> Deserialize<'de> for Field { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { struct FieldVisitor; - impl Visitor for FieldVisitor { + impl<'de> Visitor<'de> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1309,7 +1594,8 @@ } fn visit_str(self, value: &str) -> Result - where E: Error + where + E: Error, { match value { "start" => Ok(Field::Start), @@ -1319,7 +1605,8 @@ } fn visit_bytes(self, value: &[u8]) -> Result - where E: Error + where + E: Error, { match value { b"start" => Ok(Field::Start), @@ -1332,7 +1619,7 @@ } } - deserializer.deserialize_struct_field(FieldVisitor) + deserializer.deserialize_identifier(FieldVisitor) } } @@ -1340,23 +1627,27 @@ phantom: PhantomData, } - impl Visitor for RangeVisitor { - type Value = std::ops::Range; + impl<'de, Idx> Visitor<'de> for RangeVisitor + where + Idx: Deserialize<'de>, + { + type Value = ops::Range; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("struct Range") } - fn visit_seq(self, mut visitor: V) -> Result, V::Error> - where V: SeqVisitor + fn visit_seq(self, mut seq: A) -> Result, A::Error> + where + A: SeqAccess<'de>, { - let start: Idx = match try!(visitor.visit()) { + let start: Idx = match try!(seq.next_element()) { Some(value) => value, None => { return Err(Error::invalid_length(0, &self)); } }; - let end: Idx = match try!(visitor.visit()) { + let end: Idx = match try!(seq.next_element()) { Some(value) => value, None => { return Err(Error::invalid_length(1, &self)); @@ -1365,34 +1656,35 @@ Ok(start..end) } - fn visit_map(self, mut visitor: V) -> Result, V::Error> - where V: MapVisitor + fn visit_map(self, mut map: A) -> Result, A::Error> + where + A: MapAccess<'de>, { let mut start: Option = None; let mut end: Option = None; - while let Some(key) = try!(visitor.visit_key::()) { + while let Some(key) = try!(map.next_key()) { match key { Field::Start => { if start.is_some() { - return Err(::duplicate_field("start")); + return Err(::duplicate_field("start")); } - start = Some(try!(visitor.visit_value())); + start = Some(try!(map.next_value())); } Field::End => { if end.is_some() { - return Err(::duplicate_field("end")); + return Err(::duplicate_field("end")); } - end = Some(try!(visitor.visit_value())); + end = Some(try!(map.next_value())); } } } let start = match start { Some(start) => start, - None => return Err(::missing_field("start")), + None => return Err(::missing_field("start")), }; let end = match end { Some(end) => end, - None => return Err(::missing_field("end")), + None => return Err(::missing_field("end")), }; Ok(start..end) } @@ -1403,55 +1695,54 @@ } } -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "unstable")] -impl Deserialize for NonZero - where T: Deserialize + Zeroable +impl<'de, T> Deserialize<'de> for NonZero +where + T: Deserialize<'de> + Zeroable, { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { let value = try!(Deserialize::deserialize(deserializer)); - unsafe { - let ptr = &value as *const T as *const u8; - if slice::from_raw_parts(ptr, mem::size_of::()).iter().all(|&b| b == 0) { - return Err(Error::custom("expected a non-zero value")); - } - // Waiting for a safe way to construct NonZero: - // https://github.com/rust-lang/rust/issues/27730#issuecomment-269726075 - Ok(NonZero::new(value)) - } - + match NonZero::new(value) { + Some(nonzero) => Ok(nonzero), + None => Err(Error::custom("expected a non-zero value")), + } } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// - -impl Deserialize for Result - where T: Deserialize, - E: Deserialize +impl<'de, T, E> Deserialize<'de> for Result +where + T: Deserialize<'de>, + E: Deserialize<'de>, { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer + where + D: Deserializer<'de>, { + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(variant_identifier)] enum Field { Ok, Err, } - impl Deserialize for Field { + impl<'de> Deserialize<'de> for Field { #[inline] fn deserialize(deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { struct FieldVisitor; - impl Visitor for FieldVisitor { + impl<'de> Visitor<'de> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1459,19 +1750,21 @@ } fn visit_u32(self, value: u32) -> Result - where E: Error + where + E: Error, { match value { 0 => Ok(Field::Ok), 1 => Ok(Field::Err), _ => { - Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self)) + Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self),) } } } fn visit_str(self, value: &str) -> Result - where E: Error + where + E: Error, { match value { "Ok" => Ok(Field::Ok), @@ -1481,7 +1774,8 @@ } fn visit_bytes(self, value: &[u8]) -> Result - where E: Error + where + E: Error, { match value { b"Ok" => Ok(Field::Ok), @@ -1498,15 +1792,16 @@ } } - deserializer.deserialize(FieldVisitor) + deserializer.deserialize_identifier(FieldVisitor) } } struct ResultVisitor(PhantomData>); - impl Visitor for ResultVisitor - where T: Deserialize, - E: Deserialize + impl<'de, T, E> Visitor<'de> for ResultVisitor + where + T: Deserialize<'de>, + E: Deserialize<'de>, { type Value = Result; @@ -1514,12 +1809,13 @@ formatter.write_str("enum Result") } - fn visit_enum(self, visitor: V) -> Result, V::Error> - where V: EnumVisitor - { - match try!(visitor.visit_variant()) { - (Field::Ok, variant) => variant.visit_newtype().map(Ok), - (Field::Err, variant) => variant.visit_newtype().map(Err), + fn visit_enum(self, data: A) -> Result, A::Error> + where + A: EnumAccess<'de>, + { + match try!(data.variant()) { + (Field::Ok, v) => v.newtype_variant().map(Ok), + (Field::Err, v) => v.newtype_variant().map(Err), } } } @@ -1530,106 +1826,17 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A target for deserializers that want to ignore data. Implements -/// Deserialize and silently eats data given to it. -pub struct IgnoredAny; - -impl Deserialize for IgnoredAny { - #[inline] - fn deserialize(deserializer: D) -> Result - where D: Deserializer +#[cfg(feature = "std")] +impl<'de, T> Deserialize<'de> for Wrapping +where + T: Deserialize<'de> +{ + fn deserialize(deserializer: D) -> Result, D::Error> + where + D: Deserializer<'de>, { - struct IgnoredAnyVisitor; - - impl Visitor for IgnoredAnyVisitor { - type Value = IgnoredAny; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("anything at all") - } - - #[inline] - fn visit_bool(self, _: bool) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_i64(self, _: i64) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_u64(self, _: u64) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_f64(self, _: f64) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_str(self, _: &str) -> Result - where E: Error - { - Ok(IgnoredAny) - } - - #[inline] - fn visit_none(self) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_some(self, _: D) -> Result - where D: Deserializer - { - Ok(IgnoredAny) - } - - #[inline] - fn visit_newtype_struct(self, _: D) -> Result - where D: Deserializer - { - Ok(IgnoredAny) - } - - #[inline] - fn visit_unit(self) -> Result { - Ok(IgnoredAny) - } - - #[inline] - fn visit_seq(self, mut visitor: V) -> Result - where V: SeqVisitor - { - while let Some(_) = try!(visitor.visit::()) { - // Gobble - } - Ok(IgnoredAny) - } - - #[inline] - fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor - { - while let Some((_, _)) = try!(visitor.visit::()) { - // Gobble - } - Ok(IgnoredAny) - } - - #[inline] - fn visit_bytes(self, _: &[u8]) -> Result - where E: Error - { - Ok(IgnoredAny) - } - } - - // TODO maybe not necessary with impl specialization - deserializer.deserialize_ignored_any(IgnoredAnyVisitor) + Deserialize::deserialize(deserializer).map(Wrapping) } } diff -Nru distinst-0.1.0/vendor/serde/src/de/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/mod.rs --- distinst-0.1.0/vendor/serde/src/de/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,15 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + //! Generic data structure deserialization framework. //! -//! The two most important traits in this module are `Deserialize` and -//! `Deserializer`. +//! The two most important traits in this module are [`Deserialize`] and +//! [`Deserializer`]. //! //! - **A type that implements `Deserialize` is a data structure** that can be //! deserialized from any data format supported by Serde, and conversely @@ -10,43 +18,42 @@ //! //! # The Deserialize trait //! -//! Serde provides `Deserialize` implementations for many Rust primitive and +//! Serde provides [`Deserialize`] implementations for many Rust primitive and //! standard library types. The complete list is below. All of these can be //! deserialized using Serde out of the box. //! -//! Additionally, Serde provides a procedural macro called `serde_derive` to -//! automatically generate `Deserialize` implementations for structs and enums -//! in your program. See the [codegen section of the manual][codegen] for how to -//! use this. +//! Additionally, Serde provides a procedural macro called [`serde_derive`] to +//! automatically generate [`Deserialize`] implementations for structs and enums +//! in your program. See the [codegen section of the manual] for how to use +//! this. //! -//! In rare cases it may be necessary to implement `Deserialize` manually for -//! some type in your program. See the [Implementing -//! `Deserialize`][impl-deserialize] section of the manual for more about this. +//! In rare cases it may be necessary to implement [`Deserialize`] manually for +//! some type in your program. See the [Implementing `Deserialize`] section of +//! the manual for more about this. //! -//! Third-party crates may provide `Deserialize` implementations for types that -//! they expose. For example the `linked-hash-map` crate provides a -//! `LinkedHashMap` type that is deserializable by Serde because the crate -//! provides an implementation of `Deserialize` for it. +//! Third-party crates may provide [`Deserialize`] implementations for types +//! that they expose. For example the [`linked-hash-map`] crate provides a +//! [`LinkedHashMap`] type that is deserializable by Serde because the +//! crate provides an implementation of [`Deserialize`] for it. //! //! # The Deserializer trait //! -//! `Deserializer` implementations are provided by third-party crates, for -//! example [`serde_json`][serde_json], [`serde_yaml`][serde_yaml] and -//! [`bincode`][bincode]. +//! [`Deserializer`] implementations are provided by third-party crates, for +//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. //! //! A partial list of well-maintained formats is given on the [Serde -//! website][data-formats]. +//! website][data formats]. //! //! # Implementations of Deserialize provided by Serde //! //! This is a slightly different set of types than what is supported for //! serialization. Some types can be serialized by Serde but not deserialized. -//! One example is `&str`. +//! One example is `OsStr`. //! //! - **Primitive types**: //! - bool -//! - isize, i8, i16, i32, i64 -//! - usize, u8, u16, u32, u64 +//! - i8, i16, i32, i64, isize +//! - u8, u16, u32, u64, usize //! - f32, f64 //! - char //! - **Compound types**: @@ -78,10 +85,19 @@ //! - VecDeque\ //! - Vec\ //! - EnumSet\ (unstable) +//! - **Zero-copy types**: +//! - &str +//! - &[u8] +//! - **FFI types**: +//! - CString +//! - Box\ +//! - OsString //! - **Miscellaneous standard library types**: //! - Duration +//! - SystemTime //! - Path //! - PathBuf +//! - Range\ //! - NonZero\ (unstable) //! - **Net types**: //! - IpAddr @@ -91,163 +107,175 @@ //! - SocketAddrV4 //! - SocketAddrV6 //! -//! [codegen]: https://serde.rs/codegen.html -//! [impl-deserialize]: https://serde.rs/impl-deserialize.html -//! [serde_json]: https://github.com/serde-rs/json -//! [serde_yaml]: https://github.com/dtolnay/serde-yaml -//! [bincode]: https://github.com/TyOverby/bincode -//! [data-formats]: https://serde.rs/#data-formats - -#[cfg(feature = "std")] -use std::error; -#[cfg(not(feature = "std"))] -use error; - -#[cfg(all(not(feature = "std"), feature = "collections"))] -use collections::{String, Vec}; +//! [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html +//! [`Deserialize`]: ../trait.Deserialize.html +//! [`Deserializer`]: ../trait.Deserializer.html +//! [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +//! [`bincode`]: https://github.com/TyOverby/bincode +//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +//! [`serde_derive`]: https://crates.io/crates/serde_derive +//! [`serde_json`]: https://github.com/serde-rs/json +//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml +//! [codegen section of the manual]: https://serde.rs/codegen.html +//! [data formats]: https://serde.rs/#data-formats -use core::fmt::{self, Display}; -use core::marker::PhantomData; +use lib::*; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -#[doc(hidden)] -pub mod impls; pub mod value; + mod from_primitive; +mod ignored_any; +mod impls; +mod utf8; + +pub use self::ignored_any::IgnoredAny; + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! declare_error_trait { + (Error: Sized $(+ $($supertrait:ident)::+)*) => { + /// The `Error` trait allows `Deserialize` implementations to create descriptive + /// error messages belonging to the `Deserializer` against which they are + /// currently running. + /// + /// Every `Deserializer` declares an `Error` type that encompasses both + /// general-purpose deserialization errors as well as errors specific to the + /// particular deserialization format. For example the `Error` type of + /// `serde_json` can represent errors like an invalid JSON escape sequence or an + /// unterminated string literal, in addition to the error cases that are part of + /// this trait. + /// + /// Most deserializers should only need to provide the `Error::custom` method + /// and inherit the default behavior for the other methods. + pub trait Error: Sized $(+ $($supertrait)::+)* { + /// Raised when there is general error when deserializing a type. + /// + /// The message should not be capitalized and should not end with a period. + /// + /// ```rust + /// # use std::str::FromStr; + /// # + /// # struct IpAddr; + /// # + /// # impl FromStr for IpAddr { + /// # type Err = String; + /// # + /// # fn from_str(_: &str) -> Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::de::{self, Deserialize, Deserializer}; + /// + /// impl<'de> Deserialize<'de> for IpAddr { + /// fn deserialize(deserializer: D) -> Result + /// where D: Deserializer<'de> + /// { + /// let s = try!(String::deserialize(deserializer)); + /// s.parse().map_err(de::Error::custom) + /// } + /// } + /// ``` + fn custom(msg: T) -> Self + where + T: Display; + + /// Raised when a `Deserialize` receives a type different from what it was + /// expecting. + /// + /// The `unexp` argument provides information about what type was received. + /// This is the type that was present in the input file or other source data + /// of the Deserializer. + /// + /// The `exp` argument provides information about what type was being + /// expected. This is the type that is written in the program. + /// + /// For example if we try to deserialize a String out of a JSON file + /// containing an integer, the unexpected type is the integer and the + /// expected type is the string. + fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self { + Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp)) + } -// Helpers used by generated code. Not public API. -#[doc(hidden)] -pub mod private; -#[cfg(any(feature = "std", feature = "collections"))] -mod content; - -/////////////////////////////////////////////////////////////////////////////// - -/// The `Error` trait allows `Deserialize` implementations to create descriptive -/// error messages belonging to the `Deserializer` against which they are -/// currently running. -/// -/// Every `Deserializer` declares an `Error` type that encompasses both -/// general-purpose deserialization errors as well as errors specific to the -/// particular deserialization format. For example the `Error` type of -/// `serde_json` can represent errors like an invalid JSON escape sequence or an -/// unterminated string literal, in addition to the error cases that are part of -/// this trait. -/// -/// Most deserializers should only need to provide the `Error::custom` method -/// and inherit the default behavior for the other methods. -pub trait Error: Sized + error::Error { - /// Raised when there is general error when deserializing a type. - /// - /// The message should not be capitalized and should not end with a period. - /// - /// ```rust - /// # use serde::de::{Deserialize, Deserializer, Error}; - /// # use std::str::FromStr; - /// # #[allow(dead_code)] - /// # struct IpAddr; - /// # impl FromStr for IpAddr { - /// # type Err = String; - /// # fn from_str(_: &str) -> Result { unimplemented!() } - /// # } - /// impl Deserialize for IpAddr { - /// fn deserialize(deserializer: D) -> Result - /// where D: Deserializer - /// { - /// let s = try!(String::deserialize(deserializer)); - /// s.parse().map_err(Error::custom) - /// } - /// } - /// ``` - fn custom(msg: T) -> Self; + /// Raised when a `Deserialize` receives a value of the right type but that + /// is wrong for some other reason. + /// + /// The `unexp` argument provides information about what value was received. + /// This is the value that was present in the input file or other source + /// data of the Deserializer. + /// + /// The `exp` argument provides information about what value was being + /// expected. This is the type that is written in the program. + /// + /// For example if we try to deserialize a String out of some binary data + /// that is not valid UTF-8, the unexpected value is the bytes and the + /// expected value is a string. + fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self { + Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp)) + } - /// Raised when a `Deserialize` receives a type different from what it was - /// expecting. - /// - /// The `unexp` argument provides information about what type was received. - /// This is the type that was present in the input file or other source data - /// of the Deserializer. - /// - /// The `exp` argument provides information about what type was being - /// expected. This is the type that is written in the program. - /// - /// For example if we try to deserialize a String out of a JSON file - /// containing an integer, the unexpected type is the integer and the - /// expected type is the string. - fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self { - Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp)) - } + /// Raised when deserializing a sequence or map and the input data contains + /// too many or too few elements. + /// + /// The `len` argument is the number of elements encountered. The sequence + /// or map may have expected more arguments or fewer arguments. + /// + /// The `exp` argument provides information about what data was being + /// expected. For example `exp` might say that a tuple of size 6 was + /// expected. + fn invalid_length(len: usize, exp: &Expected) -> Self { + Error::custom(format_args!("invalid length {}, expected {}", len, exp)) + } - /// Raised when a `Deserialize` receives a value of the right type but that - /// is wrong for some other reason. - /// - /// The `unexp` argument provides information about what value was received. - /// This is the value that was present in the input file or other source - /// data of the Deserializer. - /// - /// The `exp` argument provides information about what value was being - /// expected. This is the type that is written in the program. - /// - /// For example if we try to deserialize a String out of some binary data - /// that is not valid UTF-8, the unexpected value is the bytes and the - /// expected value is a string. - fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self { - Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp)) - } + /// Raised when a `Deserialize` enum type received a variant with an + /// unrecognized name. + fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self { + if expected.is_empty() { + Error::custom(format_args!("unknown variant `{}`, there are no variants", + variant)) + } else { + Error::custom(format_args!("unknown variant `{}`, expected {}", + variant, + OneOf { names: expected })) + } + } - /// Raised when deserializing a sequence or map and the input data contains - /// too many or too few elements. - /// - /// The `len` argument is the number of elements encountered. The sequence - /// or map may have expected more arguments or fewer arguments. - /// - /// The `exp` argument provides information about what data was being - /// expected. For example `exp` might say that a tuple of size 6 was - /// expected. - fn invalid_length(len: usize, exp: &Expected) -> Self { - Error::custom(format_args!("invalid length {}, expected {}", len, exp)) - } + /// Raised when a `Deserialize` struct type received a field with an + /// unrecognized name. + fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self { + if expected.is_empty() { + Error::custom(format_args!("unknown field `{}`, there are no fields", + field)) + } else { + Error::custom(format_args!("unknown field `{}`, expected {}", + field, + OneOf { names: expected })) + } + } - /// Raised when a `Deserialize` enum type received a variant with an - /// unrecognized name. - fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self { - if expected.is_empty() { - Error::custom(format_args!("unknown variant `{}`, there are no variants", - variant)) - } else { - Error::custom(format_args!("unknown variant `{}`, expected {}", - variant, - OneOf { names: expected })) - } - } + /// Raised when a `Deserialize` struct type expected to receive a required + /// field with a particular name but that field was not present in the + /// input. + fn missing_field(field: &'static str) -> Self { + Error::custom(format_args!("missing field `{}`", field)) + } - /// Raised when a `Deserialize` struct type received a field with an - /// unrecognized name. - fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self { - if expected.is_empty() { - Error::custom(format_args!("unknown field `{}`, there are no fields", - field)) - } else { - Error::custom(format_args!("unknown field `{}`, expected {}", - field, - OneOf { names: expected })) + /// Raised when a `Deserialize` struct type received more than one of the + /// same field. + fn duplicate_field(field: &'static str) -> Self { + Error::custom(format_args!("duplicate field `{}`", field)) + } } } +} - /// Raised when a `Deserialize` struct type expected to receive a required - /// field with a particular name but that field was not present in the - /// input. - fn missing_field(field: &'static str) -> Self { - Error::custom(format_args!("missing field `{}`", field)) - } +#[cfg(feature = "std")] +declare_error_trait!(Error: Sized + error::Error); - /// Raised when a `Deserialize` struct type received more than one of the - /// same field. - fn duplicate_field(field: &'static str) -> Self { - Error::custom(format_args!("duplicate field `{}`", field)) - } -} +#[cfg(not(feature = "std"))] +declare_error_trait!(Error: Sized + Debug + Display); /// `Unexpected` represents an unexpected invocation of any one of the `Visitor` /// trait methods. @@ -256,23 +284,27 @@ /// `invalid_length` methods of the `Error` trait to build error messages. /// /// ```rust -/// # use serde::de::{Error, Unexpected, Visitor}; /// # use std::fmt; -/// # #[allow(dead_code)] +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # /// # struct Example; -/// # impl Visitor for Example { -/// # type Value = (); +/// # +/// # impl<'de> Visitor<'de> for Example { +/// # type Value = (); +/// # +/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// # write!(formatter, "definitely not a boolean") +/// # } +/// # /// fn visit_bool(self, v: bool) -> Result -/// where E: Error +/// where E: de::Error /// { -/// Err(Error::invalid_type(Unexpected::Bool(v), &self)) +/// Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) /// } -/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { -/// # write!(formatter, "definitely not a boolean") -/// # } /// # } /// ``` -#[derive(Clone, PartialEq, Debug)] +#[derive(Copy, Clone, PartialEq, Debug)] pub enum Unexpected<'a> { /// The input contained a boolean value that was not expected. Bool(bool), @@ -376,31 +408,37 @@ /// (`&self`) is an implementation of this trait. /// /// ```rust -/// # use serde::de::{Error, Unexpected, Visitor}; /// # use std::fmt; -/// # #[allow(dead_code)] +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # /// # struct Example; -/// # impl Visitor for Example { -/// # type Value = (); +/// # +/// # impl<'de> Visitor<'de> for Example { +/// # type Value = (); +/// # +/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// # write!(formatter, "definitely not a boolean") +/// # } +/// # /// fn visit_bool(self, v: bool) -> Result -/// where E: Error +/// where E: de::Error /// { -/// Err(Error::invalid_type(Unexpected::Bool(v), &self)) +/// Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) /// } -/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { -/// # write!(formatter, "definitely not a boolean") -/// # } /// # } /// ``` /// /// Outside of a `Visitor`, `&"..."` can be used. /// /// ```rust -/// # use serde::de::{Error, Unexpected}; -/// # #[allow(dead_code)] -/// # fn example() -> Result<(), E> { -/// # let v = true; -/// return Err(Error::invalid_type(Unexpected::Bool(v), &"a negative integer")); +/// # use serde::de::{self, Unexpected}; +/// # +/// # fn example() -> Result<(), E> +/// # where E: de::Error +/// # { +/// # let v = true; +/// return Err(de::Error::invalid_type(Unexpected::Bool(v), &"a negative integer")); /// # } /// ``` pub trait Expected { @@ -409,8 +447,9 @@ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result; } -impl Expected for T - where T: Visitor +impl<'de, T> Expected for T +where + T: Visitor<'de>, { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { self.expecting(formatter) @@ -429,7 +468,7 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /// A **data structure** that can be deserialized from any data format supported /// by Serde. @@ -455,14 +494,44 @@ /// [de]: https://docs.serde.rs/serde/de/index.html /// [codegen]: https://serde.rs/codegen.html /// [impl-deserialize]: https://serde.rs/impl-deserialize.html -pub trait Deserialize: Sized { +pub trait Deserialize<'de>: Sized { /// Deserialize this value from the given Serde deserializer. /// /// See the [Implementing `Deserialize`][impl-deserialize] section of the /// manual for more information about how to implement this method. /// /// [impl-deserialize]: https://serde.rs/impl-deserialize.html - fn deserialize(deserializer: D) -> Result where D: Deserializer; + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>; +} + +/// A data structure that can be deserialized without borrowing any data from +/// the deserializer. +/// +/// This is primarily useful for trait bounds on functions. For example a +/// `from_str` function may be able to deserialize a data structure that borrows +/// from the input string, but a `from_reader` function may only deserialize +/// owned data. +/// +/// ```rust +/// # use serde::de::{Deserialize, DeserializeOwned}; +/// # use std::io::{Read, Result}; +/// # +/// # trait Ignore { +/// fn from_str<'a, T>(s: &'a str) -> Result +/// where T: Deserialize<'a>; +/// +/// fn from_reader(rdr: R) -> Result +/// where R: Read, +/// T: DeserializeOwned; +/// # } +/// ``` +pub trait DeserializeOwned: for<'de> Deserialize<'de> {} +impl DeserializeOwned for T +where + T: for<'de> Deserialize<'de>, +{ } /// `DeserializeSeed` is the stateful form of the `Deserialize` trait. If you @@ -480,11 +549,13 @@ /// /// ```rust /// # use serde::Deserialize; -/// # #[allow(dead_code)] +/// # /// # enum Error {} -/// # #[allow(dead_code)] -/// fn func() -> Result -/// # { unimplemented!() } +/// # +/// fn func<'de, T: Deserialize<'de>>() -> Result +/// # { +/// # unimplemented!() +/// # } /// ``` /// /// Adjusting an API like this to support stateful deserialization is a matter @@ -492,10 +563,10 @@ /// /// ```rust /// # use serde::de::DeserializeSeed; -/// # #[allow(dead_code)] +/// # /// # enum Error {} -/// # #[allow(dead_code)] -/// fn func_seed(seed: T) -> Result +/// # +/// fn func_seed<'de, T: DeserializeSeed<'de>>(seed: T) -> Result /// # { /// # let _ = seed; /// # unimplemented!() @@ -516,10 +587,11 @@ /// trait. /// /// ```rust -/// # use serde::de::{Deserialize, DeserializeSeed, Deserializer, Visitor, SeqVisitor}; -/// # use std::fmt; -/// # use std::marker::PhantomData; -/// # +/// use std::fmt; +/// use std::marker::PhantomData; +/// +/// use serde::de::{Deserialize, DeserializeSeed, Deserializer, Visitor, SeqAccess}; +/// /// // A DeserializeSeed implementation that uses stateful deserialization to /// // append array elements onto the end of an existing vector. The preexisting /// // state ("seed") in this case is the Vec. The `deserialize` method of @@ -527,8 +599,8 @@ /// // appending each integer into the existing Vec. /// struct ExtendVec<'a, T: 'a>(&'a mut Vec); /// -/// impl<'a, T> DeserializeSeed for ExtendVec<'a, T> -/// where T: Deserialize +/// impl<'de, 'a, T> DeserializeSeed<'de> for ExtendVec<'a, T> +/// where T: Deserialize<'de> /// { /// // The return type of the `deserialize` method. This implementation /// // appends onto an existing vector but does not create any new data @@ -536,31 +608,31 @@ /// type Value = (); /// /// fn deserialize(self, deserializer: D) -> Result -/// where D: Deserializer +/// where D: Deserializer<'de> /// { /// // Visitor implementation that will walk an inner array of the JSON /// // input. /// struct ExtendVecVisitor<'a, T: 'a>(&'a mut Vec); /// -/// impl<'a, T> Visitor for ExtendVecVisitor<'a, T> -/// where T: Deserialize +/// impl<'de, 'a, T> Visitor<'de> for ExtendVecVisitor<'a, T> +/// where T: Deserialize<'de> /// { /// type Value = (); /// -/// fn visit_seq(self, mut visitor: V) -> Result<(), V::Error> -/// where V: SeqVisitor +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "an array of integers") +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result<(), A::Error> +/// where A: SeqAccess<'de> /// { /// // Visit each element in the inner array and push it onto /// // the existing vector. -/// while let Some(elem) = visitor.visit()? { +/// while let Some(elem) = seq.next_element()? { /// self.0.push(elem); /// } /// Ok(()) /// } -/// # -/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { -/// # write!(formatter, "an array of integers") -/// # } /// } /// /// deserializer.deserialize_seq(ExtendVecVisitor(self.0)) @@ -570,69 +642,74 @@ /// // Visitor implementation that will walk the outer array of the JSON input. /// struct FlattenedVecVisitor(PhantomData); /// -/// impl Visitor for FlattenedVecVisitor -/// where T: Deserialize +/// impl<'de, T> Visitor<'de> for FlattenedVecVisitor +/// where T: Deserialize<'de> /// { /// // This Visitor constructs a single Vec to hold the flattened /// // contents of the inner arrays. /// type Value = Vec; /// -/// fn visit_seq(self, mut visitor: V) -> Result, V::Error> -/// where V: SeqVisitor +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "an array of arrays") +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result, A::Error> +/// where A: SeqAccess<'de> /// { /// // Create a single Vec to hold the flattened contents. /// let mut vec = Vec::new(); /// /// // Each iteration through this loop is one inner array. -/// while let Some(()) = visitor.visit_seed(ExtendVec(&mut vec))? { +/// while let Some(()) = seq.next_element_seed(ExtendVec(&mut vec))? { /// // Nothing to do; inner array has been appended into `vec`. /// } /// /// // Return the finished vec. /// Ok(vec) /// } -/// # -/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { -/// # write!(formatter, "an array of arrays") -/// # } /// } /// -/// # #[allow(dead_code)] -/// # fn example(deserializer: D) -> Result<(), D::Error> { +/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error> +/// # where D: Deserializer<'de> +/// # { /// let visitor = FlattenedVecVisitor(PhantomData); /// let flattened: Vec = deserializer.deserialize_seq(visitor)?; -/// # let _ = flattened; -/// # Ok(()) } +/// # Ok(()) +/// # } /// ``` -pub trait DeserializeSeed: Sized { +pub trait DeserializeSeed<'de>: Sized { /// The type produced by using this seed. type Value; /// Equivalent to the more common `Deserialize::deserialize` method, except /// with some initial piece of data (the seed) passed in. - fn deserialize(self, deserializer: D) -> Result where D: Deserializer; + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>; } -impl DeserializeSeed for PhantomData - where T: Deserialize +impl<'de, T> DeserializeSeed<'de> for PhantomData +where + T: Deserialize<'de>, { type Value = T; #[inline] fn deserialize(self, deserializer: D) -> Result - where D: Deserializer + where + D: Deserializer<'de>, { T::deserialize(deserializer) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /// A **data format** that can deserialize any data structure supported by /// Serde. /// /// The role of this trait is to define the deserialization half of the Serde -/// data model, which is a way to categorize every Rust data type into one of 28 +/// data model, which is a way to categorize every Rust data type into one of 27 /// possible types. Each method of the `Serializer` trait corresponds to one of /// the types of the data model. /// @@ -642,47 +719,54 @@ /// /// The types that make up the Serde data model are: /// -/// - 12 primitive types: +/// - **12 primitive types** /// - bool /// - i8, i16, i32, i64 /// - u8, u16, u32, u64 /// - f32, f64 /// - char -/// - string -/// - byte array - [u8] -/// - option -/// - either none or some value -/// - unit -/// - unit is the type of () in Rust -/// - unit_struct -/// - for example `struct Unit` or `PhantomData` -/// - unit_variant -/// - the `E::A` and `E::B` in `enum E { A, B }` -/// - newtype_struct -/// - for example `struct Millimeters(u8)` -/// - newtype_variant -/// - the `E::N` in `enum E { N(u8) }` -/// - seq -/// - a dynamically sized sequence of values, for example `Vec` or -/// `HashSet` -/// - seq_fixed_size -/// - a statically sized sequence of values for which the size will be known -/// at deserialization time without looking at the serialized data, for -/// example `[u64; 10]` -/// - tuple -/// - for example `(u8,)` or `(String, u64, Vec)` -/// - tuple_struct -/// - for example `struct Rgb(u8, u8, u8)` -/// - tuple_variant -/// - the `E::T` in `enum E { T(u8, u8) }` -/// - map -/// - for example `BTreeMap` -/// - struct -/// - a key-value pairing in which the keys will be known at deserialization -/// time without looking at the serialized data, for example `struct S { r: -/// u8, g: u8, b: u8 }` -/// - struct_variant -/// - the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }` +/// - **string** +/// - UTF-8 bytes with a length and no null terminator. +/// - When serializing, all strings are handled equally. When deserializing, +/// there are three flavors of strings: transient, owned, and borrowed. +/// - **byte array** - [u8] +/// - Similar to strings, during deserialization byte arrays can be transient, +/// owned, or borrowed. +/// - **option** +/// - Either none or some value. +/// - **unit** +/// - The type of `()` in Rust. It represents an anonymous value containing no +/// data. +/// - **unit_struct** +/// - For example `struct Unit` or `PhantomData`. It represents a named value +/// containing no data. +/// - **unit_variant** +/// - For example the `E::A` and `E::B` in `enum E { A, B }`. +/// - **newtype_struct** +/// - For example `struct Millimeters(u8)`. +/// - **newtype_variant** +/// - For example the `E::N` in `enum E { N(u8) }`. +/// - **seq** +/// - A variably sized heterogeneous sequence of values, for example `Vec` or +/// `HashSet`. When serializing, the length may or may not be known before +/// iterating through all the data. When deserializing, the length is determined +/// by looking at the serialized data. +/// - **tuple** +/// - A statically sized heterogeneous sequence of values for which the length +/// will be known at deserialization time without looking at the serialized +/// data, for example `(u8,)` or `(String, u64, Vec)` or `[u64; 10]`. +/// - **tuple_struct** +/// - A named tuple, for example `struct Rgb(u8, u8, u8)`. +/// - **tuple_variant** +/// - For example the `E::T` in `enum E { T(u8, u8) }`. +/// - **map** +/// - A heterogeneous key-value pairing, for example `BTreeMap`. +/// - **struct** +/// - A heterogeneous key-value pairing in which the keys are strings and will be +/// known at deserialization time without looking at the serialized data, for +/// example `struct S { r: u8, g: u8, b: u8 }`. +/// - **struct_variant** +/// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. /// /// The `Deserializer` trait supports two entry point styles which enables /// different kinds of deserialization. @@ -691,25 +775,25 @@ /// to look at the serialized data and tell what it represents. For example /// the JSON deserializer may see an opening curly brace (`{`) and know that /// it is seeing a map. If the data format supports -/// `Deserializer::deserialize`, it will drive the Visitor using whatever +/// `Deserializer::deserialize_any`, it will drive the Visitor using whatever /// type it sees in the input. JSON uses this approach when deserializing /// `serde_json::Value` which is an enum that can represent any JSON /// document. Without knowing what is in a JSON document, we can deserialize -/// it to `serde_json::Value` by going through `Deserializer::deserialize`. +/// it to `serde_json::Value` by going through `Deserializer::deserialize_any`. /// /// 2. The various `deserialize_*` methods. Non-self-describing formats like /// Bincode need to be told what is in the input in order to deserialize it. /// The `deserialize_*` methods are hints to the deserializer for how to /// interpret the next piece of input. Non-self-describing formats are not /// able to deserialize something like `serde_json::Value` which relies on -/// `Deserializer::deserialize`. +/// `Deserializer::deserialize_any`. /// /// When implementing `Deserialize`, you should avoid relying on -/// `Deserializer::deserialize` unless you need to be told by the Deserializer -/// what type is in the input. Know that relying on `Deserializer::deserialize` +/// `Deserializer::deserialize_any` unless you need to be told by the Deserializer +/// what type is in the input. Know that relying on `Deserializer::deserialize_any` /// means your data type will be able to deserialize from self-describing /// formats only, ruling out Bincode and many others. -pub trait Deserializer: Sized { +pub trait Deserializer<'de>: Sized { /// The error type that can be returned if some error occurs during /// deserialization. type Error: Error; @@ -718,48 +802,74 @@ /// on what data type is in the input. /// /// When implementing `Deserialize`, you should avoid relying on - /// `Deserializer::deserialize` unless you need to be told by the + /// `Deserializer::deserialize_any` unless you need to be told by the /// Deserializer what type is in the input. Know that relying on - /// `Deserializer::deserialize` means your data type will be able to + /// `Deserializer::deserialize_any` means your data type will be able to /// deserialize from self-describing formats only, ruling out Bincode and /// many others. - fn deserialize(self, visitor: V) -> Result where V: Visitor; + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a `bool` value. - fn deserialize_bool(self, visitor: V) -> Result where V: Visitor; - - /// Hint that the `Deserialize` type is expecting a `u8` value. - fn deserialize_u8(self, visitor: V) -> Result where V: Visitor; - - /// Hint that the `Deserialize` type is expecting a `u16` value. - fn deserialize_u16(self, visitor: V) -> Result where V: Visitor; - - /// Hint that the `Deserialize` type is expecting a `u32` value. - fn deserialize_u32(self, visitor: V) -> Result where V: Visitor; - - /// Hint that the `Deserialize` type is expecting a `u64` value. - fn deserialize_u64(self, visitor: V) -> Result where V: Visitor; + fn deserialize_bool(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an `i8` value. - fn deserialize_i8(self, visitor: V) -> Result where V: Visitor; + fn deserialize_i8(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an `i16` value. - fn deserialize_i16(self, visitor: V) -> Result where V: Visitor; + fn deserialize_i16(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an `i32` value. - fn deserialize_i32(self, visitor: V) -> Result where V: Visitor; + fn deserialize_i32(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an `i64` value. - fn deserialize_i64(self, visitor: V) -> Result where V: Visitor; + fn deserialize_i64(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u8` value. + fn deserialize_u8(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u16` value. + fn deserialize_u16(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u32` value. + fn deserialize_u32(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u64` value. + fn deserialize_u64(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a `f32` value. - fn deserialize_f32(self, visitor: V) -> Result where V: Visitor; + fn deserialize_f32(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a `f64` value. - fn deserialize_f64(self, visitor: V) -> Result where V: Visitor; + fn deserialize_f64(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a `char` value. - fn deserialize_char(self, visitor: V) -> Result where V: Visitor; + fn deserialize_char(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a string value and does /// not benefit from taking ownership of buffered data owned by the @@ -768,7 +878,9 @@ /// If the `Visitor` would benefit from taking ownership of `String` data, /// indiciate this to the `Deserializer` by using `deserialize_string` /// instead. - fn deserialize_str(self, visitor: V) -> Result where V: Visitor; + fn deserialize_str(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a string value and would /// benefit from taking ownership of buffered data owned by the @@ -777,7 +889,9 @@ /// If the `Visitor` would not benefit from taking ownership of `String` /// data, indicate that to the `Deserializer` by using `deserialize_str` /// instead. - fn deserialize_string(self, visitor: V) -> Result where V: Visitor; + fn deserialize_string(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a byte array and does not /// benefit from taking ownership of buffered data owned by the @@ -786,7 +900,9 @@ /// If the `Visitor` would benefit from taking ownership of `Vec` data, /// indicate this to the `Deserializer` by using `deserialize_byte_buf` /// instead. - fn deserialize_bytes(self, visitor: V) -> Result where V: Visitor; + fn deserialize_bytes(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a byte array and would /// benefit from taking ownership of buffered data owned by the @@ -795,108 +911,192 @@ /// If the `Visitor` would not benefit from taking ownership of `Vec` /// data, indicate that to the `Deserializer` by using `deserialize_bytes` /// instead. - fn deserialize_byte_buf(self, visitor: V) -> Result where V: Visitor; + fn deserialize_byte_buf(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an optional value. /// /// This allows deserializers that encode an optional value as a nullable /// value to convert the null value into `None` and a regular value into /// `Some(value)`. - fn deserialize_option(self, visitor: V) -> Result where V: Visitor; + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a unit value. - fn deserialize_unit(self, visitor: V) -> Result where V: Visitor; + fn deserialize_unit(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a unit struct with a /// particular name. - fn deserialize_unit_struct(self, - name: &'static str, - visitor: V) - -> Result - where V: Visitor; + fn deserialize_unit_struct( + self, + name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a newtype struct with a /// particular name. - fn deserialize_newtype_struct(self, - name: &'static str, - visitor: V) - -> Result - where V: Visitor; + fn deserialize_newtype_struct( + self, + name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a sequence of values. - fn deserialize_seq(self, visitor: V) -> Result where V: Visitor; + fn deserialize_seq(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a sequence of values and /// knows how many values there are without looking at the serialized data. - fn deserialize_seq_fixed_size(self, - len: usize, - visitor: V) - -> Result - where V: Visitor; - - /// Hint that the `Deserialize` type is expecting a tuple value with a - /// particular number of elements. fn deserialize_tuple(self, len: usize, visitor: V) -> Result - where V: Visitor; + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a tuple struct with a /// particular name and number of fields. - fn deserialize_tuple_struct(self, - name: &'static str, - len: usize, - visitor: V) - -> Result - where V: Visitor; + fn deserialize_tuple_struct( + self, + name: &'static str, + len: usize, + visitor: V, + ) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a map of key-value pairs. - fn deserialize_map(self, visitor: V) -> Result where V: Visitor; + fn deserialize_map(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting a struct with a particular /// name and fields. - fn deserialize_struct(self, - name: &'static str, - fields: &'static [&'static str], - visitor: V) - -> Result - where V: Visitor; - - /// Hint that the `Deserialize` type is expecting the name of a struct - /// field. - fn deserialize_struct_field(self, visitor: V) -> Result - where V: Visitor; + fn deserialize_struct( + self, + name: &'static str, + fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type is expecting an enum value with a /// particular name and possible variants. - fn deserialize_enum(self, - name: &'static str, - variants: &'static [&'static str], - visitor: V) - -> Result - where V: Visitor; + fn deserialize_enum( + self, + name: &'static str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting the name of a struct + /// field or the discriminant of an enum variant. + fn deserialize_identifier(self, visitor: V) -> Result + where + V: Visitor<'de>; /// Hint that the `Deserialize` type needs to deserialize a value whose type /// doesn't matter because it is ignored. /// /// Deserializers for non-self-describing formats may not support this mode. fn deserialize_ignored_any(self, visitor: V) -> Result - where V: Visitor; + where + V: Visitor<'de>; + + /// Determine whether `Deserialize` implementations should expect to + /// deserialize their human-readable form. + /// + /// Some types have a human-readable form that may be somewhat expensive to + /// construct, as well as a binary form that is compact and efficient. + /// Generally text-based formats like JSON and YAML will prefer to use the + /// human-readable one and binary formats like Bincode will prefer the + /// compact one. + /// + /// ``` + /// # use std::ops::Add; + /// # use std::str::FromStr; + /// # + /// # struct Timestamp; + /// # + /// # impl Timestamp { + /// # const EPOCH: Timestamp = Timestamp; + /// # } + /// # + /// # impl FromStr for Timestamp { + /// # type Err = String; + /// # fn from_str(_: &str) -> Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # struct Duration; + /// # + /// # impl Duration { + /// # fn seconds(_: u64) -> Self { unimplemented!() } + /// # } + /// # + /// # impl Add for Timestamp { + /// # type Output = Timestamp; + /// # fn add(self, _: Duration) -> Self::Output { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::de::{self, Deserialize, Deserializer}; + /// + /// impl<'de> Deserialize<'de> for Timestamp { + /// fn deserialize(deserializer: D) -> Result + /// where D: Deserializer<'de> + /// { + /// if deserializer.is_human_readable() { + /// // Deserialize from a human-readable string like "2015-05-15T17:01:00Z". + /// let s = String::deserialize(deserializer)?; + /// Timestamp::from_str(&s).map_err(de::Error::custom) + /// } else { + /// // Deserialize from a compact binary representation, seconds since + /// // the Unix epoch. + /// let n = u64::deserialize(deserializer)?; + /// Ok(Timestamp::EPOCH + Duration::seconds(n)) + /// } + /// } + /// } + /// ``` + /// + /// The default implementation of this method returns `true`. Data formats + /// may override this to `false` to request a compact form for types that + /// support one. Note that modifying this method to change a format from + /// human-readable to compact or vice versa should be regarded as a breaking + /// change, as a value serialized in human-readable mode is not required to + /// deserialize from the same data in compact mode. + #[inline] + fn is_human_readable(&self) -> bool { true } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /// This trait represents a visitor that walks through a deserializer. /// /// ```rust -/// # use serde::de::{Error, Unexpected, Visitor}; /// # use std::fmt; +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # /// /// A visitor that deserializes a long string - a string containing at least /// /// some minimum number of bytes. -/// # #[allow(dead_code)] /// struct LongString { /// min: usize, /// } /// -/// impl Visitor for LongString { +/// impl<'de> Visitor<'de> for LongString { /// type Value = String; /// /// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -904,17 +1104,17 @@ /// } /// /// fn visit_str(self, s: &str) -> Result -/// where E: Error +/// where E: de::Error /// { /// if s.len() >= self.min { /// Ok(s.to_owned()) /// } else { -/// Err(Error::invalid_value(Unexpected::Str(s), &self)) +/// Err(de::Error::invalid_value(Unexpected::Str(s), &self)) /// } /// } /// } /// ``` -pub trait Visitor: Sized { +pub trait Visitor<'de>: Sized { /// The value produced by this visitor. type Value; @@ -927,10 +1127,14 @@ /// /// ```rust /// # use std::fmt; - /// # #[allow(dead_code)] - /// # struct S { max: usize } - /// # impl serde::de::Visitor for S { - /// # type Value = (); + /// # + /// # struct S { + /// # max: usize, + /// # } + /// # + /// # impl<'de> serde::de::Visitor<'de> for S { + /// # type Value = (); + /// # /// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { /// write!(formatter, "an integer between 0 and {}", self.max) /// } @@ -938,92 +1142,146 @@ /// ``` fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result; - /// Deserialize a `bool` into a `Value`. + /// The input contains a boolean. + /// + /// The default implementation fails with a type error. fn visit_bool(self, v: bool) -> Result - where E: Error + where + E: Error, { Err(Error::invalid_type(Unexpected::Bool(v), &self)) } - /// Deserialize an `i8` into a `Value`. + /// The input contains an `i8`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 fn visit_i8(self, v: i8) -> Result - where E: Error + where + E: Error, { self.visit_i64(v as i64) } - /// Deserialize an `i16` into a `Value`. + /// The input contains an `i16`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 fn visit_i16(self, v: i16) -> Result - where E: Error + where + E: Error, { self.visit_i64(v as i64) } - /// Deserialize an `i32` into a `Value`. + /// The input contains an `i32`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 fn visit_i32(self, v: i32) -> Result - where E: Error + where + E: Error, { self.visit_i64(v as i64) } - /// Deserialize an `i64` into a `Value`. + /// The input contains an `i64`. + /// + /// The default implementation fails with a type error. fn visit_i64(self, v: i64) -> Result - where E: Error + where + E: Error, { Err(Error::invalid_type(Unexpected::Signed(v), &self)) } - /// Deserialize a `u8` into a `Value`. + /// The input contains a `u8`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 fn visit_u8(self, v: u8) -> Result - where E: Error + where + E: Error, { self.visit_u64(v as u64) } - /// Deserialize a `u16` into a `Value`. + /// The input contains a `u16`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 fn visit_u16(self, v: u16) -> Result - where E: Error + where + E: Error, { self.visit_u64(v as u64) } - /// Deserialize a `u32` into a `Value`. + /// The input contains a `u32`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 fn visit_u32(self, v: u32) -> Result - where E: Error + where + E: Error, { self.visit_u64(v as u64) } - /// Deserialize a `u64` into a `Value`. + /// The input contains a `u64`. + /// + /// The default implementation fails with a type error. fn visit_u64(self, v: u64) -> Result - where E: Error + where + E: Error, { Err(Error::invalid_type(Unexpected::Unsigned(v), &self)) } - /// Deserialize a `f32` into a `Value`. + /// The input contains an `f32`. + /// + /// The default implementation forwards to [`visit_f64`]. + /// + /// [`visit_f64`]: #method.visit_f64 fn visit_f32(self, v: f32) -> Result - where E: Error + where + E: Error, { self.visit_f64(v as f64) } - /// Deserialize a `f64` into a `Value`. + /// The input contains an `f64`. + /// + /// The default implementation fails with a type error. fn visit_f64(self, v: f64) -> Result - where E: Error + where + E: Error, { Err(Error::invalid_type(Unexpected::Float(v), &self)) } - /// Deserialize a `char` into a `Value`. + /// The input contains a `char`. + /// + /// The default implementation forwards to [`visit_str`] as a one-character + /// string. + /// + /// [`visit_str`]: #method.visit_str #[inline] fn visit_char(self, v: char) -> Result - where E: Error + where + E: Error, { - self.visit_str(::utils::encode_utf8(v).as_str()) + self.visit_str(utf8::encode(v).as_str()) } - /// Deserialize a `&str` into a `Value`. + /// The input contains a string. The lifetime of the string is ephemeral and + /// it may be destroyed after this method returns. /// /// This method allows the `Deserializer` to avoid a copy by retaining /// ownership of any buffered data. `Deserialize` implementations that do @@ -1034,12 +1292,31 @@ /// It is never correct to implement `visit_string` without implementing /// `visit_str`. Implement neither, both, or just `visit_str`. fn visit_str(self, v: &str) -> Result - where E: Error + where + E: Error, { Err(Error::invalid_type(Unexpected::Str(v), &self)) } - /// Deserialize a `String` into a `Value`. + /// The input contains a string that lives at least as long as the + /// `Deserializer`. + /// + /// This enables zero-copy deserialization of strings in some formats. For + /// example JSON input containing the JSON string `"borrowed"` can be + /// deserialized with zero copying into a `&'a str` as long as the input + /// data outlives `'a`. + /// + /// The default implementation forwards to `visit_str`. + #[inline] + fn visit_borrowed_str(self, v: &'de str) -> Result + where + E: Error, + { + self.visit_str(v) + } + + /// The input contains a string and ownership of the string is being given + /// to the `Visitor`. /// /// This method allows the `Visitor` to avoid a copy by taking ownership of /// a string created by the `Deserializer`. `Deserialize` implementations @@ -1054,68 +1331,16 @@ /// The default implementation forwards to `visit_str` and then drops the /// `String`. #[inline] - #[cfg(any(feature = "std", feature = "collections"))] + #[cfg(any(feature = "std", feature = "alloc"))] fn visit_string(self, v: String) -> Result - where E: Error + where + E: Error, { self.visit_str(&v) } - /// Deserialize a `()` into a `Value`. - fn visit_unit(self) -> Result - where E: Error - { - Err(Error::invalid_type(Unexpected::Unit, &self)) - } - - /// Deserialize an absent optional `Value`. - fn visit_none(self) -> Result - where E: Error - { - Err(Error::invalid_type(Unexpected::Option, &self)) - } - - /// Deserialize a present optional `Value`. - fn visit_some(self, deserializer: D) -> Result - where D: Deserializer - { - let _ = deserializer; - Err(Error::invalid_type(Unexpected::Option, &self)) - } - - /// Deserialize `Value` as a newtype struct. - fn visit_newtype_struct(self, deserializer: D) -> Result - where D: Deserializer - { - let _ = deserializer; - Err(Error::invalid_type(Unexpected::NewtypeStruct, &self)) - } - - /// Deserialize `Value` as a sequence of elements. - fn visit_seq(self, visitor: V) -> Result - where V: SeqVisitor - { - let _ = visitor; - Err(Error::invalid_type(Unexpected::Seq, &self)) - } - - /// Deserialize `Value` as a key-value map. - fn visit_map(self, visitor: V) -> Result - where V: MapVisitor - { - let _ = visitor; - Err(Error::invalid_type(Unexpected::Map, &self)) - } - - /// Deserialize `Value` as an enum. - fn visit_enum(self, visitor: V) -> Result - where V: EnumVisitor - { - let _ = visitor; - Err(Error::invalid_type(Unexpected::Enum, &self)) - } - - /// Deserialize a `&[u8]` into a `Value`. + /// The input contains a byte array. The lifetime of the byte array is + /// ephemeral and it may be destroyed after this method returns. /// /// This method allows the `Deserializer` to avoid a copy by retaining /// ownership of any buffered data. `Deserialize` implementations that do @@ -1126,13 +1351,31 @@ /// It is never correct to implement `visit_byte_buf` without implementing /// `visit_bytes`. Implement neither, both, or just `visit_bytes`. fn visit_bytes(self, v: &[u8]) -> Result - where E: Error + where + E: Error, { let _ = v; Err(Error::invalid_type(Unexpected::Bytes(v), &self)) } - /// Deserialize a `Vec` into a `Value`. + /// The input contains a byte array that lives at least as long as the + /// `Deserializer`. + /// + /// This enables zero-copy deserialization of bytes in some formats. For + /// example Bincode data containing bytes can be deserialized with zero + /// copying into a `&'a [u8]` as long as the input data outlives `'a`. + /// + /// The default implementation forwards to `visit_bytes`. + #[inline] + fn visit_borrowed_bytes(self, v: &'de [u8]) -> Result + where + E: Error, + { + self.visit_bytes(v) + } + + /// The input contains a byte array and ownership of the byte array is being + /// given to the `Visitor`. /// /// This method allows the `Visitor` to avoid a copy by taking ownership of /// a byte buffer created by the `Deserializer`. `Deserialize` @@ -1147,21 +1390,100 @@ /// /// The default implementation forwards to `visit_bytes` and then drops the /// `Vec`. - #[cfg(any(feature = "std", feature = "collections"))] + #[cfg(any(feature = "std", feature = "alloc"))] fn visit_byte_buf(self, v: Vec) -> Result - where E: Error + where + E: Error, { self.visit_bytes(&v) } + + /// The input contains an optional that is absent. + /// + /// The default implementation fails with a type error. + fn visit_none(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// The input contains an optional that is present. + /// + /// The default implementation fails with a type error. + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// The input contains a unit `()`. + /// + /// The default implementation fails with a type error. + fn visit_unit(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Unit, &self)) + } + + /// The input contains a newtype struct. + /// + /// The content of the newtype struct may be read from the given + /// `Deserializer`. + /// + /// The default implementation fails with a type error. + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::NewtypeStruct, &self)) + } + + /// The input contains a sequence of elements. + /// + /// The default implementation fails with a type error. + fn visit_seq(self, seq: A) -> Result + where + A: SeqAccess<'de>, + { + let _ = seq; + Err(Error::invalid_type(Unexpected::Seq, &self)) + } + + /// The input contains a key-value map. + /// + /// The default implementation fails with a type error. + fn visit_map(self, map: A) -> Result + where + A: MapAccess<'de>, + { + let _ = map; + Err(Error::invalid_type(Unexpected::Map, &self)) + } + + /// The input contains an enum. + /// + /// The default implementation fails with a type error. + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + let _ = data; + Err(Error::invalid_type(Unexpected::Enum, &self)) + } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// `SeqVisitor` visits each item in a sequence. +/// Provides a `Visitor` access to each element of a sequence in the input. /// /// This is a trait that a `Deserializer` passes to a `Visitor` implementation, /// which deserializes each item in a sequence. -pub trait SeqVisitor { +pub trait SeqAccess<'de> { /// The error type that can be returned if some error occurs during /// deserialization. type Error: Error; @@ -1169,61 +1491,66 @@ /// This returns `Ok(Some(value))` for the next value in the sequence, or /// `Ok(None)` if there are no more remaining items. /// - /// `Deserialize` implementations should typically use `SeqVisitor::visit` - /// instead. - fn visit_seed(&mut self, seed: T) -> Result, Self::Error> - where T: DeserializeSeed; + /// `Deserialize` implementations should typically use + /// `SeqAccess::next_element` instead. + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>; /// This returns `Ok(Some(value))` for the next value in the sequence, or /// `Ok(None)` if there are no more remaining items. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `SeqVisitor` implementations should not override the default behavior. + /// `SeqAccess` implementations should not override the default behavior. #[inline] - fn visit(&mut self) -> Result, Self::Error> - where T: Deserialize + fn next_element(&mut self) -> Result, Self::Error> + where + T: Deserialize<'de>, { - self.visit_seed(PhantomData) + self.next_element_seed(PhantomData) } - /// Return the lower and upper bound of items remaining in the sequence. + /// Returns the number of elements remaining in the sequence, if known. #[inline] - fn size_hint(&self) -> (usize, Option) { - (0, None) + fn size_hint(&self) -> Option { + None } } -impl<'a, V> SeqVisitor for &'a mut V - where V: SeqVisitor +impl<'de, 'a, A> SeqAccess<'de> for &'a mut A +where + A: SeqAccess<'de>, { - type Error = V::Error; + type Error = A::Error; #[inline] - fn visit_seed(&mut self, seed: T) -> Result, V::Error> - where T: DeserializeSeed + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>, { - (**self).visit_seed(seed) + (**self).next_element_seed(seed) } #[inline] - fn visit(&mut self) -> Result, V::Error> - where T: Deserialize + fn next_element(&mut self) -> Result, Self::Error> + where + T: Deserialize<'de>, { - (**self).visit() + (**self).next_element() } #[inline] - fn size_hint(&self) -> (usize, Option) { + fn size_hint(&self) -> Option { (**self).size_hint() } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// `MapVisitor` visits each item in a sequence. +/// Provides a `Visitor` access to each entry of a map in the input. /// /// This is a trait that a `Deserializer` passes to a `Visitor` implementation. -pub trait MapVisitor { +pub trait MapAccess<'de> { /// The error type that can be returned if some error occurs during /// deserialization. type Error: Error; @@ -1232,36 +1559,45 @@ /// if there are no more remaining entries. /// /// `Deserialize` implementations should typically use - /// `MapVisitor::visit_key` or `MapVisitor::visit` instead. - fn visit_key_seed(&mut self, seed: K) -> Result, Self::Error> - where K: DeserializeSeed; + /// `MapAccess::next_key` or `MapAccess::next_entry` instead. + fn next_key_seed(&mut self, seed: K) -> Result, Self::Error> + where + K: DeserializeSeed<'de>; /// This returns a `Ok(value)` for the next value in the map. /// /// `Deserialize` implementations should typically use - /// `MapVisitor::visit_value` instead. - fn visit_value_seed(&mut self, seed: V) -> Result - where V: DeserializeSeed; + /// `MapAccess::next_value` instead. + /// + /// # Panics + /// + /// Calling `next_value_seed` before `next_key_seed` is incorrect and is + /// allowed to panic or return bogus results. + fn next_value_seed(&mut self, seed: V) -> Result + where + V: DeserializeSeed<'de>; /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in /// the map, or `Ok(None)` if there are no more remaining items. /// - /// `MapVisitor` implementations should override the default behavior if a + /// `MapAccess` implementations should override the default behavior if a /// more efficient implementation is possible. /// - /// `Deserialize` implementations should typically use `MapVisitor::visit` - /// instead. + /// `Deserialize` implementations should typically use + /// `MapAccess::next_entry` instead. #[inline] - fn visit_seed(&mut self, - kseed: K, - vseed: V) - -> Result, Self::Error> - where K: DeserializeSeed, - V: DeserializeSeed + fn next_entry_seed( + &mut self, + kseed: K, + vseed: V, + ) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, + V: DeserializeSeed<'de>, { - match try!(self.visit_key_seed(kseed)) { + match try!(self.next_key_seed(kseed)) { Some(key) => { - let value = try!(self.visit_value_seed(vseed)); + let value = try!(self.next_value_seed(vseed)); Ok(Some((key, value))) } None => Ok(None), @@ -1272,141 +1608,160 @@ /// if there are no more remaining entries. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `MapVisitor` implementations should not override the default behavior. + /// `MapAccess` implementations should not override the default behavior. #[inline] - fn visit_key(&mut self) -> Result, Self::Error> - where K: Deserialize + fn next_key(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, { - self.visit_key_seed(PhantomData) + self.next_key_seed(PhantomData) } /// This returns a `Ok(value)` for the next value in the map. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `MapVisitor` implementations should not override the default behavior. + /// `MapAccess` implementations should not override the default behavior. + /// + /// # Panics + /// + /// Calling `next_value` before `next_key` is incorrect and is allowed to + /// panic or return bogus results. #[inline] - fn visit_value(&mut self) -> Result - where V: Deserialize + fn next_value(&mut self) -> Result + where + V: Deserialize<'de>, { - self.visit_value_seed(PhantomData) + self.next_value_seed(PhantomData) } /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in /// the map, or `Ok(None)` if there are no more remaining items. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `MapVisitor` implementations should not override the default behavior. + /// `MapAccess` implementations should not override the default behavior. #[inline] - fn visit(&mut self) -> Result, Self::Error> - where K: Deserialize, - V: Deserialize + fn next_entry(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + V: Deserialize<'de>, { - self.visit_seed(PhantomData, PhantomData) + self.next_entry_seed(PhantomData, PhantomData) } - /// Return the lower and upper bound of items remaining in the sequence. + /// Returns the number of entries remaining in the map, if known. #[inline] - fn size_hint(&self) -> (usize, Option) { - (0, None) + fn size_hint(&self) -> Option { + None } } -impl<'a, V_> MapVisitor for &'a mut V_ - where V_: MapVisitor +impl<'de, 'a, A> MapAccess<'de> for &'a mut A +where + A: MapAccess<'de>, { - type Error = V_::Error; + type Error = A::Error; #[inline] - fn visit_key_seed(&mut self, seed: K) -> Result, Self::Error> - where K: DeserializeSeed + fn next_key_seed(&mut self, seed: K) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, { - (**self).visit_key_seed(seed) + (**self).next_key_seed(seed) } #[inline] - fn visit_value_seed(&mut self, seed: V) -> Result - where V: DeserializeSeed + fn next_value_seed(&mut self, seed: V) -> Result + where + V: DeserializeSeed<'de>, { - (**self).visit_value_seed(seed) + (**self).next_value_seed(seed) } #[inline] - fn visit_seed(&mut self, - kseed: K, - vseed: V) - -> Result, Self::Error> - where K: DeserializeSeed, - V: DeserializeSeed + fn next_entry_seed( + &mut self, + kseed: K, + vseed: V, + ) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, + V: DeserializeSeed<'de>, { - (**self).visit_seed(kseed, vseed) + (**self).next_entry_seed(kseed, vseed) } #[inline] - fn visit(&mut self) -> Result, V_::Error> - where K: Deserialize, - V: Deserialize + fn next_entry(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + V: Deserialize<'de>, { - (**self).visit() + (**self).next_entry() } #[inline] - fn visit_key(&mut self) -> Result, V_::Error> - where K: Deserialize + fn next_key(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, { - (**self).visit_key() + (**self).next_key() } #[inline] - fn visit_value(&mut self) -> Result - where V: Deserialize + fn next_value(&mut self) -> Result + where + V: Deserialize<'de>, { - (**self).visit_value() + (**self).next_value() } #[inline] - fn size_hint(&self) -> (usize, Option) { + fn size_hint(&self) -> Option { (**self).size_hint() } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// `EnumVisitor` is a visitor that is created by the `Deserializer` and passed -/// to the `Deserialize` in order to identify which variant of an enum to -/// deserialize. -pub trait EnumVisitor: Sized { +/// Provides a `Visitor` access to the data of an enum in the input. +/// +/// `EnumAccess` is created by the `Deserializer` and passed to the +/// `Visitor` in order to identify which variant of an enum to deserialize. +pub trait EnumAccess<'de>: Sized { /// The error type that can be returned if some error occurs during /// deserialization. type Error: Error; /// The `Visitor` that will be used to deserialize the content of the enum /// variant. - type Variant: VariantVisitor; + type Variant: VariantAccess<'de, Error = Self::Error>; - /// `visit_variant` is called to identify which variant to deserialize. + /// `variant` is called to identify which variant to deserialize. /// - /// `Deserialize` implementations should typically use - /// `EnumVisitor::visit_variant` instead. - fn visit_variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> - where V: DeserializeSeed; + /// `Deserialize` implementations should typically use `EnumAccess::variant` + /// instead. + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> + where + V: DeserializeSeed<'de>; - /// `visit_variant` is called to identify which variant to deserialize. + /// `variant` is called to identify which variant to deserialize. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `EnumVisitor` implementations should not override the default behavior. + /// `EnumAccess` implementations should not override the default behavior. #[inline] - fn visit_variant(self) -> Result<(V, Self::Variant), Self::Error> - where V: Deserialize + fn variant(self) -> Result<(V, Self::Variant), Self::Error> + where + V: Deserialize<'de>, { - self.visit_variant_seed(PhantomData) + self.variant_seed(PhantomData) } } -/// `VariantVisitor` is a visitor that is created by the `Deserializer` and +/// `VariantAccess` is a visitor that is created by the `Deserializer` and /// passed to the `Deserialize` to deserialize the content of a particular enum /// variant. -pub trait VariantVisitor: Sized { +pub trait VariantAccess<'de>: Sized { /// The error type that can be returned if some error occurs during - /// deserialization. Must match the error type of our `EnumVisitor`. + /// deserialization. Must match the error type of our `EnumAccess`. type Error: Error; /// Called when deserializing a variant with no values. @@ -1414,45 +1769,87 @@ /// If the data contains a different type of variant, the following /// `invalid_type` error should be constructed: /// - /// ```rust,ignore - /// fn visit_unit(self) -> Result<(), Self::Error> { + /// ```rust + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// fn unit_variant(self) -> Result<(), Self::Error> { /// // What the data actually contained; suppose it is a tuple variant. /// let unexp = Unexpected::TupleVariant; /// Err(de::Error::invalid_type(unexp, &"unit variant")) /// } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where T: DeserializeSeed<'de> + /// # { unimplemented!() } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # } /// ``` - fn visit_unit(self) -> Result<(), Self::Error>; + fn unit_variant(self) -> Result<(), Self::Error>; /// Called when deserializing a variant with a single value. /// /// `Deserialize` implementations should typically use - /// `VariantVisitor::visit_newtype` instead. + /// `VariantAccess::newtype_variant` instead. /// /// If the data contains a different type of variant, the following /// `invalid_type` error should be constructed: /// - /// ```rust,ignore - /// fn visit_newtype_seed(self, _seed: T) -> Result - /// where T: de::DeserializeSeed + /// ```rust + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// fn newtype_variant_seed(self, _seed: T) -> Result + /// where T: DeserializeSeed<'de> /// { /// // What the data actually contained; suppose it is a unit variant. /// let unexp = Unexpected::UnitVariant; /// Err(de::Error::invalid_type(unexp, &"newtype variant")) /// } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # } /// ``` - fn visit_newtype_seed(self, seed: T) -> Result - where T: DeserializeSeed; + fn newtype_variant_seed(self, seed: T) -> Result + where + T: DeserializeSeed<'de>; /// Called when deserializing a variant with a single value. /// /// This method exists as a convenience for `Deserialize` implementations. - /// `VariantVisitor` implementations should not override the default + /// `VariantAccess` implementations should not override the default /// behavior. #[inline] - fn visit_newtype(self) -> Result - where T: Deserialize + fn newtype_variant(self) -> Result + where + T: Deserialize<'de>, { - self.visit_newtype_seed(PhantomData) + self.newtype_variant_seed(PhantomData) } /// Called when deserializing a tuple-like variant. @@ -1462,19 +1859,40 @@ /// If the data contains a different type of variant, the following /// `invalid_type` error should be constructed: /// - /// ```rust,ignore - /// fn visit_tuple(self, - /// _len: usize, - /// _visitor: V) -> Result - /// where V: Visitor + /// ```rust + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where T: DeserializeSeed<'de> + /// # { unimplemented!() } + /// # + /// fn tuple_variant(self, + /// _len: usize, + /// _visitor: V) -> Result + /// where V: Visitor<'de> /// { /// // What the data actually contained; suppose it is a unit variant. /// let unexp = Unexpected::UnitVariant; - /// Err(Error::invalid_type(unexp, &"tuple variant")) + /// Err(de::Error::invalid_type(unexp, &"tuple variant")) /// } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # } /// ``` - fn visit_tuple(self, len: usize, visitor: V) -> Result - where V: Visitor; + fn tuple_variant(self, len: usize, visitor: V) -> Result + where + V: Visitor<'de>; /// Called when deserializing a struct-like variant. /// @@ -1483,25 +1901,85 @@ /// If the data contains a different type of variant, the following /// `invalid_type` error should be constructed: /// - /// ```rust,ignore - /// fn visit_struct(self, - /// _fields: &'static [&'static str], - /// _visitor: V) -> Result - /// where V: Visitor + /// ```rust + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where T: DeserializeSeed<'de> + /// # { unimplemented!() } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where V: Visitor<'de> + /// # { unimplemented!() } + /// # + /// fn struct_variant(self, + /// _fields: &'static [&'static str], + /// _visitor: V) -> Result + /// where V: Visitor<'de> /// { /// // What the data actually contained; suppose it is a unit variant. /// let unexp = Unexpected::UnitVariant; - /// Err(Error::invalid_type(unexp, &"struct variant")) + /// Err(de::Error::invalid_type(unexp, &"struct variant")) /// } + /// # } /// ``` - fn visit_struct(self, - fields: &'static [&'static str], - visitor: V) - -> Result - where V: Visitor; + fn struct_variant( + self, + fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Converts an existing value into a `Deserializer` from which other values can +/// be deserialized. +/// +/// ```rust +/// #[macro_use] +/// extern crate serde_derive; +/// +/// extern crate serde; +/// +/// use std::str::FromStr; +/// use serde::de::{value, Deserialize, IntoDeserializer}; +/// +/// #[derive(Deserialize)] +/// enum Setting { +/// On, +/// Off, +/// } +/// +/// impl FromStr for Setting { +/// type Err = value::Error; +/// +/// fn from_str(s: &str) -> Result { +/// Self::deserialize(s.into_deserializer()) +/// } +/// } +/// # +/// # fn main() {} +/// ``` +pub trait IntoDeserializer<'de, E: Error = value::Error> { + /// The type of the deserializer being converted into. + type Deserializer: Deserializer<'de, Error = E>; + + /// Convert this value into a deserializer. + fn into_deserializer(self) -> Self::Deserializer; } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /// Used in error messages. /// diff -Nru distinst-0.1.0/vendor/serde/src/de/private.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/private.rs --- distinst-0.1.0/vendor/serde/src/de/private.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/private.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -use core::marker::PhantomData; - -use de::{Deserialize, Deserializer, Error, Visitor}; - -#[cfg(any(feature = "std", feature = "collections"))] -pub use de::content::{Content, ContentRefDeserializer, ContentDeserializer, TaggedContentVisitor, - TagOrContentField, TagOrContentFieldVisitor, InternallyTaggedUnitVisitor, - UntaggedUnitVisitor}; - -/// If the missing field is of type `Option` then treat is as `None`, -/// otherwise it is an error. -pub fn missing_field(field: &'static str) -> Result - where V: Deserialize, - E: Error -{ - struct MissingFieldDeserializer(&'static str, PhantomData); - - impl Deserializer for MissingFieldDeserializer - where E: Error - { - type Error = E; - - fn deserialize(self, _visitor: V) -> Result - where V: Visitor - { - Err(Error::missing_field(self.0)) - } - - fn deserialize_option(self, visitor: V) -> Result - where V: Visitor - { - visitor.visit_none() - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any - } - } - - let deserializer = MissingFieldDeserializer(field, PhantomData); - Deserialize::deserialize(deserializer) -} diff -Nru distinst-0.1.0/vendor/serde/src/de/utf8.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/utf8.rs --- distinst-0.1.0/vendor/serde/src/de/utf8.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/utf8.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use lib::*; + +const TAG_CONT: u8 = 0b1000_0000; +const TAG_TWO_B: u8 = 0b1100_0000; +const TAG_THREE_B: u8 = 0b1110_0000; +const TAG_FOUR_B: u8 = 0b1111_0000; +const MAX_ONE_B: u32 = 0x80; +const MAX_TWO_B: u32 = 0x800; +const MAX_THREE_B: u32 = 0x10000; + +#[inline] +pub fn encode(c: char) -> Encode { + let code = c as u32; + let mut buf = [0; 4]; + let pos = if code < MAX_ONE_B { + buf[3] = code as u8; + 3 + } else if code < MAX_TWO_B { + buf[2] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 2 + } else if code < MAX_THREE_B { + buf[1] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; + buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 1 + } else { + buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; + buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT; + buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 0 + }; + Encode { buf: buf, pos: pos } +} + +pub struct Encode { + buf: [u8; 4], + pos: usize, +} + +impl Encode { + pub fn as_str(&self) -> &str { + str::from_utf8(&self.buf[self.pos..]).unwrap() + } +} diff -Nru distinst-0.1.0/vendor/serde/src/de/value.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/value.rs --- distinst-0.1.0/vendor/serde/src/de/value.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/de/value.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,100 +1,113 @@ -//! This module supports deserializing from primitives with the `ValueDeserializer` trait. +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Building blocks for deserializing basic values using the `IntoDeserializer` +//! trait. +//! +//! ```rust +//! #[macro_use] +//! extern crate serde_derive; +//! +//! extern crate serde; +//! +//! use std::str::FromStr; +//! use serde::de::{value, Deserialize, IntoDeserializer}; +//! +//! #[derive(Deserialize)] +//! enum Setting { +//! On, +//! Off, +//! } +//! +//! impl FromStr for Setting { +//! type Err = value::Error; +//! +//! fn from_str(s: &str) -> Result { +//! Self::deserialize(s.into_deserializer()) +//! } +//! } +//! # +//! # fn main() {} +//! ``` + +use lib::*; + +use de::{self, IntoDeserializer, Expected, SeqAccess}; +use private::de::size_hint; +use ser; +use self::private::{First, Second}; -#[cfg(feature = "std")] -use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, btree_map, btree_set, hash_map, - hash_set}; -#[cfg(feature = "std")] -use std::borrow::Cow; -#[cfg(feature = "std")] -use std::vec; - -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::{BTreeMap, BTreeSet, Vec, String, btree_map, btree_set, vec}; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::borrow::Cow; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::boxed::Box; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::string::ToString; - -#[cfg(feature = "std")] -use core::hash::Hash; -#[cfg(feature = "std")] -use std::error; -#[cfg(not(feature = "std"))] -use error; - -use core::fmt::{self, Display}; -use core::iter::{self, Iterator}; -use core::marker::PhantomData; - -use de::{self, Expected, SeqVisitor}; -use bytes; +//////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -/// This represents all the possible errors that can occur using the `ValueDeserializer`. +/// A minimal representation of all possible errors that can occur using the +/// `IntoDeserializer` trait. #[derive(Clone, Debug, PartialEq)] pub struct Error { err: ErrorImpl, } -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] type ErrorImpl = Box; -#[cfg(not(any(feature = "std", feature = "collections")))] +#[cfg(not(any(feature = "std", feature = "alloc")))] type ErrorImpl = (); impl de::Error for Error { - #[cfg(any(feature = "std", feature = "collections"))] - fn custom(msg: T) -> Self { + #[cfg(any(feature = "std", feature = "alloc"))] + fn custom(msg: T) -> Self + where + T: Display, + { Error { err: msg.to_string().into_boxed_str() } } - #[cfg(not(any(feature = "std", feature = "collections")))] - fn custom(_msg: T) -> Self { + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn custom(msg: T) -> Self + where + T: Display, + { + let _ = msg; Error { err: () } } } +impl ser::Error for Error { + fn custom(msg: T) -> Self + where + T: Display, + { + de::Error::custom(msg) + } +} + impl Display for Error { - #[cfg(any(feature = "std", feature = "collections"))] + #[cfg(any(feature = "std", feature = "alloc"))] fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { formatter.write_str(&self.err) } - #[cfg(not(any(feature = "std", feature = "collections")))] + #[cfg(not(any(feature = "std", feature = "alloc")))] fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { formatter.write_str("Serde deserialization error") } } +#[cfg(feature = "std")] impl error::Error for Error { - #[cfg(any(feature = "std", feature = "collections"))] fn description(&self) -> &str { &self.err } - - #[cfg(not(any(feature = "std", feature = "collections")))] - fn description(&self) -> &str { - "Serde deserialization error" - } } -/////////////////////////////////////////////////////////////////////////////// - -/// This trait converts primitive types into a deserializer. -pub trait ValueDeserializer { - /// The actual deserializer type. - type Deserializer: de::Deserializer; - - /// Convert this value into a deserializer. - fn into_deserializer(self) -> Self::Deserializer; -} +//////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -impl ValueDeserializer for () - where E: de::Error +impl<'de, E> IntoDeserializer<'de, E> for () +where + E: de::Error, { type Deserializer = UnitDeserializer; @@ -103,47 +116,54 @@ } } -/// A helper deserializer that deserializes a `()`. +/// A deserializer holding a `()`. +#[derive(Clone, Debug)] pub struct UnitDeserializer { marker: PhantomData, } -impl de::Deserializer for UnitDeserializer - where E: de::Error +impl<'de, E> de::Deserializer<'de> for UnitDeserializer +where + E: de::Error, { type Error = E; - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes map unit_struct newtype_struct tuple_struct struct - struct_field tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct newtype_struct seq tuple tuple_struct map + struct enum identifier ignored_any } - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { visitor.visit_unit() } fn deserialize_option(self, visitor: V) -> Result - where V: de::Visitor + where + V: de::Visitor<'de>, { visitor.visit_none() } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// macro_rules! primitive_deserializer { - ($ty:ty, $name:ident, $method:ident $($cast:tt)*) => { - /// A helper deserializer that deserializes a number. + ($ty:ty, $doc:tt, $name:ident, $method:ident $($cast:tt)*) => { + #[doc = "A deserializer holding"] + #[doc = $doc] + #[derive(Clone, Debug)] pub struct $name { value: $ty, marker: PhantomData } - impl ValueDeserializer for $ty - where E: de::Error, + impl<'de, E> IntoDeserializer<'de, E> for $ty + where + E: de::Error, { type Deserializer = $name; @@ -155,19 +175,21 @@ } } - impl de::Deserializer for $name - where E: de::Error, + impl<'de, E> de::Deserializer<'de> for $name + where + E: de::Error, { type Error = E; - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit - option seq seq_fixed_size bytes map unit_struct newtype_struct - tuple_struct struct struct_field tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any } - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { visitor.$method(self.value $($cast)*) } @@ -175,28 +197,30 @@ } } -primitive_deserializer!(bool, BoolDeserializer, visit_bool); -primitive_deserializer!(i8, I8Deserializer, visit_i8); -primitive_deserializer!(i16, I16Deserializer, visit_i16); -primitive_deserializer!(i32, I32Deserializer, visit_i32); -primitive_deserializer!(i64, I64Deserializer, visit_i64); -primitive_deserializer!(isize, IsizeDeserializer, visit_i64 as i64); -primitive_deserializer!(u8, U8Deserializer, visit_u8); -primitive_deserializer!(u16, U16Deserializer, visit_u16); -primitive_deserializer!(u64, U64Deserializer, visit_u64); -primitive_deserializer!(usize, UsizeDeserializer, visit_u64 as u64); -primitive_deserializer!(f32, F32Deserializer, visit_f32); -primitive_deserializer!(f64, F64Deserializer, visit_f64); -primitive_deserializer!(char, CharDeserializer, visit_char); +primitive_deserializer!(bool, "a `bool`.", BoolDeserializer, visit_bool); +primitive_deserializer!(i8, "an `i8`.", I8Deserializer, visit_i8); +primitive_deserializer!(i16, "an `i16`.", I16Deserializer, visit_i16); +primitive_deserializer!(i32, "an `i32`.", I32Deserializer, visit_i32); +primitive_deserializer!(i64, "an `i64`.", I64Deserializer, visit_i64); +primitive_deserializer!(isize, "an `isize`.", IsizeDeserializer, visit_i64 as i64); +primitive_deserializer!(u8, "a `u8`.", U8Deserializer, visit_u8); +primitive_deserializer!(u16, "a `u16`.", U16Deserializer, visit_u16); +primitive_deserializer!(u64, "a `u64`.", U64Deserializer, visit_u64); +primitive_deserializer!(usize, "a `usize`.", UsizeDeserializer, visit_u64 as u64); +primitive_deserializer!(f32, "an `f32`.", F32Deserializer, visit_f32); +primitive_deserializer!(f64, "an `f64`.", F64Deserializer, visit_f64); +primitive_deserializer!(char, "a `char`.", CharDeserializer, visit_char); -/// A helper deserializer that deserializes a number. +/// A deserializer holding a `u32`. +#[derive(Clone, Debug)] pub struct U32Deserializer { value: u32, marker: PhantomData, } -impl ValueDeserializer for u32 - where E: de::Error +impl<'de, E> IntoDeserializer<'de, E> for u32 +where + E: de::Error, { type Deserializer = U32Deserializer; @@ -208,57 +232,67 @@ } } -impl de::Deserializer for U32Deserializer - where E: de::Error +impl<'de, E> de::Deserializer<'de> for U32Deserializer +where + E: de::Error, { type Error = E; - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any } - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { visitor.visit_u32(self.value) } - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } } -impl de::EnumVisitor for U32Deserializer - where E: de::Error +impl<'de, E> de::EnumAccess<'de> for U32Deserializer +where + E: de::Error, { type Error = E; type Variant = private::UnitOnly; - fn visit_variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> - where T: de::DeserializeSeed + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, { seed.deserialize(self).map(private::unit_only) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a `&str`. +/// A deserializer holding a `&str`. +#[derive(Clone, Debug)] pub struct StrDeserializer<'a, E> { value: &'a str, marker: PhantomData, } -impl<'a, E> ValueDeserializer for &'a str - where E: de::Error +impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str +where + E: de::Error, { type Deserializer = StrDeserializer<'a, E>; @@ -270,59 +304,138 @@ } } -impl<'a, E> de::Deserializer for StrDeserializer<'a, E> - where E: de::Error +impl<'de, 'a, E> de::Deserializer<'de> for StrDeserializer<'a, E> +where + E: de::Error, { type Error = E; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { visitor.visit_str(self.value) } - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any } } -impl<'a, E> de::EnumVisitor for StrDeserializer<'a, E> - where E: de::Error +impl<'de, 'a, E> de::EnumAccess<'de> for StrDeserializer<'a, E> +where + E: de::Error, { type Error = E; type Variant = private::UnitOnly; - fn visit_variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> - where T: de::DeserializeSeed + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, { seed.deserialize(self).map(private::unit_only) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `&str` with a lifetime tied to another +/// deserializer. +#[derive(Clone, Debug)] +pub struct BorrowedStrDeserializer<'de, E> { + value: &'de str, + marker: PhantomData, +} + +impl<'de, E> BorrowedStrDeserializer<'de, E> { + /// Create a new borrowed deserializer from the given string. + pub fn new(value: &'de str) -> BorrowedStrDeserializer<'de, E> { + BorrowedStrDeserializer { + value: value, + marker: PhantomData, + } + } +} + +impl<'de, E> de::Deserializer<'de> for BorrowedStrDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; -/// A helper deserializer that deserializes a `String`. -#[cfg(any(feature = "std", feature = "collections"))] + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_borrowed_str(self.value) + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any + } +} + +impl<'de, E> de::EnumAccess<'de> for BorrowedStrDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `String`. +#[cfg(any(feature = "std", feature = "alloc"))] +#[derive(Clone, Debug)] pub struct StringDeserializer { value: String, marker: PhantomData, } -#[cfg(any(feature = "std", feature = "collections"))] -impl ValueDeserializer for String - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, E> IntoDeserializer<'de, E> for String +where + E: de::Error, { type Deserializer = StringDeserializer; @@ -334,61 +447,71 @@ } } -#[cfg(any(feature = "std", feature = "collections"))] -impl de::Deserializer for StringDeserializer - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, E> de::Deserializer<'de> for StringDeserializer +where + E: de::Error, { type Error = E; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { visitor.visit_string(self.value) } - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any } } -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, E> de::EnumVisitor for StringDeserializer - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer +where + E: de::Error, { type Error = E; type Variant = private::UnitOnly; - fn visit_variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> - where T: de::DeserializeSeed + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, { seed.deserialize(self).map(private::unit_only) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a `String`. -#[cfg(any(feature = "std", feature = "collections"))] +/// A deserializer holding a `Cow`. +#[cfg(any(feature = "std", feature = "alloc"))] +#[derive(Clone, Debug)] pub struct CowStrDeserializer<'a, E> { value: Cow<'a, str>, marker: PhantomData, } -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, E> ValueDeserializer for Cow<'a, str> - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str> +where + E: de::Error, { type Deserializer = CowStrDeserializer<'a, E>; @@ -400,14 +523,16 @@ } } -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, E> de::Deserializer for CowStrDeserializer<'a, E> - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::Deserializer<'de> for CowStrDeserializer<'a, E> +where + E: de::Error, { type Error = E; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { match self.value { Cow::Borrowed(string) => visitor.visit_str(string), @@ -415,40 +540,87 @@ } } - fn deserialize_enum(self, - _name: &str, - _variants: &'static [&'static str], - visitor: V) - -> Result - where V: de::Visitor + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any } } -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, E> de::EnumVisitor for CowStrDeserializer<'a, E> - where E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::EnumAccess<'de> for CowStrDeserializer<'a, E> +where + E: de::Error, { type Error = E; type Variant = private::UnitOnly; - fn visit_variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> - where T: de::DeserializeSeed + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, { seed.deserialize(self).map(private::unit_only) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a sequence. +/// A deserializer holding a `&[u8]` with a lifetime tied to another +/// deserializer. +#[derive(Clone, Debug)] +pub struct BorrowedBytesDeserializer<'de, E> { + value: &'de [u8], + marker: PhantomData, +} + +impl<'de, E> BorrowedBytesDeserializer<'de, E> { + /// Create a new borrowed deserializer from the given byte slice. + pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E> { + BorrowedBytesDeserializer { + value: value, + marker: PhantomData, + } + } +} + +impl<'de, E> de::Deserializer<'de> for BorrowedBytesDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_borrowed_bytes(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct identifier ignored_any enum + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer that iterates over a sequence. +#[derive(Clone, Debug)] pub struct SeqDeserializer { iter: iter::Fuse, count: usize, @@ -456,10 +628,10 @@ } impl SeqDeserializer - where I: Iterator, - E: de::Error +where + I: Iterator, { - /// Construct a new `SeqDeserializer`. + /// Construct a new `SeqDeserializer`. pub fn new(iter: I) -> Self { SeqDeserializer { iter: iter.fuse(), @@ -467,7 +639,13 @@ marker: PhantomData, } } +} +impl SeqDeserializer +where + I: Iterator, + E: de::Error, +{ /// Check for remaining elements after passing a `SeqDeserializer` to /// `Visitor::visit_seq`. pub fn end(mut self) -> Result<(), E> { @@ -480,42 +658,46 @@ } else { // First argument is the number of elements in the data, second // argument is the number of elements expected by the Deserialize. - Err(de::Error::invalid_length(self.count + remaining, &ExpectedInSeq(self.count))) + Err(de::Error::invalid_length(self.count + remaining, &ExpectedInSeq(self.count)),) } } } -impl de::Deserializer for SeqDeserializer - where I: Iterator, - T: ValueDeserializer, - E: de::Error +impl<'de, I, T, E> de::Deserializer<'de> for SeqDeserializer +where + I: Iterator, + T: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn deserialize(mut self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, { let v = try!(visitor.visit_seq(&mut self)); try!(self.end()); Ok(v) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any } } -impl de::SeqVisitor for SeqDeserializer - where I: Iterator, - T: ValueDeserializer, - E: de::Error +impl<'de, I, T, E> de::SeqAccess<'de> for SeqDeserializer +where + I: Iterator, + T: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn visit_seed(&mut self, seed: V) -> Result, Self::Error> - where V: de::DeserializeSeed + fn next_element_seed(&mut self, seed: V) -> Result, Self::Error> + where + V: de::DeserializeSeed<'de>, { match self.iter.next() { Some(value) => { @@ -526,8 +708,8 @@ } } - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) } } @@ -543,26 +725,28 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -#[cfg(any(feature = "std", feature = "collections"))] -impl ValueDeserializer for Vec - where T: ValueDeserializer, - E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, T, E> IntoDeserializer<'de, E> for Vec +where + T: IntoDeserializer<'de, E>, + E: de::Error, { - type Deserializer = SeqDeserializer, E>; + type Deserializer = SeqDeserializer<::IntoIter, E>; fn into_deserializer(self) -> Self::Deserializer { SeqDeserializer::new(self.into_iter()) } } -#[cfg(any(feature = "std", feature = "collections"))] -impl ValueDeserializer for BTreeSet - where T: ValueDeserializer + Eq + Ord, - E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet +where + T: IntoDeserializer<'de, E> + Eq + Ord, + E: de::Error, { - type Deserializer = SeqDeserializer, E>; + type Deserializer = SeqDeserializer<::IntoIter, E>; fn into_deserializer(self) -> Self::Deserializer { SeqDeserializer::new(self.into_iter()) @@ -570,88 +754,92 @@ } #[cfg(feature = "std")] -impl ValueDeserializer for HashSet - where T: ValueDeserializer + Eq + Hash, - E: de::Error +impl<'de, T, S, E> IntoDeserializer<'de, E> for HashSet +where + T: IntoDeserializer<'de, E> + Eq + Hash, + S: BuildHasher, + E: de::Error, { - type Deserializer = SeqDeserializer, E>; + type Deserializer = SeqDeserializer<::IntoIter, E>; fn into_deserializer(self) -> Self::Deserializer { SeqDeserializer::new(self.into_iter()) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a sequence using a `SeqVisitor`. -pub struct SeqVisitorDeserializer { - visitor: V_, - marker: PhantomData, +/// A deserializer holding a `SeqAccess`. +#[derive(Clone, Debug)] +pub struct SeqAccessDeserializer { + seq: A, } -impl SeqVisitorDeserializer - where V_: de::SeqVisitor, - E: de::Error -{ - /// Construct a new `SeqVisitorDeserializer`. - pub fn new(visitor: V_) -> Self { - SeqVisitorDeserializer { - visitor: visitor, - marker: PhantomData, - } +impl SeqAccessDeserializer { + /// Construct a new `SeqAccessDeserializer`. + pub fn new(seq: A) -> Self { + SeqAccessDeserializer { seq: seq } } } -impl de::Deserializer for SeqVisitorDeserializer - where V_: de::SeqVisitor, - E: de::Error +impl<'de, A> de::Deserializer<'de> for SeqAccessDeserializer +where + A: de::SeqAccess<'de>, { - type Error = E; + type Error = A::Error; - fn deserialize(self, visitor: V) -> Result { - visitor.visit_seq(self.visitor) + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_seq(self.seq) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a map. -pub struct MapDeserializer - where I: Iterator, - I::Item: private::Pair, - ::First: ValueDeserializer, - ::Second: ValueDeserializer, - E: de::Error +/// A deserializer that iterates over a map. +pub struct MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, { iter: iter::Fuse, - value: Option<::Second>, + value: Option>, count: usize, - marker: PhantomData, + lifetime: PhantomData<&'de ()>, + error: PhantomData, } -impl MapDeserializer - where I: Iterator, - I::Item: private::Pair, - ::First: ValueDeserializer, - ::Second: ValueDeserializer, - E: de::Error +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, { - /// Construct a new `MapDeserializer`. + /// Construct a new `MapDeserializer`. pub fn new(iter: I) -> Self { MapDeserializer { iter: iter.fuse(), value: None, count: 0, - marker: PhantomData, + lifetime: PhantomData, + error: PhantomData, } } +} +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + E: de::Error, +{ /// Check for remaining elements after passing a `MapDeserializer` to /// `Visitor::visit_map`. pub fn end(mut self) -> Result<(), E> { @@ -664,13 +852,17 @@ } else { // First argument is the number of elements in the data, second // argument is the number of elements expected by the Deserialize. - Err(de::Error::invalid_length(self.count + remaining, &ExpectedInMap(self.count))) + Err(de::Error::invalid_length(self.count + remaining, &ExpectedInMap(self.count)),) } } +} - fn next_pair - (&mut self) - -> Option<(::First, ::Second)> { +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, +{ + fn next_pair(&mut self) -> Option<(First, Second)> { match self.iter.next() { Some(kv) => { self.count += 1; @@ -681,58 +873,66 @@ } } -impl de::Deserializer for MapDeserializer - where I: Iterator, - I::Item: private::Pair, - ::First: ValueDeserializer, - ::Second: ValueDeserializer, - E: de::Error +impl<'de, I, E> de::Deserializer<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn deserialize(mut self, visitor: V_) -> Result - where V_: de::Visitor + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, { let value = try!(visitor.visit_map(&mut self)); try!(self.end()); Ok(value) } - fn deserialize_seq(mut self, visitor: V_) -> Result - where V_: de::Visitor + fn deserialize_seq(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, { let value = try!(visitor.visit_seq(&mut self)); try!(self.end()); Ok(value) } - fn deserialize_seq_fixed_size(self, - _len: usize, - visitor: V_) - -> Result - where V_: de::Visitor + fn deserialize_tuple( + self, + len: usize, + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { + let _ = len; self.deserialize_seq(visitor) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - bytes map unit_struct newtype_struct tuple_struct struct struct_field - tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct tuple_struct map struct + enum identifier ignored_any } } -impl de::MapVisitor for MapDeserializer - where I: Iterator, - I::Item: private::Pair, - ::First: ValueDeserializer, - ::Second: ValueDeserializer, - E: de::Error +impl<'de, I, E> de::MapAccess<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn visit_key_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, { match self.next_pair() { Some((key, value)) => { @@ -743,22 +943,25 @@ } } - fn visit_value_seed(&mut self, seed: T) -> Result - where T: de::DeserializeSeed + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, { let value = self.value.take(); // Panic because this indicates a bug in the program rather than an // expected failure. - let value = value.expect("MapVisitor::visit_value called before visit_key"); + let value = value.expect("MapAccess::visit_value called before visit_key"); seed.deserialize(value.into_deserializer()) } - fn visit_seed(&mut self, - kseed: TK, - vseed: TV) - -> Result, Self::Error> - where TK: de::DeserializeSeed, - TV: de::DeserializeSeed + fn next_entry_seed( + &mut self, + kseed: TK, + vseed: TV, + ) -> Result, Self::Error> + where + TK: de::DeserializeSeed<'de>, + TV: de::DeserializeSeed<'de>, { match self.next_pair() { Some((key, value)) => { @@ -770,22 +973,24 @@ } } - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) } } -impl de::SeqVisitor for MapDeserializer - where I: Iterator, - I::Item: private::Pair, - ::First: ValueDeserializer, - ::Second: ValueDeserializer, - E: de::Error +impl<'de, I, E> de::SeqAccess<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn visit_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, { match self.next_pair() { Some((k, v)) => { @@ -796,51 +1001,92 @@ } } - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } +} + +// Cannot #[derive(Clone)] because of the bound `Second: Clone`. +impl<'de, I, E> Clone for MapDeserializer<'de, I, E> +where + I: Iterator + Clone, + I::Item: private::Pair, + Second: Clone, +{ + fn clone(&self) -> Self { + MapDeserializer { + iter: self.iter.clone(), + value: self.value.clone(), + count: self.count, + lifetime: self.lifetime, + error: self.error, + } + } +} + +// Cannot #[derive(Debug)] because of the bound `Second: Debug`. +impl<'de, I, E> Debug for MapDeserializer<'de, I, E> +where + I: Iterator + Debug, + I::Item: private::Pair, + Second: Debug, +{ + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter + .debug_struct("MapDeserializer") + .field("iter", &self.iter) + .field("value", &self.value) + .field("count", &self.count) + .field("lifetime", &self.lifetime) + .field("error", &self.error) + .finish() } } -// Used in the `impl SeqVisitor for MapDeserializer` to visit the map as a +// Used in the `impl SeqAccess for MapDeserializer` to visit the map as a // sequence of pairs. struct PairDeserializer(A, B, PhantomData); -impl de::Deserializer for PairDeserializer - where A: ValueDeserializer, - B: ValueDeserializer, - E: de::Error +impl<'de, A, B, E> de::Deserializer<'de> for PairDeserializer +where + A: IntoDeserializer<'de, E>, + B: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - bytes map unit_struct newtype_struct tuple_struct struct struct_field - tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct tuple_struct map struct + enum identifier ignored_any } - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { self.deserialize_seq(visitor) } fn deserialize_seq(self, visitor: V) -> Result - where V: de::Visitor + where + V: de::Visitor<'de>, { let mut pair_visitor = PairVisitor(Some(self.0), Some(self.1), PhantomData); let pair = try!(visitor.visit_seq(&mut pair_visitor)); if pair_visitor.1.is_none() { Ok(pair) } else { - let remaining = pair_visitor.size_hint().0; + let remaining = pair_visitor.size_hint().unwrap(); // First argument is the number of elements in the data, second // argument is the number of elements expected by the Deserialize. Err(de::Error::invalid_length(2, &ExpectedInSeq(2 - remaining))) } } - fn deserialize_seq_fixed_size(self, len: usize, visitor: V) -> Result - where V: de::Visitor + fn deserialize_tuple(self, len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, { if len == 2 { self.deserialize_seq(visitor) @@ -854,15 +1100,17 @@ struct PairVisitor(Option, Option, PhantomData); -impl de::SeqVisitor for PairVisitor - where A: ValueDeserializer, - B: ValueDeserializer, - E: de::Error +impl<'de, A, B, E> de::SeqAccess<'de> for PairVisitor +where + A: IntoDeserializer<'de, E>, + B: IntoDeserializer<'de, E>, + E: de::Error, { type Error = E; - fn visit_seed(&mut self, seed: T) -> Result, Self::Error> - where T: de::DeserializeSeed + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, { if let Some(k) = self.0.take() { seed.deserialize(k.into_deserializer()).map(Some) @@ -873,15 +1121,14 @@ } } - fn size_hint(&self) -> (usize, Option) { - let len = if self.0.is_some() { - 2 + fn size_hint(&self) -> Option { + if self.0.is_some() { + Some(2) } else if self.1.is_some() { - 1 + Some(1) } else { - 0 - }; - (len, Some(len)) + Some(0) + } } } @@ -897,15 +1144,16 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -#[cfg(any(feature = "std", feature = "collections"))] -impl ValueDeserializer for BTreeMap - where K: ValueDeserializer + Eq + Ord, - V: ValueDeserializer, - E: de::Error +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap +where + K: IntoDeserializer<'de, E> + Eq + Ord, + V: IntoDeserializer<'de, E>, + E: de::Error, { - type Deserializer = MapDeserializer, E>; + type Deserializer = MapDeserializer<'de, ::IntoIter, E>; fn into_deserializer(self) -> Self::Deserializer { MapDeserializer::new(self.into_iter()) @@ -913,143 +1161,63 @@ } #[cfg(feature = "std")] -impl ValueDeserializer for HashMap - where K: ValueDeserializer + Eq + Hash, - V: ValueDeserializer, - E: de::Error +impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap +where + K: IntoDeserializer<'de, E> + Eq + Hash, + V: IntoDeserializer<'de, E>, + S: BuildHasher, + E: de::Error, { - type Deserializer = MapDeserializer, E>; + type Deserializer = MapDeserializer<'de, ::IntoIter, E>; fn into_deserializer(self) -> Self::Deserializer { MapDeserializer::new(self.into_iter()) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// A helper deserializer that deserializes a map using a `MapVisitor`. -pub struct MapVisitorDeserializer { - visitor: V_, - marker: PhantomData, +/// A deserializer holding a `MapAccess`. +#[derive(Clone, Debug)] +pub struct MapAccessDeserializer { + map: A, } -impl MapVisitorDeserializer - where V_: de::MapVisitor, - E: de::Error -{ - /// Construct a new `MapVisitorDeserializer`. - pub fn new(visitor: V_) -> Self { - MapVisitorDeserializer { - visitor: visitor, - marker: PhantomData, - } +impl MapAccessDeserializer { + /// Construct a new `MapAccessDeserializer`. + pub fn new(map: A) -> Self { + MapAccessDeserializer { map: map } } } -impl de::Deserializer for MapVisitorDeserializer - where V_: de::MapVisitor, - E: de::Error +impl<'de, A> de::Deserializer<'de> for MapAccessDeserializer +where + A: de::MapAccess<'de>, { - type Error = E; + type Error = A::Error; - fn deserialize(self, visitor: V) -> Result { - visitor.visit_map(self.visitor) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple enum ignored_any byte_buf - } -} - -/////////////////////////////////////////////////////////////////////////////// - -impl<'a, E> ValueDeserializer for bytes::Bytes<'a> - where E: de::Error -{ - type Deserializer = BytesDeserializer<'a, E>; - - fn into_deserializer(self) -> BytesDeserializer<'a, E> { - BytesDeserializer { - value: self.into(), - marker: PhantomData, - } - } -} - -/// A helper deserializer that deserializes a `&[u8]`. -pub struct BytesDeserializer<'a, E> { - value: &'a [u8], - marker: PhantomData, -} - -impl<'a, E> de::Deserializer for BytesDeserializer<'a, E> - where E: de::Error -{ - type Error = E; - - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, { - visitor.visit_bytes(self.value) + visitor.visit_map(self.map) } - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple enum ignored_any byte_buf + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any } } -/////////////////////////////////////////////////////////////////////////////// - -#[cfg(any(feature = "std", feature = "collections"))] -impl ValueDeserializer for bytes::ByteBuf - where E: de::Error -{ - type Deserializer = ByteBufDeserializer; - - fn into_deserializer(self) -> Self::Deserializer { - ByteBufDeserializer { - value: self.into(), - marker: PhantomData, - } - } -} - -/// A helper deserializer that deserializes a `Vec`. -#[cfg(any(feature = "std", feature = "collections"))] -pub struct ByteBufDeserializer { - value: Vec, - marker: PhantomData, -} - -#[cfg(any(feature = "std", feature = "collections"))] -impl de::Deserializer for ByteBufDeserializer - where E: de::Error -{ - type Error = E; - - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor - { - visitor.visit_byte_buf(self.value) - } - - forward_to_deserialize! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct struct_field tuple enum ignored_any byte_buf - } -} - -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// mod private { + use lib::*; + use de::{self, Unexpected}; - use core::marker::PhantomData; + #[derive(Clone, Debug)] pub struct UnitOnly { marker: PhantomData, } @@ -1058,34 +1226,39 @@ (t, UnitOnly { marker: PhantomData }) } - impl de::VariantVisitor for UnitOnly - where E: de::Error + impl<'de, E> de::VariantAccess<'de> for UnitOnly + where + E: de::Error, { type Error = E; - fn visit_unit(self) -> Result<(), Self::Error> { + fn unit_variant(self) -> Result<(), Self::Error> { Ok(()) } - fn visit_newtype_seed(self, _seed: T) -> Result - where T: de::DeserializeSeed + fn newtype_variant_seed(self, _seed: T) -> Result + where + T: de::DeserializeSeed<'de>, { - Err(de::Error::invalid_type(Unexpected::UnitVariant, &"newtype variant")) + Err(de::Error::invalid_type(Unexpected::UnitVariant, &"newtype variant"),) } - fn visit_tuple(self, _len: usize, _visitor: V) -> Result - where V: de::Visitor + fn tuple_variant(self, _len: usize, _visitor: V) -> Result + where + V: de::Visitor<'de>, { - Err(de::Error::invalid_type(Unexpected::UnitVariant, &"tuple variant")) + Err(de::Error::invalid_type(Unexpected::UnitVariant, &"tuple variant"),) } - fn visit_struct(self, - _fields: &'static [&'static str], - _visitor: V) - -> Result - where V: de::Visitor + fn struct_variant( + self, + _fields: &'static [&'static str], + _visitor: V, + ) -> Result + where + V: de::Visitor<'de>, { - Err(de::Error::invalid_type(Unexpected::UnitVariant, &"struct variant")) + Err(de::Error::invalid_type(Unexpected::UnitVariant, &"struct variant"),) } } @@ -1104,4 +1277,7 @@ self } } + + pub type First = ::First; + pub type Second = ::Second; } diff -Nru distinst-0.1.0/vendor/serde/src/error.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/error.rs --- distinst-0.1.0/vendor/serde/src/error.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/error.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -//! A stand-in for `std::error` -use core::fmt::{Debug, Display}; - -/// A stand-in for `std::error::Error`, which requires no allocation. -pub trait Error: Debug + Display { - /// A short description of the error. - /// - /// The description should not contain newlines or sentence-ending - /// punctuation, to facilitate embedding in larger user-facing - /// strings. - fn description(&self) -> &str; - - /// The lower-level cause of this error, if any. - fn cause(&self) -> Option<&Error> { - None - } -} diff -Nru distinst-0.1.0/vendor/serde/src/export.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/export.rs --- distinst-0.1.0/vendor/serde/src/export.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/export.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,36 +1,41 @@ -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::String; +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. -#[cfg(feature = "std")] -use std::borrow::Cow; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::borrow::Cow; +pub use lib::clone::Clone; +pub use lib::convert::{From, Into}; +pub use lib::default::Default; +pub use lib::fmt::{self, Formatter}; +pub use lib::marker::PhantomData; +pub use lib::option::Option::{self, None, Some}; +pub use lib::result::Result::{self, Ok, Err}; -pub use core::clone::Clone; -pub use core::convert::{From, Into}; -pub use core::default::Default; -pub use core::fmt; -pub use core::marker::PhantomData; -pub use core::option::Option::{self, None, Some}; -pub use core::result::Result::{self, Ok, Err}; +pub use self::string::from_utf8_lossy; -#[cfg(any(feature = "collections", feature = "std"))] -pub fn from_utf8_lossy(bytes: &[u8]) -> Cow { - String::from_utf8_lossy(bytes) -} +mod string { + use lib::*; -// The generated code calls this like: -// -// let value = &_serde::export::from_utf8_lossy(bytes); -// Err(_serde::de::Error::unknown_variant(value, VARIANTS)) -// -// so it is okay for the return type to be different from the std case as long -// as the above works. -#[cfg(not(any(feature = "collections", feature = "std")))] -pub fn from_utf8_lossy(bytes: &[u8]) -> &str { - use core::str; - // Three unicode replacement characters if it fails. They look like a - // white-on-black question mark. The user will recognize it as invalid - // UTF-8. - str::from_utf8(bytes).unwrap_or("\u{fffd}\u{fffd}\u{fffd}") + #[cfg(any(feature = "std", feature = "alloc"))] + pub fn from_utf8_lossy(bytes: &[u8]) -> Cow { + String::from_utf8_lossy(bytes) + } + + // The generated code calls this like: + // + // let value = &_serde::export::from_utf8_lossy(bytes); + // Err(_serde::de::Error::unknown_variant(value, VARIANTS)) + // + // so it is okay for the return type to be different from the std case as long + // as the above works. + #[cfg(not(any(feature = "std", feature = "alloc")))] + pub fn from_utf8_lossy(bytes: &[u8]) -> &str { + // Three unicode replacement characters if it fails. They look like a + // white-on-black question mark. The user will recognize it as invalid + // UTF-8. + str::from_utf8(bytes).unwrap_or("\u{fffd}\u{fffd}\u{fffd}") + } } diff -Nru distinst-0.1.0/vendor/serde/src/iter.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/iter.rs --- distinst-0.1.0/vendor/serde/src/iter.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/iter.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -//! Module that contains helper iterators. - -use std::io; -use std::iter::Peekable; - -/// Iterator over a byte stream that tracks the current position's line and column. -pub struct LineColIterator>> { - iter: Iter, - line: usize, - col: usize, -} - -impl>> LineColIterator { - /// Construct a new `LineColIterator`. - pub fn new(iter: Iter) -> LineColIterator { - LineColIterator { - iter: iter, - line: 1, - col: 0, - } - } - - /// Report the current line inside the iterator. - pub fn line(&self) -> usize { - self.line - } - - /// Report the current column inside the iterator. - pub fn col(&self) -> usize { - self.col - } - - /// Gets a reference to the underlying iterator. - pub fn get_ref(&self) -> &Iter { - &self.iter - } - - /// Gets a mutable reference to the underlying iterator. - pub fn get_mut(&mut self) -> &mut Iter { - &mut self.iter - } - - /// Unwraps this `LineColIterator`, returning the underlying iterator. - pub fn into_inner(self) -> Iter { - self.iter - } -} - -impl>> LineColIterator> { - /// peeks at the next value - pub fn peek(&mut self) -> Option<&io::Result> { - self.iter.peek() - } -} - -impl>> Iterator for LineColIterator { - type Item = io::Result; - fn next(&mut self) -> Option> { - match self.iter.next() { - None => None, - Some(Ok(b'\n')) => { - self.line += 1; - self.col = 0; - Some(Ok(b'\n')) - } - Some(Ok(c)) => { - self.col += 1; - Some(Ok(c)) - } - Some(Err(e)) => Some(Err(e)), - } - } -} diff -Nru distinst-0.1.0/vendor/serde/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/lib.rs --- distinst-0.1.0/vendor/serde/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,3 +1,11 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + //! # Serde //! //! Serde is a framework for ***ser***ializing and ***de***serializing Rust data @@ -9,104 +17,231 @@ //! these two groups interact with each other, allowing any supported data //! structure to be serialized and deserialized using any supported data format. //! -//! See the Serde website https://serde.rs/ for additional documentation and +//! See the Serde website [https://serde.rs/] for additional documentation and //! usage examples. //! -//! ### Design +//! [https://serde.rs/]: https://serde.rs/ +//! +//! ## Design //! //! Where many other languages rely on runtime reflection for serializing data, //! Serde is instead built on Rust's powerful trait system. A data structure //! that knows how to serialize and deserialize itself is one that implements -//! Serde's `Serialize` and `Deserialize` traits (or uses Serde's code -//! generation to automatically derive implementations at compile time). This +//! Serde's `Serialize` and `Deserialize` traits (or uses Serde's derive +//! attribute to automatically generate implementations at compile time). This //! avoids any overhead of reflection or runtime type information. In fact in //! many situations the interaction between data structure and data format can //! be completely optimized away by the Rust compiler, leaving Serde -//! serialization to perform roughly the same speed as a handwritten serializer -//! for the specific selection of data structure and data format. +//! serialization to perform the same speed as a handwritten serializer for the +//! specific selection of data structure and data format. //! -//! ### Data formats +//! ## Data formats //! //! The following is a partial list of data formats that have been implemented //! for Serde by the community. //! -//! - [JSON](https://github.com/serde-rs/json), the ubiquitous JavaScript Object -//! Notation used by many HTTP APIs. -//! - [Bincode](https://github.com/TyOverby/bincode), a compact binary format +//! - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs. +//! - [Bincode], a compact binary format //! used for IPC within the Servo rendering engine. -//! - [CBOR](https://github.com/pyfisch/cbor), a Concise Binary Object -//! Representation designed for small message size without the need for -//! version negotiation. -//! - [YAML](https://github.com/dtolnay/serde-yaml), a popular human-friendly -//! configuration language that ain't markup language. -//! - [MessagePack](https://github.com/3Hren/msgpack-rust), an efficient binary -//! format that resembles a compact JSON. -//! - [TOML](https://github.com/alexcrichton/toml-rs), a minimal configuration -//! format used by [Cargo](http://doc.crates.io/manifest.html). -//! - [Pickle](https://github.com/birkenfeld/serde-pickle), a format common in -//! the Python world. -//! - [Hjson](https://github.com/laktak/hjson-rust), a variant of JSON designed -//! to be readable and writable by humans. -//! - [BSON](https://github.com/zonyitoo/bson-rs), the data storage and network -//! transfer format used by MongoDB. -//! - [URL](https://github.com/nox/serde_urlencoded), the x-www-form-urlencoded -//! format. -//! - [XML](https://github.com/serde-rs/xml), the flexible machine-friendly W3C -//! standard. *(deserialization only)* -//! - [Envy](https://github.com/softprops/envy), a way to deserialize -//! environment variables into Rust structs. *(deserialization only)* -//! - [Redis](https://github.com/OneSignal/serde-redis), deserialize values from -//! Redis when using [redis-rs](https://crates.io/crates/redis). +//! - [CBOR], a Concise Binary Object Representation designed for small message +//! size without the need for version negotiation. +//! - [YAML], a popular human-friendly configuration language that ain't markup +//! language. +//! - [MessagePack], an efficient binary format that resembles a compact JSON. +//! - [TOML], a minimal configuration format used by [Cargo]. +//! - [Pickle], a format common in the Python world. +//! - [Hjson], a variant of JSON designed to be readable and writable by humans. +//! - [BSON], the data storage and network transfer format used by MongoDB. +//! - [URL], the x-www-form-urlencoded format. +//! - [XML], the flexible machine-friendly W3C standard. +//! *(deserialization only)* +//! - [Envy], a way to deserialize environment variables into Rust structs. //! *(deserialization only)* +//! - [Redis], deserialize values from Redis when using [redis-rs]. +//! *(deserialization only)* +//! +//! [JSON]: https://github.com/serde-rs/json +//! [Bincode]: https://github.com/TyOverby/bincode +//! [CBOR]: https://github.com/pyfisch/cbor +//! [YAML]: https://github.com/dtolnay/serde-yaml +//! [MessagePack]: https://github.com/3Hren/msgpack-rust +//! [TOML]: https://github.com/alexcrichton/toml-rs +//! [Pickle]: https://github.com/birkenfeld/serde-pickle +//! [Hjson]: https://github.com/laktak/hjson-rust +//! [BSON]: https://github.com/zonyitoo/bson-rs +//! [URL]: https://github.com/nox/serde_urlencoded +//! [XML]: https://github.com/RReverser/serde-xml-rs +//! [Envy]: https://github.com/softprops/envy +//! [Redis]: https://github.com/OneSignal/serde-redis +//! [Cargo]: http://doc.crates.io/manifest.html +//! [redis-rs]: https://crates.io/crates/redis + +//////////////////////////////////////////////////////////////////////////////// -#![doc(html_root_url="https://docs.serde.rs")] +// Serde types in rustdoc of other crates get linked to here. +#![doc(html_root_url = "https://docs.rs/serde/1.0.21")] + +// Support using Serde without the standard library! #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(feature = "unstable", feature(nonzero, specialization, into_boxed_c_str))] + +// Unstable functionality only if the user asks for it. For tracking and +// discussion of these features please refer to this issue: +// +// https://github.com/serde-rs/serde/issues/812 +#![cfg_attr(feature = "unstable", feature(nonzero, specialization))] #![cfg_attr(feature = "alloc", feature(alloc))] -#![cfg_attr(feature = "collections", feature(collections))] -#![cfg_attr(feature = "cargo-clippy", allow(linkedlist, type_complexity, doc_markdown))] -#![deny(missing_docs)] -#[cfg(feature = "collections")] -extern crate collections; +#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] +// Whitelisted clippy lints +#![cfg_attr(feature = "cargo-clippy", allow( + cast_lossless, + const_static_lifetime, + doc_markdown, + linkedlist, + needless_pass_by_value, + type_complexity, + unreadable_literal, + zero_prefixed_literal, +))] +// Whitelisted clippy_pedantic lints +#![cfg_attr(feature = "cargo-clippy", allow( +// integer and float ser/de requires these sorts of casts + cast_possible_truncation, + cast_possible_wrap, + cast_precision_loss, + cast_sign_loss, +// simplifies some macros + invalid_upcast_comparisons, +// things are often more readable this way + option_unwrap_used, + result_unwrap_used, + shadow_reuse, + single_match_else, + stutter, + use_self, +// not practical + missing_docs_in_private_items, +// alternative is not stable + empty_enum, + use_debug, +))] + +// Blacklisted Rust lints. +#![deny(missing_docs, unused_imports)] + +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "alloc")] extern crate alloc; -#[cfg(feature = "unstable")] -extern crate core as actual_core; +#[cfg(all(feature = "unstable", feature = "std"))] +extern crate core; + +/// A facade around all the types we need from the `std`, `core`, and `alloc` +/// crates. This avoids elaborate import wrangling having to happen in every +/// module. +mod lib { + mod core { + #[cfg(feature = "std")] + pub use std::*; + #[cfg(not(feature = "std"))] + pub use core::*; + } + + pub use self::core::{cmp, iter, mem, ops, slice, str}; + pub use self::core::{i8, i16, i32, i64, isize}; + pub use self::core::{u8, u16, u32, u64, usize}; + pub use self::core::{f32, f64}; + + pub use self::core::cell::{Cell, RefCell}; + pub use self::core::clone::{self, Clone}; + pub use self::core::convert::{self, From, Into}; + pub use self::core::default::{self, Default}; + pub use self::core::fmt::{self, Debug, Display}; + pub use self::core::marker::{self, PhantomData}; + pub use self::core::option::{self, Option}; + pub use self::core::result::{self, Result}; + + #[cfg(feature = "std")] + pub use std::borrow::{Cow, ToOwned}; + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::borrow::{Cow, ToOwned}; + + #[cfg(feature = "std")] + pub use std::string::String; + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::string::{String, ToString}; + + #[cfg(feature = "std")] + pub use std::vec::Vec; + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::vec::Vec; + + #[cfg(feature = "std")] + pub use std::boxed::Box; + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::boxed::Box; + + #[cfg(all(feature = "rc", feature = "std"))] + pub use std::rc::Rc; + #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))] + pub use alloc::rc::Rc; + + #[cfg(all(feature = "rc", feature = "std"))] + pub use std::sync::Arc; + #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))] + pub use alloc::arc::Arc; + + #[cfg(feature = "std")] + pub use std::collections::{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque}; + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque}; + + #[cfg(feature = "std")] + pub use std::{error, net}; + + #[cfg(feature = "std")] + pub use std::collections::{HashMap, HashSet}; + #[cfg(feature = "std")] + pub use std::ffi::{CString, CStr, OsString, OsStr}; + #[cfg(feature = "std")] + pub use std::hash::{Hash, BuildHasher}; + #[cfg(feature = "std")] + pub use std::io::Write; + #[cfg(feature = "std")] + pub use std::num::Wrapping; + #[cfg(feature = "std")] + pub use std::path::{Path, PathBuf}; + #[cfg(feature = "std")] + pub use std::time::{Duration, SystemTime, UNIX_EPOCH}; + #[cfg(feature = "std")] + pub use std::sync::{Mutex, RwLock}; -#[cfg(feature = "std")] -mod core { - pub use std::{ops, hash, fmt, cmp, marker, mem, i8, i16, i32, i64, u8, u16, u32, u64, isize, - usize, f32, f64, char, str, num, slice, iter, cell, default, result, option, - clone, convert}; #[cfg(feature = "unstable")] - pub use actual_core::nonzero; + pub use core::nonzero::{NonZero, Zeroable}; } -#[doc(inline)] -pub use ser::{Serialize, Serializer}; -#[doc(inline)] -pub use de::{Deserialize, Deserializer}; +//////////////////////////////////////////////////////////////////////////////// #[macro_use] mod macros; -pub mod bytes; -pub mod de; -#[cfg(feature = "std")] -#[doc(hidden)] -pub mod iter; pub mod ser; -#[cfg_attr(feature = "std", doc(hidden))] -pub mod error; -mod utils; +pub mod de; + +#[doc(inline)] +pub use ser::{Serialize, Serializer}; +#[doc(inline)] +pub use de::{Deserialize, Deserializer}; // Generated code uses these to support no_std. Not public API. #[doc(hidden)] pub mod export; +// Helpers used by generated code and doc tests. Not public API. +#[doc(hidden)] +pub mod private; + // Re-export #[derive(Serialize, Deserialize)]. // // This is a workaround for https://github.com/rust-lang/cargo/issues/1286. diff -Nru distinst-0.1.0/vendor/serde/src/macros.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/macros.rs --- distinst-0.1.0/vendor/serde/src/macros.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/macros.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,107 +1,10 @@ -#[doc(hidden)] -#[macro_export] -macro_rules! forward_to_deserialize_method { - ($func:ident($($arg:ty),*)) => { - #[inline] - fn $func<__V>(self, $(_: $arg,)* visitor: __V) -> $crate::export::Result<__V::Value, Self::Error> - where __V: $crate::de::Visitor - { - self.deserialize(visitor) - } - }; -} - -#[doc(hidden)] -#[macro_export] -macro_rules! forward_to_deserialize_helper { - (bool) => { - forward_to_deserialize_method!{deserialize_bool()} - }; - (u8) => { - forward_to_deserialize_method!{deserialize_u8()} - }; - (u16) => { - forward_to_deserialize_method!{deserialize_u16()} - }; - (u32) => { - forward_to_deserialize_method!{deserialize_u32()} - }; - (u64) => { - forward_to_deserialize_method!{deserialize_u64()} - }; - (i8) => { - forward_to_deserialize_method!{deserialize_i8()} - }; - (i16) => { - forward_to_deserialize_method!{deserialize_i16()} - }; - (i32) => { - forward_to_deserialize_method!{deserialize_i32()} - }; - (i64) => { - forward_to_deserialize_method!{deserialize_i64()} - }; - (f32) => { - forward_to_deserialize_method!{deserialize_f32()} - }; - (f64) => { - forward_to_deserialize_method!{deserialize_f64()} - }; - (char) => { - forward_to_deserialize_method!{deserialize_char()} - }; - (str) => { - forward_to_deserialize_method!{deserialize_str()} - }; - (string) => { - forward_to_deserialize_method!{deserialize_string()} - }; - (unit) => { - forward_to_deserialize_method!{deserialize_unit()} - }; - (option) => { - forward_to_deserialize_method!{deserialize_option()} - }; - (seq) => { - forward_to_deserialize_method!{deserialize_seq()} - }; - (seq_fixed_size) => { - forward_to_deserialize_method!{deserialize_seq_fixed_size(usize)} - }; - (bytes) => { - forward_to_deserialize_method!{deserialize_bytes()} - }; - (byte_buf) => { - forward_to_deserialize_method!{deserialize_byte_buf()} - }; - (map) => { - forward_to_deserialize_method!{deserialize_map()} - }; - (unit_struct) => { - forward_to_deserialize_method!{deserialize_unit_struct(&'static str)} - }; - (newtype_struct) => { - forward_to_deserialize_method!{deserialize_newtype_struct(&'static str)} - }; - (tuple_struct) => { - forward_to_deserialize_method!{deserialize_tuple_struct(&'static str, usize)} - }; - (struct) => { - forward_to_deserialize_method!{deserialize_struct(&'static str, &'static [&'static str])} - }; - (struct_field) => { - forward_to_deserialize_method!{deserialize_struct_field()} - }; - (tuple) => { - forward_to_deserialize_method!{deserialize_tuple(usize)} - }; - (enum) => { - forward_to_deserialize_method!{deserialize_enum(&'static str, &'static [&'static str])} - }; - (ignored_any) => { - forward_to_deserialize_method!{deserialize_ignored_any()} - }; -} +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. // Super explicit first paragraph because this shows up at the top level and // trips up people who are just looking for basic Serialize / Deserialize @@ -110,98 +13,230 @@ /// Helper macro when implementing the `Deserializer` part of a new data format /// for Serde. /// -/// Some `Deserializer` implementations for self-describing formats do not care -/// what hint the `Visitor` gives them, they just want to blindly call the -/// `Visitor` method corresponding to the data they can tell is in the input. -/// This requires repetitive implementations of all the `Deserializer` trait -/// methods. +/// Some [`Deserializer`] implementations for self-describing formats do not +/// care what hint the [`Visitor`] gives them, they just want to blindly call +/// the [`Visitor`] method corresponding to the data they can tell is in the +/// input. This requires repetitive implementations of all the [`Deserializer`] +/// trait methods. /// /// ```rust -/// # #[macro_use] extern crate serde; +/// # #[macro_use] +/// # extern crate serde; +/// # /// # use serde::de::{value, Deserializer, Visitor}; -/// # pub struct MyDeserializer; -/// # impl Deserializer for MyDeserializer { +/// # +/// # struct MyDeserializer; +/// # +/// # impl<'de> Deserializer<'de> for MyDeserializer { /// # type Error = value::Error; -/// # fn deserialize(self, _: V) -> Result -/// # where V: Visitor -/// # { unimplemented!() } +/// # +/// # fn deserialize_any(self, _: V) -> Result +/// # where V: Visitor<'de> +/// # { +/// # unimplemented!() +/// # } /// # /// #[inline] /// fn deserialize_bool(self, visitor: V) -> Result -/// where V: Visitor +/// where V: Visitor<'de> /// { -/// self.deserialize(visitor) +/// self.deserialize_any(visitor) /// } -/// # forward_to_deserialize! { -/// # u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option -/// # seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct -/// # tuple_struct struct struct_field tuple enum ignored_any +/// # +/// # forward_to_deserialize_any! { +/// # i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes +/// # byte_buf option unit unit_struct newtype_struct seq tuple +/// # tuple_struct map struct enum identifier ignored_any /// # } /// # } +/// # /// # fn main() {} /// ``` /// -/// The `forward_to_deserialize!` macro implements these simple forwarding -/// methods so that they forward directly to `Deserializer::deserialize`. You -/// can choose which methods to forward. +/// The `forward_to_deserialize_any!` macro implements these simple forwarding +/// methods so that they forward directly to [`Deserializer::deserialize_any`]. +/// You can choose which methods to forward. /// /// ```rust -/// # #[macro_use] extern crate serde; +/// # #[macro_use] +/// # extern crate serde; +/// # /// # use serde::de::{value, Deserializer, Visitor}; -/// # pub struct MyDeserializer; -/// impl Deserializer for MyDeserializer { +/// # +/// # struct MyDeserializer; +/// # +/// impl<'de> Deserializer<'de> for MyDeserializer { /// # type Error = value::Error; -/// fn deserialize(self, visitor: V) -> Result -/// where V: Visitor +/// # +/// fn deserialize_any(self, visitor: V) -> Result +/// where V: Visitor<'de> /// { /// /* ... */ /// # let _ = visitor; /// # unimplemented!() /// } /// -/// forward_to_deserialize! { -/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option -/// seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct -/// tuple_struct struct struct_field tuple enum ignored_any +/// forward_to_deserialize_any! { +/// bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes +/// byte_buf option unit unit_struct newtype_struct seq tuple +/// tuple_struct map struct enum identifier ignored_any /// } /// } +/// # /// # fn main() {} /// ``` +/// +/// The macro assumes the convention that your `Deserializer` lifetime parameter +/// is called `'de` and that the `Visitor` type parameters on each method are +/// called `V`. A different type parameter and a different lifetime can be +/// specified explicitly if necessary. +/// +/// ```rust +/// # #[macro_use] +/// # extern crate serde; +/// # +/// # use std::marker::PhantomData; +/// # +/// # use serde::de::{value, Deserializer, Visitor}; +/// # +/// # struct MyDeserializer(PhantomData); +/// # +/// # impl<'q, V> Deserializer<'q> for MyDeserializer { +/// # type Error = value::Error; +/// # +/// # fn deserialize_any(self, visitor: W) -> Result +/// # where W: Visitor<'q> +/// # { +/// # unimplemented!() +/// # } +/// # +/// forward_to_deserialize_any! { +/// > +/// bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes +/// byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct +/// map struct enum identifier ignored_any +/// } +/// # } +/// # +/// # fn main() {} +/// ``` +/// +/// [`Deserializer`]: trait.Deserializer.html +/// [`Visitor`]: de/trait.Visitor.html +/// [`Deserializer::deserialize_any`]: trait.Deserializer.html#tymethod.deserialize_any #[macro_export] -macro_rules! forward_to_deserialize { +macro_rules! forward_to_deserialize_any { + (<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => { + $(forward_to_deserialize_any_helper!{$func<$lifetime, $visitor>})* + }; + // This case must be after the previous one. ($($func:ident)*) => { - $(forward_to_deserialize_helper!{$func})* + $(forward_to_deserialize_any_helper!{$func<'de, V>})* }; } -/// Seralize the `$value` that implements Display as a string, -/// when that string is statically known to never have more than -/// a constant `$MAX_LEN` bytes. -/// -/// Panics if the Display impl tries to write more than `$MAX_LEN` bytes. -#[cfg(feature = "std")] -// Not exported -macro_rules! serialize_display_bounded_length { - ($value: expr, $MAX_LEN: expr, $serializer: expr) => { +#[doc(hidden)] +#[macro_export] +macro_rules! forward_to_deserialize_any_method { + ($func:ident<$l:tt, $v:ident>($($arg:ident : $ty:ty),*)) => { + #[inline] + fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::export::Result<$v::Value, Self::Error> + where + $v: $crate::de::Visitor<$l>, { - use std::io::Write; - let mut buffer: [u8; $MAX_LEN] = unsafe { ::std::mem::uninitialized() }; - let remaining_len; - { - let mut remaining = &mut buffer[..]; - write!(remaining, "{}", $value).unwrap(); - remaining_len = remaining.len() - } - let written_len = buffer.len() - remaining_len; - let written = &buffer[..written_len]; - - // write! only provides std::fmt::Formatter to Display implementations, - // which has methods write_str and write_char but no method to write arbitrary bytes. - // Therefore, `written` is well-formed in UTF-8. - let written_str = unsafe { - ::std::str::from_utf8_unchecked(written) - }; - $serializer.serialize_str(written_str) + $( + let _ = $arg; + )* + self.deserialize_any(visitor) } - } + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! forward_to_deserialize_any_helper { + (bool<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_bool<$l, $v>()} + }; + (i8<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i8<$l, $v>()} + }; + (i16<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i16<$l, $v>()} + }; + (i32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i32<$l, $v>()} + }; + (i64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i64<$l, $v>()} + }; + (u8<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()} + }; + (u16<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()} + }; + (u32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()} + }; + (u64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()} + }; + (f32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_f32<$l, $v>()} + }; + (f64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_f64<$l, $v>()} + }; + (char<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_char<$l, $v>()} + }; + (str<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_str<$l, $v>()} + }; + (string<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_string<$l, $v>()} + }; + (bytes<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_bytes<$l, $v>()} + }; + (byte_buf<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_byte_buf<$l, $v>()} + }; + (option<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_option<$l, $v>()} + }; + (unit<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_unit<$l, $v>()} + }; + (unit_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_unit_struct<$l, $v>(name: &'static str)} + }; + (newtype_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_newtype_struct<$l, $v>(name: &'static str)} + }; + (seq<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_seq<$l, $v>()} + }; + (tuple<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_tuple<$l, $v>(len: usize)} + }; + (tuple_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_tuple_struct<$l, $v>(name: &'static str, len: usize)} + }; + (map<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_map<$l, $v>()} + }; + (struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_struct<$l, $v>(name: &'static str, fields: &'static [&'static str])} + }; + (enum<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_enum<$l, $v>(name: &'static str, variants: &'static [&'static str])} + }; + (identifier<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_identifier<$l, $v>()} + }; + (ignored_any<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_ignored_any<$l, $v>()} + }; } diff -Nru distinst-0.1.0/vendor/serde/src/private/de.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/de.rs --- distinst-0.1.0/vendor/serde/src/private/de.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/de.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,2010 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use lib::*; + +use de::{Deserialize, Deserializer, IntoDeserializer, Error, Visitor}; + +#[cfg(any(feature = "std", feature = "alloc"))] +use de::Unexpected; + +#[cfg(any(feature = "std", feature = "alloc"))] +pub use self::content::{Content, ContentRefDeserializer, ContentDeserializer, + TaggedContentVisitor, TagOrContentField, TagOrContentFieldVisitor, + TagContentOtherField, TagContentOtherFieldVisitor, + InternallyTaggedUnitVisitor, UntaggedUnitVisitor}; + +/// If the missing field is of type `Option` then treat is as `None`, +/// otherwise it is an error. +pub fn missing_field<'de, V, E>(field: &'static str) -> Result +where + V: Deserialize<'de>, + E: Error, +{ + struct MissingFieldDeserializer(&'static str, PhantomData); + + impl<'de, E> Deserializer<'de> for MissingFieldDeserializer + where + E: Error, + { + type Error = E; + + fn deserialize_any(self, _visitor: V) -> Result + where + V: Visitor<'de>, + { + Err(Error::missing_field(self.0)) + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_none() + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct newtype_struct seq tuple tuple_struct map + struct enum identifier ignored_any + } + } + + let deserializer = MissingFieldDeserializer(field, PhantomData); + Deserialize::deserialize(deserializer) +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub fn borrow_cow_str<'de: 'a, 'a, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + struct CowStrVisitor; + + impl<'a> Visitor<'a> for CowStrVisitor { + type Value = Cow<'a, str>; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.to_owned())) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v)) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(Cow::Owned(v)) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => Ok(Cow::Owned(s.to_owned())), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => Ok(Cow::Borrowed(s)), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + match String::from_utf8(v) { + Ok(s) => Ok(Cow::Owned(s)), + Err(e) => Err(Error::invalid_value(Unexpected::Bytes(&e.into_bytes()), &self),), + } + } + } + + deserializer.deserialize_str(CowStrVisitor) +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub fn borrow_cow_bytes<'de: 'a, 'a, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + struct CowBytesVisitor; + + impl<'a> Visitor<'a> for CowBytesVisitor { + type Value = Cow<'a, [u8]>; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a byte array") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.as_bytes().to_vec())) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v.as_bytes())) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.into_bytes())) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.to_vec())) + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v)) + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + Ok(Cow::Owned(v)) + } + } + + deserializer.deserialize_str(CowBytesVisitor) +} + +pub mod size_hint { + use lib::*; + + pub fn from_bounds(iter: &I) -> Option + where + I: Iterator, + { + helper(iter.size_hint()) + } + + pub fn cautious(hint: Option) -> usize { + cmp::min(hint.unwrap_or(0), 4096) + } + + fn helper(bounds: (usize, Option)) -> Option { + match bounds { + (lower, Some(upper)) if lower == upper => Some(upper), + _ => None, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +mod content { + // This module is private and nothing here should be used outside of + // generated code. + // + // We will iterate on the implementation for a few releases and only have to + // worry about backward compatibility for the `untagged` and `tag` attributes + // rather than for this entire mechanism. + // + // This issue is tracking making some of this stuff public: + // https://github.com/serde-rs/serde/issues/741 + + use lib::*; + + use de::{self, Deserialize, DeserializeSeed, Deserializer, Visitor, SeqAccess, MapAccess, + EnumAccess, Unexpected}; + use super::size_hint; + + /// Used from generated code to buffer the contents of the Deserializer when + /// deserializing untagged enums and internally tagged enums. + /// + /// Not public API. Use serde-value instead. + #[derive(Debug)] + pub enum Content<'de> { + Bool(bool), + + U8(u8), + U16(u16), + U32(u32), + U64(u64), + + I8(i8), + I16(i16), + I32(i32), + I64(i64), + + F32(f32), + F64(f64), + + Char(char), + String(String), + Str(&'de str), + ByteBuf(Vec), + Bytes(&'de [u8]), + + None, + Some(Box>), + + Unit, + Newtype(Box>), + Seq(Vec>), + Map(Vec<(Content<'de>, Content<'de>)>), + } + + impl<'de> Content<'de> { + fn unexpected(&self) -> Unexpected { + match *self { + Content::Bool(b) => Unexpected::Bool(b), + Content::U8(n) => Unexpected::Unsigned(n as u64), + Content::U16(n) => Unexpected::Unsigned(n as u64), + Content::U32(n) => Unexpected::Unsigned(n as u64), + Content::U64(n) => Unexpected::Unsigned(n), + Content::I8(n) => Unexpected::Signed(n as i64), + Content::I16(n) => Unexpected::Signed(n as i64), + Content::I32(n) => Unexpected::Signed(n as i64), + Content::I64(n) => Unexpected::Signed(n), + Content::F32(f) => Unexpected::Float(f as f64), + Content::F64(f) => Unexpected::Float(f), + Content::Char(c) => Unexpected::Char(c), + Content::String(ref s) => Unexpected::Str(s), + Content::Str(s) => Unexpected::Str(s), + Content::ByteBuf(ref b) => Unexpected::Bytes(b), + Content::Bytes(b) => Unexpected::Bytes(b), + Content::None | Content::Some(_) => Unexpected::Option, + Content::Unit => Unexpected::Unit, + Content::Newtype(_) => Unexpected::NewtypeStruct, + Content::Seq(_) => Unexpected::Seq, + Content::Map(_) => Unexpected::Map, + } + } + } + + impl<'de> Deserialize<'de> for Content<'de> { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Untagged and internally tagged enums are only supported in + // self-describing formats. + let visitor = ContentVisitor { value: PhantomData }; + deserializer.deserialize_any(visitor) + } + } + + struct ContentVisitor<'de> { + value: PhantomData>, + } + + impl<'de> ContentVisitor<'de> { + fn new() -> Self { + ContentVisitor { value: PhantomData } + } + } + + impl<'de> Visitor<'de> for ContentVisitor<'de> { + type Value = Content<'de>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.write_str("any value") + } + + fn visit_bool(self, value: bool) -> Result + where + F: de::Error, + { + Ok(Content::Bool(value)) + } + + fn visit_i8(self, value: i8) -> Result + where + F: de::Error, + { + Ok(Content::I8(value)) + } + + fn visit_i16(self, value: i16) -> Result + where + F: de::Error, + { + Ok(Content::I16(value)) + } + + fn visit_i32(self, value: i32) -> Result + where + F: de::Error, + { + Ok(Content::I32(value)) + } + + fn visit_i64(self, value: i64) -> Result + where + F: de::Error, + { + Ok(Content::I64(value)) + } + + fn visit_u8(self, value: u8) -> Result + where + F: de::Error, + { + Ok(Content::U8(value)) + } + + fn visit_u16(self, value: u16) -> Result + where + F: de::Error, + { + Ok(Content::U16(value)) + } + + fn visit_u32(self, value: u32) -> Result + where + F: de::Error, + { + Ok(Content::U32(value)) + } + + fn visit_u64(self, value: u64) -> Result + where + F: de::Error, + { + Ok(Content::U64(value)) + } + + fn visit_f32(self, value: f32) -> Result + where + F: de::Error, + { + Ok(Content::F32(value)) + } + + fn visit_f64(self, value: f64) -> Result + where + F: de::Error, + { + Ok(Content::F64(value)) + } + + fn visit_char(self, value: char) -> Result + where + F: de::Error, + { + Ok(Content::Char(value)) + } + + fn visit_str(self, value: &str) -> Result + where + F: de::Error, + { + Ok(Content::String(value.into())) + } + + fn visit_borrowed_str(self, value: &'de str) -> Result + where + F: de::Error, + { + Ok(Content::Str(value)) + } + + fn visit_string(self, value: String) -> Result + where + F: de::Error, + { + Ok(Content::String(value)) + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + F: de::Error, + { + Ok(Content::ByteBuf(value.into())) + } + + fn visit_borrowed_bytes(self, value: &'de [u8]) -> Result + where + F: de::Error, + { + Ok(Content::Bytes(value)) + } + + fn visit_byte_buf(self, value: Vec) -> Result + where + F: de::Error, + { + Ok(Content::ByteBuf(value)) + } + + fn visit_unit(self) -> Result + where + F: de::Error, + { + Ok(Content::Unit) + } + + fn visit_none(self) -> Result + where + F: de::Error, + { + Ok(Content::None) + } + + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map(|v| Content::Some(Box::new(v))) + } + + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map(|v| Content::Newtype(Box::new(v))) + } + + fn visit_seq(self, mut visitor: V) -> Result + where + V: SeqAccess<'de>, + { + let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint())); + while let Some(e) = try!(visitor.next_element()) { + vec.push(e); + } + Ok(Content::Seq(vec)) + } + + fn visit_map(self, mut visitor: V) -> Result + where + V: MapAccess<'de>, + { + let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint())); + while let Some(kv) = try!(visitor.next_entry()) { + vec.push(kv); + } + Ok(Content::Map(vec)) + } + + fn visit_enum(self, _visitor: V) -> Result + where + V: EnumAccess<'de>, + { + Err(de::Error::custom("untagged and internally tagged enums do not support enum input",),) + } + } + + /// This is the type of the map keys in an internally tagged enum. + /// + /// Not public API. + pub enum TagOrContent<'de> { + Tag, + Content(Content<'de>), + } + + struct TagOrContentVisitor<'de> { + name: &'static str, + value: PhantomData>, + } + + impl<'de> TagOrContentVisitor<'de> { + fn new(name: &'static str) -> Self { + TagOrContentVisitor { name: name, value: PhantomData } + } + } + + impl<'de> DeserializeSeed<'de> for TagOrContentVisitor<'de> { + type Value = TagOrContent<'de>; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Internally tagged enums are only supported in self-describing + // formats. + deserializer.deserialize_any(self) + } + } + + impl<'de> Visitor<'de> for TagOrContentVisitor<'de> { + type Value = TagOrContent<'de>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + write!(fmt, "a type tag `{}` or any other value", self.name) + } + + fn visit_bool(self, value: bool) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_bool(value) + .map(TagOrContent::Content) + } + + fn visit_i8(self, value: i8) -> Result + where + F: de::Error, + { + ContentVisitor::new().visit_i8(value).map(TagOrContent::Content) + } + + fn visit_i16(self, value: i16) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i16(value) + .map(TagOrContent::Content) + } + + fn visit_i32(self, value: i32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i32(value) + .map(TagOrContent::Content) + } + + fn visit_i64(self, value: i64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i64(value) + .map(TagOrContent::Content) + } + + fn visit_u8(self, value: u8) -> Result + where + F: de::Error, + { + ContentVisitor::new().visit_u8(value).map(TagOrContent::Content) + } + + fn visit_u16(self, value: u16) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u16(value) + .map(TagOrContent::Content) + } + + fn visit_u32(self, value: u32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u32(value) + .map(TagOrContent::Content) + } + + fn visit_u64(self, value: u64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u64(value) + .map(TagOrContent::Content) + } + + fn visit_f32(self, value: f32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_f32(value) + .map(TagOrContent::Content) + } + + fn visit_f64(self, value: f64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_f64(value) + .map(TagOrContent::Content) + } + + fn visit_char(self, value: char) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_char(value) + .map(TagOrContent::Content) + } + + fn visit_str(self, value: &str) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_str(value) + .map(TagOrContent::Content) + } + } + + fn visit_borrowed_str(self, value: &'de str) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_borrowed_str(value) + .map(TagOrContent::Content) + } + } + + fn visit_string(self, value: String) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_string(value) + .map(TagOrContent::Content) + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_bytes(value) + .map(TagOrContent::Content) + } + } + + fn visit_borrowed_bytes(self, value: &'de [u8]) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_borrowed_bytes(value) + .map(TagOrContent::Content) + } + } + + fn visit_byte_buf(self, value: Vec) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_byte_buf(value) + .map(TagOrContent::Content) + } + } + + fn visit_unit(self) -> Result + where + F: de::Error, + { + ContentVisitor::new().visit_unit().map(TagOrContent::Content) + } + + fn visit_none(self) -> Result + where + F: de::Error, + { + ContentVisitor::new().visit_none().map(TagOrContent::Content) + } + + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + ContentVisitor::new() + .visit_some(deserializer) + .map(TagOrContent::Content) + } + + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + ContentVisitor::new() + .visit_newtype_struct(deserializer) + .map(TagOrContent::Content) + } + + fn visit_seq(self, visitor: V) -> Result + where + V: SeqAccess<'de>, + { + ContentVisitor::new() + .visit_seq(visitor) + .map(TagOrContent::Content) + } + + fn visit_map(self, visitor: V) -> Result + where + V: MapAccess<'de>, + { + ContentVisitor::new() + .visit_map(visitor) + .map(TagOrContent::Content) + } + + fn visit_enum(self, visitor: V) -> Result + where + V: EnumAccess<'de>, + { + ContentVisitor::new() + .visit_enum(visitor) + .map(TagOrContent::Content) + } + } + + /// Used by generated code to deserialize an internally tagged enum. + /// + /// Not public API. + pub struct TaggedContent<'de, T> { + pub tag: T, + pub content: Content<'de>, + } + + /// Not public API. + pub struct TaggedContentVisitor<'de, T> { + tag_name: &'static str, + value: PhantomData>, + } + + impl<'de, T> TaggedContentVisitor<'de, T> { + /// Visitor for the content of an internally tagged enum with the given tag + /// name. + pub fn new(name: &'static str) -> Self { + TaggedContentVisitor { + tag_name: name, + value: PhantomData, + } + } + } + + impl<'de, T> DeserializeSeed<'de> for TaggedContentVisitor<'de, T> + where + T: Deserialize<'de>, + { + type Value = TaggedContent<'de, T>; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Internally tagged enums are only supported in self-describing + // formats. + deserializer.deserialize_any(self) + } + } + + impl<'de, T> Visitor<'de> for TaggedContentVisitor<'de, T> + where + T: Deserialize<'de>, + { + type Value = TaggedContent<'de, T>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.write_str("internally tagged enum") + } + + fn visit_seq(self, mut seq: S) -> Result + where + S: SeqAccess<'de>, + { + let tag = match try!(seq.next_element()) { + Some(tag) => tag, + None => { + return Err(de::Error::missing_field(self.tag_name)); + } + }; + let rest = de::value::SeqAccessDeserializer::new(seq); + Ok(TaggedContent { + tag: tag, + content: try!(Content::deserialize(rest)), + }) + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'de>, + { + let mut tag = None; + let mut vec = Vec::with_capacity(size_hint::cautious(map.size_hint())); + while let Some(k) = + try!(map.next_key_seed(TagOrContentVisitor::new(self.tag_name))) { + match k { + TagOrContent::Tag => { + if tag.is_some() { + return Err(de::Error::duplicate_field(self.tag_name)); + } + tag = Some(try!(map.next_value())); + } + TagOrContent::Content(k) => { + let v = try!(map.next_value()); + vec.push((k, v)); + } + } + } + match tag { + None => Err(de::Error::missing_field(self.tag_name)), + Some(tag) => { + Ok( + TaggedContent { + tag: tag, + content: Content::Map(vec), + }, + ) + } + } + } + } + + /// Used by generated code to deserialize an adjacently tagged enum. + /// + /// Not public API. + pub enum TagOrContentField { + Tag, + Content, + } + + /// Not public API. + pub struct TagOrContentFieldVisitor { + pub tag: &'static str, + pub content: &'static str, + } + + impl<'de> DeserializeSeed<'de> for TagOrContentFieldVisitor { + type Value = TagOrContentField; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(self) + } + } + + impl<'de> Visitor<'de> for TagOrContentFieldVisitor { + type Value = TagOrContentField; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "{:?} or {:?}", self.tag, self.content) + } + + fn visit_str(self, field: &str) -> Result + where + E: de::Error, + { + if field == self.tag { + Ok(TagOrContentField::Tag) + } else if field == self.content { + Ok(TagOrContentField::Content) + } else { + Err(de::Error::invalid_value(Unexpected::Str(field), &self)) + } + } + } + + /// Used by generated code to deserialize an adjacently tagged enum when + /// ignoring unrelated fields is allowed. + /// + /// Not public API. + pub enum TagContentOtherField { + Tag, + Content, + Other, + } + + /// Not public API. + pub struct TagContentOtherFieldVisitor { + pub tag: &'static str, + pub content: &'static str, + } + + impl<'de> DeserializeSeed<'de> for TagContentOtherFieldVisitor { + type Value = TagContentOtherField; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(self) + } + } + + impl<'de> Visitor<'de> for TagContentOtherFieldVisitor { + type Value = TagContentOtherField; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "{:?}, {:?}, or other ignored fields", self.tag, self.content) + } + + fn visit_str(self, field: &str) -> Result + where + E: de::Error, + { + if field == self.tag { + Ok(TagContentOtherField::Tag) + } else if field == self.content { + Ok(TagContentOtherField::Content) + } else { + Ok(TagContentOtherField::Other) + } + } + } + + /// Not public API + pub struct ContentDeserializer<'de, E> { + content: Content<'de>, + err: PhantomData, + } + + /// Used when deserializing an internally tagged enum because the content will + /// be used exactly once. + impl<'de, E> Deserializer<'de> for ContentDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Bool(v) => visitor.visit_bool(v), + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::Char(v) => visitor.visit_char(v), + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(v) => visitor.visit_byte_buf(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Unit => visitor.visit_unit(), + Content::None => visitor.visit_none(), + Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), + Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)), + Content::Seq(v) => { + let seq = v.into_iter().map(ContentDeserializer::new); + let mut seq_visitor = de::value::SeqDeserializer::new(seq); + let value = try!(visitor.visit_seq(&mut seq_visitor)); + try!(seq_visitor.end()); + Ok(value) + } + Content::Map(v) => { + let map = v.into_iter().map(|(k, v)| { + (ContentDeserializer::new(k), + ContentDeserializer::new(v)) + }); + let mut map_visitor = de::value::MapDeserializer::new(map); + let value = try!(visitor.visit_map(&mut map_visitor)); + try!(map_visitor.end()); + Ok(value) + } + } + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::None => visitor.visit_none(), + Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), + Content::Unit => visitor.visit_unit(), + _ => visitor.visit_some(self), + } + } + + fn deserialize_newtype_struct( + self, + _name: &str, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + visitor.visit_newtype_struct(self) + } + + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + let (variant, value) = match self.content { + Content::Map(value) => { + let mut iter = value.into_iter(); + let (variant, value) = match iter.next() { + Some(v) => v, + None => { + return Err( + de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + ), + ); + } + }; + // enums are encoded in json as maps with a single key:value pair + if iter.next().is_some() { + return Err( + de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + ), + ); + } + (variant, Some(value)) + } + s @ Content::String(_) | s @ Content::Str(_) => (s, None), + other => { + return Err(de::Error::invalid_type(other.unexpected(), &"string or map"),); + } + }; + + visitor.visit_enum( + EnumDeserializer { + variant: variant, + value: value, + err: PhantomData, + }, + ) + } + + fn deserialize_unit_struct( + self, + _name: &'static str, + visitor: V + ) -> Result + where + V: Visitor<'de>, + { + match self.content { + // As a special case, allow deserializing untagged newtype + // variant containing unit struct. + // + // #[derive(Deserialize)] + // struct Info; + // + // #[derive(Deserialize)] + // #[serde(tag = "topic")] + // enum Message { + // Info(Info), + // } + // + // We want {"topic":"Info"} to deserialize even though + // ordinarily unit structs do not deserialize from empty map. + Content::Map(ref v) if v.is_empty() => visitor.visit_unit(), + _ => self.deserialize_any(visitor), + } + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit seq tuple tuple_struct map struct identifier + ignored_any + } + } + + impl<'de, E> ContentDeserializer<'de, E> { + /// private API, don't use + pub fn new(content: Content<'de>) -> Self { + ContentDeserializer { + content: content, + err: PhantomData, + } + } + } + + struct EnumDeserializer<'de, E> + where + E: de::Error, + { + variant: Content<'de>, + value: Option>, + err: PhantomData, + } + + impl<'de, E> de::EnumAccess<'de> for EnumDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + type Variant = VariantDeserializer<'de, Self::Error>; + + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), E> + where + V: de::DeserializeSeed<'de>, + { + let visitor = VariantDeserializer { + value: self.value, + err: PhantomData, + }; + seed.deserialize(ContentDeserializer::new(self.variant)) + .map(|v| (v, visitor)) + } + } + + struct VariantDeserializer<'de, E> + where + E: de::Error, + { + value: Option>, + err: PhantomData, + } + + impl<'de, E> de::VariantAccess<'de> for VariantDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn unit_variant(self) -> Result<(), E> { + match self.value { + Some(value) => de::Deserialize::deserialize(ContentDeserializer::new(value)), + None => Ok(()), + } + } + + fn newtype_variant_seed(self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value { + Some(value) => seed.deserialize(ContentDeserializer::new(value)), + None => { + Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"newtype variant"),) + } + } + } + + fn tuple_variant(self, _len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(Content::Seq(v)) => { + de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"tuple variant"),), + None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"tuple variant"),), + } + } + + fn struct_variant( + self, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(Content::Map(v)) => { + de::Deserializer::deserialize_any(MapDeserializer::new(v), visitor) + } + Some(Content::Seq(v)) => { + de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"struct variant"),), + _ => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"struct variant"),), + } + } + } + + struct SeqDeserializer<'de, E> + where + E: de::Error, + { + iter: > as IntoIterator>::IntoIter, + err: PhantomData, + } + + impl<'de, E> SeqDeserializer<'de, E> + where + E: de::Error, + { + fn new(vec: Vec>) -> Self { + SeqDeserializer { + iter: vec.into_iter(), + err: PhantomData, + } + } + } + + impl<'de, E> de::Deserializer<'de> for SeqDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let len = self.iter.len(); + if len == 0 { + visitor.visit_unit() + } else { + let ret = try!(visitor.visit_seq(&mut self)); + let remaining = self.iter.len(); + if remaining == 0 { + Ok(ret) + } else { + Err(de::Error::invalid_length(len, &"fewer elements in array")) + } + } + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, E> de::SeqAccess<'de> for SeqDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(value) => { + seed.deserialize(ContentDeserializer::new(value)) + .map(Some) + } + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + struct MapDeserializer<'de, E> + where + E: de::Error, + { + iter: , Content<'de>)> as IntoIterator>::IntoIter, + value: Option>, + err: PhantomData, + } + + impl<'de, E> MapDeserializer<'de, E> + where + E: de::Error, + { + fn new(map: Vec<(Content<'de>, Content<'de>)>) -> Self { + MapDeserializer { + iter: map.into_iter(), + value: None, + err: PhantomData, + } + } + } + + impl<'de, E> de::MapAccess<'de> for MapDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some((key, value)) => { + self.value = Some(value); + seed.deserialize(ContentDeserializer::new(key)).map(Some) + } + None => Ok(None), + } + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value.take() { + Some(value) => seed.deserialize(ContentDeserializer::new(value)), + None => Err(de::Error::custom("value is missing")), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + impl<'de, E> de::Deserializer<'de> for MapDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_map(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + /// Not public API. + pub struct ContentRefDeserializer<'a, 'de: 'a, E> { + content: &'a Content<'de>, + err: PhantomData, + } + + /// Used when deserializing an untagged enum because the content may need to be + /// used more than once. + impl<'de, 'a, E> Deserializer<'de> for ContentRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Bool(v) => visitor.visit_bool(v), + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::Char(v) => visitor.visit_char(v), + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(ref v) => visitor.visit_bytes(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Unit => visitor.visit_unit(), + Content::None => visitor.visit_none(), + Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), + Content::Newtype(ref v) => { + visitor.visit_newtype_struct(ContentRefDeserializer::new(v)) + } + Content::Seq(ref v) => { + let seq = v.into_iter().map(ContentRefDeserializer::new); + let mut seq_visitor = de::value::SeqDeserializer::new(seq); + let value = try!(visitor.visit_seq(&mut seq_visitor)); + try!(seq_visitor.end()); + Ok(value) + } + Content::Map(ref v) => { + let map = v.into_iter() + .map( + |&(ref k, ref v)| { + (ContentRefDeserializer::new(k), ContentRefDeserializer::new(v)) + }, + ); + let mut map_visitor = de::value::MapDeserializer::new(map); + let value = try!(visitor.visit_map(&mut map_visitor)); + try!(map_visitor.end()); + Ok(value) + } + } + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::None => visitor.visit_none(), + Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), + Content::Unit => visitor.visit_unit(), + _ => visitor.visit_some(self), + } + } + + fn deserialize_newtype_struct(self, _name: &str, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_newtype_struct(self) + } + + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + let (variant, value) = match *self.content { + Content::Map(ref value) => { + let mut iter = value.into_iter(); + let &(ref variant, ref value) = match iter.next() { + Some(v) => v, + None => { + return Err( + de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + ), + ); + } + }; + // enums are encoded in json as maps with a single key:value pair + if iter.next().is_some() { + return Err( + de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + ), + ); + } + (variant, Some(value)) + } + ref s @ Content::String(_) | ref s @ Content::Str(_) => (s, None), + ref other => { + return Err(de::Error::invalid_type(other.unexpected(), &"string or map"),); + } + }; + + visitor.visit_enum( + EnumRefDeserializer { + variant: variant, + value: value, + err: PhantomData, + }, + ) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct seq tuple tuple_struct map struct + identifier ignored_any + } + } + + impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E> { + /// private API, don't use + pub fn new(content: &'a Content<'de>) -> Self { + ContentRefDeserializer { + content: content, + err: PhantomData, + } + } + } + + struct EnumRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + variant: &'a Content<'de>, + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'de, 'a, E> de::EnumAccess<'de> for EnumRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + type Variant = VariantRefDeserializer<'a, 'de, Self::Error>; + + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> + where + V: de::DeserializeSeed<'de>, + { + let visitor = VariantRefDeserializer { + value: self.value, + err: PhantomData, + }; + seed.deserialize(ContentRefDeserializer::new(self.variant)) + .map(|v| (v, visitor)) + } + } + + struct VariantRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'de, 'a, E> de::VariantAccess<'de> for VariantRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn unit_variant(self) -> Result<(), E> { + match self.value { + Some(value) => de::Deserialize::deserialize(ContentRefDeserializer::new(value)), + None => Ok(()), + } + } + + fn newtype_variant_seed(self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => { + Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"newtype variant"),) + } + } + } + + fn tuple_variant(self, _len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(&Content::Seq(ref v)) => { + de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"tuple variant"),), + None => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"tuple variant"),), + } + } + + fn struct_variant( + self, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(&Content::Map(ref v)) => { + de::Deserializer::deserialize_any(MapRefDeserializer::new(v), visitor) + } + Some(&Content::Seq(ref v)) => { + de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type(other.unexpected(), &"struct variant"),), + _ => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"struct variant"),), + } + } + } + + struct SeqRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + iter: <&'a [Content<'de>] as IntoIterator>::IntoIter, + err: PhantomData, + } + + impl<'a, 'de, E> SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + fn new(vec: &'a [Content<'de>]) -> Self { + SeqRefDeserializer { + iter: vec.into_iter(), + err: PhantomData, + } + } + } + + impl<'de, 'a, E> de::Deserializer<'de> for SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let len = self.iter.len(); + if len == 0 { + visitor.visit_unit() + } else { + let ret = try!(visitor.visit_seq(&mut self)); + let remaining = self.iter.len(); + if remaining == 0 { + Ok(ret) + } else { + Err(de::Error::invalid_length(len, &"fewer elements in array")) + } + } + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, 'a, E> de::SeqAccess<'de> for SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(value) => { + seed.deserialize(ContentRefDeserializer::new(value)) + .map(Some) + } + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + struct MapRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + iter: <&'a [(Content<'de>, Content<'de>)] as IntoIterator>::IntoIter, + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'a, 'de, E> MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + fn new(map: &'a [(Content<'de>, Content<'de>)]) -> Self { + MapRefDeserializer { + iter: map.into_iter(), + value: None, + err: PhantomData, + } + } + } + + impl<'de, 'a, E> de::MapAccess<'de> for MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(&(ref key, ref value)) => { + self.value = Some(value); + seed.deserialize(ContentRefDeserializer::new(key)) + .map(Some) + } + None => Ok(None), + } + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value.take() { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => Err(de::Error::custom("value is missing")), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + impl<'de, 'a, E> de::Deserializer<'de> for MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_map(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, E> de::IntoDeserializer<'de, E> for ContentDeserializer<'de, E> + where + E: de::Error, + { + type Deserializer = Self; + + fn into_deserializer(self) -> Self { + self + } + } + + impl<'de, 'a, E> de::IntoDeserializer<'de, E> for ContentRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Deserializer = Self; + + fn into_deserializer(self) -> Self { + self + } + } + + /// Visitor for deserializing an internally tagged unit variant. + /// + /// Not public API. + pub struct InternallyTaggedUnitVisitor<'a> { + type_name: &'a str, + variant_name: &'a str, + } + + impl<'a> InternallyTaggedUnitVisitor<'a> { + /// Not public API. + pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { + InternallyTaggedUnitVisitor { + type_name: type_name, + variant_name: variant_name, + } + } + } + + impl<'de, 'a> Visitor<'de> for InternallyTaggedUnitVisitor<'a> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "unit variant {}::{}", self.type_name, self.variant_name) + } + + fn visit_seq(self, _: S) -> Result<(), S::Error> + where + S: SeqAccess<'de>, + { + Ok(()) + } + + fn visit_map(self, _: M) -> Result<(), M::Error> + where + M: MapAccess<'de>, + { + Ok(()) + } + } + + /// Visitor for deserializing an untagged unit variant. + /// + /// Not public API. + pub struct UntaggedUnitVisitor<'a> { + type_name: &'a str, + variant_name: &'a str, + } + + impl<'a> UntaggedUnitVisitor<'a> { + /// Not public API. + pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { + UntaggedUnitVisitor { + type_name: type_name, + variant_name: variant_name, + } + } + } + + impl<'de, 'a> Visitor<'de> for UntaggedUnitVisitor<'a> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "unit variant {}::{}", self.type_name, self.variant_name) + } + + fn visit_unit(self) -> Result<(), E> + where + E: de::Error, + { + Ok(()) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +// Like `IntoDeserializer` but also implemented for `&[u8]`. This is used for +// the newtype fallthrough case of `field_identifier`. +// +// #[derive(Deserialize)] +// #[serde(field_identifier)] +// enum F { +// A, +// B, +// Other(String), // deserialized using IdentifierDeserializer +// } +pub trait IdentifierDeserializer<'de, E: Error> { + type Deserializer: Deserializer<'de, Error = E>; + + fn from(self) -> Self::Deserializer; +} + +impl<'de, E> IdentifierDeserializer<'de, E> for u32 +where + E: Error, +{ + type Deserializer = >::Deserializer; + + fn from(self) -> Self::Deserializer { + self.into_deserializer() + } +} + +pub struct StrDeserializer<'a, E> { + value: &'a str, + marker: PhantomData, +} + +impl<'a, E> IdentifierDeserializer<'a, E> for &'a str +where + E: Error, +{ + type Deserializer = StrDeserializer<'a, E>; + + fn from(self) -> Self::Deserializer { + StrDeserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E> +where + E: Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_str(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any + } +} + +pub struct BytesDeserializer<'a, E> { + value: &'a [u8], + marker: PhantomData, +} + +impl<'a, E> IdentifierDeserializer<'a, E> for &'a [u8] +where + E: Error, +{ + type Deserializer = BytesDeserializer<'a, E>; + + fn from(self) -> Self::Deserializer { + BytesDeserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E> +where + E: Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_bytes(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any + } +} diff -Nru distinst-0.1.0/vendor/serde/src/private/macros.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/macros.rs --- distinst-0.1.0/vendor/serde/src/private/macros.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/macros.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,148 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[doc(hidden)] +#[macro_export] +macro_rules! __private_serialize { + () => { + trait Serialize { + fn serialize(&self, serializer: S) -> Result + where + S: $crate::Serializer; + } + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __private_deserialize { + () => { + trait Deserialize<'de>: Sized { + fn deserialize(deserializer: D) -> Result + where + D: $crate::Deserializer<'de>; + } + }; +} + +/// Used only by Serde doc tests. Not public API. +#[doc(hidden)] +#[macro_export] +macro_rules! __serialize_unimplemented { + ($($func:ident)*) => { + $( + __serialize_unimplemented_helper!($func); + )* + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __serialize_unimplemented_method { + ($func:ident $(<$t:ident>)* ($($arg:ty),*) -> $ret:ident) => { + fn $func $(<$t: ?Sized + $crate::Serialize>)* (self $(, _: $arg)*) -> $crate::export::Result { + unimplemented!() + } + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __serialize_unimplemented_helper { + (bool) => { + __serialize_unimplemented_method!(serialize_bool(bool) -> Ok); + }; + (i8) => { + __serialize_unimplemented_method!(serialize_i8(i8) -> Ok); + }; + (i16) => { + __serialize_unimplemented_method!(serialize_i16(i16) -> Ok); + }; + (i32) => { + __serialize_unimplemented_method!(serialize_i32(i32) -> Ok); + }; + (i64) => { + __serialize_unimplemented_method!(serialize_i64(i64) -> Ok); + }; + (u8) => { + __serialize_unimplemented_method!(serialize_u8(u8) -> Ok); + }; + (u16) => { + __serialize_unimplemented_method!(serialize_u16(u16) -> Ok); + }; + (u32) => { + __serialize_unimplemented_method!(serialize_u32(u32) -> Ok); + }; + (u64) => { + __serialize_unimplemented_method!(serialize_u64(u64) -> Ok); + }; + (f32) => { + __serialize_unimplemented_method!(serialize_f32(f32) -> Ok); + }; + (f64) => { + __serialize_unimplemented_method!(serialize_f64(f64) -> Ok); + }; + (char) => { + __serialize_unimplemented_method!(serialize_char(char) -> Ok); + }; + (str) => { + __serialize_unimplemented_method!(serialize_str(&str) -> Ok); + }; + (bytes) => { + __serialize_unimplemented_method!(serialize_bytes(&[u8]) -> Ok); + }; + (none) => { + __serialize_unimplemented_method!(serialize_none() -> Ok); + }; + (some) => { + __serialize_unimplemented_method!(serialize_some(&T) -> Ok); + }; + (unit) => { + __serialize_unimplemented_method!(serialize_unit() -> Ok); + }; + (unit_struct) => { + __serialize_unimplemented_method!(serialize_unit_struct(&str) -> Ok); + }; + (unit_variant) => { + __serialize_unimplemented_method!(serialize_unit_variant(&str, u32, &str) -> Ok); + }; + (newtype_struct) => { + __serialize_unimplemented_method!(serialize_newtype_struct(&str, &T) -> Ok); + }; + (newtype_variant) => { + __serialize_unimplemented_method!(serialize_newtype_variant(&str, u32, &str, &T) -> Ok); + }; + (seq) => { + type SerializeSeq = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_seq(Option) -> SerializeSeq); + }; + (tuple) => { + type SerializeTuple = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple(usize) -> SerializeTuple); + }; + (tuple_struct) => { + type SerializeTupleStruct = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple_struct(&str, usize) -> SerializeTupleStruct); + }; + (tuple_variant) => { + type SerializeTupleVariant = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple_variant(&str, u32, &str, usize) -> SerializeTupleVariant); + }; + (map) => { + type SerializeMap = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_map(Option) -> SerializeMap); + }; + (struct) => { + type SerializeStruct = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_struct(&str, usize) -> SerializeStruct); + }; + (struct_variant) => { + type SerializeStructVariant = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_struct_variant(&str, u32, &str, usize) -> SerializeStructVariant); + }; +} diff -Nru distinst-0.1.0/vendor/serde/src/private/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/mod.rs --- distinst-0.1.0/vendor/serde/src/private/mod.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,12 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod macros; + +pub mod ser; +pub mod de; diff -Nru distinst-0.1.0/vendor/serde/src/private/ser.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/ser.rs --- distinst-0.1.0/vendor/serde/src/private/ser.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/private/ser.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,1019 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use lib::*; + +use ser::{self, Serialize, Serializer, SerializeMap, SerializeStruct, Impossible}; + +#[cfg(any(feature = "std", feature = "alloc"))] +use self::content::{SerializeTupleVariantAsMapValue, SerializeStructVariantAsMapValue}; + +/// Used to check that serde(getter) attributes return the expected type. +/// Not public API. +pub fn constrain(t: &T) -> &T { + t +} + +/// Not public API. +pub fn serialize_tagged_newtype( + serializer: S, + type_ident: &'static str, + variant_ident: &'static str, + tag: &'static str, + variant_name: &'static str, + value: &T, +) -> Result +where + S: Serializer, + T: Serialize, +{ + value.serialize( + TaggedSerializer { + type_ident: type_ident, + variant_ident: variant_ident, + tag: tag, + variant_name: variant_name, + delegate: serializer, + }, + ) +} + +struct TaggedSerializer { + type_ident: &'static str, + variant_ident: &'static str, + tag: &'static str, + variant_name: &'static str, + delegate: S, +} + +enum Unsupported { + Boolean, + Integer, + Float, + Char, + String, + ByteArray, + Optional, + Unit, + Sequence, + Tuple, + TupleStruct, + #[cfg(not(any(feature = "std", feature = "alloc")))] + Enum, +} + +impl Display for Unsupported { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match *self { + Unsupported::Boolean => formatter.write_str("a boolean"), + Unsupported::Integer => formatter.write_str("an integer"), + Unsupported::Float => formatter.write_str("a float"), + Unsupported::Char => formatter.write_str("a char"), + Unsupported::String => formatter.write_str("a string"), + Unsupported::ByteArray => formatter.write_str("a byte array"), + Unsupported::Optional => formatter.write_str("an optional"), + Unsupported::Unit => formatter.write_str("unit"), + Unsupported::Sequence => formatter.write_str("a sequence"), + Unsupported::Tuple => formatter.write_str("a tuple"), + Unsupported::TupleStruct => formatter.write_str("a tuple struct"), + #[cfg(not(any(feature = "std", feature = "alloc")))] + Unsupported::Enum => formatter.write_str("an enum"), + } + } +} + +impl TaggedSerializer +where + S: Serializer, +{ + fn bad_type(self, what: Unsupported) -> S::Error { + ser::Error::custom( + format_args!( + "cannot serialize tagged newtype variant {}::{} containing {}", + self.type_ident, + self.variant_ident, + what), + ) + } +} + +impl Serializer for TaggedSerializer +where + S: Serializer, +{ + type Ok = S::Ok; + type Error = S::Error; + + type SerializeSeq = Impossible; + type SerializeTuple = Impossible; + type SerializeTupleStruct = Impossible; + type SerializeMap = S::SerializeMap; + type SerializeStruct = S::SerializeStruct; + + #[cfg(not(any(feature = "std", feature = "alloc")))] + type SerializeTupleVariant = Impossible; + #[cfg(any(feature = "std", feature = "alloc"))] + type SerializeTupleVariant = SerializeTupleVariantAsMapValue; + + #[cfg(not(any(feature = "std", feature = "alloc")))] + type SerializeStructVariant = Impossible; + #[cfg(any(feature = "std", feature = "alloc"))] + type SerializeStructVariant = SerializeStructVariantAsMapValue; + + fn serialize_bool(self, _: bool) -> Result { + Err(self.bad_type(Unsupported::Boolean)) + } + + fn serialize_i8(self, _: i8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i16(self, _: i16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i32(self, _: i32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i64(self, _: i64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u8(self, _: u8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u16(self, _: u16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u32(self, _: u32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u64(self, _: u64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_f32(self, _: f32) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_f64(self, _: f64) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_char(self, _: char) -> Result { + Err(self.bad_type(Unsupported::Char)) + } + + fn serialize_str(self, _: &str) -> Result { + Err(self.bad_type(Unsupported::String)) + } + + fn serialize_bytes(self, _: &[u8]) -> Result { + Err(self.bad_type(Unsupported::ByteArray)) + } + + fn serialize_none(self) -> Result { + Err(self.bad_type(Unsupported::Optional)) + } + + fn serialize_some(self, _: &T) -> Result + where + T: Serialize, + { + Err(self.bad_type(Unsupported::Optional)) + } + + fn serialize_unit(self) -> Result { + Err(self.bad_type(Unsupported::Unit)) + } + + fn serialize_unit_struct(self, _: &'static str) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(1))); + try!(map.serialize_entry(self.tag, self.variant_name)); + map.end() + } + + fn serialize_unit_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_entry(inner_variant, &())); + map.end() + } + + fn serialize_newtype_struct( + self, + _: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + value.serialize(self) + } + + fn serialize_newtype_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + inner_value: &T, + ) -> Result + where + T: Serialize, + { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_entry(inner_variant, inner_value)); + map.end() + } + + fn serialize_seq(self, _: Option) -> Result { + Err(self.bad_type(Unsupported::Sequence)) + } + + fn serialize_tuple(self, _: usize) -> Result { + Err(self.bad_type(Unsupported::Tuple)) + } + + fn serialize_tuple_struct( + self, + _: &'static str, + _: usize, + ) -> Result { + Err(self.bad_type(Unsupported::TupleStruct)) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn serialize_tuple_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + _: usize, + ) -> Result { + // Lack of push-based serialization means we need to buffer the content + // of the tuple variant, so it requires std. + Err(self.bad_type(Unsupported::Enum)) + } + + #[cfg(any(feature = "std", feature = "alloc"))] + fn serialize_tuple_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + len: usize, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_key(inner_variant)); + Ok(SerializeTupleVariantAsMapValue::new(map, inner_variant, len),) + } + + fn serialize_map(self, len: Option) -> Result { + let mut map = try!(self.delegate.serialize_map(len.map(|len| len + 1))); + try!(map.serialize_entry(self.tag, self.variant_name)); + Ok(map) + } + + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + let mut state = try!(self.delegate.serialize_struct(name, len + 1)); + try!(state.serialize_field(self.tag, self.variant_name)); + Ok(state) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn serialize_struct_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + _: usize, + ) -> Result { + // Lack of push-based serialization means we need to buffer the content + // of the struct variant, so it requires std. + Err(self.bad_type(Unsupported::Enum)) + } + + #[cfg(any(feature = "std", feature = "alloc"))] + fn serialize_struct_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + len: usize, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_key(inner_variant)); + Ok(SerializeStructVariantAsMapValue::new(map, inner_variant, len),) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn collect_str(self, _: &T) -> Result + where + T: Display, + { + Err(self.bad_type(Unsupported::String)) + } +} + +/// Used only by Serde doc tests. Not public API. +#[doc(hidden)] +#[derive(Debug)] +pub struct Error; + +impl ser::Error for Error { + fn custom(_: T) -> Self + where + T: Display, + { + unimplemented!() + } +} + +#[cfg(feature = "std")] +impl error::Error for Error { + fn description(&self) -> &str { + unimplemented!() + } +} + +impl Display for Error { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +mod content { + use lib::*; + + use ser::{self, Serialize, Serializer}; + + pub struct SerializeTupleVariantAsMapValue { + map: M, + name: &'static str, + fields: Vec, + } + + impl SerializeTupleVariantAsMapValue { + pub fn new(map: M, name: &'static str, len: usize) -> Self { + SerializeTupleVariantAsMapValue { + map: map, + name: name, + fields: Vec::with_capacity(len), + } + } + } + + impl ser::SerializeTupleVariant for SerializeTupleVariantAsMapValue + where + M: ser::SerializeMap, + { + type Ok = M::Ok; + type Error = M::Error; + + fn serialize_field(&mut self, value: &T) -> Result<(), M::Error> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(mut self) -> Result { + try!(self.map.serialize_value(&Content::TupleStruct(self.name, self.fields))); + self.map.end() + } + } + + pub struct SerializeStructVariantAsMapValue { + map: M, + name: &'static str, + fields: Vec<(&'static str, Content)>, + } + + impl SerializeStructVariantAsMapValue { + pub fn new(map: M, name: &'static str, len: usize) -> Self { + SerializeStructVariantAsMapValue { + map: map, + name: name, + fields: Vec::with_capacity(len), + } + } + } + + impl ser::SerializeStructVariant for SerializeStructVariantAsMapValue + where + M: ser::SerializeMap, + { + type Ok = M::Ok; + type Error = M::Error; + + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), M::Error> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(mut self) -> Result { + try!(self.map.serialize_value(&Content::Struct(self.name, self.fields))); + self.map.end() + } + } + + #[derive(Debug)] + enum Content { + Bool(bool), + + U8(u8), + U16(u16), + U32(u32), + U64(u64), + + I8(i8), + I16(i16), + I32(i32), + I64(i64), + + F32(f32), + F64(f64), + + Char(char), + String(String), + Bytes(Vec), + + None, + Some(Box), + + Unit, + UnitStruct(&'static str), + UnitVariant(&'static str, u32, &'static str), + NewtypeStruct(&'static str, Box), + NewtypeVariant(&'static str, u32, &'static str, Box), + + Seq(Vec), + Tuple(Vec), + TupleStruct(&'static str, Vec), + TupleVariant(&'static str, u32, &'static str, Vec), + Map(Vec<(Content, Content)>), + Struct(&'static str, Vec<(&'static str, Content)>), + StructVariant(&'static str, u32, &'static str, Vec<(&'static str, Content)>), + } + + impl Serialize for Content { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Content::Bool(b) => serializer.serialize_bool(b), + Content::U8(u) => serializer.serialize_u8(u), + Content::U16(u) => serializer.serialize_u16(u), + Content::U32(u) => serializer.serialize_u32(u), + Content::U64(u) => serializer.serialize_u64(u), + Content::I8(i) => serializer.serialize_i8(i), + Content::I16(i) => serializer.serialize_i16(i), + Content::I32(i) => serializer.serialize_i32(i), + Content::I64(i) => serializer.serialize_i64(i), + Content::F32(f) => serializer.serialize_f32(f), + Content::F64(f) => serializer.serialize_f64(f), + Content::Char(c) => serializer.serialize_char(c), + Content::String(ref s) => serializer.serialize_str(s), + Content::Bytes(ref b) => serializer.serialize_bytes(b), + Content::None => serializer.serialize_none(), + Content::Some(ref c) => serializer.serialize_some(&**c), + Content::Unit => serializer.serialize_unit(), + Content::UnitStruct(n) => serializer.serialize_unit_struct(n), + Content::UnitVariant(n, i, v) => serializer.serialize_unit_variant(n, i, v), + Content::NewtypeStruct(n, ref c) => serializer.serialize_newtype_struct(n, &**c), + Content::NewtypeVariant(n, i, v, ref c) => { + serializer.serialize_newtype_variant(n, i, v, &**c) + } + Content::Seq(ref elements) => elements.serialize(serializer), + Content::Tuple(ref elements) => { + use ser::SerializeTuple; + let mut tuple = try!(serializer.serialize_tuple(elements.len())); + for e in elements { + try!(tuple.serialize_element(e)); + } + tuple.end() + } + Content::TupleStruct(n, ref fields) => { + use ser::SerializeTupleStruct; + let mut ts = try!(serializer.serialize_tuple_struct(n, fields.len())); + for f in fields { + try!(ts.serialize_field(f)); + } + ts.end() + } + Content::TupleVariant(n, i, v, ref fields) => { + use ser::SerializeTupleVariant; + let mut tv = try!(serializer.serialize_tuple_variant(n, i, v, fields.len())); + for f in fields { + try!(tv.serialize_field(f)); + } + tv.end() + } + Content::Map(ref entries) => { + use ser::SerializeMap; + let mut map = try!(serializer.serialize_map(Some(entries.len()))); + for &(ref k, ref v) in entries { + try!(map.serialize_entry(k, v)); + } + map.end() + } + Content::Struct(n, ref fields) => { + use ser::SerializeStruct; + let mut s = try!(serializer.serialize_struct(n, fields.len())); + for &(k, ref v) in fields { + try!(s.serialize_field(k, v)); + } + s.end() + } + Content::StructVariant(n, i, v, ref fields) => { + use ser::SerializeStructVariant; + let mut sv = try!(serializer.serialize_struct_variant(n, i, v, fields.len())); + for &(k, ref v) in fields { + try!(sv.serialize_field(k, v)); + } + sv.end() + } + } + } + } + + struct ContentSerializer { + error: PhantomData, + } + + impl ContentSerializer { + fn new() -> Self { + ContentSerializer { error: PhantomData } + } + } + + impl Serializer for ContentSerializer + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + type SerializeSeq = SerializeSeq; + type SerializeTuple = SerializeTuple; + type SerializeTupleStruct = SerializeTupleStruct; + type SerializeTupleVariant = SerializeTupleVariant; + type SerializeMap = SerializeMap; + type SerializeStruct = SerializeStruct; + type SerializeStructVariant = SerializeStructVariant; + + fn serialize_bool(self, v: bool) -> Result { + Ok(Content::Bool(v)) + } + + fn serialize_i8(self, v: i8) -> Result { + Ok(Content::I8(v)) + } + + fn serialize_i16(self, v: i16) -> Result { + Ok(Content::I16(v)) + } + + fn serialize_i32(self, v: i32) -> Result { + Ok(Content::I32(v)) + } + + fn serialize_i64(self, v: i64) -> Result { + Ok(Content::I64(v)) + } + + fn serialize_u8(self, v: u8) -> Result { + Ok(Content::U8(v)) + } + + fn serialize_u16(self, v: u16) -> Result { + Ok(Content::U16(v)) + } + + fn serialize_u32(self, v: u32) -> Result { + Ok(Content::U32(v)) + } + + fn serialize_u64(self, v: u64) -> Result { + Ok(Content::U64(v)) + } + + fn serialize_f32(self, v: f32) -> Result { + Ok(Content::F32(v)) + } + + fn serialize_f64(self, v: f64) -> Result { + Ok(Content::F64(v)) + } + + fn serialize_char(self, v: char) -> Result { + Ok(Content::Char(v)) + } + + fn serialize_str(self, value: &str) -> Result { + Ok(Content::String(value.to_owned())) + } + + fn serialize_bytes(self, value: &[u8]) -> Result { + Ok(Content::Bytes(value.to_owned())) + } + + fn serialize_none(self) -> Result { + Ok(Content::None) + } + + fn serialize_some(self, value: &T) -> Result + where + T: Serialize, + { + Ok(Content::Some(Box::new(try!(value.serialize(self))))) + } + + fn serialize_unit(self) -> Result { + Ok(Content::Unit) + } + + fn serialize_unit_struct(self, name: &'static str) -> Result { + Ok(Content::UnitStruct(name)) + } + + fn serialize_unit_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + ) -> Result { + Ok(Content::UnitVariant(name, variant_index, variant)) + } + + fn serialize_newtype_struct( + self, + name: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + Ok(Content::NewtypeStruct(name, Box::new(try!(value.serialize(self)))),) + } + + fn serialize_newtype_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + Ok( + Content::NewtypeVariant( + name, + variant_index, + variant, + Box::new(try!(value.serialize(self))), + ), + ) + } + + fn serialize_seq(self, len: Option) -> Result { + Ok( + SerializeSeq { + elements: Vec::with_capacity(len.unwrap_or(0)), + error: PhantomData, + }, + ) + } + + fn serialize_tuple(self, len: usize) -> Result { + Ok( + SerializeTuple { + elements: Vec::with_capacity(len), + error: PhantomData, + }, + ) + } + + fn serialize_tuple_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + Ok( + SerializeTupleStruct { + name: name, + fields: Vec::with_capacity(len), + error: PhantomData, + }, + ) + } + + fn serialize_tuple_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result { + Ok( + SerializeTupleVariant { + name: name, + variant_index: variant_index, + variant: variant, + fields: Vec::with_capacity(len), + error: PhantomData, + }, + ) + } + + fn serialize_map(self, len: Option) -> Result { + Ok( + SerializeMap { + entries: Vec::with_capacity(len.unwrap_or(0)), + key: None, + error: PhantomData, + }, + ) + } + + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + Ok( + SerializeStruct { + name: name, + fields: Vec::with_capacity(len), + error: PhantomData, + }, + ) + } + + fn serialize_struct_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result { + Ok( + SerializeStructVariant { + name: name, + variant_index: variant_index, + variant: variant, + fields: Vec::with_capacity(len), + error: PhantomData, + }, + ) + } + } + + struct SerializeSeq { + elements: Vec, + error: PhantomData, + } + + impl ser::SerializeSeq for SerializeSeq + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_element(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.elements.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Seq(self.elements)) + } + } + + struct SerializeTuple { + elements: Vec, + error: PhantomData, + } + + impl ser::SerializeTuple for SerializeTuple + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_element(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.elements.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Tuple(self.elements)) + } + } + + struct SerializeTupleStruct { + name: &'static str, + fields: Vec, + error: PhantomData, + } + + impl ser::SerializeTupleStruct for SerializeTupleStruct + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::TupleStruct(self.name, self.fields)) + } + } + + struct SerializeTupleVariant { + name: &'static str, + variant_index: u32, + variant: &'static str, + fields: Vec, + error: PhantomData, + } + + impl ser::SerializeTupleVariant for SerializeTupleVariant + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::TupleVariant(self.name, self.variant_index, self.variant, self.fields),) + } + } + + struct SerializeMap { + entries: Vec<(Content, Content)>, + key: Option, + error: PhantomData, + } + + impl ser::SerializeMap for SerializeMap + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_key(&mut self, key: &T) -> Result<(), E> + where + T: Serialize, + { + let key = try!(key.serialize(ContentSerializer::::new())); + self.key = Some(key); + Ok(()) + } + + fn serialize_value(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let key = self.key + .take() + .expect("serialize_value called before serialize_key"); + let value = try!(value.serialize(ContentSerializer::::new())); + self.entries.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Map(self.entries)) + } + + fn serialize_entry(&mut self, key: &K, value: &V) -> Result<(), E> + where + K: Serialize, + V: Serialize, + { + let key = try!(key.serialize(ContentSerializer::::new())); + let value = try!(value.serialize(ContentSerializer::::new())); + self.entries.push((key, value)); + Ok(()) + } + } + + struct SerializeStruct { + name: &'static str, + fields: Vec<(&'static str, Content)>, + error: PhantomData, + } + + impl ser::SerializeStruct for SerializeStruct + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Struct(self.name, self.fields)) + } + } + + struct SerializeStructVariant { + name: &'static str, + variant_index: u32, + variant: &'static str, + fields: Vec<(&'static str, Content)>, + error: PhantomData, + } + + impl ser::SerializeStructVariant for SerializeStructVariant + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::StructVariant(self.name, self.variant_index, self.variant, self.fields),) + } + } +} diff -Nru distinst-0.1.0/vendor/serde/src/ser/content.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/content.rs --- distinst-0.1.0/vendor/serde/src/ser/content.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/content.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,607 +0,0 @@ -use core::marker::PhantomData; - -#[cfg(all(not(feature = "std"), feature = "collections"))] -use collections::{String, Vec}; - -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::boxed::Box; - -#[cfg(feature = "collections")] -use collections::borrow::ToOwned; - -use ser::{self, Serialize, Serializer}; - -pub struct SerializeTupleVariantAsMapValue { - map: M, - name: &'static str, - fields: Vec, -} - -impl SerializeTupleVariantAsMapValue { - pub fn new(map: M, name: &'static str, len: usize) -> Self { - SerializeTupleVariantAsMapValue { - map: map, - name: name, - fields: Vec::with_capacity(len), - } - } -} - -impl ser::SerializeTupleVariant for SerializeTupleVariantAsMapValue - where M: ser::SerializeMap -{ - type Ok = M::Ok; - type Error = M::Error; - - fn serialize_field(&mut self, value: &T) -> Result<(), M::Error> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push(value); - Ok(()) - } - - fn end(mut self) -> Result { - try!(self.map.serialize_value(&Content::TupleStruct(self.name, self.fields))); - self.map.end() - } -} - -pub struct SerializeStructVariantAsMapValue { - map: M, - name: &'static str, - fields: Vec<(&'static str, Content)>, -} - -impl SerializeStructVariantAsMapValue { - pub fn new(map: M, name: &'static str, len: usize) -> Self { - SerializeStructVariantAsMapValue { - map: map, - name: name, - fields: Vec::with_capacity(len), - } - } -} - -impl ser::SerializeStructVariant for SerializeStructVariantAsMapValue - where M: ser::SerializeMap -{ - type Ok = M::Ok; - type Error = M::Error; - - fn serialize_field(&mut self, - key: &'static str, - value: &T) - -> Result<(), M::Error> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push((key, value)); - Ok(()) - } - - fn end(mut self) -> Result { - try!(self.map.serialize_value(&Content::Struct(self.name, self.fields))); - self.map.end() - } -} - -#[derive(Debug)] -enum Content { - Bool(bool), - - U8(u8), - U16(u16), - U32(u32), - U64(u64), - - I8(i8), - I16(i16), - I32(i32), - I64(i64), - - F32(f32), - F64(f64), - - Char(char), - String(String), - Bytes(Vec), - - None, - Some(Box), - - Unit, - UnitStruct(&'static str), - UnitVariant(&'static str, usize, &'static str), - NewtypeStruct(&'static str, Box), - NewtypeVariant(&'static str, usize, &'static str, Box), - - Seq(Vec), - SeqFixedSize(Vec), - Tuple(Vec), - TupleStruct(&'static str, Vec), - TupleVariant(&'static str, usize, &'static str, Vec), - Map(Vec<(Content, Content)>), - Struct(&'static str, Vec<(&'static str, Content)>), - StructVariant(&'static str, usize, &'static str, Vec<(&'static str, Content)>), -} - -impl Serialize for Content { - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - match *self { - Content::Bool(b) => serializer.serialize_bool(b), - Content::U8(u) => serializer.serialize_u8(u), - Content::U16(u) => serializer.serialize_u16(u), - Content::U32(u) => serializer.serialize_u32(u), - Content::U64(u) => serializer.serialize_u64(u), - Content::I8(i) => serializer.serialize_i8(i), - Content::I16(i) => serializer.serialize_i16(i), - Content::I32(i) => serializer.serialize_i32(i), - Content::I64(i) => serializer.serialize_i64(i), - Content::F32(f) => serializer.serialize_f32(f), - Content::F64(f) => serializer.serialize_f64(f), - Content::Char(c) => serializer.serialize_char(c), - Content::String(ref s) => serializer.serialize_str(s), - Content::Bytes(ref b) => serializer.serialize_bytes(b), - Content::None => serializer.serialize_none(), - Content::Some(ref c) => serializer.serialize_some(&**c), - Content::Unit => serializer.serialize_unit(), - Content::UnitStruct(n) => serializer.serialize_unit_struct(n), - Content::UnitVariant(n, i, v) => serializer.serialize_unit_variant(n, i, v), - Content::NewtypeStruct(n, ref c) => serializer.serialize_newtype_struct(n, &**c), - Content::NewtypeVariant(n, i, v, ref c) => { - serializer.serialize_newtype_variant(n, i, v, &**c) - } - Content::Seq(ref elements) => elements.serialize(serializer), - Content::SeqFixedSize(ref elements) => { - use ser::SerializeSeq; - let mut seq = try!(serializer.serialize_seq_fixed_size(elements.len())); - for e in elements { - try!(seq.serialize_element(e)); - } - seq.end() - } - Content::Tuple(ref elements) => { - use ser::SerializeTuple; - let mut tuple = try!(serializer.serialize_tuple(elements.len())); - for e in elements { - try!(tuple.serialize_element(e)); - } - tuple.end() - } - Content::TupleStruct(n, ref fields) => { - use ser::SerializeTupleStruct; - let mut ts = try!(serializer.serialize_tuple_struct(n, fields.len())); - for f in fields { - try!(ts.serialize_field(f)); - } - ts.end() - } - Content::TupleVariant(n, i, v, ref fields) => { - use ser::SerializeTupleVariant; - let mut tv = try!(serializer.serialize_tuple_variant(n, i, v, fields.len())); - for f in fields { - try!(tv.serialize_field(f)); - } - tv.end() - } - Content::Map(ref entries) => { - use ser::SerializeMap; - let mut map = try!(serializer.serialize_map(Some(entries.len()))); - for &(ref k, ref v) in entries { - try!(map.serialize_entry(k, v)); - } - map.end() - } - Content::Struct(n, ref fields) => { - use ser::SerializeStruct; - let mut s = try!(serializer.serialize_struct(n, fields.len())); - for &(k, ref v) in fields { - try!(s.serialize_field(k, v)); - } - s.end() - } - Content::StructVariant(n, i, v, ref fields) => { - use ser::SerializeStructVariant; - let mut sv = try!(serializer.serialize_struct_variant(n, i, v, fields.len())); - for &(k, ref v) in fields { - try!(sv.serialize_field(k, v)); - } - sv.end() - } - } - } -} - -struct ContentSerializer { - error: PhantomData, -} - -impl ContentSerializer { - fn new() -> Self { - ContentSerializer { error: PhantomData } - } -} - -impl Serializer for ContentSerializer - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - type SerializeSeq = SerializeSeq; - type SerializeTuple = SerializeTuple; - type SerializeTupleStruct = SerializeTupleStruct; - type SerializeTupleVariant = SerializeTupleVariant; - type SerializeMap = SerializeMap; - type SerializeStruct = SerializeStruct; - type SerializeStructVariant = SerializeStructVariant; - - fn serialize_bool(self, v: bool) -> Result { - Ok(Content::Bool(v)) - } - - fn serialize_i8(self, v: i8) -> Result { - Ok(Content::I8(v)) - } - - fn serialize_i16(self, v: i16) -> Result { - Ok(Content::I16(v)) - } - - fn serialize_i32(self, v: i32) -> Result { - Ok(Content::I32(v)) - } - - fn serialize_i64(self, v: i64) -> Result { - Ok(Content::I64(v)) - } - - fn serialize_u8(self, v: u8) -> Result { - Ok(Content::U8(v)) - } - - fn serialize_u16(self, v: u16) -> Result { - Ok(Content::U16(v)) - } - - fn serialize_u32(self, v: u32) -> Result { - Ok(Content::U32(v)) - } - - fn serialize_u64(self, v: u64) -> Result { - Ok(Content::U64(v)) - } - - fn serialize_f32(self, v: f32) -> Result { - Ok(Content::F32(v)) - } - - fn serialize_f64(self, v: f64) -> Result { - Ok(Content::F64(v)) - } - - fn serialize_char(self, v: char) -> Result { - Ok(Content::Char(v)) - } - - fn serialize_str(self, value: &str) -> Result { - Ok(Content::String(value.to_owned())) - } - - fn serialize_bytes(self, value: &[u8]) -> Result { - Ok(Content::Bytes(value.to_owned())) - } - - fn serialize_none(self) -> Result { - Ok(Content::None) - } - - fn serialize_some(self, value: &T) -> Result { - Ok(Content::Some(Box::new(try!(value.serialize(self))))) - } - - fn serialize_unit(self) -> Result { - Ok(Content::Unit) - } - - fn serialize_unit_struct(self, name: &'static str) -> Result { - Ok(Content::UnitStruct(name)) - } - - fn serialize_unit_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str) - -> Result { - Ok(Content::UnitVariant(name, variant_index, variant)) - } - - fn serialize_newtype_struct(self, - name: &'static str, - value: &T) - -> Result { - Ok(Content::NewtypeStruct(name, Box::new(try!(value.serialize(self))))) - } - - fn serialize_newtype_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - value: &T) - -> Result { - Ok(Content::NewtypeVariant(name, - variant_index, - variant, - Box::new(try!(value.serialize(self))))) - } - - fn serialize_seq(self, len: Option) -> Result { - Ok(SerializeSeq { - fixed_size: false, - elements: Vec::with_capacity(len.unwrap_or(0)), - error: PhantomData, - }) - } - - fn serialize_seq_fixed_size(self, size: usize) -> Result { - Ok(SerializeSeq { - fixed_size: true, - elements: Vec::with_capacity(size), - error: PhantomData, - }) - } - - fn serialize_tuple(self, len: usize) -> Result { - Ok(SerializeTuple { - elements: Vec::with_capacity(len), - error: PhantomData, - }) - } - - fn serialize_tuple_struct(self, - name: &'static str, - len: usize) - -> Result { - Ok(SerializeTupleStruct { - name: name, - fields: Vec::with_capacity(len), - error: PhantomData, - }) - } - - fn serialize_tuple_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - len: usize) - -> Result { - Ok(SerializeTupleVariant { - name: name, - variant_index: variant_index, - variant: variant, - fields: Vec::with_capacity(len), - error: PhantomData, - }) - } - - fn serialize_map(self, len: Option) -> Result { - Ok(SerializeMap { - entries: Vec::with_capacity(len.unwrap_or(0)), - key: None, - error: PhantomData, - }) - } - - fn serialize_struct(self, name: &'static str, len: usize) -> Result { - Ok(SerializeStruct { - name: name, - fields: Vec::with_capacity(len), - error: PhantomData, - }) - } - - fn serialize_struct_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - len: usize) - -> Result { - Ok(SerializeStructVariant { - name: name, - variant_index: variant_index, - variant: variant, - fields: Vec::with_capacity(len), - error: PhantomData, - }) - } -} - -struct SerializeSeq { - fixed_size: bool, - elements: Vec, - error: PhantomData, -} - -impl ser::SerializeSeq for SerializeSeq - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_element(&mut self, value: &T) -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.elements.push(value); - Ok(()) - } - - fn end(self) -> Result { - Ok(if self.fixed_size { - Content::SeqFixedSize(self.elements) - } else { - Content::Seq(self.elements) - }) - } -} - -struct SerializeTuple { - elements: Vec, - error: PhantomData, -} - -impl ser::SerializeTuple for SerializeTuple - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_element(&mut self, value: &T) -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.elements.push(value); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::Tuple(self.elements)) - } -} - -struct SerializeTupleStruct { - name: &'static str, - fields: Vec, - error: PhantomData, -} - -impl ser::SerializeTupleStruct for SerializeTupleStruct - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_field(&mut self, value: &T) -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push(value); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::TupleStruct(self.name, self.fields)) - } -} - -struct SerializeTupleVariant { - name: &'static str, - variant_index: usize, - variant: &'static str, - fields: Vec, - error: PhantomData, -} - -impl ser::SerializeTupleVariant for SerializeTupleVariant - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_field(&mut self, value: &T) -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push(value); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::TupleVariant(self.name, self.variant_index, self.variant, self.fields)) - } -} - -struct SerializeMap { - entries: Vec<(Content, Content)>, - key: Option, - error: PhantomData, -} - -impl ser::SerializeMap for SerializeMap - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_key(&mut self, key: &T) -> Result<(), E> { - let key = try!(key.serialize(ContentSerializer::::new())); - self.key = Some(key); - Ok(()) - } - - fn serialize_value(&mut self, value: &T) -> Result<(), E> { - let key = self.key.take().expect("serialize_value called before serialize_key"); - let value = try!(value.serialize(ContentSerializer::::new())); - self.entries.push((key, value)); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::Map(self.entries)) - } - - fn serialize_entry(&mut self, - key: &K, - value: &V) - -> Result<(), E> { - let key = try!(key.serialize(ContentSerializer::::new())); - let value = try!(value.serialize(ContentSerializer::::new())); - self.entries.push((key, value)); - Ok(()) - } -} - -struct SerializeStruct { - name: &'static str, - fields: Vec<(&'static str, Content)>, - error: PhantomData, -} - -impl ser::SerializeStruct for SerializeStruct - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_field(&mut self, - key: &'static str, - value: &T) - -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push((key, value)); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::Struct(self.name, self.fields)) - } -} - -struct SerializeStructVariant { - name: &'static str, - variant_index: usize, - variant: &'static str, - fields: Vec<(&'static str, Content)>, - error: PhantomData, -} - -impl ser::SerializeStructVariant for SerializeStructVariant - where E: ser::Error -{ - type Ok = Content; - type Error = E; - - fn serialize_field(&mut self, - key: &'static str, - value: &T) - -> Result<(), E> { - let value = try!(value.serialize(ContentSerializer::::new())); - self.fields.push((key, value)); - Ok(()) - } - - fn end(self) -> Result { - Ok(Content::StructVariant(self.name, self.variant_index, self.variant, self.fields)) - } -} diff -Nru distinst-0.1.0/vendor/serde/src/ser/impls.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/impls.rs --- distinst-0.1.0/vendor/serde/src/ser/impls.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/impls.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,63 +1,27 @@ -#[cfg(feature = "std")] -use std::borrow::Cow; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::borrow::Cow; - -#[cfg(feature = "std")] -use std::collections::{BinaryHeap, BTreeMap, BTreeSet, LinkedList, HashMap, HashSet, VecDeque}; -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque, String, Vec}; - -#[cfg(feature = "collections")] -use collections::borrow::ToOwned; - -#[cfg(feature = "std")] -use core::hash::{Hash, BuildHasher}; -#[cfg(feature = "std")] -use std::net; -#[cfg(any(feature = "std", feature = "unstable"))] -use core::ops; -#[cfg(feature = "std")] -use std::path; -#[cfg(feature = "std")] -use std::ffi::{CString, CStr, OsString, OsStr}; -#[cfg(feature = "std")] -use std::rc::Rc; -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::rc::Rc; -#[cfg(feature = "std")] -use std::time::Duration; - -#[cfg(feature = "std")] -use std::sync::Arc; -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::arc::Arc; - -#[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::boxed::Box; - -use core::cell::{Cell, RefCell}; +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. -#[cfg(feature = "std")] -use std::sync::{Mutex, RwLock}; - -use core::marker::PhantomData; +use lib::*; -#[cfg(feature = "unstable")] -use core::nonzero::{NonZero, Zeroable}; +use ser::{Serialize, SerializeTuple, Serializer}; -use super::{Serialize, SerializeSeq, SerializeTuple, Serializer}; #[cfg(feature = "std")] -use super::Error; +use ser::Error; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -macro_rules! impl_visit { - ($ty:ty, $method:ident $($cast:tt)*) => { +macro_rules! primitive_impl { + ($ty:ident, $method:ident $($cast:tt)*) => { impl Serialize for $ty { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer, + where + S: Serializer, { serializer.$method(*self $($cast)*) } @@ -65,49 +29,52 @@ } } -impl_visit!(bool, serialize_bool); -impl_visit!(isize, serialize_i64 as i64); -impl_visit!(i8, serialize_i8); -impl_visit!(i16, serialize_i16); -impl_visit!(i32, serialize_i32); -impl_visit!(i64, serialize_i64); -impl_visit!(usize, serialize_u64 as u64); -impl_visit!(u8, serialize_u8); -impl_visit!(u16, serialize_u16); -impl_visit!(u32, serialize_u32); -impl_visit!(u64, serialize_u64); -impl_visit!(f32, serialize_f32); -impl_visit!(f64, serialize_f64); -impl_visit!(char, serialize_char); +primitive_impl!(bool, serialize_bool); +primitive_impl!(isize, serialize_i64 as i64); +primitive_impl!(i8, serialize_i8); +primitive_impl!(i16, serialize_i16); +primitive_impl!(i32, serialize_i32); +primitive_impl!(i64, serialize_i64); +primitive_impl!(usize, serialize_u64 as u64); +primitive_impl!(u8, serialize_u8); +primitive_impl!(u16, serialize_u16); +primitive_impl!(u32, serialize_u32); +primitive_impl!(u64, serialize_u64); +primitive_impl!(f32, serialize_f32); +primitive_impl!(f64, serialize_f64); +primitive_impl!(char, serialize_char); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// impl Serialize for str { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { serializer.serialize_str(self) } } -#[cfg(any(feature = "std", feature = "collections"))] +#[cfg(any(feature = "std", feature = "alloc"))] impl Serialize for String { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - (&self[..]).serialize(serializer) + serializer.serialize_str(self) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "std")] impl Serialize for CStr { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { serializer.serialize_bytes(self.to_bytes()) } @@ -117,20 +84,23 @@ impl Serialize for CString { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { serializer.serialize_bytes(self.to_bytes()) } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// impl Serialize for Option - where T: Serialize +where + T: Serialize, { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { match *self { Some(ref value) => serializer.serialize_some(value), @@ -139,138 +109,121 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// impl Serialize for PhantomData { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { serializer.serialize_unit_struct("PhantomData") } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +// Does not require T: Serialize. +impl Serialize for [T; 0] { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + try!(serializer.serialize_tuple(0)).end() + } +} macro_rules! array_impls { - ($len:expr) => { - impl Serialize for [T; $len] where T: Serialize { - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer, + ($($len:tt)+) => { + $( + impl Serialize for [T; $len] + where + T: Serialize, { - let mut seq = try!(serializer.serialize_seq_fixed_size($len)); - for e in self { - try!(seq.serialize_element(e)); + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut seq = try!(serializer.serialize_tuple($len)); + for e in self { + try!(seq.serialize_element(e)); + } + seq.end() } - seq.end() } - } + )+ } } -array_impls!(0); -array_impls!(1); -array_impls!(2); -array_impls!(3); -array_impls!(4); -array_impls!(5); -array_impls!(6); -array_impls!(7); -array_impls!(8); -array_impls!(9); -array_impls!(10); -array_impls!(11); -array_impls!(12); -array_impls!(13); -array_impls!(14); -array_impls!(15); -array_impls!(16); -array_impls!(17); -array_impls!(18); -array_impls!(19); -array_impls!(20); -array_impls!(21); -array_impls!(22); -array_impls!(23); -array_impls!(24); -array_impls!(25); -array_impls!(26); -array_impls!(27); -array_impls!(28); -array_impls!(29); -array_impls!(30); -array_impls!(31); -array_impls!(32); - -/////////////////////////////////////////////////////////////////////////////// - -macro_rules! serialize_seq { - () => { - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer, - { - serializer.collect_seq(self) - } - } -} +array_impls!(01 02 03 04 05 06 07 08 09 10 + 11 12 13 14 15 16 17 18 19 20 + 21 22 23 24 25 26 27 28 29 30 + 31 32); + +//////////////////////////////////////////////////////////////////////////////// impl Serialize for [T] - where T: Serialize +where + T: Serialize, { - serialize_seq!(); + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_seq(self) + } } -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for BinaryHeap - where T: Serialize + Ord -{ - serialize_seq!(); +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! seq_impl { + ($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => { + impl Serialize for $ty + where + T: Serialize $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound,)* + { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_seq(self) + } + } + } } -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for BTreeSet - where T: Serialize + Ord -{ - serialize_seq!(); -} +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(BinaryHeap); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(BTreeSet); #[cfg(feature = "std")] -impl Serialize for HashSet - where T: Serialize + Eq + Hash, - H: BuildHasher -{ - serialize_seq!(); -} +seq_impl!(HashSet); -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for LinkedList - where T: Serialize -{ - serialize_seq!(); -} +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(LinkedList); -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for Vec - where T: Serialize -{ - serialize_seq!(); -} +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(Vec); -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for VecDeque - where T: Serialize -{ - serialize_seq!(); -} +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(VecDeque); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "std")] -impl Serialize for ops::Range { +impl Serialize for ops::Range +where + Idx: Serialize, +{ fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { use super::SerializeStruct; let mut state = try!(serializer.serialize_struct("Range", 2)); @@ -280,36 +233,35 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// impl Serialize for () { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { serializer.serialize_unit() } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// macro_rules! tuple_impls { - ($( - $TupleVisitor:ident ($len:expr, $($T:ident),+) { - $($state:pat => $idx:tt,)+ - } - )+) => { + ($($len:expr => ($($n:tt $name:ident)+))+) => { $( - impl<$($T),+> Serialize for ($($T,)+) - where $($T: Serialize),+ + impl<$($name),+> Serialize for ($($name,)+) + where + $($name: Serialize,)+ { #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer, + where + S: Serializer, { let mut tuple = try!(serializer.serialize_tuple($len)); $( - try!(tuple.serialize_element(&self.$idx)); + try!(tuple.serialize_element(&self.$n)); )+ tuple.end() } @@ -319,295 +271,117 @@ } tuple_impls! { - TupleVisitor1 (1, T0) { - 0 => 0, - } - TupleVisitor2 (2, T0, T1) { - 0 => 0, - 1 => 1, - } - TupleVisitor3 (3, T0, T1, T2) { - 0 => 0, - 1 => 1, - 2 => 2, - } - TupleVisitor4 (4, T0, T1, T2, T3) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - } - TupleVisitor5 (5, T0, T1, T2, T3, T4) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - } - TupleVisitor6 (6, T0, T1, T2, T3, T4, T5) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - } - TupleVisitor7 (7, T0, T1, T2, T3, T4, T5, T6) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - } - TupleVisitor8 (8, T0, T1, T2, T3, T4, T5, T6, T7) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - } - TupleVisitor9 (9, T0, T1, T2, T3, T4, T5, T6, T7, T8) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - } - TupleVisitor10 (10, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - } - TupleVisitor11 (11, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - } - TupleVisitor12 (12, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - } - TupleVisitor13 (13, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - } - TupleVisitor14 (14, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - } - TupleVisitor15 (15, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - } - TupleVisitor16 (16, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) { - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, - } -} - -/////////////////////////////////////////////////////////////////////////////// - -macro_rules! serialize_map { - () => { - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer, + 1 => (0 T0) + 2 => (0 T0 1 T1) + 3 => (0 T0 1 T1 2 T2) + 4 => (0 T0 1 T1 2 T2 3 T3) + 5 => (0 T0 1 T1 2 T2 3 T3 4 T4) + 6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5) + 7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6) + 8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7) + 9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8) + 10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9) + 11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10) + 12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11) + 13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12) + 14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13) + 15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14) + 16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15) +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! map_impl { + ($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => { + impl Serialize for $ty + where + K: Serialize $(+ $kbound1 $(+ $kbound2)*)*, + V: Serialize, + $($typaram: $bound,)* { - serializer.collect_map(self) + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_map(self) + } } } } -#[cfg(any(feature = "std", feature = "collections"))] -impl Serialize for BTreeMap - where K: Serialize + Ord, - V: Serialize -{ - serialize_map!(); -} +#[cfg(any(feature = "std", feature = "alloc"))] +map_impl!(BTreeMap); #[cfg(feature = "std")] -impl Serialize for HashMap - where K: Serialize + Eq + Hash, - V: Serialize, - H: BuildHasher -{ - serialize_map!(); -} +map_impl!(HashMap); -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -impl<'a, T: ?Sized> Serialize for &'a T - where T: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - (**self).serialize(serializer) - } +macro_rules! deref_impl { + ($($desc:tt)+) => { + impl $($desc)+ { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + (**self).serialize(serializer) + } + } + }; } -impl<'a, T: ?Sized> Serialize for &'a mut T - where T: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - (**self).serialize(serializer) - } -} +deref_impl!(<'a, T: ?Sized> Serialize for &'a T where T: Serialize); +deref_impl!(<'a, T: ?Sized> Serialize for &'a mut T where T: Serialize); #[cfg(any(feature = "std", feature = "alloc"))] -impl Serialize for Box - where T: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - (**self).serialize(serializer) - } -} +deref_impl!( Serialize for Box where T: Serialize); -#[cfg(any(feature = "std", feature = "alloc"))] -impl Serialize for Rc - where T: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - (**self).serialize(serializer) - } -} +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +deref_impl!( Serialize for Rc where T: Serialize); + +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +deref_impl!( Serialize for Arc where T: Serialize); #[cfg(any(feature = "std", feature = "alloc"))] -impl Serialize for Arc - where T: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - (**self).serialize(serializer) - } -} +deref_impl!(<'a, T: ?Sized> Serialize for Cow<'a, T> where T: Serialize + ToOwned); + +//////////////////////////////////////////////////////////////////////////////// -#[cfg(any(feature = "std", feature = "collections"))] -impl<'a, T: ?Sized> Serialize for Cow<'a, T> - where T: Serialize + ToOwned +#[cfg(feature = "unstable")] +impl Serialize for NonZero +where + T: Serialize + Zeroable + Clone, { - #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - (**self).serialize(serializer) + self.clone().get().serialize(serializer) } } impl Serialize for Cell - where T: Serialize + Copy +where + T: Serialize + Copy, { - #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { self.get().serialize(serializer) } } impl Serialize for RefCell - where T: Serialize +where + T: Serialize, { - #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { self.borrow().serialize(serializer) } @@ -615,11 +389,12 @@ #[cfg(feature = "std")] impl Serialize for Mutex - where T: Serialize +where + T: Serialize, { - #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { match self.lock() { Ok(locked) => locked.serialize(serializer), @@ -630,11 +405,12 @@ #[cfg(feature = "std")] impl Serialize for RwLock - where T: Serialize +where + T: Serialize, { - #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { match self.read() { Ok(locked) => locked.serialize(serializer), @@ -643,14 +419,16 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// impl Serialize for Result - where T: Serialize, - E: Serialize +where + T: Serialize, + E: Serialize, { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { match *self { Result::Ok(ref value) => serializer.serialize_newtype_variant("Result", 0, "Ok", value), @@ -661,12 +439,13 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "std")] impl Serialize for Duration { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { use super::SerializeStruct; let mut state = try!(serializer.serialize_struct("Duration", 2)); @@ -676,16 +455,69 @@ } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for SystemTime { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use super::SerializeStruct; + let duration_since_epoch = self.duration_since(UNIX_EPOCH).expect("SystemTime must be later than UNIX_EPOCH"); + let mut state = try!(serializer.serialize_struct("SystemTime", 2)); + try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs())); + try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos())); + state.end() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Serialize a value that implements `Display` as a string, when that string is +/// statically known to never have more than a constant `MAX_LEN` bytes. +/// +/// Panics if the `Display` impl tries to write more than `MAX_LEN` bytes. +#[cfg(feature = "std")] +macro_rules! serialize_display_bounded_length { + ($value:expr, $max:expr, $serializer:expr) => {{ + let mut buffer: [u8; $max] = unsafe { mem::uninitialized() }; + let remaining_len = { + let mut remaining = &mut buffer[..]; + write!(remaining, "{}", $value).unwrap(); + remaining.len() + }; + let written_len = buffer.len() - remaining_len; + let written = &buffer[..written_len]; + + // write! only provides fmt::Formatter to Display implementations, which + // has methods write_str and write_char but no method to write arbitrary + // bytes. Therefore `written` must be valid UTF-8. + let written_str = unsafe { + str::from_utf8_unchecked(written) + }; + $serializer.serialize_str(written_str) + }} +} #[cfg(feature = "std")] impl Serialize for net::IpAddr { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - match *self { - net::IpAddr::V4(ref a) => a.serialize(serializer), - net::IpAddr::V6(ref a) => a.serialize(serializer), + if serializer.is_human_readable() { + match *self { + net::IpAddr::V4(ref a) => a.serialize(serializer), + net::IpAddr::V6(ref a) => a.serialize(serializer), + } + } else { + match *self { + net::IpAddr::V4(ref a) => + serializer.serialize_newtype_variant("IpAddr", 0, "V4", a), + net::IpAddr::V6(ref a) => + serializer.serialize_newtype_variant("IpAddr", 1, "V6", a), + } } } } @@ -693,35 +525,53 @@ #[cfg(feature = "std")] impl Serialize for net::Ipv4Addr { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - /// "101.102.103.104".len() - const MAX_LEN: usize = 15; - serialize_display_bounded_length!(self, MAX_LEN, serializer) + if serializer.is_human_readable() { + const MAX_LEN: usize = 15; + debug_assert_eq!(MAX_LEN, "101.102.103.104".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + self.octets().serialize(serializer) + } } } #[cfg(feature = "std")] impl Serialize for net::Ipv6Addr { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - /// "1000:1002:1003:1004:1005:1006:1007:1008".len() - const MAX_LEN: usize = 39; - serialize_display_bounded_length!(self, MAX_LEN, serializer) + if serializer.is_human_readable() { + const MAX_LEN: usize = 39; + debug_assert_eq!(MAX_LEN, "1001:1002:1003:1004:1005:1006:1007:1008".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + self.octets().serialize(serializer) + } } } -/////////////////////////////////////////////////////////////////////////////// - #[cfg(feature = "std")] impl Serialize for net::SocketAddr { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - match *self { - net::SocketAddr::V4(ref addr) => addr.serialize(serializer), - net::SocketAddr::V6(ref addr) => addr.serialize(serializer), + if serializer.is_human_readable() { + match *self { + net::SocketAddr::V4(ref addr) => addr.serialize(serializer), + net::SocketAddr::V6(ref addr) => addr.serialize(serializer), + } + } else { + match *self { + net::SocketAddr::V4(ref addr) => + serializer.serialize_newtype_variant("SocketAddr", 0, "V4", addr), + net::SocketAddr::V6(ref addr) => + serializer.serialize_newtype_variant("SocketAddr", 1, "V6", addr), + } } } } @@ -729,31 +579,42 @@ #[cfg(feature = "std")] impl Serialize for net::SocketAddrV4 { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - /// "101.102.103.104:65000".len() - const MAX_LEN: usize = 21; - serialize_display_bounded_length!(self, MAX_LEN, serializer) + if serializer.is_human_readable() { + const MAX_LEN: usize = 21; + debug_assert_eq!(MAX_LEN, "101.102.103.104:65000".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + (self.ip(), self.port()).serialize(serializer) + } } } #[cfg(feature = "std")] impl Serialize for net::SocketAddrV6 { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - /// "[1000:1002:1003:1004:1005:1006:1007:1008]:65000".len() - const MAX_LEN: usize = 47; - serialize_display_bounded_length!(self, MAX_LEN, serializer) + if serializer.is_human_readable() { + const MAX_LEN: usize = 47; + debug_assert_eq!(MAX_LEN, "[1001:1002:1003:1004:1005:1006:1007:1008]:65000".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + (self.ip(), self.port()).serialize(serializer) + } } } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// #[cfg(feature = "std")] -impl Serialize for path::Path { +impl Serialize for Path { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { match self.to_str() { Some(s) => s.serialize(serializer), @@ -763,9 +624,10 @@ } #[cfg(feature = "std")] -impl Serialize for path::PathBuf { +impl Serialize for PathBuf { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { self.as_path().serialize(serializer) } @@ -775,44 +637,46 @@ impl Serialize for OsStr { #[cfg(unix)] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { use std::os::unix::ffi::OsStrExt; - serializer.serialize_newtype_variant("OsString", - 0, - "Unix", - self.as_bytes()) + serializer.serialize_newtype_variant("OsString", 0, "Unix", self.as_bytes()) } + #[cfg(windows)] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { use std::os::windows::ffi::OsStrExt; let val = self.encode_wide().collect::>(); - serializer.serialize_newtype_variant("OsString", - 1, - "Windows", - &val) + serializer.serialize_newtype_variant("OsString", 1, "Windows", &val) } } #[cfg(all(feature = "std", any(unix, windows)))] -#[cfg(feature = "std")] impl Serialize for OsString { fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { self.as_os_str().serialize(serializer) } } -#[cfg(feature = "unstable")] -impl Serialize for NonZero - where T: Serialize + Zeroable +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for Wrapping +where + T: Serialize, { + #[inline] fn serialize(&self, serializer: S) -> Result - where S: Serializer + where + S: Serializer, { - (**self).serialize(serializer) + self.0.serialize(serializer) } } diff -Nru distinst-0.1.0/vendor/serde/src/ser/impossible.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/impossible.rs --- distinst-0.1.0/vendor/serde/src/ser/impossible.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/impossible.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,14 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + //! This module contains `Impossible` serializer and its implementations. -use core::marker::PhantomData; +use lib::*; use ser::{self, Serialize, SerializeSeq, SerializeTuple, SerializeTupleStruct, SerializeTupleVariant, SerializeMap, SerializeStruct, SerializeStructVariant}; @@ -9,11 +17,19 @@ /// serializing one of the compound types. /// /// This type cannot be instantiated, but implements every one of the traits -/// corresponding to the `Serializer` compound types: `SerializeSeq`, -/// `SerializeTuple`, `SerializeTupleStruct`, `SerializeTupleVariant`, -/// `SerializeMap`, `SerializeStruct`, and `SerializeStructVariant`. +/// corresponding to the [`Serializer`] compound types: [`SerializeSeq`], +/// [`SerializeTuple`], [`SerializeTupleStruct`], [`SerializeTupleVariant`], +/// [`SerializeMap`], [`SerializeStruct`], and [`SerializeStructVariant`]. /// -/// ```rust,ignore +/// ```rust +/// # #[macro_use] +/// # extern crate serde; +/// # +/// # use serde::ser::{Serializer, Impossible}; +/// # use serde::private::ser::Error; +/// # +/// # struct MySerializer; +/// # /// impl Serializer for MySerializer { /// type Ok = (); /// type Error = Error; @@ -27,130 +43,185 @@ /// -> Result { /// // Given Impossible cannot be instantiated, the only /// // thing we can do here is to return an error. +/// # stringify! { /// Err(...) +/// # }; +/// # unimplemented!() /// } /// /// /* other Serializer methods */ +/// # __serialize_unimplemented! { +/// # bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str bytes none some +/// # unit unit_struct unit_variant newtype_struct newtype_variant +/// # tuple tuple_struct tuple_variant map struct struct_variant +/// # } /// } +/// # +/// # fn main() {} /// ``` -pub struct Impossible { +/// +/// [`Serializer`]: trait.Serializer.html +/// [`SerializeSeq`]: trait.SerializeSeq.html +/// [`SerializeTuple`]: trait.SerializeTuple.html +/// [`SerializeTupleStruct`]: trait.SerializeTupleStruct.html +/// [`SerializeTupleVariant`]: trait.SerializeTupleVariant.html +/// [`SerializeMap`]: trait.SerializeMap.html +/// [`SerializeStruct`]: trait.SerializeStruct.html +/// [`SerializeStructVariant`]: trait.SerializeStructVariant.html +pub struct Impossible { void: Void, - _marker: PhantomData<(Ok, E)>, + ok: PhantomData, + error: PhantomData, } enum Void {} -impl SerializeSeq for Impossible - where E: ser::Error +impl SerializeSeq for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_element(&mut self, _value: &T) -> Result<(), E> { + fn serialize_element(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeTuple for Impossible - where E: ser::Error +impl SerializeTuple for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_element(&mut self, _value: &T) -> Result<(), E> { + fn serialize_element(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeTupleStruct for Impossible - where E: ser::Error +impl SerializeTupleStruct for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_field(&mut self, _value: &T) -> Result<(), E> { + fn serialize_field(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeTupleVariant for Impossible - where E: ser::Error +impl SerializeTupleVariant for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_field(&mut self, _value: &T) -> Result<(), E> { + fn serialize_field(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeMap for Impossible - where E: ser::Error +impl SerializeMap for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_key(&mut self, _key: &T) -> Result<(), E> { + fn serialize_key(&mut self, key: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; match self.void {} } - fn serialize_value(&mut self, _value: &T) -> Result<(), E> { + fn serialize_value(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeStruct for Impossible - where E: ser::Error +impl SerializeStruct for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_field(&mut self, - _key: &'static str, - _value: &T) - -> Result<(), E> { + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } -impl SerializeStructVariant for Impossible - where E: ser::Error +impl SerializeStructVariant for Impossible +where + Error: ser::Error, { type Ok = Ok; - type Error = E; + type Error = Error; - fn serialize_field(&mut self, - _key: &'static str, - _value: &T) - -> Result<(), E> { + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; + let _ = value; match self.void {} } - fn end(self) -> Result { + fn end(self) -> Result { match self.void {} } } diff -Nru distinst-0.1.0/vendor/serde/src/ser/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/mod.rs --- distinst-0.1.0/vendor/serde/src/ser/mod.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,15 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + //! Generic data structure serialization framework. //! -//! The two most important traits in this module are `Serialize` and -//! `Serializer`. +//! The two most important traits in this module are [`Serialize`] and +//! [`Serializer`]. //! //! - **A type that implements `Serialize` is a data structure** that can be //! serialized to any data format supported by Serde, and conversely @@ -10,39 +18,38 @@ //! //! # The Serialize trait //! -//! Serde provides `Serialize` implementations for many Rust primitive and +//! Serde provides [`Serialize`] implementations for many Rust primitive and //! standard library types. The complete list is below. All of these can be //! serialized using Serde out of the box. //! -//! Additionally, Serde provides a procedural macro called `serde_derive` to -//! automatically generate `Serialize` implementations for structs and enums in -//! your program. See the [codegen section of the manual][codegen] for how to -//! use this. -//! -//! In rare cases it may be necessary to implement `Serialize` manually for some -//! type in your program. See the [Implementing `Serialize`][impl-serialize] -//! section of the manual for more about this. -//! -//! Third-party crates may provide `Serialize` implementations for types that -//! they expose. For example the `linked-hash-map` crate provides a -//! `LinkedHashMap` type that is serializable by Serde because the crate -//! provides an implementation of `Serialize` for it. +//! Additionally, Serde provides a procedural macro called [`serde_derive`] to +//! automatically generate [`Serialize`] implementations for structs and enums +//! in your program. See the [codegen section of the manual] for how to use +//! this. +//! +//! In rare cases it may be necessary to implement [`Serialize`] manually for +//! some type in your program. See the [Implementing `Serialize`] section of the +//! manual for more about this. +//! +//! Third-party crates may provide [`Serialize`] implementations for types that +//! they expose. For example the [`linked-hash-map`] crate provides a +//! [`LinkedHashMap`] type that is serializable by Serde because the crate +//! provides an implementation of [`Serialize`] for it. //! //! # The Serializer trait //! -//! `Serializer` implementations are provided by third-party crates, for example -//! [`serde_json`][serde_json], [`serde_yaml`][serde_yaml] and -//! [`bincode`][bincode]. +//! [`Serializer`] implementations are provided by third-party crates, for +//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. //! //! A partial list of well-maintained formats is given on the [Serde -//! website][data-formats]. +//! website][data formats]. //! //! # Implementations of Serialize provided by Serde //! //! - **Primitive types**: //! - bool -//! - isize, i8, i16, i32, i64 -//! - usize, u8, u16, u32, u64 +//! - i8, i16, i32, i64, isize +//! - u8, u16, u32, u64, usize //! - f32, f64 //! - char //! - str @@ -75,8 +82,14 @@ //! - VecDeque\ //! - Vec\ //! - EnumSet\ (unstable) +//! - **FFI types**: +//! - CStr +//! - CString +//! - OsStr +//! - OsString //! - **Miscellaneous standard library types**: //! - Duration +//! - SystemTime //! - Path //! - PathBuf //! - Range\ @@ -89,68 +102,81 @@ //! - SocketAddrV4 //! - SocketAddrV6 //! -//! [codegen]: https://serde.rs/codegen.html -//! [impl-serialize]: https://serde.rs/impl-serialize.html -//! [serde_json]: https://github.com/serde-rs/json -//! [serde_yaml]: https://github.com/dtolnay/serde-yaml -//! [bincode]: https://github.com/TyOverby/bincode -//! [data-formats]: https://serde.rs/#data-formats - -#[cfg(feature = "std")] -use std::error; -#[cfg(not(feature = "std"))] -use error; +//! [Implementing `Serialize`]: https://serde.rs/impl-serialize.html +//! [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +//! [`Serialize`]: ../trait.Serialize.html +//! [`Serializer`]: ../trait.Serializer.html +//! [`bincode`]: https://github.com/TyOverby/bincode +//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +//! [`serde_derive`]: https://crates.io/crates/serde_derive +//! [`serde_json`]: https://github.com/serde-rs/json +//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml +//! [codegen section of the manual]: https://serde.rs/codegen.html +//! [data formats]: https://serde.rs/#data-formats -#[cfg(all(feature = "collections", not(feature = "std")))] -use collections::string::String; -use core::fmt::Display; -#[cfg(any(feature = "std", feature = "collections"))] -use core::fmt::Write; -use core::iter::IntoIterator; +use lib::*; mod impls; mod impossible; -// Helpers used by generated code. Not public API. -#[doc(hidden)] -pub mod private; -#[cfg(any(feature = "std", feature = "collections"))] -mod content; - pub use self::impossible::Impossible; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// -/// Trait used by `Serialize` implementations to generically construct errors -/// belonging to the `Serializer` against which they are currently running. -pub trait Error: Sized + error::Error { - /// Raised when a `Serialize` implementation encounters a general error - /// while serializing a type. - /// - /// The message should not be capitalized and should not end with a period. - /// - /// For example, a filesystem `Path` may refuse to serialize itself if it - /// contains invalid UTF-8 data. - /// - /// ```rust - /// # use serde::ser::{Serialize, Serializer, Error}; - /// # struct Path; - /// # impl Path { fn to_str(&self) -> Option<&str> { unimplemented!() } } - /// impl Serialize for Path { - /// fn serialize(&self, serializer: S) -> Result - /// where S: Serializer - /// { - /// match self.to_str() { - /// Some(s) => s.serialize(serializer), - /// None => Err(Error::custom("path contains invalid UTF-8 characters")), - /// } - /// } - /// } - /// ``` - fn custom(msg: T) -> Self; +macro_rules! declare_error_trait { + (Error: Sized $(+ $($supertrait:ident)::+)*) => { + /// Trait used by `Serialize` implementations to generically construct + /// errors belonging to the `Serializer` against which they are + /// currently running. + pub trait Error: Sized $(+ $($supertrait)::+)* { + /// Used when a [`Serialize`] implementation encounters any error + /// while serializing a type. + /// + /// The message should not be capitalized and should not end with a + /// period. + /// + /// For example, a filesystem [`Path`] may refuse to serialize + /// itself if it contains invalid UTF-8 data. + /// + /// ```rust + /// # struct Path; + /// # + /// # impl Path { + /// # fn to_str(&self) -> Option<&str> { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{self, Serialize, Serializer}; + /// + /// impl Serialize for Path { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match self.to_str() { + /// Some(s) => serializer.serialize_str(s), + /// None => Err(ser::Error::custom("path contains invalid UTF-8 characters")), + /// } + /// } + /// } + /// ``` + /// + /// [`Path`]: https://doc.rust-lang.org/std/path/struct.Path.html + /// [`Serialize`]: ../trait.Serialize.html + fn custom(msg: T) -> Self + where + T: Display; + } + } } -/////////////////////////////////////////////////////////////////////////////// +#[cfg(feature = "std")] +declare_error_trait!(Error: Sized + error::Error); + +#[cfg(not(feature = "std"))] +declare_error_trait!(Error: Sized + Debug + Display); + +//////////////////////////////////////////////////////////////////////////////// /// A **data structure** that can be serialized into any data format supported /// by Serde. @@ -159,39 +185,66 @@ /// standard library types. The complete list is [here][ser]. All of these can /// be serialized using Serde out of the box. /// -/// Additionally, Serde provides a procedural macro called `serde_derive` to +/// Additionally, Serde provides a procedural macro called [`serde_derive`] to /// automatically generate `Serialize` implementations for structs and enums in -/// your program. See the [codegen section of the manual][codegen] for how to -/// use this. +/// your program. See the [codegen section of the manual] for how to use this. /// /// In rare cases it may be necessary to implement `Serialize` manually for some -/// type in your program. See the [Implementing `Serialize`][impl-serialize] -/// section of the manual for more about this. +/// type in your program. See the [Implementing `Serialize`] section of the +/// manual for more about this. /// /// Third-party crates may provide `Serialize` implementations for types that -/// they expose. For example the `linked-hash-map` crate provides a -/// `LinkedHashMap` type that is serializable by Serde because the crate +/// they expose. For example the [`linked-hash-map`] crate provides a +/// [`LinkedHashMap`] type that is serializable by Serde because the crate /// provides an implementation of `Serialize` for it. /// +/// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html +/// [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +/// [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +/// [`serde_derive`]: https://crates.io/crates/serde_derive +/// [codegen section of the manual]: https://serde.rs/codegen.html /// [ser]: https://docs.serde.rs/serde/ser/index.html -/// [codegen]: https://serde.rs/codegen.html -/// [impl-serialize]: https://serde.rs/impl-serialize.html pub trait Serialize { /// Serialize this value into the given Serde serializer. /// - /// See the [Implementing `Serialize`][impl-serialize] section of the manual - /// for more information about how to implement this method. + /// See the [Implementing `Serialize`] section of the manual for more + /// information about how to implement this method. /// - /// [impl-serialize]: https://serde.rs/impl-serialize.html - fn serialize(&self, serializer: S) -> Result where S: Serializer; + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeStruct}; + /// + /// struct Person { + /// name: String, + /// age: u8, + /// phones: Vec, + /// } + /// + /// // This is what #[derive(Serialize)] would generate. + /// impl Serialize for Person { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut s = serializer.serialize_struct("Person", 3)?; + /// s.serialize_field("name", &self.name)?; + /// s.serialize_field("age", &self.age)?; + /// s.serialize_field("phones", &self.phones)?; + /// s.end() + /// } + /// } + /// ``` + /// + /// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html + fn serialize(&self, serializer: S) -> Result + where + S: Serializer; } -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /// A **data format** that can serialize any data structure supported by Serde. /// /// The role of this trait is to define the serialization half of the Serde data -/// model, which is a way to categorize every Rust data structure into one of 28 +/// model, which is a way to categorize every Rust data structure into one of 27 /// possible types. Each method of the `Serializer` trait corresponds to one of /// the types of the data model. /// @@ -200,47 +253,54 @@ /// /// The types that make up the Serde data model are: /// -/// - 12 primitive types: +/// - **12 primitive types** /// - bool /// - i8, i16, i32, i64 /// - u8, u16, u32, u64 /// - f32, f64 /// - char -/// - string -/// - byte array - [u8] -/// - option -/// - either none or some value -/// - unit -/// - unit is the type of () in Rust -/// - unit_struct -/// - for example `struct Unit` or `PhantomData` -/// - unit_variant -/// - the `E::A` and `E::B` in `enum E { A, B }` -/// - newtype_struct -/// - for example `struct Millimeters(u8)` -/// - newtype_variant -/// - the `E::N` in `enum E { N(u8) }` -/// - seq -/// - a dynamically sized sequence of values, for example `Vec` or -/// `HashSet` -/// - seq_fixed_size -/// - a statically sized sequence of values for which the size will be known -/// at deserialization time without looking at the serialized data, for -/// example `[u64; 10]` -/// - tuple -/// - for example `(u8,)` or `(String, u64, Vec)` -/// - tuple_struct -/// - for example `struct Rgb(u8, u8, u8)` -/// - tuple_variant -/// - the `E::T` in `enum E { T(u8, u8) }` -/// - map -/// - for example `BTreeMap` -/// - struct -/// - a key-value pairing in which the keys will be known at deserialization -/// time without looking at the serialized data, for example `struct S { r: -/// u8, g: u8, b: u8 }` -/// - struct_variant -/// - the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }` +/// - **string** +/// - UTF-8 bytes with a length and no null terminator. +/// - When serializing, all strings are handled equally. When deserializing, +/// there are three flavors of strings: transient, owned, and borrowed. +/// - **byte array** - [u8] +/// - Similar to strings, during deserialization byte arrays can be transient, +/// owned, or borrowed. +/// - **option** +/// - Either none or some value. +/// - **unit** +/// - The type of `()` in Rust. It represents an anonymous value containing no +/// data. +/// - **unit_struct** +/// - For example `struct Unit` or `PhantomData`. It represents a named value +/// containing no data. +/// - **unit_variant** +/// - For example the `E::A` and `E::B` in `enum E { A, B }`. +/// - **newtype_struct** +/// - For example `struct Millimeters(u8)`. +/// - **newtype_variant** +/// - For example the `E::N` in `enum E { N(u8) }`. +/// - **seq** +/// - A variably sized heterogeneous sequence of values, for example `Vec` or +/// `HashSet`. When serializing, the length may or may not be known before +/// iterating through all the data. When deserializing, the length is determined +/// by looking at the serialized data. +/// - **tuple** +/// - A statically sized heterogeneous sequence of values for which the length +/// will be known at deserialization time without looking at the serialized +/// data, for example `(u8,)` or `(String, u64, Vec)` or `[u64; 10]`. +/// - **tuple_struct** +/// - A named tuple, for example `struct Rgb(u8, u8, u8)`. +/// - **tuple_variant** +/// - For example the `E::T` in `enum E { T(u8, u8) }`. +/// - **map** +/// - A heterogeneous key-value pairing, for example `BTreeMap`. +/// - **struct** +/// - A heterogeneous key-value pairing in which the keys are strings and will be +/// known at deserialization time without looking at the serialized data, for +/// example `struct S { r: u8, g: u8, b: u8 }`. +/// - **struct_variant** +/// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. /// /// Many Serde serializers produce text or binary data as output, for example /// JSON or Bincode. This is not a requirement of the `Serializer` trait, and @@ -251,44 +311,79 @@ pub trait Serializer: Sized { /// The output type produced by this `Serializer` during successful /// serialization. Most serializers that produce text or binary output - /// should set `Ok = ()` and serialize into an `io::Write` or buffer + /// should set `Ok = ()` and serialize into an [`io::Write`] or buffer /// contained within the `Serializer` instance. Serializers that build /// in-memory data structures may be simplified by using `Ok` to propagate /// the data structure around. + /// + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html type Ok; /// The error type when some error occurs during serialization. type Error: Error; - /// Type returned from `serialize_seq` and `serialize_seq_fixed_size` for - /// serializing the content of the sequence. + /// Type returned from [`serialize_seq`] for serializing the content of the + /// sequence. + /// + /// [`serialize_seq`]: #tymethod.serialize_seq type SerializeSeq: SerializeSeq; - /// Type returned from `serialize_tuple` for serializing the content of the - /// tuple. + /// Type returned from [`serialize_tuple`] for serializing the content of + /// the tuple. + /// + /// [`serialize_tuple`]: #tymethod.serialize_tuple type SerializeTuple: SerializeTuple; - /// Type returned from `serialize_tuple_struct` for serializing the content - /// of the tuple struct. + /// Type returned from [`serialize_tuple_struct`] for serializing the + /// content of the tuple struct. + /// + /// [`serialize_tuple_struct`]: #tymethod.serialize_tuple_struct type SerializeTupleStruct: SerializeTupleStruct; - /// Type returned from `serialize_tuple_variant` for serializing the content - /// of the tuple variant. + /// Type returned from [`serialize_tuple_variant`] for serializing the + /// content of the tuple variant. + /// + /// [`serialize_tuple_variant`]: #tymethod.serialize_tuple_variant type SerializeTupleVariant: SerializeTupleVariant; - /// Type returned from `serialize_map` for serializing the content of the + /// Type returned from [`serialize_map`] for serializing the content of the /// map. + /// + /// [`serialize_map`]: #tymethod.serialize_map type SerializeMap: SerializeMap; - /// Type returned from `serialize_struct` for serializing the content of the - /// struct. + /// Type returned from [`serialize_struct`] for serializing the content of + /// the struct. + /// + /// [`serialize_struct`]: #tymethod.serialize_struct type SerializeStruct: SerializeStruct; - /// Type returned from `serialize_struct_variant` for serializing the + /// Type returned from [`serialize_struct_variant`] for serializing the /// content of the struct variant. + /// + /// [`serialize_struct_variant`]: #tymethod.serialize_struct_variant type SerializeStructVariant: SerializeStructVariant; /// Serialize a `bool` value. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for bool { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_bool(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_bool(self, v: bool) -> Result; /// Serialize an `i8` value. @@ -296,6 +391,25 @@ /// If the format does not differentiate between `i8` and `i64`, a /// reasonable implementation would be to cast the value to `i64` and /// forward to `serialize_i64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for i8 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_i8(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_i8(self, v: i8) -> Result; /// Serialize an `i16` value. @@ -303,6 +417,25 @@ /// If the format does not differentiate between `i16` and `i64`, a /// reasonable implementation would be to cast the value to `i64` and /// forward to `serialize_i64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for i16 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_i16(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_i16(self, v: i16) -> Result; /// Serialize an `i32` value. @@ -310,9 +443,47 @@ /// If the format does not differentiate between `i32` and `i64`, a /// reasonable implementation would be to cast the value to `i64` and /// forward to `serialize_i64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for i32 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_i32(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_i32(self, v: i32) -> Result; /// Serialize an `i64` value. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for i64 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_i64(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_i64(self, v: i64) -> Result; /// Serialize a `u8` value. @@ -320,6 +491,25 @@ /// If the format does not differentiate between `u8` and `u64`, a /// reasonable implementation would be to cast the value to `u64` and /// forward to `serialize_u64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for u8 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_u8(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_u8(self, v: u8) -> Result; /// Serialize a `u16` value. @@ -327,6 +517,25 @@ /// If the format does not differentiate between `u16` and `u64`, a /// reasonable implementation would be to cast the value to `u64` and /// forward to `serialize_u64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for u16 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_u16(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_u16(self, v: u16) -> Result; /// Serialize a `u32` value. @@ -334,9 +543,47 @@ /// If the format does not differentiate between `u32` and `u64`, a /// reasonable implementation would be to cast the value to `u64` and /// forward to `serialize_u64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for u32 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_u32(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_u32(self, v: u32) -> Result; /// Serialize a `u64` value. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for u64 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_u64(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_u64(self, v: u64) -> Result; /// Serialize an `f32` value. @@ -344,19 +591,95 @@ /// If the format does not differentiate between `f32` and `f64`, a /// reasonable implementation would be to cast the value to `f64` and /// forward to `serialize_f64`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for f32 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_f32(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_f32(self, v: f32) -> Result; /// Serialize an `f64` value. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for f64 { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_f64(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_f64(self, v: f64) -> Result; /// Serialize a character. /// /// If the format does not support characters, it is reasonable to serialize /// it as a single element `str` or a `u32`. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for char { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_char(*self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_char(self, v: char) -> Result; /// Serialize a `&str`. - fn serialize_str(self, value: &str) -> Result; + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for str { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_str(self) + /// } + /// } + /// # + /// # fn main() {} + /// ``` + fn serialize_str(self, v: &str) -> Result; /// Serialize a chunk of raw byte data. /// @@ -366,27 +689,145 @@ /// `serialize_seq`. If forwarded, the implementation looks usually just /// like this: /// - /// ```rust,ignore - /// let mut seq = self.serialize_seq(Some(value.len()))?; - /// for b in value { - /// seq.serialize_element(b)?; + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::ser::{Serializer, SerializeSeq}; + /// # use serde::private::ser::Error; + /// # + /// # struct MySerializer; + /// # + /// # impl Serializer for MySerializer { + /// # type Ok = (); + /// # type Error = Error; + /// # + /// fn serialize_bytes(self, v: &[u8]) -> Result { + /// let mut seq = self.serialize_seq(Some(v.len()))?; + /// for b in v { + /// seq.serialize_element(b)?; + /// } + /// seq.end() /// } - /// seq.end() + /// # + /// # __serialize_unimplemented! { + /// # bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str none some + /// # unit unit_struct unit_variant newtype_struct newtype_variant + /// # seq tuple tuple_struct tuple_variant map struct struct_variant + /// # } + /// # } + /// # + /// # fn main() {} /// ``` - fn serialize_bytes(self, value: &[u8]) -> Result; + fn serialize_bytes(self, v: &[u8]) -> Result; - /// Serialize a `None` value. + /// Serialize a [`None`] value. + /// + /// ```rust + /// # extern crate serde; + /// # + /// # use serde::{Serialize, Serializer}; + /// # + /// # enum Option { + /// # Some(T), + /// # None, + /// # } + /// # + /// # use Option::{Some, None}; + /// # + /// impl Serialize for Option + /// where T: Serialize + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// Some(ref value) => serializer.serialize_some(value), + /// None => serializer.serialize_none(), + /// } + /// } + /// } + /// # + /// # fn main() {} + /// ``` + /// + /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None fn serialize_none(self) -> Result; - /// Serialize a `Some(T)` value. - fn serialize_some(self, value: &T) -> Result; + /// Serialize a [`Some(T)`] value. + /// + /// ```rust + /// # extern crate serde; + /// # + /// # use serde::{Serialize, Serializer}; + /// # + /// # enum Option { + /// # Some(T), + /// # None, + /// # } + /// # + /// # use Option::{Some, None}; + /// # + /// impl Serialize for Option + /// where T: Serialize + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// Some(ref value) => serializer.serialize_some(value), + /// None => serializer.serialize_none(), + /// } + /// } + /// } + /// # + /// # fn main() {} + /// ``` + /// + /// [`Some(T)`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.Some + fn serialize_some(self, value: &T) -> Result + where + T: Serialize; /// Serialize a `()` value. + /// + /// ```rust + /// # #[macro_use] + /// # extern crate serde; + /// # + /// # use serde::Serializer; + /// # + /// # __private_serialize!(); + /// # + /// impl Serialize for () { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_unit() + /// } + /// } + /// # + /// # fn main() {} + /// ``` fn serialize_unit(self) -> Result; /// Serialize a unit struct like `struct Unit` or `PhantomData`. /// /// A reasonable implementation would be to forward to `serialize_unit`. + /// + /// ```rust + /// use serde::{Serialize, Serializer}; + /// + /// struct Nothing; + /// + /// impl Serialize for Nothing { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_unit_struct("Nothing") + /// } + /// } + /// ``` fn serialize_unit_struct(self, name: &'static str) -> Result; /// Serialize a unit variant like `E::A` in `enum E { A, B }`. @@ -395,19 +836,31 @@ /// this variant within the enum, and the `variant` is the name of the /// variant. /// - /// A reasonable implementation would be to forward to `serialize_unit`. + /// ```rust + /// use serde::{Serialize, Serializer}; /// - /// ```rust,ignore - /// match *self { - /// E::A => serializer.serialize_unit_variant("E", 0, "A"), - /// E::B => serializer.serialize_unit_variant("E", 1, "B"), + /// enum E { + /// A, + /// B, + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// E::A => serializer.serialize_unit_variant("E", 0, "A"), + /// E::B => serializer.serialize_unit_variant("E", 1, "B"), + /// } + /// } /// } /// ``` - fn serialize_unit_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str) - -> Result; + fn serialize_unit_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + ) -> Result; /// Serialize a newtype struct like `struct Millimeters(u8)`. /// @@ -415,13 +868,26 @@ /// wrappers around the data they contain. A reasonable implementation would /// be to forward to `value.serialize(self)`. /// - /// ```rust,ignore - /// serializer.serialize_newtype_struct("Millimeters", &self.0) + /// ```rust + /// use serde::{Serialize, Serializer}; + /// + /// struct Millimeters(u8); + /// + /// impl Serialize for Millimeters { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.serialize_newtype_struct("Millimeters", &self.0) + /// } + /// } /// ``` - fn serialize_newtype_struct(self, - name: &'static str, - value: &T) - -> Result; + fn serialize_newtype_struct( + self, + name: &'static str, + value: &T, + ) -> Result + where + T: Serialize; /// Serialize a newtype variant like `E::N` in `enum E { N(u8) }`. /// @@ -429,19 +895,36 @@ /// this variant within the enum, and the `variant` is the name of the /// variant. The `value` is the data contained within this newtype variant. /// - /// ```rust,ignore - /// match *self { - /// E::N(ref n) => serializer.serialize_newtype_variant("E", 0, "N", n), + /// ```rust + /// use serde::{Serialize, Serializer}; + /// + /// enum E { + /// M(String), + /// N(u8), + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// E::M(ref s) => serializer.serialize_newtype_variant("E", 0, "M", s), + /// E::N(n) => serializer.serialize_newtype_variant("E", 1, "N", &n), + /// } + /// } /// } /// ``` - fn serialize_newtype_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - value: &T) - -> Result; + fn serialize_newtype_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + value: &T, + ) -> Result + where + T: Serialize; - /// Begin to serialize a dynamically sized sequence. This call must be + /// Begin to serialize a variably sized sequence. This call must be /// followed by zero or more calls to `serialize_element`, then a call to /// `end`. /// @@ -449,12 +932,41 @@ /// not be computable before the sequence is iterated. Some serializers only /// support sequences whose length is known up front. /// - /// ```rust,ignore - /// let mut seq = serializer.serialize_seq(Some(self.len()))?; - /// for element in self { - /// seq.serialize_element(element)?; + /// ```rust + /// # use std::marker::PhantomData; + /// # + /// # struct Vec(PhantomData); + /// # + /// # impl Vec { + /// # fn len(&self) -> usize { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # impl<'a, T> IntoIterator for &'a Vec { + /// # type Item = &'a T; + /// # type IntoIter = Box>; + /// # + /// # fn into_iter(self) -> Self::IntoIter { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{Serialize, Serializer, SerializeSeq}; + /// + /// impl Serialize for Vec + /// where T: Serialize + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut seq = serializer.serialize_seq(Some(self.len()))?; + /// for element in self { + /// seq.serialize_element(element)?; + /// } + /// seq.end() + /// } /// } - /// seq.end() /// ``` fn serialize_seq(self, len: Option) -> Result; @@ -463,24 +975,51 @@ /// This call must be followed by zero or more calls to `serialize_element`, /// then a call to `end`. /// - /// ```rust,ignore - /// let mut seq = serializer.serialize_seq_fixed_size(self.len())?; - /// for element in self { - /// seq.serialize_element(element)?; - /// } - /// seq.end() - /// ``` - fn serialize_seq_fixed_size(self, size: usize) -> Result; - - /// Begin to serialize a tuple. This call must be followed by zero or more - /// calls to `serialize_element`, then a call to `end`. - /// - /// ```rust,ignore - /// let mut tup = serializer.serialize_tuple(3)?; - /// tup.serialize_element(&self.0)?; - /// tup.serialize_element(&self.1)?; - /// tup.serialize_element(&self.2)?; - /// tup.end() + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeTuple}; + /// + /// # mod fool { + /// # trait Serialize {} + /// impl Serialize for (A, B, C) + /// # {} + /// # } + /// # + /// # struct Tuple3(A, B, C); + /// # + /// # impl Serialize for Tuple3 + /// where A: Serialize, + /// B: Serialize, + /// C: Serialize + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut tup = serializer.serialize_tuple(3)?; + /// tup.serialize_element(&self.0)?; + /// tup.serialize_element(&self.1)?; + /// tup.serialize_element(&self.2)?; + /// tup.end() + /// } + /// } + /// ``` + /// + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeTuple}; + /// + /// const VRAM_SIZE: usize = 386; + /// struct Vram([u16; VRAM_SIZE]); + /// + /// impl Serialize for Vram { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut seq = serializer.serialize_tuple(VRAM_SIZE)?; + /// for element in &self.0[..] { + /// seq.serialize_element(element)?; + /// } + /// seq.end() + /// } + /// } /// ``` fn serialize_tuple(self, len: usize) -> Result; @@ -491,17 +1030,28 @@ /// The `name` is the name of the tuple struct and the `len` is the number /// of data fields that will be serialized. /// - /// ```rust,ignore - /// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; - /// ts.serialize_field(&self.0)?; - /// ts.serialize_field(&self.1)?; - /// ts.serialize_field(&self.2)?; - /// ts.end() - /// ``` - fn serialize_tuple_struct(self, - name: &'static str, - len: usize) - -> Result; + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeTupleStruct}; + /// + /// struct Rgb(u8, u8, u8); + /// + /// impl Serialize for Rgb { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; + /// ts.serialize_field(&self.0)?; + /// ts.serialize_field(&self.1)?; + /// ts.serialize_field(&self.2)?; + /// ts.end() + /// } + /// } + /// ``` + fn serialize_tuple_struct( + self, + name: &'static str, + len: usize, + ) -> Result; /// Begin to serialize a tuple variant like `E::T` in `enum E { T(u8, u8) /// }`. This call must be followed by zero or more calls to @@ -511,22 +1061,43 @@ /// this variant within the enum, the `variant` is the name of the variant, /// and the `len` is the number of data fields that will be serialized. /// - /// ```rust,ignore - /// match *self { - /// E::T(ref a, ref b) => { - /// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; - /// tv.serialize_field(a)?; - /// tv.serialize_field(b)?; - /// tv.end() + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeTupleVariant}; + /// + /// enum E { + /// T(u8, u8), + /// U(String, u32, u32), + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// E::T(ref a, ref b) => { + /// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; + /// tv.serialize_field(a)?; + /// tv.serialize_field(b)?; + /// tv.end() + /// } + /// E::U(ref a, ref b, ref c) => { + /// let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?; + /// tv.serialize_field(a)?; + /// tv.serialize_field(b)?; + /// tv.serialize_field(c)?; + /// tv.end() + /// } + /// } /// } /// } /// ``` - fn serialize_tuple_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - len: usize) - -> Result; + fn serialize_tuple_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result; /// Begin to serialize a map. This call must be followed by zero or more /// calls to `serialize_key` and `serialize_value`, then a call to `end`. @@ -535,12 +1106,42 @@ /// be computable before the map is iterated. Some serializers only support /// maps whose length is known up front. /// - /// ```rust,ignore - /// let mut map = serializer.serialize_map(Some(self.len()))?; - /// for (k, v) in self { - /// map.serialize_entry(k, v)?; + /// ```rust + /// # use std::marker::PhantomData; + /// # + /// # struct HashMap(PhantomData, PhantomData); + /// # + /// # impl HashMap { + /// # fn len(&self) -> usize { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # impl<'a, K, V> IntoIterator for &'a HashMap { + /// # type Item = (&'a K, &'a V); + /// # type IntoIter = Box>; + /// # + /// # fn into_iter(self) -> Self::IntoIter { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{Serialize, Serializer, SerializeMap}; + /// + /// impl Serialize for HashMap + /// where K: Serialize, + /// V: Serialize + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut map = serializer.serialize_map(Some(self.len()))?; + /// for (k, v) in self { + /// map.serialize_entry(k, v)?; + /// } + /// map.end() + /// } /// } - /// map.end() /// ``` fn serialize_map(self, len: Option) -> Result; @@ -551,17 +1152,32 @@ /// The `name` is the name of the struct and the `len` is the number of /// data fields that will be serialized. /// - /// ```rust,ignore - /// let mut struc = serializer.serialize_struct("Rgb", 3)?; - /// struc.serialize_field("r", &self.r)?; - /// struc.serialize_field("g", &self.g)?; - /// struc.serialize_field("b", &self.b)?; - /// struc.end() - /// ``` - fn serialize_struct(self, - name: &'static str, - len: usize) - -> Result; + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeStruct}; + /// + /// struct Rgb { + /// r: u8, + /// g: u8, + /// b: u8, + /// } + /// + /// impl Serialize for Rgb { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut rgb = serializer.serialize_struct("Rgb", 3)?; + /// rgb.serialize_field("r", &self.r)?; + /// rgb.serialize_field("g", &self.g)?; + /// rgb.serialize_field("b", &self.b)?; + /// rgb.end() + /// } + /// } + /// ``` + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result; /// Begin to serialize a struct variant like `E::S` in `enum E { S { r: u8, /// g: u8, b: u8 } }`. This call must be followed by zero or more calls to @@ -571,32 +1187,64 @@ /// this variant within the enum, the `variant` is the name of the variant, /// and the `len` is the number of data fields that will be serialized. /// - /// ```rust,ignore - /// match *self { - /// E::S { ref r, ref g, ref b } => { - /// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; - /// sv.serialize_field("r", r)?; - /// sv.serialize_field("g", g)?; - /// sv.serialize_field("b", b)?; - /// sv.end() + /// ```rust + /// use serde::ser::{Serialize, Serializer, SerializeStructVariant}; + /// + /// enum E { + /// S { r: u8, g: u8, b: u8 } + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// match *self { + /// E::S { ref r, ref g, ref b } => { + /// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; + /// sv.serialize_field("r", r)?; + /// sv.serialize_field("g", g)?; + /// sv.serialize_field("b", b)?; + /// sv.end() + /// } + /// } /// } /// } /// ``` - fn serialize_struct_variant(self, - name: &'static str, - variant_index: usize, - variant: &'static str, - len: usize) - -> Result; + fn serialize_struct_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result; /// Collect an iterator as a sequence. /// /// The default implementation serializes each item yielded by the iterator - /// using `Self::SerializeSeq`. Implementors should not need to override - /// this method. + /// using [`serialize_seq`]. Implementors should not need to override this + /// method. + /// + /// ```rust + /// use serde::{Serialize, Serializer}; + /// + /// struct SecretlyOneHigher { + /// data: Vec, + /// } + /// + /// impl Serialize for SecretlyOneHigher { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.collect_seq(self.data.iter().map(|x| x + 1)) + /// } + /// } + /// ``` + /// + /// [`serialize_seq`]: #tymethod.serialize_seq fn collect_seq(self, iter: I) -> Result - where I: IntoIterator, - ::Item: Serialize + where + I: IntoIterator, + ::Item: Serialize, { let iter = iter.into_iter(); let mut serializer = try!(self.serialize_seq(iter.len_hint())); @@ -609,12 +1257,33 @@ /// Collect an iterator as a map. /// /// The default implementation serializes each pair yielded by the iterator - /// using `Self::SerializeMap`. Implementors should not need to override - /// this method. + /// using [`serialize_map`]. Implementors should not need to override this + /// method. + /// + /// ```rust + /// use std::collections::BTreeSet; + /// use serde::{Serialize, Serializer}; + /// + /// struct MapToUnit { + /// keys: BTreeSet, + /// } + /// + /// // Serializes as a map in which the values are all unit. + /// impl Serialize for MapToUnit { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// serializer.collect_map(self.keys.iter().map(|k| (k, ()))) + /// } + /// } + /// ``` + /// + /// [`serialize_map`]: #tymethod.serialize_map fn collect_map(self, iter: I) -> Result - where K: Serialize, - V: Serialize, - I: IntoIterator + where + K: Serialize, + V: Serialize, + I: IntoIterator, { let iter = iter.into_iter(); let mut serializer = try!(self.serialize_map(iter.len_hint())); @@ -626,17 +1295,20 @@ /// Serialize a string produced by an implementation of `Display`. /// - /// The default implementation builds a heap-allocated `String` and - /// delegates to `serialize_str`. Serializers are encouraged to provide a + /// The default implementation builds a heap-allocated [`String`] and + /// delegates to [`serialize_str`]. Serializers are encouraged to provide a /// more efficient implementation if possible. /// /// ```rust - /// # use serde::{Serialize, Serializer}; /// # struct DateTime; + /// # /// # impl DateTime { /// # fn naive_local(&self) -> () { () } /// # fn offset(&self) -> () { () } /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// /// impl Serialize for DateTime { /// fn serialize(&self, serializer: S) -> Result /// where S: Serializer @@ -647,10 +1319,15 @@ /// } /// } /// ``` - #[cfg(any(feature = "std", feature = "collections"))] + /// + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`serialize_str`]: #tymethod.serialize_str + #[cfg(any(feature = "std", feature = "alloc"))] fn collect_str(self, value: &T) -> Result - where T: Display + where + T: Display, { + use lib::fmt::Write; let mut string = String::new(); write!(string, "{}", value).unwrap(); self.serialize_str(&string) @@ -658,16 +1335,20 @@ /// Serialize a string produced by an implementation of `Display`. /// - /// The default implementation returns an error unconditionally when - /// compiled with `no_std`. + /// Serializers that use `no_std` are required to provide an implementation + /// of this method. If no more sensible behavior is possible, the + /// implementation is expected to return an error. /// /// ```rust - /// # use serde::{Serialize, Serializer}; /// # struct DateTime; + /// # /// # impl DateTime { /// # fn naive_local(&self) -> () { () } /// # fn offset(&self) -> () { () } /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// /// impl Serialize for DateTime { /// fn serialize(&self, serializer: S) -> Result /// where S: Serializer @@ -678,26 +1359,98 @@ /// } /// } /// ``` - #[cfg(not(any(feature = "std", feature = "collections")))] + #[cfg(not(any(feature = "std", feature = "alloc")))] fn collect_str(self, value: &T) -> Result - where T: Display - { - // TODO https://github.com/serde-rs/serde/issues/805 - // Remove this impl and force no_std formats to implement collect_str. - let _ = value; - Err(Error::custom("this no_std format does not support serializing strings with collect_str")) - } + where + T: Display; + + /// Determine whether `Serialize` implementations should serialize in + /// human-readable form. + /// + /// Some types have a human-readable form that may be somewhat expensive to + /// construct, as well as a binary form that is compact and efficient. + /// Generally text-based formats like JSON and YAML will prefer to use the + /// human-readable one and binary formats like Bincode will prefer the + /// compact one. + /// + /// ``` + /// # use std::fmt::{self, Display}; + /// # + /// # struct Timestamp; + /// # + /// # impl Timestamp { + /// # fn seconds_since_epoch(&self) -> u64 { unimplemented!() } + /// # } + /// # + /// # impl Display for Timestamp { + /// # fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// + /// impl Serialize for Timestamp { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// if serializer.is_human_readable() { + /// // Serialize to a human-readable string "2015-05-15T17:01:00Z". + /// self.to_string().serialize(serializer) + /// } else { + /// // Serialize to a compact binary representation. + /// self.seconds_since_epoch().serialize(serializer) + /// } + /// } + /// } + /// ``` + /// + /// The default implementation of this method returns `true`. Data formats + /// may override this to `false` to request a compact form for types that + /// support one. Note that modifying this method to change a format from + /// human-readable to compact or vice versa should be regarded as a breaking + /// change, as a value serialized in human-readable mode is not required to + /// deserialize from the same data in compact mode. + #[inline] + fn is_human_readable(&self) -> bool { true } } -/// Returned from `Serializer::serialize_seq` and -/// `Serializer::serialize_seq_fixed_size`. +/// Returned from `Serializer::serialize_seq`. /// -/// ```rust,ignore -/// let mut seq = serializer.serialize_seq(Some(self.len()))?; -/// for element in self { -/// seq.serialize_element(element)?; +/// ```rust +/// # use std::marker::PhantomData; +/// # +/// # struct Vec(PhantomData); +/// # +/// # impl Vec { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, T> IntoIterator for &'a Vec { +/// # type Item = &'a T; +/// # type IntoIter = Box>; +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeSeq}; +/// +/// impl Serialize for Vec +/// where T: Serialize +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut seq = serializer.serialize_seq(Some(self.len()))?; +/// for element in self { +/// seq.serialize_element(element)?; +/// } +/// seq.end() +/// } /// } -/// seq.end() /// ``` pub trait SerializeSeq { /// Must match the `Ok` type of our `Serializer`. @@ -707,7 +1460,9 @@ type Error: Error; /// Serialize a sequence element. - fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error>; + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Finish serializing a sequence. fn end(self) -> Result; @@ -715,12 +1470,74 @@ /// Returned from `Serializer::serialize_tuple`. /// -/// ```rust,ignore -/// let mut tup = serializer.serialize_tuple(3)?; -/// tup.serialize_element(&self.0)?; -/// tup.serialize_element(&self.1)?; -/// tup.serialize_element(&self.2)?; -/// tup.end() +/// ```rust +/// use serde::ser::{Serialize, Serializer, SerializeTuple}; +/// +/// # mod fool { +/// # trait Serialize {} +/// impl Serialize for (A, B, C) +/// # {} +/// # } +/// # +/// # struct Tuple3(A, B, C); +/// # +/// # impl Serialize for Tuple3 +/// where A: Serialize, +/// B: Serialize, +/// C: Serialize +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut tup = serializer.serialize_tuple(3)?; +/// tup.serialize_element(&self.0)?; +/// tup.serialize_element(&self.1)?; +/// tup.serialize_element(&self.2)?; +/// tup.end() +/// } +/// } +/// ``` +/// +/// ```rust +/// # use std::marker::PhantomData; +/// # +/// # struct Array(PhantomData); +/// # +/// # impl Array { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, T> IntoIterator for &'a Array { +/// # type Item = &'a T; +/// # type IntoIter = Box>; +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeTuple}; +/// +/// # mod fool { +/// # trait Serialize {} +/// impl Serialize for [T; 16] +/// # {} +/// # } +/// # +/// # impl Serialize for Array +/// where T: Serialize +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut seq = serializer.serialize_tuple(16)?; +/// for element in self { +/// seq.serialize_element(element)?; +/// } +/// seq.end() +/// } +/// } /// ``` pub trait SerializeTuple { /// Must match the `Ok` type of our `Serializer`. @@ -730,7 +1547,9 @@ type Error: Error; /// Serialize a tuple element. - fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error>; + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Finish serializing a tuple. fn end(self) -> Result; @@ -738,12 +1557,22 @@ /// Returned from `Serializer::serialize_tuple_struct`. /// -/// ```rust,ignore -/// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; -/// ts.serialize_field(&self.0)?; -/// ts.serialize_field(&self.1)?; -/// ts.serialize_field(&self.2)?; -/// ts.end() +/// ```rust +/// use serde::ser::{Serialize, Serializer, SerializeTupleStruct}; +/// +/// struct Rgb(u8, u8, u8); +/// +/// impl Serialize for Rgb { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; +/// ts.serialize_field(&self.0)?; +/// ts.serialize_field(&self.1)?; +/// ts.serialize_field(&self.2)?; +/// ts.end() +/// } +/// } /// ``` pub trait SerializeTupleStruct { /// Must match the `Ok` type of our `Serializer`. @@ -753,7 +1582,9 @@ type Error: Error; /// Serialize a tuple struct field. - fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error>; + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Finish serializing a tuple struct. fn end(self) -> Result; @@ -761,13 +1592,33 @@ /// Returned from `Serializer::serialize_tuple_variant`. /// -/// ```rust,ignore -/// match *self { -/// E::T(ref a, ref b) => { -/// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; -/// tv.serialize_field(a)?; -/// tv.serialize_field(b)?; -/// tv.end() +/// ```rust +/// use serde::ser::{Serialize, Serializer, SerializeTupleVariant}; +/// +/// enum E { +/// T(u8, u8), +/// U(String, u32, u32), +/// } +/// +/// impl Serialize for E { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// match *self { +/// E::T(ref a, ref b) => { +/// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; +/// tv.serialize_field(a)?; +/// tv.serialize_field(b)?; +/// tv.end() +/// } +/// E::U(ref a, ref b, ref c) => { +/// let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?; +/// tv.serialize_field(a)?; +/// tv.serialize_field(b)?; +/// tv.serialize_field(c)?; +/// tv.end() +/// } +/// } /// } /// } /// ``` @@ -779,7 +1630,9 @@ type Error: Error; /// Serialize a tuple variant field. - fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error>; + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Finish serializing a tuple variant. fn end(self) -> Result; @@ -787,12 +1640,42 @@ /// Returned from `Serializer::serialize_map`. /// -/// ```rust,ignore -/// let mut map = serializer.serialize_map(Some(self.len()))?; -/// for (k, v) in self { -/// map.serialize_entry(k, v)?; +/// ```rust +/// # use std::marker::PhantomData; +/// # +/// # struct HashMap(PhantomData, PhantomData); +/// # +/// # impl HashMap { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, K, V> IntoIterator for &'a HashMap { +/// # type Item = (&'a K, &'a V); +/// # type IntoIter = Box>; +/// # +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeMap}; +/// +/// impl Serialize for HashMap +/// where K: Serialize, +/// V: Serialize +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut map = serializer.serialize_map(Some(self.len()))?; +/// for (k, v) in self { +/// map.serialize_entry(k, v)?; +/// } +/// map.end() +/// } /// } -/// map.end() /// ``` pub trait SerializeMap { /// Must match the `Ok` type of our `Serializer`. @@ -802,28 +1685,51 @@ type Error: Error; /// Serialize a map key. - fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error>; + /// + /// If possible, `Serialize` implementations are encouraged to use + /// `serialize_entry` instead as it may be implemented more efficiently in + /// some formats compared to a pair of calls to `serialize_key` and + /// `serialize_value`. + fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Serialize a map value. - fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error>; + /// + /// # Panics + /// + /// Calling `serialize_value` before `serialize_key` is incorrect and is + /// allowed to panic or produce bogus results. + fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; /// Serialize a map entry consisting of a key and a value. /// - /// Some `Serialize` types are not able to hold a key and value in memory at - /// the same time so `SerializeMap` implementations are required to support - /// `serialize_key` and `serialize_value` individually. The + /// Some [`Serialize`] types are not able to hold a key and value in memory + /// at the same time so `SerializeMap` implementations are required to + /// support [`serialize_key`] and [`serialize_value`] individually. The /// `serialize_entry` method allows serializers to optimize for the case - /// where key and value are both available. `Serialize` implementations are - /// encouraged to use `serialize_entry` if possible. + /// where key and value are both available. [`Serialize`] implementations + /// are encouraged to use `serialize_entry` if possible. /// - /// The default implementation delegates to `serialize_key` and - /// `serialize_value`. This is appropriate for serializers that do not care - /// about performance or are not able to optimize `serialize_entry` any + /// The default implementation delegates to [`serialize_key`] and + /// [`serialize_value`]. This is appropriate for serializers that do not + /// care about performance or are not able to optimize `serialize_entry` any /// better than this. - fn serialize_entry(&mut self, - key: &K, - value: &V) - -> Result<(), Self::Error> { + /// + /// [`Serialize`]: ../trait.Serialize.html + /// [`serialize_key`]: #tymethod.serialize_key + /// [`serialize_value`]: #tymethod.serialize_value + fn serialize_entry( + &mut self, + key: &K, + value: &V, + ) -> Result<(), Self::Error> + where + K: Serialize, + V: Serialize, + { try!(self.serialize_key(key)); self.serialize_value(value) } @@ -834,12 +1740,26 @@ /// Returned from `Serializer::serialize_struct`. /// -/// ```rust,ignore -/// let mut struc = serializer.serialize_struct("Rgb", 3)?; -/// struc.serialize_field("r", &self.r)?; -/// struc.serialize_field("g", &self.g)?; -/// struc.serialize_field("b", &self.b)?; -/// struc.end() +/// ```rust +/// use serde::ser::{Serialize, Serializer, SerializeStruct}; +/// +/// struct Rgb { +/// r: u8, +/// g: u8, +/// b: u8, +/// } +/// +/// impl Serialize for Rgb { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// let mut rgb = serializer.serialize_struct("Rgb", 3)?; +/// rgb.serialize_field("r", &self.r)?; +/// rgb.serialize_field("g", &self.g)?; +/// rgb.serialize_field("b", &self.b)?; +/// rgb.end() +/// } +/// } /// ``` pub trait SerializeStruct { /// Must match the `Ok` type of our `Serializer`. @@ -849,10 +1769,20 @@ type Error: Error; /// Serialize a struct field. - fn serialize_field(&mut self, - key: &'static str, - value: &T) - -> Result<(), Self::Error>; + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize; + + /// Indicate that a struct field has been skipped. + #[inline] + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { + let _ = key; + Ok(()) + } /// Finish serializing a struct. fn end(self) -> Result; @@ -860,14 +1790,26 @@ /// Returned from `Serializer::serialize_struct_variant`. /// -/// ```rust,ignore -/// match *self { -/// E::S { ref r, ref g, ref b } => { -/// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; -/// sv.serialize_field("r", r)?; -/// sv.serialize_field("g", g)?; -/// sv.serialize_field("b", b)?; -/// sv.end() +/// ```rust +/// use serde::ser::{Serialize, Serializer, SerializeStructVariant}; +/// +/// enum E { +/// S { r: u8, g: u8, b: u8 } +/// } +/// +/// impl Serialize for E { +/// fn serialize(&self, serializer: S) -> Result +/// where S: Serializer +/// { +/// match *self { +/// E::S { ref r, ref g, ref b } => { +/// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; +/// sv.serialize_field("r", r)?; +/// sv.serialize_field("g", g)?; +/// sv.serialize_field("b", b)?; +/// sv.end() +/// } +/// } /// } /// } /// ``` @@ -879,10 +1821,20 @@ type Error: Error; /// Serialize a struct variant field. - fn serialize_field(&mut self, - key: &'static str, - value: &T) - -> Result<(), Self::Error>; + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize; + + /// Indicate that a struct variant field has been skipped. + #[inline] + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { + let _ = key; + Ok(()) + } /// Finish serializing a struct variant. fn end(self) -> Result; @@ -892,7 +1844,10 @@ fn len_hint(&self) -> Option; } -impl LenHint for I { +impl LenHint for I +where + I: Iterator, +{ #[cfg(not(feature = "unstable"))] fn len_hint(&self) -> Option { iterator_len_hint(self) @@ -905,13 +1860,19 @@ } #[cfg(feature = "unstable")] -impl LenHint for I { +impl LenHint for I +where + I: ExactSizeIterator, +{ fn len_hint(&self) -> Option { Some(self.len()) } } -fn iterator_len_hint(iter: &I) -> Option { +fn iterator_len_hint(iter: &I) -> Option +where + I: Iterator, +{ match iter.size_hint() { (lo, Some(hi)) if lo == hi => Some(lo), _ => None, diff -Nru distinst-0.1.0/vendor/serde/src/ser/private.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/private.rs --- distinst-0.1.0/vendor/serde/src/ser/private.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/ser/private.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,315 +0,0 @@ -use core::fmt::{self, Display}; - -use ser::{self, Serialize, Serializer, SerializeMap, SerializeStruct, Impossible}; - -#[cfg(any(feature = "std", feature = "collections"))] -use ser::content::{SerializeTupleVariantAsMapValue, SerializeStructVariantAsMapValue}; - -/// Not public API. -pub fn serialize_tagged_newtype(serializer: S, - type_ident: &'static str, - variant_ident: &'static str, - tag: &'static str, - variant_name: &'static str, - value: &T) - -> Result - where S: Serializer, - T: Serialize -{ - value.serialize(TaggedSerializer { - type_ident: type_ident, - variant_ident: variant_ident, - tag: tag, - variant_name: variant_name, - delegate: serializer, - }) -} - -struct TaggedSerializer { - type_ident: &'static str, - variant_ident: &'static str, - tag: &'static str, - variant_name: &'static str, - delegate: S, -} - -enum Unsupported { - Boolean, - Integer, - Float, - Char, - String, - ByteArray, - Optional, - Unit, - UnitStruct, - Sequence, - Tuple, - TupleStruct, - #[cfg(not(any(feature = "std", feature = "collections")))] - Enum, -} - -impl Display for Unsupported { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - match *self { - Unsupported::Boolean => formatter.write_str("a boolean"), - Unsupported::Integer => formatter.write_str("an integer"), - Unsupported::Float => formatter.write_str("a float"), - Unsupported::Char => formatter.write_str("a char"), - Unsupported::String => formatter.write_str("a string"), - Unsupported::ByteArray => formatter.write_str("a byte array"), - Unsupported::Optional => formatter.write_str("an optional"), - Unsupported::Unit => formatter.write_str("unit"), - Unsupported::UnitStruct => formatter.write_str("a unit struct"), - Unsupported::Sequence => formatter.write_str("a sequence"), - Unsupported::Tuple => formatter.write_str("a tuple"), - Unsupported::TupleStruct => formatter.write_str("a tuple struct"), - #[cfg(not(any(feature = "std", feature = "collections")))] - Unsupported::Enum => formatter.write_str("an enum"), - } - } -} - -struct Error { - type_ident: &'static str, - variant_ident: &'static str, - ty: Unsupported, -} - -impl Display for Error { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, - "cannot serialize tagged newtype variant {}::{} containing {}", - self.type_ident, - self.variant_ident, - self.ty) - } -} - -impl TaggedSerializer - where S: Serializer -{ - fn bad_type(self, what: Unsupported) -> S::Error { - ser::Error::custom(Error { - type_ident: self.type_ident, - variant_ident: self.variant_ident, - ty: what, - }) - } -} - -impl Serializer for TaggedSerializer - where S: Serializer -{ - type Ok = S::Ok; - type Error = S::Error; - - type SerializeSeq = Impossible; - type SerializeTuple = Impossible; - type SerializeTupleStruct = Impossible; - type SerializeMap = S::SerializeMap; - type SerializeStruct = S::SerializeStruct; - - #[cfg(not(any(feature = "std", feature = "collections")))] - type SerializeTupleVariant = Impossible; - #[cfg(any(feature = "std", feature = "collections"))] - type SerializeTupleVariant = SerializeTupleVariantAsMapValue; - - #[cfg(not(any(feature = "std", feature = "collections")))] - type SerializeStructVariant = Impossible; - #[cfg(any(feature = "std", feature = "collections"))] - type SerializeStructVariant = SerializeStructVariantAsMapValue; - - fn serialize_bool(self, _: bool) -> Result { - Err(self.bad_type(Unsupported::Boolean)) - } - - fn serialize_i8(self, _: i8) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_i16(self, _: i16) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_i32(self, _: i32) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_i64(self, _: i64) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_u8(self, _: u8) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_u16(self, _: u16) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_u32(self, _: u32) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_u64(self, _: u64) -> Result { - Err(self.bad_type(Unsupported::Integer)) - } - - fn serialize_f32(self, _: f32) -> Result { - Err(self.bad_type(Unsupported::Float)) - } - - fn serialize_f64(self, _: f64) -> Result { - Err(self.bad_type(Unsupported::Float)) - } - - fn serialize_char(self, _: char) -> Result { - Err(self.bad_type(Unsupported::Char)) - } - - fn serialize_str(self, _: &str) -> Result { - Err(self.bad_type(Unsupported::String)) - } - - fn serialize_bytes(self, _: &[u8]) -> Result { - Err(self.bad_type(Unsupported::ByteArray)) - } - - fn serialize_none(self) -> Result { - Err(self.bad_type(Unsupported::Optional)) - } - - fn serialize_some(self, _: &T) -> Result - where T: Serialize - { - Err(self.bad_type(Unsupported::Optional)) - } - - fn serialize_unit(self) -> Result { - Err(self.bad_type(Unsupported::Unit)) - } - - fn serialize_unit_struct(self, _: &'static str) -> Result { - Err(self.bad_type(Unsupported::UnitStruct)) - } - - fn serialize_unit_variant(self, - _: &'static str, - _: usize, - inner_variant: &'static str) - -> Result { - let mut map = try!(self.delegate.serialize_map(Some(2))); - try!(map.serialize_entry(self.tag, self.variant_name)); - try!(map.serialize_entry(inner_variant, &())); - map.end() - } - - fn serialize_newtype_struct(self, - _: &'static str, - value: &T) - -> Result - where T: Serialize - { - value.serialize(self) - } - - fn serialize_newtype_variant(self, - _: &'static str, - _: usize, - inner_variant: &'static str, - inner_value: &T) - -> Result - where T: Serialize - { - let mut map = try!(self.delegate.serialize_map(Some(2))); - try!(map.serialize_entry(self.tag, self.variant_name)); - try!(map.serialize_entry(inner_variant, inner_value)); - map.end() - } - - fn serialize_seq(self, _: Option) -> Result { - Err(self.bad_type(Unsupported::Sequence)) - } - - fn serialize_seq_fixed_size(self, _: usize) -> Result { - Err(self.bad_type(Unsupported::Sequence)) - } - - fn serialize_tuple(self, _: usize) -> Result { - Err(self.bad_type(Unsupported::Tuple)) - } - - fn serialize_tuple_struct(self, - _: &'static str, - _: usize) - -> Result { - Err(self.bad_type(Unsupported::TupleStruct)) - } - - #[cfg(not(any(feature = "std", feature = "collections")))] - fn serialize_tuple_variant(self, - _: &'static str, - _: usize, - _: &'static str, - _: usize) - -> Result { - // Lack of push-based serialization means we need to buffer the content - // of the tuple variant, so it requires std. - Err(self.bad_type(Unsupported::Enum)) - } - - #[cfg(any(feature = "std", feature = "collections"))] - fn serialize_tuple_variant(self, - _: &'static str, - _: usize, - inner_variant: &'static str, - len: usize) - -> Result { - let mut map = try!(self.delegate.serialize_map(Some(2))); - try!(map.serialize_entry(self.tag, self.variant_name)); - try!(map.serialize_key(inner_variant)); - Ok(SerializeTupleVariantAsMapValue::new(map, inner_variant, len)) - } - - fn serialize_map(self, len: Option) -> Result { - let mut map = try!(self.delegate.serialize_map(len.map(|len| len + 1))); - try!(map.serialize_entry(self.tag, self.variant_name)); - Ok(map) - } - - fn serialize_struct(self, - name: &'static str, - len: usize) - -> Result { - let mut state = try!(self.delegate.serialize_struct(name, len + 1)); - try!(state.serialize_field(self.tag, self.variant_name)); - Ok(state) - } - - #[cfg(not(any(feature = "std", feature = "collections")))] - fn serialize_struct_variant(self, - _: &'static str, - _: usize, - _: &'static str, - _: usize) - -> Result { - // Lack of push-based serialization means we need to buffer the content - // of the struct variant, so it requires std. - Err(self.bad_type(Unsupported::Enum)) - } - - #[cfg(any(feature = "std", feature = "collections"))] - fn serialize_struct_variant(self, - _: &'static str, - _: usize, - inner_variant: &'static str, - len: usize) - -> Result { - let mut map = try!(self.delegate.serialize_map(Some(2))); - try!(map.serialize_entry(self.tag, self.variant_name)); - try!(map.serialize_key(inner_variant)); - Ok(SerializeStructVariantAsMapValue::new(map, inner_variant, len)) - } -} diff -Nru distinst-0.1.0/vendor/serde/src/utils.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/utils.rs --- distinst-0.1.0/vendor/serde/src/utils.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/serde/src/utils.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -//! Private utility functions - -const TAG_CONT: u8 = 0b1000_0000; -const TAG_TWO_B: u8 = 0b1100_0000; -const TAG_THREE_B: u8 = 0b1110_0000; -const TAG_FOUR_B: u8 = 0b1111_0000; -const MAX_ONE_B: u32 = 0x80; -const MAX_TWO_B: u32 = 0x800; -const MAX_THREE_B: u32 = 0x10000; - -#[inline] -pub fn encode_utf8(c: char) -> EncodeUtf8 { - let code = c as u32; - let mut buf = [0; 4]; - let pos = if code < MAX_ONE_B { - buf[3] = code as u8; - 3 - } else if code < MAX_TWO_B { - buf[2] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; - buf[3] = (code & 0x3F) as u8 | TAG_CONT; - 2 - } else if code < MAX_THREE_B { - buf[1] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; - buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; - buf[3] = (code & 0x3F) as u8 | TAG_CONT; - 1 - } else { - buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; - buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT; - buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; - buf[3] = (code & 0x3F) as u8 | TAG_CONT; - 0 - }; - EncodeUtf8 { - buf: buf, - pos: pos, - } -} - -pub struct EncodeUtf8 { - buf: [u8; 4], - pos: usize, -} - -impl EncodeUtf8 { - // FIXME: use this from_utf8_unchecked, since we know it can never fail - pub fn as_str(&self) -> &str { - ::core::str::from_utf8(&self.buf[self.pos..]).unwrap() - } -} - -#[allow(non_upper_case_globals)] -const Pattern_White_Space_table: &'static [(char, char)] = &[('\u{9}', '\u{d}'), - ('\u{20}', '\u{20}'), - ('\u{85}', '\u{85}'), - ('\u{200e}', '\u{200f}'), - ('\u{2028}', '\u{2029}')]; - -fn bsearch_range_table(c: char, r: &'static [(char, char)]) -> bool { - use core::cmp::Ordering::{Equal, Less, Greater}; - r.binary_search_by(|&(lo, hi)| if c < lo { - Greater - } else if hi < c { - Less - } else { - Equal - }) - .is_ok() -} - -#[allow(non_snake_case)] -pub fn Pattern_White_Space(c: char) -> bool { - bsearch_range_table(c, Pattern_White_Space_table) -} diff -Nru distinst-0.1.0/vendor/strsim/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/strsim/.cargo-checksum.json --- distinst-0.1.0/vendor/strsim/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/strsim/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".editorconfig":"d87dec5ba57378b3c32bbf67526e434f7ac4f44d8b1acc7f44b6d8e7ee6919ad",".travis.yml":"10ee132e43d2a5e3c304a4970adfec8939014403c32d178728a56c8cb18046ee","CHANGELOG.md":"5f3e55f36768b2d2e40ee54702d6298175b7736e9b8918ca03592011f053c25f","Cargo.toml":"ff9b4b5bd80560ed36b14313261763d321cfb9e3f212896ec565fb872e26c3f0","LICENSE":"9b60c5838cbe7953b84bb2206835cb2bc898802da4c449e4442cf23e3ad4841e","README.md":"1778e287c6788197322a352721414f7ceab0c84ee0918513bb9f5382d3e40bc6","appveyor.yml":"b41eae9798a9bb250f6046509d9bbd6e63bac9ad2655d342b3d9c8975584f0c0","dev":"498932c7296d8abeb9e432e797a579787a85a052fa514325b873c4fe3200ec67","src/lib.rs":"a79164ec2334c477ca9d25e10c161e0e9bb8ae8670eb22976948c2a574b40985","tests/lib.rs":"43c707f9c9d35fafa07b34f61418ac877687daba5a0790d87e47b3d2c8bad274"},"package":"b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"} \ No newline at end of file +{"files":{".editorconfig":"d87dec5ba57378b3c32bbf67526e434f7ac4f44d8b1acc7f44b6d8e7ee6919ad",".travis.yml":"10ee132e43d2a5e3c304a4970adfec8939014403c32d178728a56c8cb18046ee","CHANGELOG.md":"5f3e55f36768b2d2e40ee54702d6298175b7736e9b8918ca03592011f053c25f","Cargo.toml":"ff9b4b5bd80560ed36b14313261763d321cfb9e3f212896ec565fb872e26c3f0","LICENSE":"9b60c5838cbe7953b84bb2206835cb2bc898802da4c449e4442cf23e3ad4841e","README.md":"1778e287c6788197322a352721414f7ceab0c84ee0918513bb9f5382d3e40bc6","appveyor.yml":"b41eae9798a9bb250f6046509d9bbd6e63bac9ad2655d342b3d9c8975584f0c0","dev":"498932c7296d8abeb9e432e797a579787a85a052fa514325b873c4fe3200ec67","src/lib.rs":"a79164ec2334c477ca9d25e10c161e0e9bb8ae8670eb22976948c2a574b40985","tests/lib.rs":"43c707f9c9d35fafa07b34f61418ac877687daba5a0790d87e47b3d2c8bad274"},"package":"b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/syntex_errors/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_errors/.cargo-checksum.json --- distinst-0.1.0/vendor/syntex_errors/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_errors/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"ec018060c00d8ef6f05d30613fd8b9b1475a0d3f2c826e897f6f6bd9dd84aebc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/diagnostic.rs":"3df61b2252da1d110b55c2981249d35a68576ee2c7470e438dcb84763e180629","src/diagnostic_builder.rs":"535a903c0961e85d8ad9eb88a08e3095fbc251c6f032f84cb48a1f1d36c1b716","src/emitter.rs":"f7e4a4322d8f6e5a74d452ffb966e1f983c831f18526b1d2f36af66ee9b335ca","src/lib.rs":"dc689305ed5bcb2412acdb8c02de64b6d5aaf8c1c807ae244cb0ad3b45a741aa","src/lock.rs":"77e185b48b20509596d9778d7dcca02b92e09be061ed57a9ef37ccfb9fa781ae","src/registry.rs":"ab229b7c6d3016917638d15e754df421be8f4b88b95518773c5c33a07a005274","src/snippet.rs":"1d38ef64e75ced2f69808cfbe50a49a60138ee37fb49f32abb28d8241f2db6ce","src/styled_buffer.rs":"a00d37a0c57b0c16cafa28dff936c1689e0d64a0002570b731f9f34a8ecdc61c"},"package":"867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"} \ No newline at end of file +{"files":{"Cargo.toml":"ec018060c00d8ef6f05d30613fd8b9b1475a0d3f2c826e897f6f6bd9dd84aebc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/diagnostic.rs":"3df61b2252da1d110b55c2981249d35a68576ee2c7470e438dcb84763e180629","src/diagnostic_builder.rs":"535a903c0961e85d8ad9eb88a08e3095fbc251c6f032f84cb48a1f1d36c1b716","src/emitter.rs":"f7e4a4322d8f6e5a74d452ffb966e1f983c831f18526b1d2f36af66ee9b335ca","src/lib.rs":"dc689305ed5bcb2412acdb8c02de64b6d5aaf8c1c807ae244cb0ad3b45a741aa","src/lock.rs":"77e185b48b20509596d9778d7dcca02b92e09be061ed57a9ef37ccfb9fa781ae","src/registry.rs":"ab229b7c6d3016917638d15e754df421be8f4b88b95518773c5c33a07a005274","src/snippet.rs":"1d38ef64e75ced2f69808cfbe50a49a60138ee37fb49f32abb28d8241f2db6ce","src/styled_buffer.rs":"a00d37a0c57b0c16cafa28dff936c1689e0d64a0002570b731f9f34a8ecdc61c"},"package":"867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/syntex_pos/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_pos/.cargo-checksum.json --- distinst-0.1.0/vendor/syntex_pos/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_pos/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"d2493923d0a96f1bed5a2cd5cc3e5bc23d9b53f6e5468f9f3d39aeb20d2b5684","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/lib.rs":"2f9aac026b3108ca6956e9edcd489908d8ee870bb94fad6dcaa7cec36e776021"},"package":"13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"} \ No newline at end of file +{"files":{"Cargo.toml":"d2493923d0a96f1bed5a2cd5cc3e5bc23d9b53f6e5468f9f3d39aeb20d2b5684","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/lib.rs":"2f9aac026b3108ca6956e9edcd489908d8ee870bb94fad6dcaa7cec36e776021"},"package":"13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/syntex_syntax/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_syntax/.cargo-checksum.json --- distinst-0.1.0/vendor/syntex_syntax/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syntex_syntax/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"53be85bf38b38e05365e4af9f0c25932cded7b1d5b178b5fa60508c81d555614","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/abi.rs":"e3ab3c1612396140d258a679f69c0696c88389778224ff4cf504a00f1aa98d27","src/ast.rs":"1501282879380eda4be4911e58ff61a5136ac87afee84a9e8afcde768f3ea57a","src/attr.rs":"f9ce15e47a06ce90b6f9bf7a3ba9b2e360f3c3bb2af4ead6cdb01aded0058db5","src/codemap.rs":"6a082142fe08777ea1075d6ca9c27f5e0469d22d3e147bc5ed33dc60943fe863","src/config.rs":"0006e2326942fc75afcb8d6062fe439c94fbc7a1ede218587ab227f94216d207","src/diagnostic_list.rs":"20dcb30baf350f465afecc196a016885d40edc52f9f32dac611af294a83d32b3","src/diagnostics/macros.rs":"81c36c9164ef238407540f7b026ae12117eb551630ae522c55a90ff9d01fff62","src/diagnostics/metadata.rs":"55570cb118892c25d98f1c120903caa88b212d83eee846594bf32d30245a00aa","src/diagnostics/plugin.rs":"920fbb6404b714318eb83f875fa1cd8cde765607c818116d3beeddc397d7ee97","src/entry.rs":"a75ebd163348ea408d4888677a9298e369b8b91a7a377a9eab5eae045128a035","src/ext/base.rs":"6f3313ffa060d8fccf7a1294a125dd2bf5be7e2e5436b58f46dd67bed0d68bb0","src/ext/build.rs":"11114a2fa5ed5be9ef68d967736671625a24a9d040f9d5acb5617ea18912951e","src/ext/decorator.rs":"d7cb4b233eb77988664cb80202aa2d3abab05b155da125b0f06449df996030af","src/ext/env.rs":"ecb9803589052bb4c7be18f813fdb934094ee939f07b608f880eb0ae6e160b2e","src/ext/expand.rs":"648be837cd5cfac46bc47d505c09f47321d7b0d3a684d1c841e490fdc0addb5c","src/ext/hygiene.rs":"8766603dabbc52b3d5c8cffbf7781c1e365f7d5769faba307c759b296bfb82d8","src/ext/placeholders.rs":"50369498e363dd7fdf27cf2ca7def4d83dddd069a885de7fad875b10b880b096","src/ext/quote.rs":"844c854a62dcdd8acd8003cad3b2f8c8acf138730ac4376ee0795616cae88d64","src/ext/source_util.rs":"a3e85ed7af1d8b5e51d64aa3d97ca399787301aba8565ddb2aed3f8a8029896a","src/ext/tt/macro_parser.rs":"bcc5aa9db807df6481a6ef7cc345711599fa253d7f7e53b111df1cd448dfd669","src/ext/tt/macro_rules.rs":"f7cce0311218bfe32c63a4f9b207d83753068253af4c9625d4b69f774b279466","src/ext/tt/transcribe.rs":"fd193278e0d81799cbd4c846b6bce682c871825a3637cef1305a412ee4bc82b4","src/feature_gate.rs":"4508e93a06d27bc118a5b8f62cfa2b24162541dad7b24cfb60b832174d69bb2d","src/fold.rs":"0d44822b5578be2ee19940504aa39eb7b833d2b7c69c26a22ed525913fa8aac0","src/json.rs":"5a06dd34b370da558dca91835b598daa0ad5617d5981fe2b14131ec6fb7408ba","src/lib.rs":"5afc76b7c368150ebe2a4f079b310c7c499acadc7a68051509705b9678831009","src/parse/attr.rs":"d7003d982c33480f966b4a567c0575add01577268774d250f74a369af2c94021","src/parse/classify.rs":"4e859c566e98bc11e7cc05f3b5f7f7a67caa6c53b8b10366eaf32e58bcfdc7ca","src/parse/common.rs":"f231aece27f62694d1146c5b40b24daf8e0e2e0152b159ca6693a8f583679f43","src/parse/lexer/comments.rs":"48a1ee1777e54fb17977defb6ceea11e6ab75fc60c14f6dbea1df96b87d7720e","src/parse/lexer/mod.rs":"166f5c039956681f6a31c9296eff82bd3a854897c4f3a28452d90323e4137b3f","src/parse/lexer/tokentrees.rs":"e0858828fe0a4d378dc3d37db688d4bb5be925c8492ae5e18a07ac1b768fe5e3","src/parse/lexer/unicode_chars.rs":"1517851266b70cb15908457d55f5470091cf115786f35b0064d507e734830161","src/parse/mod.rs":"2f318f2dfccb2bf0828395e25b16466e91039c6e72368d3cb008aaf4fe1375bd","src/parse/obsolete.rs":"cd83ee6f4a01086b736594638492969c6cec9522527fc576886186b9ad6cff03","src/parse/parser.rs":"f9a118c1658297bf1ca1d149e869225c0f6c5a8c8b6b0063d9cc2b7c956509c1","src/parse/token.rs":"a887b06f783854808f84088324b22b4e8c0aacda437550e1a862f10ef40cc446","src/print/pp.rs":"ef6752db3a36c7a614d43d767c788985a78f33e120b39a85e2156a576630afd4","src/print/pprust.rs":"b96bbb22a97cd48545b13531a1fdc330f0ae901b4657d2c3c7d6cd5c18526070","src/ptr.rs":"2f0ecadd1d19b1e11bb067cee99ac6fff7c48dd33222ed67fb61f240e1ca820e","src/show_span.rs":"b55effca7a512b9705e793f092ca1b5af5842f5484ab61660a546b04dd10eb4f","src/std_inject.rs":"5a4b0f451f3dc23c2d6021b435f801bb2b95a485f0b53acb446535b4d4497034","src/str.rs":"023289c93979354cf6074e94327e5c71b5144e0d12042304c0c91b9dd974b26f","src/symbol.rs":"fdc04df4a729a17bc07860635e0d2c0206dc5c6eed19cad587bc6d1a0d74c69a","src/test.rs":"b9ca57f830e2e903564429bc7085d5d7905aed8b2eda6bdae633f2dbc0f8c464","src/test_snippet.rs":"e4cacc977e13753de033f1fde9d83ad230651719ecf69b75f020fe97440accb6","src/tokenstream.rs":"47ef4dd75cc018ccbbccb25d4fe2c2a9621aca8ea893584ca8cd3461eb729e1d","src/util/lev_distance.rs":"323704c761cd216568f70b2131c6010a5a68dc978a24dc3b2dcf17a4361599c0","src/util/move_map.rs":"8bf1a3546325872892ca5d4f04771af01566913d84fa678df7c862fda75fa16c","src/util/node_count.rs":"54268f87eb4d692b11362f1ef2021e8c7c63aa14f383711780d76216eeb5ee0f","src/util/parser.rs":"0aeb1cc7cbec319a8955e696cf46820ab9af7c89691dea2e2285ebb8a299a67d","src/util/parser_testing.rs":"cc500701e79628503dce4af4e792407460247e5caf5f781b83a74b157c1c79fa","src/util/rc_slice.rs":"a1ea06699bb448d135794a9e22ffbdc96c053a40fc6e228486a3c79d11d65bee","src/util/small_vector.rs":"5f3de1a28196c60ff2efdbf0f61056de30aafc64b827531c3bb735b0bebed52f","src/util/thin_vec.rs":"eda6e0ab93dce5e45bb7a2ddeae9120fdb0df3c1d6a5d4e0c8ca3648d404177e","src/visit.rs":"9cfe7ba6edff817224f7269abf3cf4bda8932a55938d228eb2a8232a6a610dd2"},"package":"6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"} \ No newline at end of file +{"files":{"Cargo.toml":"53be85bf38b38e05365e4af9f0c25932cded7b1d5b178b5fa60508c81d555614","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d7f5489a2f756fb780d16a530f66822c3079aefe9c7a1151f1709356f586818e","src/abi.rs":"e3ab3c1612396140d258a679f69c0696c88389778224ff4cf504a00f1aa98d27","src/ast.rs":"1501282879380eda4be4911e58ff61a5136ac87afee84a9e8afcde768f3ea57a","src/attr.rs":"f9ce15e47a06ce90b6f9bf7a3ba9b2e360f3c3bb2af4ead6cdb01aded0058db5","src/codemap.rs":"6a082142fe08777ea1075d6ca9c27f5e0469d22d3e147bc5ed33dc60943fe863","src/config.rs":"0006e2326942fc75afcb8d6062fe439c94fbc7a1ede218587ab227f94216d207","src/diagnostic_list.rs":"20dcb30baf350f465afecc196a016885d40edc52f9f32dac611af294a83d32b3","src/diagnostics/macros.rs":"81c36c9164ef238407540f7b026ae12117eb551630ae522c55a90ff9d01fff62","src/diagnostics/metadata.rs":"55570cb118892c25d98f1c120903caa88b212d83eee846594bf32d30245a00aa","src/diagnostics/plugin.rs":"920fbb6404b714318eb83f875fa1cd8cde765607c818116d3beeddc397d7ee97","src/entry.rs":"a75ebd163348ea408d4888677a9298e369b8b91a7a377a9eab5eae045128a035","src/ext/base.rs":"6f3313ffa060d8fccf7a1294a125dd2bf5be7e2e5436b58f46dd67bed0d68bb0","src/ext/build.rs":"11114a2fa5ed5be9ef68d967736671625a24a9d040f9d5acb5617ea18912951e","src/ext/decorator.rs":"d7cb4b233eb77988664cb80202aa2d3abab05b155da125b0f06449df996030af","src/ext/env.rs":"ecb9803589052bb4c7be18f813fdb934094ee939f07b608f880eb0ae6e160b2e","src/ext/expand.rs":"648be837cd5cfac46bc47d505c09f47321d7b0d3a684d1c841e490fdc0addb5c","src/ext/hygiene.rs":"8766603dabbc52b3d5c8cffbf7781c1e365f7d5769faba307c759b296bfb82d8","src/ext/placeholders.rs":"50369498e363dd7fdf27cf2ca7def4d83dddd069a885de7fad875b10b880b096","src/ext/quote.rs":"844c854a62dcdd8acd8003cad3b2f8c8acf138730ac4376ee0795616cae88d64","src/ext/source_util.rs":"a3e85ed7af1d8b5e51d64aa3d97ca399787301aba8565ddb2aed3f8a8029896a","src/ext/tt/macro_parser.rs":"bcc5aa9db807df6481a6ef7cc345711599fa253d7f7e53b111df1cd448dfd669","src/ext/tt/macro_rules.rs":"f7cce0311218bfe32c63a4f9b207d83753068253af4c9625d4b69f774b279466","src/ext/tt/transcribe.rs":"fd193278e0d81799cbd4c846b6bce682c871825a3637cef1305a412ee4bc82b4","src/feature_gate.rs":"4508e93a06d27bc118a5b8f62cfa2b24162541dad7b24cfb60b832174d69bb2d","src/fold.rs":"0d44822b5578be2ee19940504aa39eb7b833d2b7c69c26a22ed525913fa8aac0","src/json.rs":"5a06dd34b370da558dca91835b598daa0ad5617d5981fe2b14131ec6fb7408ba","src/lib.rs":"5afc76b7c368150ebe2a4f079b310c7c499acadc7a68051509705b9678831009","src/parse/attr.rs":"d7003d982c33480f966b4a567c0575add01577268774d250f74a369af2c94021","src/parse/classify.rs":"4e859c566e98bc11e7cc05f3b5f7f7a67caa6c53b8b10366eaf32e58bcfdc7ca","src/parse/common.rs":"f231aece27f62694d1146c5b40b24daf8e0e2e0152b159ca6693a8f583679f43","src/parse/lexer/comments.rs":"48a1ee1777e54fb17977defb6ceea11e6ab75fc60c14f6dbea1df96b87d7720e","src/parse/lexer/mod.rs":"166f5c039956681f6a31c9296eff82bd3a854897c4f3a28452d90323e4137b3f","src/parse/lexer/tokentrees.rs":"e0858828fe0a4d378dc3d37db688d4bb5be925c8492ae5e18a07ac1b768fe5e3","src/parse/lexer/unicode_chars.rs":"1517851266b70cb15908457d55f5470091cf115786f35b0064d507e734830161","src/parse/mod.rs":"2f318f2dfccb2bf0828395e25b16466e91039c6e72368d3cb008aaf4fe1375bd","src/parse/obsolete.rs":"cd83ee6f4a01086b736594638492969c6cec9522527fc576886186b9ad6cff03","src/parse/parser.rs":"f9a118c1658297bf1ca1d149e869225c0f6c5a8c8b6b0063d9cc2b7c956509c1","src/parse/token.rs":"a887b06f783854808f84088324b22b4e8c0aacda437550e1a862f10ef40cc446","src/print/pp.rs":"ef6752db3a36c7a614d43d767c788985a78f33e120b39a85e2156a576630afd4","src/print/pprust.rs":"b96bbb22a97cd48545b13531a1fdc330f0ae901b4657d2c3c7d6cd5c18526070","src/ptr.rs":"2f0ecadd1d19b1e11bb067cee99ac6fff7c48dd33222ed67fb61f240e1ca820e","src/show_span.rs":"b55effca7a512b9705e793f092ca1b5af5842f5484ab61660a546b04dd10eb4f","src/std_inject.rs":"5a4b0f451f3dc23c2d6021b435f801bb2b95a485f0b53acb446535b4d4497034","src/str.rs":"023289c93979354cf6074e94327e5c71b5144e0d12042304c0c91b9dd974b26f","src/symbol.rs":"fdc04df4a729a17bc07860635e0d2c0206dc5c6eed19cad587bc6d1a0d74c69a","src/test.rs":"b9ca57f830e2e903564429bc7085d5d7905aed8b2eda6bdae633f2dbc0f8c464","src/test_snippet.rs":"e4cacc977e13753de033f1fde9d83ad230651719ecf69b75f020fe97440accb6","src/tokenstream.rs":"47ef4dd75cc018ccbbccb25d4fe2c2a9621aca8ea893584ca8cd3461eb729e1d","src/util/lev_distance.rs":"323704c761cd216568f70b2131c6010a5a68dc978a24dc3b2dcf17a4361599c0","src/util/move_map.rs":"8bf1a3546325872892ca5d4f04771af01566913d84fa678df7c862fda75fa16c","src/util/node_count.rs":"54268f87eb4d692b11362f1ef2021e8c7c63aa14f383711780d76216eeb5ee0f","src/util/parser.rs":"0aeb1cc7cbec319a8955e696cf46820ab9af7c89691dea2e2285ebb8a299a67d","src/util/parser_testing.rs":"cc500701e79628503dce4af4e792407460247e5caf5f781b83a74b157c1c79fa","src/util/rc_slice.rs":"a1ea06699bb448d135794a9e22ffbdc96c053a40fc6e228486a3c79d11d65bee","src/util/small_vector.rs":"5f3de1a28196c60ff2efdbf0f61056de30aafc64b827531c3bb735b0bebed52f","src/util/thin_vec.rs":"eda6e0ab93dce5e45bb7a2ddeae9120fdb0df3c1d6a5d4e0c8ca3648d404177e","src/visit.rs":"9cfe7ba6edff817224f7269abf3cf4bda8932a55938d228eb2a8232a6a610dd2"},"package":"6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/syslog/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/.cargo-checksum.json --- distinst-0.1.0/vendor/syslog/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"61c9ace2b33a1185c4d743fb7a53e5d0e9244fd925f68cfaa6a7c0d8215177c4","Cargo.toml":"145676d5dd632ee27918160db335d61d7c0ab9cdccea2b3edcac3fc97b3bc873","Makefile":"73be69d4f2a7bc7f7610c8c409fa9cc89be539278dfa57f881223a7d87e976c3","README.md":"6c8eb62c9a4f9dc9d2081a6d2a52d1ecc83b9ad38073a022e9c620a645f57eef","cargo-lite.conf":"6d8f9591aa1618394b08d776464e72ddcec33299ca53aa5e1d293d8abda329a5","examples/write.rs":"76621eaf5dac578eee32a028fb42a4d64fd4e91f82d8cfed5722bdaa5f9c0c4c","src/facility.rs":"d01d730d3e4c8b20199071f4211cd4823d885dd8f52fe4d1997a4380b3c0d722","src/lib.rs":"40221dc9b25978426a0e0a4666cdca978de0fa60b3eedb173909578d819611bd"},"package":"bbc9b0acde4f7c05fdc1cfb05239b8a53a66815dd86c67fee5aa9bfac5b4ed42"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/syslog/cargo-lite.conf distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/cargo-lite.conf --- distinst-0.1.0/vendor/syslog/cargo-lite.conf 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/cargo-lite.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -[build] -crate_root = "src/syslog/lib.rs" -crate_type = "library" - diff -Nru distinst-0.1.0/vendor/syslog/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/Cargo.toml --- distinst-0.1.0/vendor/syslog/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies -# -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) - -[package] -name = "syslog" -version = "3.3.0" -authors = ["contact@geoffroycouprie.com"] -description = "Send log messages to syslog" -documentation = "http://rust.unhandledexpression.com/syslog/" -keywords = ["syslog", "logs", "logging"] -license = "MIT" -repository = "https://github.com/Geal/rust-syslog" -[dependencies.libc] -version = "~0.2" - -[dependencies.log] -version = "~0.3.5" - -[dependencies.unix_socket] -version = "~0.5" - -[dependencies.time] -version = "~0.1" - -[features] -nightly = [] diff -Nru distinst-0.1.0/vendor/syslog/examples/write.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/examples/write.rs --- distinst-0.1.0/vendor/syslog/examples/write.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/examples/write.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -extern crate syslog; - -use syslog::{Facility,Severity}; - -fn main() { - match syslog::unix(Facility::LOG_USER) { - Err(e) => println!("impossible to connect to syslog: {:?}", e), - Ok(writer) => { - let r = writer.send(Severity::LOG_ALERT, "hello world"); - if r.is_err() { - println!("error sending the log {}", r.err().expect("got error")); - } - } - } -} diff -Nru distinst-0.1.0/vendor/syslog/Makefile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/Makefile --- distinst-0.1.0/vendor/syslog/Makefile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -build: - mkdir -p build - rustc --out-dir build -O src/syslog/lib.rs - -test: build - rustc -L build -o build/test --test src/syslog/test.rs - ./build/test - -examples: build - rustc -L build -o build/example examples/write.rs - ./build/example - -clean: - rm -rf build diff -Nru distinst-0.1.0/vendor/syslog/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/README.md --- distinst-0.1.0/vendor/syslog/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -# Sending to Syslog in Rust - -[![Build Status](https://travis-ci.org/Geal/rust-syslog.png?branch=master)](https://travis-ci.org/Geal/rust-syslog) -[![Coverage Status](https://coveralls.io/repos/Geal/rust-syslog/badge.svg?branch=master&service=github)](https://coveralls.io/github/Geal/rust-syslog?branch=master) - -A small library to write to local syslog. - -## Installation - -syslog is available on [crates.io](https://crates.io/crates/syslog) and can be included in your Cargo enabled project like this: - -```toml -[dependencies] -syslog = "~3.3.0" -``` - -## documentation - -Reference documentation is available [here](http://rust.unhandledexpression.com/syslog/). - -## Example - -```rust -extern crate syslog; - -use syslog::{Facility,Severity}; - -fn main() { - match syslog::unix(Facility::LOG_USER) { - Err(e) => println!("impossible to connect to syslog: {:?}", e), - Ok(writer) => { - let r = writer.send_3164(Severity::LOG_ALERT, "hello world"); - if r.is_err() { - println!("error sending the log {}", r.err().expect("got error")); - } - } - } -} -``` - -The struct `syslog::Logger` implements `Log` from the `log` crate, so it can be used as backend for other logging systems. - -There are 3 functions to create loggers: - -* the `unix` function sends to the local syslog through a Unix socket: `syslog::unix(Facility::LOG_USER)` -* the `tcp` function takes an address for a remote TCP syslog server and a hostname: `tcp("127.0.0.1:4242", "localhost".to_string(), Facility::LOG_USER)` -* the `udp` function takes an address for a local port, and the address remote UDP syslog server and a hostname: `udp("127.0.0.1:1234", "127.0.0.1:4242", "localhost".to_string(), Facility::LOG_USER)` diff -Nru distinst-0.1.0/vendor/syslog/src/facility.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/src/facility.rs --- distinst-0.1.0/vendor/syslog/src/facility.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/src/facility.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -use std::str::FromStr; - -#[allow(non_camel_case_types)] -#[derive(Copy,Clone)] -pub enum Facility { - LOG_KERN = 0 << 3, - LOG_USER = 1 << 3, - LOG_MAIL = 2 << 3, - LOG_DAEMON = 3 << 3, - LOG_AUTH = 4 << 3, - LOG_SYSLOG = 5 << 3, - LOG_LPR = 6 << 3, - LOG_NEWS = 7 << 3, - LOG_UUCP = 8 << 3, - LOG_CRON = 9 << 3, - LOG_AUTHPRIV = 10 << 3, - LOG_FTP = 11 << 3, - LOG_LOCAL0 = 16 << 3, - LOG_LOCAL1 = 17 << 3, - LOG_LOCAL2 = 18 << 3, - LOG_LOCAL3 = 19 << 3, - LOG_LOCAL4 = 20 << 3, - LOG_LOCAL5 = 21 << 3, - LOG_LOCAL6 = 22 << 3, - LOG_LOCAL7 = 23 << 3 -} - -impl FromStr for Facility { - type Err = (); - fn from_str(s: &str) -> Result { - let result = match &s.to_lowercase()[..] { - "log_kern" | "kern" => Facility::LOG_KERN, - "log_user" | "user" => Facility::LOG_USER, - "log_mail" | "mail" => Facility::LOG_MAIL, - "log_daemon" | "daemon" => Facility::LOG_DAEMON, - "log_auth" | "auth" => Facility::LOG_AUTH, - "log_syslog" | "syslog" => Facility::LOG_SYSLOG, - "log_lpr" | "lpr" => Facility::LOG_LPR, - "log_news" | "news" => Facility::LOG_NEWS, - "log_uucp" | "uucp" => Facility::LOG_UUCP, - "log_cron" | "cron" => Facility::LOG_CRON, - "log_authpriv"| "authpriv" => Facility::LOG_AUTHPRIV, - "log_ftp" | "ftp" => Facility::LOG_FTP, - "log_local0" | "local0" => Facility::LOG_LOCAL0, - "log_local1" | "local1" => Facility::LOG_LOCAL1, - "log_local2" | "local2" => Facility::LOG_LOCAL2, - "log_local3" | "local3" => Facility::LOG_LOCAL3, - "log_local4" | "local4" => Facility::LOG_LOCAL4, - "log_local5" | "local5" => Facility::LOG_LOCAL5, - "log_local6" | "local6" => Facility::LOG_LOCAL6, - "log_local7" | "local7" => Facility::LOG_LOCAL7, - _ => return Err(()) - }; - Ok(result) - } -} diff -Nru distinst-0.1.0/vendor/syslog/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/src/lib.rs --- distinst-0.1.0/vendor/syslog/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,459 +0,0 @@ -//! Syslog -//! -//! This crate provides facilities to send log messages via syslog. -//! It supports Unix sockets for local syslog, UDP and TCP for remote servers. -//! -//! Messages can be passed directly without modification, or in RFC 3164 or RFC 5424 format -//! -//! The code is available on [Github](https://github.com/Geal/rust-syslog) -//! -//! # Example -//! -//! ``` -//! extern crate syslog; -//! -//! use syslog::{Facility,Severity}; -//! -//! fn main() { -//! match syslog::unix(Facility::LOG_USER) { -//! Err(e) => println!("impossible to connect to syslog: {:?}", e), -//! Ok(writer) => { -//! let r = writer.send(Severity::LOG_ALERT, "hello world"); -//! if r.is_err() { -//! println!("error sending the log {}", r.err().expect("got error")); -//! } -//! } -//! } -//! } -//! ``` -#![crate_type = "lib"] - -extern crate unix_socket; -extern crate libc; -extern crate time; -extern crate log; - -use std::result::Result; -use std::io::{self, Write}; -use std::env; -use std::collections::HashMap; -use std::net::{SocketAddr,ToSocketAddrs,UdpSocket,TcpStream}; -use std::sync::{Arc, Mutex}; -use std::path::Path; -use std::fmt; -use std::error::Error; - -use libc::getpid; -use unix_socket::{UnixDatagram, UnixStream}; -use log::{Log,LogRecord,LogMetadata,LogLevel,SetLoggerError}; - -mod facility; -pub use facility::Facility; - -pub type Priority = u8; - -/// RFC 5424 structured data -pub type StructuredData = HashMap>; - - -#[allow(non_camel_case_types)] -#[derive(Copy,Clone)] -pub enum Severity { - LOG_EMERG, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG -} - -enum LoggerBackend { - /// Unix socket, temp file path, log file path - Unix(UnixDatagram), - UnixStream(Arc>), - Udp(Box, SocketAddr), - Tcp(Arc>) -} - -#[derive(Debug)] -pub struct SyslogError { - description: String, -} - -impl Error for SyslogError { - fn description(&self) -> &str { - &self.description - } - - fn cause(&self) -> Option<&Error> { None } -} - -impl fmt::Display for SyslogError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.description) - } -} - -/// Main logging structure -pub struct Logger { - facility: Facility, - hostname: Option, - process: String, - pid: i32, - s: LoggerBackend -} - -/// Returns a Logger using unix socket to target local syslog ( using /dev/log or /var/run/syslog) -pub fn unix(facility: Facility) -> Result, io::Error> { - unix_custom(facility, "/dev/log").or_else(|e| if e.kind() == io::ErrorKind::NotFound { - unix_custom(facility, "/var/run/syslog") - } else { - Err(e) - }) -} - -/// Returns a Logger using unix socket to target local syslog at user provided path -pub fn unix_custom>(facility: Facility, path: P) -> Result, io::Error> { - let (process_name, pid) = get_process_info().unwrap(); - let sock = try!(UnixDatagram::unbound()); - match sock.connect(&path) { - Ok(()) => { - Ok(Box::new(Logger { - facility: facility.clone(), - hostname: None, - process: process_name, - pid: pid, - s: LoggerBackend::Unix(sock), - })) - }, - Err(ref e) if e.raw_os_error() == Some(libc::EPROTOTYPE) => { - let sock = try!(UnixStream::connect(path)); - Ok(Box::new(Logger { - facility: facility.clone(), - hostname: None, - process: process_name, - pid: pid, - s: LoggerBackend::UnixStream(Arc::new(Mutex::new(sock))), - })) - }, - Err(e) => Err(e), - } -} - -/// returns a UDP logger connecting `local` and `server` -pub fn udp(local: T, server: T, hostname:String, facility: Facility) -> Result, io::Error> { - server.to_socket_addrs().and_then(|mut server_addr_opt| { - server_addr_opt.next().ok_or( - io::Error::new( - io::ErrorKind::InvalidInput, - "invalid server address" - ) - ) - }).and_then(|server_addr| { - UdpSocket::bind(local).map(|socket| { - let (process_name, pid) = get_process_info().unwrap(); - Box::new(Logger { - facility: facility.clone(), - hostname: Some(hostname), - process: process_name, - pid: pid, - s: LoggerBackend::Udp(Box::new(socket), server_addr) - }) - }) - }) -} - -/// returns a TCP logger connecting `local` and `server` -pub fn tcp(server: T, hostname: String, facility: Facility) -> Result, io::Error> { - TcpStream::connect(server).map(|socket| { - let (process_name, pid) = get_process_info().unwrap(); - Box::new(Logger { - facility: facility.clone(), - hostname: Some(hostname), - process: process_name, - pid: pid, - s: LoggerBackend::Tcp(Arc::new(Mutex::new(socket))) - }) - }) -} - -/// Unix socket Logger init function compatible with log crate -pub fn init_unix(facility: Facility, log_level: log::LogLevelFilter) -> Result<(), SetLoggerError> { - log::set_logger(|max_level| { - max_level.set(log_level); - unix(facility).unwrap() - }) -} - -/// Unix socket Logger init function compatible with log crate and user provided socket path -pub fn init_unix_custom>(facility: Facility, log_level: log::LogLevelFilter, path: P) -> Result<(), SetLoggerError> { - log::set_logger(|max_level| { - max_level.set(log_level); - unix_custom(facility, path).unwrap() - }) -} - -/// UDP Logger init function compatible with log crate -pub fn init_udp(local: T, server: T, hostname:String, facility: Facility, log_level: log::LogLevelFilter) -> Result<(), SetLoggerError> { - log::set_logger(|max_level| { - max_level.set(log_level); - udp(local, server, hostname, facility).unwrap() - }) -} - -/// TCP Logger init function compatible with log crate -pub fn init_tcp(server: T, hostname: String, facility: Facility, log_level: log::LogLevelFilter) -> Result<(), SetLoggerError> { - log::set_logger(|max_level| { - max_level.set(log_level); - tcp(server, hostname, facility).unwrap() - }) -} - -/// Initializes logging subsystem for log crate -/// -/// This tries to connect to syslog by following ways: -/// -/// 1. Unix sockets /dev/log and /var/run/syslog (in this order) -/// 2. Tcp connection to 127.0.0.1:601 -/// 3. Udp connection to 127.0.0.1:514 -/// -/// Note the last option usually (almost) never fails in this method. So -/// this method doesn't return error even if there is no syslog. -/// -/// If `application_name` is `None` name is derived from executable name -pub fn init(facility: Facility, log_level: log::LogLevelFilter, - application_name: Option<&str>) - -> Result<(), SyslogError> -{ - let backend = unix(facility).map(|logger| logger.s) - .or_else(|_| { - TcpStream::connect(("127.0.0.1", 601)) - .map(|s| LoggerBackend::Tcp(Arc::new(Mutex::new(s)))) - }) - .or_else(|_| { - let udp_addr = "127.0.0.1:514".parse().unwrap(); - UdpSocket::bind(("127.0.0.1", 0)) - .map(|s| LoggerBackend::Udp(Box::new(s), udp_addr)) - }).map_err(|e| SyslogError{ description: e.description().to_owned() })?; - let (process_name, pid) = get_process_info().unwrap(); - log::set_logger(|max_level| { - max_level.set(log_level); - Box::new(Logger { - facility: facility.clone(), - hostname: None, - process: application_name - .map(|v| v.to_string()) - .unwrap_or(process_name), - pid: pid, - s: backend, - }) - }).map_err(|e| SyslogError{ description: e.description().to_owned() }) -} - -impl Logger { - /// format a message as a RFC 3164 log message - pub fn format_3164(&self, severity:Severity, message: T) -> String { - if let Some(ref hostname) = self.hostname { - format!("<{}>{} {} {}[{}]: {}", - self.encode_priority(severity, self.facility), - time::now().strftime("%b %d %T").unwrap(), - hostname, self.process, self.pid, message) - } else { - format!("<{}>{} {}[{}]: {}", - self.encode_priority(severity, self.facility), - time::now().strftime("%b %d %T").unwrap(), - self.process, self.pid, message) - } - } - - /// format RFC 5424 structured data as `([id (name="value")*])*` - pub fn format_5424_structured_data(&self, data: StructuredData) -> String { - if data.is_empty() { - "-".to_string() - } else { - let mut res = String::new(); - for (id, params) in data.iter() { - res = res + "["+id; - for (name,value) in params.iter() { - res = res + " " + name + "=\"" + value + "\""; - } - res = res + "]"; - } - - res - } - } - - /// format a message as a RFC 5424 log message - pub fn format_5424(&self, severity:Severity, message_id: i32, data: StructuredData, message: T) -> String { - let f = format!("<{}> {} {} {} {} {} {} {} {}", - self.encode_priority(severity, self.facility), - 1, // version - time::now_utc().rfc3339(), - self.hostname.as_ref().map(|x| &x[..]).unwrap_or("localhost"), - self.process, self.pid, message_id, - self.format_5424_structured_data(data), message); - return f; - } - - fn encode_priority(&self, severity: Severity, facility: Facility) -> Priority { - return facility as u8 | severity as u8 - } - - /// Sends a basic log message of the format ` message` - pub fn send(&self, severity: Severity, message: T) -> Result { - let formatted = format!("<{}> {}", - self.encode_priority(severity, self.facility.clone()), - message).into_bytes(); - self.send_raw(&formatted[..]) - } - - /// Sends a RFC 3164 log message - pub fn send_3164(&self, severity: Severity, message: T) -> Result { - let formatted = self.format_3164(severity, message).into_bytes(); - self.send_raw(&formatted[..]) - } - - /// Sends a RFC 5424 log message - pub fn send_5424(&self, severity: Severity, message_id: i32, data: StructuredData, message: T) -> Result { - let formatted = self.format_5424(severity, message_id, data, message).into_bytes(); - self.send_raw(&formatted[..]) - } - - /// Sends a message directly, without any formatting - pub fn send_raw(&self, message: &[u8]) -> Result { - match self.s { - LoggerBackend::Unix(ref dgram) => dgram.send(&message[..]), - LoggerBackend::UnixStream(ref socket_wrap) => { - let mut socket = socket_wrap.lock().unwrap(); - let null = [0 ; 1]; - socket.write(&message[..]).and_then(|_| socket.write(&null)) - }, - LoggerBackend::Udp(ref socket, ref addr) => socket.send_to(&message[..], addr), - LoggerBackend::Tcp(ref socket_wrap) => { - let mut socket = socket_wrap.lock().unwrap(); - socket.write(&message[..]) - } - } - } - - pub fn emerg(&self, message: T) -> Result { - self.send_3164(Severity::LOG_EMERG, message) - } - - pub fn alert(&self, message: T) -> Result { - self.send_3164(Severity::LOG_ALERT, message) - } - - pub fn crit(&self, message: T) -> Result { - self.send_3164(Severity::LOG_CRIT, message) - } - - pub fn err(&self, message: T) -> Result { - self.send_3164(Severity::LOG_ERR, message) - } - - pub fn warning(&self, message: T) -> Result { - self.send_3164(Severity::LOG_WARNING, message) - } - - pub fn notice(&self, message: T) -> Result { - self.send_3164(Severity::LOG_NOTICE, message) - } - - pub fn info(&self, message: T) -> Result { - self.send_3164(Severity::LOG_INFO, message) - } - - pub fn debug(&self, message: T) -> Result { - self.send_3164(Severity::LOG_DEBUG, message) - } - - pub fn process_name(&self) -> &String { - &self.process - } - - pub fn process_id(&self) -> i32 { - self.pid - } - - pub fn set_process_name(&mut self, name: String) { - self.process = name - } - - pub fn set_process_id(&mut self, id: i32) { - self.pid = id - } - - /// Changes facility - pub fn set_facility(&mut self, facility: Facility) { - self.facility = facility; - } -} - -#[allow(unused_variables,unused_must_use)] -impl Log for Logger { - fn enabled(&self, metadata: &LogMetadata) -> bool { - true - } - - fn log(&self, record: &LogRecord) { - let message = &(format!("{}", record.args())); - match record.level() { - LogLevel::Error => self.err(message), - LogLevel::Warn => self.warning(message), - LogLevel::Info => self.info(message), - LogLevel::Debug => self.debug(message), - LogLevel::Trace => self.debug(message) - }; - } -} - -fn get_process_info() -> Option<(String,i32)> { - env::current_exe().ok().and_then(|path| { - path.file_name().and_then(|os_name| os_name.to_str()).map(|name| name.to_string()) - }).map(|name| { - let pid = unsafe { getpid() }; - (name, pid) - }) -} - -#[test] -#[allow(unused_must_use)] -fn message() { - use std::thread; - use std::sync::mpsc::channel; - - let r = unix(Facility::LOG_USER); - //let r = tcp("127.0.0.1:4242", "localhost".to_string(), Facility::LOG_USER); - if r.is_ok() { - let w = r.unwrap(); - let m:String = w.format_3164(Severity::LOG_ALERT, "hello"); - println!("test: {}", m); - let r = w.send_3164(Severity::LOG_ALERT, "pouet"); - if r.is_err() { - println!("error sending: {}", r.unwrap_err()); - } - //assert_eq!(m, "<9> test hello".to_string()); - - let data = Arc::new(w); - let (tx, rx) = channel(); - for i in 0..3 { - let shared = data.clone(); - let tx = tx.clone(); - thread::spawn(move || { - //let mut logger = *shared; - let message = &format!("sent from {}", i); - shared.send_3164(Severity::LOG_DEBUG, message); - tx.send(()); - }); - } - - for _ in 0..3 { - rx.recv(); - } - } -} - diff -Nru distinst-0.1.0/vendor/syslog/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/.travis.yml --- distinst-0.1.0/vendor/syslog/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/syslog/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -language: rust - -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - -rust: - - nightly - - beta - - stable - -before_script: - - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH - -script: - - | - travis-cargo build && - travis-cargo test && - travis-cargo bench - travis-cargo --only stable doc - -after_success: - - travis-cargo coveralls --no-sudo - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/9c035a194ac4fd4cc061 - on_success: change - on_failure: always - on_start: false - - -env: - global: - # override the default `--features unstable` used for the nightly branch (optional) - - TRAVIS_CARGO_NIGHTLY_FEATURE=nightly - -sudo: false diff -Nru distinst-0.1.0/vendor/tempdir/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/tempdir/.cargo-checksum.json --- distinst-0.1.0/vendor/tempdir/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/tempdir/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"a4229a7e2eaa72b54020926415d7715144a291fe433380d371bbb0e1207f8326","Cargo.toml":"a6c08b72f1ed2a2ab14761024d023eb1c270c272cd6cd62b42041ea30e112824","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"fe89569b23ecd71d60148f1356c286b4a8614327cec4ff8518dfab17e57c5487","src/lib.rs":"2235297adddfa32e4ab3a4506c538717d89f2c0bdf196893132dc65f52a991c9","tests/smoke.rs":"b2b2ed4a10c1d1965b1effee0995da73cb7b1480aefcd77ba4ad5456651253e4"},"package":"87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"} \ No newline at end of file +{"files":{".travis.yml":"a4229a7e2eaa72b54020926415d7715144a291fe433380d371bbb0e1207f8326","Cargo.toml":"a6c08b72f1ed2a2ab14761024d023eb1c270c272cd6cd62b42041ea30e112824","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"fe89569b23ecd71d60148f1356c286b4a8614327cec4ff8518dfab17e57c5487","src/lib.rs":"2235297adddfa32e4ab3a4506c538717d89f2c0bdf196893132dc65f52a991c9","tests/smoke.rs":"b2b2ed4a10c1d1965b1effee0995da73cb7b1480aefcd77ba4ad5456651253e4"},"package":"87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/term/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term/.cargo-checksum.json --- distinst-0.1.0/vendor/term/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"8a98e02ce273cefe3e6bdc92966575a9a71957ec49dba52301f5bdea8c194f9f","Cargo.toml":"f88e383191ad44e3f49cb5ed1389fd1f0cca6be0e9cc5f37f11c323186cd8bf6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"f5d6df44431e0814368b2890d954ae2253efb7765925582de8be11eb16a505a6","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","rustfmt.toml":"be851a0fa92766755e54e163ccceedee0b28ea6d527888c48f1cbc766f23733c","scripts/id_rsa.enc":"210d1476adba1c08d77329d9f71dba828c0516d8ae659c6317c9bee4683e5d50","scripts/travis-doc-upload.cfg":"2609cb89644596a2ede3cd63b7a5fb6e84ee56c2b880ff67584e9655f4a2e777","src/lib.rs":"53c4f63f2bc07326024b8663961790ecd0a136b14c38eacb4c751764da5d5f2c","src/terminfo/mod.rs":"a47021ff3bca69131cbd23b3df0143a9baebf2c1949687ec1b726b29b157ba6f","src/terminfo/parm.rs":"efde5f3ab1cb5a646f51f07bd90cd05154e7d080c96dc03ae33dc2a125c5aedd","src/terminfo/parser/compiled.rs":"8f5a87d19c0bdfbc95f9fed8deb447e07d1368abca6d147f79c14b2f164b4a11","src/terminfo/parser/names.rs":"dd32022a5f198abc40fa68566c0798725451345173a7d80c80e05a121c8cf0f8","src/terminfo/searcher.rs":"5602a32e555762e5171c1865c2c1b3b6bb092b8c233f413bc0933658bed40b67","src/win.rs":"9efbdc4bb18b317e3d98fa58e441cc8903710ac0e6f315899329660cf6d10277","tests/data/dumb":"123c85a2812a517d967db5f31660db0e6aded4a0b95ed943c5ab435368e7a25c","tests/data/linux":"9dcec472e8ec612e84b46c2b8ae17a4f47b2ccfe93bc7b16970bbaaa20fab1e9","tests/data/linux-16color":"eb0b5684a42db662ebaa0043cc4bb5e082b09a7312796ec669e0159fce6af499","tests/data/linux-basic":"1373c033c6a891911a0a478e5f9654600e84dbfe2d16f649ba2fc08802335a0c","tests/data/linux-c":"50807ab8371b45bd80ca9d563de882b733b5db88cff7646e40c344e98ef755ed","tests/data/linux-c-nc":"d88eb59f749d91be3148ce39dec7c050d95feb516702ed7f9f6cec7a58b424a7","tests/data/linux-koi8":"4b7d942f03ce95d45802029db0c87879eb93be50b43026c63c18a3552dd37c93","tests/data/linux-koi8r":"7267d93deec24396a9955e95da621c054d8d677634b465d798f792141b24e1de","tests/data/linux-lat":"b72b2ec68fa445e2e0ae96cc7bb2149a1527e11ae475d1957c8a22d9ec2c0905","tests/data/linux-m":"4a92f6fef1eeb679ec4511579d3004cfe6fc1d4dd73fed5299cde568f6cf3fbf","tests/data/linux-nic":"eac886df04c80e6ba02687087ddc93635c0f433f4f28195447499a8963989f21","tests/data/linux-vt":"2ebd4c761a492190609f6d8bcdd8f9c8c81e281b0d5e8a51b87f4ba126370bb4","tests/data/linux2.2":"c3d6e1466e9fb4111f4bf243b87a3de290d85224f1a4241947a3f51bdff08b82","tests/data/linux2.6":"52c2930ab1cad8271c280fefb1f581b12b7b3be445348d047a39f5e3448b3614","tests/data/linux2.6.26":"88f5a62b78956a21015ac887c5189a9f72900a842c2f844a1a5e197151a078d2","tests/data/linux3.0":"29b2aad27b5c291adab85e4150883fa6dc0034671c67e889d722168735ba2504","tests/data/rxvt":"9411be0058e147fc7a1962cd35145446d3d439ac3be9b6ca9d3aa2aa0c28ef5e","tests/data/rxvt-16color":"d41e75a0bad0e7c6d957c727f68dc507898685f3bbd71f0721a0a4beb14daf08","tests/data/rxvt-256color":"e6415e230d7962133d1da913cfcf23a0e2d3ed75379164a921feb9462c475a8e","tests/data/rxvt-88color":"958a81509d2b1e2cfe5a7bcf7a15e81d12575e4ccaa1dd308eda8edf7905a36a","tests/data/rxvt-basic":"3989e1c659121cb8fd8f67b8bff7f304e52c1f401cd1d09e906e11a58e0bc587","tests/data/rxvt-color":"3d2b49d48aca7fad7a3bf26d06592207b3c3cbf7afc3a5223fd0613f50a2739b","tests/data/rxvt-cygwin":"d50e434af6b3ab85b26e4f6af21c9c612d271efacaff3e64ef3da8c350a91809","tests/data/rxvt-cygwin-native":"34ee4ef070d9c366f5aba8f72a29a0e45ab552ba43b3e32265dfbe9eef157994","tests/data/rxvt-xpm":"4e8e40313ef00f0572456724249a625c36f2c5338b5014b87f236e29f612212e","tests/data/screen":"57c2888ffb9d7632381dc6191657abda998ca5f0958ad5787f848ff2206198f9","tests/data/screen-256color":"13fd658c693283ffb495d7f473bf525422e312e199bff6e64abdb70db5b22f46","tests/data/xterm":"67a59e4f0807759546dbf45c0bc2dddb30944ef553990345b1d08d7d19ddc13a","tests/data/xterm-256color":"e2525d133091a1ac38b2ad4eecd8df48eee31789c8fafac0ed99bcd6b746d8ce","tests/terminfo.rs":"e07390f101f2c109a15c2274eb31a96c602845c75f33f2775ed2a6b98ffbdf5a"},"package":"fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"} \ No newline at end of file +{"files":{".travis.yml":"8a98e02ce273cefe3e6bdc92966575a9a71957ec49dba52301f5bdea8c194f9f","Cargo.toml":"f88e383191ad44e3f49cb5ed1389fd1f0cca6be0e9cc5f37f11c323186cd8bf6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"f5d6df44431e0814368b2890d954ae2253efb7765925582de8be11eb16a505a6","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","rustfmt.toml":"be851a0fa92766755e54e163ccceedee0b28ea6d527888c48f1cbc766f23733c","scripts/id_rsa.enc":"210d1476adba1c08d77329d9f71dba828c0516d8ae659c6317c9bee4683e5d50","scripts/travis-doc-upload.cfg":"2609cb89644596a2ede3cd63b7a5fb6e84ee56c2b880ff67584e9655f4a2e777","src/lib.rs":"53c4f63f2bc07326024b8663961790ecd0a136b14c38eacb4c751764da5d5f2c","src/terminfo/mod.rs":"a47021ff3bca69131cbd23b3df0143a9baebf2c1949687ec1b726b29b157ba6f","src/terminfo/parm.rs":"efde5f3ab1cb5a646f51f07bd90cd05154e7d080c96dc03ae33dc2a125c5aedd","src/terminfo/parser/compiled.rs":"8f5a87d19c0bdfbc95f9fed8deb447e07d1368abca6d147f79c14b2f164b4a11","src/terminfo/parser/names.rs":"dd32022a5f198abc40fa68566c0798725451345173a7d80c80e05a121c8cf0f8","src/terminfo/searcher.rs":"5602a32e555762e5171c1865c2c1b3b6bb092b8c233f413bc0933658bed40b67","src/win.rs":"9efbdc4bb18b317e3d98fa58e441cc8903710ac0e6f315899329660cf6d10277","tests/data/dumb":"123c85a2812a517d967db5f31660db0e6aded4a0b95ed943c5ab435368e7a25c","tests/data/linux":"9dcec472e8ec612e84b46c2b8ae17a4f47b2ccfe93bc7b16970bbaaa20fab1e9","tests/data/linux-16color":"eb0b5684a42db662ebaa0043cc4bb5e082b09a7312796ec669e0159fce6af499","tests/data/linux-basic":"1373c033c6a891911a0a478e5f9654600e84dbfe2d16f649ba2fc08802335a0c","tests/data/linux-c":"50807ab8371b45bd80ca9d563de882b733b5db88cff7646e40c344e98ef755ed","tests/data/linux-c-nc":"d88eb59f749d91be3148ce39dec7c050d95feb516702ed7f9f6cec7a58b424a7","tests/data/linux-koi8":"4b7d942f03ce95d45802029db0c87879eb93be50b43026c63c18a3552dd37c93","tests/data/linux-koi8r":"7267d93deec24396a9955e95da621c054d8d677634b465d798f792141b24e1de","tests/data/linux-lat":"b72b2ec68fa445e2e0ae96cc7bb2149a1527e11ae475d1957c8a22d9ec2c0905","tests/data/linux-m":"4a92f6fef1eeb679ec4511579d3004cfe6fc1d4dd73fed5299cde568f6cf3fbf","tests/data/linux-nic":"eac886df04c80e6ba02687087ddc93635c0f433f4f28195447499a8963989f21","tests/data/linux-vt":"2ebd4c761a492190609f6d8bcdd8f9c8c81e281b0d5e8a51b87f4ba126370bb4","tests/data/linux2.2":"c3d6e1466e9fb4111f4bf243b87a3de290d85224f1a4241947a3f51bdff08b82","tests/data/linux2.6":"52c2930ab1cad8271c280fefb1f581b12b7b3be445348d047a39f5e3448b3614","tests/data/linux2.6.26":"88f5a62b78956a21015ac887c5189a9f72900a842c2f844a1a5e197151a078d2","tests/data/linux3.0":"29b2aad27b5c291adab85e4150883fa6dc0034671c67e889d722168735ba2504","tests/data/rxvt":"9411be0058e147fc7a1962cd35145446d3d439ac3be9b6ca9d3aa2aa0c28ef5e","tests/data/rxvt-16color":"d41e75a0bad0e7c6d957c727f68dc507898685f3bbd71f0721a0a4beb14daf08","tests/data/rxvt-256color":"e6415e230d7962133d1da913cfcf23a0e2d3ed75379164a921feb9462c475a8e","tests/data/rxvt-88color":"958a81509d2b1e2cfe5a7bcf7a15e81d12575e4ccaa1dd308eda8edf7905a36a","tests/data/rxvt-basic":"3989e1c659121cb8fd8f67b8bff7f304e52c1f401cd1d09e906e11a58e0bc587","tests/data/rxvt-color":"3d2b49d48aca7fad7a3bf26d06592207b3c3cbf7afc3a5223fd0613f50a2739b","tests/data/rxvt-cygwin":"d50e434af6b3ab85b26e4f6af21c9c612d271efacaff3e64ef3da8c350a91809","tests/data/rxvt-cygwin-native":"34ee4ef070d9c366f5aba8f72a29a0e45ab552ba43b3e32265dfbe9eef157994","tests/data/rxvt-xpm":"4e8e40313ef00f0572456724249a625c36f2c5338b5014b87f236e29f612212e","tests/data/screen":"57c2888ffb9d7632381dc6191657abda998ca5f0958ad5787f848ff2206198f9","tests/data/screen-256color":"13fd658c693283ffb495d7f473bf525422e312e199bff6e64abdb70db5b22f46","tests/data/xterm":"67a59e4f0807759546dbf45c0bc2dddb30944ef553990345b1d08d7d19ddc13a","tests/data/xterm-256color":"e2525d133091a1ac38b2ad4eecd8df48eee31789c8fafac0ed99bcd6b746d8ce","tests/terminfo.rs":"e07390f101f2c109a15c2274eb31a96c602845c75f33f2775ed2a6b98ffbdf5a"},"package":"fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/termion/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/.cargo-checksum.json --- distinst-0.1.0/vendor/termion/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +{"files":{".travis.yml":"5ac96d0b7956730882c41fa620f04388ff3100205fac606ae3bd8353661794a9","Cargo.toml":"b061b09fc4bbf280c932f4b7d3c4641a5a2f0eb8c57029de7d0e4441888a1765","LICENSE":"6252f0c8d4a0df9b2dc0c6464cb2489dbe8859b0eb727e19c14e6af1ee432394","README.md":"71cac837cd6f1326865add7dd565ea2738756648de87fc2d35d0cf22a2512630","examples/alternate_screen.rs":"37978473e77331ad613843049b4f355e32a51a7b8ece9ee52efe02997391e4ec","examples/alternate_screen_raw.rs":"bfd68f86de929952aaed7e1e7175694d771be2a0b0943092fec4f58bf7473dc3","examples/async.rs":"2fdf5fe69edd3b407de3c1c8caf23f9e19a7f25b55578c84838e4305a9857c42","examples/click.rs":"bb3a76f4817292a82b00d92281a86a400038a8282b6c9d41a34dbaca84fb0caf","examples/color.rs":"808219c739677b9f2645e0ae7975a4bd8981255ed8bfc9df2413f8f8059bbda5","examples/commie.rs":"7bb00a7f669c74ccb3a9e9c8ff39fd01aa984f7c38983e5c1cfe6940f90b0c73","examples/detect_color.rs":"764d6465c6879efc38aca8d980a433bac058c1f03d578ac764437af289931824","examples/is_tty.rs":"9a76bdfb11ea84e7b25f6efc06c8d3a8d13a03448bd826bd283b935852f409c7","examples/keys.rs":"cd89f31a21062486e7c014843b360cee35dcee07d8022fc0282eddc48e46bdc7","examples/mouse.rs":"eeccab8043cec987e40e175f03b63c9c6cdc7bcd5808f51a57d0e970cae1c04e","examples/rainbow.rs":"c015176eba7c7a81c6d302d6fc41abea8817935ee804af59d64e3098b127c333","examples/read.rs":"b95fb9b02d2cbf978096825b18ffa25772467df3417c3f3cf5edfe811181a67a","examples/rustc_fun.rs":"f39bd8dbe224cb592d58a0084d15d1eb80d86eade72423fe51acc455e0e1ea68","examples/simple.rs":"eac1aab0d251f884a7d7d7d0d017b6ac4854b38ffcfb244d6a80102ed7a981ab","examples/size.rs":"ae89e7b98a29040f1b641d75226f5738770e2e043cee3f49649accaaeaabbeac","examples/truecolor.rs":"67128ef4870e9e742b1090fa129097484633d82fb015009b1760295f7a24e6af","logo.svg":"09b7a6bca3185acddc217d3d3baab23627c5e03a192f815116e71cf00cb31ddc","src/async.rs":"f0126ff1ee18c8c355bb86deb76e852c5f6bb47fbbaa286cce3d38cb656dfa28","src/clear.rs":"a9cf9a9f92cef2430239dc33d8ecb4e291c46b650f1f71b63248d0a0215768ba","src/color.rs":"2f2c8f6f572b22fc40a62d0502fc192c843dbeed21bb7ecc1954e881d41c9a1c","src/cursor.rs":"9132638902c4e42728efaac247ca363c1bda3e80d6c3cc20bc6928b9fe9a1d10","src/event.rs":"321c0a73cd6208a8ef17083d1bd907e308d5197cfd198a3f1ed1498b7e2b8055","src/input.rs":"a3e226a53b6536aef89d66a1e4974453389c86116c175c3efc4fc4bb9b41d60c","src/lib.rs":"549beee5f5a6fb7954af37df7fa598ba6c716f2287123e09d300e048af2a70ac","src/macros.rs":"8611f257ffc046ed25870611f1353a96e17a5671efbe2bbf33aae525b53a4df3","src/raw.rs":"6949b164cf1bd0a4146c169b948100ed626b3e0747df15a54b7f41853d348ea1","src/screen.rs":"19a9a2c42abe2afdb75d4850dc6ee54f33808f6da7f59644668e683418cbce4a","src/scroll.rs":"d0ba08663127e09e111fafc9f84c1fe42662b74f9acbca6b5d26d0b335ee4136","src/style.rs":"b2c805d710cf553835a01482f014aff7395f79d5f71f1e5029ae679e002ac010","src/sys/redox/attr.rs":"834d21cc17090fb7989906ce885f4efed252d65086c05e32ecc05792eb69151a","src/sys/redox/mod.rs":"4066ba97f10c8b87a6ebf32257c89d36338366e1230781aeb5fca98bd5f5bae0","src/sys/redox/size.rs":"b892d0053f40c343eeb40ea06a10fb77abd2758eecda6a7cccb0b07c07fff6eb","src/sys/redox/tty.rs":"3369a6ee3a21400053a023c01912bdd92b709915b833e25e557214dfad425224","src/sys/unix/attr.rs":"7b17e4841eab69533d2561764506211e2967cd4d7464a309e6d2832473b75dd7","src/sys/unix/mod.rs":"8ddebce9f5b2dbbd419519beb7d41f6d6a7eaed40a70cd0d0676ee893549f7a7","src/sys/unix/size.rs":"19f3de9ced2b329a50a9752ba1be406b25648b298c1a2b3e83582a34e21d2998","src/sys/unix/tty.rs":"eeea0279f76838aa4badd807325403d32ab359334cf59f9574191afcbe86c811"},"package":"689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/termion/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/Cargo.toml --- distinst-0.1.0/vendor/termion/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,17 @@ +[package] +name = "termion" +version = "1.5.1" +authors = ["ticki ", "gycos ", "IGI-111 "] +description = "A bindless library for manipulating terminals." +repository = "https://github.com/ticki/termion" +documentation = "https://docs.rs/termion" +license = "MIT" +keywords = ["tty", "color", "terminal", "password", "tui"] +exclude = ["target", "CHANGELOG.md", "image.png", "Cargo.lock"] + +[target.'cfg(not(target_os = "redox"))'.dependencies] +libc = "0.2.8" + +[target.'cfg(target_os = "redox")'.dependencies] +redox_syscall = "0.1" +redox_termios = "0.1" diff -Nru distinst-0.1.0/vendor/termion/examples/alternate_screen_raw.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/alternate_screen_raw.rs --- distinst-0.1.0/vendor/termion/examples/alternate_screen_raw.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/alternate_screen_raw.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,40 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use termion::screen::*; +use std::io::{Write, stdout, stdin}; + +fn write_alt_screen_msg(screen: &mut W) { + write!(screen, "{}{}Welcome to the alternate screen.{}Press '1' to switch to the main screen or '2' to switch to the alternate screen.{}Press 'q' to exit (and switch back to the main screen).", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Goto(1, 3), + termion::cursor::Goto(1, 4)).unwrap(); +} + +fn main() { + let stdin = stdin(); + let mut screen = AlternateScreen::from(stdout().into_raw_mode().unwrap()); + write!(screen, "{}", termion::cursor::Hide).unwrap(); + write_alt_screen_msg(&mut screen); + + screen.flush().unwrap(); + + for c in stdin.keys() { + match c.unwrap() { + Key::Char('q') => break, + Key::Char('1') => { + write!(screen, "{}", ToMainScreen).unwrap(); + } + Key::Char('2') => { + write!(screen, "{}", ToAlternateScreen).unwrap(); + write_alt_screen_msg(&mut screen); + } + _ => {} + } + screen.flush().unwrap(); + } + write!(screen, "{}", termion::cursor::Show).unwrap(); +} diff -Nru distinst-0.1.0/vendor/termion/examples/alternate_screen.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/alternate_screen.rs --- distinst-0.1.0/vendor/termion/examples/alternate_screen.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/alternate_screen.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,17 @@ +extern crate termion; + +use termion::screen::*; +use std::io::{Write, stdout}; +use std::{time, thread}; + +fn main() { + { + let mut screen = AlternateScreen::from(stdout()); + write!(screen, "Welcome to the alternate screen.\n\nPlease wait patiently until we arrive back at the main screen in a about three seconds.").unwrap(); + screen.flush().unwrap(); + + thread::sleep(time::Duration::from_secs(3)); + } + + println!("Phew! We are back."); +} diff -Nru distinst-0.1.0/vendor/termion/examples/async.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/async.rs --- distinst-0.1.0/vendor/termion/examples/async.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/async.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,39 @@ +extern crate termion; + +use termion::raw::IntoRawMode; +use termion::async_stdin; +use std::io::{Read, Write, stdout}; +use std::thread; +use std::time::Duration; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock().into_raw_mode().unwrap(); + let mut stdin = async_stdin().bytes(); + + write!(stdout, + "{}{}", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + + loop { + write!(stdout, "{}", termion::clear::CurrentLine).unwrap(); + + let b = stdin.next(); + write!(stdout, "\r{:?} <- This demonstrates the async read input char. Between each update a 100 ms. is waited, simply to demonstrate the async fashion. \n\r", b).unwrap(); + if let Some(Ok(b'q')) = b { + break; + } + + stdout.flush().unwrap(); + + thread::sleep(Duration::from_millis(50)); + stdout.write_all(b"# ").unwrap(); + stdout.flush().unwrap(); + thread::sleep(Duration::from_millis(50)); + stdout.write_all(b"\r #").unwrap(); + write!(stdout, "{}", termion::cursor::Goto(1, 1)).unwrap(); + stdout.flush().unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/click.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/click.rs --- distinst-0.1.0/vendor/termion/examples/click.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/click.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,35 @@ +extern crate termion; + +use termion::event::{Key, Event, MouseEvent}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = MouseTerminal::from(stdout().into_raw_mode().unwrap()); + + write!(stdout, + "{}{}q to exit. Click, click, click!", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + stdout.flush().unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, x, y) => { + write!(stdout, "{}x", termion::cursor::Goto(x, y)).unwrap(); + } + _ => (), + } + } + _ => {} + } + stdout.flush().unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/color.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/color.rs --- distinst-0.1.0/vendor/termion/examples/color.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/color.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,10 @@ +extern crate termion; + +use termion::{color, style}; + +fn main() { + println!("{}Red", color::Fg(color::Red)); + println!("{}Blue", color::Fg(color::Blue)); + println!("{}Blue'n'Bold{}", style::Bold, style::Reset); + println!("{}Just plain italic", style::Italic); +} diff -Nru distinst-0.1.0/vendor/termion/examples/commie.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/commie.rs --- distinst-0.1.0/vendor/termion/examples/commie.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/commie.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,51 @@ +extern crate termion; + +use termion::{clear, color, cursor}; + +use std::{time, thread}; + +const COMMUNISM: &'static str = r#" + !######### # + !########! ##! + !########! ### + !########## #### + ######### ##### ###### + !###! !####! ###### + ! ##### ######! + !####! ####### + ##### ####### + !####! #######! + ####!######## + ## ########## + ,######! !############# + ,#### ########################!####! + ,####' ##################!' ##### + ,####' ####### !####! + ####' ##### + ~## ##~ +"#; + +fn main() { + let mut state = 0; + + println!("\n{}{}{}{}{}{}", + cursor::Hide, + clear::All, + cursor::Goto(1, 1), + color::Fg(color::Black), + color::Bg(color::Red), + COMMUNISM); + loop { + println!("{}{} ☭ GAY ☭ SPACE ☭ COMMUNISM ☭ ", + cursor::Goto(1, 1), + color::Bg(color::AnsiValue(state))); + println!("{}{} WILL PREVAIL, COMRADES! ", + cursor::Goto(1, 20), + color::Bg(color::AnsiValue(state))); + + state += 1; + state %= 8; + + thread::sleep(time::Duration::from_millis(90)); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/detect_color.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/detect_color.rs --- distinst-0.1.0/vendor/termion/examples/detect_color.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/detect_color.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,19 @@ +extern crate termion; + +use termion::color::{DetectColors, AnsiValue, Bg}; +use termion::raw::IntoRawMode; +use std::io::stdout; + +fn main() { + let count; + { + let mut term = stdout().into_raw_mode().unwrap(); + count = term.available_colors().unwrap(); + } + + println!("This terminal supports {} colors.", count); + for i in 0..count { + print!("{} {}", Bg(AnsiValue(i as u8)), Bg(AnsiValue(0))); + } + println!(); +} diff -Nru distinst-0.1.0/vendor/termion/examples/is_tty.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/is_tty.rs --- distinst-0.1.0/vendor/termion/examples/is_tty.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/is_tty.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,11 @@ +extern crate termion; + +use std::fs; + +fn main() { + if termion::is_tty(&fs::File::create("/dev/stdout").unwrap()) { + println!("This is a TTY!"); + } else { + println!("This is not a TTY :("); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/keys.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/keys.rs --- distinst-0.1.0/vendor/termion/examples/keys.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/keys.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,44 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = stdout().into_raw_mode().unwrap(); + + write!(stdout, + "{}{}q to exit. Type stuff, use alt, and so on.{}", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Hide) + .unwrap(); + stdout.flush().unwrap(); + + for c in stdin.keys() { + write!(stdout, + "{}{}", + termion::cursor::Goto(1, 1), + termion::clear::CurrentLine) + .unwrap(); + + match c.unwrap() { + Key::Char('q') => break, + Key::Char(c) => println!("{}", c), + Key::Alt(c) => println!("^{}", c), + Key::Ctrl(c) => println!("*{}", c), + Key::Esc => println!("ESC"), + Key::Left => println!("←"), + Key::Right => println!("→"), + Key::Up => println!("↑"), + Key::Down => println!("↓"), + Key::Backspace => println!("×"), + _ => {} + } + stdout.flush().unwrap(); + } + + write!(stdout, "{}", termion::cursor::Show).unwrap(); +} diff -Nru distinst-0.1.0/vendor/termion/examples/mouse.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/mouse.rs --- distinst-0.1.0/vendor/termion/examples/mouse.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/mouse.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,46 @@ +extern crate termion; + +use termion::event::*; +use termion::cursor::{self, DetectCursorPos}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{self, Write}; + +fn main() { + let stdin = io::stdin(); + let mut stdout = MouseTerminal::from(io::stdout().into_raw_mode().unwrap()); + + writeln!(stdout, + "{}{}q to exit. Type stuff, use alt, click around...", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, a, b) | + MouseEvent::Release(a, b) | + MouseEvent::Hold(a, b) => { + write!(stdout, "{}", cursor::Goto(a, b)).unwrap(); + let (x, y) = stdout.cursor_pos().unwrap(); + write!(stdout, + "{}{}Cursor is at: ({},{}){}", + cursor::Goto(5, 5), + termion::clear::UntilNewline, + x, + y, + cursor::Goto(a, b)) + .unwrap(); + } + } + } + _ => {} + } + + stdout.flush().unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/rainbow.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/rainbow.rs --- distinst-0.1.0/vendor/termion/examples/rainbow.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/rainbow.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,60 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn rainbow(stdout: &mut W, blue: u8) { + write!(stdout, + "{}{}", + termion::cursor::Goto(1, 1), + termion::clear::All) + .unwrap(); + + for red in 0..32 { + let red = red * 8; + for green in 0..64 { + let green = green * 4; + write!(stdout, + "{} ", + termion::color::Bg(termion::color::Rgb(red, green, blue))) + .unwrap(); + } + write!(stdout, "\n\r").unwrap(); + } + + writeln!(stdout, "{}b = {}", termion::style::Reset, blue).unwrap(); +} + +fn main() { + let stdin = stdin(); + let mut stdout = stdout().into_raw_mode().unwrap(); + + writeln!(stdout, + "{}{}{}Use the up/down arrow keys to change the blue in the rainbow.", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Hide) + .unwrap(); + + let mut blue = 172u8; + + for c in stdin.keys() { + match c.unwrap() { + Key::Up => { + blue = blue.saturating_add(4); + rainbow(&mut stdout, blue); + } + Key::Down => { + blue = blue.saturating_sub(4); + rainbow(&mut stdout, blue); + } + Key::Char('q') => break, + _ => {} + } + stdout.flush().unwrap(); + } + + write!(stdout, "{}", termion::cursor::Show).unwrap(); +} diff -Nru distinst-0.1.0/vendor/termion/examples/read.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/read.rs --- distinst-0.1.0/vendor/termion/examples/read.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/read.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,23 @@ +extern crate termion; + +use termion::input::TermRead; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock(); + let stdin = stdin(); + let mut stdin = stdin.lock(); + + stdout.write_all(b"password: ").unwrap(); + stdout.flush().unwrap(); + + let pass = stdin.read_passwd(&mut stdout); + + if let Ok(Some(pass)) = pass { + stdout.write_all(pass.as_bytes()).unwrap(); + stdout.write_all(b"\n").unwrap(); + } else { + stdout.write_all(b"Error\n").unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/rustc_fun.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/rustc_fun.rs --- distinst-0.1.0/vendor/termion/examples/rustc_fun.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/rustc_fun.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,24 @@ +extern crate termion; + +use termion::{color, style}; + +fn main() { + println!("{lighgreen}-- src/test/ui/borrow-errors.rs at 82:18 --\n\ + {red}error: {reset}{bold}two closures require unique access to `vec` at the same time {reset}{bold}{magenta}[E0524]{reset}\n\ + {line_num_fg}{line_num_bg}79 {reset} let append = |e| {{\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}first closure is constructed here\n\ + {line_num_fg}{line_num_bg}80 {reset} vec.push(e)\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}previous borrow occurs due to use of `vec` in closure\n\ + {line_num_fg}{line_num_bg}84 {reset} }};\n\ + {line_num_fg}{line_num_bg}85 {reset} }}\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^{reset} {error_fg}borrow from first closure ends here", + lighgreen = color::Fg(color::LightGreen), + red = color::Fg(color::Red), + bold = style::Bold, + reset = style::Reset, + magenta = color::Fg(color::Magenta), + line_num_bg = color::Bg(color::AnsiValue::grayscale(3)), + line_num_fg = color::Fg(color::AnsiValue::grayscale(18)), + info_line = "| ", + error_fg = color::Fg(color::AnsiValue::grayscale(17))) +} diff -Nru distinst-0.1.0/vendor/termion/examples/simple.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/simple.rs --- distinst-0.1.0/vendor/termion/examples/simple.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/simple.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,42 @@ +extern crate termion; + +use termion::color; +use termion::raw::IntoRawMode; +use std::io::{Read, Write, stdout, stdin}; + +fn main() { + // Initialize 'em all. + let stdout = stdout(); + let mut stdout = stdout.lock().into_raw_mode().unwrap(); + let stdin = stdin(); + let stdin = stdin.lock(); + + write!(stdout, + "{}{}{}yo, 'q' will exit.{}{}", + termion::clear::All, + termion::cursor::Goto(5, 5), + termion::style::Bold, + termion::style::Reset, + termion::cursor::Goto(20, 10)) + .unwrap(); + stdout.flush().unwrap(); + + let mut bytes = stdin.bytes(); + loop { + let b = bytes.next().unwrap().unwrap(); + + match b { + // Quit + b'q' => return, + // Clear the screen + b'c' => write!(stdout, "{}", termion::clear::All), + // Set red color + b'r' => write!(stdout, "{}", color::Fg(color::Rgb(5, 0, 0))), + // Write it to stdout. + a => write!(stdout, "{}", a), + } + .unwrap(); + + stdout.flush().unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/examples/size.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/size.rs --- distinst-0.1.0/vendor/termion/examples/size.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/size.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,7 @@ +extern crate termion; + +use termion::terminal_size; + +fn main() { + println!("Size is {:?}", terminal_size().unwrap()) +} diff -Nru distinst-0.1.0/vendor/termion/examples/truecolor.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/truecolor.rs --- distinst-0.1.0/vendor/termion/examples/truecolor.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/examples/truecolor.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,12 @@ +extern crate termion; + +use termion::{color, cursor, clear}; +use std::{thread, time}; + +fn main() { + for r in 0..255 { + let c = color::Rgb(r, !r, 2 * ((r % 128) as i8 - 64).abs() as u8); + println!("{}{}{}wow", cursor::Goto(1, 1), color::Bg(c), clear::All); + thread::sleep(time::Duration::from_millis(100)); + } +} diff -Nru distinst-0.1.0/vendor/termion/LICENSE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/LICENSE --- distinst-0.1.0/vendor/termion/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/LICENSE 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Ticki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -Nru distinst-0.1.0/vendor/termion/logo.svg distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/logo.svg --- distinst-0.1.0/vendor/termion/logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/logo.svg 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + diff -Nru distinst-0.1.0/vendor/termion/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/README.md --- distinst-0.1.0/vendor/termion/README.md 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,181 @@ +

+Termion logo +

+ +[![Build Status](https://travis-ci.org/ticki/termion.svg?branch=master)](https://travis-ci.org/ticki/termion) [![Latest Version](https://img.shields.io/crates/v/termion.svg)](https://crates.io/crates/termion) | [Documentation](https://docs.rs/termion) | [Examples](https://github.com/Ticki/termion/tree/master/examples) | [Changelog](https://github.com/Ticki/termion/tree/master/CHANGELOG.md) | [Tutorial](http://ticki.github.io/blog/making-terminal-applications-in-rust-with-termion/) +|----|----|----|----|---- + + +**Termion** is a pure Rust, bindless library for low-level handling, manipulating +and reading information about terminals. This provides a full-featured +alternative to Termbox. + +Termion aims to be simple and yet expressive. It is bindless, meaning that it +is not a front-end to some other library (e.g., ncurses or termbox), but a +standalone library directly talking to the TTY. + +Termion is quite convenient, due to its complete coverage of essential TTY +features, providing one consistent API. Termion is rather low-level containing +only abstraction aligned with what actually happens behind the scenes. For +something more high-level, refer to inquirer-rs, which uses Termion as backend. + +Termion generates escapes and API calls for the user. This makes it a whole lot +cleaner to use escapes. + +Supports Redox, Mac OS X, BSD, and Linux (or, in general, ANSI terminals). + +## A note on stability + +This crate is stable. + +## Cargo.toml + +```toml +[dependencies] +termion = "*" +``` + +## 0.1.0 to 1.0.0 guide + +This sample table gives an idea of how to go about converting to the new major +version of Termion. + +| 0.1.0 | 1.0.0 +|--------------------------------|--------------------------- +| `use termion::IntoRawMode` | `use termion::raw::IntoRawMode` +| `use termion::TermRead` | `use termion::input::TermRead` +| `stdout.color(color::Red);` | `write!(stdout, "{}", color::Fg(color::Red));` +| `stdout.color_bg(color::Red);` | `write!(stdout, "{}", color::Bg(color::Red));` +| `stdout.goto(x, y);` | `write!(stdout, "{}", cursor::Goto(x, y));` +| `color::rgb(r, g, b);` | `color::Rgb(r, g, b)` (truecolor) +| `x.with_mouse()` | `MouseTerminal::from(x)` + +## Features + +- Raw mode. +- TrueColor. +- 256-color mode. +- Cursor movement. +- Text formatting. +- Console size. +- TTY-only stream. +- Control sequences. +- Termios control. +- Password input. +- Redox support. +- Safe `isatty` wrapper. +- Panic-free error handling. +- Special keys events (modifiers, special keys, etc.). +- Allocation-free. +- Asynchronous key events. +- Mouse input. +- Carefully tested. +- Detailed documentation on every item. + +and much more. + +## Examples + +### Style and colors. + +```rust +extern crate termion; + +use termion::{color, style}; + +use std::io; + +fn main() { + println!("{}Red", color::Fg(color::Red)); + println!("{}Blue", color::Fg(color::Blue)); + println!("{}Blue'n'Bold{}", style::Bold, style::Reset); + println!("{}Just plain italic", style::Italic); +} +``` + +### Moving the cursor + +```rust +extern crate termion; + +fn main() { + print!("{}{}Stuff", termion::clear::All, termion::cursor::Goto(1, 1)); +} + +``` + +### Mouse + +```rust +extern crate termion; + +use termion::event::{Key, Event, MouseEvent}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = MouseTerminal::from(stdout().into_raw_mode().unwrap()); + + write!(stdout, "{}{}q to exit. Click, click, click!", termion::clear::All, termion::cursor::Goto(1, 1)).unwrap(); + stdout.flush().unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, x, y) => { + write!(stdout, "{}x", termion::cursor::Goto(x, y)).unwrap(); + }, + _ => (), + } + } + _ => {} + } + stdout.flush().unwrap(); + } +} +``` + +### Read a password + +```rust +extern crate termion; + +use termion::input::TermRead; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock(); + let stdin = stdin(); + let mut stdin = stdin.lock(); + + stdout.write_all(b"password: ").unwrap(); + stdout.flush().unwrap(); + + let pass = stdin.read_passwd(&mut stdout); + + if let Ok(Some(pass)) = pass { + stdout.write_all(pass.as_bytes()).unwrap(); + stdout.write_all(b"\n").unwrap(); + } else { + stdout.write_all(b"Error\n").unwrap(); + } +} +``` + +## Usage + +See `examples/`, and the documentation, which can be rendered using `cargo doc`. + +For a more complete example, see [a minesweeper implementation](https://github.com/redox-os/games-for-redox/blob/master/src/minesweeper/main.rs), that I made for Redox using termion. + + + +## License + +MIT/X11. diff -Nru distinst-0.1.0/vendor/termion/src/async.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/async.rs --- distinst-0.1.0/vendor/termion/src/async.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/async.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,78 @@ +use std::io::{self, Read}; +use std::sync::mpsc; +use std::thread; + +use sys::tty::get_tty; + +/// Construct an asynchronous handle to the TTY standard input. +/// +/// This allows you to read from standard input _without blocking_ the current thread. +/// Specifically, it works by firing up another thread to handle the event stream, which will then +/// be buffered in a mpsc queue, which will eventually be read by the current thread. +/// +/// This will not read the piped standard input, but rather read from the TTY device, since reading +/// asyncronized from piped input would rarely make sense. In other words, if you pipe standard +/// output from another process, it won't be reflected in the stream returned by this function, as +/// this represents the TTY device, and not the piped standard input. +pub fn async_stdin() -> AsyncReader { + let (send, recv) = mpsc::channel(); + + thread::spawn(move || for i in get_tty().unwrap().bytes() { + if send.send(i).is_err() { + return; + } + }); + + AsyncReader { recv: recv } +} + +/// An asynchronous reader. +/// +/// This acts as any other stream, with the exception that reading from it won't block. Instead, +/// the buffer will only be partially updated based on how much the internal buffer holds. +pub struct AsyncReader { + /// The underlying mpsc receiver. + recv: mpsc::Receiver>, +} + +// FIXME: Allow constructing an async reader from an arbitrary stream. + +impl Read for AsyncReader { + /// Read from the byte stream. + /// + /// This will never block, but try to drain the event queue until empty. If the total number of + /// bytes written is lower than the buffer's length, the event queue is empty or that the event + /// stream halted. + fn read(&mut self, buf: &mut [u8]) -> io::Result { + let mut total = 0; + + loop { + if total >= buf.len() { + break; + } + + match self.recv.try_recv() { + Ok(Ok(b)) => { + buf[total] = b; + total += 1; + } + Ok(Err(e)) => return Err(e), + Err(_) => break, + } + } + + Ok(total) + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::Read; + + #[test] + fn test_async_stdin() { + let stdin = async_stdin(); + stdin.bytes().next(); + } +} diff -Nru distinst-0.1.0/vendor/termion/src/clear.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/clear.rs --- distinst-0.1.0/vendor/termion/src/clear.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/clear.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,9 @@ +//! Clearing the screen. + +use std::fmt; + +derive_csi_sequence!("Clear the entire screen.", All, "2J"); +derive_csi_sequence!("Clear everything after the cursor.", AfterCursor, "J"); +derive_csi_sequence!("Clear everything before the cursor.", BeforeCursor, "1J"); +derive_csi_sequence!("Clear the current line.", CurrentLine, "2K"); +derive_csi_sequence!("Clear from cursor to newline.", UntilNewline, "K"); diff -Nru distinst-0.1.0/vendor/termion/src/color.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/color.rs --- distinst-0.1.0/vendor/termion/src/color.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/color.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,242 @@ +//! Color managemement. +//! +//! # Example +//! +//! ```rust +//! use termion::color; +//! +//! fn main() { +//! println!("{}Red", color::Fg(color::Red)); +//! println!("{}Blue", color::Fg(color::Blue)); +//! println!("{}Back again", color::Fg(color::Reset)); +//! } +//! ``` + +use std::fmt; +use raw::CONTROL_SEQUENCE_TIMEOUT; +use std::io::{self, Write, Read}; +use std::time::{SystemTime, Duration}; +use async::async_stdin; +use std::env; + +/// A terminal color. +pub trait Color { + /// Write the foreground version of this color. + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result; + /// Write the background version of this color. + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result; +} + +macro_rules! derive_color { + ($doc:expr, $name:ident, $value:expr) => { + #[doc = $doc] + #[derive(Copy, Clone, Debug)] + pub struct $name; + + impl Color for $name { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("38;5;", $value, "m")) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("48;5;", $value, "m")) + } + } + }; +} + +derive_color!("Black.", Black, "0"); +derive_color!("Red.", Red, "1"); +derive_color!("Green.", Green, "2"); +derive_color!("Yellow.", Yellow, "3"); +derive_color!("Blue.", Blue, "4"); +derive_color!("Magenta.", Magenta, "5"); +derive_color!("Cyan.", Cyan, "6"); +derive_color!("White.", White, "7"); +derive_color!("High-intensity light black.", LightBlack, "8"); +derive_color!("High-intensity light red.", LightRed, "9"); +derive_color!("High-intensity light green.", LightGreen, "10"); +derive_color!("High-intensity light yellow.", LightYellow, "11"); +derive_color!("High-intensity light blue.", LightBlue, "12"); +derive_color!("High-intensity light magenta.", LightMagenta, "13"); +derive_color!("High-intensity light cyan.", LightCyan, "14"); +derive_color!("High-intensity light white.", LightWhite, "15"); + +impl<'a> Color for &'a Color { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + (*self).write_fg(f) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + (*self).write_bg(f) + } +} + +/// An arbitrary ANSI color value. +#[derive(Clone, Copy, Debug)] +pub struct AnsiValue(pub u8); + +impl AnsiValue { + /// 216-color (r, g, b ≤ 5) RGB. + pub fn rgb(r: u8, g: u8, b: u8) -> AnsiValue { + debug_assert!(r <= 5, + "Red color fragment (r = {}) is out of bound. Make sure r ≤ 5.", + r); + debug_assert!(g <= 5, + "Green color fragment (g = {}) is out of bound. Make sure g ≤ 5.", + g); + debug_assert!(b <= 5, + "Blue color fragment (b = {}) is out of bound. Make sure b ≤ 5.", + b); + + AnsiValue(16 + 36 * r + 6 * g + b) + } + + /// Grayscale color. + /// + /// There are 24 shades of gray. + pub fn grayscale(shade: u8) -> AnsiValue { + // Unfortunately, there are a little less than fifty shades. + debug_assert!(shade < 24, + "Grayscale out of bound (shade = {}). There are only 24 shades of \ + gray.", + shade); + + AnsiValue(0xE8 + shade) + } +} + +impl Color for AnsiValue { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("38;5;{}m"), self.0) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("48;5;{}m"), self.0) + } +} + +/// A truecolor RGB. +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Rgb(pub u8, pub u8, pub u8); + +impl Color for Rgb { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("38;2;{};{};{}m"), self.0, self.1, self.2) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("48;2;{};{};{}m"), self.0, self.1, self.2) + } +} + +/// Reset colors to defaults. +#[derive(Debug, Clone, Copy)] +pub struct Reset; + +impl Color for Reset { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("39m")) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("49m")) + } +} + +/// A foreground color. +#[derive(Debug, Clone, Copy)] +pub struct Fg(pub C); + +impl fmt::Display for Fg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.write_fg(f) + } +} + +/// A background color. +#[derive(Debug, Clone, Copy)] +pub struct Bg(pub C); + +impl fmt::Display for Bg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.write_bg(f) + } +} + +/// Types that allow detection of the colors they support. +pub trait DetectColors { + /// How many ANSI colors are supported (from 8 to 256)? + /// + /// Beware: the information given isn't authoritative, it's infered through escape codes or the + /// value of `TERM`, more colors may be available. + fn available_colors(&mut self) -> io::Result; +} + +impl DetectColors for W { + fn available_colors(&mut self) -> io::Result { + let mut stdin = async_stdin(); + + if detect_color(self, &mut stdin, 0)? { + // OSC 4 is supported, detect how many colors there are. + // Do a binary search of the last supported color. + let mut min = 8; + let mut max = 256; + let mut i; + while min + 1 < max { + i = (min + max) / 2; + if detect_color(self, &mut stdin, i)? { + min = i + } else { + max = i + } + } + Ok(max) + } else { + // OSC 4 is not supported, trust TERM contents. + Ok(match env::var_os("TERM") { + Some(val) => { + if val.to_str().unwrap_or("").contains("256color") { + 256 + } else { + 8 + } + } + None => 8, + }) + } + } +} + +/// Detect a color using OSC 4. +fn detect_color(stdout: &mut Write, stdin: &mut Read, color: u16) -> io::Result { + // Is the color available? + // Use `ESC ] 4 ; color ; ? BEL`. + write!(stdout, "\x1B]4;{};?\x07", color)?; + stdout.flush()?; + + let mut buf: [u8; 1] = [0]; + let mut total_read = 0; + + let timeout = Duration::from_millis(CONTROL_SEQUENCE_TIMEOUT); + let now = SystemTime::now(); + let bell = 7u8; + + // Either consume all data up to bell or wait for a timeout. + while buf[0] != bell && now.elapsed().unwrap() < timeout { + total_read += stdin.read(&mut buf)?; + } + + // If there was a response, the color is supported. + Ok(total_read > 0) +} diff -Nru distinst-0.1.0/vendor/termion/src/cursor.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/cursor.rs --- distinst-0.1.0/vendor/termion/src/cursor.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/cursor.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,140 @@ +//! Cursor movement. + +use std::fmt; +use std::io::{self, Write, Error, ErrorKind, Read}; +use async::async_stdin; +use std::time::{SystemTime, Duration}; +use raw::CONTROL_SEQUENCE_TIMEOUT; + +derive_csi_sequence!("Hide the cursor.", Hide, "?25l"); +derive_csi_sequence!("Show the cursor.", Show, "?25h"); + +derive_csi_sequence!("Restore the cursor.", Restore, "u"); +derive_csi_sequence!("Save the cursor.", Save, "s"); + +/// Goto some position ((1,1)-based). +/// +/// # Why one-based? +/// +/// ANSI escapes are very poorly designed, and one of the many odd aspects is being one-based. This +/// can be quite strange at first, but it is not that big of an obstruction once you get used to +/// it. +/// +/// # Example +/// +/// ```rust +/// extern crate termion; +/// +/// fn main() { +/// print!("{}{}Stuff", termion::clear::All, termion::cursor::Goto(5, 3)); +/// } +/// ``` +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Goto(pub u16, pub u16); + +impl Default for Goto { + fn default() -> Goto { + Goto(1, 1) + } +} + +impl fmt::Display for Goto { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + debug_assert!(self != &Goto(0, 0), "Goto is one-based."); + + write!(f, csi!("{};{}H"), self.1, self.0) + } +} + +/// Move cursor left. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Left(pub u16); + +impl fmt::Display for Left { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}D"), self.0) + } +} + +/// Move cursor right. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Right(pub u16); + +impl fmt::Display for Right { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}C"), self.0) + } +} + +/// Move cursor up. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Up(pub u16); + +impl fmt::Display for Up { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}A"), self.0) + } +} + +/// Move cursor down. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Down(pub u16); + +impl fmt::Display for Down { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}B"), self.0) + } +} + +/// Types that allow detection of the cursor position. +pub trait DetectCursorPos { + /// Get the (1,1)-based cursor position from the terminal. + fn cursor_pos(&mut self) -> io::Result<(u16, u16)>; +} + +impl DetectCursorPos for W { + fn cursor_pos(&mut self) -> io::Result<(u16, u16)> { + let mut stdin = async_stdin(); + + // Where is the cursor? + // Use `ESC [ 6 n`. + write!(self, "\x1B[6n")?; + self.flush()?; + + let mut buf: [u8; 1] = [0]; + let mut read_chars = Vec::new(); + + let timeout = Duration::from_millis(CONTROL_SEQUENCE_TIMEOUT); + let now = SystemTime::now(); + + // Either consume all data up to R or wait for a timeout. + while buf[0] != b'R' && now.elapsed().unwrap() < timeout { + if stdin.read(&mut buf)? > 0 { + read_chars.push(buf[0]); + } + } + + if read_chars.len() == 0 { + return Err(Error::new(ErrorKind::Other, "Cursor position detection timed out.")); + } + + // The answer will look like `ESC [ Cy ; Cx R`. + + read_chars.pop(); // remove trailing R. + let read_str = String::from_utf8(read_chars).unwrap(); + let beg = read_str.rfind('[').unwrap(); + let coords: String = read_str.chars().skip(beg + 1).collect(); + let mut nums = coords.split(';'); + + let cy = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cx = nums.next() + .unwrap() + .parse::() + .unwrap(); + + Ok((cx, cy)) + } +} diff -Nru distinst-0.1.0/vendor/termion/src/event.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/event.rs --- distinst-0.1.0/vendor/termion/src/event.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/event.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,351 @@ +//! Mouse and key events. + +use std::io::{Error, ErrorKind}; +use std::ascii::AsciiExt; +use std::str; + +/// An event reported by the terminal. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Event { + /// A key press. + Key(Key), + /// A mouse button press, release or wheel use at specific coordinates. + Mouse(MouseEvent), + /// An event that cannot currently be evaluated. + Unsupported(Vec), +} + +/// A mouse related event. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum MouseEvent { + /// A mouse button was pressed. + /// + /// The coordinates are one-based. + Press(MouseButton, u16, u16), + /// A mouse button was released. + /// + /// The coordinates are one-based. + Release(u16, u16), + /// A mouse button is held over the given coordinates. + /// + /// The coordinates are one-based. + Hold(u16, u16), +} + +/// A mouse button. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum MouseButton { + /// The left mouse button. + Left, + /// The right mouse button. + Right, + /// The middle mouse button. + Middle, + /// Mouse wheel is going up. + /// + /// This event is typically only used with Mouse::Press. + WheelUp, + /// Mouse wheel is going down. + /// + /// This event is typically only used with Mouse::Press. + WheelDown, +} + +/// A key. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum Key { + /// Backspace. + Backspace, + /// Left arrow. + Left, + /// Right arrow. + Right, + /// Up arrow. + Up, + /// Down arrow. + Down, + /// Home key. + Home, + /// End key. + End, + /// Page Up key. + PageUp, + /// Page Down key. + PageDown, + /// Delete key. + Delete, + /// Insert key. + Insert, + /// Function keys. + /// + /// Only function keys 1 through 12 are supported. + F(u8), + /// Normal character. + Char(char), + /// Alt modified character. + Alt(char), + /// Ctrl modified character. + /// + /// Note that certain keys may not be modifiable with `ctrl`, due to limitations of terminals. + Ctrl(char), + /// Null byte. + Null, + /// Esc key. + Esc, + + #[doc(hidden)] + __IsNotComplete, +} + +/// Parse an Event from `item` and possibly subsequent bytes through `iter`. +pub fn parse_event(item: u8, iter: &mut I) -> Result + where I: Iterator> +{ + let error = Error::new(ErrorKind::Other, "Could not parse an event"); + match item { + b'\x1B' => { + // This is an escape character, leading a control sequence. + Ok(match iter.next() { + Some(Ok(b'O')) => { + match iter.next() { + // F1-F4 + Some(Ok(val @ b'P'...b'S')) => Event::Key(Key::F(1 + val - b'P')), + _ => return Err(error), + } + } + Some(Ok(b'[')) => { + // This is a CSI sequence. + parse_csi(iter).ok_or(error)? + } + Some(Ok(c)) => { + let ch = parse_utf8_char(c, iter); + Event::Key(Key::Alt(try!(ch))) + } + Some(Err(_)) | None => return Err(error), + }) + } + b'\n' | b'\r' => Ok(Event::Key(Key::Char('\n'))), + b'\t' => Ok(Event::Key(Key::Char('\t'))), + b'\x7F' => Ok(Event::Key(Key::Backspace)), + c @ b'\x01'...b'\x1A' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1 + b'a') as char))), + c @ b'\x1C'...b'\x1F' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1C + b'4') as char))), + b'\0' => Ok(Event::Key(Key::Null)), + c => { + Ok({ + let ch = parse_utf8_char(c, iter); + Event::Key(Key::Char(try!(ch))) + }) + } + } +} + +/// Parses a CSI sequence, just after reading ^[ +/// +/// Returns None if an unrecognized sequence is found. +fn parse_csi(iter: &mut I) -> Option + where I: Iterator> +{ + Some(match iter.next() { + Some(Ok(b'[')) => match iter.next() { + Some(Ok(val @ b'A'...b'E')) => Event::Key(Key::F(1 + val - b'A')), + _ => return None, + }, + Some(Ok(b'D')) => Event::Key(Key::Left), + Some(Ok(b'C')) => Event::Key(Key::Right), + Some(Ok(b'A')) => Event::Key(Key::Up), + Some(Ok(b'B')) => Event::Key(Key::Down), + Some(Ok(b'H')) => Event::Key(Key::Home), + Some(Ok(b'F')) => Event::Key(Key::End), + Some(Ok(b'M')) => { + // X10 emulation mouse encoding: ESC [ CB Cx Cy (6 characters only). + let mut next = || iter.next().unwrap().unwrap(); + + let cb = next() as i8 - 32; + // (1, 1) are the coords for upper left. + let cx = next().saturating_sub(32) as u16; + let cy = next().saturating_sub(32) as u16; + Event::Mouse(match cb & 0b11 { + 0 => { + if cb & 0x40 != 0 { + MouseEvent::Press(MouseButton::WheelUp, cx, cy) + } else { + MouseEvent::Press(MouseButton::Left, cx, cy) + } + } + 1 => { + if cb & 0x40 != 0 { + MouseEvent::Press(MouseButton::WheelDown, cx, cy) + } else { + MouseEvent::Press(MouseButton::Middle, cx, cy) + } + } + 2 => MouseEvent::Press(MouseButton::Right, cx, cy), + 3 => MouseEvent::Release(cx, cy), + _ => return None, + }) + } + Some(Ok(b'<')) => { + // xterm mouse encoding: + // ESC [ < Cb ; Cx ; Cy (;) (M or m) + let mut buf = Vec::new(); + let mut c = iter.next().unwrap().unwrap(); + while match c { + b'm' | b'M' => false, + _ => true, + } { + buf.push(c); + c = iter.next().unwrap().unwrap(); + } + let str_buf = String::from_utf8(buf).unwrap(); + let nums = &mut str_buf.split(';'); + + let cb = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cx = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cy = nums.next() + .unwrap() + .parse::() + .unwrap(); + + let event = match cb { + 0...2 | 64...65 => { + let button = match cb { + 0 => MouseButton::Left, + 1 => MouseButton::Middle, + 2 => MouseButton::Right, + 64 => MouseButton::WheelUp, + 65 => MouseButton::WheelDown, + _ => unreachable!(), + }; + match c { + b'M' => MouseEvent::Press(button, cx, cy), + b'm' => MouseEvent::Release(cx, cy), + _ => return None, + } + } + 32 => MouseEvent::Hold(cx, cy), + 3 => MouseEvent::Release(cx, cy), + _ => return None, + }; + + Event::Mouse(event) + } + Some(Ok(c @ b'0'...b'9')) => { + // Numbered escape code. + let mut buf = Vec::new(); + buf.push(c); + let mut c = iter.next().unwrap().unwrap(); + // The final byte of a CSI sequence can be in the range 64-126, so + // let's keep reading anything else. + while c < 64 || c > 126 { + buf.push(c); + c = iter.next().unwrap().unwrap(); + } + + match c { + // rxvt mouse encoding: + // ESC [ Cb ; Cx ; Cy ; M + b'M' => { + let str_buf = String::from_utf8(buf).unwrap(); + + let nums: Vec = str_buf.split(';').map(|n| n.parse().unwrap()).collect(); + + let cb = nums[0]; + let cx = nums[1]; + let cy = nums[2]; + + let event = match cb { + 32 => MouseEvent::Press(MouseButton::Left, cx, cy), + 33 => MouseEvent::Press(MouseButton::Middle, cx, cy), + 34 => MouseEvent::Press(MouseButton::Right, cx, cy), + 35 => MouseEvent::Release(cx, cy), + 64 => MouseEvent::Hold(cx, cy), + 96 | 97 => MouseEvent::Press(MouseButton::WheelUp, cx, cy), + _ => return None, + }; + + Event::Mouse(event) + } + // Special key code. + b'~' => { + let str_buf = String::from_utf8(buf).unwrap(); + + // This CSI sequence can be a list of semicolon-separated + // numbers. + let nums: Vec = str_buf.split(';').map(|n| n.parse().unwrap()).collect(); + + if nums.is_empty() { + return None; + } + + // TODO: handle multiple values for key modififiers (ex: values + // [3, 2] means Shift+Delete) + if nums.len() > 1 { + return None; + } + + match nums[0] { + 1 | 7 => Event::Key(Key::Home), + 2 => Event::Key(Key::Insert), + 3 => Event::Key(Key::Delete), + 4 | 8 => Event::Key(Key::End), + 5 => Event::Key(Key::PageUp), + 6 => Event::Key(Key::PageDown), + v @ 11...15 => Event::Key(Key::F(v - 10)), + v @ 17...21 => Event::Key(Key::F(v - 11)), + v @ 23...24 => Event::Key(Key::F(v - 12)), + _ => return None, + } + } + _ => return None, + } + } + _ => return None, + }) + +} + +/// Parse `c` as either a single byte ASCII char or a variable size UTF-8 char. +fn parse_utf8_char(c: u8, iter: &mut I) -> Result + where I: Iterator> +{ + let error = Err(Error::new(ErrorKind::Other, "Input character is not valid UTF-8")); + if c.is_ascii() { + Ok(c as char) + } else { + let bytes = &mut Vec::new(); + bytes.push(c); + + loop { + match iter.next() { + Some(Ok(next)) => { + bytes.push(next); + if let Ok(st) = str::from_utf8(bytes) { + return Ok(st.chars().next().unwrap()); + } + if bytes.len() >= 4 { + return error; + } + } + _ => return error, + } + } + } +} + +#[cfg(test)] +#[test] +fn test_parse_utf8() { + let st = "abcéŷ¤£€ù%323"; + let ref mut bytes = st.bytes().map(|x| Ok(x)); + let chars = st.chars(); + for c in chars { + let b = bytes.next().unwrap().unwrap(); + assert!(c == parse_utf8_char(b, bytes).unwrap()); + } +} diff -Nru distinst-0.1.0/vendor/termion/src/input.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/input.rs --- distinst-0.1.0/vendor/termion/src/input.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/input.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,388 @@ +//! User input. + +use std::io::{self, Read, Write}; +use std::ops; + +use event::{self, Event, Key}; +use raw::IntoRawMode; + +/// An iterator over input keys. +pub struct Keys { + iter: Events, +} + +impl Iterator for Keys { + type Item = Result; + + fn next(&mut self) -> Option> { + loop { + match self.iter.next() { + Some(Ok(Event::Key(k))) => return Some(Ok(k)), + Some(Ok(_)) => continue, + e @ Some(Err(_)) => e, + None => return None, + }; + } + } +} + +/// An iterator over input events. +pub struct Events { + inner: EventsAndRaw +} + +impl Iterator for Events { + type Item = Result; + + fn next(&mut self) -> Option> { + self.inner.next().map(|tuple| tuple.map(|(event, _raw)| event)) + } +} + +/// An iterator over input events and the bytes that define them. +pub struct EventsAndRaw { + source: R, + leftover: Option, +} + +impl Iterator for EventsAndRaw { + type Item = Result<(Event, Vec), io::Error>; + + fn next(&mut self) -> Option), io::Error>> { + let mut source = &mut self.source; + + if let Some(c) = self.leftover { + // we have a leftover byte, use it + self.leftover = None; + return Some(parse_event(c, &mut source.bytes())); + } + + // Here we read two bytes at a time. We need to distinguish between single ESC key presses, + // and escape sequences (which start with ESC or a x1B byte). The idea is that if this is + // an escape sequence, we will read multiple bytes (the first byte being ESC) but if this + // is a single ESC keypress, we will only read a single byte. + let mut buf = [0u8; 2]; + let res = match source.read(&mut buf) { + Ok(0) => return None, + Ok(1) => { + match buf[0] { + b'\x1B' => Ok((Event::Key(Key::Esc), vec![b'\x1B'])), + c => parse_event(c, &mut source.bytes()), + } + } + Ok(2) => { + let mut option_iter = &mut Some(buf[1]).into_iter(); + let result = { + let mut iter = option_iter.map(|c| Ok(c)).chain(source.bytes()); + parse_event(buf[0], &mut iter) + }; + // If the option_iter wasn't consumed, keep the byte for later. + self.leftover = option_iter.next(); + result + } + Ok(_) => unreachable!(), + Err(e) => Err(e), + }; + + Some(res) + } +} + +fn parse_event(item: u8, iter: &mut I) -> Result<(Event, Vec), io::Error> + where I: Iterator> +{ + let mut buf = vec![item]; + let result = { + let mut iter = iter.inspect(|byte| if let &Ok(byte) = byte { + buf.push(byte); + }); + event::parse_event(item, &mut iter) + }; + result.or(Ok(Event::Unsupported(buf.clone()))).map(|e| (e, buf)) +} + + +/// Extension to `Read` trait. +pub trait TermRead { + /// An iterator over input events. + fn events(self) -> Events where Self: Sized; + + /// An iterator over key inputs. + fn keys(self) -> Keys where Self: Sized; + + /// Read a line. + /// + /// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will + /// complete the input. + fn read_line(&mut self) -> io::Result>; + + /// Read a password. + /// + /// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will + /// complete the input. + fn read_passwd(&mut self, writer: &mut W) -> io::Result> { + let _raw = try!(writer.into_raw_mode()); + self.read_line() + } +} + + +impl TermRead for R { + fn events(self) -> Events { + Events { + inner: self.events_and_raw() + } + } + fn keys(self) -> Keys { + Keys { iter: self.events() } + } + + fn read_line(&mut self) -> io::Result> { + let mut buf = Vec::with_capacity(30); + + for c in self.bytes() { + match c { + Err(e) => return Err(e), + Ok(0) | Ok(3) | Ok(4) => return Ok(None), + Ok(0x7f) => { + buf.pop(); + } + Ok(b'\n') | Ok(b'\r') => break, + Ok(c) => buf.push(c), + } + } + + let string = try!(String::from_utf8(buf) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))); + Ok(Some(string)) + } +} + +/// Extension to `TermRead` trait. A separate trait in order to maintain backwards compatibility. +pub trait TermReadEventsAndRaw { + /// An iterator over input events and the bytes that define them. + fn events_and_raw(self) -> EventsAndRaw where Self: Sized; +} + +impl TermReadEventsAndRaw for R { + fn events_and_raw(self) -> EventsAndRaw { + EventsAndRaw { + source: self, + leftover: None, + } + } +} + +/// A sequence of escape codes to enable terminal mouse support. +const ENTER_MOUSE_SEQUENCE: &'static str = csi!("?1000h\x1b[?1002h\x1b[?1015h\x1b[?1006h"); + +/// A sequence of escape codes to disable terminal mouse support. +const EXIT_MOUSE_SEQUENCE: &'static str = csi!("?1006l\x1b[?1015l\x1b[?1002l\x1b[?1000l"); + +/// A terminal with added mouse support. +/// +/// This can be obtained through the `From` implementations. +pub struct MouseTerminal { + term: W, +} + +impl From for MouseTerminal { + fn from(mut from: W) -> MouseTerminal { + from.write_all(ENTER_MOUSE_SEQUENCE.as_bytes()).unwrap(); + + MouseTerminal { term: from } + } +} + +impl Drop for MouseTerminal { + fn drop(&mut self) { + self.term.write_all(EXIT_MOUSE_SEQUENCE.as_bytes()).unwrap(); + } +} + +impl ops::Deref for MouseTerminal { + type Target = W; + + fn deref(&self) -> &W { + &self.term + } +} + +impl ops::DerefMut for MouseTerminal { + fn deref_mut(&mut self) -> &mut W { + &mut self.term + } +} + +impl Write for MouseTerminal { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.term.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.term.flush() + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io; + use event::{Key, Event, MouseEvent, MouseButton}; + + #[test] + fn test_keys() { + let mut i = b"\x1Bayo\x7F\x1B[D".keys(); + + assert_eq!(i.next().unwrap().unwrap(), Key::Alt('a')); + assert_eq!(i.next().unwrap().unwrap(), Key::Char('y')); + assert_eq!(i.next().unwrap().unwrap(), Key::Char('o')); + assert_eq!(i.next().unwrap().unwrap(), Key::Backspace); + assert_eq!(i.next().unwrap().unwrap(), Key::Left); + assert!(i.next().is_none()); + } + + #[test] + fn test_events() { + let mut i = + b"\x1B[\x00bc\x7F\x1B[D\ + \x1B[M\x00\x22\x24\x1B[<0;2;4;M\x1B[32;2;4M\x1B[<0;2;4;m\x1B[35;2;4Mb" + .events(); + + assert_eq!(i.next().unwrap().unwrap(), + Event::Unsupported(vec![0x1B, b'[', 0x00])); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('b'))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('c'))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Backspace)); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Left)); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::WheelUp, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('b'))); + assert!(i.next().is_none()); + } + + #[test] + fn test_events_and_raw() { + let input = b"\x1B[\x00bc\x7F\x1B[D\ + \x1B[M\x00\x22\x24\x1B[<0;2;4;M\x1B[32;2;4M\x1B[<0;2;4;m\x1B[35;2;4Mb"; + let mut output = Vec::::new(); + { + let mut i = input.events_and_raw().map(|res| res.unwrap()) + .inspect(|&(_, ref raw)| { output.extend(raw); }).map(|(event, _)| event); + + assert_eq!(i.next().unwrap(), + Event::Unsupported(vec![0x1B, b'[', 0x00])); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('b'))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('c'))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Backspace)); + assert_eq!(i.next().unwrap(), Event::Key(Key::Left)); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::WheelUp, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('b'))); + assert!(i.next().is_none()); + } + + assert_eq!(input.iter().map(|b| *b).collect::>(), output) + } + + #[test] + fn test_function_keys() { + let mut st = b"\x1BOP\x1BOQ\x1BOR\x1BOS".keys(); + for i in 1..5 { + assert_eq!(st.next().unwrap().unwrap(), Key::F(i)); + } + + let mut st = b"\x1B[11~\x1B[12~\x1B[13~\x1B[14~\x1B[15~\ + \x1B[17~\x1B[18~\x1B[19~\x1B[20~\x1B[21~\x1B[23~\x1B[24~" + .keys(); + for i in 1..13 { + assert_eq!(st.next().unwrap().unwrap(), Key::F(i)); + } + } + + #[test] + fn test_special_keys() { + let mut st = b"\x1B[2~\x1B[H\x1B[7~\x1B[5~\x1B[3~\x1B[F\x1B[8~\x1B[6~".keys(); + assert_eq!(st.next().unwrap().unwrap(), Key::Insert); + assert_eq!(st.next().unwrap().unwrap(), Key::Home); + assert_eq!(st.next().unwrap().unwrap(), Key::Home); + assert_eq!(st.next().unwrap().unwrap(), Key::PageUp); + assert_eq!(st.next().unwrap().unwrap(), Key::Delete); + assert_eq!(st.next().unwrap().unwrap(), Key::End); + assert_eq!(st.next().unwrap().unwrap(), Key::End); + assert_eq!(st.next().unwrap().unwrap(), Key::PageDown); + assert!(st.next().is_none()); + } + + #[test] + fn test_esc_key() { + let mut st = b"\x1B".keys(); + assert_eq!(st.next().unwrap().unwrap(), Key::Esc); + assert!(st.next().is_none()); + } + + fn line_match(a: &str, b: Option<&str>) { + let mut sink = io::sink(); + + let line = a.as_bytes().read_line().unwrap(); + let pass = a.as_bytes().read_passwd(&mut sink).unwrap(); + + // godammit rustc + + assert_eq!(line, pass); + + if let Some(l) = line { + assert_eq!(Some(l.as_str()), b); + } else { + assert!(b.is_none()); + } + } + + #[test] + fn test_read() { + let test1 = "this is the first test"; + let test2 = "this is the second test"; + + line_match(test1, Some(test1)); + line_match(test2, Some(test2)); + } + + #[test] + fn test_backspace() { + line_match("this is the\x7f first\x7f\x7f test", + Some("this is th fir test")); + line_match("this is the seco\x7fnd test\x7f", + Some("this is the secnd tes")); + } + + #[test] + fn test_end() { + line_match("abc\nhttps://www.youtube.com/watch?v=dQw4w9WgXcQ", + Some("abc")); + line_match("hello\rhttps://www.youtube.com/watch?v=yPYZpwSpKmA", + Some("hello")); + } + + #[test] + fn test_abort() { + line_match("abc\x03https://www.youtube.com/watch?v=dQw4w9WgXcQ", None); + line_match("hello\x04https://www.youtube.com/watch?v=yPYZpwSpKmA", None); + } + +} diff -Nru distinst-0.1.0/vendor/termion/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/lib.rs --- distinst-0.1.0/vendor/termion/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,61 @@ +//! Termion is a pure Rust, bindless library for low-level handling, manipulating +//! and reading information about terminals. This provides a full-featured +//! alternative to Termbox. +//! +//! Termion aims to be simple and yet expressive. It is bindless, meaning that it +//! is not a front-end to some other library (e.g., ncurses or termbox), but a +//! standalone library directly talking to the TTY. +//! +//! Supports Redox, Mac OS X, and Linux (or, in general, ANSI terminals). +//! +//! For more information refer to the [README](https://github.com/ticki/termion). +#![warn(missing_docs)] + +#[cfg(target_os = "redox")] +#[path="sys/redox/mod.rs"] +mod sys; + +#[cfg(unix)] +#[path="sys/unix/mod.rs"] +mod sys; + +pub use sys::size::terminal_size; +pub use sys::tty::{is_tty, get_tty}; + +mod async; +pub use async::{AsyncReader, async_stdin}; + +#[macro_use] +mod macros; +pub mod clear; +pub mod color; +pub mod cursor; +pub mod event; +pub mod input; +pub mod raw; +pub mod screen; +pub mod scroll; +pub mod style; + +#[cfg(test)] +mod test { + use super::sys; + + #[test] + fn test_get_terminal_attr() { + sys::attr::get_terminal_attr().unwrap(); + sys::attr::get_terminal_attr().unwrap(); + sys::attr::get_terminal_attr().unwrap(); + } + + #[test] + fn test_set_terminal_attr() { + let ios = sys::attr::get_terminal_attr().unwrap(); + sys::attr::set_terminal_attr(&ios).unwrap(); + } + + #[test] + fn test_size() { + sys::size::terminal_size().unwrap(); + } +} diff -Nru distinst-0.1.0/vendor/termion/src/macros.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/macros.rs --- distinst-0.1.0/vendor/termion/src/macros.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/macros.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,19 @@ +/// Create a CSI-introduced sequence. +macro_rules! csi { + ($( $l:expr ),*) => { concat!("\x1B[", $( $l ),*) }; +} + +/// Derive a CSI sequence struct. +macro_rules! derive_csi_sequence { + ($doc:expr, $name:ident, $value:expr) => { + #[doc = $doc] + #[derive(Copy, Clone)] + pub struct $name; + + impl fmt::Display for $name { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!($value)) + } + } + }; +} diff -Nru distinst-0.1.0/vendor/termion/src/raw.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/raw.rs --- distinst-0.1.0/vendor/termion/src/raw.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/raw.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,117 @@ +//! Managing raw mode. +//! +//! Raw mode is a particular state a TTY can have. It signifies that: +//! +//! 1. No line buffering (the input is given byte-by-byte). +//! 2. The input is not written out, instead it has to be done manually by the programmer. +//! 3. The output is not canonicalized (for example, `\n` means "go one line down", not "line +//! break"). +//! +//! It is essential to design terminal programs. +//! +//! # Example +//! +//! ```rust,no_run +//! use termion::raw::IntoRawMode; +//! use std::io::{Write, stdout}; +//! +//! fn main() { +//! let mut stdout = stdout().into_raw_mode().unwrap(); +//! +//! write!(stdout, "Hey there.").unwrap(); +//! } +//! ``` + +use std::io::{self, Write}; +use std::ops; + +use sys::Termios; +use sys::attr::{get_terminal_attr, raw_terminal_attr, set_terminal_attr}; + +/// The timeout of an escape code control sequence, in milliseconds. +pub const CONTROL_SEQUENCE_TIMEOUT: u64 = 100; + +/// A terminal restorer, which keeps the previous state of the terminal, and restores it, when +/// dropped. +/// +/// Restoring will entirely bring back the old TTY state. +pub struct RawTerminal { + prev_ios: Termios, + output: W, +} + +impl Drop for RawTerminal { + fn drop(&mut self) { + set_terminal_attr(&self.prev_ios).unwrap(); + } +} + +impl ops::Deref for RawTerminal { + type Target = W; + + fn deref(&self) -> &W { + &self.output + } +} + +impl ops::DerefMut for RawTerminal { + fn deref_mut(&mut self) -> &mut W { + &mut self.output + } +} + +impl Write for RawTerminal { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.output.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.output.flush() + } +} + +/// Types which can be converted into "raw mode". +/// +/// # Why is this type defined on writers and not readers? +/// +/// TTYs has their state controlled by the writer, not the reader. You use the writer to clear the +/// screen, move the cursor and so on, so naturally you use the writer to change the mode as well. +pub trait IntoRawMode: Write + Sized { + /// Switch to raw mode. + /// + /// Raw mode means that stdin won't be printed (it will instead have to be written manually by + /// the program). Furthermore, the input isn't canonicalised or buffered (that is, you can + /// read from stdin one byte of a time). The output is neither modified in any way. + fn into_raw_mode(self) -> io::Result>; +} + +impl IntoRawMode for W { + fn into_raw_mode(self) -> io::Result> { + let mut ios = get_terminal_attr()?; + let prev_ios = ios; + + raw_terminal_attr(&mut ios); + + set_terminal_attr(&ios)?; + + Ok(RawTerminal { + prev_ios: prev_ios, + output: self, + }) + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::{Write, stdout}; + + #[test] + fn test_into_raw_mode() { + let mut out = stdout().into_raw_mode().unwrap(); + + out.write_all(b"this is a test, muahhahahah\r\n").unwrap(); + + drop(out); + } +} diff -Nru distinst-0.1.0/vendor/termion/src/screen.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/screen.rs --- distinst-0.1.0/vendor/termion/src/screen.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/screen.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,91 @@ +//! Managing switching between main and alternate screen buffers. +//! +//! Note that this implementation uses xterm's new escape sequences for screen switching and thus +//! only works for xterm compatible terminals (which should be most terminals nowadays). +//! +//! # Example +//! +//! ```rust +//! use termion::screen::AlternateScreen; +//! use std::io::{Write, stdout}; +//! +//! fn main() { +//! { +//! let mut screen = AlternateScreen::from(stdout()); +//! write!(screen, "Writing to alternate screen!").unwrap(); +//! screen.flush().unwrap(); +//! } +//! println!("Writing to main screen."); +//! } +//! ``` + +use std::io::{self, Write}; +use std::ops; +use std::fmt; + +/// Switch to the main screen buffer of the terminal. +pub struct ToMainScreen; + +impl fmt::Display for ToMainScreen { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("?1049l")) + } +} + +/// Switch to the alternate screen buffer of the terminal. +pub struct ToAlternateScreen; + +impl fmt::Display for ToAlternateScreen { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("?1049h")) + } +} + +/// A terminal restorer, which wraps a type implementing Write, and causes all writes to be written +/// to an alternate screen. +/// +/// This is achieved by switching the terminal to the alternate screen on creation and +/// automatically switching it back to the original screen on drop. +pub struct AlternateScreen { + /// The output target. + output: W, +} + +impl AlternateScreen { + /// Create an alternate screen wrapper struct for the provided output and switch the terminal + /// to the alternate screen. + pub fn from(mut output: W) -> Self { + write!(output, "{}", ToAlternateScreen).expect("switch to alternate screen"); + AlternateScreen { output: output } + } +} + +impl Drop for AlternateScreen { + fn drop(&mut self) { + write!(self, "{}", ToMainScreen).expect("switch to main screen"); + } +} + +impl ops::Deref for AlternateScreen { + type Target = W; + + fn deref(&self) -> &W { + &self.output + } +} + +impl ops::DerefMut for AlternateScreen { + fn deref_mut(&mut self) -> &mut W { + &mut self.output + } +} + +impl Write for AlternateScreen { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.output.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.output.flush() + } +} diff -Nru distinst-0.1.0/vendor/termion/src/scroll.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/scroll.rs --- distinst-0.1.0/vendor/termion/src/scroll.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/scroll.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,23 @@ +//! Scrolling. + +use std::fmt; + +/// Scroll up. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Up(pub u16); + +impl fmt::Display for Up { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}S"), self.0) + } +} + +/// Scroll down. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Down(pub u16); + +impl fmt::Display for Down { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}T"), self.0) + } +} diff -Nru distinst-0.1.0/vendor/termion/src/style.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/style.rs --- distinst-0.1.0/vendor/termion/src/style.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/style.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,22 @@ +//! Text styling management. + +use std::fmt; + +derive_csi_sequence!("Reset SGR parameters.", Reset, "m"); +derive_csi_sequence!("Bold text.", Bold, "1m"); +derive_csi_sequence!("Fainted text (not widely supported).", Faint, "2m"); +derive_csi_sequence!("Italic text.", Italic, "3m"); +derive_csi_sequence!("Underlined text.", Underline, "4m"); +derive_csi_sequence!("Blinking text (not widely supported).", Blink, "5m"); +derive_csi_sequence!("Inverted colors (negative mode).", Invert, "7m"); +derive_csi_sequence!("Crossed out text (not widely supported).", CrossedOut, "9m"); +derive_csi_sequence!("Undo bold text.", NoBold, "21m"); +derive_csi_sequence!("Undo fainted text (not widely supported).", NoFaint, "22m"); +derive_csi_sequence!("Undo italic text.", NoItalic, "23m"); +derive_csi_sequence!("Undo underlined text.", NoUnderline, "24m"); +derive_csi_sequence!("Undo blinking text (not widely supported).", NoBlink, "25m"); +derive_csi_sequence!("Undo inverted colors (negative mode).", NoInvert, "27m"); +derive_csi_sequence!("Undo crossed out text (not widely supported).", + NoCrossedOut, + "29m"); +derive_csi_sequence!("Framed text (not widely supported).", Framed, "51m"); diff -Nru distinst-0.1.0/vendor/termion/src/sys/redox/attr.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/attr.rs --- distinst-0.1.0/vendor/termion/src/sys/redox/attr.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/attr.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,33 @@ +use std::io; + +use super::{cvt, syscall, Termios}; + +pub fn get_terminal_attr() -> io::Result { + let mut termios = Termios::default(); + + let fd = cvt(syscall::dup(0, b"termios"))?; + let res = cvt(syscall::read(fd, &mut termios)); + let _ = syscall::close(fd); + + if res? == termios.len() { + Ok(termios) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to get the terminal attributes.")) + } +} + +pub fn set_terminal_attr(termios: &Termios) -> io::Result<()> { + let fd = cvt(syscall::dup(0, b"termios"))?; + let res = cvt(syscall::write(fd, termios)); + let _ = syscall::close(fd); + + if res? == termios.len() { + Ok(()) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to set the terminal attributes.")) + } +} + +pub fn raw_terminal_attr(ios: &mut Termios) { + ios.make_raw() +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/redox/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/mod.rs --- distinst-0.1.0/vendor/termion/src/sys/redox/mod.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,15 @@ +extern crate redox_termios; +extern crate syscall; + +use std::io; + +pub use self::redox_termios::Termios; + +pub mod attr; +pub mod size; +pub mod tty; + +// Support function for converting syscall error to io error +fn cvt(result: Result) -> io::Result { + result.map_err(|err| io::Error::from_raw_os_error(err.errno)) +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/redox/size.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/size.rs --- distinst-0.1.0/vendor/termion/src/sys/redox/size.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/size.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,18 @@ +use std::io; + +use super::{cvt, redox_termios, syscall}; + +/// Get the size of the terminal. +pub fn terminal_size() -> io::Result<(u16, u16)> { + let mut winsize = redox_termios::Winsize::default(); + + let fd = cvt(syscall::dup(1, b"winsize"))?; + let res = cvt(syscall::read(fd, &mut winsize)); + let _ = syscall::close(fd); + + if res? == winsize.len() { + Ok((winsize.ws_col, winsize.ws_row)) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to get the terminal size.")) + } +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/redox/tty.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/tty.rs --- distinst-0.1.0/vendor/termion/src/sys/redox/tty.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/redox/tty.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,22 @@ +use std::{env, fs, io}; +use std::os::unix::io::AsRawFd; + +use super::syscall; + +/// Is this stream a TTY? +pub fn is_tty(stream: &T) -> bool { + if let Ok(fd) = syscall::dup(stream.as_raw_fd(), b"termios") { + let _ = syscall::close(fd); + true + } else { + false + } +} + +/// Get the TTY device. +/// +/// This allows for getting stdio representing _only_ the TTY, and not other streams. +pub fn get_tty() -> io::Result { + let tty = try!(env::var("TTY").map_err(|x| io::Error::new(io::ErrorKind::NotFound, x))); + fs::OpenOptions::new().read(true).write(true).open(tty) +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/unix/attr.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/attr.rs --- distinst-0.1.0/vendor/termion/src/sys/unix/attr.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/attr.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,29 @@ +use std::{io, mem}; + +use super::{cvt, Termios}; +use super::libc::c_int; + +pub fn get_terminal_attr() -> io::Result { + extern "C" { + pub fn tcgetattr(fd: c_int, termptr: *mut Termios) -> c_int; + } + unsafe { + let mut termios = mem::zeroed(); + cvt(tcgetattr(0, &mut termios))?; + Ok(termios) + } +} + +pub fn set_terminal_attr(termios: &Termios) -> io::Result<()> { + extern "C" { + pub fn tcsetattr(fd: c_int, opt: c_int, termptr: *const Termios) -> c_int; + } + cvt(unsafe { tcsetattr(0, 0, termios) }).and(Ok(())) +} + +pub fn raw_terminal_attr(termios: &mut Termios) { + extern "C" { + pub fn cfmakeraw(termptr: *mut Termios); + } + unsafe { cfmakeraw(termios) } +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/unix/mod.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/mod.rs --- distinst-0.1.0/vendor/termion/src/sys/unix/mod.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/mod.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,33 @@ +extern crate libc; + +use std::io; + +pub use self::libc::termios as Termios; + +pub mod attr; +pub mod size; +pub mod tty; + +// Support functions for converting libc return values to io errors { +trait IsMinusOne { + fn is_minus_one(&self) -> bool; +} + +macro_rules! impl_is_minus_one { + ($($t:ident)*) => ($(impl IsMinusOne for $t { + fn is_minus_one(&self) -> bool { + *self == -1 + } + })*) + } + +impl_is_minus_one! { i8 i16 i32 i64 isize } + +fn cvt(t: T) -> io::Result { + if t.is_minus_one() { + Err(io::Error::last_os_error()) + } else { + Ok(t) + } +} +// } End of support functions diff -Nru distinst-0.1.0/vendor/termion/src/sys/unix/size.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/size.rs --- distinst-0.1.0/vendor/termion/src/sys/unix/size.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/size.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,48 @@ +use std::{io, mem}; + +use super::cvt; +use super::libc::{c_ushort, ioctl, STDOUT_FILENO}; + +#[repr(C)] +struct TermSize { + row: c_ushort, + col: c_ushort, + _x: c_ushort, + _y: c_ushort, +} + +#[cfg(target_os = "linux")] +pub const TIOCGWINSZ: usize = 0x00005413; + +#[cfg(not(target_os = "linux"))] +pub const TIOCGWINSZ: usize = 0x40087468; + +// Since attributes on non-item statements is not stable yet, we use a function. +#[cfg(not(target_os = "android"))] +#[cfg(not(target_os = "redox"))] +#[cfg(target_pointer_width = "64")] +#[cfg(not(target_env = "musl"))] +fn tiocgwinsz() -> u64 { + TIOCGWINSZ as u64 +} +#[cfg(not(target_os = "android"))] +#[cfg(not(target_os = "redox"))] +#[cfg(target_pointer_width = "32")] +#[cfg(not(target_env = "musl"))] +fn tiocgwinsz() -> u32 { + TIOCGWINSZ as u32 +} + +#[cfg(any(target_env = "musl", target_os = "android"))] +fn tiocgwinsz() -> i32 { + TIOCGWINSZ as i32 +} + +/// Get the size of the terminal. +pub fn terminal_size() -> io::Result<(u16, u16)> { + unsafe { + let mut size: TermSize = mem::zeroed(); + cvt(ioctl(STDOUT_FILENO, tiocgwinsz(), &mut size as *mut _))?; + Ok((size.col as u16, size.row as u16)) + } +} diff -Nru distinst-0.1.0/vendor/termion/src/sys/unix/tty.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/tty.rs --- distinst-0.1.0/vendor/termion/src/sys/unix/tty.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/src/sys/unix/tty.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,17 @@ +use std::{fs, io}; +use std::os::unix::io::AsRawFd; + +use super::libc; + + +/// Is this stream a TTY? +pub fn is_tty(stream: &T) -> bool { + unsafe { libc::isatty(stream.as_raw_fd()) == 1 } +} + +/// Get the TTY device. +/// +/// This allows for getting stdio representing _only_ the TTY, and not other streams. +pub fn get_tty() -> io::Result { + fs::OpenOptions::new().read(true).write(true).open("/dev/tty") +} diff -Nru distinst-0.1.0/vendor/termion/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/.travis.yml --- distinst-0.1.0/vendor/termion/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/termion/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +language: rust +cache: cargo +rust: + - stable + - beta + - nightly +os: + - linux + - osx +script: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then FAKETTY="script -q /dev/null"; fi + - $FAKETTY cargo build --verbose + - $FAKETTY cargo test --verbose + - $FAKETTY cargo test --release --verbose diff -Nru distinst-0.1.0/vendor/term_size/appveyor.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/appveyor.yml --- distinst-0.1.0/vendor/term_size/appveyor.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -install: - - ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe' - - rust-nightly-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" - - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin - - rustc -V - - cargo -V - -build: false - -test_script: - - cargo build --verbose - - cargo test --verbose diff -Nru distinst-0.1.0/vendor/term_size/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.cargo-checksum.json --- distinst-0.1.0/vendor/term_size/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".clog.toml":"62e8c759e1ec21df31926f7545ff2c66ce63aaf38a758c0b4044c5bbec59bcae",".travis.yml":"c187312aeba08ff741fab82fc152d2d5aae738231b43d1cef2181a3c831d01d0","CHANGELOG.md":"c3ba8be220413f2ed5fce3f49a3888d22e20802f19a237cdaa1171fb13000427","Cargo.toml":"4de1d58c6b6e19f026939fcd1a3bb1ae65abeaeb524f3c9d0f29909a61d08604","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"9cf3574889a4e7f4fe68f532bacd596786057d41eb20fe8e8ed2215d430d8bd3","appveyor.yml":"bd88ad4a942e10ef602540ae592f3e010327dc93aa3d60f07f9f7ff6d3562719","index.html":"d2203968a6fb051d52c55d6e517614c942ea0edbc283e6c3cc8aeb4556eeaad4","justfile":"8255dafcc5dbb0c4df869d68d5cfe0f8b16835669151dacbc0782fbeb3a3e5d4","rustfmt.toml":"8fd2d63119df515fd5f44e530c709b19d66b09fbc2e22a640bf4b64c57e7d6b3","src/lib.rs":"eab371fe8be05d03bb1cd2a5f1ec3e665423501412383d211552174e21da05c7"},"package":"e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/term_size/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/Cargo.toml --- distinst-0.1.0/vendor/term_size/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -[package] -name = "term_size" -version = "0.3.0" -authors = ["Kevin K. ", "Benjamin Sago "] -exclude = [] -description = "functions for determining terminal sizes and dimensions" -repository = "https://github.com/kbknapp/term_size-rs.git" -documentation = "https://kbknapp.github.io/term_size-rs" -readme = "README.md" -license = "MIT OR Apache-2.0" -keywords = ["term", "terminal", "size", "width", "dimension"] - -[dependencies] -clippy = { version = "~0.0.112", optional = true } - -[target.'cfg(not(target_os = "windows"))'.dependencies] -libc = "~0.2.20" - -[target.'cfg(target_os = "windows")'.dependencies] -kernel32-sys = "~0.2.2" -winapi = "~0.2.8" - -[features] -default = [] -lints = ["clippy", "nightly"] -nightly = [] # for building with nightly and unstable features -unstable = [] # for building with unstable features on stable Rust -debug = [] # for building with debug messages -travis = ["lints", "nightly"] # for building with travis-cargo - -[profile.release] -opt-level = 3 -debug = false -rpath = false -lto = true -debug-assertions = false -# codegen-units ignored with lto=true - -[profile.dev] -opt-level = 0 -debug = true -rpath = false -lto = false -debug-assertions = true -codegen-units = 4 - -[profile.test] -opt-level = 1 -debug = true -rpath = false -lto = false -debug-assertions = true -codegen-units = 2 - -[profile.bench] -opt-level = 3 -debug = false -rpath = false -lto = true -debug-assertions = false - -[profile.doc] -opt-level = 0 -debug = true -rpath = false -lto = false -debug-assertions = true -codegen-units = 4 diff -Nru distinst-0.1.0/vendor/term_size/CHANGELOG.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/CHANGELOG.md --- distinst-0.1.0/vendor/term_size/CHANGELOG.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -
-## v0.3.0 (2017-04-09) - - -#### Features - -* allows getting the terminal size of all standard streams, or just particular ones ([c7095c95](https://github.com/kbknapp/term_size-rs/commit/c7095c95d633e0a36ea78434bc83349a9711a187)) - - - - -### v0.2.3 (2017-02-21) - -#### Bug Fixes - -* Moves the code into distinct modules and adds dummy functions for unsupported platforms - - - -### v0.2.2 (2017-01-29) - -* Updates deps `libc` and `clippy` - - -### v0.2.1 (2016-09-05) - - -#### Bug Fixes - -* uses libc::winsize instead of homegrown ([216986ec](https://github.com/kbknapp/term_size-rs/commit/216986ecdbe528523953a1cde4cf6c329a0f4fbc), closes [#6](https://github.com/kbknapp/term_size-rs/issues/6)) - - - - -v0.2.0 -## v0.2.0 (2016-09-05) - -#### Features - -* adds support for Windows ([f181c99](https://github.com/kbknapp/term_size-rs/commit/f181c99c0c306b711952a2a4053df904e851413f)) - -#### Documentation - -* **README.md:** - * fixes documentation link ([ca06bf13](https://github.com/kbknapp/term_size-rs/commit/ca06bf132948559032853addd9aa0af022a126e9)) - * minor fixups ([1c269046](https://github.com/kbknapp/term_size-rs/commit/1c2690462b1b1db58d46395c6f1cf098dd769e18)) - - diff -Nru distinst-0.1.0/vendor/term_size/.clog.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.clog.toml --- distinst-0.1.0/vendor/term_size/.clog.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.clog.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -[clog] -repository = "https://github.com/kbknapp/term_size-rs" -outfile = "CHANGELOG.md" -from-latest-tag = true - -[sections] -Performance = ["perf"] -Improvements = ["impr", "im", "imp"] -Documentation = ["docs"] -Deprecations = ["depr"] -Examples = ["examples"] diff -Nru distinst-0.1.0/vendor/term_size/index.html distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/index.html --- distinst-0.1.0/vendor/term_size/index.html 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru distinst-0.1.0/vendor/term_size/justfile distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/justfile --- distinst-0.1.0/vendor/term_size/justfile 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/justfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -@update-contributors: - echo 'Removing old CONTRIBUTORS.md' - mv CONTRIBUTORS.md CONTRIBUTORS.md.bak - echo 'Downloading a list of new contributors' - echo "The following is a list of contributors in alphabetical order:" > CONTRIBUTORS.md - echo "" >> CONTRIBUTORS.md - echo "" >> CONTRIBUTORS.md - githubcontrib --owner kbknapp --repo term_size-rs --sha master --cols 6 --format md --showlogin true --sortBy login >> CONTRIBUTORS.md - rm CONTRIBUTORS.md.bak - -run-test TEST: - cargo test --test {{TEST}} - -debug TEST: - cargo test --test {{TEST}} --features debug - -run-tests: - cargo test --features "yaml unstable" - -@bench: nightly - cargo bench && just remove-nightly - -nightly: - rustup override add nightly - -remove-nightly: - rustup override remove - -@lint: nightly - cargo build --features lints && just remove-nightly - -clean: - cargo clean - find . -type f -name "*.orig" -exec rm {} \; - find . -type f -name "*.bk" -exec rm {} \; - find . -type f -name ".*~" -exec rm {} \; diff -Nru distinst-0.1.0/vendor/term_size/LICENSE-APACHE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/LICENSE-APACHE --- distinst-0.1.0/vendor/term_size/LICENSE-APACHE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff -Nru distinst-0.1.0/vendor/term_size/LICENSE-MIT distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/LICENSE-MIT --- distinst-0.1.0/vendor/term_size/LICENSE-MIT 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016 Kevin B. Knapp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff -Nru distinst-0.1.0/vendor/term_size/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/README.md --- distinst-0.1.0/vendor/term_size/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -term_size -==== - -[![Crates.io](https://img.shields.io/crates/v/term_size.svg)](https://crates.io/crates/term_size) [![Crates.io](https://img.shields.io/crates/d/term_size.svg)](https://crates.io/crates/term_size) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kbknapp/term_size-rs/blob/master/LICENSE-MIT) [![license](http://img.shields.io/badge/license-Apache2.0-blue.svg)](https://github.com/kbknapp/term_size-rs/blob/master/LICENSE-APACHE) [![Coverage Status](https://coveralls.io/repos/kbknapp/term_size-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kbknapp/term_size-rs?branch=master) [![Join the chat at https://gitter.im/kbknapp/term_size-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/term_size-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -Linux: [![Build Status](https://travis-ci.org/kbknapp/term_size-rs.svg?branch=master)](https://travis-ci.org/kbknapp/term_size-rs) -Windows: [![Build status](https://ci.appveyor.com/api/projects/status/6q0x4h6i0e3ypbm5?svg=true -)](https://ci.appveyor.com/project/kbknapp/term_size-rs/branch/master) - -A Rust library to enable getting terminal sizes and dimensions - -[Documentation](https://kbknapp.github.io/term_size-rs) - -## Usage - -First, add the following to your `Cargo.toml`: - -```toml -[dependencies] -term_size = "0.3" -``` - -Next, add this to your crate root: - -```rust -extern crate term_size; -``` - -To get the dimensions of your terminal window, simply use the following: - -```rust -fn main() { - if let Some((w, h)) = term_size::dimensions() { - println!("Width: {}\nHeight: {}", w, h); - } else { - println!("Unable to get term size :(") - } -} -``` - -## License - -Copyright Benjamin Sago, Kevin Knapp, and `term_size` contributors. - -Licensed under either of - -* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) -* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) - -at your option. - -## Contributing - -1. Fork it! -2. Create your feature branch: `git checkout -b my-new-feature` -3. Commit your changes: `git commit -am 'Add some feature'` -4. Push to the branch: `git push origin my-new-feature` -5. Submit a pull request :D - -Unless you explicitly state otherwise, any contribution intentionally -submitted for inclusion in the work by you, as defined in the -Apache-2.0 license, shall be dual licensed as above, without any -additional terms or conditions. diff -Nru distinst-0.1.0/vendor/term_size/rustfmt.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/rustfmt.toml --- distinst-0.1.0/vendor/term_size/rustfmt.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/rustfmt.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -format_strings = false -chain_overflow_last = false -same_line_if_else = true -fn_single_line = true diff -Nru distinst-0.1.0/vendor/term_size/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/src/lib.rs --- distinst-0.1.0/vendor/term_size/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -// The following was originally taken and adapated from exa source -// repo: https://github.com/ogham/exa -// commit: b9eb364823d0d4f9085eb220233c704a13d0f611 -// license: MIT - Copyright (c) 2014 Benjamin Sago - -//! System calls for getting the terminal size. -//! -//! Getting the terminal size is performed using an ioctl command that takes -//! the file handle to the terminal -- which in this case, is stdout -- and -//! populates a structure containing the values. -//! -//! The size is needed when the user wants the output formatted into columns: -//! the default grid view, or the hybrid grid-details view. - -#[cfg(not(target_os = "windows"))] -extern crate libc; -#[cfg(target_os = "windows")] -extern crate kernel32; -#[cfg(target_os = "windows")] -extern crate winapi; - -pub use platform::{dimensions, dimensions_stdout, dimensions_stdin, dimensions_stderr}; - -#[cfg(any(target_os = "linux", - target_os = "android", - target_os = "macos", - target_os = "ios", - target_os = "bitrig", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris"))] -mod platform { - use libc::{STDOUT_FILENO, STDIN_FILENO, STDERR_FILENO, c_int, c_ulong, winsize}; - use std::mem::zeroed; - - // Unfortunately the actual command is not standardised... - #[cfg(any(target_os = "linux", target_os = "android"))] - static TIOCGWINSZ: c_ulong = 0x5413; - - #[cfg(any(target_os = "macos", - target_os = "ios", - target_os = "bitrig", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd"))] - static TIOCGWINSZ: c_ulong = 0x40087468; - - #[cfg(target_os = "solaris")] - static TIOCGWINSZ: c_ulong = 0x5468; - - extern "C" { - fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int; - } - - /// Runs the ioctl command. Returns (0, 0) if all of the streams are not to a terminal, or - /// there is an error. (0, 0) is an invalid size to have anyway, which is why - /// it can be used as a nil value. - unsafe fn get_dimensions_any() -> winsize { - let mut window: winsize = zeroed(); - let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut window); - - if result == -1 { - window = zeroed(); - result = ioctl(STDIN_FILENO, TIOCGWINSZ, &mut window); - if result == -1 { - window = zeroed(); - result = ioctl(STDERR_FILENO, TIOCGWINSZ, &mut window); - if result == -1 { - return zeroed(); - } - } - } - window - } - - /// Runs the ioctl command. Returns (0, 0) if the output is not to a terminal, or - /// there is an error. (0, 0) is an invalid size to have anyway, which is why - /// it can be used as a nil value. - unsafe fn get_dimensions_out() -> winsize { - let mut window: winsize = zeroed(); - let result = ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut window); - - if result != -1 { - return window; - } - zeroed() - } - - /// Runs the ioctl command. Returns (0, 0) if the input is not to a terminal, or - /// there is an error. (0, 0) is an invalid size to have anyway, which is why - /// it can be used as a nil value. - unsafe fn get_dimensions_in() -> winsize { - let mut window: winsize = zeroed(); - let result = ioctl(STDIN_FILENO, TIOCGWINSZ, &mut window); - - if result != -1 { - return window; - } - zeroed() - } - - /// Runs the ioctl command. Returns (0, 0) if the error is not to a terminal, or - /// there is an error. (0, 0) is an invalid size to have anyway, which is why - /// it can be used as a nil value. - unsafe fn get_dimensions_err() -> winsize { - let mut window: winsize = zeroed(); - let result = ioctl(STDERR_FILENO, TIOCGWINSZ, &mut window); - - if result != -1 { - return window; - } - zeroed() - } - - /// Query the current processes's output (`stdout`), input (`stdin`), and error (`stderr`) in - /// that order, in the attempt to dtermine terminal width. If one of those streams is actually - /// a tty, this function returns its width and height as a number of characters. - /// - /// If *all* of the streams are not ttys or return any errors this function will return `None`. - pub fn dimensions() -> Option<(usize, usize)> { - let w = unsafe { get_dimensions_any() }; - - if w.ws_col == 0 || w.ws_row == 0 { - None - } else { - Some((w.ws_col as usize, w.ws_row as usize)) - } - } - - /// Query the current processes's output (`stdout`) *only*, in the attempt to dtermine - /// terminal width. If that streams is actually a tty, this function returns its width - /// and height as a number of characters. - /// - /// If *all* of the streams are not ttys or return any errors this function will return `None`. - pub fn dimensions_stdout() -> Option<(usize, usize)> { - let w = unsafe { get_dimensions_out() }; - - if w.ws_col == 0 || w.ws_row == 0 { - None - } else { - Some((w.ws_col as usize, w.ws_row as usize)) - } - } - - /// Query the current processes's input (`stdin`) *only*, in the attempt to dtermine - /// terminal width. If that streams is actually a tty, this function returns its width - /// and height as a number of characters. - /// - /// If *all* of the streams are not ttys or return any errors this function will return `None`. - pub fn dimensions_stdin() -> Option<(usize, usize)> { - let w = unsafe { get_dimensions_in() }; - - if w.ws_col == 0 || w.ws_row == 0 { - None - } else { - Some((w.ws_col as usize, w.ws_row as usize)) - } - } - - /// Query the current processes's error output (`stderr`) *only*, in the attempt to dtermine - /// terminal width. If that streams is actually a tty, this function returns its width - /// and height as a number of characters. - /// - /// If *all* of the streams are not ttys or return any errors this function will return `None`. - pub fn dimensions_stderr() -> Option<(usize, usize)> { - let w = unsafe { get_dimensions_err() }; - - if w.ws_col == 0 || w.ws_row == 0 { - None - } else { - Some((w.ws_col as usize, w.ws_row as usize)) - } - } -} - -#[cfg(target_os = "windows")] -mod platform { - use kernel32::{GetConsoleScreenBufferInfo, GetStdHandle}; - use winapi::{CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_OUTPUT_HANDLE}; - - /// Query the current processes's output, returning its width and height as a - /// number of characters. Returns `None` if the output isn't to a terminal. - pub fn dimensions() -> Option<(usize, usize)> { - let null_coord = COORD { X: 0, Y: 0 }; - let null_smallrect = SMALL_RECT { - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }; - - let stdout_h = unsafe { GetStdHandle(STD_OUTPUT_HANDLE) }; - let mut console_data = CONSOLE_SCREEN_BUFFER_INFO { - dwSize: null_coord, - dwCursorPosition: null_coord, - wAttributes: 0, - srWindow: null_smallrect, - dwMaximumWindowSize: null_coord, - }; - - if unsafe { GetConsoleScreenBufferInfo(stdout_h, &mut console_data) } != 0 { - Some(((console_data.srWindow.Right - console_data.srWindow.Left) as usize, - (console_data.srWindow.Bottom - console_data.srWindow.Top) as usize)) - } else { - None - } - } - /// Query the current processes's output, returning its width and height as a - /// number of characters. Returns `None` if the output isn't to a terminal. - pub fn dimensions_stdout() -> Option<(usize, usize)> { dimensions() } - /// This isn't implemented for Windows - pub fn dimensions_stdin() -> Option<(usize, usize)> { unimplemented!() } - /// This isn't implemented for Windows - pub fn dimensions_stderr() -> Option<(usize, usize)> { unimplemented!() } -} - -// makes project compilable on unsupported platforms -#[cfg(not(any(target_os = "linux", - target_os = "android", - target_os = "macos", - target_os = "ios", - target_os = "bitrig", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "windows")))] -mod platform { - pub fn dimensions() -> Option<(usize, usize)> { None } - pub fn dimensions_stdout() -> Option<(usize, usize)> { None } - pub fn dimensions_stdin() -> Option<(usize, usize)> { None } - pub fn dimensions_stderr() -> Option<(usize, usize)> { None } -} diff -Nru distinst-0.1.0/vendor/term_size/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.travis.yml --- distinst-0.1.0/vendor/term_size/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/term_size/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -sudo: false -language: rust -rust: - - nightly - - nightly-2016-09-04 - - beta - - stable -matrix: - allow_failures: - - rust: nightly -before_script: - - | - pip install 'travis-cargo<0.2' --user && - export PATH=$HOME/.local/bin:$PATH -script: - - | - cargo build --verbose && - cargo test --verbose && - travis-cargo --only nightly build && - travis-cargo --only nightly bench -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev -after_success: - - | - travis-cargo --only stable coveralls --no-sudo -env: - global: - - TRAVIS_CARGO_NIGHTLY_FEATURE=travis - - secure: JLBlgHY6OEmhJ8woewNJHmuBokTNUv7/WvLkJGV8xk0t6bXBwSU0jNloXwlH7FiQTc4TccX0PumPDD4MrMgxIAVFPmmmlQOCmdpYP4tqZJ8xo189E5zk8lKF5OyaVYCs5SMmFC3cxCsKjfwGIexNu3ck5Uhwe9jI0tqgkgM3URA= diff -Nru distinst-0.1.0/vendor/textwrap/.appveyor.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.appveyor.yml --- distinst-0.1.0/vendor/textwrap/.appveyor.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.appveyor.yml 2017-12-21 19:00:07.000000000 +0000 @@ -1,25 +1,4 @@ environment: - # From https://github.com/rust-lang-nursery/rand/commit/bb78689: - # - # At the time this was added AppVeyor was having troubles with checking - # revocation of SSL certificates of sites like static.rust-lang.org and what - # we think is crates.io. The libcurl HTTP client by default checks for - # revocation on Windows and according to a mailing list [1] this can be - # disabled. - # - # The `CARGO_HTTP_CHECK_REVOKE` env var here tells cargo to disable SSL - # revocation checking on Windows in libcurl. Note, though, that rustup, which - # we're using to download Rust here, also uses libcurl as the default backend. - # Unlike Cargo, however, rustup doesn't have a mechanism to disable revocation - # checking. To get rustup working we set `RUSTUP_USE_HYPER` which forces it to - # use the Hyper instead of libcurl backend. Both Hyper and libcurl use - # schannel on Windows but it appears that Hyper configures it slightly - # differently such that revocation checking isn't turned on by default. - # - # [1]: https://curl.haxx.se/mail/lib-2016-03/0202.html - RUSTUP_USE_HYPER: 1 - CARGO_HTTP_CHECK_REVOKE: false - matrix: - TOOLCHAIN: stable FEATURES: "hyphenation" diff -Nru distinst-0.1.0/vendor/textwrap/benches/linear.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/benches/linear.rs --- distinst-0.1.0/vendor/textwrap/benches/linear.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/benches/linear.rs 2017-12-21 19:00:07.000000000 +0000 @@ -4,6 +4,7 @@ // where *n* is the number of characters in the text to be wrapped. extern crate test; +extern crate rand; extern crate lipsum; extern crate textwrap; #[cfg(feature = "hyphenation")] @@ -14,6 +15,8 @@ use hyphenation::Language; #[cfg(feature = "hyphenation")] use textwrap::Wrapper; +use rand::XorShiftRng; +use lipsum::MarkovChain; const LINE_LENGTH: usize = 60; @@ -22,7 +25,12 @@ // The average word length in the lorem ipsum text is somewhere // between 6 and 7. So we conservatively divide by 5 to have a // long enough text that we can truncate below. - let mut text = lipsum::lipsum(length / 5); + let rng = XorShiftRng::new_unseeded(); + let mut chain = MarkovChain::new_with_rng(rng); + chain.learn(lipsum::LOREM_IPSUM); + chain.learn(lipsum::LIBER_PRIMUS); + + let mut text = chain.generate_from(length / 5, ("Lorem", "ipsum")); text.truncate(length); text } @@ -82,7 +90,7 @@ fn hyphenation_fill_100(b: &mut Bencher) { let text = &lorem_ipsum(100); let corpus = hyphenation::load(Language::Latin).unwrap(); - let wrapper = Wrapper::new(LINE_LENGTH).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); b.iter(|| wrapper.fill(text)) } @@ -91,7 +99,7 @@ fn hyphenation_fill_200(b: &mut Bencher) { let text = &lorem_ipsum(200); let corpus = hyphenation::load(Language::Latin).unwrap(); - let wrapper = Wrapper::new(LINE_LENGTH).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); b.iter(|| wrapper.fill(text)) } @@ -100,7 +108,7 @@ fn hyphenation_fill_400(b: &mut Bencher) { let text = &lorem_ipsum(400); let corpus = hyphenation::load(Language::Latin).unwrap(); - let wrapper = Wrapper::new(LINE_LENGTH).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); b.iter(|| wrapper.fill(text)) } @@ -109,6 +117,6 @@ fn hyphenation_fill_800(b: &mut Bencher) { let text = &lorem_ipsum(800); let corpus = hyphenation::load(Language::Latin).unwrap(); - let wrapper = Wrapper::new(LINE_LENGTH).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); b.iter(|| wrapper.fill(text)) } diff -Nru distinst-0.1.0/vendor/textwrap/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.cargo-checksum.json --- distinst-0.1.0/vendor/textwrap/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".appveyor.yml":"06e5000a6d1742f61e78ad6159585fb0462f66f5ee068cf64381d24af35fc33f",".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".rustfmt.toml":"6faa2937abb6a114e2f099614d492ae8c0fd08f8060497ecd18a3e31c3b5d69f",".travis.yml":"afc3861d80dbffc431e723bd4be8a9065e176fb377d900db1db91957a2a47917","Cargo.toml":"87f0464f83ccefdf1d17f99bc3ea2763938af262bdfe5769fdc767fa55dfa765","LICENSE":"ce93600c49fbb3e14df32efe752264644f6a2f8e08a735ba981725799e5309ef","README.md":"e9b7a7b0f57686eeef59489f0ee1e1d6ffd0517d021b003fdbe0728a3e631e6e","benches/linear.rs":"2e135df4f0db05c22e7a07b1448c43e8e9da509c5edd8decd0c8034795197a64","examples/layout.rs":"ddace5d81f7199109a9b71039c6b4401f7cdab89a99ab67e612d6d64e7f26966","examples/termwidth.rs":"91c6762d35c4a542432885f3949b8db1cf5b5e428a0bec23f780c7bbd31c7fe3","src/lib.rs":"207343badeaea479d6b1fdf3c54a55a2ce400d6352993ac5b98508b519d6bae7"},"package":"f728584ea33b0ad19318e20557cb0a39097751dbb07171419673502f848c7af6"} \ No newline at end of file +{"files":{".appveyor.yml":"71febf4135af9ce7be6350b192d2906078269f0eab94b743e003e02e8191e11f",".rustfmt.toml":"6faa2937abb6a114e2f099614d492ae8c0fd08f8060497ecd18a3e31c3b5d69f",".travis.yml":"0aa0c290da95cef37877fadaad3a668cbffe60533986bbcfa04c7db0c830d674","Cargo.toml":"cb72f8ac90e87d794252acfe2e957fbe0effe937ab2eded759af1daad4bc052d","LICENSE":"ce93600c49fbb3e14df32efe752264644f6a2f8e08a735ba981725799e5309ef","README.md":"9cd343e0b056f823677521bfe96b3ff1440d6a5e4455179ae3fe28cd6c4038da","benches/linear.rs":"0484029d32f3f0e8e0d61085db9cdae610019241a73f05485f9b9a9a7a5e1c53","examples/layout.rs":"7758e5526a8b1718c7a69748a4f63703545b6ac13042d753a6d14de0a1b3edcf","examples/termwidth.rs":"f969e869802d21daf59d1ae23c668539bfb493d5b9ef9c7cbc9de30ce315a529","src/lib.rs":"2c42a300a12236d36d855c2799dae69b1a9de69de97e655d4ced409e814d5c7b","tests/version-numbers.rs":"0d75532e72e9054cb8c8c12b8851e55fad7319ed14482b562f6806872f18dd0f"},"package":"c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/textwrap/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/Cargo.toml --- distinst-0.1.0/vendor/textwrap/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -12,8 +12,9 @@ [package] name = "textwrap" -version = "0.7.0" +version = "0.9.0" authors = ["Martin Geisler "] +exclude = [".dir-locals.el"] description = "Textwrap is a small library for word wrapping, indenting, and\ndedenting strings.\n\nYou can use it to format strings (such as help and error messages) for\ndisplay in commandline applications. It is designed to be efficient\nand handle Unicode characters correctly.\n" documentation = "https://docs.rs/textwrap/" readme = "README.md" @@ -23,19 +24,26 @@ repository = "https://github.com/mgeisler/textwrap" [package.metadata.docs.rs] all-features = true +[dependencies.unicode-width] +version = "0.1.3" + [dependencies.hyphenation] version = "0.6.1" optional = true [dependencies.term_size] version = "0.3.0" - -[dependencies.unicode-width] -version = "0.1.3" +optional = true [dev-dependencies.lipsum] +version = "0.3" + +[dev-dependencies.version-sync] version = "0.2" -[badges.travis-ci] -repository = "mgeisler/textwrap" +[dev-dependencies.rand] +version = "0.3" [badges.appveyor] repository = "mgeisler/textwrap" + +[badges.travis-ci] +repository = "mgeisler/textwrap" diff -Nru distinst-0.1.0/vendor/textwrap/examples/layout.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/examples/layout.rs --- distinst-0.1.0/vendor/textwrap/examples/layout.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/examples/layout.rs 2017-12-21 19:00:07.000000000 +0000 @@ -8,14 +8,14 @@ #[cfg(not(feature = "hyphenation"))] -fn new_wrapper<'a>() -> Wrapper<'a> { +fn new_wrapper<'a>() -> Wrapper<'a, textwrap::HyphenSplitter> { Wrapper::new(0) } #[cfg(feature = "hyphenation")] -fn new_wrapper<'a>() -> Wrapper<'a> { +fn new_wrapper<'a>() -> Wrapper<'a, hyphenation::Corpus> { let corpus = hyphenation::load(Language::English_US).unwrap(); - Wrapper::new(0).word_splitter(Box::new(corpus)) + Wrapper::with_splitter(0, corpus) } fn main() { diff -Nru distinst-0.1.0/vendor/textwrap/examples/termwidth.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/examples/termwidth.rs --- distinst-0.1.0/vendor/textwrap/examples/termwidth.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/examples/termwidth.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,16 +1,19 @@ +#[cfg(feature = "term_size")] extern crate textwrap; -use textwrap::Wrapper; +#[cfg(not(feature = "term_size"))] +fn main() { + println!("Please enable the term_size feature to run this example."); +} +#[cfg(feature = "term_size")] fn main() { - let example = " -Memory safety without garbage collection. -Concurrency without data races. -Zero-cost abstractions. -"; + let example = "Memory safety without garbage collection. \ + Concurrency without data races. \ + Zero-cost abstractions."; // Create a new Wrapper -- automatically set the width to the // current terminal width. - let wrapper = Wrapper::with_termwidth(); + let wrapper = textwrap::Wrapper::with_termwidth(); println!("Formatted in within {} columns:", wrapper.width); println!("----"); println!("{}", wrapper.fill(example)); diff -Nru distinst-0.1.0/vendor/textwrap/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/README.md --- distinst-0.1.0/vendor/textwrap/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -15,7 +15,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -textwrap = "0.7" +textwrap = "0.9" ``` and this to your crate root: @@ -27,7 +27,15 @@ dependency as: ```toml [dependencies] -textwrap = { version: "0.7", features: ["hyphenation"] } +textwrap = { version = "0.9", features = ["hyphenation"] } +``` + +To conveniently wrap text at the current terminal width, enable the +`term_size` feature: + +```toml +[dependencies] +textwrap = { version = "0.9", features = ["term_size"] } ``` ## Documentation @@ -65,7 +73,7 @@ fn main() { let corpus = hyphenation::load(Language::English_US).unwrap(); - let wrapper = Wrapper::new(18).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(18, corpus); let text = "textwrap: a small library for wrapping text."; println!("{}", wrapper.fill(text)) } @@ -173,6 +181,39 @@ This section lists the largest changes per release. +### Version 0.9.0 — October 5th, 2017 + +The dependency on `term_size` is now optional, and by default this +feature is not enabled. This is a *breaking change* for users of +`Wrapper::with_termwidth`. Enable the `term_size` feature to restore +the old functionality. + +Added a regression test for case where width is set to usize::MAX. +Thanks @Fraser999! All public structs now implement `Debug`. + +Issues closed: + +* Fixed [#101][issue-101]: Remove `term_size` as a (hard required) + dependency. + +### Version 0.8.0 — September 4th, 2017 + +The `Wrapper` stuct is now generic over the type of word splitter +being used. This means less boxing and a nicer API. The +`Wrapper::word_splitter` method has been removed. This is a *breaking +API change* if you used the method to change the word splitter. + +The `Wrapper` struct has two new methods that will wrap the input text +lazily: `Wrapper::wrap_iter` and `Wrapper::into_wrap_iter`. Use those +if you will be iterating over the wrapped lines one by one. + +Issues closed: + +* Fixed [#59][issue-59]: `wrap` could return an iterator. Thanks + @hcpl! + +* Fixed [#81][issue-81]: Set `html_root_url` + ### Version 0.7.0 — July 20th, 2017 Version 0.7.0 changes the return type of `Wrapper::wrap` from @@ -266,14 +307,17 @@ [py-textwrap]: https://docs.python.org/library/textwrap [patterns]: https://github.com/tapeinosyne/hyphenation/tree/master/patterns-tex [api-docs]: https://docs.rs/textwrap/ -[issue-13]: ../../issues/13 -[issue-14]: ../../issues/14 -[issue-19]: ../../issues/19 -[issue-25]: ../../issues/25 -[issue-26]: ../../issues/26 -[issue-28]: ../../issues/28 -[issue-36]: ../../issues/36 -[issue-39]: ../../issues/39 -[issue-58]: ../../issues/58 -[issue-61]: ../../issues/61 +[issue-13]: https://github.com/mgeisler/textwrap/issues/13 +[issue-14]: https://github.com/mgeisler/textwrap/issues/14 +[issue-19]: https://github.com/mgeisler/textwrap/issues/19 +[issue-25]: https://github.com/mgeisler/textwrap/issues/25 +[issue-26]: https://github.com/mgeisler/textwrap/issues/26 +[issue-28]: https://github.com/mgeisler/textwrap/issues/28 +[issue-36]: https://github.com/mgeisler/textwrap/issues/36 +[issue-39]: https://github.com/mgeisler/textwrap/issues/39 +[issue-58]: https://github.com/mgeisler/textwrap/issues/58 +[issue-59]: https://github.com/mgeisler/textwrap/issues/59 +[issue-61]: https://github.com/mgeisler/textwrap/issues/61 +[issue-81]: https://github.com/mgeisler/textwrap/issues/81 +[issue-101]: https://github.com/mgeisler/textwrap/issues/101 [mit]: LICENSE diff -Nru distinst-0.1.0/vendor/textwrap/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/src/lib.rs --- distinst-0.1.0/vendor/textwrap/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -4,7 +4,7 @@ //! want to format dynamic output nicely so it looks good in a //! terminal. A quick example: //! -//! ``` +//! ```no_run //! extern crate textwrap; //! use textwrap::fill; //! @@ -41,14 +41,20 @@ //! //! [unicode-width]: https://docs.rs/unicode-width/ +#![doc(html_root_url = "https://docs.rs/textwrap/0.9.0")] #![deny(missing_docs)] +#![deny(missing_debug_implementations)] extern crate unicode_width; +#[cfg(feature = "term_size")] extern crate term_size; #[cfg(feature = "hyphenation")] extern crate hyphenation; +use std::fmt; use std::borrow::Cow; +use std::str::CharIndices; + use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthChar; #[cfg(feature = "hyphenation")] @@ -59,10 +65,10 @@ /// An interface for splitting words. /// -/// When the [`wrap`] method will try to fit text into a line, it will -/// eventually find a word that it too large the current text width. -/// It will then call the currently configured `WordSplitter` to have -/// it attempt to split the word into smaller parts. This trait +/// When the [`wrap_iter`] method will try to fit text into a line, it +/// will eventually find a word that it too large the current text +/// width. It will then call the currently configured `WordSplitter` to +/// have it attempt to split the word into smaller parts. This trait /// describes that functionality via the [`split`] method. /// /// If the `textwrap` crate has been compiled with the `hyphenation` @@ -71,7 +77,7 @@ /// language-aware hyphenation. See the [`hyphenation` documentation] /// for details. /// -/// [`wrap`]: struct.Wrapper.html#method.wrap +/// [`wrap_iter`]: struct.Wrapper.html#method.wrap_iter /// [`split`]: #tymethod.split /// [`hyphenation` documentation]: https://docs.rs/hyphenation/ pub trait WordSplitter { @@ -84,7 +90,7 @@ /// include no split at all. So the word "technology" could be /// split into /// - /// ``` + /// ```no_run /// vec![("tech", "-", "nology"), /// ("technol", "-", "ogy"), /// ("technolo", "-", "gy"), @@ -99,11 +105,12 @@ /// ``` /// use textwrap::{Wrapper, NoHyphenation}; /// -/// let wrapper = Wrapper::new(8).word_splitter(Box::new(NoHyphenation)); +/// let wrapper = Wrapper::with_splitter(8, NoHyphenation); /// assert_eq!(wrapper.wrap("foo bar-baz"), vec!["foo", "bar-baz"]); /// ``` /// /// [`Wrapper.splitter`]: struct.Wrapper.html#structfield.splitter +#[derive(Clone, Debug)] pub struct NoHyphenation; /// `NoHyphenation` implements `WordSplitter` by not splitting the @@ -119,10 +126,12 @@ /// /// You probably don't need to use this type since it's already used /// by default by `Wrapper::new`. +#[derive(Clone, Debug)] pub struct HyphenSplitter; -/// HyphenSplitter is the default WordSplitter used by `Wrapper::new`. -/// It will split words on any existing hyphens in the word. +/// `HyphenSplitter` is the default `WordSplitter` used by +/// `Wrapper::new`. It will split words on any existing hyphens in the +/// word. /// /// It will only use hyphens that are surrounded by alphanumeric /// characters, which prevents a word like "--foo-bar" from being @@ -148,7 +157,7 @@ Some((idx, cur)) => (idx, cur), }; - while let Some((i, next)) = char_indices.next() { + for (i, next) in char_indices { if prev.is_alphanumeric() && cur == '-' && next.is_alphanumeric() { let (head, tail) = word.split_at(idx + 1); triples.push((head, "", tail)); @@ -172,7 +181,7 @@ fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)> { // Find splits based on language corpus. let mut triples = Vec::new(); - for n in word.opportunities(&self) { + for n in word.opportunities(self) { let (head, tail) = word.split_at(n); let hyphen = if head.ends_with('-') { "" } else { "-" }; triples.push((head, hyphen, tail)); @@ -184,7 +193,7 @@ } } -/// Backport of the AddAssign trait implementation from Rust 1.14. +/// Backport of the `AddAssign` trait implementation from Rust 1.14. fn cow_add_assign<'a>(lhs: &mut Cow<'a, str>, rhs: &'a str) { if lhs.is_empty() { *lhs = Cow::Borrowed(rhs) @@ -202,17 +211,20 @@ /// A Wrapper holds settings for wrapping and filling text. Use it -/// when the convenience [`wrap`] and [`fill`] functions are not -/// flexible enough. +/// when the convenience [`wrap_iter`], [`wrap`] and [`fill`] functions +/// are not flexible enough. /// +/// [`wrap_iter`]: fn.wrap_iter.html /// [`wrap`]: fn.wrap.html /// [`fill`]: fn.fill.html /// -/// The algorithm used by the `wrap` method works by doing a single -/// scan over words in the input string and splitting them into one or -/// more lines. The time and memory complexity is O(*n*) where *n* is -/// the length of the input string. -pub struct Wrapper<'a> { +/// The algorithm used by the `WrapIter` iterator (returned from the +/// `wrap_iter` method) works by doing successive partial scans over +/// words in the input string (where each single scan yields a single +/// line) so that the overall time and memory complexity is O(*n*) where +/// *n* is the length of the input string. +#[derive(Clone, Debug)] +pub struct Wrapper<'a, S: WordSplitter> { /// The width in columns at which the text will be wrapped. pub width: usize, /// Indentation used for the first line of output. @@ -220,16 +232,16 @@ /// Indentation used for subsequent lines of output. pub subsequent_indent: &'a str, /// Allow long words to be broken if they cannot fit on a line. - /// When set to `false`, some lines be being longer than + /// When set to `false`, some lines may be longer than /// `self.width`. pub break_words: bool, /// The method for splitting words. If the `hyphenation` feature /// is enabled, you can use a `hyphenation::language::Corpus` here /// to get language-aware hyphenation. - pub splitter: Box, + pub splitter: S, } -impl<'a> Wrapper<'a> { +impl<'a> Wrapper<'a, HyphenSplitter> { /// Create a new Wrapper for wrapping at the specified width. By /// default, we allow words longer than `width` to be broken. A /// [`HyphenSplitter`] will be used by default for splitting @@ -237,43 +249,85 @@ /// /// [`HyphenSplitter`]: struct.HyphenSplitter.html /// [`WordSplitter`]: trait.WordSplitter.html - pub fn new(width: usize) -> Wrapper<'a> { - Wrapper { - width: width, - initial_indent: "", - subsequent_indent: "", - break_words: true, - splitter: Box::new(HyphenSplitter), - } + pub fn new(width: usize) -> Wrapper<'a, HyphenSplitter> { + Wrapper::with_splitter(width, HyphenSplitter) } - /// Crate a new Wrapper for wrapping text at the current terminal + /// Create a new Wrapper for wrapping text at the current terminal /// width. If the terminal width cannot be determined (typically /// because the standard input and output is not connected to a /// terminal), a width of 80 characters will be used. Other /// settings use the same defaults as `Wrapper::new`. - pub fn with_termwidth() -> Wrapper<'a> { - Wrapper::new(term_size::dimensions_stdout().map_or(80, |(w, _)| w)) + /// + /// Equivalent to: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::{Wrapper, termwidth}; + /// + /// let wrapper = Wrapper::new(termwidth()); + /// ``` + #[cfg(feature = "term_size")] + pub fn with_termwidth() -> Wrapper<'a, HyphenSplitter> { + Wrapper::new(termwidth()) + } +} + +impl<'w, 'a: 'w, S: WordSplitter> Wrapper<'a, S> { + /// Use the given [`WordSplitter`] to create a new Wrapper for + /// wrapping at the specified width. By default, we allow words + /// longer than `width` to be broken. + /// + /// [`WordSplitter`]: trait.WordSplitter.html + pub fn with_splitter(width: usize, splitter: S) -> Wrapper<'a, S> { + Wrapper { + width: width, + initial_indent: "", + subsequent_indent: "", + break_words: true, + splitter: splitter, + } } /// Change [`self.initial_indent`]. The initial indentation is - /// used on the very first line of output. Setting it to something - /// like `"* "` can be useful if you are formatting an item in a - /// bulleted list. You will then probably want to set - /// `self.subsequent_indent` to `" "`. + /// used on the very first line of output. + /// + /// # Examples + /// + /// Classic paragraph indentation can be achieved by specifying an + /// initial indentation and wrapping each paragraph by itself: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::Wrapper; + /// + /// let wrapper = Wrapper::new(15).initial_indent(" "); + /// ``` /// /// [`self.initial_indent`]: #structfield.initial_indent - pub fn initial_indent(self, indent: &'a str) -> Wrapper<'a> { + pub fn initial_indent(self, indent: &'a str) -> Wrapper<'a, S> { Wrapper { initial_indent: indent, ..self } } /// Change [`self.subsequent_indent`]. The subsequent indentation - /// is used on lines following the first line of output. Setting - /// it to something like `" "` can be useful if you are - /// formatting an item in a bulleted list. + /// is used on lines following the first line of output. + /// + /// # Examples + /// + /// Combining initial and subsequent indentation lets you format a + /// single paragraph as a bullet list: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::Wrapper; + /// + /// let wrapper = Wrapper::new(15) + /// .initial_indent("* ") + /// .subsequent_indent(" "); + /// ``` /// /// [`self.subsequent_indent`]: #structfield.subsequent_indent - pub fn subsequent_indent(self, indent: &'a str) -> Wrapper<'a> { + pub fn subsequent_indent(self, indent: &'a str) -> Wrapper<'a, S> { Wrapper { subsequent_indent: indent, ..self } } @@ -282,22 +336,10 @@ /// sticking out into the right margin. /// /// [`self.break_words`]: #structfield.break_words - pub fn break_words(self, setting: bool) -> Wrapper<'a> { + pub fn break_words(self, setting: bool) -> Wrapper<'a, S> { Wrapper { break_words: setting, ..self } } - /// Change [`self.splitter`]. The word splitter is consulted when - /// a word is too wide to fit the current line. By changing this, - /// you can decide if such words should be hyphenated or left - /// alone. Hyphenation can be done using existing hyphens (see - /// [`HyphenSplitter`]) or it can be based on TeX hyphenation - /// patterns, if the `hyphenation` feature is enabled. - /// - /// [`self.splitter`]: #structfield.splitter - pub fn word_splitter(self, splitter: Box) -> Wrapper<'a> { - Wrapper { splitter: splitter, ..self } - } - /// Fill a line of text at `self.width` characters. Strings are /// wrapped based on their displayed width, not their size in /// bytes. @@ -305,6 +347,14 @@ /// The result is a string with newlines between each line. Use /// the `wrap` method if you need access to the individual lines. /// + /// # Complexities + /// + /// This method simply joins the lines produced by `wrap_iter`. As + /// such, it inherits the O(*n*) time and memory complexity where + /// *n* is the input string length. + /// + /// # Examples + /// /// ``` /// use textwrap::Wrapper; /// @@ -312,18 +362,33 @@ /// assert_eq!(wrapper.fill("Memory safety without garbage collection."), /// "Memory safety\nwithout garbage\ncollection."); /// ``` - /// - /// This method simply joins the lines produced by `wrap`. As - /// such, it inherits the O(*n*) time and memory complexity where - /// *n* is the input string length. pub fn fill(&self, s: &str) -> String { - self.wrap(s).join("\n") + // This will avoid reallocation in simple cases (no + // indentation, no hyphenation). + let mut result = String::with_capacity(s.len()); + + for (i, line) in self.wrap_iter(s).enumerate() { + if i > 0 { + result.push('\n'); + } + result.push_str(&line); + } + + result } /// Wrap a line of text at `self.width` characters. Strings are /// wrapped based on their displayed width, not their size in /// bytes. /// + /// # Complexities + /// + /// This method simply collects the lines produced by `wrap_iter`. + /// As such, it inherits the O(*n*) overall time and memory + /// complexity where *n* is the input string length. + /// + /// # Examples + /// /// ``` /// use textwrap::Wrapper; /// @@ -338,53 +403,235 @@ /// vec!["Concurrency without", /// "data races."]); /// ``` + pub fn wrap(&self, s: &'a str) -> Vec> { + self.wrap_iter(s).collect::>() + } + + /// Lazily wrap a line of text at `self.width` characters. Strings + /// are wrapped based on their displayed width, not their size in + /// bytes. /// /// The [`WordSplitter`] stored in [`self.splitter`] is used /// whenever when a word is too large to fit on the current line. /// By changing the field, different hyphenation strategies can be /// implemented. /// - /// This method does a single scan over the input string, it has - /// an O(*n*) time and memory complexity where *n* is the input - /// string length. + /// # Complexities + /// + /// This method returns a [`WrapIter`] iterator which borrows this + /// `Wrapper`. The algorithm used has a linear complexity, so + /// getting the next line from the iterator will take O(*w*) time, + /// where *w* is the wrapping width. Fully processing the iterator + /// will take O(*n*) time for an input string of length *n*. + /// + /// When no indentation is used, each line returned is a slice of + /// the input string and the memory overhead is thus constant. + /// Otherwise new memory is allocated for each line returned. + /// + /// # Examples + /// + /// ``` + /// use std::borrow::Cow; + /// use textwrap::Wrapper; + /// + /// let wrap20 = Wrapper::new(20); + /// let mut wrap20_iter = wrap20.wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); + /// assert_eq!(wrap20_iter.next(), None); + /// + /// let wrap25 = Wrapper::new(25); + /// let mut wrap25_iter = wrap25.wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap25_iter.next(), Some(Cow::from("Zero-cost abstractions."))); + /// assert_eq!(wrap25_iter.next(), None); + /// ``` /// /// [`self.splitter`]: #structfield.splitter /// [`WordSplitter`]: trait.WordSplitter.html + /// [`WrapIter`]: struct.WrapIter.html + pub fn wrap_iter(&'w self, s: &'a str) -> WrapIter<'w, 'a, S> { + WrapIter { + wrapper: self, + wrap_iter_impl: WrapIterImpl::new(self, s), + } + } + + /// Lazily wrap a line of text at `self.width` characters. Strings + /// are wrapped based on their displayed width, not their size in + /// bytes. /// - pub fn wrap(&self, s: &'a str) -> Vec> { - let mut lines = Vec::with_capacity(s.len() / (self.width + 1)); - // Byte index where the current line starts. - let mut start = 0; - // Byte index of the last place where the string can be split. - let mut split = 0; - // Size in bytes of the character at s[split]. - let mut split_len = 0; - // Width of s[start..idx]. - let mut line_width = self.initial_indent.width(); - // Width of s[start..split]. - let mut line_width_at_split = line_width; - // Tracking runs of whitespace characters. - let mut in_whitespace = false; + /// The [`WordSplitter`] stored in [`self.splitter`] is used + /// whenever when a word is too large to fit on the current line. + /// By changing the field, different hyphenation strategies can be + /// implemented. + /// + /// # Complexities + /// + /// This method consumes the `Wrapper` and returns a + /// [`IntoWrapIter`] iterator. Fully processing the iterator has + /// the same O(*n*) time complexity as [`wrap_iter`], where *n* is + /// the length of the input string. + /// + /// # Examples + /// + /// ``` + /// use std::borrow::Cow; + /// use textwrap::Wrapper; + /// + /// let wrap20 = Wrapper::new(20); + /// let mut wrap20_iter = wrap20.into_wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); + /// assert_eq!(wrap20_iter.next(), None); + /// ``` + /// + /// [`self.splitter`]: #structfield.splitter + /// [`WordSplitter`]: trait.WordSplitter.html + /// [`IntoWrapIter`]: struct.IntoWrapIter.html + /// [`wrap_iter`]: #method.wrap_iter + pub fn into_wrap_iter(self, s: &'a str) -> IntoWrapIter<'a, S> { + let wrap_iter_impl = WrapIterImpl::new(&self, s); + + IntoWrapIter { + wrapper: self, + wrap_iter_impl: wrap_iter_impl, + } + } +} - let mut line = Cow::from(self.initial_indent); - for (idx, ch) in s.char_indices() { +/// An iterator over the lines of the input string which owns a +/// `Wrapper`. An instance of `IntoWrapIter` is typically obtained +/// through either [`wrap_iter`] or [`Wrapper::into_wrap_iter`]. +/// +/// Each call of `.next()` method yields a line wrapped in `Some` if the +/// input hasn't been fully processed yet. Otherwise it returns `None`. +/// +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`Wrapper::into_wrap_iter`]: struct.Wrapper.html#method.into_wrap_iter +#[derive(Debug)] +pub struct IntoWrapIter<'a, S: WordSplitter> { + wrapper: Wrapper<'a, S>, + wrap_iter_impl: WrapIterImpl<'a>, +} + +impl<'a, S: WordSplitter> Iterator for IntoWrapIter<'a, S> { + type Item = Cow<'a, str>; + + fn next(&mut self) -> Option> { + self.wrap_iter_impl.impl_next(&self.wrapper) + } +} + +/// An iterator over the lines of the input string which borrows a +/// `Wrapper`. An instance of `WrapIter` is typically obtained +/// through the [`Wrapper::wrap_iter`] method. +/// +/// Each call of `.next()` method yields a line wrapped in `Some` if the +/// input hasn't been fully processed yet. Otherwise it returns `None`. +/// +/// [`Wrapper::wrap_iter`]: struct.Wrapper.html#method.wrap_iter +#[derive(Debug)] +pub struct WrapIter<'w, 'a: 'w, S: WordSplitter + 'w> { + wrapper: &'w Wrapper<'a, S>, + wrap_iter_impl: WrapIterImpl<'a>, +} + +impl<'w, 'a: 'w, S: WordSplitter> Iterator for WrapIter<'w, 'a, S> { + type Item = Cow<'a, str>; + + fn next(&mut self) -> Option> { + self.wrap_iter_impl.impl_next(self.wrapper) + } +} + +struct WrapIterImpl<'a> { + // String to wrap. + source: &'a str, + // CharIndices iterator over self.source. + char_indices: CharIndices<'a>, + // Is the next element the first one ever produced? + is_next_first: bool, + // Byte index where the current line starts. + start: usize, + // Byte index of the last place where the string can be split. + split: usize, + // Size in bytes of the character at self.source[self.split]. + split_len: usize, + // Width of self.source[self.start..idx]. + line_width: usize, + // Width of self.source[self.start..self.split]. + line_width_at_split: usize, + // Tracking runs of whitespace characters. + in_whitespace: bool, + // Has iterator finished producing elements? + finished: bool, +} + +impl<'a> fmt::Debug for WrapIterImpl<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("WrapIterImpl") + .field("source", &self.source) + .field("char_indices", &"CharIndices { ... }") + .field("is_next_first", &self.is_next_first) + .field("start", &self.start) + .field("split", &self.split) + .field("split_len", &self.split_len) + .field("line_width", &self.line_width) + .field("line_width_at_split", &self.line_width_at_split) + .field("in_whitespace", &self.in_whitespace) + .field("finished", &self.finished) + .finish() + } +} + +impl<'a> WrapIterImpl<'a> { + fn new(wrapper: &Wrapper<'a, S>, s: &'a str) -> WrapIterImpl<'a> { + WrapIterImpl { + source: s, + char_indices: s.char_indices(), + is_next_first: true, + start: 0, + split: 0, + split_len: 0, + line_width: wrapper.initial_indent.width(), + line_width_at_split: wrapper.initial_indent.width(), + in_whitespace: false, + finished: false, + } + } + + fn create_result_line(&mut self, wrapper: &Wrapper<'a, S>) -> Cow<'a, str> { + if self.is_next_first { + self.is_next_first = false; + Cow::from(wrapper.initial_indent) + } else { + Cow::from(wrapper.subsequent_indent) + } + } + + fn impl_next(&mut self, wrapper: &Wrapper<'a, S>) -> Option> { + if self.finished { + return None; + } + + while let Some((idx, ch)) = self.char_indices.next() { let char_width = ch.width().unwrap_or(0); let char_len = ch.len_utf8(); if ch.is_whitespace() && ch != NBSP { // Extend the previous split or create a new one. - if in_whitespace { - split_len += char_len; + if self.in_whitespace { + self.split_len += char_len; } else { - split = idx; - split_len = char_len; + self.split = idx; + self.split_len = char_len; } - line_width_at_split = line_width + char_width; - in_whitespace = true; - } else if line_width + char_width > self.width { + self.line_width_at_split = self.line_width + char_width; + self.in_whitespace = true; + } else if self.line_width + char_width > wrapper.width { // There is no room for this character on the current // line. Try to split the final word. - let remaining_text = &s[split + split_len..]; + let remaining_text = &self.source[self.split + self.split_len..]; let final_word = match remaining_text .find(|ch: char| ch.is_whitespace() && ch != NBSP) { Some(i) => &remaining_text[..i], @@ -392,62 +639,96 @@ }; let mut hyphen = ""; - let splits = self.splitter.split(final_word); + let splits = wrapper.splitter.split(final_word); for &(head, hyp, _) in splits.iter().rev() { - if line_width_at_split + head.width() + hyp.width() <= self.width { - split += head.len(); - split_len = 0; + if self.line_width_at_split + head.width() + hyp.width() <= wrapper.width { + self.split += head.len(); + self.split_len = 0; hyphen = hyp; break; } } - if start >= split { + if self.start >= self.split { // The word is too big to fit on a single line, so we // need to split it at the current index. - if self.break_words { + if wrapper.break_words { // Break work at current index. - split = idx; - split_len = 0; - line_width_at_split = line_width; + self.split = idx; + self.split_len = 0; + self.line_width_at_split = self.line_width; } else { // Add smallest split. - split = start + splits[0].0.len(); - split_len = 0; - line_width_at_split = line_width; + self.split = self.start + splits[0].0.len(); + self.split_len = 0; + self.line_width_at_split = self.line_width; } } - if start < split { - cow_add_assign(&mut line, &s[start..split]); - cow_add_assign(&mut line, hyphen); - lines.push(line); - line = Cow::from(self.subsequent_indent); - start = split + split_len; - line_width += self.subsequent_indent.width(); - line_width -= line_width_at_split; + if self.start < self.split { + let mut result_line = self.create_result_line(wrapper); + cow_add_assign(&mut result_line, &self.source[self.start..self.split]); + cow_add_assign(&mut result_line, hyphen); + + self.start = self.split + self.split_len; + self.line_width += wrapper.subsequent_indent.width(); + self.line_width -= self.line_width_at_split; + self.line_width += char_width; + + return Some(result_line); } } else { - in_whitespace = false; + self.in_whitespace = false; } - line_width += char_width; + self.line_width += char_width; } // Add final line. - if start < s.len() { - cow_add_assign(&mut line, &s[start..]); - lines.push(line); - } + let final_line = if self.start < self.source.len() { + let mut result_line = self.create_result_line(wrapper); + cow_add_assign(&mut result_line, &self.source[self.start..]); + + Some(result_line) + } else { + None + }; - lines + self.finished = true; + + final_line } } + +/// Return the current terminal width. If the terminal width cannot be +/// determined (typically because the standard output is not connected +/// to a terminal), a default width of 80 characters will be used. +/// +/// # Examples +/// +/// Create a `Wrapper` for the current terminal with a two column +/// margin: +/// +/// ```no_run +/// # #![allow(unused_variables)] +/// use textwrap::{Wrapper, NoHyphenation, termwidth}; +/// +/// let width = termwidth() - 4; // Two columns on each side. +/// let wrapper = Wrapper::with_splitter(width, NoHyphenation) +/// .initial_indent(" ") +/// .subsequent_indent(" "); +/// ``` +#[cfg(feature = "term_size")] +pub fn termwidth() -> usize { + term_size::dimensions_stdout().map_or(80, |(w, _)| w) +} + /// Fill a line of text at `width` characters. Strings are wrapped /// based on their displayed width, not their size in bytes. /// -/// The result is a string with newlines between each line. Use `wrap` -/// if you need access to the individual lines. +/// The result is a string with newlines between each line. Use +/// [`wrap`] if you need access to the individual lines or +/// [`wrap_iter`] for its iterator counterpart. /// /// ``` /// use textwrap::fill; @@ -458,15 +739,29 @@ /// /// This function creates a Wrapper on the fly with default settings. /// If you need to set a language corpus for automatic hyphenation, or -/// need to fill many strings, then it is suggested to create Wrapper -/// and call its [`fill` method](struct.Wrapper.html#method.fill). +/// need to fill many strings, then it is suggested to create a Wrapper +/// and call its [`fill` method]. +/// +/// [`wrap`]: fn.wrap.html +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`fill` method]: struct.Wrapper.html#method.fill pub fn fill(s: &str, width: usize) -> String { - wrap(s, width).join("\n") + Wrapper::new(width).fill(s) } /// Wrap a line of text at `width` characters. Strings are wrapped /// based on their displayed width, not their size in bytes. /// +/// This function creates a Wrapper on the fly with default settings. +/// If you need to set a language corpus for automatic hyphenation, or +/// need to wrap many strings, then it is suggested to create a Wrapper +/// and call its [`wrap` method]. +/// +/// The result is a vector of strings. Use [`wrap_iter`] if you need an +/// iterator version. +/// +/// # Examples +/// /// ``` /// use textwrap::wrap; /// @@ -480,12 +775,46 @@ /// "data races."]); /// ``` /// +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`wrap` method]: struct.Wrapper.html#method.wrap +pub fn wrap(s: &str, width: usize) -> Vec> { + Wrapper::new(width).wrap(s) +} + +/// Lazily wrap a line of text at `self.width` characters. Strings are +/// wrapped based on their displayed width, not their size in bytes. +/// /// This function creates a Wrapper on the fly with default settings. +/// It then calls the [`into_wrap_iter`] method. Hence, the return +/// value is an [`IntoWrapIter`], not a [`WrapIter`] as the function +/// name would otherwise suggest. +/// /// If you need to set a language corpus for automatic hyphenation, or -/// need to wrap many strings, then it is suggested to create Wrapper -/// and call its [`wrap` method](struct.Wrapper.html#method.wrap). -pub fn wrap<'a>(s: &'a str, width: usize) -> Vec> { - Wrapper::new(width).wrap(s) +/// need to wrap many strings, then it is suggested to create a Wrapper +/// and call its [`wrap_iter`] or [`into_wrap_iter`] methods. +/// +/// # Examples +/// +/// ``` +/// use std::borrow::Cow; +/// use textwrap::wrap_iter; +/// +/// let mut wrap20_iter = wrap_iter("Zero-cost abstractions.", 20); +/// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); +/// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); +/// assert_eq!(wrap20_iter.next(), None); +/// +/// let mut wrap25_iter = wrap_iter("Zero-cost abstractions.", 25); +/// assert_eq!(wrap25_iter.next(), Some(Cow::from("Zero-cost abstractions."))); +/// assert_eq!(wrap25_iter.next(), None); +/// ``` +/// +/// [`wrap_iter`]: struct.Wrapper.html#method.wrap_iter +/// [`into_wrap_iter`]: struct.Wrapper.html#method.into_wrap_iter +/// [`IntoWrapIter`]: struct.IntoWrapIter.html +/// [`WrapIter`]: struct.WrapIter.html +pub fn wrap_iter(s: &str, width: usize) -> IntoWrapIter { + Wrapper::new(width).into_wrap_iter(s) } /// Add prefix to each non-empty line. @@ -587,11 +916,10 @@ #[cfg(feature = "hyphenation")] use hyphenation::Language; use super::*; - use std::borrow::Cow; /// Add newlines. Ensures that the final line in the vector also /// has a newline. - fn add_nl(lines: &Vec<&str>) -> String { + fn add_nl(lines: &[&str]) -> String { lines.join("\n") + "\n" } @@ -621,6 +949,11 @@ } #[test] + fn max_width() { + assert_eq!(wrap("foo bar", usize::max_value()), vec!["foo bar"]); + } + + #[test] fn leading_whitespace() { assert_eq!(wrap(" foo bar", 6), vec![" foo", "bar"]); } @@ -728,7 +1061,7 @@ #[test] fn no_hyphenation() { - let wrapper = Wrapper::new(8).word_splitter(Box::new(NoHyphenation)); + let wrapper = Wrapper::with_splitter(8, NoHyphenation); assert_eq!(wrapper.wrap("foo bar-baz"), vec!["foo", "bar-baz"]); } @@ -740,7 +1073,7 @@ assert_eq!(wrapper.wrap("Internationalization"), vec!["Internatio", "nalization"]); - let wrapper = wrapper.word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(10, corpus); assert_eq!(wrapper.wrap("Internationalization"), vec!["Interna-", "tionaliza-", "tion"]); } @@ -750,16 +1083,17 @@ fn borrowed_lines() { // Lines that end with an extra hyphen are owned, the final // line is borrowed. + use std::borrow::Cow::{Borrowed, Owned}; let corpus = hyphenation::load(Language::English_US).unwrap(); - let wrapper = Wrapper::new(10).word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(10, corpus); let lines = wrapper.wrap("Internationalization"); - if let Cow::Borrowed(s) = lines[0] { + if let Borrowed(s) = lines[0] { assert!(false, "should not have been borrowed: {:?}", s); } - if let Cow::Borrowed(s) = lines[1] { + if let Borrowed(s) = lines[1] { assert!(false, "should not have been borrowed: {:?}", s); } - if let Cow::Owned(ref s) = lines[2] { + if let Owned(ref s) = lines[2] { assert!(false, "should not have been owned: {:?}", s); } } @@ -771,7 +1105,7 @@ let wrapper = Wrapper::new(8).break_words(false); assert_eq!(wrapper.wrap("over-caffinated"), vec!["over-", "caffinated"]); - let wrapper = wrapper.word_splitter(Box::new(corpus)); + let wrapper = Wrapper::with_splitter(8, corpus).break_words(false); assert_eq!(wrapper.wrap("over-caffinated"), vec!["over-", "caffi-", "nated"]); } diff -Nru distinst-0.1.0/vendor/textwrap/tests/version-numbers.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/tests/version-numbers.rs --- distinst-0.1.0/vendor/textwrap/tests/version-numbers.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/tests/version-numbers.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,12 @@ +#[macro_use] +extern crate version_sync; + +#[test] +fn test_readme_deps() { + assert_markdown_deps_updated!("README.md"); +} + +#[test] +fn test_html_root_url() { + assert_html_root_url_updated!("src/lib.rs"); +} diff -Nru distinst-0.1.0/vendor/textwrap/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.travis.yml --- distinst-0.1.0/vendor/textwrap/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/textwrap/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -7,6 +7,15 @@ cache: cargo +before_install: + # We need Rust 1.15 or later for version-sync + - | + if [[ "$TRAVIS_RUST_VERSION" =~ 1\.(8|13)\.0 ]]; then + echo "Old Rust detected, removing version-sync dependency" + sed -i "/^version-sync =/d" Cargo.toml + rm "tests/version-numbers.rs" + fi + script: - cargo build --verbose --features "$FEATURES" - cargo test --verbose --features "$FEATURES" diff -Nru distinst-0.1.0/vendor/time/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/time/.cargo-checksum.json --- distinst-0.1.0/vendor/time/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/time/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"9555a092ed1f87de52b07a90c614a30c6fa8f307eb4b05229253d06df363ce7a","Cargo.toml":"e51328f4f8dd0d9b1f039121c70de3e8bb4cf29975a64036af64c95bfeaa9e72","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"2c17f942c4a797f6f491c6d40570f904f35047531884ded3244438832b3d6f0a","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","benches/precise_time_ns.rs":"f331c85489a05ea3bb83df9d57131a6e651ce852ca881417f328c4e8f53503c6","src/display.rs":"b79a81b4f068e44934ad3398ba0259120cc30cf0855ac5108c4569e320fd7f1d","src/duration.rs":"032f2ced8ea4dddaf6ed111f345e99217bad17edb7ed9fc4c511e405c8e02b87","src/lib.rs":"d01631b2340e30673e4c809678a5bdd3f8c18debb25ada21805a990254cb7caf","src/parse.rs":"717ae5735dfdaaba513f2a54a179e73bb2a48f8d4fb8787740d4662d6ff3389c","src/sys.rs":"0ca713b16747d046e4ce117828148bea66f23f4d461ad17045a24c7895d62be7"},"package":"d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"} \ No newline at end of file +{"files":{".travis.yml":"9555a092ed1f87de52b07a90c614a30c6fa8f307eb4b05229253d06df363ce7a","Cargo.toml":"e51328f4f8dd0d9b1f039121c70de3e8bb4cf29975a64036af64c95bfeaa9e72","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"2c17f942c4a797f6f491c6d40570f904f35047531884ded3244438832b3d6f0a","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","benches/precise_time_ns.rs":"f331c85489a05ea3bb83df9d57131a6e651ce852ca881417f328c4e8f53503c6","src/display.rs":"b79a81b4f068e44934ad3398ba0259120cc30cf0855ac5108c4569e320fd7f1d","src/duration.rs":"032f2ced8ea4dddaf6ed111f345e99217bad17edb7ed9fc4c511e405c8e02b87","src/lib.rs":"d01631b2340e30673e4c809678a5bdd3f8c18debb25ada21805a990254cb7caf","src/parse.rs":"717ae5735dfdaaba513f2a54a179e73bb2a48f8d4fb8787740d4662d6ff3389c","src/sys.rs":"0ca713b16747d046e4ce117828148bea66f23f4d461ad17045a24c7895d62be7"},"package":"d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/toml/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/.cargo-checksum.json --- distinst-0.1.0/vendor/toml/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"f0a813e5ed7f0d04cbf2c3207158a36da4b8d5b32252569148d68ff0cb40002d","Cargo.toml":"4e19bfd3eca470b9608de75a2d009cb8e2547b59461638a3a112e0a36941ab87","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"9ad4e828e7a51f787841486d72139eb46369aa1a10d20a8934bac546730fffcf","examples/decode.rs":"c6b42a3c8ab2ce81bbdf6e355450d2c152aed59845c4bfea5272ccf1c7a7cb15","examples/toml2json.rs":"eaa9ad85ec19714f6437048ae28b844966225a17055d1a37878f41bcbc2c5e47","src/datetime.rs":"21e088423744d01e483de2c50e4b86fd087e011d23c639c55a4448d7381d7e87","src/de.rs":"e64e2822b87dda2e6796e61c803ce5ae4f82513a957e500c840a1e00383a679c","src/lib.rs":"a32fe6b3a720e6eb7d557f08dcdda33410cdd25b815cf3044f1d8d4f16afc1f5","src/ser.rs":"5868fb57b5046030e4c5dfdc87f5995149ccdaa0e7dd987444535de572ac479b","src/tokens.rs":"981f1613fd73bd1624ac2da7017b8377d20bc75bd5ad7c18df478bea0ac70805","src/value.rs":"b3cfd188e1e25354c693c7d6c649515f0cfd451b454de30d971e9603a8092818","src/value/display.rs":"e6997018f84ff7c2d78785b49c6a38a45c1d74bf691aa174b277cfedacb84403","tests/README.md":"3e7d07d64c34e117c3d862ee12e4947af8c133fb0b53f6f0de43cc3bfa5057b8","tests/backcompat.rs":"1d40b13ed379832d31c5d1ae35b9a3c9d9f66ab0ec40e7c16f46139d2fb4c35e","tests/datetime.rs":"c76e7f60514a748c56e09c369d888ea22d8e600b0200275da62dc8ad47ce9761","tests/display-tricky.rs":"e0ffa4f992ac1b3f6c88cf2dc299b605c6352ca3dcf18a4253fdb9b98ef410fd","tests/display.rs":"4472cf88c0ccc58d47b109570f8b19a218ac274ab5293df9e67db2db4f6e5945","tests/formatting.rs":"8941f2fe843d5294ef3dc7ff8aaa3db325d4ec368f1d138f8c28ab4e18c8261b","tests/invalid-encoder/array-mixed-types-ints-and-floats.json":"206d2a353153efbcee74e7ee7b0f852e7a948cfb88417f74607b3ad6f020e373","tests/invalid-misc.rs":"7ff25428e87ba797d9cfa5c181845a6d7669873be1d891cbead4e4aa4f236349","tests/invalid.rs":"f6798f22652c2c09c23b066af33b402319399f7106ef5c9fda1a5222af522856","tests/invalid/array-mixed-types-arrays-and-ints.toml":"c1547b686357c7a865e333a7ce7eed1e30743ebc4daac8ea6148bdd84b7e4dc7","tests/invalid/array-mixed-types-ints-and-floats.toml":"baa235fc168869716680955fd5bdafab30b6fa9b3d09185086261a56ef12960e","tests/invalid/array-mixed-types-strings-and-ints.toml":"4440057ed90d4461db0be55cfd71299cad96b601d5faec2140666242f6fde147","tests/invalid/datetime-malformed-no-leads.toml":"1fa6bf72ea0b96be835ac031408f7acfd0b8d18d5f54b4c0fce8136aad27d22e","tests/invalid/datetime-malformed-no-secs.toml":"b9c30b7fa1847c80e381d68cc79834eefbb8813cd0eff465fb7cbe0733df429b","tests/invalid/datetime-malformed-no-t.toml":"490a46d2e707ef4f87987ec12a22afa5a71c97c5eaa0f4201a174c47846c6a4a","tests/invalid/datetime-malformed-with-milli.toml":"62bfd0a6645bcb3f78211523e5673a3d1fa726d9e942c1643df243d6fba474c8","tests/invalid/duplicate-key-table.toml":"a896ea2180d16fcdd4f6c30aa27529b5b29e7e195a4e7a9944343028783602e9","tests/invalid/duplicate-keys.toml":"4bb0a65c22e7704893a2a51334eb2518af702850ef59aeecd5226e7b26bc07ec","tests/invalid/duplicate-tables.toml":"23b16ce26e1155ee6bf1fff559701dce86475c6a2878536b61f6b7e68be340de","tests/invalid/empty-implicit-table.toml":"d6026110dc0dee7babd69592218819328caa425f48cc879e895b29e48550c06c","tests/invalid/empty-table.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/float-no-leading-zero.toml":"159654461094c938574ba2d2d09baa3d3c387dd6ed024fd411530c0573a1ec42","tests/invalid/float-no-trailing-digits.toml":"64e4f336186cd096be2804532dbd694dd50ea551d292a9cdbf0bef2abf227101","tests/invalid/key-after-array.toml":"314af33770170b53bf2ec3be43ea1609d981c81d62c968052499b85ed54ccce8","tests/invalid/key-after-table.toml":"ed0dcf38f003d184dd18d1518702da0115cbfb05a5a28cbcf42de2f9bdee05fa","tests/invalid/key-empty.toml":"4303477abf4c0b920b42e96edd61caecf9c1f2d5d97f56af876854cd725aff3c","tests/invalid/key-hash.toml":"cd2a2eba6032d32c829633d3cd2778aeba81f5ff554e69f62af6557d1dc712f6","tests/invalid/key-newline.toml":"06a313a6bd70c2db6a1f5bda479d854d8f87e037e3cabf18fb5db822466ffcac","tests/invalid/key-open-bracket.toml":"52dea939022949290e3a19f1291d15605429344dce3cd1aa1f1568ecad8ca365","tests/invalid/key-single-open-bracket.toml":"245843abef9e72e7efac30138a994bf6301e7e1d7d7042a33d42e863d2638811","tests/invalid/key-space.toml":"b4e336d07c27fb3d0f0a6e50b733e1546202dfd58aaf2f7956f56fd6f075b0a1","tests/invalid/key-start-bracket.toml":"3bd3748a9df1d25ab2661330a3da187bd4da3958292bbf0e8b59d7963634dd87","tests/invalid/key-two-equals.toml":"3ac0c4e339d47c86e57564e43147b772ae83933b78083dc78d0ef77e231df3f1","tests/invalid/string-bad-byte-escape.toml":"c665dcec7c02f442c4fdc80423698eed2376ce65779cf855371772293bec2927","tests/invalid/string-bad-escape.toml":"eeca691fbba3d270f58ae2953d2d1369a773e619e39d8c11f38d6bf6f8472e82","tests/invalid/string-byte-escapes.toml":"4a4604b32971de3a252cd01d2997b450972c3ec9030cf22a070d49c57f050da4","tests/invalid/string-no-close.toml":"bb2eaf96eb9f83a52bd0772abb313060a06b94f650efeb45edce774622686882","tests/invalid/table-array-implicit.toml":"9b841ea64d68be4deb54f67fc807b05fd235452ee563ffa7de69dbca64b2f7dd","tests/invalid/table-array-malformed-bracket.toml":"164f641b2628bf04f8202d9746a360a4a243faca1408dc2ecd0c0fdd2d1c2c27","tests/invalid/table-array-malformed-empty.toml":"56ca2a15019cf5c3555041a191f983dc72b1678f0de0afd1a7b8f46ed7970420","tests/invalid/table-empty.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/table-nested-brackets-close.toml":"991e1210f81e24abcd735988f0d960d4ee94d2ec3b133c6fea6e24932d91c507","tests/invalid/table-nested-brackets-open.toml":"8fb569fc90fa606ae94708ee2bf205bff8db8a023624b3e52ef6b2c1a98ba1c6","tests/invalid/table-whitespace.toml":"2c2db1259adc641df0459e896d349d3db60965d5368d5c8ed50aedd3bc88f040","tests/invalid/table-with-pound.toml":"d8070437f07bd115ac8006c61e286401bd3be88728a62264796e757121750ecd","tests/invalid/text-after-array-entries.toml":"2530cace13292313983b90b01d63e4b8ac484809e7ef0ac79904923573eda7ec","tests/invalid/text-after-integer.toml":"6168ed823a135b8914956b04307aeec2347b10eb1aa79008406d7b547cbde682","tests/invalid/text-after-string.toml":"1771987dd679e1cc181cf53406ba313fdc3413a081d17a93da6041bf6ccccf5e","tests/invalid/text-after-table.toml":"f27ae56bb0b42d3af4c813392857afdfeb4bf8ab77ff896cd93ba32cf1a21b26","tests/invalid/text-before-array-separator.toml":"192d28699573abbdc521797576d4885adf756336c3e76971f10270603c957464","tests/invalid/text-in-array.toml":"50d7b16d7a03d470f1a907eebfeb156d0c696e6f9a8c734a5e4caa2365f54654","tests/parser.rs":"fc0de1ac5f02505f82f9886403416914e0dd810927081a9ffb0f69da385b1b50","tests/serde.rs":"6b0a864bf6d4e62ba9dd3fd01149496759b0e683fa85fc358dfa3ffab5484219","tests/tables-last.rs":"593c60ea4727f08168a4a016ef876283d50f78888c5eab7d407092681712f912","tests/valid.rs":"b796ffb99aee2d61c13e82193c96c8eec18f52b358660af15047417bed054cf0","tests/valid/array-empty.json":"4ed46e8aa3586a7ddd9097cda38919699860052f188880de18e12d4acbee5307","tests/valid/array-empty.toml":"769faa42a690b02ad1b573277f0d793a4a38a7ecf30b9db67bf9836fe2b7778c","tests/valid/array-nospaces.json":"7c82b474797871488c2b522e9b852772a78c681a86900f780f7a0be4f901e1ec","tests/valid/array-nospaces.toml":"01fba63551b1051f7e117c9551c488b293bd3cd4745cbeec6b3709c32f2a3a64","tests/valid/arrays-hetergeneous.json":"dac4702412c90d5ddd6b898c3657c71d782d0aca46e5b9ca19cc694d3e226c0f","tests/valid/arrays-hetergeneous.toml":"361ae2e8470b47b12b336eb61eedd09abb20e216fbeb582b46d16a2831adda4d","tests/valid/arrays-nested.json":"34d6f8fd770f0728f38dbf0d686bed2c218bc16da978290c0208d3bf3704bdec","tests/valid/arrays-nested.toml":"a5941a01a2ba2fa179a3885039a5f81ca6c9876b2e8bea7b880563238be9f004","tests/valid/arrays.json":"315fff195a7d4c80e867e1f14c12a23e36dcc666e8de36138249b15e99bdd4dd","tests/valid/arrays.toml":"2d3c91b77d4f6a65a6a5a2c5ad521dbe86cc2f0ff389dfe58e8c34275cdc35c7","tests/valid/bool.json":"bb608b912fe4d89cb2186da957c10951780575bb34b2f43305335c745eff049c","tests/valid/bool.toml":"3c06ad4dce7430326f5f867105b2e9382def90cccb3ecb69f657c0b88974ab04","tests/valid/comments-everywhere.json":"800f8efd86d1bab4f91f0e367da52a2465e1480387df892561ed8948fd1a38c3","tests/valid/comments-everywhere.toml":"8636108c34f50d45244b142d342234b7535e01fba2db2d2ffed3430223009cea","tests/valid/datetime.json":"94f130c3b2a5f30c625a3a3168b9dfe52aa109b470c4e077f352b3dd79382a69","tests/valid/datetime.toml":"4e1b71ba31a1feef80a1e436225aa9c5d291bf780f558e7cfa76998fe2a29e08","tests/valid/empty.json":"ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356","tests/valid/empty.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","tests/valid/example-bom.toml":"50f3607be97de2f894ccd41a29d3a8a1b1f430982e5ab5bf43047874837f6a42","tests/valid/example-v0.3.0.json":"ec02332eb59dab93a50560771e4b01b972a29d93b6dca8954728c0631e1799a0","tests/valid/example-v0.3.0.toml":"aba9349588c1ba6af2a3ad0c1db2c3d311dca66b64f654480340a0823dfd4546","tests/valid/example-v0.4.0.json":"8b967b246ca2383172eaaecf790b2115a18020f63c70d0848d1dc25fc1fed5a9","tests/valid/example-v0.4.0.toml":"47ee4c4cd83637cd09aca6518f88c8ed56acc2b3022e5ea53d9121e5d35335ed","tests/valid/example.json":"c57fabb1be0ae7ed140fe7ae5082051571c85180204b8ae8d8da1e86133278c9","tests/valid/example.toml":"6f02b2a52ea63c70b629e41e06a8eb1eb4aab359ab966a7a397b248e13849c9c","tests/valid/example2.json":"de89432e78f0a074aae54650fedf151ceca3b0ccb148b8a66e18e2ed68024ba2","tests/valid/example2.toml":"c389eeb485fb7cb9445d617a9a0f8ba70049f08d66cf6b6f2a9a986574295de1","tests/valid/float.json":"9676c13fef00a01bc729456bfe27f1b24a1bd059c9a5913bb0b0401e976a0aab","tests/valid/float.toml":"b6784f554aa38bb210f0905c3bafdfae6db723a4f53288fb07febc66451bbc2d","tests/valid/hard_example.json":"8d170e73e156b8b6be559246880e9cb6a79b36f63d14bc97e3bdf2f2091e7a17","tests/valid/hard_example.toml":"cd3b89f8917a44f944b12fe47f69f86bb39f17db85d1a081bf0c134831eb90f9","tests/valid/implicit-and-explicit-after.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-after.toml":"0599b16822764cdb1c3d3cf53f71186b97afc9f60f8d58358a4a89fe4d9477c3","tests/valid/implicit-and-explicit-before.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-before.toml":"33435dddb68144b652ca5f5e0c4c53e4f7b3ca0166f9b944eda55f8d76ed2871","tests/valid/implicit-groups.json":"fc2bb43ec20c8c9148c8a70490b3a054506932c41687222ea11faae47eafb723","tests/valid/implicit-groups.toml":"248b3e8272ec43ce4af872981acde10628eeae73537ed6763a1f4245f5a9610c","tests/valid/integer.json":"0fc2d0cb1fb46d7805c1007b1fa4c46a65b273e56ae9d751df686e81d3a3354f","tests/valid/integer.toml":"74b964eb9561be6aa7266f6034cee1cd0657bdab8043a5ec9da33d9b184345da","tests/valid/key-equals-nospace.json":"b9878ee3585d1b48710a4bc09f2163b910ea71a2bfdaa8f1da68e599e8b30f47","tests/valid/key-equals-nospace.toml":"24cab0d01b67b184d0a737de3a5b5d47b8b69b36203273296d5ef763f7fdcf68","tests/valid/key-space.json":"30be539b01420be5cedc9078b88c3279bbef7c0bdde36ba8249ed8906112d5c7","tests/valid/key-space.toml":"9e9459b8cfebc404cf93d77c2d4082cadcd57165a2f9ce9cb35d1d12dc94a8c0","tests/valid/key-special-chars.json":"8bbebb20660d93efa73707bdb09e87a43c2b31c18f13df6388c701a1bc7cab8c","tests/valid/key-special-chars.toml":"c6cb0ba12d32f03cda4206097a1edb27cd154215d72e1c5791cc4f8dff2270b3","tests/valid/key-with-pound.json":"ea4dd79d0ad2a824bcce5c4c194d7fae82a7584a2ab7c0d83d6ddaae6130973e","tests/valid/key-with-pound.toml":"c334f676e19c01b96111277248654358cc8222fd0639aecaf429407e63b6a2dc","tests/valid/long-float.json":"7e103f56e490aa1b1fe5a762000ceb1f8c599f7d81aa215c90f5da41ab4ba6db","tests/valid/long-float.toml":"4d23f706f2a0d241840f6ea78657820c9c7b904c0c3c16828f8cc2574d7c8761","tests/valid/long-integer.json":"9ed7976639f0c2cd7f112584e2f5d272e92569be7135ea5bb9ba597abaff0767","tests/valid/long-integer.toml":"309f94be7ff5fd6f6dedbd257a1e6c171cb71aa74409ff3f8babda951f89d687","tests/valid/multiline-string.json":"3d67a8b992b85e9a2e58b77a1b76dc29745a9c2b4a362ad517786fed541948d7","tests/valid/multiline-string.toml":"7d6650009eb31a03d5b40b20712ef0157e9b787d9c966e66c38873a34e3b861c","tests/valid/raw-multiline-string.json":"4c95e34497433168cac25eb4132485c3bd13c35cad9d13d7becf7f90469dacca","tests/valid/raw-multiline-string.toml":"c724151024ccde432e0ec0d4ba60a5320d77841008116324c39516b8cbb94f4d","tests/valid/raw-string.json":"19268797aff8dfa28437d6ed8f9d813035f6eee50aade5fc774ba12b3290216b","tests/valid/raw-string.toml":"16510e05d477a0856ebaf38cacd0e9e18f02ab63ac7bd1a2eabbaa47a54d0e49","tests/valid/string-empty.json":"ece7d01326742a46e37d6404175118c0a91a2494f7ba2290bbc1d6f990ddb65b","tests/valid/string-empty.toml":"251e9e4052ede79f6b2462e71f73e0b7c9f5927484f6f77f0cd8b3c839b0c13b","tests/valid/string-escapes.json":"3d516f03cf94d5b5ee6b0887b8d37fdf21152752f049f5922a24adaacb5b8c35","tests/valid/string-escapes.toml":"86b1569e10fec91301709ad747012f0f42395050a2343b42aca450e001120f7a","tests/valid/string-simple.json":"622676e347676cce9f9733210acbd8056ce77a0588772ffd6efb05bb4e81b571","tests/valid/string-simple.toml":"ae74db09acea3be2ccae7f854f7b6f7c874ace9d4d87bf2f437b059a7d38a464","tests/valid/string-with-pound.json":"458a0add71536c1df5e1ed3ee5483c6eb48578abce0b0ebcdf75ea20d41ed6f4","tests/valid/string-with-pound.toml":"1aee397830d9ad2a93d41ee9c435acdbfef3758d1bb7c48bca7424fbbec89466","tests/valid/table-array-implicit.json":"3f7d3cdb468de67bc183162805d9c753ef5772f6f363ac2a26598387a5d991ea","tests/valid/table-array-implicit.toml":"66bcb030899a95e9a25ec44b7c9291b02f80ecbc324061cf1cd93223a2919f21","tests/valid/table-array-many.json":"3f21243eeb71ca3e5657a43559c806e12e3833e9f74c43c0c12aad9b0c853e4c","tests/valid/table-array-many.toml":"8d8ea546f954a81ca149a02147ae5f4bf075151cfcd530e62dcf05a04d843ffb","tests/valid/table-array-nest.json":"0a987d2bf1d5bc85f5c9433f23d389063600682a68538b6e57938a3c572959e4","tests/valid/table-array-nest.toml":"71b9c753bf773f232ac71cb2469a54ee0110ff137829045421edd7c5a64d6b6a","tests/valid/table-array-one.json":"7dc0ea3f7f843f7dc7443e68af43a1e5130a5fbae8a27fb02d8d92fa2487888e","tests/valid/table-array-one.toml":"4c478aea2dd7dfcfda682503b49e610f0fa4ce85a3b3cd0bc9041d4959e3626a","tests/valid/table-empty.json":"11e43e212d87b3b2547a5f2541f4091a3d2f6ba00b2a2004b07e02734e927ea7","tests/valid/table-empty.toml":"24d4941e67d5965d270eaebdb9816b994311e0f2f0e79ef6bb626f362c52842e","tests/valid/table-sub-empty.json":"85cca6d48a5993c4f207c21ed96652af4f50b6936b0807659c75317c1763b6db","tests/valid/table-sub-empty.toml":"ae92e90a806ffefcbf8cda83cb82acf7448f75efa50dcfb5e2384632d36471b3","tests/valid/table-whitespace.json":"ad84ac49a6d13f7c4a8af0e1e71fd7ff2a446aa16a34c21a809a0850dfa76e73","tests/valid/table-whitespace.toml":"2f15dafb263d2771671db299f6202b4b78d293aec1ded7641ec7eb1cb024b52c","tests/valid/table-with-pound.json":"151e76606efe77500cbb0aa8fcf8ccfadb124d533bb79a9caa62e937b826e676","tests/valid/table-with-pound.toml":"a1f86c2e3789cc89500ec1d5eac2ec0bdb94bf445fddc3cab558b5228f3aba56","tests/valid/unicode-escape.json":"ebbf81930fa92ea5822bb1ed808b798731abe5c97e64f6471e1e86878d79037c","tests/valid/unicode-escape.toml":"aa26e55e5526a0d00ad68eca774d5c43cbcdf24ae753e0219bf3ab31b9e628b8","tests/valid/unicode-literal.json":"1dd42756384b954955815dc3e906db64b4cd2c0c094f9b3c86633d1652d6d79d","tests/valid/unicode-literal.toml":"bffc6c3d4757de31d0cbfd7b8dc591edd2910fe8a4e1c46bbee422dddc841003"},"package":"bd86ad9ebee246fdedd610e0f6d0587b754a3d81438db930a244d0480ed7878f"} \ No newline at end of file +{"files":{".travis.yml":"cd984c9fc4ae15cf9a1cbc8d0f3b0b41cb2ad240fc3b14e06917e0ffd824964d","Cargo.toml":"e3606897c2303508e3091468afb2afd22828bb2fa971d91b522c9ddf4832f100","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"cdb1e357027407997a4666c3cb7d4db6676ef151289dbc49b1ab6df744e06047","examples/decode.rs":"91f5c35b94257f184d85183036a6d6d7aafbc22672b99446105b3cffdf3e7ff4","examples/toml2json.rs":"eaa9ad85ec19714f6437048ae28b844966225a17055d1a37878f41bcbc2c5e47","src/datetime.rs":"770bf5947748c8d563174dd8b4e4dee35fbd3171ea81c445c554d642c524f302","src/de.rs":"47a8e1ecee22068dc9d381f8ec05a47c644af49dbbb160fd3cb7a7b86d664adf","src/lib.rs":"d618368aac8d3ee5873eab36a3672cd88d72a121e26b5fd537cd3548293a1ff6","src/ser.rs":"11d8b67e9f84583d48c1a561c3c8e080b71be0ff479243ddbae28d5da797d261","src/tokens.rs":"ccc58d254a4a5666573fe42cf21b88621292c59858067169f102f2533cea9372","src/value.rs":"87a745d1eeba0ce4dc79451d0640d9a6145dec50dded1748e9a167719217be2a","tests/README.md":"3e7d07d64c34e117c3d862ee12e4947af8c133fb0b53f6f0de43cc3bfa5057b8","tests/backcompat.rs":"1d40b13ed379832d31c5d1ae35b9a3c9d9f66ab0ec40e7c16f46139d2fb4c35e","tests/datetime.rs":"c76e7f60514a748c56e09c369d888ea22d8e600b0200275da62dc8ad47ce9761","tests/display-tricky.rs":"e0ffa4f992ac1b3f6c88cf2dc299b605c6352ca3dcf18a4253fdb9b98ef410fd","tests/display.rs":"4472cf88c0ccc58d47b109570f8b19a218ac274ab5293df9e67db2db4f6e5945","tests/formatting.rs":"8941f2fe843d5294ef3dc7ff8aaa3db325d4ec368f1d138f8c28ab4e18c8261b","tests/invalid-encoder-misc.rs":"7a29c89dd664276cae8869d2394b0e7cf29f7a6d298cd8566fa1fd087dd635f4","tests/invalid-encoder/array-mixed-types-ints-and-floats.json":"206d2a353153efbcee74e7ee7b0f852e7a948cfb88417f74607b3ad6f020e373","tests/invalid-misc.rs":"70e14c859e67ed7e03ec426e5cb25a306a893cf85042e0be4fdbbc423b076887","tests/invalid.rs":"f6798f22652c2c09c23b066af33b402319399f7106ef5c9fda1a5222af522856","tests/invalid/array-mixed-types-arrays-and-ints.toml":"c1547b686357c7a865e333a7ce7eed1e30743ebc4daac8ea6148bdd84b7e4dc7","tests/invalid/array-mixed-types-ints-and-floats.toml":"baa235fc168869716680955fd5bdafab30b6fa9b3d09185086261a56ef12960e","tests/invalid/array-mixed-types-strings-and-ints.toml":"4440057ed90d4461db0be55cfd71299cad96b601d5faec2140666242f6fde147","tests/invalid/datetime-malformed-no-leads.toml":"1fa6bf72ea0b96be835ac031408f7acfd0b8d18d5f54b4c0fce8136aad27d22e","tests/invalid/datetime-malformed-no-secs.toml":"b9c30b7fa1847c80e381d68cc79834eefbb8813cd0eff465fb7cbe0733df429b","tests/invalid/datetime-malformed-no-t.toml":"490a46d2e707ef4f87987ec12a22afa5a71c97c5eaa0f4201a174c47846c6a4a","tests/invalid/datetime-malformed-with-milli.toml":"62bfd0a6645bcb3f78211523e5673a3d1fa726d9e942c1643df243d6fba474c8","tests/invalid/duplicate-key-table.toml":"a896ea2180d16fcdd4f6c30aa27529b5b29e7e195a4e7a9944343028783602e9","tests/invalid/duplicate-keys.toml":"4bb0a65c22e7704893a2a51334eb2518af702850ef59aeecd5226e7b26bc07ec","tests/invalid/duplicate-tables.toml":"23b16ce26e1155ee6bf1fff559701dce86475c6a2878536b61f6b7e68be340de","tests/invalid/empty-implicit-table.toml":"d6026110dc0dee7babd69592218819328caa425f48cc879e895b29e48550c06c","tests/invalid/empty-table.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/float-no-leading-zero.toml":"159654461094c938574ba2d2d09baa3d3c387dd6ed024fd411530c0573a1ec42","tests/invalid/float-no-trailing-digits.toml":"64e4f336186cd096be2804532dbd694dd50ea551d292a9cdbf0bef2abf227101","tests/invalid/key-after-array.toml":"314af33770170b53bf2ec3be43ea1609d981c81d62c968052499b85ed54ccce8","tests/invalid/key-after-table.toml":"ed0dcf38f003d184dd18d1518702da0115cbfb05a5a28cbcf42de2f9bdee05fa","tests/invalid/key-empty.toml":"4303477abf4c0b920b42e96edd61caecf9c1f2d5d97f56af876854cd725aff3c","tests/invalid/key-hash.toml":"cd2a2eba6032d32c829633d3cd2778aeba81f5ff554e69f62af6557d1dc712f6","tests/invalid/key-newline.toml":"06a313a6bd70c2db6a1f5bda479d854d8f87e037e3cabf18fb5db822466ffcac","tests/invalid/key-open-bracket.toml":"52dea939022949290e3a19f1291d15605429344dce3cd1aa1f1568ecad8ca365","tests/invalid/key-single-open-bracket.toml":"245843abef9e72e7efac30138a994bf6301e7e1d7d7042a33d42e863d2638811","tests/invalid/key-space.toml":"b4e336d07c27fb3d0f0a6e50b733e1546202dfd58aaf2f7956f56fd6f075b0a1","tests/invalid/key-start-bracket.toml":"3bd3748a9df1d25ab2661330a3da187bd4da3958292bbf0e8b59d7963634dd87","tests/invalid/key-two-equals.toml":"3ac0c4e339d47c86e57564e43147b772ae83933b78083dc78d0ef77e231df3f1","tests/invalid/string-bad-byte-escape.toml":"c665dcec7c02f442c4fdc80423698eed2376ce65779cf855371772293bec2927","tests/invalid/string-bad-escape.toml":"eeca691fbba3d270f58ae2953d2d1369a773e619e39d8c11f38d6bf6f8472e82","tests/invalid/string-byte-escapes.toml":"4a4604b32971de3a252cd01d2997b450972c3ec9030cf22a070d49c57f050da4","tests/invalid/string-no-close.toml":"bb2eaf96eb9f83a52bd0772abb313060a06b94f650efeb45edce774622686882","tests/invalid/table-array-implicit.toml":"9b841ea64d68be4deb54f67fc807b05fd235452ee563ffa7de69dbca64b2f7dd","tests/invalid/table-array-malformed-bracket.toml":"164f641b2628bf04f8202d9746a360a4a243faca1408dc2ecd0c0fdd2d1c2c27","tests/invalid/table-array-malformed-empty.toml":"56ca2a15019cf5c3555041a191f983dc72b1678f0de0afd1a7b8f46ed7970420","tests/invalid/table-empty.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/table-nested-brackets-close.toml":"991e1210f81e24abcd735988f0d960d4ee94d2ec3b133c6fea6e24932d91c507","tests/invalid/table-nested-brackets-open.toml":"8fb569fc90fa606ae94708ee2bf205bff8db8a023624b3e52ef6b2c1a98ba1c6","tests/invalid/table-whitespace.toml":"2c2db1259adc641df0459e896d349d3db60965d5368d5c8ed50aedd3bc88f040","tests/invalid/table-with-pound.toml":"d8070437f07bd115ac8006c61e286401bd3be88728a62264796e757121750ecd","tests/invalid/text-after-array-entries.toml":"2530cace13292313983b90b01d63e4b8ac484809e7ef0ac79904923573eda7ec","tests/invalid/text-after-integer.toml":"6168ed823a135b8914956b04307aeec2347b10eb1aa79008406d7b547cbde682","tests/invalid/text-after-string.toml":"1771987dd679e1cc181cf53406ba313fdc3413a081d17a93da6041bf6ccccf5e","tests/invalid/text-after-table.toml":"f27ae56bb0b42d3af4c813392857afdfeb4bf8ab77ff896cd93ba32cf1a21b26","tests/invalid/text-before-array-separator.toml":"192d28699573abbdc521797576d4885adf756336c3e76971f10270603c957464","tests/invalid/text-in-array.toml":"50d7b16d7a03d470f1a907eebfeb156d0c696e6f9a8c734a5e4caa2365f54654","tests/parser.rs":"6efa6a073adc041e1347fbaf30225359253a8f878ce328cdb74af3e83f60163e","tests/pretty.rs":"82b69142f0b438b0d76753d1a70ecb5c9d78df9f7c05a75e1be36eef11679960","tests/serde.rs":"94a119191110c4e57ef44f75022c0473fa1ffb9ed4242cd6320cbf96a7a3234a","tests/tables-last.rs":"593c60ea4727f08168a4a016ef876283d50f78888c5eab7d407092681712f912","tests/valid.rs":"ac398cac034eb7b6d320eb97b383a562e4924a22ef8d29fe43417ad95b17877d","tests/valid/array-empty.json":"4ed46e8aa3586a7ddd9097cda38919699860052f188880de18e12d4acbee5307","tests/valid/array-empty.toml":"769faa42a690b02ad1b573277f0d793a4a38a7ecf30b9db67bf9836fe2b7778c","tests/valid/array-nospaces.json":"7c82b474797871488c2b522e9b852772a78c681a86900f780f7a0be4f901e1ec","tests/valid/array-nospaces.toml":"01fba63551b1051f7e117c9551c488b293bd3cd4745cbeec6b3709c32f2a3a64","tests/valid/arrays-hetergeneous.json":"dac4702412c90d5ddd6b898c3657c71d782d0aca46e5b9ca19cc694d3e226c0f","tests/valid/arrays-hetergeneous.toml":"361ae2e8470b47b12b336eb61eedd09abb20e216fbeb582b46d16a2831adda4d","tests/valid/arrays-nested.json":"34d6f8fd770f0728f38dbf0d686bed2c218bc16da978290c0208d3bf3704bdec","tests/valid/arrays-nested.toml":"a5941a01a2ba2fa179a3885039a5f81ca6c9876b2e8bea7b880563238be9f004","tests/valid/arrays.json":"315fff195a7d4c80e867e1f14c12a23e36dcc666e8de36138249b15e99bdd4dd","tests/valid/arrays.toml":"2d3c91b77d4f6a65a6a5a2c5ad521dbe86cc2f0ff389dfe58e8c34275cdc35c7","tests/valid/bool.json":"bb608b912fe4d89cb2186da957c10951780575bb34b2f43305335c745eff049c","tests/valid/bool.toml":"3c06ad4dce7430326f5f867105b2e9382def90cccb3ecb69f657c0b88974ab04","tests/valid/comments-everywhere.json":"800f8efd86d1bab4f91f0e367da52a2465e1480387df892561ed8948fd1a38c3","tests/valid/comments-everywhere.toml":"8636108c34f50d45244b142d342234b7535e01fba2db2d2ffed3430223009cea","tests/valid/datetime-truncate.json":"5ca5dbb56bb00c4cfc4c10aeb5607160284593bad3bf6dc988425a4f1f53dfbc","tests/valid/datetime-truncate.toml":"55ee01485f3e537fb6b2d3977f656c11543e53adb4e79c6fa8f2a953183c0f7f","tests/valid/datetime.json":"94f130c3b2a5f30c625a3a3168b9dfe52aa109b470c4e077f352b3dd79382a69","tests/valid/datetime.toml":"4e1b71ba31a1feef80a1e436225aa9c5d291bf780f558e7cfa76998fe2a29e08","tests/valid/empty.json":"ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356","tests/valid/empty.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","tests/valid/example-bom.toml":"50f3607be97de2f894ccd41a29d3a8a1b1f430982e5ab5bf43047874837f6a42","tests/valid/example-v0.3.0.json":"ec02332eb59dab93a50560771e4b01b972a29d93b6dca8954728c0631e1799a0","tests/valid/example-v0.3.0.toml":"aba9349588c1ba6af2a3ad0c1db2c3d311dca66b64f654480340a0823dfd4546","tests/valid/example-v0.4.0.json":"8b967b246ca2383172eaaecf790b2115a18020f63c70d0848d1dc25fc1fed5a9","tests/valid/example-v0.4.0.toml":"47ee4c4cd83637cd09aca6518f88c8ed56acc2b3022e5ea53d9121e5d35335ed","tests/valid/example.json":"c57fabb1be0ae7ed140fe7ae5082051571c85180204b8ae8d8da1e86133278c9","tests/valid/example.toml":"6f02b2a52ea63c70b629e41e06a8eb1eb4aab359ab966a7a397b248e13849c9c","tests/valid/example2.json":"de89432e78f0a074aae54650fedf151ceca3b0ccb148b8a66e18e2ed68024ba2","tests/valid/example2.toml":"c389eeb485fb7cb9445d617a9a0f8ba70049f08d66cf6b6f2a9a986574295de1","tests/valid/float.json":"9676c13fef00a01bc729456bfe27f1b24a1bd059c9a5913bb0b0401e976a0aab","tests/valid/float.toml":"b6784f554aa38bb210f0905c3bafdfae6db723a4f53288fb07febc66451bbc2d","tests/valid/hard_example.json":"8d170e73e156b8b6be559246880e9cb6a79b36f63d14bc97e3bdf2f2091e7a17","tests/valid/hard_example.toml":"cd3b89f8917a44f944b12fe47f69f86bb39f17db85d1a081bf0c134831eb90f9","tests/valid/implicit-and-explicit-after.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-after.toml":"0599b16822764cdb1c3d3cf53f71186b97afc9f60f8d58358a4a89fe4d9477c3","tests/valid/implicit-and-explicit-before.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-before.toml":"33435dddb68144b652ca5f5e0c4c53e4f7b3ca0166f9b944eda55f8d76ed2871","tests/valid/implicit-groups.json":"fc2bb43ec20c8c9148c8a70490b3a054506932c41687222ea11faae47eafb723","tests/valid/implicit-groups.toml":"248b3e8272ec43ce4af872981acde10628eeae73537ed6763a1f4245f5a9610c","tests/valid/integer.json":"0fc2d0cb1fb46d7805c1007b1fa4c46a65b273e56ae9d751df686e81d3a3354f","tests/valid/integer.toml":"74b964eb9561be6aa7266f6034cee1cd0657bdab8043a5ec9da33d9b184345da","tests/valid/key-equals-nospace.json":"b9878ee3585d1b48710a4bc09f2163b910ea71a2bfdaa8f1da68e599e8b30f47","tests/valid/key-equals-nospace.toml":"24cab0d01b67b184d0a737de3a5b5d47b8b69b36203273296d5ef763f7fdcf68","tests/valid/key-quote-newline.json":"dc077cc852761ffbab2cb23486c023dae2e07410c76fcb507a40d96ed8922e06","tests/valid/key-quote-newline.toml":"a224611bfce786f7d04a3a6abda62fdff79bc6fd2cb94263334d135d46e0143b","tests/valid/key-space.json":"30be539b01420be5cedc9078b88c3279bbef7c0bdde36ba8249ed8906112d5c7","tests/valid/key-space.toml":"9e9459b8cfebc404cf93d77c2d4082cadcd57165a2f9ce9cb35d1d12dc94a8c0","tests/valid/key-special-chars.json":"8bbebb20660d93efa73707bdb09e87a43c2b31c18f13df6388c701a1bc7cab8c","tests/valid/key-special-chars.toml":"c6cb0ba12d32f03cda4206097a1edb27cd154215d72e1c5791cc4f8dff2270b3","tests/valid/key-with-pound.json":"ea4dd79d0ad2a824bcce5c4c194d7fae82a7584a2ab7c0d83d6ddaae6130973e","tests/valid/key-with-pound.toml":"c334f676e19c01b96111277248654358cc8222fd0639aecaf429407e63b6a2dc","tests/valid/long-float.json":"7e103f56e490aa1b1fe5a762000ceb1f8c599f7d81aa215c90f5da41ab4ba6db","tests/valid/long-float.toml":"4d23f706f2a0d241840f6ea78657820c9c7b904c0c3c16828f8cc2574d7c8761","tests/valid/long-integer.json":"9ed7976639f0c2cd7f112584e2f5d272e92569be7135ea5bb9ba597abaff0767","tests/valid/long-integer.toml":"309f94be7ff5fd6f6dedbd257a1e6c171cb71aa74409ff3f8babda951f89d687","tests/valid/multiline-string.json":"3d67a8b992b85e9a2e58b77a1b76dc29745a9c2b4a362ad517786fed541948d7","tests/valid/multiline-string.toml":"7d6650009eb31a03d5b40b20712ef0157e9b787d9c966e66c38873a34e3b861c","tests/valid/raw-multiline-string.json":"4c95e34497433168cac25eb4132485c3bd13c35cad9d13d7becf7f90469dacca","tests/valid/raw-multiline-string.toml":"c724151024ccde432e0ec0d4ba60a5320d77841008116324c39516b8cbb94f4d","tests/valid/raw-string.json":"19268797aff8dfa28437d6ed8f9d813035f6eee50aade5fc774ba12b3290216b","tests/valid/raw-string.toml":"16510e05d477a0856ebaf38cacd0e9e18f02ab63ac7bd1a2eabbaa47a54d0e49","tests/valid/string-empty.json":"ece7d01326742a46e37d6404175118c0a91a2494f7ba2290bbc1d6f990ddb65b","tests/valid/string-empty.toml":"251e9e4052ede79f6b2462e71f73e0b7c9f5927484f6f77f0cd8b3c839b0c13b","tests/valid/string-escapes.json":"3d516f03cf94d5b5ee6b0887b8d37fdf21152752f049f5922a24adaacb5b8c35","tests/valid/string-escapes.toml":"86b1569e10fec91301709ad747012f0f42395050a2343b42aca450e001120f7a","tests/valid/string-simple.json":"622676e347676cce9f9733210acbd8056ce77a0588772ffd6efb05bb4e81b571","tests/valid/string-simple.toml":"ae74db09acea3be2ccae7f854f7b6f7c874ace9d4d87bf2f437b059a7d38a464","tests/valid/string-with-pound.json":"458a0add71536c1df5e1ed3ee5483c6eb48578abce0b0ebcdf75ea20d41ed6f4","tests/valid/string-with-pound.toml":"1aee397830d9ad2a93d41ee9c435acdbfef3758d1bb7c48bca7424fbbec89466","tests/valid/table-array-implicit.json":"3f7d3cdb468de67bc183162805d9c753ef5772f6f363ac2a26598387a5d991ea","tests/valid/table-array-implicit.toml":"66bcb030899a95e9a25ec44b7c9291b02f80ecbc324061cf1cd93223a2919f21","tests/valid/table-array-many.json":"3f21243eeb71ca3e5657a43559c806e12e3833e9f74c43c0c12aad9b0c853e4c","tests/valid/table-array-many.toml":"8d8ea546f954a81ca149a02147ae5f4bf075151cfcd530e62dcf05a04d843ffb","tests/valid/table-array-nest-no-keys.json":"a93ed1e96a8c52848e65a2f79c0e5c0627fbc62bd5f3e2557fdd0d42c303e7da","tests/valid/table-array-nest-no-keys.toml":"9cfcd72b7d166b4ae77a7be456017f749f375ad562475802e22dc1a57b503dc7","tests/valid/table-array-nest.json":"0a987d2bf1d5bc85f5c9433f23d389063600682a68538b6e57938a3c572959e4","tests/valid/table-array-nest.toml":"71b9c753bf773f232ac71cb2469a54ee0110ff137829045421edd7c5a64d6b6a","tests/valid/table-array-one.json":"7dc0ea3f7f843f7dc7443e68af43a1e5130a5fbae8a27fb02d8d92fa2487888e","tests/valid/table-array-one.toml":"4c478aea2dd7dfcfda682503b49e610f0fa4ce85a3b3cd0bc9041d4959e3626a","tests/valid/table-empty.json":"11e43e212d87b3b2547a5f2541f4091a3d2f6ba00b2a2004b07e02734e927ea7","tests/valid/table-empty.toml":"24d4941e67d5965d270eaebdb9816b994311e0f2f0e79ef6bb626f362c52842e","tests/valid/table-multi-empty.json":"3a2c82201a0447304afb23fb48ee961b4bd812fca3e1b061cc033e7e2bfb976c","tests/valid/table-multi-empty.toml":"886c9c4cc2d691816ed3fa404cb9d362b0511eb8c389a71419a858abb26f83df","tests/valid/table-sub-empty.json":"85cca6d48a5993c4f207c21ed96652af4f50b6936b0807659c75317c1763b6db","tests/valid/table-sub-empty.toml":"ae92e90a806ffefcbf8cda83cb82acf7448f75efa50dcfb5e2384632d36471b3","tests/valid/table-whitespace.json":"ad84ac49a6d13f7c4a8af0e1e71fd7ff2a446aa16a34c21a809a0850dfa76e73","tests/valid/table-whitespace.toml":"2f15dafb263d2771671db299f6202b4b78d293aec1ded7641ec7eb1cb024b52c","tests/valid/table-with-pound.json":"151e76606efe77500cbb0aa8fcf8ccfadb124d533bb79a9caa62e937b826e676","tests/valid/table-with-pound.toml":"a1f86c2e3789cc89500ec1d5eac2ec0bdb94bf445fddc3cab558b5228f3aba56","tests/valid/unicode-escape.json":"ddfc662f25712f1ebfc7b93b839405dfca56fc43dcde3276ad8b1ea9fdcdcc4d","tests/valid/unicode-escape.toml":"d12be96b9316b2092026be060e0008cb67a81472dccd9eab7914c7252a840608","tests/valid/unicode-literal.json":"1dd42756384b954955815dc3e906db64b4cd2c0c094f9b3c86633d1652d6d79d","tests/valid/unicode-literal.toml":"bffc6c3d4757de31d0cbfd7b8dc591edd2910fe8a4e1c46bbee422dddc841003"},"package":"a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/toml/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/Cargo.toml --- distinst-0.1.0/vendor/toml/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/Cargo.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,26 +1,33 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + [package] name = "toml" -version = "0.3.2" +version = "0.4.5" authors = ["Alex Crichton "] -license = "MIT/Apache-2.0" -readme = "README.md" -keywords = ["encoding"] -repository = "https://github.com/alexcrichton/toml-rs" +description = "A native Rust encoder and decoder of TOML-formatted files and streams. Provides\nimplementations of the standard Serialize/Deserialize traits for TOML data to\nfacilitate deserializing and serializing Rust structures.\n" homepage = "https://github.com/alexcrichton/toml-rs" documentation = "https://docs.rs/toml" -description = """ -A native Rust encoder and decoder of TOML-formatted files and streams. Provides -implementations of the standard Serialize/Deserialize traits for TOML data to -facilitate deserializing and serializing Rust structures. -""" +readme = "README.md" +keywords = ["encoding"] categories = ["config", "encoding", "parser-implementations"] +license = "MIT/Apache-2.0" +repository = "https://github.com/alexcrichton/toml-rs" +[dependencies.serde] +version = "1.0" +[dev-dependencies.serde_derive] +version = "1.0" -[badges] -travis-ci = { repository = "alexcrichton/toml-rs" } - -[dependencies] -serde = "0.9.6" - -[dev-dependencies] -serde_derive = "0.9" -serde_json = "0.9" +[dev-dependencies.serde_json] +version = "1.0" +[badges.travis-ci] +repository = "alexcrichton/toml-rs" diff -Nru distinst-0.1.0/vendor/toml/examples/decode.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/examples/decode.rs --- distinst-0.1.0/vendor/toml/examples/decode.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/examples/decode.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,11 +1,10 @@ //! An example showing off the usage of `Deserialize` to automatically decode //! TOML into a Rust `struct` -//! -//! Note that this works similarly with `serde` as well. #![deny(warnings)] extern crate toml; +extern crate serde; #[macro_use] extern crate serde_derive; diff -Nru distinst-0.1.0/vendor/toml/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/README.md --- distinst-0.1.0/vendor/toml/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/README.md 2017-12-21 19:00:07.000000000 +0000 @@ -3,8 +3,7 @@ [![Build Status](https://travis-ci.org/alexcrichton/toml-rs.svg?branch=master)](https://travis-ci.org/alexcrichton/toml-rs) [![Coverage Status](https://coveralls.io/repos/alexcrichton/toml-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexcrichton/toml-rs?branch=master) [![Latest Version](https://img.shields.io/crates/v/toml.svg)](https://crates.io/crates/toml) - -[Documentation](https://docs.rs/toml) +[![Documentation](https://docs.rs/toml/badge.svg)](https://docs.rs/toml) A [TOML][toml] decoder and encoder for Rust. This library is currently compliant with the v0.4.0 version of TOML. This library will also likely continue to stay @@ -15,7 +14,7 @@ ```toml # Cargo.toml [dependencies] -toml = "0.3" +toml = "0.4" ``` This crate also supports serialization/deserialization through the diff -Nru distinst-0.1.0/vendor/toml/src/datetime.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/datetime.rs --- distinst-0.1.0/vendor/toml/src/datetime.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/datetime.rs 2017-12-21 19:00:07.000000000 +0000 @@ -55,7 +55,7 @@ hour: u8, minute: u8, second: u8, - secfract: Option, + nanosecond: u32, } #[derive(PartialEq, Clone)] @@ -97,9 +97,9 @@ impl fmt::Display for Time { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:02}:{:02}:{:02}", self.hour, self.minute, self.second)?; - if let Some(i) = self.secfract { - let s = format!("{}", i); - write!(f, "{}", s.trim_left_matches("0"))?; + if self.nanosecond != 0 { + let s = format!("{:09}", self.nanosecond); + write!(f, ".{}", s.trim_right_matches('0'))?; } Ok(()) } @@ -179,11 +179,10 @@ chars.clone().next() == Some('T') { chars.next(); true - } else if full_date.is_none() { - true } else { - false + full_date.is_none() }; + let time = if partial_time { let h1 = digit(&mut chars)?; let h2 = digit(&mut chars)?; @@ -200,38 +199,37 @@ let s1 = digit(&mut chars)?; let s2 = digit(&mut chars)?; - let secfract = if chars.clone().next() == Some('.') { + let mut nanosecond = 0; + if chars.clone().next() == Some('.') { chars.next(); - let mut first = true; let whole = chars.as_str(); + let mut end = whole.len(); - for (i, c) in whole.char_indices() { - match c { - '0' ... '9' => {} + for (i, byte) in whole.bytes().enumerate() { + match byte { + b'0' ... b'9' => { + if i < 9 { + let p = 10_u32.pow(8 - i as u32); + nanosecond += p * (byte - b'0') as u32; + } + } _ => { end = i; - break + break; } } - first = false; } - if first { + if end == 0 { return Err(DatetimeParseError { _private: () }) } chars = whole[end..].chars(); - match format!("0.{}", &whole[..end]).parse() { - Ok(f) => Some(f), - Err(_) => return Err(DatetimeParseError { _private: () }), - } - } else { - None - }; + } let time = Time { hour: h1 * 10 + h2, minute: m1 * 10 + m2, second: s1 * 10 + s2, - secfract: secfract, + nanosecond: nanosecond, }; if time.hour > 24 { @@ -240,7 +238,10 @@ if time.minute > 59 { return Err(DatetimeParseError { _private: () }) } - if time.second > 60 { + if time.second > 59 { + return Err(DatetimeParseError { _private: () }) + } + if time.nanosecond > 999_999_999 { return Err(DatetimeParseError { _private: () }) } @@ -299,7 +300,7 @@ fn digit(chars: &mut str::Chars) -> Result { match chars.next() { - Some(c) if '0' <= c && c <= '9' => Ok(c as u8 - '0' as u8), + Some(c) if '0' <= c && c <= '9' => Ok(c as u8 - b'0'), _ => Err(DatetimeParseError { _private: () }), } } @@ -316,13 +317,13 @@ } } -impl de::Deserialize for Datetime { +impl<'de> de::Deserialize<'de> for Datetime { fn deserialize(deserializer: D) -> Result - where D: de::Deserializer + where D: de::Deserializer<'de> { struct DatetimeVisitor; - impl de::Visitor for DatetimeVisitor { + impl<'de> de::Visitor<'de> for DatetimeVisitor { type Value = Datetime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -330,13 +331,13 @@ } fn visit_map(self, mut visitor: V) -> Result - where V: de::MapVisitor + where V: de::MapAccess<'de> { - let value = visitor.visit_key::()?; + let value = visitor.next_key::()?; if value.is_none() { return Err(de::Error::custom("datetime key not found")) } - let v: DatetimeFromString = visitor.visit_value()?; + let v: DatetimeFromString = visitor.next_value()?; Ok(v.value) } @@ -351,13 +352,13 @@ struct DatetimeKey; -impl de::Deserialize for DatetimeKey { +impl<'de> de::Deserialize<'de> for DatetimeKey { fn deserialize(deserializer: D) -> Result - where D: de::Deserializer + where D: de::Deserializer<'de> { struct FieldVisitor; - impl de::Visitor for FieldVisitor { + impl<'de> de::Visitor<'de> for FieldVisitor { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -375,7 +376,7 @@ } } - deserializer.deserialize_struct_field(FieldVisitor)?; + deserializer.deserialize_identifier(FieldVisitor)?; Ok(DatetimeKey) } } @@ -384,13 +385,13 @@ pub value: Datetime, } -impl de::Deserialize for DatetimeFromString { +impl<'de> de::Deserialize<'de> for DatetimeFromString { fn deserialize(deserializer: D) -> Result - where D: de::Deserializer + where D: de::Deserializer<'de> { struct Visitor; - impl de::Visitor for Visitor { + impl<'de> de::Visitor<'de> for Visitor { type Value = DatetimeFromString; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff -Nru distinst-0.1.0/vendor/toml/src/de.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/de.rs --- distinst-0.1.0/vendor/toml/src/de.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/de.rs 2017-12-21 19:00:07.000000000 +0000 @@ -11,6 +11,7 @@ use std::vec; use serde::de; +use serde::de::IntoDeserializer; use tokens::{Tokenizer, Token, Error as TokenError}; use datetime::{SERDE_STRUCT_FIELD_NAME, SERDE_STRUCT_NAME}; @@ -19,8 +20,8 @@ /// /// This function will attempt to interpret `bytes` as UTF-8 data and then /// deserialize `T` from the TOML document provided. -pub fn from_slice(bytes: &[u8]) -> Result - where T: de::Deserialize, +pub fn from_slice<'de, T>(bytes: &'de [u8]) -> Result + where T: de::Deserialize<'de>, { match str::from_utf8(bytes) { Ok(s) => from_str(s), @@ -32,13 +33,44 @@ /// /// This function will attempt to interpret `s` as a TOML document and /// deserialize `T` from the document. -pub fn from_str(s: &str) -> Result - where T: de::Deserialize, +/// +/// # Examples +/// +/// ``` +/// #[macro_use] +/// extern crate serde_derive; +/// extern crate toml; +/// +/// #[derive(Deserialize)] +/// struct Config { +/// title: String, +/// owner: Owner, +/// } +/// +/// #[derive(Deserialize)] +/// struct Owner { +/// name: String, +/// } +/// +/// fn main() { +/// let config: Config = toml::from_str(r#" +/// title = 'TOML Example' +/// +/// [owner] +/// name = 'Lisa' +/// "#).unwrap(); +/// +/// assert_eq!(config.title, "TOML Example"); +/// assert_eq!(config.owner.name, "Lisa"); +/// } +/// ``` +pub fn from_str<'de, T>(s: &'de str) -> Result + where T: de::Deserialize<'de>, { let mut d = Deserializer::new(s); let ret = T::deserialize(&mut d)?; d.end()?; - return Ok(ret) + Ok(ret) } /// Errors that can occur when deserializing a type. @@ -121,6 +153,9 @@ /// type. Custom, + /// A struct was expected but something else was found + ExpectedString, + #[doc(hidden)] __Nonexhaustive, } @@ -132,11 +167,11 @@ tokens: Tokenizer<'a>, } -impl<'a, 'b> de::Deserializer for &'b mut Deserializer<'a> { +impl<'de, 'b> de::Deserializer<'de> for &'b mut Deserializer<'de> { type Error = Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { let mut tables = Vec::new(); let mut cur_table = Table { @@ -145,10 +180,11 @@ values: None, array: false, }; + while let Some(line) = self.line()? { match line { Line::Table { at, mut header, array } => { - if cur_table.header.len() > 0 || cur_table.values.is_some() { + if !cur_table.header.is_empty() || cur_table.values.is_some() { tables.push(cur_table); } cur_table = Table { @@ -175,7 +211,7 @@ } } } - if cur_table.header.len() > 0 || cur_table.values.is_some() { + if !cur_table.header.is_empty() || cur_table.values.is_some() { tables.push(cur_table); } @@ -192,10 +228,30 @@ }) } - forward_to_deserialize! { + fn deserialize_enum( + self, + _name: &'static str, + _variants: &'static [&'static str], + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + if let Some(next) = self.next()? { + match next { + Token::String { val, .. } => { + visitor.visit_enum(val.into_deserializer()) + }, + _ => Err(Error::from_kind(ErrorKind::ExpectedString)) + } + } else { + Err(Error::from_kind(ErrorKind::UnexpectedEof)) + } + } + + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - seq_fixed_size bytes byte_buf map struct unit enum newtype_struct - struct_field ignored_any unit_struct tuple_struct tuple option + bytes byte_buf map struct unit newtype_struct + ignored_any unit_struct tuple_struct tuple option identifier } } @@ -207,23 +263,23 @@ } #[doc(hidden)] -pub struct MapVisitor<'a: 'b, 'b> { - values: vec::IntoIter<(Cow<'a, str>, Value<'a>)>, - next_value: Option<(Cow<'a, str>, Value<'a>)>, +pub struct MapVisitor<'de: 'b, 'b> { + values: vec::IntoIter<(Cow<'de, str>, Value<'de>)>, + next_value: Option<(Cow<'de, str>, Value<'de>)>, depth: usize, cur: usize, cur_parent: usize, max: usize, - tables: &'b mut [Table<'a>], + tables: &'b mut [Table<'de>], array: bool, - de: &'b mut Deserializer<'a>, + de: &'b mut Deserializer<'de>, } -impl<'a, 'b> de::MapVisitor for MapVisitor<'a, 'b> { +impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> { type Error = Error; - fn visit_key_seed(&mut self, seed: K) -> Result, Error> - where K: de::DeserializeSeed, + fn next_key_seed(&mut self, seed: K) -> Result, Error> + where K: de::DeserializeSeed<'de>, { if self.cur_parent == self.max || self.cur == self.max { return Ok(None) @@ -268,11 +324,11 @@ let table = &mut self.tables[pos]; // If we're not yet at the appropriate depth for this table then we - // just visit the next portion of its header and then continue + // just next the next portion of its header and then continue // decoding. if self.depth != table.header.len() { let key = &table.header[self.depth]; - let key = seed.deserialize(StrDeserializer::new(key[..].into()))?; + let key = seed.deserialize(StrDeserializer::new(key.clone()))?; return Ok(Some(key)) } @@ -285,12 +341,12 @@ return Err(self.de.error(table.at, kind)) } - self.values = table.values.take().unwrap().into_iter(); + self.values = table.values.take().expect("Unable to read table values").into_iter(); } } - fn visit_value_seed(&mut self, seed: V) -> Result - where V: de::DeserializeSeed, + fn next_value_seed(&mut self, seed: V) -> Result + where V: de::DeserializeSeed<'de>, { if let Some((k, v)) = self.next_value.take() { match seed.deserialize(ValueDeserializer::new(v)) { @@ -323,11 +379,11 @@ } } -impl<'a, 'b> de::SeqVisitor for MapVisitor<'a, 'b> { +impl<'de, 'b> de::SeqAccess<'de> for MapVisitor<'de, 'b> { type Error = Error; - fn visit_seed(&mut self, seed: K) -> Result, Error> - where K: de::DeserializeSeed, + fn next_element_seed(&mut self, seed: K) -> Result, Error> + where K: de::DeserializeSeed<'de>, { assert!(self.next_value.is_none()); assert!(self.values.next().is_none()); @@ -346,7 +402,7 @@ .unwrap_or(self.max); let ret = seed.deserialize(MapVisitor { - values: self.tables[self.cur_parent].values.take().unwrap().into_iter(), + values: self.tables[self.cur_parent].values.take().expect("Unable to read table values").into_iter(), next_value: None, depth: self.depth + 1, cur_parent: self.cur_parent, @@ -357,15 +413,15 @@ de: &mut self.de, })?; self.cur_parent = next; - return Ok(Some(ret)) + Ok(Some(ret)) } } -impl<'a, 'b> de::Deserializer for MapVisitor<'a, 'b> { +impl<'de, 'b> de::Deserializer<'de> for MapVisitor<'de, 'b> { type Error = Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { if self.array { visitor.visit_seq(self) @@ -377,15 +433,25 @@ // `None` is interpreted as a missing field so be sure to implement `Some` // as a present field. fn deserialize_option(self, visitor: V) -> Result - where V: de::Visitor + where V: de::Visitor<'de>, { visitor.visit_some(self) } - forward_to_deserialize! { + fn deserialize_newtype_struct( + self, + _name: &'static str, + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + visitor.visit_newtype_struct(self) + } + + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - seq_fixed_size bytes byte_buf map struct unit newtype_struct - struct_field ignored_any unit_struct tuple_struct tuple enum + bytes byte_buf map struct unit identifier + ignored_any unit_struct tuple_struct tuple enum } } @@ -401,22 +467,22 @@ } } -impl<'a> de::Deserializer for StrDeserializer<'a> { +impl<'de> de::Deserializer<'de> for StrDeserializer<'de> { type Error = Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { match self.key { - Cow::Borrowed(s) => visitor.visit_str(s), + Cow::Borrowed(s) => visitor.visit_borrowed_str(s), Cow::Owned(s) => visitor.visit_string(s), } } - forward_to_deserialize! { + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - seq_fixed_size bytes byte_buf map struct option unit newtype_struct - struct_field ignored_any unit_struct tuple_struct tuple enum + bytes byte_buf map struct option unit newtype_struct + ignored_any unit_struct tuple_struct tuple enum identifier } } @@ -432,17 +498,17 @@ } } -impl<'a> de::Deserializer for ValueDeserializer<'a> { +impl<'de> de::Deserializer<'de> for ValueDeserializer<'de> { type Error = Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { match self.value { Value::Integer(i) => visitor.visit_i64(i), Value::Boolean(b) => visitor.visit_bool(b), Value::Float(f) => visitor.visit_f64(f), - Value::String(Cow::Borrowed(s)) => visitor.visit_str(s), + Value::String(Cow::Borrowed(s)) => visitor.visit_borrowed_str(s), Value::String(Cow::Owned(s)) => visitor.visit_string(s), Value::Datetime(s) => visitor.visit_map(DatetimeDeserializer { date: s, @@ -467,10 +533,10 @@ name: &'static str, fields: &'static [&'static str], visitor: V) -> Result - where V: de::Visitor, + where V: de::Visitor<'de>, { if name == SERDE_STRUCT_NAME && fields == &[SERDE_STRUCT_FIELD_NAME] { - if let Value::Datetime(ref s) = self.value { + if let Value::Datetime(s) = self.value { return visitor.visit_map(DatetimeDeserializer { date: s, visited: false, @@ -478,26 +544,50 @@ } } - self.deserialize(visitor) + self.deserialize_any(visitor) } // `None` is interpreted as a missing field so be sure to implement `Some` // as a present field. fn deserialize_option(self, visitor: V) -> Result - where V: de::Visitor + where V: de::Visitor<'de>, { visitor.visit_some(self) } - forward_to_deserialize! { + fn deserialize_enum( + self, + _name: &'static str, + _variants: &'static [&'static str], + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + match self.value { + Value::String(val) => visitor.visit_enum(val.into_deserializer()), + _ => Err(Error::from_kind(ErrorKind::ExpectedString)) + } + } + + fn deserialize_newtype_struct( + self, + _name: &'static str, + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + visitor.visit_newtype_struct(self) + } + + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - seq_fixed_size bytes byte_buf map unit newtype_struct - struct_field ignored_any unit_struct tuple_struct tuple enum + bytes byte_buf map unit identifier + ignored_any unit_struct tuple_struct tuple } } -impl<'a> de::value::ValueDeserializer for Value<'a> { - type Deserializer = ValueDeserializer<'a>; +impl<'de> de::IntoDeserializer<'de, Error> for Value<'de> { + type Deserializer = ValueDeserializer<'de>; fn into_deserializer(self) -> Self::Deserializer { ValueDeserializer::new(self) @@ -509,11 +599,11 @@ date: &'a str, } -impl<'a> de::MapVisitor for DatetimeDeserializer<'a> { +impl<'de> de::MapAccess<'de> for DatetimeDeserializer<'de> { type Error = Error; - fn visit_key_seed(&mut self, seed: K) -> Result, Error> - where K: de::DeserializeSeed, + fn next_key_seed(&mut self, seed: K) -> Result, Error> + where K: de::DeserializeSeed<'de>, { if self.visited { return Ok(None) @@ -522,8 +612,8 @@ seed.deserialize(DatetimeFieldDeserializer).map(Some) } - fn visit_value_seed(&mut self, seed: V) -> Result - where V: de::DeserializeSeed, + fn next_value_seed(&mut self, seed: V) -> Result + where V: de::DeserializeSeed<'de>, { seed.deserialize(StrDeserializer::new(self.date.into())) } @@ -531,19 +621,19 @@ struct DatetimeFieldDeserializer; -impl de::Deserializer for DatetimeFieldDeserializer { +impl<'de> de::Deserializer<'de> for DatetimeFieldDeserializer { type Error = Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { - visitor.visit_str(SERDE_STRUCT_FIELD_NAME) + visitor.visit_borrowed_str(SERDE_STRUCT_FIELD_NAME) } - forward_to_deserialize! { + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - seq_fixed_size bytes byte_buf map struct option unit newtype_struct - struct_field ignored_any unit_struct tuple_struct tuple enum + bytes byte_buf map struct option unit newtype_struct + ignored_any unit_struct tuple_struct tuple enum identifier } } @@ -552,11 +642,11 @@ next_value: Option>, } -impl<'a> de::MapVisitor for InlineTableDeserializer<'a> { +impl<'de> de::MapAccess<'de> for InlineTableDeserializer<'de> { type Error = Error; - fn visit_key_seed(&mut self, seed: K) -> Result, Error> - where K: de::DeserializeSeed, + fn next_key_seed(&mut self, seed: K) -> Result, Error> + where K: de::DeserializeSeed<'de>, { let (key, value) = match self.values.next() { Some(pair) => pair, @@ -566,14 +656,15 @@ seed.deserialize(StrDeserializer::new(key)).map(Some) } - fn visit_value_seed(&mut self, seed: V) -> Result - where V: de::DeserializeSeed, + fn next_value_seed(&mut self, seed: V) -> Result + where V: de::DeserializeSeed<'de>, { - let value = self.next_value.take().unwrap(); + let value = self.next_value.take().expect("Unable to read table values"); seed.deserialize(ValueDeserializer::new(value)) } } + impl<'a> Deserializer<'a> { /// Creates a new deserializer which will be deserializing the string /// provided. @@ -687,7 +778,7 @@ } fn number_or_date(&mut self, s: &'a str) -> Result, Error> { - if s.contains("T") || (s.len() > 1 && s[1..].contains("-")) && + if s.contains('T') || (s.len() > 1 && s[1..].contains('-')) && !s.contains("e-") { self.datetime(s, false).map(Value::Datetime) } else if self.eat(Token::Colon)? { @@ -698,7 +789,7 @@ } fn number(&mut self, s: &'a str) -> Result, Error> { - if s.contains("e") || s.contains("E") { + if s.contains('e') || s.contains('E') { self.float(s, None).map(Value::Float) } else if self.eat(Token::Period)? { let at = self.tokens.current(); @@ -727,7 +818,7 @@ if suffix != "" { return Err(self.error(start, ErrorKind::NumberInvalid)) } - prefix.replace("_", "").trim_left_matches("+").parse().map_err(|_e| { + prefix.replace("_", "").trim_left_matches('+').parse().map_err(|_e| { self.error(start, ErrorKind::NumberInvalid) }) } @@ -783,13 +874,13 @@ if suffix != "" { return Err(self.error(start, ErrorKind::NumberInvalid)) } - let (a, b) = self.parse_integer(&after, false, true)?; + let (a, b) = self.parse_integer(after, false, true)?; fraction = Some(a); suffix = b; } let mut exponent = None; - if suffix.starts_with("e") || suffix.starts_with("E") { + if suffix.starts_with('e') || suffix.starts_with('E') { let (a, b) = if suffix.len() == 1 { self.eat(Token::Plus)?; match self.next()? { @@ -807,7 +898,7 @@ exponent = Some(a); } - let mut number = integral.trim_left_matches("+") + let mut number = integral.trim_left_matches('+') .chars() .filter(|c| *c != '_') .collect::(); @@ -821,6 +912,12 @@ } number.parse().map_err(|_e| { self.error(start, ErrorKind::NumberInvalid) + }).and_then(|n: f64| { + if n.is_finite() { + Ok(n) + } else { + Err(self.error(start, ErrorKind::NumberInvalid)) + } }) } @@ -1003,7 +1100,7 @@ let (line, col) = self.to_linecol(at); err.inner.line = Some(line); err.inner.col = col; - return err + err } /// Converts a byte offset from an error message to a (line, column) pair @@ -1022,6 +1119,13 @@ } impl Error { + /// Produces a (line, column) pair of the position of the error if available + /// + /// All indexes are 0-based. + pub fn line_col(&self) -> Option<(usize, usize)> { + self.inner.line.map(|line| (line, self.inner.col)) + } + fn from_kind(kind: ErrorKind) -> Error { Error { inner: Box::new(ErrorInner { @@ -1092,10 +1196,11 @@ ErrorKind::RedefineAsArray => "table redefined as array".fmt(f)?, ErrorKind::EmptyTableKey => "empty table key found".fmt(f)?, ErrorKind::Custom => self.inner.message.fmt(f)?, + ErrorKind::ExpectedString => "expected string".fmt(f)?, ErrorKind::__Nonexhaustive => panic!(), } - if self.inner.key.len() > 0 { + if !self.inner.key.is_empty() { write!(f, " for key `")?; for (i, k) in self.inner.key.iter().enumerate() { if i > 0 { @@ -1134,6 +1239,7 @@ ErrorKind::RedefineAsArray => "table redefined as array", ErrorKind::EmptyTableKey => "empty table key found", ErrorKind::Custom => "a custom error", + ErrorKind::ExpectedString => "expected string", ErrorKind::__Nonexhaustive => panic!(), } } @@ -1193,6 +1299,7 @@ } } +#[derive(Debug)] enum Value<'a> { Integer(i64), Float(f64), diff -Nru distinst-0.1.0/vendor/toml/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/lib.rs --- distinst-0.1.0/vendor/toml/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/lib.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,5 @@ //! A [TOML]-parsing library //! -//! [TOML]: https://github.com/toml-lang/toml -//! //! This library implements a [TOML] v0.4.0 compatible parser, //! primarily supporting the [`serde`] library for encoding/decoding //! various types in Rust. @@ -11,11 +9,11 @@ //! ```toml //! [package] //! name = "toml" -//! version = "0.2.1" +//! version = "0.4.2" //! authors = ["Alex Crichton "] //! //! [dependencies] -//! serde = "0.9" +//! serde = "1.0" //! ``` //! //! The TOML format tends to be relatively common throughout the Rust community @@ -59,7 +57,7 @@ //! //! ## Deserialization and Serialization //! -//! This crate supports [`serde`] 0.9 with a number of +//! This crate supports [`serde`] 1.0 with a number of //! implementations of the `Deserialize`, `Serialize`, `Deserializer`, and //! `Serializer` traits. Namely, you'll find: //! @@ -146,23 +144,24 @@ //! } //! ``` //! +//! [TOML]: https://github.com/toml-lang/toml //! [Cargo]: https://crates.io/ //! [`serde`]: https://serde.rs/ -#![doc(html_root_url = "https://docs.rs/toml/0.3")] +#![doc(html_root_url = "https://docs.rs/toml/0.4")] #![deny(missing_docs)] #[macro_use] extern crate serde; pub mod value; -mod datetime; #[doc(no_inline)] pub use value::Value; +mod datetime; pub mod ser; #[doc(no_inline)] -pub use ser::{to_string, to_vec, Serializer}; +pub use ser::{to_string, to_string_pretty, to_vec, Serializer}; pub mod de; #[doc(no_inline)] pub use de::{from_slice, from_str, Deserializer}; diff -Nru distinst-0.1.0/vendor/toml/src/ser.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/ser.rs --- distinst-0.1.0/vendor/toml/src/ser.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/ser.rs 2017-12-21 19:00:07.000000000 +0000 @@ -30,6 +30,7 @@ use std::error; use std::fmt::{self, Write}; use std::marker; +use std::rc::Rc; use serde::ser; use datetime::{SERDE_STRUCT_FIELD_NAME, SERDE_STRUCT_NAME}; @@ -50,6 +51,41 @@ /// Serialization can fail if `T`'s implementation of `Serialize` decides to /// fail, if `T` contains a map with non-string keys, or if `T` attempts to /// serialize an unsupported datatype such as an enum, tuple, or tuple struct. +/// +/// # Examples +/// +/// ``` +/// #[macro_use] +/// extern crate serde_derive; +/// extern crate toml; +/// +/// #[derive(Serialize)] +/// struct Config { +/// database: Database, +/// } +/// +/// #[derive(Serialize)] +/// struct Database { +/// ip: String, +/// port: Vec, +/// connection_max: u32, +/// enabled: bool, +/// } +/// +/// fn main() { +/// let config = Config { +/// database: Database { +/// ip: "192.168.1.1".to_string(), +/// port: vec![8001, 8002, 8003], +/// connection_max: 5000, +/// enabled: false, +/// }, +/// }; +/// +/// let toml = toml::to_string(&config).unwrap(); +/// println!("{}", toml) +/// } +/// ``` pub fn to_string(value: &T) -> Result where T: ser::Serialize, { @@ -58,6 +94,18 @@ Ok(dst) } +/// Serialize the given data structure as a "pretty" String of TOML. +/// +/// This is identical to `to_string` except the output string has a more +/// "pretty" output. See `Serializer::pretty` for more details. +pub fn to_string_pretty(value: &T) -> Result + where T: ser::Serialize, +{ + let mut dst = String::with_capacity(128); + value.serialize(&mut Serializer::pretty(&mut dst))?; + Ok(dst) +} + /// Errors that can occur when serializing a type. #[derive(Debug, PartialEq, Eq, Clone)] pub enum Error { @@ -72,7 +120,8 @@ /// attempted where the key of a map was not a string. KeyNotString, - /// Keys in maps are not allowed to have newlines. + /// An error that we never omit but keep for backwards compatibility + #[doc(hidden)] KeyNewline, /// Arrays in TOML must have a homogenous type, but a heterogeneous array @@ -87,6 +136,9 @@ /// A serialized date was invalid. DateInvalid, + /// A serialized number was invalid. + NumberInvalid, + /// None was attempted to be serialized, but it's not supported. UnsupportedNone, @@ -98,6 +150,47 @@ __Nonexhaustive, } +#[derive(Debug, Default, Clone)] +#[doc(hidden)] +/// Internal place for holding array setings +struct ArraySettings { + indent: usize, + trailing_comma: bool, +} + +impl ArraySettings { + fn pretty() -> ArraySettings { + ArraySettings { + indent: 4, + trailing_comma: true, + } + } +} + +#[doc(hidden)] +#[derive(Debug, Default, Clone)] +/// String settings +struct StringSettings { + /// Whether to use literal strings when possible + literal: bool, +} + +impl StringSettings { + fn pretty() -> StringSettings { + StringSettings { + literal: true, + } + } +} + +#[derive(Debug, Default, Clone)] +#[doc(hidden)] +/// Internal struct for holding serialization settings +struct Settings { + array: Option, + string: Option, +} + /// Serialization implementation for TOML. /// /// This structure implements serialization support for TOML to serialize an @@ -110,6 +203,7 @@ pub struct Serializer<'a> { dst: &'a mut String, state: State<'a>, + settings: Rc, } #[derive(Debug, Clone)] @@ -124,6 +218,7 @@ parent: &'a State<'a>, first: &'a Cell, type_: &'a Cell>, + len: Option, }, End, } @@ -133,6 +228,7 @@ ser: &'b mut Serializer<'a>, first: Cell, type_: Cell>, + len: Option, } #[doc(hidden)] @@ -155,7 +251,178 @@ Serializer { dst: dst, state: State::End, + settings: Rc::new(Settings::default()), + } + } + + /// Instantiate a "pretty" formatter + /// + /// By default this will use: + /// + /// - pretty strings: strings with newlines will use the `'''` syntax. See + /// `Serializer::pretty_string` + /// - pretty arrays: each item in arrays will be on a newline, have an indentation of 4 and + /// have a trailing comma. See `Serializer::pretty_array` + pub fn pretty(dst: &'a mut String) -> Serializer<'a> { + Serializer { + dst: dst, + state: State::End, + settings: Rc::new(Settings { + array: Some(ArraySettings::pretty()), + string: Some(StringSettings::pretty()), + }), + } + } + + /// Enable or Disable pretty strings + /// + /// If enabled, literal strings will be used when possible and strings with + /// one or more newlines will use triple quotes (i.e.: `'''` or `"""`) + /// + /// # Examples + /// + /// Instead of: + /// + /// ```toml,ignore + /// single = "no newlines" + /// text = "\nfoo\nbar\n" + /// ``` + /// + /// You will have: + /// + /// ```toml,ignore + /// single = 'no newlines' + /// text = ''' + /// foo + /// bar + /// ''' + /// ``` + pub fn pretty_string(&mut self, value: bool) -> &mut Self { + Rc::get_mut(&mut self.settings).unwrap().string = if value { + Some(StringSettings::pretty()) + } else { + None + }; + self + } + + /// Enable or Disable Literal strings for pretty strings + /// + /// If enabled, literal strings will be used when possible and strings with + /// one or more newlines will use triple quotes (i.e.: `'''` or `"""`) + /// + /// If disabled, literal strings will NEVER be used and strings with one or + /// more newlines will use `"""` + /// + /// # Examples + /// + /// Instead of: + /// + /// ```toml,ignore + /// single = "no newlines" + /// text = "\nfoo\nbar\n" + /// ``` + /// + /// You will have: + /// + /// ```toml,ignore + /// single = "no newlines" + /// text = """ + /// foo + /// bar + /// """ + /// ``` + pub fn pretty_string_literal(&mut self, value: bool) -> &mut Self { + let use_default = if let &mut Some(ref mut s) = &mut Rc::get_mut(&mut self.settings) + .unwrap().string { + s.literal = value; + false + } else { + true + }; + + if use_default { + let mut string = StringSettings::pretty(); + string.literal = value; + Rc::get_mut(&mut self.settings).unwrap().string = Some(string); + } + self + } + + /// Enable or Disable pretty arrays + /// + /// If enabled, arrays will always have each item on their own line. + /// + /// Some specific features can be controlled via other builder methods: + /// + /// - `Serializer::pretty_array_indent`: set the indent to a value other + /// than 4. + /// - `Serializer::pretty_array_trailing_comma`: enable/disable the trailing + /// comma on the last item. + /// + /// # Examples + /// + /// Instead of: + /// + /// ```toml,ignore + /// array = ["foo", "bar"] + /// ``` + /// + /// You will have: + /// + /// ```toml,ignore + /// array = [ + /// "foo", + /// "bar", + /// ] + /// ``` + pub fn pretty_array(&mut self, value: bool) -> &mut Self { + Rc::get_mut(&mut self.settings).unwrap().array = if value { + Some(ArraySettings::pretty()) + } else { + None + }; + self + } + + /// Set the indent for pretty arrays + /// + /// See `Serializer::pretty_array` for more details. + pub fn pretty_array_indent(&mut self, value: usize) -> &mut Self { + let use_default = if let &mut Some(ref mut a) = &mut Rc::get_mut(&mut self.settings) + .unwrap().array { + a.indent = value; + false + } else { + true + }; + + if use_default { + let mut array = ArraySettings::pretty(); + array.indent = value; + Rc::get_mut(&mut self.settings).unwrap().array = Some(array); } + self + } + + /// Specify whether to use a trailing comma when serializing pretty arrays + /// + /// See `Serializer::pretty_array` for more details. + pub fn pretty_array_trailing_comma(&mut self, value: bool) -> &mut Self { + let use_default = if let &mut Some(ref mut a) = &mut Rc::get_mut(&mut self.settings) + .unwrap().array { + a.trailing_comma = value; + false + } else { + true + }; + + if use_default { + let mut array = ArraySettings::pretty(); + array.trailing_comma = value; + Rc::get_mut(&mut self.settings).unwrap().array = Some(array); + } + self } fn display(&mut self, @@ -179,12 +446,12 @@ fn _emit_key(&mut self, state: &State) -> Result<(), Error> { match *state { State::End => Ok(()), - State::Array { parent, first, type_ } => { + State::Array { parent, first, type_, len } => { assert!(type_.get().is_some()); if first.get() { self._emit_key(parent)?; } - self.emit_array(first) + self.emit_array(first, len) } State::Table { parent, first, table_emitted, key } => { if table_emitted.get() { @@ -201,11 +468,25 @@ } } - fn emit_array(&mut self, first: &Cell) -> Result<(), Error> { - if first.get() { - self.dst.push_str("["); - } else { - self.dst.push_str(", "); + fn emit_array(&mut self, first: &Cell, len: Option) -> Result<(), Error> { + match (len, &self.settings.array) { + (Some(0...1), _) | (_, &None) => { + if first.get() { + self.dst.push_str("[") + } else { + self.dst.push_str(", ") + } + }, + (_, &Some(ref a)) => { + if first.get() { + self.dst.push_str("[\n") + } else { + self.dst.push_str(",\n") + } + for _ in 0..a.indent { + self.dst.push_str(" "); + } + }, } Ok(()) } @@ -238,29 +519,144 @@ if ok { drop(write!(self.dst, "{}", key)); } else { - self.emit_str(key)?; + self.emit_str(key, true)?; } Ok(()) } - fn emit_str(&mut self, value: &str) -> Result<(), Error> { - drop(write!(self.dst, "\"")); - for ch in value.chars() { - match ch { - '\u{8}' => drop(write!(self.dst, "\\b")), - '\u{9}' => drop(write!(self.dst, "\\t")), - '\u{a}' => drop(write!(self.dst, "\\n")), - '\u{c}' => drop(write!(self.dst, "\\f")), - '\u{d}' => drop(write!(self.dst, "\\r")), - '\u{22}' => drop(write!(self.dst, "\\\"")), - '\u{5c}' => drop(write!(self.dst, "\\\\")), - c if c < '\u{1f}' => { - drop(write!(self.dst, "\\u{:04}", ch as u32)) + fn emit_str(&mut self, value: &str, is_key: bool) -> Result<(), Error> { + #[derive(PartialEq)] + enum Type { + NewlineTripple, + OnelineTripple, + OnelineSingle, + } + + enum Repr { + /// represent as a literal string (using '') + Literal(String, Type), + /// represent the std way (using "") + Std(Type), + } + + fn do_pretty(value: &str) -> Repr { + // For doing pretty prints we store in a new String + // because there are too many cases where pretty cannot + // work. We need to determine: + // - if we are a "multi-line" pretty (if there are \n) + // - if ['''] appears if multi or ['] if single + // - if there are any invalid control characters + // + // Doing it any other way would require multiple passes + // to determine if a pretty string works or not. + let mut out = String::with_capacity(value.len() * 2); + let mut ty = Type::OnelineSingle; + // found consecutive single quotes + let mut max_found_singles = 0; + let mut found_singles = 0; + let mut can_be_pretty = true; + + for ch in value.chars() { + if can_be_pretty { + if ch == '\'' { + found_singles += 1; + if found_singles >= 3 { + can_be_pretty = false; + } + } else { + if found_singles > max_found_singles { + max_found_singles = found_singles; + } + found_singles = 0 + } + match ch { + '\t' => {}, + '\n' => ty = Type::NewlineTripple, + // note that the following are invalid: \b \f \r + c if c < '\u{1f}' => can_be_pretty = false, // Invalid control character + _ => {} + } + out.push(ch); + } else { + // the string cannot be represented as pretty, + // still check if it should be multiline + if ch == '\n' { + ty = Type::NewlineTripple; + } } - ch => drop(write!(self.dst, "{}", ch)), } + if !can_be_pretty { + debug_assert!(ty != Type::OnelineTripple); + return Repr::Std(ty); + } + if found_singles > max_found_singles { + max_found_singles = found_singles; + } + debug_assert!(max_found_singles < 3); + if ty == Type::OnelineSingle && max_found_singles >= 1 { + // no newlines, but must use ''' because it has ' in it + ty = Type::OnelineTripple; + } + Repr::Literal(out, ty) + } + + let repr = if !is_key && self.settings.string.is_some() { + match (&self.settings.string, do_pretty(value)) { + (&Some(StringSettings { literal: false, .. }), Repr::Literal(_, ty)) => + Repr::Std(ty), + (_, r @ _) => r, + } + } else { + Repr::Std(Type::OnelineSingle) + }; + match repr { + Repr::Literal(literal, ty) => { + // A pretty string + match ty { + Type::NewlineTripple => self.dst.push_str("'''\n"), + Type::OnelineTripple => self.dst.push_str("'''"), + Type::OnelineSingle => self.dst.push('\''), + } + self.dst.push_str(&literal); + match ty { + Type::OnelineSingle => self.dst.push('\''), + _ => self.dst.push_str("'''"), + } + }, + Repr::Std(ty) => { + match ty { + Type::NewlineTripple => self.dst.push_str("\"\"\"\n"), + // note: OnelineTripple can happen if do_pretty wants to do + // '''it's one line''' + // but settings.string.literal == false + Type::OnelineSingle | + Type::OnelineTripple => self.dst.push('"'), + } + for ch in value.chars() { + match ch { + '\u{8}' => self.dst.push_str("\\b"), + '\u{9}' => self.dst.push_str("\\t"), + '\u{a}' => { + match ty { + Type::NewlineTripple => self.dst.push('\n'), + Type::OnelineSingle => self.dst.push_str("\\n"), + _ => unreachable!(), + } + }, + '\u{c}' => self.dst.push_str("\\f"), + '\u{d}' => self.dst.push_str("\\r"), + '\u{22}' => self.dst.push_str("\\\""), + '\u{5c}' => self.dst.push_str("\\\\"), + c if c < '\u{1f}' => drop(write!(self.dst, "\\u{:04X}", ch as u32)), + ch => self.dst.push(ch), + } + } + match ty { + Type::NewlineTripple => self.dst.push_str("\"\"\""), + Type::OnelineSingle | Type::OnelineTripple => self.dst.push('"'), + } + }, } - drop(write!(self.dst, "\"")); Ok(()) } @@ -270,20 +666,53 @@ State::Array { .. } => true, _ => false, }; + + // Unlike [..]s, we can't omit [[..]] ancestors, so be sure to emit table + // headers for them. + let mut p = state; + if let State::Array { first, parent, .. } = *state { + if first.get() { + p = parent; + } + } + while let State::Table { first, parent, .. } = *p { + p = parent; + if !first.get() { + break; + } + if let State::Array { parent: &State::Table {..}, ..} = *parent { + self.emit_table_header(parent)?; + break; + } + } + match *state { - State::Table { first , .. } | - State::Array { parent: &State::Table { first, .. }, .. } => { + State::Table { first, .. } => { if !first.get() { - self.dst.push_str("\n"); + // Newline if we are a table that is not the first + // table in the document. + self.dst.push('\n'); } - } + }, + State::Array { parent, first, .. } => { + if !first.get() { + // Always newline if we are not the first item in the + // table-array + self.dst.push('\n'); + } else if let State::Table { first, .. } = *parent { + if !first.get() { + // Newline if we are not the first item in the document + self.dst.push('\n'); + } + } + }, _ => {} } self.dst.push_str("["); if array_of_tables { self.dst.push_str("["); } - self.emit_key_part(&state)?; + self.emit_key_part(state)?; if array_of_tables { self.dst.push_str("]"); } @@ -356,6 +785,10 @@ } fn serialize_f32(mut self, v: f32) -> Result<(), Self::Error> { + if !v.is_finite() { + return Err(Error::NumberInvalid); + } + self.emit_key("float")?; drop(write!(self.dst, "{}", v)); if v % 1.0 == 0.0 { @@ -368,6 +801,10 @@ } fn serialize_f64(mut self, v: f64) -> Result<(), Self::Error> { + if !v.is_finite() { + return Err(Error::NumberInvalid); + } + self.emit_key("float")?; drop(write!(self.dst, "{}", v)); if v % 1.0 == 0.0 { @@ -386,7 +823,7 @@ fn serialize_str(mut self, value: &str) -> Result<(), Self::Error> { self.emit_key("string")?; - self.emit_str(value)?; + self.emit_str(value, false)?; if let State::Table { .. } = self.state { self.dst.push_str("\n"); } @@ -420,10 +857,10 @@ fn serialize_unit_variant(self, _name: &'static str, - _variant_index: usize, - _variant: &'static str) + _variant_index: u32, + variant: &'static str) -> Result<(), Self::Error> { - Err(Error::UnsupportedType) + self.serialize_str(variant) } fn serialize_newtype_struct(self, _name: &'static str, value: &T) @@ -435,7 +872,7 @@ fn serialize_newtype_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _value: &T) -> Result<(), Self::Error> @@ -444,21 +881,17 @@ Err(Error::UnsupportedType) } - fn serialize_seq(mut self, _len: Option) + fn serialize_seq(mut self, len: Option) -> Result { self.array_type("array")?; Ok(SerializeSeq { ser: self, first: Cell::new(true), type_: Cell::new(None), + len: len, }) } - fn serialize_seq_fixed_size(self, size: usize) - -> Result { - self.serialize_seq(Some(size)) - } - fn serialize_tuple(self, _len: usize) -> Result { Err(Error::UnsupportedType) @@ -471,7 +904,7 @@ fn serialize_tuple_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -507,7 +940,7 @@ fn serialize_struct_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -528,7 +961,9 @@ parent: &self.ser.state, first: &self.first, type_: &self.type_, + len: self.len, }, + settings: self.ser.settings.clone(), })?; self.first.set(false); Ok(()) @@ -537,7 +972,19 @@ fn end(self) -> Result<(), Error> { match self.type_.get() { Some("table") => return Ok(()), - Some(_) => self.ser.dst.push_str("]"), + Some(_) => { + match (self.len, &self.ser.settings.array) { + (Some(0...1), _) | (_, &None) => { + self.ser.dst.push_str("]"); + }, + (_, &Some(ref a)) => { + if a.trailing_comma { + self.ser.dst.push_str(","); + } + self.ser.dst.push_str("\n]"); + }, + } + } None => { assert!(self.first.get()); self.ser.emit_key("array")?; @@ -563,9 +1010,6 @@ SerializeTable::Table { ref mut key, .. } => { key.truncate(0); *key = input.serialize(StringExtractor)?; - if key.contains("\n") { - return Err(Error::KeyNewline) - } } } Ok(()) @@ -586,11 +1030,12 @@ let res = value.serialize(&mut Serializer { dst: &mut *ser.dst, state: State::Table { - key: &key, + key: key, parent: &ser.state, - first: &first, - table_emitted: &table_emitted, + first: first, + table_emitted: table_emitted, }, + settings: ser.settings.clone(), }); match res { Ok(()) => first.set(false), @@ -646,6 +1091,7 @@ first: first, table_emitted: table_emitted, }, + settings: ser.settings.clone(), }); match res { Ok(()) => first.set(false), @@ -658,6 +1104,15 @@ } fn end(self) -> Result<(), Error> { + match self { + SerializeTable::Datetime(_) => {}, + SerializeTable::Table { mut ser, first, .. } => { + if first.get() { + let state = ser.state.clone(); + ser.emit_table_header(&state)?; + } + } + } Ok(()) } } @@ -754,7 +1209,7 @@ fn serialize_unit_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str) -> Result<(), Self::Error> { Err(Error::DateInvalid) @@ -769,7 +1224,7 @@ fn serialize_newtype_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _value: &T) -> Result<(), Self::Error> @@ -783,11 +1238,6 @@ Err(Error::DateInvalid) } - fn serialize_seq_fixed_size(self, _size: usize) - -> Result { - Err(Error::DateInvalid) - } - fn serialize_tuple(self, _len: usize) -> Result { Err(Error::DateInvalid) @@ -800,7 +1250,7 @@ fn serialize_tuple_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -819,7 +1269,7 @@ fn serialize_struct_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -918,7 +1368,7 @@ fn serialize_unit_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str) -> Result { Err(Error::KeyNotString) @@ -933,7 +1383,7 @@ fn serialize_newtype_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _value: &T) -> Result @@ -947,11 +1397,6 @@ Err(Error::KeyNotString) } - fn serialize_seq_fixed_size(self, _size: usize) - -> Result { - Err(Error::KeyNotString) - } - fn serialize_tuple(self, _len: usize) -> Result { Err(Error::KeyNotString) @@ -964,7 +1409,7 @@ fn serialize_tuple_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -983,7 +1428,7 @@ fn serialize_struct_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result { @@ -996,12 +1441,13 @@ match *self { Error::UnsupportedType => "unsupported Rust type".fmt(f), Error::KeyNotString => "map key was not a string".fmt(f), - Error::KeyNewline => "map keys cannot contain newlines".fmt(f), Error::ArrayMixedType => "arrays cannot have mixed types".fmt(f), Error::ValueAfterTable => "values must be emitted before tables".fmt(f), - Error::DateInvalid => "a serialize date was invalid".fmt(f), + Error::DateInvalid => "a serialized date was invalid".fmt(f), + Error::NumberInvalid => "a serialized number was invalid".fmt(f), Error::UnsupportedNone => "unsupported None value".fmt(f), Error::Custom(ref s) => s.fmt(f), + Error::KeyNewline => unreachable!(), Error::__Nonexhaustive => panic!(), } } @@ -1012,12 +1458,13 @@ match *self { Error::UnsupportedType => "unsupported Rust type", Error::KeyNotString => "map key was not a string", - Error::KeyNewline => "map keys cannot contain newlines", Error::ArrayMixedType => "arrays cannot have mixed types", Error::ValueAfterTable => "values must be emitted before tables", Error::DateInvalid => "a serialized date was invalid", + Error::NumberInvalid => "a serialized number was invalid", Error::UnsupportedNone => "unsupported None value", Error::Custom(_) => "custom error", + Error::KeyNewline => unreachable!(), Error::__Nonexhaustive => panic!(), } } @@ -1175,7 +1622,7 @@ Err(ser::Error::custom("unsupported")) } - fn serialize_unit_variant(self, _: &'static str, _: usize, _: &'static str) -> Result { + fn serialize_unit_variant(self, _: &'static str, _: u32, _: &'static str) -> Result { Err(ser::Error::custom("unsupported")) } @@ -1183,7 +1630,7 @@ v.serialize(self) } - fn serialize_newtype_variant(self, _: &'static str, _: usize, _: &'static str, _: &T) -> Result { + fn serialize_newtype_variant(self, _: &'static str, _: u32, _: &'static str, _: &T) -> Result { Err(ser::Error::custom("unsupported")) } @@ -1191,10 +1638,6 @@ Ok(self) } - fn serialize_seq_fixed_size(self, _: usize) -> Result { - Ok(self) - } - fn serialize_tuple(self, _: usize) -> Result { Err(ser::Error::custom("unsupported")) } @@ -1203,7 +1646,7 @@ Err(ser::Error::custom("unsupported")) } - fn serialize_tuple_variant(self, _: &'static str, _: usize, _: &'static str, _: usize) -> Result { + fn serialize_tuple_variant(self, _: &'static str, _: u32, _: &'static str, _: usize) -> Result { Err(ser::Error::custom("unsupported")) } @@ -1215,7 +1658,7 @@ Ok(self) } - fn serialize_struct_variant(self, _: &'static str, _: usize, _: &'static str, _: usize) -> Result { + fn serialize_struct_variant(self, _: &'static str, _: u32, _: &'static str, _: usize) -> Result { Err(ser::Error::custom("unsupported")) } } diff -Nru distinst-0.1.0/vendor/toml/src/tokens.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/tokens.rs --- distinst-0.1.0/vendor/toml/src/tokens.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/tokens.rs 2017-12-21 19:00:07.000000000 +0000 @@ -66,7 +66,7 @@ }; // Eat utf-8 BOM t.eatc('\u{feff}'); - return t + t } pub fn next(&mut self) -> Result>, Error> { @@ -141,7 +141,7 @@ if val == "" { return Err(Error::EmptyTableKey(offset)) } - match src.find("\n") { + match src.find('\n') { None => Ok(val), Some(i) => Err(Error::NewlineInTableKey(offset + i)), } @@ -422,7 +422,7 @@ } } - fn into_cow<'a>(self, input: &'a str) -> Cow<'a, str> { + fn into_cow(self, input: &str) -> Cow { match self { MaybeString::NotEscaped(start) => Cow::Borrowed(&input[start..]), MaybeString::Owned(s) => Cow::Owned(s), diff -Nru distinst-0.1.0/vendor/toml/src/value/display.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/value/display.rs --- distinst-0.1.0/vendor/toml/src/value/display.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/value/display.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -use std::fmt; - -use Table as TomlTable; -use Value::{self, String, Integer, Float, Boolean, Datetime, Array, Table}; - -struct Printer<'a, 'b:'a> { - output: &'a mut fmt::Formatter<'b>, - stack: Vec<&'a str>, -} - -struct Key<'a>(&'a [&'a str]); - -impl fmt::Display for Value { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - String(ref s) => write_str(f, s), - Integer(i) => write!(f, "{}", i), - Float(fp) => { - try!(write!(f, "{}", fp)); - if fp % 1.0 == 0.0 { try!(write!(f, ".0")) } - Ok(()) - } - Boolean(b) => write!(f, "{}", b), - Datetime(ref s) => write!(f, "{}", s), - Table(ref t) => { - let mut p = Printer { output: f, stack: Vec::new() }; - p.print(t) - } - Array(ref a) => { - try!(write!(f, "[")); - for (i, v) in a.iter().enumerate() { - if i != 0 { try!(write!(f, ", ")); } - try!(write!(f, "{}", v)); - } - write!(f, "]") - } - } - } -} - -fn write_str(f: &mut fmt::Formatter, s: &str) -> fmt::Result { - try!(write!(f, "\"")); - for ch in s.chars() { - match ch { - '\u{8}' => try!(write!(f, "\\b")), - '\u{9}' => try!(write!(f, "\\t")), - '\u{a}' => try!(write!(f, "\\n")), - '\u{c}' => try!(write!(f, "\\f")), - '\u{d}' => try!(write!(f, "\\r")), - '\u{22}' => try!(write!(f, "\\\"")), - '\u{5c}' => try!(write!(f, "\\\\")), - c if c < '\u{1f}' => { - try!(write!(f, "\\u{:04}", ch as u32)) - } - ch => try!(write!(f, "{}", ch)), - } - } - write!(f, "\"") -} - -impl<'a, 'b> Printer<'a, 'b> { - fn print(&mut self, table: &'a TomlTable) -> fmt::Result { - let mut space_out_first = false; - for (k, v) in table.iter() { - match *v { - Table(..) => continue, - Array(ref a) => { - if let Some(&Table(..)) = a.first() { - continue; - } - } - _ => {} - } - space_out_first = true; - try!(writeln!(self.output, "{} = {}", Key(&[k]), v)); - } - for (i, (k, v)) in table.iter().enumerate() { - match *v { - Table(ref inner) => { - self.stack.push(k); - if space_out_first || i != 0 { - try!(write!(self.output, "\n")); - } - try!(writeln!(self.output, "[{}]", Key(&self.stack))); - try!(self.print(inner)); - self.stack.pop(); - } - Array(ref inner) => { - match inner.first() { - Some(&Table(..)) => {} - _ => continue - } - self.stack.push(k); - for (j, inner) in inner.iter().enumerate() { - if space_out_first || i != 0 || j != 0 { - try!(write!(self.output, "\n")); - } - try!(writeln!(self.output, "[[{}]]", Key(&self.stack))); - match *inner { - Table(ref inner) => try!(self.print(inner)), - _ => panic!("non-heterogeneous toml array"), - } - } - self.stack.pop(); - } - _ => {}, - } - } - Ok(()) - } -} - -impl<'a> fmt::Display for Key<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - for (i, part) in self.0.iter().enumerate() { - if i != 0 { try!(write!(f, ".")); } - let ok = part.chars().all(|c| { - match c { - 'a' ... 'z' | - 'A' ... 'Z' | - '0' ... '9' | - '-' | '_' => true, - _ => false, - } - }); - if ok { - try!(write!(f, "{}", part)); - } else { - try!(write_str(f, part)); - } - } - Ok(()) - } -} diff -Nru distinst-0.1.0/vendor/toml/src/value.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/value.rs --- distinst-0.1.0/vendor/toml/src/value.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/src/value.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,6 +1,7 @@ //! Definition of a TOML value -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashMap}; +use std::hash::Hash; use std::fmt; use std::ops; use std::str::FromStr; @@ -8,6 +9,7 @@ use serde::ser; use serde::de; +use serde::de::IntoDeserializer; pub use datetime::{Datetime, DatetimeParseError}; use datetime::{DatetimeFromString, SERDE_STRUCT_FIELD_NAME}; @@ -58,8 +60,8 @@ /// something is wrong with the data, for example required struct fields are /// missing from the TOML map or some number is too big to fit in the expected /// primitive type. - pub fn try_into(self) -> Result - where T: de::Deserialize, + pub fn try_into<'de, T>(self) -> Result + where T: de::Deserialize<'de>, { de::Deserialize::deserialize(self) } @@ -218,48 +220,61 @@ } } -impl From for Value { - fn from(val: String) -> Value { - Value::String(val) +impl<'a> From<&'a str> for Value { + #[inline] + fn from(val: &'a str) -> Value { + Value::String(val.to_string()) } } -impl From for Value { - fn from(val: i64) -> Value { - Value::Integer(val) +impl> From> for Value { + fn from(val: Vec) -> Value { + Value::Array(val.into_iter().map(|v| v.into()).collect()) } } -impl From for Value { - fn from(val: f64) -> Value { - Value::Float(val) - } -} +impl, V: Into> From> for Value { + fn from(val: BTreeMap) -> Value { + let table = val.into_iter() + .map(|(s, v)| (s.into(), v.into())) + .collect(); -impl From for Value { - fn from(val: bool) -> Value { - Value::Boolean(val) + Value::Table(table) } } -impl From for Value { - fn from(val: Array) -> Value { - Value::Array(val) - } -} +impl + Hash + Eq, V: Into> From> for Value { + fn from(val: HashMap) -> Value { + let table = val.into_iter() + .map(|(s, v)| (s.into(), v.into())) + .collect(); -impl From for Value { - fn from(val: Table) -> Value { - Value::Table(val) + Value::Table(table) } } -impl From for Value { - fn from(val: Datetime) -> Value { - Value::Datetime(val) +macro_rules! impl_into_value { + ($variant:ident : $T:ty) => { + impl From<$T> for Value { + #[inline] + fn from(val: $T) -> Value { + Value::$variant(val.into()) + } + } } } +impl_into_value!(String: String); +impl_into_value!(Integer: i64); +impl_into_value!(Integer: i32); +impl_into_value!(Integer: i8); +impl_into_value!(Integer: u8); +impl_into_value!(Integer: u32); +impl_into_value!(Float: f64); +impl_into_value!(Float: f32); +impl_into_value!(Boolean: bool); +impl_into_value!(Datetime: Datetime); + /// Types that can be used to index a `toml::Value` /// /// Currently this is implemented for `usize` to index arrays and `str` to index @@ -337,7 +352,7 @@ impl fmt::Display for Value { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::ser::to_string(self).unwrap().fmt(f) + ::ser::to_string(self).expect("Unable to represent value as string").fmt(f) } } @@ -387,13 +402,13 @@ } } -impl de::Deserialize for Value { +impl<'de> de::Deserialize<'de> for Value { fn deserialize(deserializer: D) -> Result - where D: de::Deserializer + where D: de::Deserializer<'de>, { struct ValueVisitor; - impl de::Visitor for ValueVisitor { + impl<'de> de::Visitor<'de> for ValueVisitor { type Value = Value; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -421,55 +436,58 @@ } fn visit_some(self, deserializer: D) -> Result - where D: de::Deserializer, + where D: de::Deserializer<'de>, { de::Deserialize::deserialize(deserializer) } - fn visit_seq(self, visitor: V) -> Result - where V: de::SeqVisitor + fn visit_seq(self, mut visitor: V) -> Result + where V: de::SeqAccess<'de>, { - let values = de::impls::VecVisitor::new().visit_seq(visitor)?; - Ok(Value::Array(values)) + let mut vec = Vec::new(); + while let Some(elem) = try!(visitor.next_element()) { + vec.push(elem); + } + Ok(Value::Array(vec)) } fn visit_map(self, mut visitor: V) -> Result - where V: de::MapVisitor + where V: de::MapAccess<'de>, { let mut key = String::new(); - let datetime = visitor.visit_key_seed(DatetimeOrTable { + let datetime = visitor.next_key_seed(DatetimeOrTable { key: &mut key, })?; match datetime { Some(true) => { - let date: DatetimeFromString = visitor.visit_value()?; + let date: DatetimeFromString = visitor.next_value()?; return Ok(Value::Datetime(date.value)) } None => return Ok(Value::Table(BTreeMap::new())), Some(false) => {} } let mut map = BTreeMap::new(); - map.insert(key, visitor.visit_value()?); - while let Some(key) = visitor.visit_key()? { + map.insert(key, visitor.next_value()?); + while let Some(key) = visitor.next_key()? { if map.contains_key(&key) { let msg = format!("duplicate key: `{}`", key); return Err(de::Error::custom(msg)) } - map.insert(key, visitor.visit_value()?); + map.insert(key, visitor.next_value()?); } Ok(Value::Table(map)) } } - deserializer.deserialize(ValueVisitor) + deserializer.deserialize_any(ValueVisitor) } } -impl de::Deserializer for Value { +impl<'de> de::Deserializer<'de> for Value { type Error = ::de::Error; - fn deserialize(self, visitor: V) -> Result - where V: de::Visitor, + fn deserialize_any(self, visitor: V) -> Result + where V: de::Visitor<'de>, { match self { Value::Boolean(v) => visitor.visit_bool(v), @@ -502,18 +520,44 @@ } } + #[inline] + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + match self { + Value::String(variant) => visitor.visit_enum(variant.into_deserializer()), + _ => Err(de::Error::invalid_type(de::Unexpected::UnitVariant, &"string only")), + } + } + // `None` is interpreted as a missing field so be sure to implement `Some` // as a present field. fn deserialize_option(self, visitor: V) -> Result - where V: de::Visitor + where V: de::Visitor<'de>, { visitor.visit_some(self) } - forward_to_deserialize! { + fn deserialize_newtype_struct( + self, + _name: &'static str, + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + visitor.visit_newtype_struct(self) + } + + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct tuple_struct struct - struct_field tuple ignored_any enum newtype_struct + bytes byte_buf map unit_struct tuple_struct struct + tuple ignored_any identifier } } @@ -529,11 +573,12 @@ } } -impl de::SeqVisitor for SeqDeserializer { +impl<'de> de::SeqAccess<'de> for SeqDeserializer { type Error = ::de::Error; - fn visit_seed(&mut self, seed: T) -> Result, ::de::Error> - where T: de::DeserializeSeed, + fn next_element_seed(&mut self, seed: T) + -> Result, ::de::Error> + where T: de::DeserializeSeed<'de>, { match self.iter.next() { Some(value) => seed.deserialize(value).map(Some), @@ -541,8 +586,11 @@ } } - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() + fn size_hint(&self) -> Option { + match self.iter.size_hint() { + (lower, Some(upper)) if lower == upper => Some(upper), + _ => None, + } } } @@ -560,11 +608,11 @@ } } -impl de::MapVisitor for MapDeserializer { +impl<'de> de::MapAccess<'de> for MapDeserializer { type Error = ::de::Error; - fn visit_key_seed(&mut self, seed: T) -> Result, ::de::Error> - where T: de::DeserializeSeed, + fn next_key_seed(&mut self, seed: T) -> Result, ::de::Error> + where T: de::DeserializeSeed<'de>, { match self.iter.next() { Some((key, value)) => { @@ -575,8 +623,8 @@ } } - fn visit_value_seed(&mut self, seed: T) -> Result - where T: de::DeserializeSeed, + fn next_value_seed(&mut self, seed: T) -> Result + where T: de::DeserializeSeed<'de>, { let (key, res) = match self.value.take() { Some((key, value)) => (key, seed.deserialize(value)), @@ -588,8 +636,19 @@ }) } - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() + fn size_hint(&self) -> Option { + match self.iter.size_hint() { + (lower, Some(upper)) if lower == upper => Some(upper), + _ => None, + } + } +} + +impl<'de> de::IntoDeserializer<'de, ::de::Error> for Value { + type Deserializer = Self; + + fn into_deserializer(self) -> Self { + self } } @@ -681,10 +740,10 @@ fn serialize_unit_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str) -> Result { - Err(::ser::Error::UnsupportedType) + self.serialize_str(_variant) } fn serialize_newtype_struct(self, @@ -698,7 +757,7 @@ fn serialize_newtype_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _value: &T) -> Result @@ -725,11 +784,6 @@ }) } - fn serialize_seq_fixed_size(self, size: usize) - -> Result { - self.serialize_seq(Some(size)) - } - fn serialize_tuple(self, _len: usize) -> Result { Err(::ser::Error::UnsupportedType) } @@ -741,7 +795,7 @@ fn serialize_tuple_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result @@ -765,7 +819,7 @@ fn serialize_struct_variant(self, _name: &'static str, - _variant_index: usize, + _variant_index: u32, _variant: &'static str, _len: usize) -> Result @@ -851,17 +905,17 @@ key: &'a mut String, } -impl<'a> de::DeserializeSeed for DatetimeOrTable<'a> { +impl<'a, 'de> de::DeserializeSeed<'de> for DatetimeOrTable<'a> { type Value = bool; fn deserialize(self, deserializer: D) -> Result - where D: de::Deserializer + where D: de::Deserializer<'de> { - deserializer.deserialize(self) + deserializer.deserialize_any(self) } } -impl<'a> de::Visitor for DatetimeOrTable<'a> { +impl<'a, 'de> de::Visitor<'de> for DatetimeOrTable<'a> { type Value = bool; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff -Nru distinst-0.1.0/vendor/toml/tests/invalid-encoder-misc.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/invalid-encoder-misc.rs --- distinst-0.1.0/vendor/toml/tests/invalid-encoder-misc.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/invalid-encoder-misc.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +extern crate toml; + +use std::f64; + +#[test] +fn test_invalid_float_encode() { + fn bad(value: toml::Value) { + assert!(toml::to_string(&value).is_err()); + } + + bad(toml::Value::Float(f64::INFINITY)); + bad(toml::Value::Float(f64::NEG_INFINITY)); + bad(toml::Value::Float(f64::NAN)); +} diff -Nru distinst-0.1.0/vendor/toml/tests/invalid-misc.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/invalid-misc.rs --- distinst-0.1.0/vendor/toml/tests/invalid-misc.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/invalid-misc.rs 2017-12-21 19:00:07.000000000 +0000 @@ -10,4 +10,8 @@ bad("a = 1__1"); bad("a = 1_"); bad("''"); + bad("a = nan"); + bad("a = -inf"); + bad("a = inf"); + bad("a = 9e99999"); } diff -Nru distinst-0.1.0/vendor/toml/tests/parser.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/parser.rs --- distinst-0.1.0/vendor/toml/tests/parser.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/parser.rs 2017-12-21 19:00:07.000000000 +0000 @@ -463,7 +463,7 @@ t!("2016-09-09T09:09:09Z"); t!("2016-09-09T09:09:09.1Z"); t!("2016-09-09T09:09:09.2+10:00"); - t!("2016-09-09T09:09:09.0123456789-02:00"); + t!("2016-09-09T09:09:09.123456789-02:00"); bad!("foo = 2016-09-09T09:09:09.Z", "failed to parse date"); bad!("foo = 2016-9-09T09:09:09Z", "failed to parse date"); bad!("foo = 2016-09-09T09:09:09+2:00", "failed to parse date"); diff -Nru distinst-0.1.0/vendor/toml/tests/pretty.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/pretty.rs --- distinst-0.1.0/vendor/toml/tests/pretty.rs 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/pretty.rs 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,308 @@ +extern crate toml; +extern crate serde; + +use serde::ser::Serialize; + +const NO_PRETTY: &'static str = "\ +[example] +array = [\"item 1\", \"item 2\"] +empty = [] +oneline = \"this has no newlines.\" +text = \"\\nthis is the first line\\nthis is the second line\\n\" +"; + +#[test] +fn no_pretty() { + let toml = NO_PRETTY; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + value.serialize(&mut toml::Serializer::new(&mut result)).unwrap(); + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + +#[test] +fn disable_pretty() { + let toml = NO_PRETTY; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_string(false); + serializer.pretty_array(false); + value.serialize(&mut serializer).unwrap(); + } + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + +const PRETTY_STD: &'static str = "\ +[example] +array = [ + 'item 1', + 'item 2', +] +empty = [] +one = ['one'] +oneline = 'this has no newlines.' +text = ''' +this is the first line +this is the second line +''' +"; + +#[test] +fn pretty_std() { + let toml = PRETTY_STD; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + value.serialize(&mut toml::Serializer::pretty(&mut result)).unwrap(); + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + + +const PRETTY_INDENT_2: &'static str = "\ +[example] +array = [ + 'item 1', + 'item 2', +] +empty = [] +one = ['one'] +oneline = 'this has no newlines.' +text = ''' +this is the first line +this is the second line +''' +three = [ + 'one', + 'two', + 'three', +] +"; + +#[test] +fn pretty_indent_2() { + let toml = PRETTY_INDENT_2; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_array_indent(2); + value.serialize(&mut serializer).unwrap(); + } + println!(">> Result:\n{}", result); + assert_eq!(toml, &result); +} + +const PRETTY_INDENT_2_OTHER: &'static str = "\ +[example] +array = [ + \"item 1\", + \"item 2\", +] +empty = [] +oneline = \"this has no newlines.\" +text = \"\\nthis is the first line\\nthis is the second line\\n\" +"; + + +#[test] +/// Test pretty indent when gotten the other way +fn pretty_indent_2_other() { + let toml = PRETTY_INDENT_2_OTHER; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::new(&mut result); + serializer.pretty_array_indent(2); + value.serialize(&mut serializer).unwrap(); + } + assert_eq!(toml, &result); +} + + +const PRETTY_ARRAY_NO_COMMA: &'static str = "\ +[example] +array = [ + \"item 1\", + \"item 2\" +] +empty = [] +oneline = \"this has no newlines.\" +text = \"\\nthis is the first line\\nthis is the second line\\n\" +"; +#[test] +/// Test pretty indent when gotten the other way +fn pretty_indent_array_no_comma() { + let toml = PRETTY_ARRAY_NO_COMMA; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::new(&mut result); + serializer.pretty_array_trailing_comma(false); + value.serialize(&mut serializer).unwrap(); + } + assert_eq!(toml, &result); +} + + +const PRETTY_NO_STRING: &'static str = "\ +[example] +array = [ + \"item 1\", + \"item 2\", +] +empty = [] +oneline = \"this has no newlines.\" +text = \"\\nthis is the first line\\nthis is the second line\\n\" +"; +#[test] +/// Test pretty indent when gotten the other way +fn pretty_no_string() { + let toml = PRETTY_NO_STRING; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_string(false); + value.serialize(&mut serializer).unwrap(); + } + assert_eq!(toml, &result); +} + +const PRETTY_TRICKY: &'static str = r##"[example] +f = "\f" +glass = ''' +Nothing too unusual, except that I can eat glass in: +- Greek: Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα. +- Polish: Mogę jeść szkło, i mi nie szkodzi. +- Hindi: मैं काँच खा सकता हूँ, मुझे उस से कोई पीडा नहीं होती. +- Japanese: 私はガラスを食べられます。それは私を傷つけません。 +''' +r = "\r" +r_newline = """ +\r +""" +single = '''this is a single line but has '' cuz it's tricky''' +single_tricky = "single line with ''' in it" +tabs = ''' +this is pretty standard + except for some tabs right here +''' +text = """ +this is the first line. +This has a ''' in it and \"\"\" cuz it's tricky yo +Also ' and \" because why not +this is the fourth line +""" +"##; + +#[test] +fn pretty_tricky() { + let toml = PRETTY_TRICKY; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + value.serialize(&mut toml::Serializer::pretty(&mut result)).unwrap(); + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + +const PRETTY_TABLE_ARRAY: &'static str = r##"[[array]] +key = 'foo' + +[[array]] +key = 'bar' + +[abc] +doc = 'this is a table' + +[example] +single = 'this is a single line string' +"##; + +#[test] +fn pretty_table_array() { + let toml = PRETTY_TABLE_ARRAY; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + value.serialize(&mut toml::Serializer::pretty(&mut result)).unwrap(); + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + +const TABLE_ARRAY: &'static str = r##"[[array]] +key = "foo" + +[[array]] +key = "bar" + +[abc] +doc = "this is a table" + +[example] +single = "this is a single line string" +"##; + +#[test] +fn table_array() { + let toml = TABLE_ARRAY; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + value.serialize(&mut toml::Serializer::new(&mut result)).unwrap(); + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} + +const PRETTY_TRICKY_NON_LITERAL: &'static str = r##"[example] +f = "\f" +glass = """ +Nothing too unusual, except that I can eat glass in: +- Greek: Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα. +- Polish: Mogę jeść szkło, i mi nie szkodzi. +- Hindi: मैं काँच खा सकता हूँ, मुझे उस से कोई पीडा नहीं होती. +- Japanese: 私はガラスを食べられます。それは私を傷つけません。 +""" +plain = """ +This has a couple of lines +Because it likes to. +""" +r = "\r" +r_newline = """ +\r +""" +single = "this is a single line but has '' cuz it's tricky" +single_tricky = "single line with ''' in it" +tabs = """ +this is pretty standard +\texcept for some \ttabs right here +""" +text = """ +this is the first line. +This has a ''' in it and \"\"\" cuz it's tricky yo +Also ' and \" because why not +this is the fourth line +""" +"##; + +#[test] +fn pretty_tricky_non_literal() { + let toml = PRETTY_TRICKY_NON_LITERAL; + let value: toml::Value = toml::from_str(toml).unwrap(); + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_string_literal(false); + value.serialize(&mut serializer).unwrap(); + } + println!("EXPECTED:\n{}", toml); + println!("\nRESULT:\n{}", result); + assert_eq!(toml, &result); +} diff -Nru distinst-0.1.0/vendor/toml/tests/serde.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/serde.rs --- distinst-0.1.0/vendor/toml/tests/serde.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/serde.rs 2017-12-21 19:00:07.000000000 +0000 @@ -61,10 +61,6 @@ }) } -macro_rules! decode( ($t:expr) => ({ - t!($t.try_into()) -}) ); - macro_rules! map( ($($k:ident: $v:expr),*) => ({ let mut _m = BTreeMap::new(); $(_m.insert(stringify!($k).to_string(), $v);)* @@ -130,8 +126,8 @@ fn application_decode_error() { #[derive(PartialEq, Debug)] struct Range10(usize); - impl Deserialize for Range10 { - fn deserialize(d: D) -> Result { + impl<'de> Deserialize<'de> for Range10 { + fn deserialize>(d: D) -> Result { let x: usize = try!(Deserialize::deserialize(d)); if x > 10 { Err(serde::de::Error::custom("more than 10")) @@ -329,6 +325,25 @@ } } +#[test] +fn parse_enum_string() { + #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] + struct Foo { a: Sort } + + #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] + #[serde(rename_all = "lowercase")] + enum Sort { + Asc, + Desc, + } + + equivalent! { + Foo { a: Sort::Desc }, + Table(map! { a: Value::String("desc".to_string()) }), + } + +} + // #[test] // fn unused_fields() { // #[derive(Serialize, Deserialize, PartialEq, Debug)] @@ -494,3 +509,70 @@ assert!(toml.clone().try_into::().is_ok()); assert!(toml::from_str::(&toml.to_string()).is_ok()); } + +#[test] +fn newtypes() { + #[derive(Deserialize, Serialize, PartialEq, Debug, Clone)] + struct A { + b: B + } + + #[derive(Deserialize, Serialize, PartialEq, Debug, Clone)] + struct B(u32); + + equivalent! { + A { b: B(2) }, + Table(map! { b: Integer(2) }), + } +} + +#[test] +fn newtypes2() { + #[derive(Deserialize, Serialize, PartialEq, Debug, Clone)] + struct A { + b: B + } + + #[derive(Deserialize, Serialize, PartialEq, Debug, Clone)] + struct B(Option); + + #[derive(Deserialize, Serialize, PartialEq, Debug, Clone)] + struct C { + x: u32, + y: u32, + z: u32 + } + + equivalent! { + A { b: B(Some(C { x: 0, y: 1, z: 2 })) }, + Table(map! { + b: Table(map! { + x: Integer(0), + y: Integer(1), + z: Integer(2) + }) + }), + } +} + +#[derive(Debug, Default, PartialEq, Serialize, Deserialize)] +struct CanBeEmpty { + a: Option, + b: Option, +} + +#[test] +fn table_structs_empty() { + let text = "[bar]\n\n[baz]\n\n[bazv]\na = \"foo\"\n\n[foo]\n"; + let value: BTreeMap = toml::from_str(text).unwrap(); + let mut expected: BTreeMap = BTreeMap::new(); + expected.insert("bar".to_string(), CanBeEmpty::default()); + expected.insert("baz".to_string(), CanBeEmpty::default()); + expected.insert( + "bazv".to_string(), + CanBeEmpty {a: Some("foo".to_string()), b: None}, + ); + expected.insert("foo".to_string(), CanBeEmpty::default()); + assert_eq!(value, expected); + assert_eq!(toml::to_string(&value).unwrap(), text); +} diff -Nru distinst-0.1.0/vendor/toml/tests/valid/datetime-truncate.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/datetime-truncate.json --- distinst-0.1.0/vendor/toml/tests/valid/datetime-truncate.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/datetime-truncate.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,6 @@ +{ + "bestdayever": { + "type": "datetime", + "value": "1987-07-05T17:45:00.123456789Z" + } +} diff -Nru distinst-0.1.0/vendor/toml/tests/valid/datetime-truncate.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/datetime-truncate.toml --- distinst-0.1.0/vendor/toml/tests/valid/datetime-truncate.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/datetime-truncate.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +bestdayever = 1987-07-05T17:45:00.123456789012345Z diff -Nru distinst-0.1.0/vendor/toml/tests/valid/key-quote-newline.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/key-quote-newline.json --- distinst-0.1.0/vendor/toml/tests/valid/key-quote-newline.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/key-quote-newline.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "\n": {"type": "integer", "value": "1"} +} diff -Nru distinst-0.1.0/vendor/toml/tests/valid/key-quote-newline.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/key-quote-newline.toml --- distinst-0.1.0/vendor/toml/tests/valid/key-quote-newline.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/key-quote-newline.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1 @@ +"\n" = 1 diff -Nru distinst-0.1.0/vendor/toml/tests/valid/table-array-nest-no-keys.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-array-nest-no-keys.json --- distinst-0.1.0/vendor/toml/tests/valid/table-array-nest-no-keys.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-array-nest-no-keys.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,14 @@ +{ + "albums": [ + { + "songs": [{}, {}] + } + ], + "artists": [ + { + "home": { + "address": {} + } + } + ] +} diff -Nru distinst-0.1.0/vendor/toml/tests/valid/table-array-nest-no-keys.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-array-nest-no-keys.toml --- distinst-0.1.0/vendor/toml/tests/valid/table-array-nest-no-keys.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-array-nest-no-keys.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,6 @@ +[[ albums ]] + [[ albums.songs ]] + [[ albums.songs ]] + +[[ artists ]] + [ artists.home.address ] diff -Nru distinst-0.1.0/vendor/toml/tests/valid/table-multi-empty.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-multi-empty.json --- distinst-0.1.0/vendor/toml/tests/valid/table-multi-empty.json 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-multi-empty.json 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,5 @@ +{ + "a": { "b": {} }, + "b": {}, + "c": { "a": {} } +} diff -Nru distinst-0.1.0/vendor/toml/tests/valid/table-multi-empty.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-multi-empty.toml --- distinst-0.1.0/vendor/toml/tests/valid/table-multi-empty.toml 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/table-multi-empty.toml 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,5 @@ +[a] +[a.b] +[b] +[c] +[c.a] diff -Nru distinst-0.1.0/vendor/toml/tests/valid/unicode-escape.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/unicode-escape.json --- distinst-0.1.0/vendor/toml/tests/valid/unicode-escape.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/unicode-escape.json 2017-12-21 19:00:07.000000000 +0000 @@ -1,4 +1,5 @@ { + "answer1": {"type": "string", "value": "\u000B"}, "answer4": {"type": "string", "value": "\u03B4α"}, "answer8": {"type": "string", "value": "\u03B4β"} } diff -Nru distinst-0.1.0/vendor/toml/tests/valid/unicode-escape.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/unicode-escape.toml --- distinst-0.1.0/vendor/toml/tests/valid/unicode-escape.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid/unicode-escape.toml 2017-12-21 19:00:07.000000000 +0000 @@ -1,2 +1,3 @@ +answer1 = "\u000B" answer4 = "\u03B4α" answer8 = "\U000003B4β" diff -Nru distinst-0.1.0/vendor/toml/tests/valid.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid.rs --- distinst-0.1.0/vendor/toml/tests/valid.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/tests/valid.rs 2017-12-21 19:00:07.000000000 +0000 @@ -1,7 +1,9 @@ extern crate toml; +extern crate serde; extern crate serde_json; -use toml::Value as Toml; +use toml::{Value as Toml, to_string_pretty}; +use serde::ser::Serialize; use serde_json::Value as Json; fn to_json(toml: toml::Value) -> Json { @@ -18,7 +20,7 @@ Toml::Float(f) => doit("float", Json::String({ let s = format!("{:.15}", f); let s = format!("{}", s.trim_right_matches('0')); - if s.ends_with(".") {format!("{}0", s)} else {s} + if s.ends_with('.') {format!("{}0", s)} else {s} })), Toml::Boolean(b) => doit("bool", Json::String(format!("{}", b))), Toml::Datetime(s) => doit("datetime", Json::String(s.to_string())), @@ -40,10 +42,52 @@ } } -fn run(toml: &str, json: &str) { - println!("parsing:\n{}", toml); - let toml: Toml = toml.parse().unwrap(); - let json: Json = json.parse().unwrap(); +fn run_pretty(toml: Toml) { + // Assert toml == json + println!("### pretty round trip parse."); + + // standard pretty + let toml_raw = to_string_pretty(&toml).expect("to string"); + let toml2 = toml_raw.parse().expect("from string"); + assert_eq!(toml, toml2); + + // pretty with indent 2 + let mut result = String::with_capacity(128); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_array_indent(2); + toml.serialize(&mut serializer).expect("to string"); + } + assert_eq!(toml, result.parse().expect("from str")); + result.clear(); + { + let mut serializer = toml::Serializer::new(&mut result); + serializer.pretty_array_trailing_comma(false); + toml.serialize(&mut serializer).expect("to string"); + } + assert_eq!(toml, result.parse().expect("from str")); + result.clear(); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_string(false); + toml.serialize(&mut serializer).expect("to string"); + assert_eq!(toml, toml2); + } + assert_eq!(toml, result.parse().expect("from str")); + result.clear(); + { + let mut serializer = toml::Serializer::pretty(&mut result); + serializer.pretty_array(false); + toml.serialize(&mut serializer).expect("to string"); + assert_eq!(toml, toml2); + } + assert_eq!(toml, result.parse().expect("from str")); +} + +fn run(toml_raw: &str, json_raw: &str) { + println!("parsing:\n{}", toml_raw); + let toml: Toml = toml_raw.parse().unwrap(); + let json: Json = json_raw.parse().unwrap(); // Assert toml == json let toml_json = to_json(toml.clone()); @@ -56,6 +100,7 @@ println!("round trip parse: {}", toml); let toml2 = toml.to_string().parse().unwrap(); assert_eq!(toml, toml2); + run_pretty(toml); } macro_rules! test( ($name:ident, $toml:expr, $json:expr) => ( @@ -162,6 +207,9 @@ test!(table_sub_empty, include_str!("valid/table-sub-empty.toml"), include_str!("valid/table-sub-empty.json")); +test!(table_multi_empty, + include_str!("valid/table-multi-empty.toml"), + include_str!("valid/table-multi-empty.json")); test!(table_whitespace, include_str!("valid/table-whitespace.toml"), include_str!("valid/table-whitespace.json")); @@ -189,3 +237,13 @@ test!(example_bom, include_str!("valid/example-bom.toml"), include_str!("valid/example.json")); + +test!(datetime_truncate, + include_str!("valid/datetime-truncate.toml"), + include_str!("valid/datetime-truncate.json")); +test!(key_quote_newline, + include_str!("valid/key-quote-newline.toml"), + include_str!("valid/key-quote-newline.json")); +test!(table_array_nest_no_keys, + include_str!("valid/table-array-nest-no-keys.toml"), + include_str!("valid/table-array-nest-no-keys.json")); diff -Nru distinst-0.1.0/vendor/toml/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/.travis.yml --- distinst-0.1.0/vendor/toml/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/toml/.travis.yml 2017-12-21 19:00:07.000000000 +0000 @@ -1,5 +1,6 @@ language: rust rust: + - 1.15.0 - stable - beta - nightly @@ -9,7 +10,7 @@ script: - cargo test - rustdoc --test README.md -L target - - cargo doc --no-deps + - test "$TRAVIS_RUST_VERSION" != "1.15.0" && cargo doc --no-deps || echo "skipping cargo doc" after_success: - travis-cargo --only nightly doc-upload - travis-cargo coveralls --no-sudo diff -Nru distinst-0.1.0/vendor/unicode-segmentation/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/.cargo-checksum.json --- distinst-0.1.0/vendor/unicode-segmentation/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"45a9e28a40dc51950223f939e74e09e3792d797db4c43c6a2e7d2ebc82e405e7","COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"5cb5a7555780c8b9cc767ca8e7cca6cb9efe00bd9130cf01c77cf98a6fe7e5a3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"32f1640f92c102be60895ceda728dce63820bb13a8a24065fe8a33d69a0e36e2","scripts/unicode.py":"4bbbbb274c358fa46eea130e99c7f77c1c2c4bb4f60f7380e77ac93e47a20143","scripts/unicode_gen_breaktests.py":"a8d9c88aec31f4d33b9850e71d497efbc9e6e9268a1b67ce55bd2a45ad552c67","src/grapheme.rs":"7b93f6dbd99575dc9fc3d3032c358f3580b5d5c71da56625decc2017eecfabb6","src/lib.rs":"445d37ea35cd787d8b5f43f853b74e4e21e374d65e78e45dbd77122bedf96b31","src/tables.rs":"a8fc42a3f3d788bf3154ee4012e9e90c1f311eba67ede3ff1d69fd4eb8cefe74","src/test.rs":"58d5d80e17df64a95c86728416afac0a4744adf5020bbbc053b2514ddeecd2da","src/testdata.rs":"33d4c58cf9416b342f31b1139b428676deecec34b0994c40ebe0c5cf4a639c79","src/word.rs":"eefecfcf85554fc529a44892fa7e3be50377b24a095610b7feb5f184c82818b9"},"package":"a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/unicode-segmentation/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/Cargo.toml --- distinst-0.1.0/vendor/unicode-segmentation/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -[package] - -name = "unicode-segmentation" -version = "1.2.0" -authors = ["kwantam "] - -homepage = "https://github.com/unicode-rs/unicode-segmentation" -repository = "https://github.com/unicode-rs/unicode-segmentation" -documentation = "https://unicode-rs.github.io/unicode-segmentation" - -license = "MIT/Apache-2.0" -keywords = ["text", "unicode", "grapheme", "word", "boundary"] -readme = "README.md" -description = """ -This crate provides Grapheme Cluster and Word boundaries -according to Unicode Standard Annex #29 rules. -""" - -exclude = [ "target/*", "Cargo.lock", "scripts/tmp", "*.txt" ] - -[features] -no_std = [] # This is a no-op, preserved for backward compatibility only. - -[dev-dependencies] -quickcheck = "0.4" diff -Nru distinst-0.1.0/vendor/unicode-segmentation/COPYRIGHT distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/COPYRIGHT --- distinst-0.1.0/vendor/unicode-segmentation/COPYRIGHT 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/COPYRIGHT 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -Licensed under the Apache License, Version 2.0 - or the MIT -license , -at your option. All files in the project carrying such -notice may not be copied, modified, or distributed except -according to those terms. diff -Nru distinst-0.1.0/vendor/unicode-segmentation/LICENSE-APACHE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/LICENSE-APACHE --- distinst-0.1.0/vendor/unicode-segmentation/LICENSE-APACHE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff -Nru distinst-0.1.0/vendor/unicode-segmentation/LICENSE-MIT distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/LICENSE-MIT --- distinst-0.1.0/vendor/unicode-segmentation/LICENSE-MIT 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Copyright (c) 2015 The Rust Project Developers - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff -Nru distinst-0.1.0/vendor/unicode-segmentation/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/README.md --- distinst-0.1.0/vendor/unicode-segmentation/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -Iterators which split strings on Grapheme Cluster or Word boundaries, according -to the [Unicode Standard Annex #29](http://www.unicode.org/reports/tr29/) rules. - -[![Build Status](https://travis-ci.org/unicode-rs/unicode-segmentation.svg)](https://travis-ci.org/unicode-rs/unicode-segmentation) - -[Documentation](https://unicode-rs.github.io/unicode-segmentation/unicode_segmentation/index.html) - -```rust -extern crate unicode_segmentation; - -use unicode_segmentation::UnicodeSegmentation; - -fn main() { - let s = "a̐éö̲\r\n"; - let g = UnicodeSegmentation::graphemes(s, true).collect::>(); - let b: &[_] = &["a̐", "é", "ö̲", "\r\n"]; - assert_eq!(g, b); - - let s = "The quick (\"brown\") fox can't jump 32.3 feet, right?"; - let w = s.unicode_words().collect::>(); - let b: &[_] = &["The", "quick", "brown", "fox", "can't", "jump", "32.3", "feet", "right"]; - assert_eq!(w, b); - - let s = "The quick (\"brown\") fox"; - let w = s.split_word_bounds().collect::>(); - let b: &[_] = &["The", " ", "quick", " ", "(", "\"", "brown", "\"", ")", " ", " ", "fox"]; - assert_eq!(w, b); -} -``` - -# no_std - -unicode-segmentation does not depend on libstd, so it can be used in crates -with the `#![no_std]` attribute. - -# crates.io - -You can use this package in your project by adding the following -to your `Cargo.toml`: - -```toml -[dependencies] -unicode-segmentation = "1.1.0" -``` - -# Change Log - -## 1.1.0 - -* Add `as_str` methods to the iterator types. - -## 1.0.3 - -* Code cleanup and additional tests. - -## 1.0.1 - -* Fix a bug affecting some grapheme clusters containing Prepend characters. - -## 1.0.0 - -* Upgrade to Unicode 9.0.0. diff -Nru distinst-0.1.0/vendor/unicode-segmentation/scripts/unicode_gen_breaktests.py distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/scripts/unicode_gen_breaktests.py --- distinst-0.1.0/vendor/unicode-segmentation/scripts/unicode_gen_breaktests.py 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/scripts/unicode_gen_breaktests.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -# -# Copyright 2015 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 or the MIT license -# , at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -# This script uses the following Unicode tables: -# - auxiliary/GraphemeBreakTest.txt -# - auxiliary/WordBreakTest.txt -# -# Since this should not require frequent updates, we just store this -# out-of-line and check the unicode.rs file into git. - -import unicode, re, os, fileinput - -def load_test_data(f, optsplit=[]): - outls = [] - testRe1 = re.compile("^÷\s+([^\s].*[^\s])\s+÷\s+#\s+÷\s+\[0.2\].*?([÷×].*)\s+÷\s+\[0.3\]\s*$") - - unicode.fetch(f) - data = [] - for line in fileinput.input(os.path.basename(f)): - # lines that include a test start with the ÷ character - if len(line) < 2 or line[0:2] != '÷': - continue - - m = testRe1.match(line) - if not m: - print "error: no match on line where test was expected: %s" % line - continue - - # process the characters in this test case - chars = process_split_string(m.group(1)) - # skip test case if it contains invalid characters (viz., surrogates) - if not chars: - continue - - # now process test cases - (chars, info) = process_split_info(m.group(2), chars, optsplit) - - # make sure that we have break info for each break! - assert len(chars) - 1 == len(info) - - outls.append((chars, info)) - - return outls - -def process_split_info(s, c, o): - outcs = [] - outis = [] - workcs = c.pop(0) - - # are we on a × or a ÷? - isX = False - if s[0:2] == '×': - isX = True - - # find each instance of '(÷|×) [x.y] ' - while s: - # find the currently considered rule number - sInd = s.index('[') + 1 - eInd = s.index(']') - - # if it's '× [a.b]' where 'a.b' is in o, then - # we consider it a split even though it's not - # marked as one - # if it's ÷ then it's always a split - if not isX or s[sInd:eInd] in o: - outis.append(s[sInd:eInd]) - outcs.append(workcs) - workcs = c.pop(0) - else: - workcs.extend(c.pop(0)) - - idx = 1 - while idx < len(s): - if s[idx:idx+2] == '×': - isX = True - break - if s[idx:idx+2] == '÷': - isX = False - break - idx += 1 - s = s[idx:] - - outcs.append(workcs) - return (outcs, outis) - -def process_split_string(s): - outls = [] - workls = [] - - inls = s.split() - - for i in inls: - if i == '÷' or i == '×': - outls.append(workls) - workls = [] - continue - - ival = int(i,16) - - if unicode.is_surrogate(ival): - return [] - - workls.append(ival) - - if workls: - outls.append(workls) - - return outls - -def showfun(x): - outstr = '("' - for c in x[0]: - outstr += "\\u{%x}" % c - outstr += '",&[' - xfirst = True - for xx in x[1:]: - if not xfirst: - outstr += '],&[' - xfirst = False - sfirst = True - for sp in xx: - if not sfirst: - outstr += ',' - sfirst = False - outstr += '"' - for c in sp: - outstr += "\\u{%x}" % c - outstr += '"' - outstr += '])' - return outstr - -def create_grapheme_data(f): - # rules 9.1 and 9.2 are for extended graphemes only - optsplits = ['9.1','9.2'] - d = load_test_data("auxiliary/GraphemeBreakTest.txt", optsplits) - - test_same = [] - test_diff = [] - - for (c, i) in d: - allchars = [cn for s in c for cn in s] - extgraphs = [] - extwork = [] - - extwork.extend(c[0]) - for n in range(0,len(i)): - if i[n] in optsplits: - extwork.extend(c[n+1]) - else: - extgraphs.append(extwork) - extwork = [] - extwork.extend(c[n+1]) - - # these are the extended grapheme clusters - extgraphs.append(extwork) - - if extgraphs == c: - test_same.append((allchars, c)) - else: - test_diff.append((allchars, extgraphs, c)) - - stype = "&'static [(&'static str, &'static [&'static str])]" - dtype = "&'static [(&'static str, &'static [&'static str], &'static [&'static str])]" - f.write(" // official Unicode test data\n") - f.write(" // http://www.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakTest.txt\n") - unicode.emit_table(f, "TEST_SAME", test_same, stype, True, showfun, True) - unicode.emit_table(f, "TEST_DIFF", test_diff, dtype, True, showfun, True) - -def create_words_data(f): - d = load_test_data("auxiliary/WordBreakTest.txt") - - test = [] - - for (c, i) in d: - allchars = [cn for s in c for cn in s] - test.append((allchars, c)) - - wtype = "&'static [(&'static str, &'static [&'static str])]" - f.write(" // official Unicode test data\n") - f.write(" // http://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakTest.txt\n") - unicode.emit_table(f, "TEST_WORD", test, wtype, True, showfun, True) - -if __name__ == "__main__": - with open("testdata.rs", "w") as rf: - rf.write(unicode.preamble) - create_grapheme_data(rf) - create_words_data(rf) diff -Nru distinst-0.1.0/vendor/unicode-segmentation/scripts/unicode.py distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/scripts/unicode.py --- distinst-0.1.0/vendor/unicode-segmentation/scripts/unicode.py 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/scripts/unicode.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 or the MIT license -# , at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -# This script uses the following Unicode tables: -# - DerivedCoreProperties.txt -# - auxiliary/GraphemeBreakProperty.txt -# - auxiliary/WordBreakProperty.txt -# - ReadMe.txt -# - UnicodeData.txt -# -# Since this should not require frequent updates, we just store this -# out-of-line and check the unicode.rs file into git. - -import fileinput, re, os, sys, operator - -preamble = '''// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly - -#![allow(missing_docs, non_upper_case_globals, non_snake_case)] -''' - -# Mapping taken from Table 12 from: -# http://www.unicode.org/reports/tr44/#General_Category_Values -expanded_categories = { - 'Lu': ['LC', 'L'], 'Ll': ['LC', 'L'], 'Lt': ['LC', 'L'], - 'Lm': ['L'], 'Lo': ['L'], - 'Mn': ['M'], 'Mc': ['M'], 'Me': ['M'], - 'Nd': ['N'], 'Nl': ['N'], 'No': ['No'], - 'Pc': ['P'], 'Pd': ['P'], 'Ps': ['P'], 'Pe': ['P'], - 'Pi': ['P'], 'Pf': ['P'], 'Po': ['P'], - 'Sm': ['S'], 'Sc': ['S'], 'Sk': ['S'], 'So': ['S'], - 'Zs': ['Z'], 'Zl': ['Z'], 'Zp': ['Z'], - 'Cc': ['C'], 'Cf': ['C'], 'Cs': ['C'], 'Co': ['C'], 'Cn': ['C'], -} - -# these are the surrogate codepoints, which are not valid rust characters -surrogate_codepoints = (0xd800, 0xdfff) - -def is_surrogate(n): - return surrogate_codepoints[0] <= n <= surrogate_codepoints[1] - -def fetch(f): - if not os.path.exists(os.path.basename(f)): - os.system("curl -O http://www.unicode.org/Public/UNIDATA/%s" - % f) - - if not os.path.exists(os.path.basename(f)): - sys.stderr.write("cannot load %s" % f) - exit(1) - -def load_gencats(f): - fetch(f) - gencats = {} - - udict = {}; - range_start = -1; - for line in fileinput.input(f): - data = line.split(';'); - if len(data) != 15: - continue - cp = int(data[0], 16); - if is_surrogate(cp): - continue - if range_start >= 0: - for i in xrange(range_start, cp): - udict[i] = data; - range_start = -1; - if data[1].endswith(", First>"): - range_start = cp; - continue; - udict[cp] = data; - - for code in udict: - [code_org, name, gencat, combine, bidi, - decomp, deci, digit, num, mirror, - old, iso, upcase, lowcase, titlecase ] = udict[code]; - - # place letter in categories as appropriate - for cat in [gencat, "Assigned"] + expanded_categories.get(gencat, []): - if cat not in gencats: - gencats[cat] = [] - gencats[cat].append(code) - - gencats = group_cats(gencats) - return gencats - -def group_cats(cats): - cats_out = {} - for cat in cats: - cats_out[cat] = group_cat(cats[cat]) - return cats_out - -def group_cat(cat): - cat_out = [] - letters = sorted(set(cat)) - cur_start = letters.pop(0) - cur_end = cur_start - for letter in letters: - assert letter > cur_end, \ - "cur_end: %s, letter: %s" % (hex(cur_end), hex(letter)) - if letter == cur_end + 1: - cur_end = letter - else: - cat_out.append((cur_start, cur_end)) - cur_start = cur_end = letter - cat_out.append((cur_start, cur_end)) - return cat_out - -def ungroup_cat(cat): - cat_out = [] - for (lo, hi) in cat: - while lo <= hi: - cat_out.append(lo) - lo += 1 - return cat_out - -def format_table_content(f, content, indent): - line = " "*indent - first = True - for chunk in content.split(","): - if len(line) + len(chunk) < 98: - if first: - line += chunk - else: - line += ", " + chunk - first = False - else: - f.write(line + ",\n") - line = " "*indent + chunk - f.write(line) - -def load_properties(f, interestingprops): - fetch(f) - props = {} - re1 = re.compile("^ *([0-9A-F]+) *; *(\w+)") - re2 = re.compile("^ *([0-9A-F]+)\.\.([0-9A-F]+) *; *(\w+)") - - for line in fileinput.input(os.path.basename(f)): - prop = None - d_lo = 0 - d_hi = 0 - m = re1.match(line) - if m: - d_lo = m.group(1) - d_hi = m.group(1) - prop = m.group(2) - else: - m = re2.match(line) - if m: - d_lo = m.group(1) - d_hi = m.group(2) - prop = m.group(3) - else: - continue - if interestingprops and prop not in interestingprops: - continue - d_lo = int(d_lo, 16) - d_hi = int(d_hi, 16) - if prop not in props: - props[prop] = [] - props[prop].append((d_lo, d_hi)) - - # optimize if possible - for prop in props: - props[prop] = group_cat(ungroup_cat(props[prop])) - - return props - -def escape_char(c): - return "'\\u{%x}'" % c - -def emit_table(f, name, t_data, t_type = "&'static [(char, char)]", is_pub=True, - pfun=lambda x: "(%s,%s)" % (escape_char(x[0]), escape_char(x[1])), is_const=True): - pub_string = "const" - if not is_const: - pub_string = "let" - if is_pub: - pub_string = "pub " + pub_string - f.write(" %s %s: %s = &[\n" % (pub_string, name, t_type)) - data = "" - first = True - for dat in t_data: - if not first: - data += "," - first = False - data += pfun(dat) - format_table_content(f, data, 8) - f.write("\n ];\n\n") - -def emit_util_mod(f): - f.write(""" -pub mod util { - #[inline] - pub fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { - use core::cmp::Ordering::{Equal, Less, Greater}; - r.binary_search_by(|&(lo,hi)| { - if lo <= c && c <= hi { Equal } - else if hi < c { Less } - else { Greater } - }).is_ok() - } - - #[inline] - fn is_alphabetic(c: char) -> bool { - match c { - 'a' ... 'z' | 'A' ... 'Z' => true, - c if c > '\x7f' => super::derived_property::Alphabetic(c), - _ => false, - } - } - - #[inline] - fn is_numeric(c: char) -> bool { - match c { - '0' ... '9' => true, - c if c > '\x7f' => super::general_category::N(c), - _ => false, - } - } - - #[inline] - pub fn is_alphanumeric(c: char) -> bool { - is_alphabetic(c) || is_numeric(c) - } -} - -""") - -def emit_property_module(f, mod, tbl, emit): - f.write("mod %s {\n" % mod) - for cat in sorted(emit): - emit_table(f, "%s_table" % cat, tbl[cat], is_pub=False) - f.write(" #[inline]\n") - f.write(" pub fn %s(c: char) -> bool {\n" % cat) - f.write(" super::util::bsearch_range_table(c, %s_table)\n" % cat) - f.write(" }\n\n") - f.write("}\n\n") - -def emit_break_module(f, break_table, break_cats, name): - Name = name.capitalize() - f.write("""pub mod %s { - use core::result::Result::{Ok, Err}; - - pub use self::%sCat::*; - - #[allow(non_camel_case_types)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum %sCat { -""" % (name, Name, Name)) - - break_cats.append("Any") - break_cats.sort() - for cat in break_cats: - f.write((" %sC_" % Name[0]) + cat + ",\n") - f.write(""" } - - fn bsearch_range_value_table(c: char, r: &'static [(char, char, %sCat)]) -> %sCat { - use core::cmp::Ordering::{Equal, Less, Greater}; - match r.binary_search_by(|&(lo, hi, _)| { - if lo <= c && c <= hi { Equal } - else if hi < c { Less } - else { Greater } - }) { - Ok(idx) => { - let (_, _, cat) = r[idx]; - cat - } - Err(_) => %sC_Any - } - } - - pub fn %s_category(c: char) -> %sCat { - bsearch_range_value_table(c, %s_cat_table) - } - -""" % (Name, Name, Name[0], name, Name, name)) - - emit_table(f, "%s_cat_table" % name, break_table, "&'static [(char, char, %sCat)]" % Name, - pfun=lambda x: "(%s,%s,%sC_%s)" % (escape_char(x[0]), escape_char(x[1]), Name[0], x[2]), - is_pub=False, is_const=True) - f.write("}\n") - -if __name__ == "__main__": - r = "tables.rs" - if os.path.exists(r): - os.remove(r) - with open(r, "w") as rf: - # write the file's preamble - rf.write(preamble) - - # download and parse all the data - fetch("ReadMe.txt") - with open("ReadMe.txt") as readme: - pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode" - unicode_version = re.search(pattern, readme.read()).groups() - rf.write(""" -/// The version of [Unicode](http://www.unicode.org/) -/// that this version of unicode-segmentation is based on. -pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s); -""" % unicode_version) - - gencats = load_gencats("UnicodeData.txt") - derived = load_properties("DerivedCoreProperties.txt", ["Alphabetic"]) - - emit_util_mod(rf) - for (name, cat, pfuns) in ("general_category", gencats, ["N"]), \ - ("derived_property", derived, ["Alphabetic"]): - emit_property_module(rf, name, cat, pfuns) - - ### grapheme cluster module - # from http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Break_Property_Values - grapheme_cats = load_properties("auxiliary/GraphemeBreakProperty.txt", []) - - # Control - # Note: - # This category also includes Cs (surrogate codepoints), but Rust's `char`s are - # Unicode Scalar Values only, and surrogates are thus invalid `char`s. - # Thus, we have to remove Cs from the Control category - grapheme_cats["Control"] = group_cat(list( - set(ungroup_cat(grapheme_cats["Control"])) - - set(ungroup_cat([surrogate_codepoints])))) - - grapheme_table = [] - for cat in grapheme_cats: - grapheme_table.extend([(x, y, cat) for (x, y) in grapheme_cats[cat]]) - grapheme_table.sort(key=lambda w: w[0]) - emit_break_module(rf, grapheme_table, grapheme_cats.keys(), "grapheme") - rf.write("\n") - - word_cats = load_properties("auxiliary/WordBreakProperty.txt", []) - word_table = [] - for cat in word_cats: - word_table.extend([(x, y, cat) for (x, y) in word_cats[cat]]) - word_table.sort(key=lambda w: w[0]) - emit_break_module(rf, word_table, word_cats.keys(), "word") diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/grapheme.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/grapheme.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/grapheme.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/grapheme.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,661 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use core::cmp; - -use tables::grapheme::GraphemeCat; - -/// External iterator for grapheme clusters and byte offsets. -#[derive(Clone)] -pub struct GraphemeIndices<'a> { - start_offset: usize, - iter: Graphemes<'a>, -} - -impl<'a> GraphemeIndices<'a> { - #[inline] - /// View the underlying data (the part yet to be iterated) as a slice of the original string. - /// - /// ```rust - /// # use unicode_segmentation::UnicodeSegmentation; - /// let mut iter = "abc".grapheme_indices(true); - /// assert_eq!(iter.as_str(), "abc"); - /// iter.next(); - /// assert_eq!(iter.as_str(), "bc"); - /// iter.next(); - /// iter.next(); - /// assert_eq!(iter.as_str(), ""); - /// ``` - pub fn as_str(&self) -> &'a str { - self.iter.as_str() - } -} - -impl<'a> Iterator for GraphemeIndices<'a> { - type Item = (usize, &'a str); - - #[inline] - fn next(&mut self) -> Option<(usize, &'a str)> { - self.iter.next().map(|s| (s.as_ptr() as usize - self.start_offset, s)) - } - - #[inline] - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -impl<'a> DoubleEndedIterator for GraphemeIndices<'a> { - #[inline] - fn next_back(&mut self) -> Option<(usize, &'a str)> { - self.iter.next_back().map(|s| (s.as_ptr() as usize - self.start_offset, s)) - } -} - -/// External iterator for a string's -/// [grapheme clusters](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries). -#[derive(Clone)] -pub struct Graphemes<'a> { - string: &'a str, - cursor: GraphemeCursor, - cursor_back: GraphemeCursor, -} - -impl<'a> Graphemes<'a> { - #[inline] - /// View the underlying data (the part yet to be iterated) as a slice of the original string. - /// - /// ```rust - /// # use unicode_segmentation::UnicodeSegmentation; - /// let mut iter = "abc".graphemes(true); - /// assert_eq!(iter.as_str(), "abc"); - /// iter.next(); - /// assert_eq!(iter.as_str(), "bc"); - /// iter.next(); - /// iter.next(); - /// assert_eq!(iter.as_str(), ""); - /// ``` - pub fn as_str(&self) -> &'a str { - &self.string[self.cursor.cur_cursor()..self.cursor_back.cur_cursor()] - } -} - -impl<'a> Iterator for Graphemes<'a> { - type Item = &'a str; - - #[inline] - fn size_hint(&self) -> (usize, Option) { - let slen = self.cursor_back.cur_cursor() - self.cursor.cur_cursor(); - (cmp::min(slen, 1), Some(slen)) - } - - #[inline] - fn next(&mut self) -> Option<&'a str> { - let start = self.cursor.cur_cursor(); - if start == self.cursor_back.cur_cursor() { - return None; - } - let next = self.cursor.next_boundary(self.string, 0).unwrap().unwrap(); - Some(&self.string[start..next]) - } -} - -impl<'a> DoubleEndedIterator for Graphemes<'a> { - #[inline] - fn next_back(&mut self) -> Option<&'a str> { - let end = self.cursor_back.cur_cursor(); - if end == self.cursor.cur_cursor() { - return None; - } - let prev = self.cursor_back.prev_boundary(self.string, 0).unwrap().unwrap(); - Some(&self.string[prev..end]) - } -} - -#[inline] -pub fn new_graphemes<'b>(s: &'b str, is_extended: bool) -> Graphemes<'b> { - let len = s.len(); - Graphemes { - string: s, - cursor: GraphemeCursor::new(0, len, is_extended), - cursor_back: GraphemeCursor::new(len, len, is_extended), - } -} - -#[inline] -pub fn new_grapheme_indices<'b>(s: &'b str, is_extended: bool) -> GraphemeIndices<'b> { - GraphemeIndices { start_offset: s.as_ptr() as usize, iter: new_graphemes(s, is_extended) } -} - -// maybe unify with PairResult? -// An enum describing information about a potential boundary. -#[derive(PartialEq, Eq, Clone)] -enum GraphemeState { - // No information is known. - Unknown, - // It is known to not be a boundary. - NotBreak, - // It is known to be a boundary. - Break, - // The codepoint after is a Regional Indicator Symbol, so a boundary iff - // it is preceded by an even number of RIS codepoints. (GB12, GB13) - Regional, - // The codepoint after is in the E_Modifier category, so whether it's a boundary - // depends on pre-context according to GB10. - Emoji, -} - -/// Cursor-based segmenter for grapheme clusters. -#[derive(Clone)] -pub struct GraphemeCursor { - // Current cursor position. - offset: usize, - // Total length of the string. - len: usize, - // A config flag indicating whether this cursor computes legacy or extended - // grapheme cluster boundaries (enables GB9a and GB9b if set). - is_extended: bool, - // Information about the potential boundary at `offset` - state: GraphemeState, - // Category of codepoint immediately preceding cursor, if known. - cat_before: Option, - // Category of codepoint immediately after cursor, if known. - cat_after: Option, - // If set, at least one more codepoint immediately preceding this offset - // is needed to resolve whether there's a boundary at `offset`. - pre_context_offset: Option, - // The number of RIS codepoints preceding `offset`. If `pre_context_offset` - // is set, then counts the number of RIS between that and `offset`, otherwise - // is an accurate count relative to the string. - ris_count: Option, - // Set if a call to `prev_boundary` or `next_boundary` was suspended due - // to needing more input. - resuming: bool, -} - -/// An error return indicating that not enough content was available in the -/// provided chunk to satisfy the query, and that more content must be provided. -#[derive(PartialEq, Eq, Debug)] -pub enum GraphemeIncomplete { - /// More pre-context is needed. The caller should call `provide_context` - /// with a chunk ending at the offset given, then retry the query. This - /// will only be returned if the `chunk_start` parameter is nonzero. - PreContext(usize), - - /// When requesting `prev_boundary`, the cursor is moving past the beginning - /// of the current chunk, so the chunk before that is requested. This will - /// only be returned if the `chunk_start` parameter is nonzero. - PrevChunk, - - /// When requesting `next_boundary`, the cursor is moving past the end of the - /// current chunk, so the chunk after that is requested. This will only be - /// returned if the chunk ends before the `len` parameter provided on - /// creation of the cursor. - NextChunk, // requesting chunk following the one given - - /// An error returned when the chunk given does not contain the cursor position. - InvalidOffset, -} - -// An enum describing the result from lookup of a pair of categories. -#[derive(PartialEq, Eq)] -enum PairResult { - NotBreak, // definitely not a break - Break, // definitely a break - Extended, // a break iff not in extended mode - Regional, // a break if preceded by an even number of RIS - Emoji, // a break if preceded by emoji base and (Extend)* -} - -fn check_pair(before: GraphemeCat, after: GraphemeCat) -> PairResult { - use tables::grapheme::GraphemeCat::*; - use self::PairResult::*; - match (before, after) { - (GC_CR, GC_LF) => NotBreak, // GB3 - (GC_Control, _) => Break, // GB4 - (GC_CR, _) => Break, // GB4 - (GC_LF, _) => Break, // GB4 - (_, GC_Control) => Break, // GB5 - (_, GC_CR) => Break, // GB5 - (_, GC_LF) => Break, // GB5 - (GC_L, GC_L) => NotBreak, // GB6 - (GC_L, GC_V) => NotBreak, // GB6 - (GC_L, GC_LV) => NotBreak, // GB6 - (GC_L, GC_LVT) => NotBreak, // GB6 - (GC_LV, GC_V) => NotBreak, // GB7 - (GC_LV, GC_T) => NotBreak, // GB7 - (GC_V, GC_V) => NotBreak, // GB7 - (GC_V, GC_T) => NotBreak, // GB7 - (GC_LVT, GC_T) => NotBreak, // GB8 - (GC_T, GC_T) => NotBreak, // GB8 - (_, GC_Extend) => NotBreak, // GB9 - (_, GC_ZWJ) => NotBreak, // GB9 - (_, GC_SpacingMark) => Extended, // GB9a - (GC_Prepend, _) => Extended, // GB9b - (GC_E_Base, GC_E_Modifier) => NotBreak, // GB10 - (GC_E_Base_GAZ, GC_E_Modifier) => NotBreak, // GB10 - (GC_Extend, GC_E_Modifier) => Emoji, // GB10 - (GC_ZWJ, GC_Glue_After_Zwj) => NotBreak, // GB11 - (GC_ZWJ, GC_E_Base_GAZ) => NotBreak, // GB11 - (GC_Regional_Indicator, GC_Regional_Indicator) => Regional, // GB12, GB13 - (_, _) => Break, // GB999 - } -} - -impl GraphemeCursor { - /// Create a new cursor. The string and initial offset are given at creation - /// time, but the contents of the string are not. The `is_extended` parameter - /// controls whether extended grapheme clusters are selected. - /// - /// The `offset` parameter must be on a codepoint boundary. - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// let s = "हिन्दी"; - /// let mut legacy = GraphemeCursor::new(0, s.len(), false); - /// assert_eq!(legacy.next_boundary(s, 0), Ok(Some("ह".len()))); - /// let mut extended = GraphemeCursor::new(0, s.len(), true); - /// assert_eq!(extended.next_boundary(s, 0), Ok(Some("हि".len()))); - /// ``` - pub fn new(offset: usize, len: usize, is_extended: bool) -> GraphemeCursor { - let state = if offset == 0 || offset == len { - GraphemeState::Break - } else { - GraphemeState::Unknown - }; - GraphemeCursor { - offset: offset, - len: len, - state: state, - is_extended: is_extended, - cat_before: None, - cat_after: None, - pre_context_offset: None, - ris_count: None, - resuming: false, - } - } - - // Not sure I'm gonna keep this, the advantage over new() seems thin. - - /// Set the cursor to a new location in the same string. - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// let s = "abcd"; - /// let mut cursor = GraphemeCursor::new(0, s.len(), false); - /// assert_eq!(cursor.cur_cursor(), 0); - /// cursor.set_cursor(2); - /// assert_eq!(cursor.cur_cursor(), 2); - /// ``` - pub fn set_cursor(&mut self, offset: usize) { - if offset != self.offset { - self.offset = offset; - self.state = if offset == 0 || offset == self.len { - GraphemeState::Break - } else { - GraphemeState::Unknown - }; - // reset state derived from text around cursor - self.cat_before = None; - self.cat_after = None; - self.ris_count = None; - } - } - - /// The current offset of the cursor. Equal to the last value provided to - /// `new()` or `set_cursor()`, or returned from `next_boundary()` or - /// `prev_boundary()`. - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// // Two flags (🇷🇸🇮🇴), each flag is two RIS codepoints, each RIS is 4 bytes. - /// let flags = "\u{1F1F7}\u{1F1F8}\u{1F1EE}\u{1F1F4}"; - /// let mut cursor = GraphemeCursor::new(4, flags.len(), false); - /// assert_eq!(cursor.cur_cursor(), 4); - /// assert_eq!(cursor.next_boundary(flags, 0), Ok(Some(8))); - /// assert_eq!(cursor.cur_cursor(), 8); - /// ``` - pub fn cur_cursor(&self) -> usize { - self.offset - } - - /// Provide additional pre-context when it is needed to decide a boundary. - /// The end of the chunk must coincide with the value given in the - /// `GraphemeIncomplete::PreContext` request. - /// - /// ```rust - /// # use unicode_segmentation::{GraphemeCursor, GraphemeIncomplete}; - /// let flags = "\u{1F1F7}\u{1F1F8}\u{1F1EE}\u{1F1F4}"; - /// let mut cursor = GraphemeCursor::new(8, flags.len(), false); - /// // Not enough pre-context to decide if there's a boundary between the two flags. - /// assert_eq!(cursor.is_boundary(&flags[8..], 8), Err(GraphemeIncomplete::PreContext(8))); - /// // Provide one more Regional Indicator Symbol of pre-context - /// cursor.provide_context(&flags[4..8], 4); - /// // Still not enough context to decide. - /// assert_eq!(cursor.is_boundary(&flags[8..], 8), Err(GraphemeIncomplete::PreContext(4))); - /// // Provide additional requested context. - /// cursor.provide_context(&flags[0..4], 0); - /// // That's enough to decide (it always is when context goes to the start of the string) - /// assert_eq!(cursor.is_boundary(&flags[8..], 8), Ok(true)); - /// ``` - pub fn provide_context(&mut self, chunk: &str, chunk_start: usize) { - use tables::grapheme as gr; - assert!(chunk_start + chunk.len() == self.pre_context_offset.unwrap()); - self.pre_context_offset = None; - if self.is_extended && chunk_start + chunk.len() == self.offset { - let ch = chunk.chars().rev().next().unwrap(); - if gr::grapheme_category(ch) == gr::GC_Prepend { - self.decide(false); // GB9b - return; - } - } - match self.state { - GraphemeState::Regional => self.handle_regional(chunk, chunk_start), - GraphemeState::Emoji => self.handle_emoji(chunk, chunk_start), - _ => panic!("invalid state") - } - } - - fn decide(&mut self, is_break: bool) { - self.state = if is_break { - GraphemeState::Break - } else { - GraphemeState::NotBreak - }; - } - - fn decision(&mut self, is_break: bool) -> Result { - self.decide(is_break); - Ok(is_break) - } - - fn is_boundary_result(&self) -> Result { - if self.state == GraphemeState::Break { - Ok(true) - } else if self.state == GraphemeState::NotBreak { - Ok(false) - } else if let Some(pre_context_offset) = self.pre_context_offset { - Err(GraphemeIncomplete::PreContext(pre_context_offset)) - } else { - unreachable!("inconsistent state"); - } - } - - fn handle_regional(&mut self, chunk: &str, chunk_start: usize) { - use tables::grapheme as gr; - let mut ris_count = self.ris_count.unwrap_or(0); - for ch in chunk.chars().rev() { - if gr::grapheme_category(ch) != gr::GC_Regional_Indicator { - self.ris_count = Some(ris_count); - self.decide((ris_count % 2) == 0); - return; - } - ris_count += 1; - } - self.ris_count = Some(ris_count); - if chunk_start == 0 { - self.decide((ris_count % 2) == 0); - return; - } - self.pre_context_offset = Some(chunk_start); - } - - fn handle_emoji(&mut self, chunk: &str, chunk_start: usize) { - use tables::grapheme as gr; - for ch in chunk.chars().rev() { - match gr::grapheme_category(ch) { - gr::GC_Extend => (), - gr::GC_E_Base | gr::GC_E_Base_GAZ => { - self.decide(false); - return; - } - _ => { - self.decide(true); - return; - } - } - } - if chunk_start == 0 { - self.decide(true); - return; - } - self.pre_context_offset = Some(chunk_start); - } - - /// Determine whether the current cursor location is a grapheme cluster boundary. - /// Only a part of the string need be supplied. If `chunk_start` is nonzero or - /// the length of `chunk` is not equal to `len` on creation, then this method - /// may return `GraphemeIncomplete::PreContext`. The caller should then - /// call `provide_context` with the requested chunk, then retry calling this - /// method. - /// - /// For partial chunks, if the cursor is not at the beginning or end of the - /// string, the chunk should contain at least the codepoint following the cursor. - /// If the string is nonempty, the chunk must be nonempty. - /// - /// All calls should have consistent chunk contents (ie, if a chunk provides - /// content for a given slice, all further chunks covering that slice must have - /// the same content for it). - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// let flags = "\u{1F1F7}\u{1F1F8}\u{1F1EE}\u{1F1F4}"; - /// let mut cursor = GraphemeCursor::new(8, flags.len(), false); - /// assert_eq!(cursor.is_boundary(flags, 0), Ok(true)); - /// cursor.set_cursor(12); - /// assert_eq!(cursor.is_boundary(flags, 0), Ok(false)); - /// ``` - pub fn is_boundary(&mut self, chunk: &str, chunk_start: usize) -> Result { - use tables::grapheme as gr; - if self.state == GraphemeState::Break { - return Ok(true) - } - if self.state == GraphemeState::NotBreak { - return Ok(false) - } - if self.offset < chunk_start || self.offset >= chunk_start + chunk.len() { - if self.offset > chunk_start + chunk.len() || self.cat_after.is_none() { - return Err(GraphemeIncomplete::InvalidOffset) - } - } - if let Some(pre_context_offset) = self.pre_context_offset { - return Err(GraphemeIncomplete::PreContext(pre_context_offset)); - } - let offset_in_chunk = self.offset - chunk_start; - if self.cat_after.is_none() { - let ch = chunk[offset_in_chunk..].chars().next().unwrap(); - self.cat_after = Some(gr::grapheme_category(ch)); - } - if self.offset == chunk_start { - let mut need_pre_context = true; - match self.cat_after.unwrap() { - gr::GC_Regional_Indicator => self.state = GraphemeState::Regional, - gr::GC_E_Modifier => self.state = GraphemeState::Emoji, - _ => need_pre_context = self.cat_before.is_none(), - } - if need_pre_context { - self.pre_context_offset = Some(chunk_start); - return Err(GraphemeIncomplete::PreContext(chunk_start)); - } - } - if self.cat_before.is_none() { - let ch = chunk[..offset_in_chunk].chars().rev().next().unwrap(); - self.cat_before = Some(gr::grapheme_category(ch)); - } - match check_pair(self.cat_before.unwrap(), self.cat_after.unwrap()) { - PairResult::NotBreak => return self.decision(false), - PairResult::Break => return self.decision(true), - PairResult::Extended => { - let is_extended = self.is_extended; - return self.decision(!is_extended); - } - PairResult::Regional => { - if let Some(ris_count) = self.ris_count { - return self.decision((ris_count % 2) == 0); - } - self.handle_regional(&chunk[..offset_in_chunk], chunk_start); - self.is_boundary_result() - } - PairResult::Emoji => { - self.handle_emoji(&chunk[..offset_in_chunk], chunk_start); - self.is_boundary_result() - } - } - } - - /// Find the next boundary after the current cursor position. Only a part of - /// the string need be supplied. If the chunk is incomplete, then this - /// method might return `GraphemeIncomplete::PreContext` or - /// `GraphemeIncomplete::NextChunk`. In the former case, the caller should - /// call `provide_context` with the requested chunk, then retry. In the - /// latter case, the caller should provide the chunk following the one - /// given, then retry. - /// - /// See `is_boundary` for expectations on the provided chunk. - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// let flags = "\u{1F1F7}\u{1F1F8}\u{1F1EE}\u{1F1F4}"; - /// let mut cursor = GraphemeCursor::new(4, flags.len(), false); - /// assert_eq!(cursor.next_boundary(flags, 0), Ok(Some(8))); - /// assert_eq!(cursor.next_boundary(flags, 0), Ok(Some(16))); - /// assert_eq!(cursor.next_boundary(flags, 0), Ok(None)); - /// ``` - /// - /// And an example that uses partial strings: - /// - /// ```rust - /// # use unicode_segmentation::{GraphemeCursor, GraphemeIncomplete}; - /// let s = "abcd"; - /// let mut cursor = GraphemeCursor::new(0, s.len(), false); - /// assert_eq!(cursor.next_boundary(&s[..2], 0), Ok(Some(1))); - /// assert_eq!(cursor.next_boundary(&s[..2], 0), Err(GraphemeIncomplete::NextChunk)); - /// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(Some(2))); - /// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(Some(3))); - /// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(Some(4))); - /// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(None)); - /// ``` - pub fn next_boundary(&mut self, chunk: &str, chunk_start: usize) -> Result, GraphemeIncomplete> { - use tables::grapheme as gr; - if self.offset == self.len { - return Ok(None); - } - let mut iter = chunk[self.offset - chunk_start..].chars(); - let mut ch = iter.next().unwrap(); - loop { - if self.resuming { - if self.cat_after.is_none() { - self.cat_after = Some(gr::grapheme_category(ch)); - } - } else { - self.offset += ch.len_utf8(); - self.state = GraphemeState::Unknown; - self.cat_before = self.cat_after.take(); - if self.cat_before.is_none() { - self.cat_before = Some(gr::grapheme_category(ch)); - } - if self.cat_before.unwrap() == GraphemeCat::GC_Regional_Indicator { - self.ris_count = self.ris_count.map(|c| c + 1); - } else { - self.ris_count = Some(0); - } - if let Some(next_ch) = iter.next() { - ch = next_ch; - self.cat_after = Some(gr::grapheme_category(ch)); - } else if self.offset == self.len { - self.decide(true); - } else { - self.resuming = true; - return Err(GraphemeIncomplete::NextChunk); - } - } - self.resuming = true; - if self.is_boundary(chunk, chunk_start)? { - self.resuming = false; - return Ok(Some(self.offset)); - } - self.resuming = false; - } - } - - /// Find the previous boundary after the current cursor position. Only a part - /// of the string need be supplied. If the chunk is incomplete, then this - /// method might return `GraphemeIncomplete::PreContext` or - /// `GraphemeIncomplete::PrevChunk`. In the former case, the caller should - /// call `provide_context` with the requested chunk, then retry. In the - /// latter case, the caller should provide the chunk preceding the one - /// given, then retry. - /// - /// See `is_boundary` for expectations on the provided chunk. - /// - /// ```rust - /// # use unicode_segmentation::GraphemeCursor; - /// let flags = "\u{1F1F7}\u{1F1F8}\u{1F1EE}\u{1F1F4}"; - /// let mut cursor = GraphemeCursor::new(12, flags.len(), false); - /// assert_eq!(cursor.prev_boundary(flags, 0), Ok(Some(8))); - /// assert_eq!(cursor.prev_boundary(flags, 0), Ok(Some(0))); - /// assert_eq!(cursor.prev_boundary(flags, 0), Ok(None)); - /// ``` - /// - /// And an example that uses partial strings (note the exact return is not - /// guaranteed, and may be `PrevChunk` or `PreContext` arbitrarily): - /// - /// ```rust - /// # use unicode_segmentation::{GraphemeCursor, GraphemeIncomplete}; - /// let s = "abcd"; - /// let mut cursor = GraphemeCursor::new(4, s.len(), false); - /// assert_eq!(cursor.prev_boundary(&s[2..4], 2), Ok(Some(3))); - /// assert_eq!(cursor.prev_boundary(&s[2..4], 2), Err(GraphemeIncomplete::PrevChunk)); - /// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(Some(2))); - /// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(Some(1))); - /// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(Some(0))); - /// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(None)); - /// ``` - pub fn prev_boundary(&mut self, chunk: &str, chunk_start: usize) -> Result, GraphemeIncomplete> { - use tables::grapheme as gr; - if self.offset == 0 { - return Ok(None); - } - let mut iter = chunk[..self.offset - chunk_start].chars().rev(); - let mut ch = iter.next().unwrap(); - loop { - if self.offset == chunk_start { - self.resuming = true; - return Err(GraphemeIncomplete::PrevChunk); - } - if self.resuming { - self.cat_before = Some(gr::grapheme_category(ch)); - } else { - self.offset -= ch.len_utf8(); - self.cat_after = self.cat_before.take(); - self.state = GraphemeState::Unknown; - if let Some(ris_count) = self.ris_count { - self.ris_count = if ris_count > 0 { Some(ris_count - 1) } else { None }; - } - if let Some(prev_ch) = iter.next() { - ch = prev_ch; - self.cat_before = Some(gr::grapheme_category(ch)); - } else if self.offset == 0 { - self.decide(true); - } else { - self.resuming = true; - return Err(GraphemeIncomplete::PrevChunk); - } - } - self.resuming = true; - if self.is_boundary(chunk, chunk_start)? { - self.resuming = false; - return Ok(Some(self.offset)); - } - self.resuming = false; - } - } -} diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/lib.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,204 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Iterators which split strings on Grapheme Cluster or Word boundaries, according -//! to the [Unicode Standard Annex #29](http://www.unicode.org/reports/tr29/) rules. -//! -//! ```rust -//! extern crate unicode_segmentation; -//! -//! use unicode_segmentation::UnicodeSegmentation; -//! -//! fn main() { -//! let s = "a̐éö̲\r\n"; -//! let g = UnicodeSegmentation::graphemes(s, true).collect::>(); -//! let b: &[_] = &["a̐", "é", "ö̲", "\r\n"]; -//! assert_eq!(g, b); -//! -//! let s = "The quick (\"brown\") fox can't jump 32.3 feet, right?"; -//! let w = s.unicode_words().collect::>(); -//! let b: &[_] = &["The", "quick", "brown", "fox", "can't", "jump", "32.3", "feet", "right"]; -//! assert_eq!(w, b); -//! -//! let s = "The quick (\"brown\") fox"; -//! let w = s.split_word_bounds().collect::>(); -//! let b: &[_] = &["The", " ", "quick", " ", "(", "\"", "brown", "\"", ")", " ", " ", "fox"]; -//! assert_eq!(w, b); -//! } -//! ``` -//! -//! # no_std -//! -//! unicode-segmentation does not depend on libstd, so it can be used in crates -//! with the `#![no_std]` attribute. -//! -//! # crates.io -//! -//! You can use this package in your project by adding the following -//! to your `Cargo.toml`: -//! -//! ```toml -//! [dependencies] -//! unicode-segmentation = "1.1.0" -//! ``` - -#![deny(missing_docs, unsafe_code)] -#![doc(html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png", - html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png")] - -#![no_std] - -#[cfg(test)] -#[macro_use] -extern crate std; - -#[cfg(test)] -#[macro_use] -extern crate quickcheck; - -pub use grapheme::{Graphemes, GraphemeIndices}; -pub use grapheme::{GraphemeCursor, GraphemeIncomplete}; -pub use tables::UNICODE_VERSION; -pub use word::{UWordBounds, UWordBoundIndices, UnicodeWords}; - -mod grapheme; -mod tables; -mod word; - -#[cfg(test)] -mod test; -#[cfg(test)] -mod testdata; - -/// Methods for segmenting strings according to -/// [Unicode Standard Annex #29](http://www.unicode.org/reports/tr29/). -pub trait UnicodeSegmentation { - /// Returns an iterator over the [grapheme clusters][graphemes] of `self`. - /// - /// [graphemes]: http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries - /// - /// If `is_extended` is true, the iterator is over the - /// *extended grapheme clusters*; - /// otherwise, the iterator is over the *legacy grapheme clusters*. - /// [UAX#29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) - /// recommends extended grapheme cluster boundaries for general processing. - /// - /// # Examples - /// - /// ``` - /// # use self::unicode_segmentation::UnicodeSegmentation; - /// let gr1 = UnicodeSegmentation::graphemes("a\u{310}e\u{301}o\u{308}\u{332}", true) - /// .collect::>(); - /// let b: &[_] = &["a\u{310}", "e\u{301}", "o\u{308}\u{332}"]; - /// - /// assert_eq!(&gr1[..], b); - /// - /// let gr2 = UnicodeSegmentation::graphemes("a\r\nb🇷🇺🇸🇹", true).collect::>(); - /// let b: &[_] = &["a", "\r\n", "b", "🇷🇺", "🇸🇹"]; - /// - /// assert_eq!(&gr2[..], b); - /// ``` - fn graphemes<'a>(&'a self, is_extended: bool) -> Graphemes<'a>; - - /// Returns an iterator over the grapheme clusters of `self` and their - /// byte offsets. See `graphemes()` for more information. - /// - /// # Examples - /// - /// ``` - /// # use self::unicode_segmentation::UnicodeSegmentation; - /// let gr_inds = UnicodeSegmentation::grapheme_indices("a̐éö̲\r\n", true) - /// .collect::>(); - /// let b: &[_] = &[(0, "a̐"), (3, "é"), (6, "ö̲"), (11, "\r\n")]; - /// - /// assert_eq!(&gr_inds[..], b); - /// ``` - fn grapheme_indices<'a>(&'a self, is_extended: bool) -> GraphemeIndices<'a>; - - /// Returns an iterator over the words of `self`, separated on - /// [UAX#29 word boundaries](http://www.unicode.org/reports/tr29/#Word_Boundaries). - /// - /// Here, "words" are just those substrings which, after splitting on - /// UAX#29 word boundaries, contain any alphanumeric characters. That is, the - /// substring must contain at least one character with the - /// [Alphabetic](http://unicode.org/reports/tr44/#Alphabetic) - /// property, or with - /// [General_Category=Number](http://unicode.org/reports/tr44/#General_Category_Values). - /// - /// # Example - /// - /// ``` - /// # use self::unicode_segmentation::UnicodeSegmentation; - /// let uws = "The quick (\"brown\") fox can't jump 32.3 feet, right?"; - /// let uw1 = uws.unicode_words().collect::>(); - /// let b: &[_] = &["The", "quick", "brown", "fox", "can't", "jump", "32.3", "feet", "right"]; - /// - /// assert_eq!(&uw1[..], b); - /// ``` - fn unicode_words<'a>(&'a self) -> UnicodeWords<'a>; - - /// Returns an iterator over substrings of `self` separated on - /// [UAX#29 word boundaries](http://www.unicode.org/reports/tr29/#Word_Boundaries). - /// - /// The concatenation of the substrings returned by this function is just the original string. - /// - /// # Example - /// - /// ``` - /// # use self::unicode_segmentation::UnicodeSegmentation; - /// let swu1 = "The quick (\"brown\") fox".split_word_bounds().collect::>(); - /// let b: &[_] = &["The", " ", "quick", " ", "(", "\"", "brown", "\"", ")", " ", " ", "fox"]; - /// - /// assert_eq!(&swu1[..], b); - /// ``` - fn split_word_bounds<'a>(&'a self) -> UWordBounds<'a>; - - /// Returns an iterator over substrings of `self`, split on UAX#29 word boundaries, - /// and their offsets. See `split_word_bounds()` for more information. - /// - /// # Example - /// - /// ``` - /// # use self::unicode_segmentation::UnicodeSegmentation; - /// let swi1 = "Brr, it's 29.3°F!".split_word_bound_indices().collect::>(); - /// let b: &[_] = &[(0, "Brr"), (3, ","), (4, " "), (5, "it's"), (9, " "), (10, "29.3"), - /// (14, "°"), (16, "F"), (17, "!")]; - /// - /// assert_eq!(&swi1[..], b); - /// ``` - fn split_word_bound_indices<'a>(&'a self) -> UWordBoundIndices<'a>; -} - -impl UnicodeSegmentation for str { - #[inline] - fn graphemes(&self, is_extended: bool) -> Graphemes { - grapheme::new_graphemes(self, is_extended) - } - - #[inline] - fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices { - grapheme::new_grapheme_indices(self, is_extended) - } - - #[inline] - fn unicode_words(&self) -> UnicodeWords { - word::new_unicode_words(self) - } - - #[inline] - fn split_word_bounds(&self) -> UWordBounds { - word::new_word_bounds(self) - } - - #[inline] - fn split_word_bound_indices(&self) -> UWordBoundIndices { - word::new_word_bound_indices(self) - } -} diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/tables.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/tables.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/tables.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/tables.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,1325 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly - -#![allow(missing_docs, non_upper_case_globals, non_snake_case)] - -/// The version of [Unicode](http://www.unicode.org/) -/// that this version of unicode-segmentation is based on. -pub const UNICODE_VERSION: (u64, u64, u64) = (9, 0, 0); - -pub mod util { - #[inline] - pub fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { - use core::cmp::Ordering::{Equal, Less, Greater}; - r.binary_search_by(|&(lo,hi)| { - if lo <= c && c <= hi { Equal } - else if hi < c { Less } - else { Greater } - }).is_ok() - } - - #[inline] - fn is_alphabetic(c: char) -> bool { - match c { - 'a' ... 'z' | 'A' ... 'Z' => true, - c if c > '' => super::derived_property::Alphabetic(c), - _ => false, - } - } - - #[inline] - fn is_numeric(c: char) -> bool { - match c { - '0' ... '9' => true, - c if c > '' => super::general_category::N(c), - _ => false, - } - } - - #[inline] - pub fn is_alphanumeric(c: char) -> bool { - is_alphabetic(c) || is_numeric(c) - } -} - -mod general_category { - const N_table: &'static [(char, char)] = &[ - ('\u{30}', '\u{39}'), ('\u{660}', '\u{669}'), ('\u{6f0}', '\u{6f9}'), ('\u{7c0}', - '\u{7c9}'), ('\u{966}', '\u{96f}'), ('\u{9e6}', '\u{9ef}'), ('\u{a66}', '\u{a6f}'), - ('\u{ae6}', '\u{aef}'), ('\u{b66}', '\u{b6f}'), ('\u{be6}', '\u{bef}'), ('\u{c66}', - '\u{c6f}'), ('\u{ce6}', '\u{cef}'), ('\u{d66}', '\u{d6f}'), ('\u{de6}', '\u{def}'), - ('\u{e50}', '\u{e59}'), ('\u{ed0}', '\u{ed9}'), ('\u{f20}', '\u{f29}'), ('\u{1040}', - '\u{1049}'), ('\u{1090}', '\u{1099}'), ('\u{16ee}', '\u{16f0}'), ('\u{17e0}', '\u{17e9}'), - ('\u{1810}', '\u{1819}'), ('\u{1946}', '\u{194f}'), ('\u{19d0}', '\u{19d9}'), ('\u{1a80}', - '\u{1a89}'), ('\u{1a90}', '\u{1a99}'), ('\u{1b50}', '\u{1b59}'), ('\u{1bb0}', '\u{1bb9}'), - ('\u{1c40}', '\u{1c49}'), ('\u{1c50}', '\u{1c59}'), ('\u{2160}', '\u{2182}'), ('\u{2185}', - '\u{2188}'), ('\u{3007}', '\u{3007}'), ('\u{3021}', '\u{3029}'), ('\u{3038}', '\u{303a}'), - ('\u{a620}', '\u{a629}'), ('\u{a6e6}', '\u{a6ef}'), ('\u{a8d0}', '\u{a8d9}'), ('\u{a900}', - '\u{a909}'), ('\u{a9d0}', '\u{a9d9}'), ('\u{a9f0}', '\u{a9f9}'), ('\u{aa50}', '\u{aa59}'), - ('\u{abf0}', '\u{abf9}'), ('\u{ff10}', '\u{ff19}'), ('\u{10140}', '\u{10174}'), - ('\u{10341}', '\u{10341}'), ('\u{1034a}', '\u{1034a}'), ('\u{103d1}', '\u{103d5}'), - ('\u{104a0}', '\u{104a9}'), ('\u{11066}', '\u{1106f}'), ('\u{110f0}', '\u{110f9}'), - ('\u{11136}', '\u{1113f}'), ('\u{111d0}', '\u{111d9}'), ('\u{112f0}', '\u{112f9}'), - ('\u{11450}', '\u{11459}'), ('\u{114d0}', '\u{114d9}'), ('\u{11650}', '\u{11659}'), - ('\u{116c0}', '\u{116c9}'), ('\u{11730}', '\u{11739}'), ('\u{118e0}', '\u{118e9}'), - ('\u{11c50}', '\u{11c59}'), ('\u{12400}', '\u{1246e}'), ('\u{16a60}', '\u{16a69}'), - ('\u{16b50}', '\u{16b59}'), ('\u{1d7ce}', '\u{1d7ff}'), ('\u{1e950}', '\u{1e959}') - ]; - - #[inline] - pub fn N(c: char) -> bool { - super::util::bsearch_range_table(c, N_table) - } - -} - -mod derived_property { - const Alphabetic_table: &'static [(char, char)] = &[ - ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), - ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), - ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', - '\u{2ee}'), ('\u{345}', '\u{345}'), ('\u{370}', '\u{374}'), ('\u{376}', '\u{377}'), - ('\u{37a}', '\u{37d}'), ('\u{37f}', '\u{37f}'), ('\u{386}', '\u{386}'), ('\u{388}', - '\u{38a}'), ('\u{38c}', '\u{38c}'), ('\u{38e}', '\u{3a1}'), ('\u{3a3}', '\u{3f5}'), - ('\u{3f7}', '\u{481}'), ('\u{48a}', '\u{52f}'), ('\u{531}', '\u{556}'), ('\u{559}', - '\u{559}'), ('\u{561}', '\u{587}'), ('\u{5b0}', '\u{5bd}'), ('\u{5bf}', '\u{5bf}'), - ('\u{5c1}', '\u{5c2}'), ('\u{5c4}', '\u{5c5}'), ('\u{5c7}', '\u{5c7}'), ('\u{5d0}', - '\u{5ea}'), ('\u{5f0}', '\u{5f2}'), ('\u{610}', '\u{61a}'), ('\u{620}', '\u{657}'), - ('\u{659}', '\u{65f}'), ('\u{66e}', '\u{6d3}'), ('\u{6d5}', '\u{6dc}'), ('\u{6e1}', - '\u{6e8}'), ('\u{6ed}', '\u{6ef}'), ('\u{6fa}', '\u{6fc}'), ('\u{6ff}', '\u{6ff}'), - ('\u{710}', '\u{73f}'), ('\u{74d}', '\u{7b1}'), ('\u{7ca}', '\u{7ea}'), ('\u{7f4}', - '\u{7f5}'), ('\u{7fa}', '\u{7fa}'), ('\u{800}', '\u{817}'), ('\u{81a}', '\u{82c}'), - ('\u{840}', '\u{858}'), ('\u{8a0}', '\u{8b4}'), ('\u{8b6}', '\u{8bd}'), ('\u{8d4}', - '\u{8df}'), ('\u{8e3}', '\u{8e9}'), ('\u{8f0}', '\u{93b}'), ('\u{93d}', '\u{94c}'), - ('\u{94e}', '\u{950}'), ('\u{955}', '\u{963}'), ('\u{971}', '\u{983}'), ('\u{985}', - '\u{98c}'), ('\u{98f}', '\u{990}'), ('\u{993}', '\u{9a8}'), ('\u{9aa}', '\u{9b0}'), - ('\u{9b2}', '\u{9b2}'), ('\u{9b6}', '\u{9b9}'), ('\u{9bd}', '\u{9c4}'), ('\u{9c7}', - '\u{9c8}'), ('\u{9cb}', '\u{9cc}'), ('\u{9ce}', '\u{9ce}'), ('\u{9d7}', '\u{9d7}'), - ('\u{9dc}', '\u{9dd}'), ('\u{9df}', '\u{9e3}'), ('\u{9f0}', '\u{9f1}'), ('\u{a01}', - '\u{a03}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', '\u{a10}'), ('\u{a13}', '\u{a28}'), - ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), ('\u{a35}', '\u{a36}'), ('\u{a38}', - '\u{a39}'), ('\u{a3e}', '\u{a42}'), ('\u{a47}', '\u{a48}'), ('\u{a4b}', '\u{a4c}'), - ('\u{a51}', '\u{a51}'), ('\u{a59}', '\u{a5c}'), ('\u{a5e}', '\u{a5e}'), ('\u{a70}', - '\u{a75}'), ('\u{a81}', '\u{a83}'), ('\u{a85}', '\u{a8d}'), ('\u{a8f}', '\u{a91}'), - ('\u{a93}', '\u{aa8}'), ('\u{aaa}', '\u{ab0}'), ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', - '\u{ab9}'), ('\u{abd}', '\u{ac5}'), ('\u{ac7}', '\u{ac9}'), ('\u{acb}', '\u{acc}'), - ('\u{ad0}', '\u{ad0}'), ('\u{ae0}', '\u{ae3}'), ('\u{af9}', '\u{af9}'), ('\u{b01}', - '\u{b03}'), ('\u{b05}', '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', '\u{b28}'), - ('\u{b2a}', '\u{b30}'), ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), ('\u{b3d}', - '\u{b44}'), ('\u{b47}', '\u{b48}'), ('\u{b4b}', '\u{b4c}'), ('\u{b56}', '\u{b57}'), - ('\u{b5c}', '\u{b5d}'), ('\u{b5f}', '\u{b63}'), ('\u{b71}', '\u{b71}'), ('\u{b82}', - '\u{b83}'), ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), ('\u{b92}', '\u{b95}'), - ('\u{b99}', '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', '\u{b9f}'), ('\u{ba3}', - '\u{ba4}'), ('\u{ba8}', '\u{baa}'), ('\u{bae}', '\u{bb9}'), ('\u{bbe}', '\u{bc2}'), - ('\u{bc6}', '\u{bc8}'), ('\u{bca}', '\u{bcc}'), ('\u{bd0}', '\u{bd0}'), ('\u{bd7}', - '\u{bd7}'), ('\u{c00}', '\u{c03}'), ('\u{c05}', '\u{c0c}'), ('\u{c0e}', '\u{c10}'), - ('\u{c12}', '\u{c28}'), ('\u{c2a}', '\u{c39}'), ('\u{c3d}', '\u{c44}'), ('\u{c46}', - '\u{c48}'), ('\u{c4a}', '\u{c4c}'), ('\u{c55}', '\u{c56}'), ('\u{c58}', '\u{c5a}'), - ('\u{c60}', '\u{c63}'), ('\u{c80}', '\u{c83}'), ('\u{c85}', '\u{c8c}'), ('\u{c8e}', - '\u{c90}'), ('\u{c92}', '\u{ca8}'), ('\u{caa}', '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), - ('\u{cbd}', '\u{cc4}'), ('\u{cc6}', '\u{cc8}'), ('\u{cca}', '\u{ccc}'), ('\u{cd5}', - '\u{cd6}'), ('\u{cde}', '\u{cde}'), ('\u{ce0}', '\u{ce3}'), ('\u{cf1}', '\u{cf2}'), - ('\u{d01}', '\u{d03}'), ('\u{d05}', '\u{d0c}'), ('\u{d0e}', '\u{d10}'), ('\u{d12}', - '\u{d3a}'), ('\u{d3d}', '\u{d44}'), ('\u{d46}', '\u{d48}'), ('\u{d4a}', '\u{d4c}'), - ('\u{d4e}', '\u{d4e}'), ('\u{d54}', '\u{d57}'), ('\u{d5f}', '\u{d63}'), ('\u{d7a}', - '\u{d7f}'), ('\u{d82}', '\u{d83}'), ('\u{d85}', '\u{d96}'), ('\u{d9a}', '\u{db1}'), - ('\u{db3}', '\u{dbb}'), ('\u{dbd}', '\u{dbd}'), ('\u{dc0}', '\u{dc6}'), ('\u{dcf}', - '\u{dd4}'), ('\u{dd6}', '\u{dd6}'), ('\u{dd8}', '\u{ddf}'), ('\u{df2}', '\u{df3}'), - ('\u{e01}', '\u{e3a}'), ('\u{e40}', '\u{e46}'), ('\u{e4d}', '\u{e4d}'), ('\u{e81}', - '\u{e82}'), ('\u{e84}', '\u{e84}'), ('\u{e87}', '\u{e88}'), ('\u{e8a}', '\u{e8a}'), - ('\u{e8d}', '\u{e8d}'), ('\u{e94}', '\u{e97}'), ('\u{e99}', '\u{e9f}'), ('\u{ea1}', - '\u{ea3}'), ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', '\u{ea7}'), ('\u{eaa}', '\u{eab}'), - ('\u{ead}', '\u{eb9}'), ('\u{ebb}', '\u{ebd}'), ('\u{ec0}', '\u{ec4}'), ('\u{ec6}', - '\u{ec6}'), ('\u{ecd}', '\u{ecd}'), ('\u{edc}', '\u{edf}'), ('\u{f00}', '\u{f00}'), - ('\u{f40}', '\u{f47}'), ('\u{f49}', '\u{f6c}'), ('\u{f71}', '\u{f81}'), ('\u{f88}', - '\u{f97}'), ('\u{f99}', '\u{fbc}'), ('\u{1000}', '\u{1036}'), ('\u{1038}', '\u{1038}'), - ('\u{103b}', '\u{103f}'), ('\u{1050}', '\u{1062}'), ('\u{1065}', '\u{1068}'), ('\u{106e}', - '\u{1086}'), ('\u{108e}', '\u{108e}'), ('\u{109c}', '\u{109d}'), ('\u{10a0}', '\u{10c5}'), - ('\u{10c7}', '\u{10c7}'), ('\u{10cd}', '\u{10cd}'), ('\u{10d0}', '\u{10fa}'), ('\u{10fc}', - '\u{1248}'), ('\u{124a}', '\u{124d}'), ('\u{1250}', '\u{1256}'), ('\u{1258}', '\u{1258}'), - ('\u{125a}', '\u{125d}'), ('\u{1260}', '\u{1288}'), ('\u{128a}', '\u{128d}'), ('\u{1290}', - '\u{12b0}'), ('\u{12b2}', '\u{12b5}'), ('\u{12b8}', '\u{12be}'), ('\u{12c0}', '\u{12c0}'), - ('\u{12c2}', '\u{12c5}'), ('\u{12c8}', '\u{12d6}'), ('\u{12d8}', '\u{1310}'), ('\u{1312}', - '\u{1315}'), ('\u{1318}', '\u{135a}'), ('\u{135f}', '\u{135f}'), ('\u{1380}', '\u{138f}'), - ('\u{13a0}', '\u{13f5}'), ('\u{13f8}', '\u{13fd}'), ('\u{1401}', '\u{166c}'), ('\u{166f}', - '\u{167f}'), ('\u{1681}', '\u{169a}'), ('\u{16a0}', '\u{16ea}'), ('\u{16ee}', '\u{16f8}'), - ('\u{1700}', '\u{170c}'), ('\u{170e}', '\u{1713}'), ('\u{1720}', '\u{1733}'), ('\u{1740}', - '\u{1753}'), ('\u{1760}', '\u{176c}'), ('\u{176e}', '\u{1770}'), ('\u{1772}', '\u{1773}'), - ('\u{1780}', '\u{17b3}'), ('\u{17b6}', '\u{17c8}'), ('\u{17d7}', '\u{17d7}'), ('\u{17dc}', - '\u{17dc}'), ('\u{1820}', '\u{1877}'), ('\u{1880}', '\u{18aa}'), ('\u{18b0}', '\u{18f5}'), - ('\u{1900}', '\u{191e}'), ('\u{1920}', '\u{192b}'), ('\u{1930}', '\u{1938}'), ('\u{1950}', - '\u{196d}'), ('\u{1970}', '\u{1974}'), ('\u{1980}', '\u{19ab}'), ('\u{19b0}', '\u{19c9}'), - ('\u{1a00}', '\u{1a1b}'), ('\u{1a20}', '\u{1a5e}'), ('\u{1a61}', '\u{1a74}'), ('\u{1aa7}', - '\u{1aa7}'), ('\u{1b00}', '\u{1b33}'), ('\u{1b35}', '\u{1b43}'), ('\u{1b45}', '\u{1b4b}'), - ('\u{1b80}', '\u{1ba9}'), ('\u{1bac}', '\u{1baf}'), ('\u{1bba}', '\u{1be5}'), ('\u{1be7}', - '\u{1bf1}'), ('\u{1c00}', '\u{1c35}'), ('\u{1c4d}', '\u{1c4f}'), ('\u{1c5a}', '\u{1c7d}'), - ('\u{1c80}', '\u{1c88}'), ('\u{1ce9}', '\u{1cec}'), ('\u{1cee}', '\u{1cf3}'), ('\u{1cf5}', - '\u{1cf6}'), ('\u{1d00}', '\u{1dbf}'), ('\u{1de7}', '\u{1df4}'), ('\u{1e00}', '\u{1f15}'), - ('\u{1f18}', '\u{1f1d}'), ('\u{1f20}', '\u{1f45}'), ('\u{1f48}', '\u{1f4d}'), ('\u{1f50}', - '\u{1f57}'), ('\u{1f59}', '\u{1f59}'), ('\u{1f5b}', '\u{1f5b}'), ('\u{1f5d}', '\u{1f5d}'), - ('\u{1f5f}', '\u{1f7d}'), ('\u{1f80}', '\u{1fb4}'), ('\u{1fb6}', '\u{1fbc}'), ('\u{1fbe}', - '\u{1fbe}'), ('\u{1fc2}', '\u{1fc4}'), ('\u{1fc6}', '\u{1fcc}'), ('\u{1fd0}', '\u{1fd3}'), - ('\u{1fd6}', '\u{1fdb}'), ('\u{1fe0}', '\u{1fec}'), ('\u{1ff2}', '\u{1ff4}'), ('\u{1ff6}', - '\u{1ffc}'), ('\u{2071}', '\u{2071}'), ('\u{207f}', '\u{207f}'), ('\u{2090}', '\u{209c}'), - ('\u{2102}', '\u{2102}'), ('\u{2107}', '\u{2107}'), ('\u{210a}', '\u{2113}'), ('\u{2115}', - '\u{2115}'), ('\u{2119}', '\u{211d}'), ('\u{2124}', '\u{2124}'), ('\u{2126}', '\u{2126}'), - ('\u{2128}', '\u{2128}'), ('\u{212a}', '\u{212d}'), ('\u{212f}', '\u{2139}'), ('\u{213c}', - '\u{213f}'), ('\u{2145}', '\u{2149}'), ('\u{214e}', '\u{214e}'), ('\u{2160}', '\u{2188}'), - ('\u{24b6}', '\u{24e9}'), ('\u{2c00}', '\u{2c2e}'), ('\u{2c30}', '\u{2c5e}'), ('\u{2c60}', - '\u{2ce4}'), ('\u{2ceb}', '\u{2cee}'), ('\u{2cf2}', '\u{2cf3}'), ('\u{2d00}', '\u{2d25}'), - ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}'), ('\u{2d30}', '\u{2d67}'), ('\u{2d6f}', - '\u{2d6f}'), ('\u{2d80}', '\u{2d96}'), ('\u{2da0}', '\u{2da6}'), ('\u{2da8}', '\u{2dae}'), - ('\u{2db0}', '\u{2db6}'), ('\u{2db8}', '\u{2dbe}'), ('\u{2dc0}', '\u{2dc6}'), ('\u{2dc8}', - '\u{2dce}'), ('\u{2dd0}', '\u{2dd6}'), ('\u{2dd8}', '\u{2dde}'), ('\u{2de0}', '\u{2dff}'), - ('\u{2e2f}', '\u{2e2f}'), ('\u{3005}', '\u{3007}'), ('\u{3021}', '\u{3029}'), ('\u{3031}', - '\u{3035}'), ('\u{3038}', '\u{303c}'), ('\u{3041}', '\u{3096}'), ('\u{309d}', '\u{309f}'), - ('\u{30a1}', '\u{30fa}'), ('\u{30fc}', '\u{30ff}'), ('\u{3105}', '\u{312d}'), ('\u{3131}', - '\u{318e}'), ('\u{31a0}', '\u{31ba}'), ('\u{31f0}', '\u{31ff}'), ('\u{3400}', '\u{4db5}'), - ('\u{4e00}', '\u{9fd5}'), ('\u{a000}', '\u{a48c}'), ('\u{a4d0}', '\u{a4fd}'), ('\u{a500}', - '\u{a60c}'), ('\u{a610}', '\u{a61f}'), ('\u{a62a}', '\u{a62b}'), ('\u{a640}', '\u{a66e}'), - ('\u{a674}', '\u{a67b}'), ('\u{a67f}', '\u{a6ef}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', - '\u{a788}'), ('\u{a78b}', '\u{a7ae}'), ('\u{a7b0}', '\u{a7b7}'), ('\u{a7f7}', '\u{a801}'), - ('\u{a803}', '\u{a805}'), ('\u{a807}', '\u{a80a}'), ('\u{a80c}', '\u{a827}'), ('\u{a840}', - '\u{a873}'), ('\u{a880}', '\u{a8c3}'), ('\u{a8c5}', '\u{a8c5}'), ('\u{a8f2}', '\u{a8f7}'), - ('\u{a8fb}', '\u{a8fb}'), ('\u{a8fd}', '\u{a8fd}'), ('\u{a90a}', '\u{a92a}'), ('\u{a930}', - '\u{a952}'), ('\u{a960}', '\u{a97c}'), ('\u{a980}', '\u{a9b2}'), ('\u{a9b4}', '\u{a9bf}'), - ('\u{a9cf}', '\u{a9cf}'), ('\u{a9e0}', '\u{a9e4}'), ('\u{a9e6}', '\u{a9ef}'), ('\u{a9fa}', - '\u{a9fe}'), ('\u{aa00}', '\u{aa36}'), ('\u{aa40}', '\u{aa4d}'), ('\u{aa60}', '\u{aa76}'), - ('\u{aa7a}', '\u{aa7a}'), ('\u{aa7e}', '\u{aabe}'), ('\u{aac0}', '\u{aac0}'), ('\u{aac2}', - '\u{aac2}'), ('\u{aadb}', '\u{aadd}'), ('\u{aae0}', '\u{aaef}'), ('\u{aaf2}', '\u{aaf5}'), - ('\u{ab01}', '\u{ab06}'), ('\u{ab09}', '\u{ab0e}'), ('\u{ab11}', '\u{ab16}'), ('\u{ab20}', - '\u{ab26}'), ('\u{ab28}', '\u{ab2e}'), ('\u{ab30}', '\u{ab5a}'), ('\u{ab5c}', '\u{ab65}'), - ('\u{ab70}', '\u{abea}'), ('\u{ac00}', '\u{d7a3}'), ('\u{d7b0}', '\u{d7c6}'), ('\u{d7cb}', - '\u{d7fb}'), ('\u{f900}', '\u{fa6d}'), ('\u{fa70}', '\u{fad9}'), ('\u{fb00}', '\u{fb06}'), - ('\u{fb13}', '\u{fb17}'), ('\u{fb1d}', '\u{fb28}'), ('\u{fb2a}', '\u{fb36}'), ('\u{fb38}', - '\u{fb3c}'), ('\u{fb3e}', '\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', '\u{fb44}'), - ('\u{fb46}', '\u{fbb1}'), ('\u{fbd3}', '\u{fd3d}'), ('\u{fd50}', '\u{fd8f}'), ('\u{fd92}', - '\u{fdc7}'), ('\u{fdf0}', '\u{fdfb}'), ('\u{fe70}', '\u{fe74}'), ('\u{fe76}', '\u{fefc}'), - ('\u{ff21}', '\u{ff3a}'), ('\u{ff41}', '\u{ff5a}'), ('\u{ff66}', '\u{ffbe}'), ('\u{ffc2}', - '\u{ffc7}'), ('\u{ffca}', '\u{ffcf}'), ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}', '\u{ffdc}'), - ('\u{10000}', '\u{1000b}'), ('\u{1000d}', '\u{10026}'), ('\u{10028}', '\u{1003a}'), - ('\u{1003c}', '\u{1003d}'), ('\u{1003f}', '\u{1004d}'), ('\u{10050}', '\u{1005d}'), - ('\u{10080}', '\u{100fa}'), ('\u{10140}', '\u{10174}'), ('\u{10280}', '\u{1029c}'), - ('\u{102a0}', '\u{102d0}'), ('\u{10300}', '\u{1031f}'), ('\u{10330}', '\u{1034a}'), - ('\u{10350}', '\u{1037a}'), ('\u{10380}', '\u{1039d}'), ('\u{103a0}', '\u{103c3}'), - ('\u{103c8}', '\u{103cf}'), ('\u{103d1}', '\u{103d5}'), ('\u{10400}', '\u{1049d}'), - ('\u{104b0}', '\u{104d3}'), ('\u{104d8}', '\u{104fb}'), ('\u{10500}', '\u{10527}'), - ('\u{10530}', '\u{10563}'), ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), - ('\u{10760}', '\u{10767}'), ('\u{10800}', '\u{10805}'), ('\u{10808}', '\u{10808}'), - ('\u{1080a}', '\u{10835}'), ('\u{10837}', '\u{10838}'), ('\u{1083c}', '\u{1083c}'), - ('\u{1083f}', '\u{10855}'), ('\u{10860}', '\u{10876}'), ('\u{10880}', '\u{1089e}'), - ('\u{108e0}', '\u{108f2}'), ('\u{108f4}', '\u{108f5}'), ('\u{10900}', '\u{10915}'), - ('\u{10920}', '\u{10939}'), ('\u{10980}', '\u{109b7}'), ('\u{109be}', '\u{109bf}'), - ('\u{10a00}', '\u{10a03}'), ('\u{10a05}', '\u{10a06}'), ('\u{10a0c}', '\u{10a13}'), - ('\u{10a15}', '\u{10a17}'), ('\u{10a19}', '\u{10a33}'), ('\u{10a60}', '\u{10a7c}'), - ('\u{10a80}', '\u{10a9c}'), ('\u{10ac0}', '\u{10ac7}'), ('\u{10ac9}', '\u{10ae4}'), - ('\u{10b00}', '\u{10b35}'), ('\u{10b40}', '\u{10b55}'), ('\u{10b60}', '\u{10b72}'), - ('\u{10b80}', '\u{10b91}'), ('\u{10c00}', '\u{10c48}'), ('\u{10c80}', '\u{10cb2}'), - ('\u{10cc0}', '\u{10cf2}'), ('\u{11000}', '\u{11045}'), ('\u{11082}', '\u{110b8}'), - ('\u{110d0}', '\u{110e8}'), ('\u{11100}', '\u{11132}'), ('\u{11150}', '\u{11172}'), - ('\u{11176}', '\u{11176}'), ('\u{11180}', '\u{111bf}'), ('\u{111c1}', '\u{111c4}'), - ('\u{111da}', '\u{111da}'), ('\u{111dc}', '\u{111dc}'), ('\u{11200}', '\u{11211}'), - ('\u{11213}', '\u{11234}'), ('\u{11237}', '\u{11237}'), ('\u{1123e}', '\u{1123e}'), - ('\u{11280}', '\u{11286}'), ('\u{11288}', '\u{11288}'), ('\u{1128a}', '\u{1128d}'), - ('\u{1128f}', '\u{1129d}'), ('\u{1129f}', '\u{112a8}'), ('\u{112b0}', '\u{112e8}'), - ('\u{11300}', '\u{11303}'), ('\u{11305}', '\u{1130c}'), ('\u{1130f}', '\u{11310}'), - ('\u{11313}', '\u{11328}'), ('\u{1132a}', '\u{11330}'), ('\u{11332}', '\u{11333}'), - ('\u{11335}', '\u{11339}'), ('\u{1133d}', '\u{11344}'), ('\u{11347}', '\u{11348}'), - ('\u{1134b}', '\u{1134c}'), ('\u{11350}', '\u{11350}'), ('\u{11357}', '\u{11357}'), - ('\u{1135d}', '\u{11363}'), ('\u{11400}', '\u{11441}'), ('\u{11443}', '\u{11445}'), - ('\u{11447}', '\u{1144a}'), ('\u{11480}', '\u{114c1}'), ('\u{114c4}', '\u{114c5}'), - ('\u{114c7}', '\u{114c7}'), ('\u{11580}', '\u{115b5}'), ('\u{115b8}', '\u{115be}'), - ('\u{115d8}', '\u{115dd}'), ('\u{11600}', '\u{1163e}'), ('\u{11640}', '\u{11640}'), - ('\u{11644}', '\u{11644}'), ('\u{11680}', '\u{116b5}'), ('\u{11700}', '\u{11719}'), - ('\u{1171d}', '\u{1172a}'), ('\u{118a0}', '\u{118df}'), ('\u{118ff}', '\u{118ff}'), - ('\u{11ac0}', '\u{11af8}'), ('\u{11c00}', '\u{11c08}'), ('\u{11c0a}', '\u{11c36}'), - ('\u{11c38}', '\u{11c3e}'), ('\u{11c40}', '\u{11c40}'), ('\u{11c72}', '\u{11c8f}'), - ('\u{11c92}', '\u{11ca7}'), ('\u{11ca9}', '\u{11cb6}'), ('\u{12000}', '\u{12399}'), - ('\u{12400}', '\u{1246e}'), ('\u{12480}', '\u{12543}'), ('\u{13000}', '\u{1342e}'), - ('\u{14400}', '\u{14646}'), ('\u{16800}', '\u{16a38}'), ('\u{16a40}', '\u{16a5e}'), - ('\u{16ad0}', '\u{16aed}'), ('\u{16b00}', '\u{16b36}'), ('\u{16b40}', '\u{16b43}'), - ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), ('\u{16f00}', '\u{16f44}'), - ('\u{16f50}', '\u{16f7e}'), ('\u{16f93}', '\u{16f9f}'), ('\u{16fe0}', '\u{16fe0}'), - ('\u{17000}', '\u{187ec}'), ('\u{18800}', '\u{18af2}'), ('\u{1b000}', '\u{1b001}'), - ('\u{1bc00}', '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), ('\u{1bc80}', '\u{1bc88}'), - ('\u{1bc90}', '\u{1bc99}'), ('\u{1bc9e}', '\u{1bc9e}'), ('\u{1d400}', '\u{1d454}'), - ('\u{1d456}', '\u{1d49c}'), ('\u{1d49e}', '\u{1d49f}'), ('\u{1d4a2}', '\u{1d4a2}'), - ('\u{1d4a5}', '\u{1d4a6}'), ('\u{1d4a9}', '\u{1d4ac}'), ('\u{1d4ae}', '\u{1d4b9}'), - ('\u{1d4bb}', '\u{1d4bb}'), ('\u{1d4bd}', '\u{1d4c3}'), ('\u{1d4c5}', '\u{1d505}'), - ('\u{1d507}', '\u{1d50a}'), ('\u{1d50d}', '\u{1d514}'), ('\u{1d516}', '\u{1d51c}'), - ('\u{1d51e}', '\u{1d539}'), ('\u{1d53b}', '\u{1d53e}'), ('\u{1d540}', '\u{1d544}'), - ('\u{1d546}', '\u{1d546}'), ('\u{1d54a}', '\u{1d550}'), ('\u{1d552}', '\u{1d6a5}'), - ('\u{1d6a8}', '\u{1d6c0}'), ('\u{1d6c2}', '\u{1d6da}'), ('\u{1d6dc}', '\u{1d6fa}'), - ('\u{1d6fc}', '\u{1d714}'), ('\u{1d716}', '\u{1d734}'), ('\u{1d736}', '\u{1d74e}'), - ('\u{1d750}', '\u{1d76e}'), ('\u{1d770}', '\u{1d788}'), ('\u{1d78a}', '\u{1d7a8}'), - ('\u{1d7aa}', '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7cb}'), ('\u{1e000}', '\u{1e006}'), - ('\u{1e008}', '\u{1e018}'), ('\u{1e01b}', '\u{1e021}'), ('\u{1e023}', '\u{1e024}'), - ('\u{1e026}', '\u{1e02a}'), ('\u{1e800}', '\u{1e8c4}'), ('\u{1e900}', '\u{1e943}'), - ('\u{1e947}', '\u{1e947}'), ('\u{1ee00}', '\u{1ee03}'), ('\u{1ee05}', '\u{1ee1f}'), - ('\u{1ee21}', '\u{1ee22}'), ('\u{1ee24}', '\u{1ee24}'), ('\u{1ee27}', '\u{1ee27}'), - ('\u{1ee29}', '\u{1ee32}'), ('\u{1ee34}', '\u{1ee37}'), ('\u{1ee39}', '\u{1ee39}'), - ('\u{1ee3b}', '\u{1ee3b}'), ('\u{1ee42}', '\u{1ee42}'), ('\u{1ee47}', '\u{1ee47}'), - ('\u{1ee49}', '\u{1ee49}'), ('\u{1ee4b}', '\u{1ee4b}'), ('\u{1ee4d}', '\u{1ee4f}'), - ('\u{1ee51}', '\u{1ee52}'), ('\u{1ee54}', '\u{1ee54}'), ('\u{1ee57}', '\u{1ee57}'), - ('\u{1ee59}', '\u{1ee59}'), ('\u{1ee5b}', '\u{1ee5b}'), ('\u{1ee5d}', '\u{1ee5d}'), - ('\u{1ee5f}', '\u{1ee5f}'), ('\u{1ee61}', '\u{1ee62}'), ('\u{1ee64}', '\u{1ee64}'), - ('\u{1ee67}', '\u{1ee6a}'), ('\u{1ee6c}', '\u{1ee72}'), ('\u{1ee74}', '\u{1ee77}'), - ('\u{1ee79}', '\u{1ee7c}'), ('\u{1ee7e}', '\u{1ee7e}'), ('\u{1ee80}', '\u{1ee89}'), - ('\u{1ee8b}', '\u{1ee9b}'), ('\u{1eea1}', '\u{1eea3}'), ('\u{1eea5}', '\u{1eea9}'), - ('\u{1eeab}', '\u{1eebb}'), ('\u{1f130}', '\u{1f149}'), ('\u{1f150}', '\u{1f169}'), - ('\u{1f170}', '\u{1f189}'), ('\u{20000}', '\u{2a6d6}'), ('\u{2a700}', '\u{2b734}'), - ('\u{2b740}', '\u{2b81d}'), ('\u{2b820}', '\u{2cea1}'), ('\u{2f800}', '\u{2fa1d}') - ]; - - #[inline] - pub fn Alphabetic(c: char) -> bool { - super::util::bsearch_range_table(c, Alphabetic_table) - } - -} - -pub mod grapheme { - use core::result::Result::{Ok, Err}; - - pub use self::GraphemeCat::*; - - #[allow(non_camel_case_types)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum GraphemeCat { - GC_Any, - GC_CR, - GC_Control, - GC_E_Base, - GC_E_Base_GAZ, - GC_E_Modifier, - GC_Extend, - GC_Glue_After_Zwj, - GC_L, - GC_LF, - GC_LV, - GC_LVT, - GC_Prepend, - GC_Regional_Indicator, - GC_SpacingMark, - GC_T, - GC_V, - GC_ZWJ, - } - - fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat { - use core::cmp::Ordering::{Equal, Less, Greater}; - match r.binary_search_by(|&(lo, hi, _)| { - if lo <= c && c <= hi { Equal } - else if hi < c { Less } - else { Greater } - }) { - Ok(idx) => { - let (_, _, cat) = r[idx]; - cat - } - Err(_) => GC_Any - } - } - - pub fn grapheme_category(c: char) -> GraphemeCat { - bsearch_range_value_table(c, grapheme_cat_table) - } - - const grapheme_cat_table: &'static [(char, char, GraphemeCat)] = &[ - ('\u{0}', '\u{9}', GC_Control), ('\u{a}', '\u{a}', GC_LF), ('\u{b}', '\u{c}', GC_Control), - ('\u{d}', '\u{d}', GC_CR), ('\u{e}', '\u{1f}', GC_Control), ('\u{7f}', '\u{9f}', - GC_Control), ('\u{ad}', '\u{ad}', GC_Control), ('\u{300}', '\u{36f}', GC_Extend), - ('\u{483}', '\u{489}', GC_Extend), ('\u{591}', '\u{5bd}', GC_Extend), ('\u{5bf}', '\u{5bf}', - GC_Extend), ('\u{5c1}', '\u{5c2}', GC_Extend), ('\u{5c4}', '\u{5c5}', GC_Extend), - ('\u{5c7}', '\u{5c7}', GC_Extend), ('\u{600}', '\u{605}', GC_Prepend), ('\u{610}', - '\u{61a}', GC_Extend), ('\u{61c}', '\u{61c}', GC_Control), ('\u{64b}', '\u{65f}', - GC_Extend), ('\u{670}', '\u{670}', GC_Extend), ('\u{6d6}', '\u{6dc}', GC_Extend), - ('\u{6dd}', '\u{6dd}', GC_Prepend), ('\u{6df}', '\u{6e4}', GC_Extend), ('\u{6e7}', - '\u{6e8}', GC_Extend), ('\u{6ea}', '\u{6ed}', GC_Extend), ('\u{70f}', '\u{70f}', - GC_Prepend), ('\u{711}', '\u{711}', GC_Extend), ('\u{730}', '\u{74a}', GC_Extend), - ('\u{7a6}', '\u{7b0}', GC_Extend), ('\u{7eb}', '\u{7f3}', GC_Extend), ('\u{816}', '\u{819}', - GC_Extend), ('\u{81b}', '\u{823}', GC_Extend), ('\u{825}', '\u{827}', GC_Extend), - ('\u{829}', '\u{82d}', GC_Extend), ('\u{859}', '\u{85b}', GC_Extend), ('\u{8d4}', '\u{8e1}', - GC_Extend), ('\u{8e2}', '\u{8e2}', GC_Prepend), ('\u{8e3}', '\u{902}', GC_Extend), - ('\u{903}', '\u{903}', GC_SpacingMark), ('\u{93a}', '\u{93a}', GC_Extend), ('\u{93b}', - '\u{93b}', GC_SpacingMark), ('\u{93c}', '\u{93c}', GC_Extend), ('\u{93e}', '\u{940}', - GC_SpacingMark), ('\u{941}', '\u{948}', GC_Extend), ('\u{949}', '\u{94c}', GC_SpacingMark), - ('\u{94d}', '\u{94d}', GC_Extend), ('\u{94e}', '\u{94f}', GC_SpacingMark), ('\u{951}', - '\u{957}', GC_Extend), ('\u{962}', '\u{963}', GC_Extend), ('\u{981}', '\u{981}', GC_Extend), - ('\u{982}', '\u{983}', GC_SpacingMark), ('\u{9bc}', '\u{9bc}', GC_Extend), ('\u{9be}', - '\u{9be}', GC_Extend), ('\u{9bf}', '\u{9c0}', GC_SpacingMark), ('\u{9c1}', '\u{9c4}', - GC_Extend), ('\u{9c7}', '\u{9c8}', GC_SpacingMark), ('\u{9cb}', '\u{9cc}', GC_SpacingMark), - ('\u{9cd}', '\u{9cd}', GC_Extend), ('\u{9d7}', '\u{9d7}', GC_Extend), ('\u{9e2}', '\u{9e3}', - GC_Extend), ('\u{a01}', '\u{a02}', GC_Extend), ('\u{a03}', '\u{a03}', GC_SpacingMark), - ('\u{a3c}', '\u{a3c}', GC_Extend), ('\u{a3e}', '\u{a40}', GC_SpacingMark), ('\u{a41}', - '\u{a42}', GC_Extend), ('\u{a47}', '\u{a48}', GC_Extend), ('\u{a4b}', '\u{a4d}', GC_Extend), - ('\u{a51}', '\u{a51}', GC_Extend), ('\u{a70}', '\u{a71}', GC_Extend), ('\u{a75}', '\u{a75}', - GC_Extend), ('\u{a81}', '\u{a82}', GC_Extend), ('\u{a83}', '\u{a83}', GC_SpacingMark), - ('\u{abc}', '\u{abc}', GC_Extend), ('\u{abe}', '\u{ac0}', GC_SpacingMark), ('\u{ac1}', - '\u{ac5}', GC_Extend), ('\u{ac7}', '\u{ac8}', GC_Extend), ('\u{ac9}', '\u{ac9}', - GC_SpacingMark), ('\u{acb}', '\u{acc}', GC_SpacingMark), ('\u{acd}', '\u{acd}', GC_Extend), - ('\u{ae2}', '\u{ae3}', GC_Extend), ('\u{b01}', '\u{b01}', GC_Extend), ('\u{b02}', '\u{b03}', - GC_SpacingMark), ('\u{b3c}', '\u{b3c}', GC_Extend), ('\u{b3e}', '\u{b3f}', GC_Extend), - ('\u{b40}', '\u{b40}', GC_SpacingMark), ('\u{b41}', '\u{b44}', GC_Extend), ('\u{b47}', - '\u{b48}', GC_SpacingMark), ('\u{b4b}', '\u{b4c}', GC_SpacingMark), ('\u{b4d}', '\u{b4d}', - GC_Extend), ('\u{b56}', '\u{b57}', GC_Extend), ('\u{b62}', '\u{b63}', GC_Extend), - ('\u{b82}', '\u{b82}', GC_Extend), ('\u{bbe}', '\u{bbe}', GC_Extend), ('\u{bbf}', '\u{bbf}', - GC_SpacingMark), ('\u{bc0}', '\u{bc0}', GC_Extend), ('\u{bc1}', '\u{bc2}', GC_SpacingMark), - ('\u{bc6}', '\u{bc8}', GC_SpacingMark), ('\u{bca}', '\u{bcc}', GC_SpacingMark), ('\u{bcd}', - '\u{bcd}', GC_Extend), ('\u{bd7}', '\u{bd7}', GC_Extend), ('\u{c00}', '\u{c00}', GC_Extend), - ('\u{c01}', '\u{c03}', GC_SpacingMark), ('\u{c3e}', '\u{c40}', GC_Extend), ('\u{c41}', - '\u{c44}', GC_SpacingMark), ('\u{c46}', '\u{c48}', GC_Extend), ('\u{c4a}', '\u{c4d}', - GC_Extend), ('\u{c55}', '\u{c56}', GC_Extend), ('\u{c62}', '\u{c63}', GC_Extend), - ('\u{c81}', '\u{c81}', GC_Extend), ('\u{c82}', '\u{c83}', GC_SpacingMark), ('\u{cbc}', - '\u{cbc}', GC_Extend), ('\u{cbe}', '\u{cbe}', GC_SpacingMark), ('\u{cbf}', '\u{cbf}', - GC_Extend), ('\u{cc0}', '\u{cc1}', GC_SpacingMark), ('\u{cc2}', '\u{cc2}', GC_Extend), - ('\u{cc3}', '\u{cc4}', GC_SpacingMark), ('\u{cc6}', '\u{cc6}', GC_Extend), ('\u{cc7}', - '\u{cc8}', GC_SpacingMark), ('\u{cca}', '\u{ccb}', GC_SpacingMark), ('\u{ccc}', '\u{ccd}', - GC_Extend), ('\u{cd5}', '\u{cd6}', GC_Extend), ('\u{ce2}', '\u{ce3}', GC_Extend), - ('\u{d01}', '\u{d01}', GC_Extend), ('\u{d02}', '\u{d03}', GC_SpacingMark), ('\u{d3e}', - '\u{d3e}', GC_Extend), ('\u{d3f}', '\u{d40}', GC_SpacingMark), ('\u{d41}', '\u{d44}', - GC_Extend), ('\u{d46}', '\u{d48}', GC_SpacingMark), ('\u{d4a}', '\u{d4c}', GC_SpacingMark), - ('\u{d4d}', '\u{d4d}', GC_Extend), ('\u{d4e}', '\u{d4e}', GC_Prepend), ('\u{d57}', - '\u{d57}', GC_Extend), ('\u{d62}', '\u{d63}', GC_Extend), ('\u{d82}', '\u{d83}', - GC_SpacingMark), ('\u{dca}', '\u{dca}', GC_Extend), ('\u{dcf}', '\u{dcf}', GC_Extend), - ('\u{dd0}', '\u{dd1}', GC_SpacingMark), ('\u{dd2}', '\u{dd4}', GC_Extend), ('\u{dd6}', - '\u{dd6}', GC_Extend), ('\u{dd8}', '\u{dde}', GC_SpacingMark), ('\u{ddf}', '\u{ddf}', - GC_Extend), ('\u{df2}', '\u{df3}', GC_SpacingMark), ('\u{e31}', '\u{e31}', GC_Extend), - ('\u{e33}', '\u{e33}', GC_SpacingMark), ('\u{e34}', '\u{e3a}', GC_Extend), ('\u{e47}', - '\u{e4e}', GC_Extend), ('\u{eb1}', '\u{eb1}', GC_Extend), ('\u{eb3}', '\u{eb3}', - GC_SpacingMark), ('\u{eb4}', '\u{eb9}', GC_Extend), ('\u{ebb}', '\u{ebc}', GC_Extend), - ('\u{ec8}', '\u{ecd}', GC_Extend), ('\u{f18}', '\u{f19}', GC_Extend), ('\u{f35}', '\u{f35}', - GC_Extend), ('\u{f37}', '\u{f37}', GC_Extend), ('\u{f39}', '\u{f39}', GC_Extend), - ('\u{f3e}', '\u{f3f}', GC_SpacingMark), ('\u{f71}', '\u{f7e}', GC_Extend), ('\u{f7f}', - '\u{f7f}', GC_SpacingMark), ('\u{f80}', '\u{f84}', GC_Extend), ('\u{f86}', '\u{f87}', - GC_Extend), ('\u{f8d}', '\u{f97}', GC_Extend), ('\u{f99}', '\u{fbc}', GC_Extend), - ('\u{fc6}', '\u{fc6}', GC_Extend), ('\u{102d}', '\u{1030}', GC_Extend), ('\u{1031}', - '\u{1031}', GC_SpacingMark), ('\u{1032}', '\u{1037}', GC_Extend), ('\u{1039}', '\u{103a}', - GC_Extend), ('\u{103b}', '\u{103c}', GC_SpacingMark), ('\u{103d}', '\u{103e}', GC_Extend), - ('\u{1056}', '\u{1057}', GC_SpacingMark), ('\u{1058}', '\u{1059}', GC_Extend), ('\u{105e}', - '\u{1060}', GC_Extend), ('\u{1071}', '\u{1074}', GC_Extend), ('\u{1082}', '\u{1082}', - GC_Extend), ('\u{1084}', '\u{1084}', GC_SpacingMark), ('\u{1085}', '\u{1086}', GC_Extend), - ('\u{108d}', '\u{108d}', GC_Extend), ('\u{109d}', '\u{109d}', GC_Extend), ('\u{1100}', - '\u{115f}', GC_L), ('\u{1160}', '\u{11a7}', GC_V), ('\u{11a8}', '\u{11ff}', GC_T), - ('\u{135d}', '\u{135f}', GC_Extend), ('\u{1712}', '\u{1714}', GC_Extend), ('\u{1732}', - '\u{1734}', GC_Extend), ('\u{1752}', '\u{1753}', GC_Extend), ('\u{1772}', '\u{1773}', - GC_Extend), ('\u{17b4}', '\u{17b5}', GC_Extend), ('\u{17b6}', '\u{17b6}', GC_SpacingMark), - ('\u{17b7}', '\u{17bd}', GC_Extend), ('\u{17be}', '\u{17c5}', GC_SpacingMark), ('\u{17c6}', - '\u{17c6}', GC_Extend), ('\u{17c7}', '\u{17c8}', GC_SpacingMark), ('\u{17c9}', '\u{17d3}', - GC_Extend), ('\u{17dd}', '\u{17dd}', GC_Extend), ('\u{180b}', '\u{180d}', GC_Extend), - ('\u{180e}', '\u{180e}', GC_Control), ('\u{1885}', '\u{1886}', GC_Extend), ('\u{18a9}', - '\u{18a9}', GC_Extend), ('\u{1920}', '\u{1922}', GC_Extend), ('\u{1923}', '\u{1926}', - GC_SpacingMark), ('\u{1927}', '\u{1928}', GC_Extend), ('\u{1929}', '\u{192b}', - GC_SpacingMark), ('\u{1930}', '\u{1931}', GC_SpacingMark), ('\u{1932}', '\u{1932}', - GC_Extend), ('\u{1933}', '\u{1938}', GC_SpacingMark), ('\u{1939}', '\u{193b}', GC_Extend), - ('\u{1a17}', '\u{1a18}', GC_Extend), ('\u{1a19}', '\u{1a1a}', GC_SpacingMark), ('\u{1a1b}', - '\u{1a1b}', GC_Extend), ('\u{1a55}', '\u{1a55}', GC_SpacingMark), ('\u{1a56}', '\u{1a56}', - GC_Extend), ('\u{1a57}', '\u{1a57}', GC_SpacingMark), ('\u{1a58}', '\u{1a5e}', GC_Extend), - ('\u{1a60}', '\u{1a60}', GC_Extend), ('\u{1a62}', '\u{1a62}', GC_Extend), ('\u{1a65}', - '\u{1a6c}', GC_Extend), ('\u{1a6d}', '\u{1a72}', GC_SpacingMark), ('\u{1a73}', '\u{1a7c}', - GC_Extend), ('\u{1a7f}', '\u{1a7f}', GC_Extend), ('\u{1ab0}', '\u{1abe}', GC_Extend), - ('\u{1b00}', '\u{1b03}', GC_Extend), ('\u{1b04}', '\u{1b04}', GC_SpacingMark), ('\u{1b34}', - '\u{1b34}', GC_Extend), ('\u{1b35}', '\u{1b35}', GC_SpacingMark), ('\u{1b36}', '\u{1b3a}', - GC_Extend), ('\u{1b3b}', '\u{1b3b}', GC_SpacingMark), ('\u{1b3c}', '\u{1b3c}', GC_Extend), - ('\u{1b3d}', '\u{1b41}', GC_SpacingMark), ('\u{1b42}', '\u{1b42}', GC_Extend), ('\u{1b43}', - '\u{1b44}', GC_SpacingMark), ('\u{1b6b}', '\u{1b73}', GC_Extend), ('\u{1b80}', '\u{1b81}', - GC_Extend), ('\u{1b82}', '\u{1b82}', GC_SpacingMark), ('\u{1ba1}', '\u{1ba1}', - GC_SpacingMark), ('\u{1ba2}', '\u{1ba5}', GC_Extend), ('\u{1ba6}', '\u{1ba7}', - GC_SpacingMark), ('\u{1ba8}', '\u{1ba9}', GC_Extend), ('\u{1baa}', '\u{1baa}', - GC_SpacingMark), ('\u{1bab}', '\u{1bad}', GC_Extend), ('\u{1be6}', '\u{1be6}', GC_Extend), - ('\u{1be7}', '\u{1be7}', GC_SpacingMark), ('\u{1be8}', '\u{1be9}', GC_Extend), ('\u{1bea}', - '\u{1bec}', GC_SpacingMark), ('\u{1bed}', '\u{1bed}', GC_Extend), ('\u{1bee}', '\u{1bee}', - GC_SpacingMark), ('\u{1bef}', '\u{1bf1}', GC_Extend), ('\u{1bf2}', '\u{1bf3}', - GC_SpacingMark), ('\u{1c24}', '\u{1c2b}', GC_SpacingMark), ('\u{1c2c}', '\u{1c33}', - GC_Extend), ('\u{1c34}', '\u{1c35}', GC_SpacingMark), ('\u{1c36}', '\u{1c37}', GC_Extend), - ('\u{1cd0}', '\u{1cd2}', GC_Extend), ('\u{1cd4}', '\u{1ce0}', GC_Extend), ('\u{1ce1}', - '\u{1ce1}', GC_SpacingMark), ('\u{1ce2}', '\u{1ce8}', GC_Extend), ('\u{1ced}', '\u{1ced}', - GC_Extend), ('\u{1cf2}', '\u{1cf3}', GC_SpacingMark), ('\u{1cf4}', '\u{1cf4}', GC_Extend), - ('\u{1cf8}', '\u{1cf9}', GC_Extend), ('\u{1dc0}', '\u{1df5}', GC_Extend), ('\u{1dfb}', - '\u{1dff}', GC_Extend), ('\u{200b}', '\u{200b}', GC_Control), ('\u{200c}', '\u{200c}', - GC_Extend), ('\u{200d}', '\u{200d}', GC_ZWJ), ('\u{200e}', '\u{200f}', GC_Control), - ('\u{2028}', '\u{202e}', GC_Control), ('\u{2060}', '\u{206f}', GC_Control), ('\u{20d0}', - '\u{20f0}', GC_Extend), ('\u{261d}', '\u{261d}', GC_E_Base), ('\u{26f9}', '\u{26f9}', - GC_E_Base), ('\u{270a}', '\u{270d}', GC_E_Base), ('\u{2764}', '\u{2764}', - GC_Glue_After_Zwj), ('\u{2cef}', '\u{2cf1}', GC_Extend), ('\u{2d7f}', '\u{2d7f}', - GC_Extend), ('\u{2de0}', '\u{2dff}', GC_Extend), ('\u{302a}', '\u{302f}', GC_Extend), - ('\u{3099}', '\u{309a}', GC_Extend), ('\u{a66f}', '\u{a672}', GC_Extend), ('\u{a674}', - '\u{a67d}', GC_Extend), ('\u{a69e}', '\u{a69f}', GC_Extend), ('\u{a6f0}', '\u{a6f1}', - GC_Extend), ('\u{a802}', '\u{a802}', GC_Extend), ('\u{a806}', '\u{a806}', GC_Extend), - ('\u{a80b}', '\u{a80b}', GC_Extend), ('\u{a823}', '\u{a824}', GC_SpacingMark), ('\u{a825}', - '\u{a826}', GC_Extend), ('\u{a827}', '\u{a827}', GC_SpacingMark), ('\u{a880}', '\u{a881}', - GC_SpacingMark), ('\u{a8b4}', '\u{a8c3}', GC_SpacingMark), ('\u{a8c4}', '\u{a8c5}', - GC_Extend), ('\u{a8e0}', '\u{a8f1}', GC_Extend), ('\u{a926}', '\u{a92d}', GC_Extend), - ('\u{a947}', '\u{a951}', GC_Extend), ('\u{a952}', '\u{a953}', GC_SpacingMark), ('\u{a960}', - '\u{a97c}', GC_L), ('\u{a980}', '\u{a982}', GC_Extend), ('\u{a983}', '\u{a983}', - GC_SpacingMark), ('\u{a9b3}', '\u{a9b3}', GC_Extend), ('\u{a9b4}', '\u{a9b5}', - GC_SpacingMark), ('\u{a9b6}', '\u{a9b9}', GC_Extend), ('\u{a9ba}', '\u{a9bb}', - GC_SpacingMark), ('\u{a9bc}', '\u{a9bc}', GC_Extend), ('\u{a9bd}', '\u{a9c0}', - GC_SpacingMark), ('\u{a9e5}', '\u{a9e5}', GC_Extend), ('\u{aa29}', '\u{aa2e}', GC_Extend), - ('\u{aa2f}', '\u{aa30}', GC_SpacingMark), ('\u{aa31}', '\u{aa32}', GC_Extend), ('\u{aa33}', - '\u{aa34}', GC_SpacingMark), ('\u{aa35}', '\u{aa36}', GC_Extend), ('\u{aa43}', '\u{aa43}', - GC_Extend), ('\u{aa4c}', '\u{aa4c}', GC_Extend), ('\u{aa4d}', '\u{aa4d}', GC_SpacingMark), - ('\u{aa7c}', '\u{aa7c}', GC_Extend), ('\u{aab0}', '\u{aab0}', GC_Extend), ('\u{aab2}', - '\u{aab4}', GC_Extend), ('\u{aab7}', '\u{aab8}', GC_Extend), ('\u{aabe}', '\u{aabf}', - GC_Extend), ('\u{aac1}', '\u{aac1}', GC_Extend), ('\u{aaeb}', '\u{aaeb}', GC_SpacingMark), - ('\u{aaec}', '\u{aaed}', GC_Extend), ('\u{aaee}', '\u{aaef}', GC_SpacingMark), ('\u{aaf5}', - '\u{aaf5}', GC_SpacingMark), ('\u{aaf6}', '\u{aaf6}', GC_Extend), ('\u{abe3}', '\u{abe4}', - GC_SpacingMark), ('\u{abe5}', '\u{abe5}', GC_Extend), ('\u{abe6}', '\u{abe7}', - GC_SpacingMark), ('\u{abe8}', '\u{abe8}', GC_Extend), ('\u{abe9}', '\u{abea}', - GC_SpacingMark), ('\u{abec}', '\u{abec}', GC_SpacingMark), ('\u{abed}', '\u{abed}', - GC_Extend), ('\u{ac00}', '\u{ac00}', GC_LV), ('\u{ac01}', '\u{ac1b}', GC_LVT), ('\u{ac1c}', - '\u{ac1c}', GC_LV), ('\u{ac1d}', '\u{ac37}', GC_LVT), ('\u{ac38}', '\u{ac38}', GC_LV), - ('\u{ac39}', '\u{ac53}', GC_LVT), ('\u{ac54}', '\u{ac54}', GC_LV), ('\u{ac55}', '\u{ac6f}', - GC_LVT), ('\u{ac70}', '\u{ac70}', GC_LV), ('\u{ac71}', '\u{ac8b}', GC_LVT), ('\u{ac8c}', - '\u{ac8c}', GC_LV), ('\u{ac8d}', '\u{aca7}', GC_LVT), ('\u{aca8}', '\u{aca8}', GC_LV), - ('\u{aca9}', '\u{acc3}', GC_LVT), ('\u{acc4}', '\u{acc4}', GC_LV), ('\u{acc5}', '\u{acdf}', - GC_LVT), ('\u{ace0}', '\u{ace0}', GC_LV), ('\u{ace1}', '\u{acfb}', GC_LVT), ('\u{acfc}', - '\u{acfc}', GC_LV), ('\u{acfd}', '\u{ad17}', GC_LVT), ('\u{ad18}', '\u{ad18}', GC_LV), - ('\u{ad19}', '\u{ad33}', GC_LVT), ('\u{ad34}', '\u{ad34}', GC_LV), ('\u{ad35}', '\u{ad4f}', - GC_LVT), ('\u{ad50}', '\u{ad50}', GC_LV), ('\u{ad51}', '\u{ad6b}', GC_LVT), ('\u{ad6c}', - '\u{ad6c}', GC_LV), ('\u{ad6d}', '\u{ad87}', GC_LVT), ('\u{ad88}', '\u{ad88}', GC_LV), - ('\u{ad89}', '\u{ada3}', GC_LVT), ('\u{ada4}', '\u{ada4}', GC_LV), ('\u{ada5}', '\u{adbf}', - GC_LVT), ('\u{adc0}', '\u{adc0}', GC_LV), ('\u{adc1}', '\u{addb}', GC_LVT), ('\u{addc}', - '\u{addc}', GC_LV), ('\u{addd}', '\u{adf7}', GC_LVT), ('\u{adf8}', '\u{adf8}', GC_LV), - ('\u{adf9}', '\u{ae13}', GC_LVT), ('\u{ae14}', '\u{ae14}', GC_LV), ('\u{ae15}', '\u{ae2f}', - GC_LVT), ('\u{ae30}', '\u{ae30}', GC_LV), ('\u{ae31}', '\u{ae4b}', GC_LVT), ('\u{ae4c}', - '\u{ae4c}', GC_LV), ('\u{ae4d}', '\u{ae67}', GC_LVT), ('\u{ae68}', '\u{ae68}', GC_LV), - ('\u{ae69}', '\u{ae83}', GC_LVT), ('\u{ae84}', '\u{ae84}', GC_LV), ('\u{ae85}', '\u{ae9f}', - GC_LVT), ('\u{aea0}', '\u{aea0}', GC_LV), ('\u{aea1}', '\u{aebb}', GC_LVT), ('\u{aebc}', - '\u{aebc}', GC_LV), ('\u{aebd}', '\u{aed7}', GC_LVT), ('\u{aed8}', '\u{aed8}', GC_LV), - ('\u{aed9}', '\u{aef3}', GC_LVT), ('\u{aef4}', '\u{aef4}', GC_LV), ('\u{aef5}', '\u{af0f}', - GC_LVT), ('\u{af10}', '\u{af10}', GC_LV), ('\u{af11}', '\u{af2b}', GC_LVT), ('\u{af2c}', - '\u{af2c}', GC_LV), ('\u{af2d}', '\u{af47}', GC_LVT), ('\u{af48}', '\u{af48}', GC_LV), - ('\u{af49}', '\u{af63}', GC_LVT), ('\u{af64}', '\u{af64}', GC_LV), ('\u{af65}', '\u{af7f}', - GC_LVT), ('\u{af80}', '\u{af80}', GC_LV), ('\u{af81}', '\u{af9b}', GC_LVT), ('\u{af9c}', - '\u{af9c}', GC_LV), ('\u{af9d}', '\u{afb7}', GC_LVT), ('\u{afb8}', '\u{afb8}', GC_LV), - ('\u{afb9}', '\u{afd3}', GC_LVT), ('\u{afd4}', '\u{afd4}', GC_LV), ('\u{afd5}', '\u{afef}', - GC_LVT), ('\u{aff0}', '\u{aff0}', GC_LV), ('\u{aff1}', '\u{b00b}', GC_LVT), ('\u{b00c}', - '\u{b00c}', GC_LV), ('\u{b00d}', '\u{b027}', GC_LVT), ('\u{b028}', '\u{b028}', GC_LV), - ('\u{b029}', '\u{b043}', GC_LVT), ('\u{b044}', '\u{b044}', GC_LV), ('\u{b045}', '\u{b05f}', - GC_LVT), ('\u{b060}', '\u{b060}', GC_LV), ('\u{b061}', '\u{b07b}', GC_LVT), ('\u{b07c}', - '\u{b07c}', GC_LV), ('\u{b07d}', '\u{b097}', GC_LVT), ('\u{b098}', '\u{b098}', GC_LV), - ('\u{b099}', '\u{b0b3}', GC_LVT), ('\u{b0b4}', '\u{b0b4}', GC_LV), ('\u{b0b5}', '\u{b0cf}', - GC_LVT), ('\u{b0d0}', '\u{b0d0}', GC_LV), ('\u{b0d1}', '\u{b0eb}', GC_LVT), ('\u{b0ec}', - '\u{b0ec}', GC_LV), ('\u{b0ed}', '\u{b107}', GC_LVT), ('\u{b108}', '\u{b108}', GC_LV), - ('\u{b109}', '\u{b123}', GC_LVT), ('\u{b124}', '\u{b124}', GC_LV), ('\u{b125}', '\u{b13f}', - GC_LVT), ('\u{b140}', '\u{b140}', GC_LV), ('\u{b141}', '\u{b15b}', GC_LVT), ('\u{b15c}', - '\u{b15c}', GC_LV), ('\u{b15d}', '\u{b177}', GC_LVT), ('\u{b178}', '\u{b178}', GC_LV), - ('\u{b179}', '\u{b193}', GC_LVT), ('\u{b194}', '\u{b194}', GC_LV), ('\u{b195}', '\u{b1af}', - GC_LVT), ('\u{b1b0}', '\u{b1b0}', GC_LV), ('\u{b1b1}', '\u{b1cb}', GC_LVT), ('\u{b1cc}', - '\u{b1cc}', GC_LV), ('\u{b1cd}', '\u{b1e7}', GC_LVT), ('\u{b1e8}', '\u{b1e8}', GC_LV), - ('\u{b1e9}', '\u{b203}', GC_LVT), ('\u{b204}', '\u{b204}', GC_LV), ('\u{b205}', '\u{b21f}', - GC_LVT), ('\u{b220}', '\u{b220}', GC_LV), ('\u{b221}', '\u{b23b}', GC_LVT), ('\u{b23c}', - '\u{b23c}', GC_LV), ('\u{b23d}', '\u{b257}', GC_LVT), ('\u{b258}', '\u{b258}', GC_LV), - ('\u{b259}', '\u{b273}', GC_LVT), ('\u{b274}', '\u{b274}', GC_LV), ('\u{b275}', '\u{b28f}', - GC_LVT), ('\u{b290}', '\u{b290}', GC_LV), ('\u{b291}', '\u{b2ab}', GC_LVT), ('\u{b2ac}', - '\u{b2ac}', GC_LV), ('\u{b2ad}', '\u{b2c7}', GC_LVT), ('\u{b2c8}', '\u{b2c8}', GC_LV), - ('\u{b2c9}', '\u{b2e3}', GC_LVT), ('\u{b2e4}', '\u{b2e4}', GC_LV), ('\u{b2e5}', '\u{b2ff}', - GC_LVT), ('\u{b300}', '\u{b300}', GC_LV), ('\u{b301}', '\u{b31b}', GC_LVT), ('\u{b31c}', - '\u{b31c}', GC_LV), ('\u{b31d}', '\u{b337}', GC_LVT), ('\u{b338}', '\u{b338}', GC_LV), - ('\u{b339}', '\u{b353}', GC_LVT), ('\u{b354}', '\u{b354}', GC_LV), ('\u{b355}', '\u{b36f}', - GC_LVT), ('\u{b370}', '\u{b370}', GC_LV), ('\u{b371}', '\u{b38b}', GC_LVT), ('\u{b38c}', - '\u{b38c}', GC_LV), ('\u{b38d}', '\u{b3a7}', GC_LVT), ('\u{b3a8}', '\u{b3a8}', GC_LV), - ('\u{b3a9}', '\u{b3c3}', GC_LVT), ('\u{b3c4}', '\u{b3c4}', GC_LV), ('\u{b3c5}', '\u{b3df}', - GC_LVT), ('\u{b3e0}', '\u{b3e0}', GC_LV), ('\u{b3e1}', '\u{b3fb}', GC_LVT), ('\u{b3fc}', - '\u{b3fc}', GC_LV), ('\u{b3fd}', '\u{b417}', GC_LVT), ('\u{b418}', '\u{b418}', GC_LV), - ('\u{b419}', '\u{b433}', GC_LVT), ('\u{b434}', '\u{b434}', GC_LV), ('\u{b435}', '\u{b44f}', - GC_LVT), ('\u{b450}', '\u{b450}', GC_LV), ('\u{b451}', '\u{b46b}', GC_LVT), ('\u{b46c}', - '\u{b46c}', GC_LV), ('\u{b46d}', '\u{b487}', GC_LVT), ('\u{b488}', '\u{b488}', GC_LV), - ('\u{b489}', '\u{b4a3}', GC_LVT), ('\u{b4a4}', '\u{b4a4}', GC_LV), ('\u{b4a5}', '\u{b4bf}', - GC_LVT), ('\u{b4c0}', '\u{b4c0}', GC_LV), ('\u{b4c1}', '\u{b4db}', GC_LVT), ('\u{b4dc}', - '\u{b4dc}', GC_LV), ('\u{b4dd}', '\u{b4f7}', GC_LVT), ('\u{b4f8}', '\u{b4f8}', GC_LV), - ('\u{b4f9}', '\u{b513}', GC_LVT), ('\u{b514}', '\u{b514}', GC_LV), ('\u{b515}', '\u{b52f}', - GC_LVT), ('\u{b530}', '\u{b530}', GC_LV), ('\u{b531}', '\u{b54b}', GC_LVT), ('\u{b54c}', - '\u{b54c}', GC_LV), ('\u{b54d}', '\u{b567}', GC_LVT), ('\u{b568}', '\u{b568}', GC_LV), - ('\u{b569}', '\u{b583}', GC_LVT), ('\u{b584}', '\u{b584}', GC_LV), ('\u{b585}', '\u{b59f}', - GC_LVT), ('\u{b5a0}', '\u{b5a0}', GC_LV), ('\u{b5a1}', '\u{b5bb}', GC_LVT), ('\u{b5bc}', - '\u{b5bc}', GC_LV), ('\u{b5bd}', '\u{b5d7}', GC_LVT), ('\u{b5d8}', '\u{b5d8}', GC_LV), - ('\u{b5d9}', '\u{b5f3}', GC_LVT), ('\u{b5f4}', '\u{b5f4}', GC_LV), ('\u{b5f5}', '\u{b60f}', - GC_LVT), ('\u{b610}', '\u{b610}', GC_LV), ('\u{b611}', '\u{b62b}', GC_LVT), ('\u{b62c}', - '\u{b62c}', GC_LV), ('\u{b62d}', '\u{b647}', GC_LVT), ('\u{b648}', '\u{b648}', GC_LV), - ('\u{b649}', '\u{b663}', GC_LVT), ('\u{b664}', '\u{b664}', GC_LV), ('\u{b665}', '\u{b67f}', - GC_LVT), ('\u{b680}', '\u{b680}', GC_LV), ('\u{b681}', '\u{b69b}', GC_LVT), ('\u{b69c}', - '\u{b69c}', GC_LV), ('\u{b69d}', '\u{b6b7}', GC_LVT), ('\u{b6b8}', '\u{b6b8}', GC_LV), - ('\u{b6b9}', '\u{b6d3}', GC_LVT), ('\u{b6d4}', '\u{b6d4}', GC_LV), ('\u{b6d5}', '\u{b6ef}', - GC_LVT), ('\u{b6f0}', '\u{b6f0}', GC_LV), ('\u{b6f1}', '\u{b70b}', GC_LVT), ('\u{b70c}', - '\u{b70c}', GC_LV), ('\u{b70d}', '\u{b727}', GC_LVT), ('\u{b728}', '\u{b728}', GC_LV), - ('\u{b729}', '\u{b743}', GC_LVT), ('\u{b744}', '\u{b744}', GC_LV), ('\u{b745}', '\u{b75f}', - GC_LVT), ('\u{b760}', '\u{b760}', GC_LV), ('\u{b761}', '\u{b77b}', GC_LVT), ('\u{b77c}', - '\u{b77c}', GC_LV), ('\u{b77d}', '\u{b797}', GC_LVT), ('\u{b798}', '\u{b798}', GC_LV), - ('\u{b799}', '\u{b7b3}', GC_LVT), ('\u{b7b4}', '\u{b7b4}', GC_LV), ('\u{b7b5}', '\u{b7cf}', - GC_LVT), ('\u{b7d0}', '\u{b7d0}', GC_LV), ('\u{b7d1}', '\u{b7eb}', GC_LVT), ('\u{b7ec}', - '\u{b7ec}', GC_LV), ('\u{b7ed}', '\u{b807}', GC_LVT), ('\u{b808}', '\u{b808}', GC_LV), - ('\u{b809}', '\u{b823}', GC_LVT), ('\u{b824}', '\u{b824}', GC_LV), ('\u{b825}', '\u{b83f}', - GC_LVT), ('\u{b840}', '\u{b840}', GC_LV), ('\u{b841}', '\u{b85b}', GC_LVT), ('\u{b85c}', - '\u{b85c}', GC_LV), ('\u{b85d}', '\u{b877}', GC_LVT), ('\u{b878}', '\u{b878}', GC_LV), - ('\u{b879}', '\u{b893}', GC_LVT), ('\u{b894}', '\u{b894}', GC_LV), ('\u{b895}', '\u{b8af}', - GC_LVT), ('\u{b8b0}', '\u{b8b0}', GC_LV), ('\u{b8b1}', '\u{b8cb}', GC_LVT), ('\u{b8cc}', - '\u{b8cc}', GC_LV), ('\u{b8cd}', '\u{b8e7}', GC_LVT), ('\u{b8e8}', '\u{b8e8}', GC_LV), - ('\u{b8e9}', '\u{b903}', GC_LVT), ('\u{b904}', '\u{b904}', GC_LV), ('\u{b905}', '\u{b91f}', - GC_LVT), ('\u{b920}', '\u{b920}', GC_LV), ('\u{b921}', '\u{b93b}', GC_LVT), ('\u{b93c}', - '\u{b93c}', GC_LV), ('\u{b93d}', '\u{b957}', GC_LVT), ('\u{b958}', '\u{b958}', GC_LV), - ('\u{b959}', '\u{b973}', GC_LVT), ('\u{b974}', '\u{b974}', GC_LV), ('\u{b975}', '\u{b98f}', - GC_LVT), ('\u{b990}', '\u{b990}', GC_LV), ('\u{b991}', '\u{b9ab}', GC_LVT), ('\u{b9ac}', - '\u{b9ac}', GC_LV), ('\u{b9ad}', '\u{b9c7}', GC_LVT), ('\u{b9c8}', '\u{b9c8}', GC_LV), - ('\u{b9c9}', '\u{b9e3}', GC_LVT), ('\u{b9e4}', '\u{b9e4}', GC_LV), ('\u{b9e5}', '\u{b9ff}', - GC_LVT), ('\u{ba00}', '\u{ba00}', GC_LV), ('\u{ba01}', '\u{ba1b}', GC_LVT), ('\u{ba1c}', - '\u{ba1c}', GC_LV), ('\u{ba1d}', '\u{ba37}', GC_LVT), ('\u{ba38}', '\u{ba38}', GC_LV), - ('\u{ba39}', '\u{ba53}', GC_LVT), ('\u{ba54}', '\u{ba54}', GC_LV), ('\u{ba55}', '\u{ba6f}', - GC_LVT), ('\u{ba70}', '\u{ba70}', GC_LV), ('\u{ba71}', '\u{ba8b}', GC_LVT), ('\u{ba8c}', - '\u{ba8c}', GC_LV), ('\u{ba8d}', '\u{baa7}', GC_LVT), ('\u{baa8}', '\u{baa8}', GC_LV), - ('\u{baa9}', '\u{bac3}', GC_LVT), ('\u{bac4}', '\u{bac4}', GC_LV), ('\u{bac5}', '\u{badf}', - GC_LVT), ('\u{bae0}', '\u{bae0}', GC_LV), ('\u{bae1}', '\u{bafb}', GC_LVT), ('\u{bafc}', - '\u{bafc}', GC_LV), ('\u{bafd}', '\u{bb17}', GC_LVT), ('\u{bb18}', '\u{bb18}', GC_LV), - ('\u{bb19}', '\u{bb33}', GC_LVT), ('\u{bb34}', '\u{bb34}', GC_LV), ('\u{bb35}', '\u{bb4f}', - GC_LVT), ('\u{bb50}', '\u{bb50}', GC_LV), ('\u{bb51}', '\u{bb6b}', GC_LVT), ('\u{bb6c}', - '\u{bb6c}', GC_LV), ('\u{bb6d}', '\u{bb87}', GC_LVT), ('\u{bb88}', '\u{bb88}', GC_LV), - ('\u{bb89}', '\u{bba3}', GC_LVT), ('\u{bba4}', '\u{bba4}', GC_LV), ('\u{bba5}', '\u{bbbf}', - GC_LVT), ('\u{bbc0}', '\u{bbc0}', GC_LV), ('\u{bbc1}', '\u{bbdb}', GC_LVT), ('\u{bbdc}', - '\u{bbdc}', GC_LV), ('\u{bbdd}', '\u{bbf7}', GC_LVT), ('\u{bbf8}', '\u{bbf8}', GC_LV), - ('\u{bbf9}', '\u{bc13}', GC_LVT), ('\u{bc14}', '\u{bc14}', GC_LV), ('\u{bc15}', '\u{bc2f}', - GC_LVT), ('\u{bc30}', '\u{bc30}', GC_LV), ('\u{bc31}', '\u{bc4b}', GC_LVT), ('\u{bc4c}', - '\u{bc4c}', GC_LV), ('\u{bc4d}', '\u{bc67}', GC_LVT), ('\u{bc68}', '\u{bc68}', GC_LV), - ('\u{bc69}', '\u{bc83}', GC_LVT), ('\u{bc84}', '\u{bc84}', GC_LV), ('\u{bc85}', '\u{bc9f}', - GC_LVT), ('\u{bca0}', '\u{bca0}', GC_LV), ('\u{bca1}', '\u{bcbb}', GC_LVT), ('\u{bcbc}', - '\u{bcbc}', GC_LV), ('\u{bcbd}', '\u{bcd7}', GC_LVT), ('\u{bcd8}', '\u{bcd8}', GC_LV), - ('\u{bcd9}', '\u{bcf3}', GC_LVT), ('\u{bcf4}', '\u{bcf4}', GC_LV), ('\u{bcf5}', '\u{bd0f}', - GC_LVT), ('\u{bd10}', '\u{bd10}', GC_LV), ('\u{bd11}', '\u{bd2b}', GC_LVT), ('\u{bd2c}', - '\u{bd2c}', GC_LV), ('\u{bd2d}', '\u{bd47}', GC_LVT), ('\u{bd48}', '\u{bd48}', GC_LV), - ('\u{bd49}', '\u{bd63}', GC_LVT), ('\u{bd64}', '\u{bd64}', GC_LV), ('\u{bd65}', '\u{bd7f}', - GC_LVT), ('\u{bd80}', '\u{bd80}', GC_LV), ('\u{bd81}', '\u{bd9b}', GC_LVT), ('\u{bd9c}', - '\u{bd9c}', GC_LV), ('\u{bd9d}', '\u{bdb7}', GC_LVT), ('\u{bdb8}', '\u{bdb8}', GC_LV), - ('\u{bdb9}', '\u{bdd3}', GC_LVT), ('\u{bdd4}', '\u{bdd4}', GC_LV), ('\u{bdd5}', '\u{bdef}', - GC_LVT), ('\u{bdf0}', '\u{bdf0}', GC_LV), ('\u{bdf1}', '\u{be0b}', GC_LVT), ('\u{be0c}', - '\u{be0c}', GC_LV), ('\u{be0d}', '\u{be27}', GC_LVT), ('\u{be28}', '\u{be28}', GC_LV), - ('\u{be29}', '\u{be43}', GC_LVT), ('\u{be44}', '\u{be44}', GC_LV), ('\u{be45}', '\u{be5f}', - GC_LVT), ('\u{be60}', '\u{be60}', GC_LV), ('\u{be61}', '\u{be7b}', GC_LVT), ('\u{be7c}', - '\u{be7c}', GC_LV), ('\u{be7d}', '\u{be97}', GC_LVT), ('\u{be98}', '\u{be98}', GC_LV), - ('\u{be99}', '\u{beb3}', GC_LVT), ('\u{beb4}', '\u{beb4}', GC_LV), ('\u{beb5}', '\u{becf}', - GC_LVT), ('\u{bed0}', '\u{bed0}', GC_LV), ('\u{bed1}', '\u{beeb}', GC_LVT), ('\u{beec}', - '\u{beec}', GC_LV), ('\u{beed}', '\u{bf07}', GC_LVT), ('\u{bf08}', '\u{bf08}', GC_LV), - ('\u{bf09}', '\u{bf23}', GC_LVT), ('\u{bf24}', '\u{bf24}', GC_LV), ('\u{bf25}', '\u{bf3f}', - GC_LVT), ('\u{bf40}', '\u{bf40}', GC_LV), ('\u{bf41}', '\u{bf5b}', GC_LVT), ('\u{bf5c}', - '\u{bf5c}', GC_LV), ('\u{bf5d}', '\u{bf77}', GC_LVT), ('\u{bf78}', '\u{bf78}', GC_LV), - ('\u{bf79}', '\u{bf93}', GC_LVT), ('\u{bf94}', '\u{bf94}', GC_LV), ('\u{bf95}', '\u{bfaf}', - GC_LVT), ('\u{bfb0}', '\u{bfb0}', GC_LV), ('\u{bfb1}', '\u{bfcb}', GC_LVT), ('\u{bfcc}', - '\u{bfcc}', GC_LV), ('\u{bfcd}', '\u{bfe7}', GC_LVT), ('\u{bfe8}', '\u{bfe8}', GC_LV), - ('\u{bfe9}', '\u{c003}', GC_LVT), ('\u{c004}', '\u{c004}', GC_LV), ('\u{c005}', '\u{c01f}', - GC_LVT), ('\u{c020}', '\u{c020}', GC_LV), ('\u{c021}', '\u{c03b}', GC_LVT), ('\u{c03c}', - '\u{c03c}', GC_LV), ('\u{c03d}', '\u{c057}', GC_LVT), ('\u{c058}', '\u{c058}', GC_LV), - ('\u{c059}', '\u{c073}', GC_LVT), ('\u{c074}', '\u{c074}', GC_LV), ('\u{c075}', '\u{c08f}', - GC_LVT), ('\u{c090}', '\u{c090}', GC_LV), ('\u{c091}', '\u{c0ab}', GC_LVT), ('\u{c0ac}', - '\u{c0ac}', GC_LV), ('\u{c0ad}', '\u{c0c7}', GC_LVT), ('\u{c0c8}', '\u{c0c8}', GC_LV), - ('\u{c0c9}', '\u{c0e3}', GC_LVT), ('\u{c0e4}', '\u{c0e4}', GC_LV), ('\u{c0e5}', '\u{c0ff}', - GC_LVT), ('\u{c100}', '\u{c100}', GC_LV), ('\u{c101}', '\u{c11b}', GC_LVT), ('\u{c11c}', - '\u{c11c}', GC_LV), ('\u{c11d}', '\u{c137}', GC_LVT), ('\u{c138}', '\u{c138}', GC_LV), - ('\u{c139}', '\u{c153}', GC_LVT), ('\u{c154}', '\u{c154}', GC_LV), ('\u{c155}', '\u{c16f}', - GC_LVT), ('\u{c170}', '\u{c170}', GC_LV), ('\u{c171}', '\u{c18b}', GC_LVT), ('\u{c18c}', - '\u{c18c}', GC_LV), ('\u{c18d}', '\u{c1a7}', GC_LVT), ('\u{c1a8}', '\u{c1a8}', GC_LV), - ('\u{c1a9}', '\u{c1c3}', GC_LVT), ('\u{c1c4}', '\u{c1c4}', GC_LV), ('\u{c1c5}', '\u{c1df}', - GC_LVT), ('\u{c1e0}', '\u{c1e0}', GC_LV), ('\u{c1e1}', '\u{c1fb}', GC_LVT), ('\u{c1fc}', - '\u{c1fc}', GC_LV), ('\u{c1fd}', '\u{c217}', GC_LVT), ('\u{c218}', '\u{c218}', GC_LV), - ('\u{c219}', '\u{c233}', GC_LVT), ('\u{c234}', '\u{c234}', GC_LV), ('\u{c235}', '\u{c24f}', - GC_LVT), ('\u{c250}', '\u{c250}', GC_LV), ('\u{c251}', '\u{c26b}', GC_LVT), ('\u{c26c}', - '\u{c26c}', GC_LV), ('\u{c26d}', '\u{c287}', GC_LVT), ('\u{c288}', '\u{c288}', GC_LV), - ('\u{c289}', '\u{c2a3}', GC_LVT), ('\u{c2a4}', '\u{c2a4}', GC_LV), ('\u{c2a5}', '\u{c2bf}', - GC_LVT), ('\u{c2c0}', '\u{c2c0}', GC_LV), ('\u{c2c1}', '\u{c2db}', GC_LVT), ('\u{c2dc}', - '\u{c2dc}', GC_LV), ('\u{c2dd}', '\u{c2f7}', GC_LVT), ('\u{c2f8}', '\u{c2f8}', GC_LV), - ('\u{c2f9}', '\u{c313}', GC_LVT), ('\u{c314}', '\u{c314}', GC_LV), ('\u{c315}', '\u{c32f}', - GC_LVT), ('\u{c330}', '\u{c330}', GC_LV), ('\u{c331}', '\u{c34b}', GC_LVT), ('\u{c34c}', - '\u{c34c}', GC_LV), ('\u{c34d}', '\u{c367}', GC_LVT), ('\u{c368}', '\u{c368}', GC_LV), - ('\u{c369}', '\u{c383}', GC_LVT), ('\u{c384}', '\u{c384}', GC_LV), ('\u{c385}', '\u{c39f}', - GC_LVT), ('\u{c3a0}', '\u{c3a0}', GC_LV), ('\u{c3a1}', '\u{c3bb}', GC_LVT), ('\u{c3bc}', - '\u{c3bc}', GC_LV), ('\u{c3bd}', '\u{c3d7}', GC_LVT), ('\u{c3d8}', '\u{c3d8}', GC_LV), - ('\u{c3d9}', '\u{c3f3}', GC_LVT), ('\u{c3f4}', '\u{c3f4}', GC_LV), ('\u{c3f5}', '\u{c40f}', - GC_LVT), ('\u{c410}', '\u{c410}', GC_LV), ('\u{c411}', '\u{c42b}', GC_LVT), ('\u{c42c}', - '\u{c42c}', GC_LV), ('\u{c42d}', '\u{c447}', GC_LVT), ('\u{c448}', '\u{c448}', GC_LV), - ('\u{c449}', '\u{c463}', GC_LVT), ('\u{c464}', '\u{c464}', GC_LV), ('\u{c465}', '\u{c47f}', - GC_LVT), ('\u{c480}', '\u{c480}', GC_LV), ('\u{c481}', '\u{c49b}', GC_LVT), ('\u{c49c}', - '\u{c49c}', GC_LV), ('\u{c49d}', '\u{c4b7}', GC_LVT), ('\u{c4b8}', '\u{c4b8}', GC_LV), - ('\u{c4b9}', '\u{c4d3}', GC_LVT), ('\u{c4d4}', '\u{c4d4}', GC_LV), ('\u{c4d5}', '\u{c4ef}', - GC_LVT), ('\u{c4f0}', '\u{c4f0}', GC_LV), ('\u{c4f1}', '\u{c50b}', GC_LVT), ('\u{c50c}', - '\u{c50c}', GC_LV), ('\u{c50d}', '\u{c527}', GC_LVT), ('\u{c528}', '\u{c528}', GC_LV), - ('\u{c529}', '\u{c543}', GC_LVT), ('\u{c544}', '\u{c544}', GC_LV), ('\u{c545}', '\u{c55f}', - GC_LVT), ('\u{c560}', '\u{c560}', GC_LV), ('\u{c561}', '\u{c57b}', GC_LVT), ('\u{c57c}', - '\u{c57c}', GC_LV), ('\u{c57d}', '\u{c597}', GC_LVT), ('\u{c598}', '\u{c598}', GC_LV), - ('\u{c599}', '\u{c5b3}', GC_LVT), ('\u{c5b4}', '\u{c5b4}', GC_LV), ('\u{c5b5}', '\u{c5cf}', - GC_LVT), ('\u{c5d0}', '\u{c5d0}', GC_LV), ('\u{c5d1}', '\u{c5eb}', GC_LVT), ('\u{c5ec}', - '\u{c5ec}', GC_LV), ('\u{c5ed}', '\u{c607}', GC_LVT), ('\u{c608}', '\u{c608}', GC_LV), - ('\u{c609}', '\u{c623}', GC_LVT), ('\u{c624}', '\u{c624}', GC_LV), ('\u{c625}', '\u{c63f}', - GC_LVT), ('\u{c640}', '\u{c640}', GC_LV), ('\u{c641}', '\u{c65b}', GC_LVT), ('\u{c65c}', - '\u{c65c}', GC_LV), ('\u{c65d}', '\u{c677}', GC_LVT), ('\u{c678}', '\u{c678}', GC_LV), - ('\u{c679}', '\u{c693}', GC_LVT), ('\u{c694}', '\u{c694}', GC_LV), ('\u{c695}', '\u{c6af}', - GC_LVT), ('\u{c6b0}', '\u{c6b0}', GC_LV), ('\u{c6b1}', '\u{c6cb}', GC_LVT), ('\u{c6cc}', - '\u{c6cc}', GC_LV), ('\u{c6cd}', '\u{c6e7}', GC_LVT), ('\u{c6e8}', '\u{c6e8}', GC_LV), - ('\u{c6e9}', '\u{c703}', GC_LVT), ('\u{c704}', '\u{c704}', GC_LV), ('\u{c705}', '\u{c71f}', - GC_LVT), ('\u{c720}', '\u{c720}', GC_LV), ('\u{c721}', '\u{c73b}', GC_LVT), ('\u{c73c}', - '\u{c73c}', GC_LV), ('\u{c73d}', '\u{c757}', GC_LVT), ('\u{c758}', '\u{c758}', GC_LV), - ('\u{c759}', '\u{c773}', GC_LVT), ('\u{c774}', '\u{c774}', GC_LV), ('\u{c775}', '\u{c78f}', - GC_LVT), ('\u{c790}', '\u{c790}', GC_LV), ('\u{c791}', '\u{c7ab}', GC_LVT), ('\u{c7ac}', - '\u{c7ac}', GC_LV), ('\u{c7ad}', '\u{c7c7}', GC_LVT), ('\u{c7c8}', '\u{c7c8}', GC_LV), - ('\u{c7c9}', '\u{c7e3}', GC_LVT), ('\u{c7e4}', '\u{c7e4}', GC_LV), ('\u{c7e5}', '\u{c7ff}', - GC_LVT), ('\u{c800}', '\u{c800}', GC_LV), ('\u{c801}', '\u{c81b}', GC_LVT), ('\u{c81c}', - '\u{c81c}', GC_LV), ('\u{c81d}', '\u{c837}', GC_LVT), ('\u{c838}', '\u{c838}', GC_LV), - ('\u{c839}', '\u{c853}', GC_LVT), ('\u{c854}', '\u{c854}', GC_LV), ('\u{c855}', '\u{c86f}', - GC_LVT), ('\u{c870}', '\u{c870}', GC_LV), ('\u{c871}', '\u{c88b}', GC_LVT), ('\u{c88c}', - '\u{c88c}', GC_LV), ('\u{c88d}', '\u{c8a7}', GC_LVT), ('\u{c8a8}', '\u{c8a8}', GC_LV), - ('\u{c8a9}', '\u{c8c3}', GC_LVT), ('\u{c8c4}', '\u{c8c4}', GC_LV), ('\u{c8c5}', '\u{c8df}', - GC_LVT), ('\u{c8e0}', '\u{c8e0}', GC_LV), ('\u{c8e1}', '\u{c8fb}', GC_LVT), ('\u{c8fc}', - '\u{c8fc}', GC_LV), ('\u{c8fd}', '\u{c917}', GC_LVT), ('\u{c918}', '\u{c918}', GC_LV), - ('\u{c919}', '\u{c933}', GC_LVT), ('\u{c934}', '\u{c934}', GC_LV), ('\u{c935}', '\u{c94f}', - GC_LVT), ('\u{c950}', '\u{c950}', GC_LV), ('\u{c951}', '\u{c96b}', GC_LVT), ('\u{c96c}', - '\u{c96c}', GC_LV), ('\u{c96d}', '\u{c987}', GC_LVT), ('\u{c988}', '\u{c988}', GC_LV), - ('\u{c989}', '\u{c9a3}', GC_LVT), ('\u{c9a4}', '\u{c9a4}', GC_LV), ('\u{c9a5}', '\u{c9bf}', - GC_LVT), ('\u{c9c0}', '\u{c9c0}', GC_LV), ('\u{c9c1}', '\u{c9db}', GC_LVT), ('\u{c9dc}', - '\u{c9dc}', GC_LV), ('\u{c9dd}', '\u{c9f7}', GC_LVT), ('\u{c9f8}', '\u{c9f8}', GC_LV), - ('\u{c9f9}', '\u{ca13}', GC_LVT), ('\u{ca14}', '\u{ca14}', GC_LV), ('\u{ca15}', '\u{ca2f}', - GC_LVT), ('\u{ca30}', '\u{ca30}', GC_LV), ('\u{ca31}', '\u{ca4b}', GC_LVT), ('\u{ca4c}', - '\u{ca4c}', GC_LV), ('\u{ca4d}', '\u{ca67}', GC_LVT), ('\u{ca68}', '\u{ca68}', GC_LV), - ('\u{ca69}', '\u{ca83}', GC_LVT), ('\u{ca84}', '\u{ca84}', GC_LV), ('\u{ca85}', '\u{ca9f}', - GC_LVT), ('\u{caa0}', '\u{caa0}', GC_LV), ('\u{caa1}', '\u{cabb}', GC_LVT), ('\u{cabc}', - '\u{cabc}', GC_LV), ('\u{cabd}', '\u{cad7}', GC_LVT), ('\u{cad8}', '\u{cad8}', GC_LV), - ('\u{cad9}', '\u{caf3}', GC_LVT), ('\u{caf4}', '\u{caf4}', GC_LV), ('\u{caf5}', '\u{cb0f}', - GC_LVT), ('\u{cb10}', '\u{cb10}', GC_LV), ('\u{cb11}', '\u{cb2b}', GC_LVT), ('\u{cb2c}', - '\u{cb2c}', GC_LV), ('\u{cb2d}', '\u{cb47}', GC_LVT), ('\u{cb48}', '\u{cb48}', GC_LV), - ('\u{cb49}', '\u{cb63}', GC_LVT), ('\u{cb64}', '\u{cb64}', GC_LV), ('\u{cb65}', '\u{cb7f}', - GC_LVT), ('\u{cb80}', '\u{cb80}', GC_LV), ('\u{cb81}', '\u{cb9b}', GC_LVT), ('\u{cb9c}', - '\u{cb9c}', GC_LV), ('\u{cb9d}', '\u{cbb7}', GC_LVT), ('\u{cbb8}', '\u{cbb8}', GC_LV), - ('\u{cbb9}', '\u{cbd3}', GC_LVT), ('\u{cbd4}', '\u{cbd4}', GC_LV), ('\u{cbd5}', '\u{cbef}', - GC_LVT), ('\u{cbf0}', '\u{cbf0}', GC_LV), ('\u{cbf1}', '\u{cc0b}', GC_LVT), ('\u{cc0c}', - '\u{cc0c}', GC_LV), ('\u{cc0d}', '\u{cc27}', GC_LVT), ('\u{cc28}', '\u{cc28}', GC_LV), - ('\u{cc29}', '\u{cc43}', GC_LVT), ('\u{cc44}', '\u{cc44}', GC_LV), ('\u{cc45}', '\u{cc5f}', - GC_LVT), ('\u{cc60}', '\u{cc60}', GC_LV), ('\u{cc61}', '\u{cc7b}', GC_LVT), ('\u{cc7c}', - '\u{cc7c}', GC_LV), ('\u{cc7d}', '\u{cc97}', GC_LVT), ('\u{cc98}', '\u{cc98}', GC_LV), - ('\u{cc99}', '\u{ccb3}', GC_LVT), ('\u{ccb4}', '\u{ccb4}', GC_LV), ('\u{ccb5}', '\u{cccf}', - GC_LVT), ('\u{ccd0}', '\u{ccd0}', GC_LV), ('\u{ccd1}', '\u{cceb}', GC_LVT), ('\u{ccec}', - '\u{ccec}', GC_LV), ('\u{cced}', '\u{cd07}', GC_LVT), ('\u{cd08}', '\u{cd08}', GC_LV), - ('\u{cd09}', '\u{cd23}', GC_LVT), ('\u{cd24}', '\u{cd24}', GC_LV), ('\u{cd25}', '\u{cd3f}', - GC_LVT), ('\u{cd40}', '\u{cd40}', GC_LV), ('\u{cd41}', '\u{cd5b}', GC_LVT), ('\u{cd5c}', - '\u{cd5c}', GC_LV), ('\u{cd5d}', '\u{cd77}', GC_LVT), ('\u{cd78}', '\u{cd78}', GC_LV), - ('\u{cd79}', '\u{cd93}', GC_LVT), ('\u{cd94}', '\u{cd94}', GC_LV), ('\u{cd95}', '\u{cdaf}', - GC_LVT), ('\u{cdb0}', '\u{cdb0}', GC_LV), ('\u{cdb1}', '\u{cdcb}', GC_LVT), ('\u{cdcc}', - '\u{cdcc}', GC_LV), ('\u{cdcd}', '\u{cde7}', GC_LVT), ('\u{cde8}', '\u{cde8}', GC_LV), - ('\u{cde9}', '\u{ce03}', GC_LVT), ('\u{ce04}', '\u{ce04}', GC_LV), ('\u{ce05}', '\u{ce1f}', - GC_LVT), ('\u{ce20}', '\u{ce20}', GC_LV), ('\u{ce21}', '\u{ce3b}', GC_LVT), ('\u{ce3c}', - '\u{ce3c}', GC_LV), ('\u{ce3d}', '\u{ce57}', GC_LVT), ('\u{ce58}', '\u{ce58}', GC_LV), - ('\u{ce59}', '\u{ce73}', GC_LVT), ('\u{ce74}', '\u{ce74}', GC_LV), ('\u{ce75}', '\u{ce8f}', - GC_LVT), ('\u{ce90}', '\u{ce90}', GC_LV), ('\u{ce91}', '\u{ceab}', GC_LVT), ('\u{ceac}', - '\u{ceac}', GC_LV), ('\u{cead}', '\u{cec7}', GC_LVT), ('\u{cec8}', '\u{cec8}', GC_LV), - ('\u{cec9}', '\u{cee3}', GC_LVT), ('\u{cee4}', '\u{cee4}', GC_LV), ('\u{cee5}', '\u{ceff}', - GC_LVT), ('\u{cf00}', '\u{cf00}', GC_LV), ('\u{cf01}', '\u{cf1b}', GC_LVT), ('\u{cf1c}', - '\u{cf1c}', GC_LV), ('\u{cf1d}', '\u{cf37}', GC_LVT), ('\u{cf38}', '\u{cf38}', GC_LV), - ('\u{cf39}', '\u{cf53}', GC_LVT), ('\u{cf54}', '\u{cf54}', GC_LV), ('\u{cf55}', '\u{cf6f}', - GC_LVT), ('\u{cf70}', '\u{cf70}', GC_LV), ('\u{cf71}', '\u{cf8b}', GC_LVT), ('\u{cf8c}', - '\u{cf8c}', GC_LV), ('\u{cf8d}', '\u{cfa7}', GC_LVT), ('\u{cfa8}', '\u{cfa8}', GC_LV), - ('\u{cfa9}', '\u{cfc3}', GC_LVT), ('\u{cfc4}', '\u{cfc4}', GC_LV), ('\u{cfc5}', '\u{cfdf}', - GC_LVT), ('\u{cfe0}', '\u{cfe0}', GC_LV), ('\u{cfe1}', '\u{cffb}', GC_LVT), ('\u{cffc}', - '\u{cffc}', GC_LV), ('\u{cffd}', '\u{d017}', GC_LVT), ('\u{d018}', '\u{d018}', GC_LV), - ('\u{d019}', '\u{d033}', GC_LVT), ('\u{d034}', '\u{d034}', GC_LV), ('\u{d035}', '\u{d04f}', - GC_LVT), ('\u{d050}', '\u{d050}', GC_LV), ('\u{d051}', '\u{d06b}', GC_LVT), ('\u{d06c}', - '\u{d06c}', GC_LV), ('\u{d06d}', '\u{d087}', GC_LVT), ('\u{d088}', '\u{d088}', GC_LV), - ('\u{d089}', '\u{d0a3}', GC_LVT), ('\u{d0a4}', '\u{d0a4}', GC_LV), ('\u{d0a5}', '\u{d0bf}', - GC_LVT), ('\u{d0c0}', '\u{d0c0}', GC_LV), ('\u{d0c1}', '\u{d0db}', GC_LVT), ('\u{d0dc}', - '\u{d0dc}', GC_LV), ('\u{d0dd}', '\u{d0f7}', GC_LVT), ('\u{d0f8}', '\u{d0f8}', GC_LV), - ('\u{d0f9}', '\u{d113}', GC_LVT), ('\u{d114}', '\u{d114}', GC_LV), ('\u{d115}', '\u{d12f}', - GC_LVT), ('\u{d130}', '\u{d130}', GC_LV), ('\u{d131}', '\u{d14b}', GC_LVT), ('\u{d14c}', - '\u{d14c}', GC_LV), ('\u{d14d}', '\u{d167}', GC_LVT), ('\u{d168}', '\u{d168}', GC_LV), - ('\u{d169}', '\u{d183}', GC_LVT), ('\u{d184}', '\u{d184}', GC_LV), ('\u{d185}', '\u{d19f}', - GC_LVT), ('\u{d1a0}', '\u{d1a0}', GC_LV), ('\u{d1a1}', '\u{d1bb}', GC_LVT), ('\u{d1bc}', - '\u{d1bc}', GC_LV), ('\u{d1bd}', '\u{d1d7}', GC_LVT), ('\u{d1d8}', '\u{d1d8}', GC_LV), - ('\u{d1d9}', '\u{d1f3}', GC_LVT), ('\u{d1f4}', '\u{d1f4}', GC_LV), ('\u{d1f5}', '\u{d20f}', - GC_LVT), ('\u{d210}', '\u{d210}', GC_LV), ('\u{d211}', '\u{d22b}', GC_LVT), ('\u{d22c}', - '\u{d22c}', GC_LV), ('\u{d22d}', '\u{d247}', GC_LVT), ('\u{d248}', '\u{d248}', GC_LV), - ('\u{d249}', '\u{d263}', GC_LVT), ('\u{d264}', '\u{d264}', GC_LV), ('\u{d265}', '\u{d27f}', - GC_LVT), ('\u{d280}', '\u{d280}', GC_LV), ('\u{d281}', '\u{d29b}', GC_LVT), ('\u{d29c}', - '\u{d29c}', GC_LV), ('\u{d29d}', '\u{d2b7}', GC_LVT), ('\u{d2b8}', '\u{d2b8}', GC_LV), - ('\u{d2b9}', '\u{d2d3}', GC_LVT), ('\u{d2d4}', '\u{d2d4}', GC_LV), ('\u{d2d5}', '\u{d2ef}', - GC_LVT), ('\u{d2f0}', '\u{d2f0}', GC_LV), ('\u{d2f1}', '\u{d30b}', GC_LVT), ('\u{d30c}', - '\u{d30c}', GC_LV), ('\u{d30d}', '\u{d327}', GC_LVT), ('\u{d328}', '\u{d328}', GC_LV), - ('\u{d329}', '\u{d343}', GC_LVT), ('\u{d344}', '\u{d344}', GC_LV), ('\u{d345}', '\u{d35f}', - GC_LVT), ('\u{d360}', '\u{d360}', GC_LV), ('\u{d361}', '\u{d37b}', GC_LVT), ('\u{d37c}', - '\u{d37c}', GC_LV), ('\u{d37d}', '\u{d397}', GC_LVT), ('\u{d398}', '\u{d398}', GC_LV), - ('\u{d399}', '\u{d3b3}', GC_LVT), ('\u{d3b4}', '\u{d3b4}', GC_LV), ('\u{d3b5}', '\u{d3cf}', - GC_LVT), ('\u{d3d0}', '\u{d3d0}', GC_LV), ('\u{d3d1}', '\u{d3eb}', GC_LVT), ('\u{d3ec}', - '\u{d3ec}', GC_LV), ('\u{d3ed}', '\u{d407}', GC_LVT), ('\u{d408}', '\u{d408}', GC_LV), - ('\u{d409}', '\u{d423}', GC_LVT), ('\u{d424}', '\u{d424}', GC_LV), ('\u{d425}', '\u{d43f}', - GC_LVT), ('\u{d440}', '\u{d440}', GC_LV), ('\u{d441}', '\u{d45b}', GC_LVT), ('\u{d45c}', - '\u{d45c}', GC_LV), ('\u{d45d}', '\u{d477}', GC_LVT), ('\u{d478}', '\u{d478}', GC_LV), - ('\u{d479}', '\u{d493}', GC_LVT), ('\u{d494}', '\u{d494}', GC_LV), ('\u{d495}', '\u{d4af}', - GC_LVT), ('\u{d4b0}', '\u{d4b0}', GC_LV), ('\u{d4b1}', '\u{d4cb}', GC_LVT), ('\u{d4cc}', - '\u{d4cc}', GC_LV), ('\u{d4cd}', '\u{d4e7}', GC_LVT), ('\u{d4e8}', '\u{d4e8}', GC_LV), - ('\u{d4e9}', '\u{d503}', GC_LVT), ('\u{d504}', '\u{d504}', GC_LV), ('\u{d505}', '\u{d51f}', - GC_LVT), ('\u{d520}', '\u{d520}', GC_LV), ('\u{d521}', '\u{d53b}', GC_LVT), ('\u{d53c}', - '\u{d53c}', GC_LV), ('\u{d53d}', '\u{d557}', GC_LVT), ('\u{d558}', '\u{d558}', GC_LV), - ('\u{d559}', '\u{d573}', GC_LVT), ('\u{d574}', '\u{d574}', GC_LV), ('\u{d575}', '\u{d58f}', - GC_LVT), ('\u{d590}', '\u{d590}', GC_LV), ('\u{d591}', '\u{d5ab}', GC_LVT), ('\u{d5ac}', - '\u{d5ac}', GC_LV), ('\u{d5ad}', '\u{d5c7}', GC_LVT), ('\u{d5c8}', '\u{d5c8}', GC_LV), - ('\u{d5c9}', '\u{d5e3}', GC_LVT), ('\u{d5e4}', '\u{d5e4}', GC_LV), ('\u{d5e5}', '\u{d5ff}', - GC_LVT), ('\u{d600}', '\u{d600}', GC_LV), ('\u{d601}', '\u{d61b}', GC_LVT), ('\u{d61c}', - '\u{d61c}', GC_LV), ('\u{d61d}', '\u{d637}', GC_LVT), ('\u{d638}', '\u{d638}', GC_LV), - ('\u{d639}', '\u{d653}', GC_LVT), ('\u{d654}', '\u{d654}', GC_LV), ('\u{d655}', '\u{d66f}', - GC_LVT), ('\u{d670}', '\u{d670}', GC_LV), ('\u{d671}', '\u{d68b}', GC_LVT), ('\u{d68c}', - '\u{d68c}', GC_LV), ('\u{d68d}', '\u{d6a7}', GC_LVT), ('\u{d6a8}', '\u{d6a8}', GC_LV), - ('\u{d6a9}', '\u{d6c3}', GC_LVT), ('\u{d6c4}', '\u{d6c4}', GC_LV), ('\u{d6c5}', '\u{d6df}', - GC_LVT), ('\u{d6e0}', '\u{d6e0}', GC_LV), ('\u{d6e1}', '\u{d6fb}', GC_LVT), ('\u{d6fc}', - '\u{d6fc}', GC_LV), ('\u{d6fd}', '\u{d717}', GC_LVT), ('\u{d718}', '\u{d718}', GC_LV), - ('\u{d719}', '\u{d733}', GC_LVT), ('\u{d734}', '\u{d734}', GC_LV), ('\u{d735}', '\u{d74f}', - GC_LVT), ('\u{d750}', '\u{d750}', GC_LV), ('\u{d751}', '\u{d76b}', GC_LVT), ('\u{d76c}', - '\u{d76c}', GC_LV), ('\u{d76d}', '\u{d787}', GC_LVT), ('\u{d788}', '\u{d788}', GC_LV), - ('\u{d789}', '\u{d7a3}', GC_LVT), ('\u{d7b0}', '\u{d7c6}', GC_V), ('\u{d7cb}', '\u{d7fb}', - GC_T), ('\u{fb1e}', '\u{fb1e}', GC_Extend), ('\u{fe00}', '\u{fe0f}', GC_Extend), - ('\u{fe20}', '\u{fe2f}', GC_Extend), ('\u{feff}', '\u{feff}', GC_Control), ('\u{ff9e}', - '\u{ff9f}', GC_Extend), ('\u{fff0}', '\u{fffb}', GC_Control), ('\u{101fd}', '\u{101fd}', - GC_Extend), ('\u{102e0}', '\u{102e0}', GC_Extend), ('\u{10376}', '\u{1037a}', GC_Extend), - ('\u{10a01}', '\u{10a03}', GC_Extend), ('\u{10a05}', '\u{10a06}', GC_Extend), ('\u{10a0c}', - '\u{10a0f}', GC_Extend), ('\u{10a38}', '\u{10a3a}', GC_Extend), ('\u{10a3f}', '\u{10a3f}', - GC_Extend), ('\u{10ae5}', '\u{10ae6}', GC_Extend), ('\u{11000}', '\u{11000}', - GC_SpacingMark), ('\u{11001}', '\u{11001}', GC_Extend), ('\u{11002}', '\u{11002}', - GC_SpacingMark), ('\u{11038}', '\u{11046}', GC_Extend), ('\u{1107f}', '\u{11081}', - GC_Extend), ('\u{11082}', '\u{11082}', GC_SpacingMark), ('\u{110b0}', '\u{110b2}', - GC_SpacingMark), ('\u{110b3}', '\u{110b6}', GC_Extend), ('\u{110b7}', '\u{110b8}', - GC_SpacingMark), ('\u{110b9}', '\u{110ba}', GC_Extend), ('\u{110bd}', '\u{110bd}', - GC_Prepend), ('\u{11100}', '\u{11102}', GC_Extend), ('\u{11127}', '\u{1112b}', GC_Extend), - ('\u{1112c}', '\u{1112c}', GC_SpacingMark), ('\u{1112d}', '\u{11134}', GC_Extend), - ('\u{11173}', '\u{11173}', GC_Extend), ('\u{11180}', '\u{11181}', GC_Extend), ('\u{11182}', - '\u{11182}', GC_SpacingMark), ('\u{111b3}', '\u{111b5}', GC_SpacingMark), ('\u{111b6}', - '\u{111be}', GC_Extend), ('\u{111bf}', '\u{111c0}', GC_SpacingMark), ('\u{111c2}', - '\u{111c3}', GC_Prepend), ('\u{111ca}', '\u{111cc}', GC_Extend), ('\u{1122c}', '\u{1122e}', - GC_SpacingMark), ('\u{1122f}', '\u{11231}', GC_Extend), ('\u{11232}', '\u{11233}', - GC_SpacingMark), ('\u{11234}', '\u{11234}', GC_Extend), ('\u{11235}', '\u{11235}', - GC_SpacingMark), ('\u{11236}', '\u{11237}', GC_Extend), ('\u{1123e}', '\u{1123e}', - GC_Extend), ('\u{112df}', '\u{112df}', GC_Extend), ('\u{112e0}', '\u{112e2}', - GC_SpacingMark), ('\u{112e3}', '\u{112ea}', GC_Extend), ('\u{11300}', '\u{11301}', - GC_Extend), ('\u{11302}', '\u{11303}', GC_SpacingMark), ('\u{1133c}', '\u{1133c}', - GC_Extend), ('\u{1133e}', '\u{1133e}', GC_Extend), ('\u{1133f}', '\u{1133f}', - GC_SpacingMark), ('\u{11340}', '\u{11340}', GC_Extend), ('\u{11341}', '\u{11344}', - GC_SpacingMark), ('\u{11347}', '\u{11348}', GC_SpacingMark), ('\u{1134b}', '\u{1134d}', - GC_SpacingMark), ('\u{11357}', '\u{11357}', GC_Extend), ('\u{11362}', '\u{11363}', - GC_SpacingMark), ('\u{11366}', '\u{1136c}', GC_Extend), ('\u{11370}', '\u{11374}', - GC_Extend), ('\u{11435}', '\u{11437}', GC_SpacingMark), ('\u{11438}', '\u{1143f}', - GC_Extend), ('\u{11440}', '\u{11441}', GC_SpacingMark), ('\u{11442}', '\u{11444}', - GC_Extend), ('\u{11445}', '\u{11445}', GC_SpacingMark), ('\u{11446}', '\u{11446}', - GC_Extend), ('\u{114b0}', '\u{114b0}', GC_Extend), ('\u{114b1}', '\u{114b2}', - GC_SpacingMark), ('\u{114b3}', '\u{114b8}', GC_Extend), ('\u{114b9}', '\u{114b9}', - GC_SpacingMark), ('\u{114ba}', '\u{114ba}', GC_Extend), ('\u{114bb}', '\u{114bc}', - GC_SpacingMark), ('\u{114bd}', '\u{114bd}', GC_Extend), ('\u{114be}', '\u{114be}', - GC_SpacingMark), ('\u{114bf}', '\u{114c0}', GC_Extend), ('\u{114c1}', '\u{114c1}', - GC_SpacingMark), ('\u{114c2}', '\u{114c3}', GC_Extend), ('\u{115af}', '\u{115af}', - GC_Extend), ('\u{115b0}', '\u{115b1}', GC_SpacingMark), ('\u{115b2}', '\u{115b5}', - GC_Extend), ('\u{115b8}', '\u{115bb}', GC_SpacingMark), ('\u{115bc}', '\u{115bd}', - GC_Extend), ('\u{115be}', '\u{115be}', GC_SpacingMark), ('\u{115bf}', '\u{115c0}', - GC_Extend), ('\u{115dc}', '\u{115dd}', GC_Extend), ('\u{11630}', '\u{11632}', - GC_SpacingMark), ('\u{11633}', '\u{1163a}', GC_Extend), ('\u{1163b}', '\u{1163c}', - GC_SpacingMark), ('\u{1163d}', '\u{1163d}', GC_Extend), ('\u{1163e}', '\u{1163e}', - GC_SpacingMark), ('\u{1163f}', '\u{11640}', GC_Extend), ('\u{116ab}', '\u{116ab}', - GC_Extend), ('\u{116ac}', '\u{116ac}', GC_SpacingMark), ('\u{116ad}', '\u{116ad}', - GC_Extend), ('\u{116ae}', '\u{116af}', GC_SpacingMark), ('\u{116b0}', '\u{116b5}', - GC_Extend), ('\u{116b6}', '\u{116b6}', GC_SpacingMark), ('\u{116b7}', '\u{116b7}', - GC_Extend), ('\u{1171d}', '\u{1171f}', GC_Extend), ('\u{11720}', '\u{11721}', - GC_SpacingMark), ('\u{11722}', '\u{11725}', GC_Extend), ('\u{11726}', '\u{11726}', - GC_SpacingMark), ('\u{11727}', '\u{1172b}', GC_Extend), ('\u{11c2f}', '\u{11c2f}', - GC_SpacingMark), ('\u{11c30}', '\u{11c36}', GC_Extend), ('\u{11c38}', '\u{11c3d}', - GC_Extend), ('\u{11c3e}', '\u{11c3e}', GC_SpacingMark), ('\u{11c3f}', '\u{11c3f}', - GC_Extend), ('\u{11c92}', '\u{11ca7}', GC_Extend), ('\u{11ca9}', '\u{11ca9}', - GC_SpacingMark), ('\u{11caa}', '\u{11cb0}', GC_Extend), ('\u{11cb1}', '\u{11cb1}', - GC_SpacingMark), ('\u{11cb2}', '\u{11cb3}', GC_Extend), ('\u{11cb4}', '\u{11cb4}', - GC_SpacingMark), ('\u{11cb5}', '\u{11cb6}', GC_Extend), ('\u{16af0}', '\u{16af4}', - GC_Extend), ('\u{16b30}', '\u{16b36}', GC_Extend), ('\u{16f51}', '\u{16f7e}', - GC_SpacingMark), ('\u{16f8f}', '\u{16f92}', GC_Extend), ('\u{1bc9d}', '\u{1bc9e}', - GC_Extend), ('\u{1bca0}', '\u{1bca3}', GC_Control), ('\u{1d165}', '\u{1d165}', GC_Extend), - ('\u{1d166}', '\u{1d166}', GC_SpacingMark), ('\u{1d167}', '\u{1d169}', GC_Extend), - ('\u{1d16d}', '\u{1d16d}', GC_SpacingMark), ('\u{1d16e}', '\u{1d172}', GC_Extend), - ('\u{1d173}', '\u{1d17a}', GC_Control), ('\u{1d17b}', '\u{1d182}', GC_Extend), ('\u{1d185}', - '\u{1d18b}', GC_Extend), ('\u{1d1aa}', '\u{1d1ad}', GC_Extend), ('\u{1d242}', '\u{1d244}', - GC_Extend), ('\u{1da00}', '\u{1da36}', GC_Extend), ('\u{1da3b}', '\u{1da6c}', GC_Extend), - ('\u{1da75}', '\u{1da75}', GC_Extend), ('\u{1da84}', '\u{1da84}', GC_Extend), ('\u{1da9b}', - '\u{1da9f}', GC_Extend), ('\u{1daa1}', '\u{1daaf}', GC_Extend), ('\u{1e000}', '\u{1e006}', - GC_Extend), ('\u{1e008}', '\u{1e018}', GC_Extend), ('\u{1e01b}', '\u{1e021}', GC_Extend), - ('\u{1e023}', '\u{1e024}', GC_Extend), ('\u{1e026}', '\u{1e02a}', GC_Extend), ('\u{1e8d0}', - '\u{1e8d6}', GC_Extend), ('\u{1e944}', '\u{1e94a}', GC_Extend), ('\u{1f1e6}', '\u{1f1ff}', - GC_Regional_Indicator), ('\u{1f385}', '\u{1f385}', GC_E_Base), ('\u{1f3c3}', '\u{1f3c4}', - GC_E_Base), ('\u{1f3ca}', '\u{1f3cb}', GC_E_Base), ('\u{1f3fb}', '\u{1f3ff}', - GC_E_Modifier), ('\u{1f442}', '\u{1f443}', GC_E_Base), ('\u{1f446}', '\u{1f450}', - GC_E_Base), ('\u{1f466}', '\u{1f469}', GC_E_Base_GAZ), ('\u{1f46e}', '\u{1f46e}', - GC_E_Base), ('\u{1f470}', '\u{1f478}', GC_E_Base), ('\u{1f47c}', '\u{1f47c}', GC_E_Base), - ('\u{1f481}', '\u{1f483}', GC_E_Base), ('\u{1f485}', '\u{1f487}', GC_E_Base), ('\u{1f48b}', - '\u{1f48b}', GC_Glue_After_Zwj), ('\u{1f4aa}', '\u{1f4aa}', GC_E_Base), ('\u{1f575}', - '\u{1f575}', GC_E_Base), ('\u{1f57a}', '\u{1f57a}', GC_E_Base), ('\u{1f590}', '\u{1f590}', - GC_E_Base), ('\u{1f595}', '\u{1f596}', GC_E_Base), ('\u{1f5e8}', '\u{1f5e8}', - GC_Glue_After_Zwj), ('\u{1f645}', '\u{1f647}', GC_E_Base), ('\u{1f64b}', '\u{1f64f}', - GC_E_Base), ('\u{1f6a3}', '\u{1f6a3}', GC_E_Base), ('\u{1f6b4}', '\u{1f6b6}', GC_E_Base), - ('\u{1f6c0}', '\u{1f6c0}', GC_E_Base), ('\u{1f918}', '\u{1f91e}', GC_E_Base), ('\u{1f926}', - '\u{1f926}', GC_E_Base), ('\u{1f930}', '\u{1f930}', GC_E_Base), ('\u{1f933}', '\u{1f939}', - GC_E_Base), ('\u{1f93c}', '\u{1f93e}', GC_E_Base), ('\u{e0000}', '\u{e001f}', GC_Control), - ('\u{e0020}', '\u{e007f}', GC_Extend), ('\u{e0080}', '\u{e00ff}', GC_Control), ('\u{e0100}', - '\u{e01ef}', GC_Extend), ('\u{e01f0}', '\u{e0fff}', GC_Control) - ]; - -} - -pub mod word { - use core::result::Result::{Ok, Err}; - - pub use self::WordCat::*; - - #[allow(non_camel_case_types)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum WordCat { - WC_ALetter, - WC_Any, - WC_CR, - WC_Double_Quote, - WC_E_Base, - WC_E_Base_GAZ, - WC_E_Modifier, - WC_Extend, - WC_ExtendNumLet, - WC_Format, - WC_Glue_After_Zwj, - WC_Hebrew_Letter, - WC_Katakana, - WC_LF, - WC_MidLetter, - WC_MidNum, - WC_MidNumLet, - WC_Newline, - WC_Numeric, - WC_Regional_Indicator, - WC_Single_Quote, - WC_ZWJ, - } - - fn bsearch_range_value_table(c: char, r: &'static [(char, char, WordCat)]) -> WordCat { - use core::cmp::Ordering::{Equal, Less, Greater}; - match r.binary_search_by(|&(lo, hi, _)| { - if lo <= c && c <= hi { Equal } - else if hi < c { Less } - else { Greater } - }) { - Ok(idx) => { - let (_, _, cat) = r[idx]; - cat - } - Err(_) => WC_Any - } - } - - pub fn word_category(c: char) -> WordCat { - bsearch_range_value_table(c, word_cat_table) - } - - const word_cat_table: &'static [(char, char, WordCat)] = &[ - ('\u{a}', '\u{a}', WC_LF), ('\u{b}', '\u{c}', WC_Newline), ('\u{d}', '\u{d}', WC_CR), - ('\u{22}', '\u{22}', WC_Double_Quote), ('\u{27}', '\u{27}', WC_Single_Quote), ('\u{2c}', - '\u{2c}', WC_MidNum), ('\u{2e}', '\u{2e}', WC_MidNumLet), ('\u{30}', '\u{39}', WC_Numeric), - ('\u{3a}', '\u{3a}', WC_MidLetter), ('\u{3b}', '\u{3b}', WC_MidNum), ('\u{41}', '\u{5a}', - WC_ALetter), ('\u{5f}', '\u{5f}', WC_ExtendNumLet), ('\u{61}', '\u{7a}', WC_ALetter), - ('\u{85}', '\u{85}', WC_Newline), ('\u{aa}', '\u{aa}', WC_ALetter), ('\u{ad}', '\u{ad}', - WC_Format), ('\u{b5}', '\u{b5}', WC_ALetter), ('\u{b7}', '\u{b7}', WC_MidLetter), ('\u{ba}', - '\u{ba}', WC_ALetter), ('\u{c0}', '\u{d6}', WC_ALetter), ('\u{d8}', '\u{f6}', WC_ALetter), - ('\u{f8}', '\u{2c1}', WC_ALetter), ('\u{2c6}', '\u{2d1}', WC_ALetter), ('\u{2d7}', - '\u{2d7}', WC_MidLetter), ('\u{2e0}', '\u{2e4}', WC_ALetter), ('\u{2ec}', '\u{2ec}', - WC_ALetter), ('\u{2ee}', '\u{2ee}', WC_ALetter), ('\u{300}', '\u{36f}', WC_Extend), - ('\u{370}', '\u{374}', WC_ALetter), ('\u{376}', '\u{377}', WC_ALetter), ('\u{37a}', - '\u{37d}', WC_ALetter), ('\u{37e}', '\u{37e}', WC_MidNum), ('\u{37f}', '\u{37f}', - WC_ALetter), ('\u{386}', '\u{386}', WC_ALetter), ('\u{387}', '\u{387}', WC_MidLetter), - ('\u{388}', '\u{38a}', WC_ALetter), ('\u{38c}', '\u{38c}', WC_ALetter), ('\u{38e}', - '\u{3a1}', WC_ALetter), ('\u{3a3}', '\u{3f5}', WC_ALetter), ('\u{3f7}', '\u{481}', - WC_ALetter), ('\u{483}', '\u{489}', WC_Extend), ('\u{48a}', '\u{52f}', WC_ALetter), - ('\u{531}', '\u{556}', WC_ALetter), ('\u{559}', '\u{559}', WC_ALetter), ('\u{561}', - '\u{587}', WC_ALetter), ('\u{589}', '\u{589}', WC_MidNum), ('\u{591}', '\u{5bd}', - WC_Extend), ('\u{5bf}', '\u{5bf}', WC_Extend), ('\u{5c1}', '\u{5c2}', WC_Extend), - ('\u{5c4}', '\u{5c5}', WC_Extend), ('\u{5c7}', '\u{5c7}', WC_Extend), ('\u{5d0}', '\u{5ea}', - WC_Hebrew_Letter), ('\u{5f0}', '\u{5f2}', WC_Hebrew_Letter), ('\u{5f3}', '\u{5f3}', - WC_ALetter), ('\u{5f4}', '\u{5f4}', WC_MidLetter), ('\u{600}', '\u{605}', WC_Format), - ('\u{60c}', '\u{60d}', WC_MidNum), ('\u{610}', '\u{61a}', WC_Extend), ('\u{61c}', '\u{61c}', - WC_Format), ('\u{620}', '\u{64a}', WC_ALetter), ('\u{64b}', '\u{65f}', WC_Extend), - ('\u{660}', '\u{669}', WC_Numeric), ('\u{66b}', '\u{66b}', WC_Numeric), ('\u{66c}', - '\u{66c}', WC_MidNum), ('\u{66e}', '\u{66f}', WC_ALetter), ('\u{670}', '\u{670}', - WC_Extend), ('\u{671}', '\u{6d3}', WC_ALetter), ('\u{6d5}', '\u{6d5}', WC_ALetter), - ('\u{6d6}', '\u{6dc}', WC_Extend), ('\u{6dd}', '\u{6dd}', WC_Format), ('\u{6df}', '\u{6e4}', - WC_Extend), ('\u{6e5}', '\u{6e6}', WC_ALetter), ('\u{6e7}', '\u{6e8}', WC_Extend), - ('\u{6ea}', '\u{6ed}', WC_Extend), ('\u{6ee}', '\u{6ef}', WC_ALetter), ('\u{6f0}', - '\u{6f9}', WC_Numeric), ('\u{6fa}', '\u{6fc}', WC_ALetter), ('\u{6ff}', '\u{6ff}', - WC_ALetter), ('\u{70f}', '\u{70f}', WC_Format), ('\u{710}', '\u{710}', WC_ALetter), - ('\u{711}', '\u{711}', WC_Extend), ('\u{712}', '\u{72f}', WC_ALetter), ('\u{730}', - '\u{74a}', WC_Extend), ('\u{74d}', '\u{7a5}', WC_ALetter), ('\u{7a6}', '\u{7b0}', - WC_Extend), ('\u{7b1}', '\u{7b1}', WC_ALetter), ('\u{7c0}', '\u{7c9}', WC_Numeric), - ('\u{7ca}', '\u{7ea}', WC_ALetter), ('\u{7eb}', '\u{7f3}', WC_Extend), ('\u{7f4}', - '\u{7f5}', WC_ALetter), ('\u{7f8}', '\u{7f8}', WC_MidNum), ('\u{7fa}', '\u{7fa}', - WC_ALetter), ('\u{800}', '\u{815}', WC_ALetter), ('\u{816}', '\u{819}', WC_Extend), - ('\u{81a}', '\u{81a}', WC_ALetter), ('\u{81b}', '\u{823}', WC_Extend), ('\u{824}', - '\u{824}', WC_ALetter), ('\u{825}', '\u{827}', WC_Extend), ('\u{828}', '\u{828}', - WC_ALetter), ('\u{829}', '\u{82d}', WC_Extend), ('\u{840}', '\u{858}', WC_ALetter), - ('\u{859}', '\u{85b}', WC_Extend), ('\u{8a0}', '\u{8b4}', WC_ALetter), ('\u{8b6}', - '\u{8bd}', WC_ALetter), ('\u{8d4}', '\u{8e1}', WC_Extend), ('\u{8e2}', '\u{8e2}', - WC_Format), ('\u{8e3}', '\u{903}', WC_Extend), ('\u{904}', '\u{939}', WC_ALetter), - ('\u{93a}', '\u{93c}', WC_Extend), ('\u{93d}', '\u{93d}', WC_ALetter), ('\u{93e}', - '\u{94f}', WC_Extend), ('\u{950}', '\u{950}', WC_ALetter), ('\u{951}', '\u{957}', - WC_Extend), ('\u{958}', '\u{961}', WC_ALetter), ('\u{962}', '\u{963}', WC_Extend), - ('\u{966}', '\u{96f}', WC_Numeric), ('\u{971}', '\u{980}', WC_ALetter), ('\u{981}', - '\u{983}', WC_Extend), ('\u{985}', '\u{98c}', WC_ALetter), ('\u{98f}', '\u{990}', - WC_ALetter), ('\u{993}', '\u{9a8}', WC_ALetter), ('\u{9aa}', '\u{9b0}', WC_ALetter), - ('\u{9b2}', '\u{9b2}', WC_ALetter), ('\u{9b6}', '\u{9b9}', WC_ALetter), ('\u{9bc}', - '\u{9bc}', WC_Extend), ('\u{9bd}', '\u{9bd}', WC_ALetter), ('\u{9be}', '\u{9c4}', - WC_Extend), ('\u{9c7}', '\u{9c8}', WC_Extend), ('\u{9cb}', '\u{9cd}', WC_Extend), - ('\u{9ce}', '\u{9ce}', WC_ALetter), ('\u{9d7}', '\u{9d7}', WC_Extend), ('\u{9dc}', - '\u{9dd}', WC_ALetter), ('\u{9df}', '\u{9e1}', WC_ALetter), ('\u{9e2}', '\u{9e3}', - WC_Extend), ('\u{9e6}', '\u{9ef}', WC_Numeric), ('\u{9f0}', '\u{9f1}', WC_ALetter), - ('\u{a01}', '\u{a03}', WC_Extend), ('\u{a05}', '\u{a0a}', WC_ALetter), ('\u{a0f}', - '\u{a10}', WC_ALetter), ('\u{a13}', '\u{a28}', WC_ALetter), ('\u{a2a}', '\u{a30}', - WC_ALetter), ('\u{a32}', '\u{a33}', WC_ALetter), ('\u{a35}', '\u{a36}', WC_ALetter), - ('\u{a38}', '\u{a39}', WC_ALetter), ('\u{a3c}', '\u{a3c}', WC_Extend), ('\u{a3e}', - '\u{a42}', WC_Extend), ('\u{a47}', '\u{a48}', WC_Extend), ('\u{a4b}', '\u{a4d}', WC_Extend), - ('\u{a51}', '\u{a51}', WC_Extend), ('\u{a59}', '\u{a5c}', WC_ALetter), ('\u{a5e}', - '\u{a5e}', WC_ALetter), ('\u{a66}', '\u{a6f}', WC_Numeric), ('\u{a70}', '\u{a71}', - WC_Extend), ('\u{a72}', '\u{a74}', WC_ALetter), ('\u{a75}', '\u{a75}', WC_Extend), - ('\u{a81}', '\u{a83}', WC_Extend), ('\u{a85}', '\u{a8d}', WC_ALetter), ('\u{a8f}', - '\u{a91}', WC_ALetter), ('\u{a93}', '\u{aa8}', WC_ALetter), ('\u{aaa}', '\u{ab0}', - WC_ALetter), ('\u{ab2}', '\u{ab3}', WC_ALetter), ('\u{ab5}', '\u{ab9}', WC_ALetter), - ('\u{abc}', '\u{abc}', WC_Extend), ('\u{abd}', '\u{abd}', WC_ALetter), ('\u{abe}', - '\u{ac5}', WC_Extend), ('\u{ac7}', '\u{ac9}', WC_Extend), ('\u{acb}', '\u{acd}', WC_Extend), - ('\u{ad0}', '\u{ad0}', WC_ALetter), ('\u{ae0}', '\u{ae1}', WC_ALetter), ('\u{ae2}', - '\u{ae3}', WC_Extend), ('\u{ae6}', '\u{aef}', WC_Numeric), ('\u{af9}', '\u{af9}', - WC_ALetter), ('\u{b01}', '\u{b03}', WC_Extend), ('\u{b05}', '\u{b0c}', WC_ALetter), - ('\u{b0f}', '\u{b10}', WC_ALetter), ('\u{b13}', '\u{b28}', WC_ALetter), ('\u{b2a}', - '\u{b30}', WC_ALetter), ('\u{b32}', '\u{b33}', WC_ALetter), ('\u{b35}', '\u{b39}', - WC_ALetter), ('\u{b3c}', '\u{b3c}', WC_Extend), ('\u{b3d}', '\u{b3d}', WC_ALetter), - ('\u{b3e}', '\u{b44}', WC_Extend), ('\u{b47}', '\u{b48}', WC_Extend), ('\u{b4b}', '\u{b4d}', - WC_Extend), ('\u{b56}', '\u{b57}', WC_Extend), ('\u{b5c}', '\u{b5d}', WC_ALetter), - ('\u{b5f}', '\u{b61}', WC_ALetter), ('\u{b62}', '\u{b63}', WC_Extend), ('\u{b66}', - '\u{b6f}', WC_Numeric), ('\u{b71}', '\u{b71}', WC_ALetter), ('\u{b82}', '\u{b82}', - WC_Extend), ('\u{b83}', '\u{b83}', WC_ALetter), ('\u{b85}', '\u{b8a}', WC_ALetter), - ('\u{b8e}', '\u{b90}', WC_ALetter), ('\u{b92}', '\u{b95}', WC_ALetter), ('\u{b99}', - '\u{b9a}', WC_ALetter), ('\u{b9c}', '\u{b9c}', WC_ALetter), ('\u{b9e}', '\u{b9f}', - WC_ALetter), ('\u{ba3}', '\u{ba4}', WC_ALetter), ('\u{ba8}', '\u{baa}', WC_ALetter), - ('\u{bae}', '\u{bb9}', WC_ALetter), ('\u{bbe}', '\u{bc2}', WC_Extend), ('\u{bc6}', - '\u{bc8}', WC_Extend), ('\u{bca}', '\u{bcd}', WC_Extend), ('\u{bd0}', '\u{bd0}', - WC_ALetter), ('\u{bd7}', '\u{bd7}', WC_Extend), ('\u{be6}', '\u{bef}', WC_Numeric), - ('\u{c00}', '\u{c03}', WC_Extend), ('\u{c05}', '\u{c0c}', WC_ALetter), ('\u{c0e}', - '\u{c10}', WC_ALetter), ('\u{c12}', '\u{c28}', WC_ALetter), ('\u{c2a}', '\u{c39}', - WC_ALetter), ('\u{c3d}', '\u{c3d}', WC_ALetter), ('\u{c3e}', '\u{c44}', WC_Extend), - ('\u{c46}', '\u{c48}', WC_Extend), ('\u{c4a}', '\u{c4d}', WC_Extend), ('\u{c55}', '\u{c56}', - WC_Extend), ('\u{c58}', '\u{c5a}', WC_ALetter), ('\u{c60}', '\u{c61}', WC_ALetter), - ('\u{c62}', '\u{c63}', WC_Extend), ('\u{c66}', '\u{c6f}', WC_Numeric), ('\u{c80}', - '\u{c80}', WC_ALetter), ('\u{c81}', '\u{c83}', WC_Extend), ('\u{c85}', '\u{c8c}', - WC_ALetter), ('\u{c8e}', '\u{c90}', WC_ALetter), ('\u{c92}', '\u{ca8}', WC_ALetter), - ('\u{caa}', '\u{cb3}', WC_ALetter), ('\u{cb5}', '\u{cb9}', WC_ALetter), ('\u{cbc}', - '\u{cbc}', WC_Extend), ('\u{cbd}', '\u{cbd}', WC_ALetter), ('\u{cbe}', '\u{cc4}', - WC_Extend), ('\u{cc6}', '\u{cc8}', WC_Extend), ('\u{cca}', '\u{ccd}', WC_Extend), - ('\u{cd5}', '\u{cd6}', WC_Extend), ('\u{cde}', '\u{cde}', WC_ALetter), ('\u{ce0}', - '\u{ce1}', WC_ALetter), ('\u{ce2}', '\u{ce3}', WC_Extend), ('\u{ce6}', '\u{cef}', - WC_Numeric), ('\u{cf1}', '\u{cf2}', WC_ALetter), ('\u{d01}', '\u{d03}', WC_Extend), - ('\u{d05}', '\u{d0c}', WC_ALetter), ('\u{d0e}', '\u{d10}', WC_ALetter), ('\u{d12}', - '\u{d3a}', WC_ALetter), ('\u{d3d}', '\u{d3d}', WC_ALetter), ('\u{d3e}', '\u{d44}', - WC_Extend), ('\u{d46}', '\u{d48}', WC_Extend), ('\u{d4a}', '\u{d4d}', WC_Extend), - ('\u{d4e}', '\u{d4e}', WC_ALetter), ('\u{d54}', '\u{d56}', WC_ALetter), ('\u{d57}', - '\u{d57}', WC_Extend), ('\u{d5f}', '\u{d61}', WC_ALetter), ('\u{d62}', '\u{d63}', - WC_Extend), ('\u{d66}', '\u{d6f}', WC_Numeric), ('\u{d7a}', '\u{d7f}', WC_ALetter), - ('\u{d82}', '\u{d83}', WC_Extend), ('\u{d85}', '\u{d96}', WC_ALetter), ('\u{d9a}', - '\u{db1}', WC_ALetter), ('\u{db3}', '\u{dbb}', WC_ALetter), ('\u{dbd}', '\u{dbd}', - WC_ALetter), ('\u{dc0}', '\u{dc6}', WC_ALetter), ('\u{dca}', '\u{dca}', WC_Extend), - ('\u{dcf}', '\u{dd4}', WC_Extend), ('\u{dd6}', '\u{dd6}', WC_Extend), ('\u{dd8}', '\u{ddf}', - WC_Extend), ('\u{de6}', '\u{def}', WC_Numeric), ('\u{df2}', '\u{df3}', WC_Extend), - ('\u{e31}', '\u{e31}', WC_Extend), ('\u{e34}', '\u{e3a}', WC_Extend), ('\u{e47}', '\u{e4e}', - WC_Extend), ('\u{e50}', '\u{e59}', WC_Numeric), ('\u{eb1}', '\u{eb1}', WC_Extend), - ('\u{eb4}', '\u{eb9}', WC_Extend), ('\u{ebb}', '\u{ebc}', WC_Extend), ('\u{ec8}', '\u{ecd}', - WC_Extend), ('\u{ed0}', '\u{ed9}', WC_Numeric), ('\u{f00}', '\u{f00}', WC_ALetter), - ('\u{f18}', '\u{f19}', WC_Extend), ('\u{f20}', '\u{f29}', WC_Numeric), ('\u{f35}', - '\u{f35}', WC_Extend), ('\u{f37}', '\u{f37}', WC_Extend), ('\u{f39}', '\u{f39}', WC_Extend), - ('\u{f3e}', '\u{f3f}', WC_Extend), ('\u{f40}', '\u{f47}', WC_ALetter), ('\u{f49}', - '\u{f6c}', WC_ALetter), ('\u{f71}', '\u{f84}', WC_Extend), ('\u{f86}', '\u{f87}', - WC_Extend), ('\u{f88}', '\u{f8c}', WC_ALetter), ('\u{f8d}', '\u{f97}', WC_Extend), - ('\u{f99}', '\u{fbc}', WC_Extend), ('\u{fc6}', '\u{fc6}', WC_Extend), ('\u{102b}', - '\u{103e}', WC_Extend), ('\u{1040}', '\u{1049}', WC_Numeric), ('\u{1056}', '\u{1059}', - WC_Extend), ('\u{105e}', '\u{1060}', WC_Extend), ('\u{1062}', '\u{1064}', WC_Extend), - ('\u{1067}', '\u{106d}', WC_Extend), ('\u{1071}', '\u{1074}', WC_Extend), ('\u{1082}', - '\u{108d}', WC_Extend), ('\u{108f}', '\u{108f}', WC_Extend), ('\u{1090}', '\u{1099}', - WC_Numeric), ('\u{109a}', '\u{109d}', WC_Extend), ('\u{10a0}', '\u{10c5}', WC_ALetter), - ('\u{10c7}', '\u{10c7}', WC_ALetter), ('\u{10cd}', '\u{10cd}', WC_ALetter), ('\u{10d0}', - '\u{10fa}', WC_ALetter), ('\u{10fc}', '\u{1248}', WC_ALetter), ('\u{124a}', '\u{124d}', - WC_ALetter), ('\u{1250}', '\u{1256}', WC_ALetter), ('\u{1258}', '\u{1258}', WC_ALetter), - ('\u{125a}', '\u{125d}', WC_ALetter), ('\u{1260}', '\u{1288}', WC_ALetter), ('\u{128a}', - '\u{128d}', WC_ALetter), ('\u{1290}', '\u{12b0}', WC_ALetter), ('\u{12b2}', '\u{12b5}', - WC_ALetter), ('\u{12b8}', '\u{12be}', WC_ALetter), ('\u{12c0}', '\u{12c0}', WC_ALetter), - ('\u{12c2}', '\u{12c5}', WC_ALetter), ('\u{12c8}', '\u{12d6}', WC_ALetter), ('\u{12d8}', - '\u{1310}', WC_ALetter), ('\u{1312}', '\u{1315}', WC_ALetter), ('\u{1318}', '\u{135a}', - WC_ALetter), ('\u{135d}', '\u{135f}', WC_Extend), ('\u{1380}', '\u{138f}', WC_ALetter), - ('\u{13a0}', '\u{13f5}', WC_ALetter), ('\u{13f8}', '\u{13fd}', WC_ALetter), ('\u{1401}', - '\u{166c}', WC_ALetter), ('\u{166f}', '\u{167f}', WC_ALetter), ('\u{1681}', '\u{169a}', - WC_ALetter), ('\u{16a0}', '\u{16ea}', WC_ALetter), ('\u{16ee}', '\u{16f8}', WC_ALetter), - ('\u{1700}', '\u{170c}', WC_ALetter), ('\u{170e}', '\u{1711}', WC_ALetter), ('\u{1712}', - '\u{1714}', WC_Extend), ('\u{1720}', '\u{1731}', WC_ALetter), ('\u{1732}', '\u{1734}', - WC_Extend), ('\u{1740}', '\u{1751}', WC_ALetter), ('\u{1752}', '\u{1753}', WC_Extend), - ('\u{1760}', '\u{176c}', WC_ALetter), ('\u{176e}', '\u{1770}', WC_ALetter), ('\u{1772}', - '\u{1773}', WC_Extend), ('\u{17b4}', '\u{17d3}', WC_Extend), ('\u{17dd}', '\u{17dd}', - WC_Extend), ('\u{17e0}', '\u{17e9}', WC_Numeric), ('\u{180b}', '\u{180d}', WC_Extend), - ('\u{180e}', '\u{180e}', WC_Format), ('\u{1810}', '\u{1819}', WC_Numeric), ('\u{1820}', - '\u{1877}', WC_ALetter), ('\u{1880}', '\u{1884}', WC_ALetter), ('\u{1885}', '\u{1886}', - WC_Extend), ('\u{1887}', '\u{18a8}', WC_ALetter), ('\u{18a9}', '\u{18a9}', WC_Extend), - ('\u{18aa}', '\u{18aa}', WC_ALetter), ('\u{18b0}', '\u{18f5}', WC_ALetter), ('\u{1900}', - '\u{191e}', WC_ALetter), ('\u{1920}', '\u{192b}', WC_Extend), ('\u{1930}', '\u{193b}', - WC_Extend), ('\u{1946}', '\u{194f}', WC_Numeric), ('\u{19d0}', '\u{19d9}', WC_Numeric), - ('\u{1a00}', '\u{1a16}', WC_ALetter), ('\u{1a17}', '\u{1a1b}', WC_Extend), ('\u{1a55}', - '\u{1a5e}', WC_Extend), ('\u{1a60}', '\u{1a7c}', WC_Extend), ('\u{1a7f}', '\u{1a7f}', - WC_Extend), ('\u{1a80}', '\u{1a89}', WC_Numeric), ('\u{1a90}', '\u{1a99}', WC_Numeric), - ('\u{1ab0}', '\u{1abe}', WC_Extend), ('\u{1b00}', '\u{1b04}', WC_Extend), ('\u{1b05}', - '\u{1b33}', WC_ALetter), ('\u{1b34}', '\u{1b44}', WC_Extend), ('\u{1b45}', '\u{1b4b}', - WC_ALetter), ('\u{1b50}', '\u{1b59}', WC_Numeric), ('\u{1b6b}', '\u{1b73}', WC_Extend), - ('\u{1b80}', '\u{1b82}', WC_Extend), ('\u{1b83}', '\u{1ba0}', WC_ALetter), ('\u{1ba1}', - '\u{1bad}', WC_Extend), ('\u{1bae}', '\u{1baf}', WC_ALetter), ('\u{1bb0}', '\u{1bb9}', - WC_Numeric), ('\u{1bba}', '\u{1be5}', WC_ALetter), ('\u{1be6}', '\u{1bf3}', WC_Extend), - ('\u{1c00}', '\u{1c23}', WC_ALetter), ('\u{1c24}', '\u{1c37}', WC_Extend), ('\u{1c40}', - '\u{1c49}', WC_Numeric), ('\u{1c4d}', '\u{1c4f}', WC_ALetter), ('\u{1c50}', '\u{1c59}', - WC_Numeric), ('\u{1c5a}', '\u{1c7d}', WC_ALetter), ('\u{1c80}', '\u{1c88}', WC_ALetter), - ('\u{1cd0}', '\u{1cd2}', WC_Extend), ('\u{1cd4}', '\u{1ce8}', WC_Extend), ('\u{1ce9}', - '\u{1cec}', WC_ALetter), ('\u{1ced}', '\u{1ced}', WC_Extend), ('\u{1cee}', '\u{1cf1}', - WC_ALetter), ('\u{1cf2}', '\u{1cf4}', WC_Extend), ('\u{1cf5}', '\u{1cf6}', WC_ALetter), - ('\u{1cf8}', '\u{1cf9}', WC_Extend), ('\u{1d00}', '\u{1dbf}', WC_ALetter), ('\u{1dc0}', - '\u{1df5}', WC_Extend), ('\u{1dfb}', '\u{1dff}', WC_Extend), ('\u{1e00}', '\u{1f15}', - WC_ALetter), ('\u{1f18}', '\u{1f1d}', WC_ALetter), ('\u{1f20}', '\u{1f45}', WC_ALetter), - ('\u{1f48}', '\u{1f4d}', WC_ALetter), ('\u{1f50}', '\u{1f57}', WC_ALetter), ('\u{1f59}', - '\u{1f59}', WC_ALetter), ('\u{1f5b}', '\u{1f5b}', WC_ALetter), ('\u{1f5d}', '\u{1f5d}', - WC_ALetter), ('\u{1f5f}', '\u{1f7d}', WC_ALetter), ('\u{1f80}', '\u{1fb4}', WC_ALetter), - ('\u{1fb6}', '\u{1fbc}', WC_ALetter), ('\u{1fbe}', '\u{1fbe}', WC_ALetter), ('\u{1fc2}', - '\u{1fc4}', WC_ALetter), ('\u{1fc6}', '\u{1fcc}', WC_ALetter), ('\u{1fd0}', '\u{1fd3}', - WC_ALetter), ('\u{1fd6}', '\u{1fdb}', WC_ALetter), ('\u{1fe0}', '\u{1fec}', WC_ALetter), - ('\u{1ff2}', '\u{1ff4}', WC_ALetter), ('\u{1ff6}', '\u{1ffc}', WC_ALetter), ('\u{200c}', - '\u{200c}', WC_Extend), ('\u{200d}', '\u{200d}', WC_ZWJ), ('\u{200e}', '\u{200f}', - WC_Format), ('\u{2018}', '\u{2019}', WC_MidNumLet), ('\u{2024}', '\u{2024}', WC_MidNumLet), - ('\u{2027}', '\u{2027}', WC_MidLetter), ('\u{2028}', '\u{2029}', WC_Newline), ('\u{202a}', - '\u{202e}', WC_Format), ('\u{202f}', '\u{202f}', WC_ExtendNumLet), ('\u{203f}', '\u{2040}', - WC_ExtendNumLet), ('\u{2044}', '\u{2044}', WC_MidNum), ('\u{2054}', '\u{2054}', - WC_ExtendNumLet), ('\u{2060}', '\u{2064}', WC_Format), ('\u{2066}', '\u{206f}', WC_Format), - ('\u{2071}', '\u{2071}', WC_ALetter), ('\u{207f}', '\u{207f}', WC_ALetter), ('\u{2090}', - '\u{209c}', WC_ALetter), ('\u{20d0}', '\u{20f0}', WC_Extend), ('\u{2102}', '\u{2102}', - WC_ALetter), ('\u{2107}', '\u{2107}', WC_ALetter), ('\u{210a}', '\u{2113}', WC_ALetter), - ('\u{2115}', '\u{2115}', WC_ALetter), ('\u{2119}', '\u{211d}', WC_ALetter), ('\u{2124}', - '\u{2124}', WC_ALetter), ('\u{2126}', '\u{2126}', WC_ALetter), ('\u{2128}', '\u{2128}', - WC_ALetter), ('\u{212a}', '\u{212d}', WC_ALetter), ('\u{212f}', '\u{2139}', WC_ALetter), - ('\u{213c}', '\u{213f}', WC_ALetter), ('\u{2145}', '\u{2149}', WC_ALetter), ('\u{214e}', - '\u{214e}', WC_ALetter), ('\u{2160}', '\u{2188}', WC_ALetter), ('\u{24b6}', '\u{24e9}', - WC_ALetter), ('\u{261d}', '\u{261d}', WC_E_Base), ('\u{26f9}', '\u{26f9}', WC_E_Base), - ('\u{270a}', '\u{270d}', WC_E_Base), ('\u{2764}', '\u{2764}', WC_Glue_After_Zwj), - ('\u{2c00}', '\u{2c2e}', WC_ALetter), ('\u{2c30}', '\u{2c5e}', WC_ALetter), ('\u{2c60}', - '\u{2ce4}', WC_ALetter), ('\u{2ceb}', '\u{2cee}', WC_ALetter), ('\u{2cef}', '\u{2cf1}', - WC_Extend), ('\u{2cf2}', '\u{2cf3}', WC_ALetter), ('\u{2d00}', '\u{2d25}', WC_ALetter), - ('\u{2d27}', '\u{2d27}', WC_ALetter), ('\u{2d2d}', '\u{2d2d}', WC_ALetter), ('\u{2d30}', - '\u{2d67}', WC_ALetter), ('\u{2d6f}', '\u{2d6f}', WC_ALetter), ('\u{2d7f}', '\u{2d7f}', - WC_Extend), ('\u{2d80}', '\u{2d96}', WC_ALetter), ('\u{2da0}', '\u{2da6}', WC_ALetter), - ('\u{2da8}', '\u{2dae}', WC_ALetter), ('\u{2db0}', '\u{2db6}', WC_ALetter), ('\u{2db8}', - '\u{2dbe}', WC_ALetter), ('\u{2dc0}', '\u{2dc6}', WC_ALetter), ('\u{2dc8}', '\u{2dce}', - WC_ALetter), ('\u{2dd0}', '\u{2dd6}', WC_ALetter), ('\u{2dd8}', '\u{2dde}', WC_ALetter), - ('\u{2de0}', '\u{2dff}', WC_Extend), ('\u{2e2f}', '\u{2e2f}', WC_ALetter), ('\u{3005}', - '\u{3005}', WC_ALetter), ('\u{302a}', '\u{302f}', WC_Extend), ('\u{3031}', '\u{3035}', - WC_Katakana), ('\u{303b}', '\u{303c}', WC_ALetter), ('\u{3099}', '\u{309a}', WC_Extend), - ('\u{309b}', '\u{309c}', WC_Katakana), ('\u{30a0}', '\u{30fa}', WC_Katakana), ('\u{30fc}', - '\u{30ff}', WC_Katakana), ('\u{3105}', '\u{312d}', WC_ALetter), ('\u{3131}', '\u{318e}', - WC_ALetter), ('\u{31a0}', '\u{31ba}', WC_ALetter), ('\u{31f0}', '\u{31ff}', WC_Katakana), - ('\u{32d0}', '\u{32fe}', WC_Katakana), ('\u{3300}', '\u{3357}', WC_Katakana), ('\u{a000}', - '\u{a48c}', WC_ALetter), ('\u{a4d0}', '\u{a4fd}', WC_ALetter), ('\u{a500}', '\u{a60c}', - WC_ALetter), ('\u{a610}', '\u{a61f}', WC_ALetter), ('\u{a620}', '\u{a629}', WC_Numeric), - ('\u{a62a}', '\u{a62b}', WC_ALetter), ('\u{a640}', '\u{a66e}', WC_ALetter), ('\u{a66f}', - '\u{a672}', WC_Extend), ('\u{a674}', '\u{a67d}', WC_Extend), ('\u{a67f}', '\u{a69d}', - WC_ALetter), ('\u{a69e}', '\u{a69f}', WC_Extend), ('\u{a6a0}', '\u{a6ef}', WC_ALetter), - ('\u{a6f0}', '\u{a6f1}', WC_Extend), ('\u{a717}', '\u{a71f}', WC_ALetter), ('\u{a722}', - '\u{a788}', WC_ALetter), ('\u{a78b}', '\u{a7ae}', WC_ALetter), ('\u{a7b0}', '\u{a7b7}', - WC_ALetter), ('\u{a7f7}', '\u{a801}', WC_ALetter), ('\u{a802}', '\u{a802}', WC_Extend), - ('\u{a803}', '\u{a805}', WC_ALetter), ('\u{a806}', '\u{a806}', WC_Extend), ('\u{a807}', - '\u{a80a}', WC_ALetter), ('\u{a80b}', '\u{a80b}', WC_Extend), ('\u{a80c}', '\u{a822}', - WC_ALetter), ('\u{a823}', '\u{a827}', WC_Extend), ('\u{a840}', '\u{a873}', WC_ALetter), - ('\u{a880}', '\u{a881}', WC_Extend), ('\u{a882}', '\u{a8b3}', WC_ALetter), ('\u{a8b4}', - '\u{a8c5}', WC_Extend), ('\u{a8d0}', '\u{a8d9}', WC_Numeric), ('\u{a8e0}', '\u{a8f1}', - WC_Extend), ('\u{a8f2}', '\u{a8f7}', WC_ALetter), ('\u{a8fb}', '\u{a8fb}', WC_ALetter), - ('\u{a8fd}', '\u{a8fd}', WC_ALetter), ('\u{a900}', '\u{a909}', WC_Numeric), ('\u{a90a}', - '\u{a925}', WC_ALetter), ('\u{a926}', '\u{a92d}', WC_Extend), ('\u{a930}', '\u{a946}', - WC_ALetter), ('\u{a947}', '\u{a953}', WC_Extend), ('\u{a960}', '\u{a97c}', WC_ALetter), - ('\u{a980}', '\u{a983}', WC_Extend), ('\u{a984}', '\u{a9b2}', WC_ALetter), ('\u{a9b3}', - '\u{a9c0}', WC_Extend), ('\u{a9cf}', '\u{a9cf}', WC_ALetter), ('\u{a9d0}', '\u{a9d9}', - WC_Numeric), ('\u{a9e5}', '\u{a9e5}', WC_Extend), ('\u{a9f0}', '\u{a9f9}', WC_Numeric), - ('\u{aa00}', '\u{aa28}', WC_ALetter), ('\u{aa29}', '\u{aa36}', WC_Extend), ('\u{aa40}', - '\u{aa42}', WC_ALetter), ('\u{aa43}', '\u{aa43}', WC_Extend), ('\u{aa44}', '\u{aa4b}', - WC_ALetter), ('\u{aa4c}', '\u{aa4d}', WC_Extend), ('\u{aa50}', '\u{aa59}', WC_Numeric), - ('\u{aa7b}', '\u{aa7d}', WC_Extend), ('\u{aab0}', '\u{aab0}', WC_Extend), ('\u{aab2}', - '\u{aab4}', WC_Extend), ('\u{aab7}', '\u{aab8}', WC_Extend), ('\u{aabe}', '\u{aabf}', - WC_Extend), ('\u{aac1}', '\u{aac1}', WC_Extend), ('\u{aae0}', '\u{aaea}', WC_ALetter), - ('\u{aaeb}', '\u{aaef}', WC_Extend), ('\u{aaf2}', '\u{aaf4}', WC_ALetter), ('\u{aaf5}', - '\u{aaf6}', WC_Extend), ('\u{ab01}', '\u{ab06}', WC_ALetter), ('\u{ab09}', '\u{ab0e}', - WC_ALetter), ('\u{ab11}', '\u{ab16}', WC_ALetter), ('\u{ab20}', '\u{ab26}', WC_ALetter), - ('\u{ab28}', '\u{ab2e}', WC_ALetter), ('\u{ab30}', '\u{ab5a}', WC_ALetter), ('\u{ab5c}', - '\u{ab65}', WC_ALetter), ('\u{ab70}', '\u{abe2}', WC_ALetter), ('\u{abe3}', '\u{abea}', - WC_Extend), ('\u{abec}', '\u{abed}', WC_Extend), ('\u{abf0}', '\u{abf9}', WC_Numeric), - ('\u{ac00}', '\u{d7a3}', WC_ALetter), ('\u{d7b0}', '\u{d7c6}', WC_ALetter), ('\u{d7cb}', - '\u{d7fb}', WC_ALetter), ('\u{fb00}', '\u{fb06}', WC_ALetter), ('\u{fb13}', '\u{fb17}', - WC_ALetter), ('\u{fb1d}', '\u{fb1d}', WC_Hebrew_Letter), ('\u{fb1e}', '\u{fb1e}', - WC_Extend), ('\u{fb1f}', '\u{fb28}', WC_Hebrew_Letter), ('\u{fb2a}', '\u{fb36}', - WC_Hebrew_Letter), ('\u{fb38}', '\u{fb3c}', WC_Hebrew_Letter), ('\u{fb3e}', '\u{fb3e}', - WC_Hebrew_Letter), ('\u{fb40}', '\u{fb41}', WC_Hebrew_Letter), ('\u{fb43}', '\u{fb44}', - WC_Hebrew_Letter), ('\u{fb46}', '\u{fb4f}', WC_Hebrew_Letter), ('\u{fb50}', '\u{fbb1}', - WC_ALetter), ('\u{fbd3}', '\u{fd3d}', WC_ALetter), ('\u{fd50}', '\u{fd8f}', WC_ALetter), - ('\u{fd92}', '\u{fdc7}', WC_ALetter), ('\u{fdf0}', '\u{fdfb}', WC_ALetter), ('\u{fe00}', - '\u{fe0f}', WC_Extend), ('\u{fe10}', '\u{fe10}', WC_MidNum), ('\u{fe13}', '\u{fe13}', - WC_MidLetter), ('\u{fe14}', '\u{fe14}', WC_MidNum), ('\u{fe20}', '\u{fe2f}', WC_Extend), - ('\u{fe33}', '\u{fe34}', WC_ExtendNumLet), ('\u{fe4d}', '\u{fe4f}', WC_ExtendNumLet), - ('\u{fe50}', '\u{fe50}', WC_MidNum), ('\u{fe52}', '\u{fe52}', WC_MidNumLet), ('\u{fe54}', - '\u{fe54}', WC_MidNum), ('\u{fe55}', '\u{fe55}', WC_MidLetter), ('\u{fe70}', '\u{fe74}', - WC_ALetter), ('\u{fe76}', '\u{fefc}', WC_ALetter), ('\u{feff}', '\u{feff}', WC_Format), - ('\u{ff07}', '\u{ff07}', WC_MidNumLet), ('\u{ff0c}', '\u{ff0c}', WC_MidNum), ('\u{ff0e}', - '\u{ff0e}', WC_MidNumLet), ('\u{ff1a}', '\u{ff1a}', WC_MidLetter), ('\u{ff1b}', '\u{ff1b}', - WC_MidNum), ('\u{ff21}', '\u{ff3a}', WC_ALetter), ('\u{ff3f}', '\u{ff3f}', WC_ExtendNumLet), - ('\u{ff41}', '\u{ff5a}', WC_ALetter), ('\u{ff66}', '\u{ff9d}', WC_Katakana), ('\u{ff9e}', - '\u{ff9f}', WC_Extend), ('\u{ffa0}', '\u{ffbe}', WC_ALetter), ('\u{ffc2}', '\u{ffc7}', - WC_ALetter), ('\u{ffca}', '\u{ffcf}', WC_ALetter), ('\u{ffd2}', '\u{ffd7}', WC_ALetter), - ('\u{ffda}', '\u{ffdc}', WC_ALetter), ('\u{fff9}', '\u{fffb}', WC_Format), ('\u{10000}', - '\u{1000b}', WC_ALetter), ('\u{1000d}', '\u{10026}', WC_ALetter), ('\u{10028}', '\u{1003a}', - WC_ALetter), ('\u{1003c}', '\u{1003d}', WC_ALetter), ('\u{1003f}', '\u{1004d}', WC_ALetter), - ('\u{10050}', '\u{1005d}', WC_ALetter), ('\u{10080}', '\u{100fa}', WC_ALetter), - ('\u{10140}', '\u{10174}', WC_ALetter), ('\u{101fd}', '\u{101fd}', WC_Extend), ('\u{10280}', - '\u{1029c}', WC_ALetter), ('\u{102a0}', '\u{102d0}', WC_ALetter), ('\u{102e0}', '\u{102e0}', - WC_Extend), ('\u{10300}', '\u{1031f}', WC_ALetter), ('\u{10330}', '\u{1034a}', WC_ALetter), - ('\u{10350}', '\u{10375}', WC_ALetter), ('\u{10376}', '\u{1037a}', WC_Extend), ('\u{10380}', - '\u{1039d}', WC_ALetter), ('\u{103a0}', '\u{103c3}', WC_ALetter), ('\u{103c8}', '\u{103cf}', - WC_ALetter), ('\u{103d1}', '\u{103d5}', WC_ALetter), ('\u{10400}', '\u{1049d}', WC_ALetter), - ('\u{104a0}', '\u{104a9}', WC_Numeric), ('\u{104b0}', '\u{104d3}', WC_ALetter), - ('\u{104d8}', '\u{104fb}', WC_ALetter), ('\u{10500}', '\u{10527}', WC_ALetter), - ('\u{10530}', '\u{10563}', WC_ALetter), ('\u{10600}', '\u{10736}', WC_ALetter), - ('\u{10740}', '\u{10755}', WC_ALetter), ('\u{10760}', '\u{10767}', WC_ALetter), - ('\u{10800}', '\u{10805}', WC_ALetter), ('\u{10808}', '\u{10808}', WC_ALetter), - ('\u{1080a}', '\u{10835}', WC_ALetter), ('\u{10837}', '\u{10838}', WC_ALetter), - ('\u{1083c}', '\u{1083c}', WC_ALetter), ('\u{1083f}', '\u{10855}', WC_ALetter), - ('\u{10860}', '\u{10876}', WC_ALetter), ('\u{10880}', '\u{1089e}', WC_ALetter), - ('\u{108e0}', '\u{108f2}', WC_ALetter), ('\u{108f4}', '\u{108f5}', WC_ALetter), - ('\u{10900}', '\u{10915}', WC_ALetter), ('\u{10920}', '\u{10939}', WC_ALetter), - ('\u{10980}', '\u{109b7}', WC_ALetter), ('\u{109be}', '\u{109bf}', WC_ALetter), - ('\u{10a00}', '\u{10a00}', WC_ALetter), ('\u{10a01}', '\u{10a03}', WC_Extend), ('\u{10a05}', - '\u{10a06}', WC_Extend), ('\u{10a0c}', '\u{10a0f}', WC_Extend), ('\u{10a10}', '\u{10a13}', - WC_ALetter), ('\u{10a15}', '\u{10a17}', WC_ALetter), ('\u{10a19}', '\u{10a33}', WC_ALetter), - ('\u{10a38}', '\u{10a3a}', WC_Extend), ('\u{10a3f}', '\u{10a3f}', WC_Extend), ('\u{10a60}', - '\u{10a7c}', WC_ALetter), ('\u{10a80}', '\u{10a9c}', WC_ALetter), ('\u{10ac0}', '\u{10ac7}', - WC_ALetter), ('\u{10ac9}', '\u{10ae4}', WC_ALetter), ('\u{10ae5}', '\u{10ae6}', WC_Extend), - ('\u{10b00}', '\u{10b35}', WC_ALetter), ('\u{10b40}', '\u{10b55}', WC_ALetter), - ('\u{10b60}', '\u{10b72}', WC_ALetter), ('\u{10b80}', '\u{10b91}', WC_ALetter), - ('\u{10c00}', '\u{10c48}', WC_ALetter), ('\u{10c80}', '\u{10cb2}', WC_ALetter), - ('\u{10cc0}', '\u{10cf2}', WC_ALetter), ('\u{11000}', '\u{11002}', WC_Extend), ('\u{11003}', - '\u{11037}', WC_ALetter), ('\u{11038}', '\u{11046}', WC_Extend), ('\u{11066}', '\u{1106f}', - WC_Numeric), ('\u{1107f}', '\u{11082}', WC_Extend), ('\u{11083}', '\u{110af}', WC_ALetter), - ('\u{110b0}', '\u{110ba}', WC_Extend), ('\u{110bd}', '\u{110bd}', WC_Format), ('\u{110d0}', - '\u{110e8}', WC_ALetter), ('\u{110f0}', '\u{110f9}', WC_Numeric), ('\u{11100}', '\u{11102}', - WC_Extend), ('\u{11103}', '\u{11126}', WC_ALetter), ('\u{11127}', '\u{11134}', WC_Extend), - ('\u{11136}', '\u{1113f}', WC_Numeric), ('\u{11150}', '\u{11172}', WC_ALetter), - ('\u{11173}', '\u{11173}', WC_Extend), ('\u{11176}', '\u{11176}', WC_ALetter), ('\u{11180}', - '\u{11182}', WC_Extend), ('\u{11183}', '\u{111b2}', WC_ALetter), ('\u{111b3}', '\u{111c0}', - WC_Extend), ('\u{111c1}', '\u{111c4}', WC_ALetter), ('\u{111ca}', '\u{111cc}', WC_Extend), - ('\u{111d0}', '\u{111d9}', WC_Numeric), ('\u{111da}', '\u{111da}', WC_ALetter), - ('\u{111dc}', '\u{111dc}', WC_ALetter), ('\u{11200}', '\u{11211}', WC_ALetter), - ('\u{11213}', '\u{1122b}', WC_ALetter), ('\u{1122c}', '\u{11237}', WC_Extend), ('\u{1123e}', - '\u{1123e}', WC_Extend), ('\u{11280}', '\u{11286}', WC_ALetter), ('\u{11288}', '\u{11288}', - WC_ALetter), ('\u{1128a}', '\u{1128d}', WC_ALetter), ('\u{1128f}', '\u{1129d}', WC_ALetter), - ('\u{1129f}', '\u{112a8}', WC_ALetter), ('\u{112b0}', '\u{112de}', WC_ALetter), - ('\u{112df}', '\u{112ea}', WC_Extend), ('\u{112f0}', '\u{112f9}', WC_Numeric), ('\u{11300}', - '\u{11303}', WC_Extend), ('\u{11305}', '\u{1130c}', WC_ALetter), ('\u{1130f}', '\u{11310}', - WC_ALetter), ('\u{11313}', '\u{11328}', WC_ALetter), ('\u{1132a}', '\u{11330}', WC_ALetter), - ('\u{11332}', '\u{11333}', WC_ALetter), ('\u{11335}', '\u{11339}', WC_ALetter), - ('\u{1133c}', '\u{1133c}', WC_Extend), ('\u{1133d}', '\u{1133d}', WC_ALetter), ('\u{1133e}', - '\u{11344}', WC_Extend), ('\u{11347}', '\u{11348}', WC_Extend), ('\u{1134b}', '\u{1134d}', - WC_Extend), ('\u{11350}', '\u{11350}', WC_ALetter), ('\u{11357}', '\u{11357}', WC_Extend), - ('\u{1135d}', '\u{11361}', WC_ALetter), ('\u{11362}', '\u{11363}', WC_Extend), ('\u{11366}', - '\u{1136c}', WC_Extend), ('\u{11370}', '\u{11374}', WC_Extend), ('\u{11400}', '\u{11434}', - WC_ALetter), ('\u{11435}', '\u{11446}', WC_Extend), ('\u{11447}', '\u{1144a}', WC_ALetter), - ('\u{11450}', '\u{11459}', WC_Numeric), ('\u{11480}', '\u{114af}', WC_ALetter), - ('\u{114b0}', '\u{114c3}', WC_Extend), ('\u{114c4}', '\u{114c5}', WC_ALetter), ('\u{114c7}', - '\u{114c7}', WC_ALetter), ('\u{114d0}', '\u{114d9}', WC_Numeric), ('\u{11580}', '\u{115ae}', - WC_ALetter), ('\u{115af}', '\u{115b5}', WC_Extend), ('\u{115b8}', '\u{115c0}', WC_Extend), - ('\u{115d8}', '\u{115db}', WC_ALetter), ('\u{115dc}', '\u{115dd}', WC_Extend), ('\u{11600}', - '\u{1162f}', WC_ALetter), ('\u{11630}', '\u{11640}', WC_Extend), ('\u{11644}', '\u{11644}', - WC_ALetter), ('\u{11650}', '\u{11659}', WC_Numeric), ('\u{11680}', '\u{116aa}', WC_ALetter), - ('\u{116ab}', '\u{116b7}', WC_Extend), ('\u{116c0}', '\u{116c9}', WC_Numeric), ('\u{1171d}', - '\u{1172b}', WC_Extend), ('\u{11730}', '\u{11739}', WC_Numeric), ('\u{118a0}', '\u{118df}', - WC_ALetter), ('\u{118e0}', '\u{118e9}', WC_Numeric), ('\u{118ff}', '\u{118ff}', WC_ALetter), - ('\u{11ac0}', '\u{11af8}', WC_ALetter), ('\u{11c00}', '\u{11c08}', WC_ALetter), - ('\u{11c0a}', '\u{11c2e}', WC_ALetter), ('\u{11c2f}', '\u{11c36}', WC_Extend), ('\u{11c38}', - '\u{11c3f}', WC_Extend), ('\u{11c40}', '\u{11c40}', WC_ALetter), ('\u{11c50}', '\u{11c59}', - WC_Numeric), ('\u{11c72}', '\u{11c8f}', WC_ALetter), ('\u{11c92}', '\u{11ca7}', WC_Extend), - ('\u{11ca9}', '\u{11cb6}', WC_Extend), ('\u{12000}', '\u{12399}', WC_ALetter), ('\u{12400}', - '\u{1246e}', WC_ALetter), ('\u{12480}', '\u{12543}', WC_ALetter), ('\u{13000}', '\u{1342e}', - WC_ALetter), ('\u{14400}', '\u{14646}', WC_ALetter), ('\u{16800}', '\u{16a38}', WC_ALetter), - ('\u{16a40}', '\u{16a5e}', WC_ALetter), ('\u{16a60}', '\u{16a69}', WC_Numeric), - ('\u{16ad0}', '\u{16aed}', WC_ALetter), ('\u{16af0}', '\u{16af4}', WC_Extend), ('\u{16b00}', - '\u{16b2f}', WC_ALetter), ('\u{16b30}', '\u{16b36}', WC_Extend), ('\u{16b40}', '\u{16b43}', - WC_ALetter), ('\u{16b50}', '\u{16b59}', WC_Numeric), ('\u{16b63}', '\u{16b77}', WC_ALetter), - ('\u{16b7d}', '\u{16b8f}', WC_ALetter), ('\u{16f00}', '\u{16f44}', WC_ALetter), - ('\u{16f50}', '\u{16f50}', WC_ALetter), ('\u{16f51}', '\u{16f7e}', WC_Extend), ('\u{16f8f}', - '\u{16f92}', WC_Extend), ('\u{16f93}', '\u{16f9f}', WC_ALetter), ('\u{16fe0}', '\u{16fe0}', - WC_ALetter), ('\u{1b000}', '\u{1b000}', WC_Katakana), ('\u{1bc00}', '\u{1bc6a}', - WC_ALetter), ('\u{1bc70}', '\u{1bc7c}', WC_ALetter), ('\u{1bc80}', '\u{1bc88}', WC_ALetter), - ('\u{1bc90}', '\u{1bc99}', WC_ALetter), ('\u{1bc9d}', '\u{1bc9e}', WC_Extend), ('\u{1bca0}', - '\u{1bca3}', WC_Format), ('\u{1d165}', '\u{1d169}', WC_Extend), ('\u{1d16d}', '\u{1d172}', - WC_Extend), ('\u{1d173}', '\u{1d17a}', WC_Format), ('\u{1d17b}', '\u{1d182}', WC_Extend), - ('\u{1d185}', '\u{1d18b}', WC_Extend), ('\u{1d1aa}', '\u{1d1ad}', WC_Extend), ('\u{1d242}', - '\u{1d244}', WC_Extend), ('\u{1d400}', '\u{1d454}', WC_ALetter), ('\u{1d456}', '\u{1d49c}', - WC_ALetter), ('\u{1d49e}', '\u{1d49f}', WC_ALetter), ('\u{1d4a2}', '\u{1d4a2}', WC_ALetter), - ('\u{1d4a5}', '\u{1d4a6}', WC_ALetter), ('\u{1d4a9}', '\u{1d4ac}', WC_ALetter), - ('\u{1d4ae}', '\u{1d4b9}', WC_ALetter), ('\u{1d4bb}', '\u{1d4bb}', WC_ALetter), - ('\u{1d4bd}', '\u{1d4c3}', WC_ALetter), ('\u{1d4c5}', '\u{1d505}', WC_ALetter), - ('\u{1d507}', '\u{1d50a}', WC_ALetter), ('\u{1d50d}', '\u{1d514}', WC_ALetter), - ('\u{1d516}', '\u{1d51c}', WC_ALetter), ('\u{1d51e}', '\u{1d539}', WC_ALetter), - ('\u{1d53b}', '\u{1d53e}', WC_ALetter), ('\u{1d540}', '\u{1d544}', WC_ALetter), - ('\u{1d546}', '\u{1d546}', WC_ALetter), ('\u{1d54a}', '\u{1d550}', WC_ALetter), - ('\u{1d552}', '\u{1d6a5}', WC_ALetter), ('\u{1d6a8}', '\u{1d6c0}', WC_ALetter), - ('\u{1d6c2}', '\u{1d6da}', WC_ALetter), ('\u{1d6dc}', '\u{1d6fa}', WC_ALetter), - ('\u{1d6fc}', '\u{1d714}', WC_ALetter), ('\u{1d716}', '\u{1d734}', WC_ALetter), - ('\u{1d736}', '\u{1d74e}', WC_ALetter), ('\u{1d750}', '\u{1d76e}', WC_ALetter), - ('\u{1d770}', '\u{1d788}', WC_ALetter), ('\u{1d78a}', '\u{1d7a8}', WC_ALetter), - ('\u{1d7aa}', '\u{1d7c2}', WC_ALetter), ('\u{1d7c4}', '\u{1d7cb}', WC_ALetter), - ('\u{1d7ce}', '\u{1d7ff}', WC_Numeric), ('\u{1da00}', '\u{1da36}', WC_Extend), ('\u{1da3b}', - '\u{1da6c}', WC_Extend), ('\u{1da75}', '\u{1da75}', WC_Extend), ('\u{1da84}', '\u{1da84}', - WC_Extend), ('\u{1da9b}', '\u{1da9f}', WC_Extend), ('\u{1daa1}', '\u{1daaf}', WC_Extend), - ('\u{1e000}', '\u{1e006}', WC_Extend), ('\u{1e008}', '\u{1e018}', WC_Extend), ('\u{1e01b}', - '\u{1e021}', WC_Extend), ('\u{1e023}', '\u{1e024}', WC_Extend), ('\u{1e026}', '\u{1e02a}', - WC_Extend), ('\u{1e800}', '\u{1e8c4}', WC_ALetter), ('\u{1e8d0}', '\u{1e8d6}', WC_Extend), - ('\u{1e900}', '\u{1e943}', WC_ALetter), ('\u{1e944}', '\u{1e94a}', WC_Extend), ('\u{1e950}', - '\u{1e959}', WC_Numeric), ('\u{1ee00}', '\u{1ee03}', WC_ALetter), ('\u{1ee05}', '\u{1ee1f}', - WC_ALetter), ('\u{1ee21}', '\u{1ee22}', WC_ALetter), ('\u{1ee24}', '\u{1ee24}', WC_ALetter), - ('\u{1ee27}', '\u{1ee27}', WC_ALetter), ('\u{1ee29}', '\u{1ee32}', WC_ALetter), - ('\u{1ee34}', '\u{1ee37}', WC_ALetter), ('\u{1ee39}', '\u{1ee39}', WC_ALetter), - ('\u{1ee3b}', '\u{1ee3b}', WC_ALetter), ('\u{1ee42}', '\u{1ee42}', WC_ALetter), - ('\u{1ee47}', '\u{1ee47}', WC_ALetter), ('\u{1ee49}', '\u{1ee49}', WC_ALetter), - ('\u{1ee4b}', '\u{1ee4b}', WC_ALetter), ('\u{1ee4d}', '\u{1ee4f}', WC_ALetter), - ('\u{1ee51}', '\u{1ee52}', WC_ALetter), ('\u{1ee54}', '\u{1ee54}', WC_ALetter), - ('\u{1ee57}', '\u{1ee57}', WC_ALetter), ('\u{1ee59}', '\u{1ee59}', WC_ALetter), - ('\u{1ee5b}', '\u{1ee5b}', WC_ALetter), ('\u{1ee5d}', '\u{1ee5d}', WC_ALetter), - ('\u{1ee5f}', '\u{1ee5f}', WC_ALetter), ('\u{1ee61}', '\u{1ee62}', WC_ALetter), - ('\u{1ee64}', '\u{1ee64}', WC_ALetter), ('\u{1ee67}', '\u{1ee6a}', WC_ALetter), - ('\u{1ee6c}', '\u{1ee72}', WC_ALetter), ('\u{1ee74}', '\u{1ee77}', WC_ALetter), - ('\u{1ee79}', '\u{1ee7c}', WC_ALetter), ('\u{1ee7e}', '\u{1ee7e}', WC_ALetter), - ('\u{1ee80}', '\u{1ee89}', WC_ALetter), ('\u{1ee8b}', '\u{1ee9b}', WC_ALetter), - ('\u{1eea1}', '\u{1eea3}', WC_ALetter), ('\u{1eea5}', '\u{1eea9}', WC_ALetter), - ('\u{1eeab}', '\u{1eebb}', WC_ALetter), ('\u{1f130}', '\u{1f149}', WC_ALetter), - ('\u{1f150}', '\u{1f169}', WC_ALetter), ('\u{1f170}', '\u{1f189}', WC_ALetter), - ('\u{1f1e6}', '\u{1f1ff}', WC_Regional_Indicator), ('\u{1f385}', '\u{1f385}', WC_E_Base), - ('\u{1f3c3}', '\u{1f3c4}', WC_E_Base), ('\u{1f3ca}', '\u{1f3cb}', WC_E_Base), ('\u{1f3fb}', - '\u{1f3ff}', WC_E_Modifier), ('\u{1f442}', '\u{1f443}', WC_E_Base), ('\u{1f446}', - '\u{1f450}', WC_E_Base), ('\u{1f466}', '\u{1f469}', WC_E_Base_GAZ), ('\u{1f46e}', - '\u{1f46e}', WC_E_Base), ('\u{1f470}', '\u{1f478}', WC_E_Base), ('\u{1f47c}', '\u{1f47c}', - WC_E_Base), ('\u{1f481}', '\u{1f483}', WC_E_Base), ('\u{1f485}', '\u{1f487}', WC_E_Base), - ('\u{1f48b}', '\u{1f48b}', WC_Glue_After_Zwj), ('\u{1f4aa}', '\u{1f4aa}', WC_E_Base), - ('\u{1f575}', '\u{1f575}', WC_E_Base), ('\u{1f57a}', '\u{1f57a}', WC_E_Base), ('\u{1f590}', - '\u{1f590}', WC_E_Base), ('\u{1f595}', '\u{1f596}', WC_E_Base), ('\u{1f5e8}', '\u{1f5e8}', - WC_Glue_After_Zwj), ('\u{1f645}', '\u{1f647}', WC_E_Base), ('\u{1f64b}', '\u{1f64f}', - WC_E_Base), ('\u{1f6a3}', '\u{1f6a3}', WC_E_Base), ('\u{1f6b4}', '\u{1f6b6}', WC_E_Base), - ('\u{1f6c0}', '\u{1f6c0}', WC_E_Base), ('\u{1f918}', '\u{1f91e}', WC_E_Base), ('\u{1f926}', - '\u{1f926}', WC_E_Base), ('\u{1f930}', '\u{1f930}', WC_E_Base), ('\u{1f933}', '\u{1f939}', - WC_E_Base), ('\u{1f93c}', '\u{1f93e}', WC_E_Base), ('\u{e0001}', '\u{e0001}', WC_Format), - ('\u{e0020}', '\u{e007f}', WC_Extend), ('\u{e0100}', '\u{e01ef}', WC_Extend) - ]; - -} diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/testdata.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/testdata.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/testdata.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/testdata.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2058 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly - -#![allow(missing_docs, non_upper_case_globals, non_snake_case)] - // official Unicode test data - // http://www.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakTest.txt - pub const TEST_SAME: &'static [(&'static str, &'static [&'static str])] = &[ - ("\u{20}\u{20}", &["\u{20}", "\u{20}"]), ("\u{20}\u{308}\u{20}", &["\u{20}\u{308}", - "\u{20}"]), ("\u{20}\u{d}", &["\u{20}", "\u{d}"]), ("\u{20}\u{308}\u{d}", &["\u{20}\u{308}", - "\u{d}"]), ("\u{20}\u{a}", &["\u{20}", "\u{a}"]), ("\u{20}\u{308}\u{a}", &["\u{20}\u{308}", - "\u{a}"]), ("\u{20}\u{1}", &["\u{20}", "\u{1}"]), ("\u{20}\u{308}\u{1}", &["\u{20}\u{308}", - "\u{1}"]), ("\u{20}\u{300}", &["\u{20}\u{300}"]), ("\u{20}\u{308}\u{300}", - &["\u{20}\u{308}\u{300}"]), ("\u{20}\u{600}", &["\u{20}", "\u{600}"]), - ("\u{20}\u{308}\u{600}", &["\u{20}\u{308}", "\u{600}"]), ("\u{20}\u{1100}", &["\u{20}", - "\u{1100}"]), ("\u{20}\u{308}\u{1100}", &["\u{20}\u{308}", "\u{1100}"]), ("\u{20}\u{1160}", - &["\u{20}", "\u{1160}"]), ("\u{20}\u{308}\u{1160}", &["\u{20}\u{308}", "\u{1160}"]), - ("\u{20}\u{11a8}", &["\u{20}", "\u{11a8}"]), ("\u{20}\u{308}\u{11a8}", &["\u{20}\u{308}", - "\u{11a8}"]), ("\u{20}\u{ac00}", &["\u{20}", "\u{ac00}"]), ("\u{20}\u{308}\u{ac00}", - &["\u{20}\u{308}", "\u{ac00}"]), ("\u{20}\u{ac01}", &["\u{20}", "\u{ac01}"]), - ("\u{20}\u{308}\u{ac01}", &["\u{20}\u{308}", "\u{ac01}"]), ("\u{20}\u{1f1e6}", &["\u{20}", - "\u{1f1e6}"]), ("\u{20}\u{308}\u{1f1e6}", &["\u{20}\u{308}", "\u{1f1e6}"]), - ("\u{20}\u{261d}", &["\u{20}", "\u{261d}"]), ("\u{20}\u{308}\u{261d}", &["\u{20}\u{308}", - "\u{261d}"]), ("\u{20}\u{1f3fb}", &["\u{20}", "\u{1f3fb}"]), ("\u{20}\u{308}\u{1f3fb}", - &["\u{20}\u{308}", "\u{1f3fb}"]), ("\u{20}\u{200d}", &["\u{20}\u{200d}"]), - ("\u{20}\u{308}\u{200d}", &["\u{20}\u{308}\u{200d}"]), ("\u{20}\u{2764}", &["\u{20}", - "\u{2764}"]), ("\u{20}\u{308}\u{2764}", &["\u{20}\u{308}", "\u{2764}"]), ("\u{20}\u{1f466}", - &["\u{20}", "\u{1f466}"]), ("\u{20}\u{308}\u{1f466}", &["\u{20}\u{308}", "\u{1f466}"]), - ("\u{20}\u{378}", &["\u{20}", "\u{378}"]), ("\u{20}\u{308}\u{378}", &["\u{20}\u{308}", - "\u{378}"]), ("\u{d}\u{20}", &["\u{d}", "\u{20}"]), ("\u{d}\u{308}\u{20}", &["\u{d}", - "\u{308}", "\u{20}"]), ("\u{d}\u{d}", &["\u{d}", "\u{d}"]), ("\u{d}\u{308}\u{d}", &["\u{d}", - "\u{308}", "\u{d}"]), ("\u{d}\u{a}", &["\u{d}\u{a}"]), ("\u{d}\u{308}\u{a}", &["\u{d}", - "\u{308}", "\u{a}"]), ("\u{d}\u{1}", &["\u{d}", "\u{1}"]), ("\u{d}\u{308}\u{1}", &["\u{d}", - "\u{308}", "\u{1}"]), ("\u{d}\u{300}", &["\u{d}", "\u{300}"]), ("\u{d}\u{308}\u{300}", - &["\u{d}", "\u{308}\u{300}"]), ("\u{d}\u{600}", &["\u{d}", "\u{600}"]), - ("\u{d}\u{308}\u{600}", &["\u{d}", "\u{308}", "\u{600}"]), ("\u{d}\u{903}", &["\u{d}", - "\u{903}"]), ("\u{d}\u{1100}", &["\u{d}", "\u{1100}"]), ("\u{d}\u{308}\u{1100}", &["\u{d}", - "\u{308}", "\u{1100}"]), ("\u{d}\u{1160}", &["\u{d}", "\u{1160}"]), ("\u{d}\u{308}\u{1160}", - &["\u{d}", "\u{308}", "\u{1160}"]), ("\u{d}\u{11a8}", &["\u{d}", "\u{11a8}"]), - ("\u{d}\u{308}\u{11a8}", &["\u{d}", "\u{308}", "\u{11a8}"]), ("\u{d}\u{ac00}", &["\u{d}", - "\u{ac00}"]), ("\u{d}\u{308}\u{ac00}", &["\u{d}", "\u{308}", "\u{ac00}"]), ("\u{d}\u{ac01}", - &["\u{d}", "\u{ac01}"]), ("\u{d}\u{308}\u{ac01}", &["\u{d}", "\u{308}", "\u{ac01}"]), - ("\u{d}\u{1f1e6}", &["\u{d}", "\u{1f1e6}"]), ("\u{d}\u{308}\u{1f1e6}", &["\u{d}", "\u{308}", - "\u{1f1e6}"]), ("\u{d}\u{261d}", &["\u{d}", "\u{261d}"]), ("\u{d}\u{308}\u{261d}", - &["\u{d}", "\u{308}", "\u{261d}"]), ("\u{d}\u{1f3fb}", &["\u{d}", "\u{1f3fb}"]), - ("\u{d}\u{308}\u{1f3fb}", &["\u{d}", "\u{308}", "\u{1f3fb}"]), ("\u{d}\u{200d}", &["\u{d}", - "\u{200d}"]), ("\u{d}\u{308}\u{200d}", &["\u{d}", "\u{308}\u{200d}"]), ("\u{d}\u{2764}", - &["\u{d}", "\u{2764}"]), ("\u{d}\u{308}\u{2764}", &["\u{d}", "\u{308}", "\u{2764}"]), - ("\u{d}\u{1f466}", &["\u{d}", "\u{1f466}"]), ("\u{d}\u{308}\u{1f466}", &["\u{d}", "\u{308}", - "\u{1f466}"]), ("\u{d}\u{378}", &["\u{d}", "\u{378}"]), ("\u{d}\u{308}\u{378}", &["\u{d}", - "\u{308}", "\u{378}"]), ("\u{a}\u{20}", &["\u{a}", "\u{20}"]), ("\u{a}\u{308}\u{20}", - &["\u{a}", "\u{308}", "\u{20}"]), ("\u{a}\u{d}", &["\u{a}", "\u{d}"]), ("\u{a}\u{308}\u{d}", - &["\u{a}", "\u{308}", "\u{d}"]), ("\u{a}\u{a}", &["\u{a}", "\u{a}"]), ("\u{a}\u{308}\u{a}", - &["\u{a}", "\u{308}", "\u{a}"]), ("\u{a}\u{1}", &["\u{a}", "\u{1}"]), ("\u{a}\u{308}\u{1}", - &["\u{a}", "\u{308}", "\u{1}"]), ("\u{a}\u{300}", &["\u{a}", "\u{300}"]), - ("\u{a}\u{308}\u{300}", &["\u{a}", "\u{308}\u{300}"]), ("\u{a}\u{600}", &["\u{a}", - "\u{600}"]), ("\u{a}\u{308}\u{600}", &["\u{a}", "\u{308}", "\u{600}"]), ("\u{a}\u{903}", - &["\u{a}", "\u{903}"]), ("\u{a}\u{1100}", &["\u{a}", "\u{1100}"]), ("\u{a}\u{308}\u{1100}", - &["\u{a}", "\u{308}", "\u{1100}"]), ("\u{a}\u{1160}", &["\u{a}", "\u{1160}"]), - ("\u{a}\u{308}\u{1160}", &["\u{a}", "\u{308}", "\u{1160}"]), ("\u{a}\u{11a8}", &["\u{a}", - "\u{11a8}"]), ("\u{a}\u{308}\u{11a8}", &["\u{a}", "\u{308}", "\u{11a8}"]), ("\u{a}\u{ac00}", - &["\u{a}", "\u{ac00}"]), ("\u{a}\u{308}\u{ac00}", &["\u{a}", "\u{308}", "\u{ac00}"]), - ("\u{a}\u{ac01}", &["\u{a}", "\u{ac01}"]), ("\u{a}\u{308}\u{ac01}", &["\u{a}", "\u{308}", - "\u{ac01}"]), ("\u{a}\u{1f1e6}", &["\u{a}", "\u{1f1e6}"]), ("\u{a}\u{308}\u{1f1e6}", - &["\u{a}", "\u{308}", "\u{1f1e6}"]), ("\u{a}\u{261d}", &["\u{a}", "\u{261d}"]), - ("\u{a}\u{308}\u{261d}", &["\u{a}", "\u{308}", "\u{261d}"]), ("\u{a}\u{1f3fb}", &["\u{a}", - "\u{1f3fb}"]), ("\u{a}\u{308}\u{1f3fb}", &["\u{a}", "\u{308}", "\u{1f3fb}"]), - ("\u{a}\u{200d}", &["\u{a}", "\u{200d}"]), ("\u{a}\u{308}\u{200d}", &["\u{a}", - "\u{308}\u{200d}"]), ("\u{a}\u{2764}", &["\u{a}", "\u{2764}"]), ("\u{a}\u{308}\u{2764}", - &["\u{a}", "\u{308}", "\u{2764}"]), ("\u{a}\u{1f466}", &["\u{a}", "\u{1f466}"]), - ("\u{a}\u{308}\u{1f466}", &["\u{a}", "\u{308}", "\u{1f466}"]), ("\u{a}\u{378}", &["\u{a}", - "\u{378}"]), ("\u{a}\u{308}\u{378}", &["\u{a}", "\u{308}", "\u{378}"]), ("\u{1}\u{20}", - &["\u{1}", "\u{20}"]), ("\u{1}\u{308}\u{20}", &["\u{1}", "\u{308}", "\u{20}"]), - ("\u{1}\u{d}", &["\u{1}", "\u{d}"]), ("\u{1}\u{308}\u{d}", &["\u{1}", "\u{308}", "\u{d}"]), - ("\u{1}\u{a}", &["\u{1}", "\u{a}"]), ("\u{1}\u{308}\u{a}", &["\u{1}", "\u{308}", "\u{a}"]), - ("\u{1}\u{1}", &["\u{1}", "\u{1}"]), ("\u{1}\u{308}\u{1}", &["\u{1}", "\u{308}", "\u{1}"]), - ("\u{1}\u{300}", &["\u{1}", "\u{300}"]), ("\u{1}\u{308}\u{300}", &["\u{1}", - "\u{308}\u{300}"]), ("\u{1}\u{600}", &["\u{1}", "\u{600}"]), ("\u{1}\u{308}\u{600}", - &["\u{1}", "\u{308}", "\u{600}"]), ("\u{1}\u{903}", &["\u{1}", "\u{903}"]), - ("\u{1}\u{1100}", &["\u{1}", "\u{1100}"]), ("\u{1}\u{308}\u{1100}", &["\u{1}", "\u{308}", - "\u{1100}"]), ("\u{1}\u{1160}", &["\u{1}", "\u{1160}"]), ("\u{1}\u{308}\u{1160}", &["\u{1}", - "\u{308}", "\u{1160}"]), ("\u{1}\u{11a8}", &["\u{1}", "\u{11a8}"]), ("\u{1}\u{308}\u{11a8}", - &["\u{1}", "\u{308}", "\u{11a8}"]), ("\u{1}\u{ac00}", &["\u{1}", "\u{ac00}"]), - ("\u{1}\u{308}\u{ac00}", &["\u{1}", "\u{308}", "\u{ac00}"]), ("\u{1}\u{ac01}", &["\u{1}", - "\u{ac01}"]), ("\u{1}\u{308}\u{ac01}", &["\u{1}", "\u{308}", "\u{ac01}"]), - ("\u{1}\u{1f1e6}", &["\u{1}", "\u{1f1e6}"]), ("\u{1}\u{308}\u{1f1e6}", &["\u{1}", "\u{308}", - "\u{1f1e6}"]), ("\u{1}\u{261d}", &["\u{1}", "\u{261d}"]), ("\u{1}\u{308}\u{261d}", - &["\u{1}", "\u{308}", "\u{261d}"]), ("\u{1}\u{1f3fb}", &["\u{1}", "\u{1f3fb}"]), - ("\u{1}\u{308}\u{1f3fb}", &["\u{1}", "\u{308}", "\u{1f3fb}"]), ("\u{1}\u{200d}", &["\u{1}", - "\u{200d}"]), ("\u{1}\u{308}\u{200d}", &["\u{1}", "\u{308}\u{200d}"]), ("\u{1}\u{2764}", - &["\u{1}", "\u{2764}"]), ("\u{1}\u{308}\u{2764}", &["\u{1}", "\u{308}", "\u{2764}"]), - ("\u{1}\u{1f466}", &["\u{1}", "\u{1f466}"]), ("\u{1}\u{308}\u{1f466}", &["\u{1}", "\u{308}", - "\u{1f466}"]), ("\u{1}\u{378}", &["\u{1}", "\u{378}"]), ("\u{1}\u{308}\u{378}", &["\u{1}", - "\u{308}", "\u{378}"]), ("\u{300}\u{20}", &["\u{300}", "\u{20}"]), ("\u{300}\u{308}\u{20}", - &["\u{300}\u{308}", "\u{20}"]), ("\u{300}\u{d}", &["\u{300}", "\u{d}"]), - ("\u{300}\u{308}\u{d}", &["\u{300}\u{308}", "\u{d}"]), ("\u{300}\u{a}", &["\u{300}", - "\u{a}"]), ("\u{300}\u{308}\u{a}", &["\u{300}\u{308}", "\u{a}"]), ("\u{300}\u{1}", - &["\u{300}", "\u{1}"]), ("\u{300}\u{308}\u{1}", &["\u{300}\u{308}", "\u{1}"]), - ("\u{300}\u{300}", &["\u{300}\u{300}"]), ("\u{300}\u{308}\u{300}", - &["\u{300}\u{308}\u{300}"]), ("\u{300}\u{600}", &["\u{300}", "\u{600}"]), - ("\u{300}\u{308}\u{600}", &["\u{300}\u{308}", "\u{600}"]), ("\u{300}\u{1100}", &["\u{300}", - "\u{1100}"]), ("\u{300}\u{308}\u{1100}", &["\u{300}\u{308}", "\u{1100}"]), - ("\u{300}\u{1160}", &["\u{300}", "\u{1160}"]), ("\u{300}\u{308}\u{1160}", - &["\u{300}\u{308}", "\u{1160}"]), ("\u{300}\u{11a8}", &["\u{300}", "\u{11a8}"]), - ("\u{300}\u{308}\u{11a8}", &["\u{300}\u{308}", "\u{11a8}"]), ("\u{300}\u{ac00}", - &["\u{300}", "\u{ac00}"]), ("\u{300}\u{308}\u{ac00}", &["\u{300}\u{308}", "\u{ac00}"]), - ("\u{300}\u{ac01}", &["\u{300}", "\u{ac01}"]), ("\u{300}\u{308}\u{ac01}", - &["\u{300}\u{308}", "\u{ac01}"]), ("\u{300}\u{1f1e6}", &["\u{300}", "\u{1f1e6}"]), - ("\u{300}\u{308}\u{1f1e6}", &["\u{300}\u{308}", "\u{1f1e6}"]), ("\u{300}\u{261d}", - &["\u{300}", "\u{261d}"]), ("\u{300}\u{308}\u{261d}", &["\u{300}\u{308}", "\u{261d}"]), - ("\u{300}\u{1f3fb}", &["\u{300}", "\u{1f3fb}"]), ("\u{300}\u{308}\u{1f3fb}", - &["\u{300}\u{308}", "\u{1f3fb}"]), ("\u{300}\u{200d}", &["\u{300}\u{200d}"]), - ("\u{300}\u{308}\u{200d}", &["\u{300}\u{308}\u{200d}"]), ("\u{300}\u{2764}", &["\u{300}", - "\u{2764}"]), ("\u{300}\u{308}\u{2764}", &["\u{300}\u{308}", "\u{2764}"]), - ("\u{300}\u{1f466}", &["\u{300}", "\u{1f466}"]), ("\u{300}\u{308}\u{1f466}", - &["\u{300}\u{308}", "\u{1f466}"]), ("\u{300}\u{378}", &["\u{300}", "\u{378}"]), - ("\u{300}\u{308}\u{378}", &["\u{300}\u{308}", "\u{378}"]), ("\u{600}\u{308}\u{20}", - &["\u{600}\u{308}", "\u{20}"]), ("\u{600}\u{d}", &["\u{600}", "\u{d}"]), - ("\u{600}\u{308}\u{d}", &["\u{600}\u{308}", "\u{d}"]), ("\u{600}\u{a}", &["\u{600}", - "\u{a}"]), ("\u{600}\u{308}\u{a}", &["\u{600}\u{308}", "\u{a}"]), ("\u{600}\u{1}", - &["\u{600}", "\u{1}"]), ("\u{600}\u{308}\u{1}", &["\u{600}\u{308}", "\u{1}"]), - ("\u{600}\u{300}", &["\u{600}\u{300}"]), ("\u{600}\u{308}\u{300}", - &["\u{600}\u{308}\u{300}"]), ("\u{600}\u{308}\u{600}", &["\u{600}\u{308}", "\u{600}"]), - ("\u{600}\u{308}\u{1100}", &["\u{600}\u{308}", "\u{1100}"]), ("\u{600}\u{308}\u{1160}", - &["\u{600}\u{308}", "\u{1160}"]), ("\u{600}\u{308}\u{11a8}", &["\u{600}\u{308}", - "\u{11a8}"]), ("\u{600}\u{308}\u{ac00}", &["\u{600}\u{308}", "\u{ac00}"]), - ("\u{600}\u{308}\u{ac01}", &["\u{600}\u{308}", "\u{ac01}"]), ("\u{600}\u{308}\u{1f1e6}", - &["\u{600}\u{308}", "\u{1f1e6}"]), ("\u{600}\u{308}\u{261d}", &["\u{600}\u{308}", - "\u{261d}"]), ("\u{600}\u{308}\u{1f3fb}", &["\u{600}\u{308}", "\u{1f3fb}"]), - ("\u{600}\u{200d}", &["\u{600}\u{200d}"]), ("\u{600}\u{308}\u{200d}", - &["\u{600}\u{308}\u{200d}"]), ("\u{600}\u{308}\u{2764}", &["\u{600}\u{308}", "\u{2764}"]), - ("\u{600}\u{308}\u{1f466}", &["\u{600}\u{308}", "\u{1f466}"]), ("\u{600}\u{308}\u{378}", - &["\u{600}\u{308}", "\u{378}"]), ("\u{903}\u{20}", &["\u{903}", "\u{20}"]), - ("\u{903}\u{308}\u{20}", &["\u{903}\u{308}", "\u{20}"]), ("\u{903}\u{d}", &["\u{903}", - "\u{d}"]), ("\u{903}\u{308}\u{d}", &["\u{903}\u{308}", "\u{d}"]), ("\u{903}\u{a}", - &["\u{903}", "\u{a}"]), ("\u{903}\u{308}\u{a}", &["\u{903}\u{308}", "\u{a}"]), - ("\u{903}\u{1}", &["\u{903}", "\u{1}"]), ("\u{903}\u{308}\u{1}", &["\u{903}\u{308}", - "\u{1}"]), ("\u{903}\u{300}", &["\u{903}\u{300}"]), ("\u{903}\u{308}\u{300}", - &["\u{903}\u{308}\u{300}"]), ("\u{903}\u{600}", &["\u{903}", "\u{600}"]), - ("\u{903}\u{308}\u{600}", &["\u{903}\u{308}", "\u{600}"]), ("\u{903}\u{1100}", &["\u{903}", - "\u{1100}"]), ("\u{903}\u{308}\u{1100}", &["\u{903}\u{308}", "\u{1100}"]), - ("\u{903}\u{1160}", &["\u{903}", "\u{1160}"]), ("\u{903}\u{308}\u{1160}", - &["\u{903}\u{308}", "\u{1160}"]), ("\u{903}\u{11a8}", &["\u{903}", "\u{11a8}"]), - ("\u{903}\u{308}\u{11a8}", &["\u{903}\u{308}", "\u{11a8}"]), ("\u{903}\u{ac00}", - &["\u{903}", "\u{ac00}"]), ("\u{903}\u{308}\u{ac00}", &["\u{903}\u{308}", "\u{ac00}"]), - ("\u{903}\u{ac01}", &["\u{903}", "\u{ac01}"]), ("\u{903}\u{308}\u{ac01}", - &["\u{903}\u{308}", "\u{ac01}"]), ("\u{903}\u{1f1e6}", &["\u{903}", "\u{1f1e6}"]), - ("\u{903}\u{308}\u{1f1e6}", &["\u{903}\u{308}", "\u{1f1e6}"]), ("\u{903}\u{261d}", - &["\u{903}", "\u{261d}"]), ("\u{903}\u{308}\u{261d}", &["\u{903}\u{308}", "\u{261d}"]), - ("\u{903}\u{1f3fb}", &["\u{903}", "\u{1f3fb}"]), ("\u{903}\u{308}\u{1f3fb}", - &["\u{903}\u{308}", "\u{1f3fb}"]), ("\u{903}\u{200d}", &["\u{903}\u{200d}"]), - ("\u{903}\u{308}\u{200d}", &["\u{903}\u{308}\u{200d}"]), ("\u{903}\u{2764}", &["\u{903}", - "\u{2764}"]), ("\u{903}\u{308}\u{2764}", &["\u{903}\u{308}", "\u{2764}"]), - ("\u{903}\u{1f466}", &["\u{903}", "\u{1f466}"]), ("\u{903}\u{308}\u{1f466}", - &["\u{903}\u{308}", "\u{1f466}"]), ("\u{903}\u{378}", &["\u{903}", "\u{378}"]), - ("\u{903}\u{308}\u{378}", &["\u{903}\u{308}", "\u{378}"]), ("\u{1100}\u{20}", &["\u{1100}", - "\u{20}"]), ("\u{1100}\u{308}\u{20}", &["\u{1100}\u{308}", "\u{20}"]), ("\u{1100}\u{d}", - &["\u{1100}", "\u{d}"]), ("\u{1100}\u{308}\u{d}", &["\u{1100}\u{308}", "\u{d}"]), - ("\u{1100}\u{a}", &["\u{1100}", "\u{a}"]), ("\u{1100}\u{308}\u{a}", &["\u{1100}\u{308}", - "\u{a}"]), ("\u{1100}\u{1}", &["\u{1100}", "\u{1}"]), ("\u{1100}\u{308}\u{1}", - &["\u{1100}\u{308}", "\u{1}"]), ("\u{1100}\u{300}", &["\u{1100}\u{300}"]), - ("\u{1100}\u{308}\u{300}", &["\u{1100}\u{308}\u{300}"]), ("\u{1100}\u{600}", &["\u{1100}", - "\u{600}"]), ("\u{1100}\u{308}\u{600}", &["\u{1100}\u{308}", "\u{600}"]), - ("\u{1100}\u{1100}", &["\u{1100}\u{1100}"]), ("\u{1100}\u{308}\u{1100}", - &["\u{1100}\u{308}", "\u{1100}"]), ("\u{1100}\u{1160}", &["\u{1100}\u{1160}"]), - ("\u{1100}\u{308}\u{1160}", &["\u{1100}\u{308}", "\u{1160}"]), ("\u{1100}\u{11a8}", - &["\u{1100}", "\u{11a8}"]), ("\u{1100}\u{308}\u{11a8}", &["\u{1100}\u{308}", "\u{11a8}"]), - ("\u{1100}\u{ac00}", &["\u{1100}\u{ac00}"]), ("\u{1100}\u{308}\u{ac00}", - &["\u{1100}\u{308}", "\u{ac00}"]), ("\u{1100}\u{ac01}", &["\u{1100}\u{ac01}"]), - ("\u{1100}\u{308}\u{ac01}", &["\u{1100}\u{308}", "\u{ac01}"]), ("\u{1100}\u{1f1e6}", - &["\u{1100}", "\u{1f1e6}"]), ("\u{1100}\u{308}\u{1f1e6}", &["\u{1100}\u{308}", - "\u{1f1e6}"]), ("\u{1100}\u{261d}", &["\u{1100}", "\u{261d}"]), ("\u{1100}\u{308}\u{261d}", - &["\u{1100}\u{308}", "\u{261d}"]), ("\u{1100}\u{1f3fb}", &["\u{1100}", "\u{1f3fb}"]), - ("\u{1100}\u{308}\u{1f3fb}", &["\u{1100}\u{308}", "\u{1f3fb}"]), ("\u{1100}\u{200d}", - &["\u{1100}\u{200d}"]), ("\u{1100}\u{308}\u{200d}", &["\u{1100}\u{308}\u{200d}"]), - ("\u{1100}\u{2764}", &["\u{1100}", "\u{2764}"]), ("\u{1100}\u{308}\u{2764}", - &["\u{1100}\u{308}", "\u{2764}"]), ("\u{1100}\u{1f466}", &["\u{1100}", "\u{1f466}"]), - ("\u{1100}\u{308}\u{1f466}", &["\u{1100}\u{308}", "\u{1f466}"]), ("\u{1100}\u{378}", - &["\u{1100}", "\u{378}"]), ("\u{1100}\u{308}\u{378}", &["\u{1100}\u{308}", "\u{378}"]), - ("\u{1160}\u{20}", &["\u{1160}", "\u{20}"]), ("\u{1160}\u{308}\u{20}", &["\u{1160}\u{308}", - "\u{20}"]), ("\u{1160}\u{d}", &["\u{1160}", "\u{d}"]), ("\u{1160}\u{308}\u{d}", - &["\u{1160}\u{308}", "\u{d}"]), ("\u{1160}\u{a}", &["\u{1160}", "\u{a}"]), - ("\u{1160}\u{308}\u{a}", &["\u{1160}\u{308}", "\u{a}"]), ("\u{1160}\u{1}", &["\u{1160}", - "\u{1}"]), ("\u{1160}\u{308}\u{1}", &["\u{1160}\u{308}", "\u{1}"]), ("\u{1160}\u{300}", - &["\u{1160}\u{300}"]), ("\u{1160}\u{308}\u{300}", &["\u{1160}\u{308}\u{300}"]), - ("\u{1160}\u{600}", &["\u{1160}", "\u{600}"]), ("\u{1160}\u{308}\u{600}", - &["\u{1160}\u{308}", "\u{600}"]), ("\u{1160}\u{1100}", &["\u{1160}", "\u{1100}"]), - ("\u{1160}\u{308}\u{1100}", &["\u{1160}\u{308}", "\u{1100}"]), ("\u{1160}\u{1160}", - &["\u{1160}\u{1160}"]), ("\u{1160}\u{308}\u{1160}", &["\u{1160}\u{308}", "\u{1160}"]), - ("\u{1160}\u{11a8}", &["\u{1160}\u{11a8}"]), ("\u{1160}\u{308}\u{11a8}", - &["\u{1160}\u{308}", "\u{11a8}"]), ("\u{1160}\u{ac00}", &["\u{1160}", "\u{ac00}"]), - ("\u{1160}\u{308}\u{ac00}", &["\u{1160}\u{308}", "\u{ac00}"]), ("\u{1160}\u{ac01}", - &["\u{1160}", "\u{ac01}"]), ("\u{1160}\u{308}\u{ac01}", &["\u{1160}\u{308}", "\u{ac01}"]), - ("\u{1160}\u{1f1e6}", &["\u{1160}", "\u{1f1e6}"]), ("\u{1160}\u{308}\u{1f1e6}", - &["\u{1160}\u{308}", "\u{1f1e6}"]), ("\u{1160}\u{261d}", &["\u{1160}", "\u{261d}"]), - ("\u{1160}\u{308}\u{261d}", &["\u{1160}\u{308}", "\u{261d}"]), ("\u{1160}\u{1f3fb}", - &["\u{1160}", "\u{1f3fb}"]), ("\u{1160}\u{308}\u{1f3fb}", &["\u{1160}\u{308}", - "\u{1f3fb}"]), ("\u{1160}\u{200d}", &["\u{1160}\u{200d}"]), ("\u{1160}\u{308}\u{200d}", - &["\u{1160}\u{308}\u{200d}"]), ("\u{1160}\u{2764}", &["\u{1160}", "\u{2764}"]), - ("\u{1160}\u{308}\u{2764}", &["\u{1160}\u{308}", "\u{2764}"]), ("\u{1160}\u{1f466}", - &["\u{1160}", "\u{1f466}"]), ("\u{1160}\u{308}\u{1f466}", &["\u{1160}\u{308}", - "\u{1f466}"]), ("\u{1160}\u{378}", &["\u{1160}", "\u{378}"]), ("\u{1160}\u{308}\u{378}", - &["\u{1160}\u{308}", "\u{378}"]), ("\u{11a8}\u{20}", &["\u{11a8}", "\u{20}"]), - ("\u{11a8}\u{308}\u{20}", &["\u{11a8}\u{308}", "\u{20}"]), ("\u{11a8}\u{d}", &["\u{11a8}", - "\u{d}"]), ("\u{11a8}\u{308}\u{d}", &["\u{11a8}\u{308}", "\u{d}"]), ("\u{11a8}\u{a}", - &["\u{11a8}", "\u{a}"]), ("\u{11a8}\u{308}\u{a}", &["\u{11a8}\u{308}", "\u{a}"]), - ("\u{11a8}\u{1}", &["\u{11a8}", "\u{1}"]), ("\u{11a8}\u{308}\u{1}", &["\u{11a8}\u{308}", - "\u{1}"]), ("\u{11a8}\u{300}", &["\u{11a8}\u{300}"]), ("\u{11a8}\u{308}\u{300}", - &["\u{11a8}\u{308}\u{300}"]), ("\u{11a8}\u{600}", &["\u{11a8}", "\u{600}"]), - ("\u{11a8}\u{308}\u{600}", &["\u{11a8}\u{308}", "\u{600}"]), ("\u{11a8}\u{1100}", - &["\u{11a8}", "\u{1100}"]), ("\u{11a8}\u{308}\u{1100}", &["\u{11a8}\u{308}", "\u{1100}"]), - ("\u{11a8}\u{1160}", &["\u{11a8}", "\u{1160}"]), ("\u{11a8}\u{308}\u{1160}", - &["\u{11a8}\u{308}", "\u{1160}"]), ("\u{11a8}\u{11a8}", &["\u{11a8}\u{11a8}"]), - ("\u{11a8}\u{308}\u{11a8}", &["\u{11a8}\u{308}", "\u{11a8}"]), ("\u{11a8}\u{ac00}", - &["\u{11a8}", "\u{ac00}"]), ("\u{11a8}\u{308}\u{ac00}", &["\u{11a8}\u{308}", "\u{ac00}"]), - ("\u{11a8}\u{ac01}", &["\u{11a8}", "\u{ac01}"]), ("\u{11a8}\u{308}\u{ac01}", - &["\u{11a8}\u{308}", "\u{ac01}"]), ("\u{11a8}\u{1f1e6}", &["\u{11a8}", "\u{1f1e6}"]), - ("\u{11a8}\u{308}\u{1f1e6}", &["\u{11a8}\u{308}", "\u{1f1e6}"]), ("\u{11a8}\u{261d}", - &["\u{11a8}", "\u{261d}"]), ("\u{11a8}\u{308}\u{261d}", &["\u{11a8}\u{308}", "\u{261d}"]), - ("\u{11a8}\u{1f3fb}", &["\u{11a8}", "\u{1f3fb}"]), ("\u{11a8}\u{308}\u{1f3fb}", - &["\u{11a8}\u{308}", "\u{1f3fb}"]), ("\u{11a8}\u{200d}", &["\u{11a8}\u{200d}"]), - ("\u{11a8}\u{308}\u{200d}", &["\u{11a8}\u{308}\u{200d}"]), ("\u{11a8}\u{2764}", - &["\u{11a8}", "\u{2764}"]), ("\u{11a8}\u{308}\u{2764}", &["\u{11a8}\u{308}", "\u{2764}"]), - ("\u{11a8}\u{1f466}", &["\u{11a8}", "\u{1f466}"]), ("\u{11a8}\u{308}\u{1f466}", - &["\u{11a8}\u{308}", "\u{1f466}"]), ("\u{11a8}\u{378}", &["\u{11a8}", "\u{378}"]), - ("\u{11a8}\u{308}\u{378}", &["\u{11a8}\u{308}", "\u{378}"]), ("\u{ac00}\u{20}", - &["\u{ac00}", "\u{20}"]), ("\u{ac00}\u{308}\u{20}", &["\u{ac00}\u{308}", "\u{20}"]), - ("\u{ac00}\u{d}", &["\u{ac00}", "\u{d}"]), ("\u{ac00}\u{308}\u{d}", &["\u{ac00}\u{308}", - "\u{d}"]), ("\u{ac00}\u{a}", &["\u{ac00}", "\u{a}"]), ("\u{ac00}\u{308}\u{a}", - &["\u{ac00}\u{308}", "\u{a}"]), ("\u{ac00}\u{1}", &["\u{ac00}", "\u{1}"]), - ("\u{ac00}\u{308}\u{1}", &["\u{ac00}\u{308}", "\u{1}"]), ("\u{ac00}\u{300}", - &["\u{ac00}\u{300}"]), ("\u{ac00}\u{308}\u{300}", &["\u{ac00}\u{308}\u{300}"]), - ("\u{ac00}\u{600}", &["\u{ac00}", "\u{600}"]), ("\u{ac00}\u{308}\u{600}", - &["\u{ac00}\u{308}", "\u{600}"]), ("\u{ac00}\u{1100}", &["\u{ac00}", "\u{1100}"]), - ("\u{ac00}\u{308}\u{1100}", &["\u{ac00}\u{308}", "\u{1100}"]), ("\u{ac00}\u{1160}", - &["\u{ac00}\u{1160}"]), ("\u{ac00}\u{308}\u{1160}", &["\u{ac00}\u{308}", "\u{1160}"]), - ("\u{ac00}\u{11a8}", &["\u{ac00}\u{11a8}"]), ("\u{ac00}\u{308}\u{11a8}", - &["\u{ac00}\u{308}", "\u{11a8}"]), ("\u{ac00}\u{ac00}", &["\u{ac00}", "\u{ac00}"]), - ("\u{ac00}\u{308}\u{ac00}", &["\u{ac00}\u{308}", "\u{ac00}"]), ("\u{ac00}\u{ac01}", - &["\u{ac00}", "\u{ac01}"]), ("\u{ac00}\u{308}\u{ac01}", &["\u{ac00}\u{308}", "\u{ac01}"]), - ("\u{ac00}\u{1f1e6}", &["\u{ac00}", "\u{1f1e6}"]), ("\u{ac00}\u{308}\u{1f1e6}", - &["\u{ac00}\u{308}", "\u{1f1e6}"]), ("\u{ac00}\u{261d}", &["\u{ac00}", "\u{261d}"]), - ("\u{ac00}\u{308}\u{261d}", &["\u{ac00}\u{308}", "\u{261d}"]), ("\u{ac00}\u{1f3fb}", - &["\u{ac00}", "\u{1f3fb}"]), ("\u{ac00}\u{308}\u{1f3fb}", &["\u{ac00}\u{308}", - "\u{1f3fb}"]), ("\u{ac00}\u{200d}", &["\u{ac00}\u{200d}"]), ("\u{ac00}\u{308}\u{200d}", - &["\u{ac00}\u{308}\u{200d}"]), ("\u{ac00}\u{2764}", &["\u{ac00}", "\u{2764}"]), - ("\u{ac00}\u{308}\u{2764}", &["\u{ac00}\u{308}", "\u{2764}"]), ("\u{ac00}\u{1f466}", - &["\u{ac00}", "\u{1f466}"]), ("\u{ac00}\u{308}\u{1f466}", &["\u{ac00}\u{308}", - "\u{1f466}"]), ("\u{ac00}\u{378}", &["\u{ac00}", "\u{378}"]), ("\u{ac00}\u{308}\u{378}", - &["\u{ac00}\u{308}", "\u{378}"]), ("\u{ac01}\u{20}", &["\u{ac01}", "\u{20}"]), - ("\u{ac01}\u{308}\u{20}", &["\u{ac01}\u{308}", "\u{20}"]), ("\u{ac01}\u{d}", &["\u{ac01}", - "\u{d}"]), ("\u{ac01}\u{308}\u{d}", &["\u{ac01}\u{308}", "\u{d}"]), ("\u{ac01}\u{a}", - &["\u{ac01}", "\u{a}"]), ("\u{ac01}\u{308}\u{a}", &["\u{ac01}\u{308}", "\u{a}"]), - ("\u{ac01}\u{1}", &["\u{ac01}", "\u{1}"]), ("\u{ac01}\u{308}\u{1}", &["\u{ac01}\u{308}", - "\u{1}"]), ("\u{ac01}\u{300}", &["\u{ac01}\u{300}"]), ("\u{ac01}\u{308}\u{300}", - &["\u{ac01}\u{308}\u{300}"]), ("\u{ac01}\u{600}", &["\u{ac01}", "\u{600}"]), - ("\u{ac01}\u{308}\u{600}", &["\u{ac01}\u{308}", "\u{600}"]), ("\u{ac01}\u{1100}", - &["\u{ac01}", "\u{1100}"]), ("\u{ac01}\u{308}\u{1100}", &["\u{ac01}\u{308}", "\u{1100}"]), - ("\u{ac01}\u{1160}", &["\u{ac01}", "\u{1160}"]), ("\u{ac01}\u{308}\u{1160}", - &["\u{ac01}\u{308}", "\u{1160}"]), ("\u{ac01}\u{11a8}", &["\u{ac01}\u{11a8}"]), - ("\u{ac01}\u{308}\u{11a8}", &["\u{ac01}\u{308}", "\u{11a8}"]), ("\u{ac01}\u{ac00}", - &["\u{ac01}", "\u{ac00}"]), ("\u{ac01}\u{308}\u{ac00}", &["\u{ac01}\u{308}", "\u{ac00}"]), - ("\u{ac01}\u{ac01}", &["\u{ac01}", "\u{ac01}"]), ("\u{ac01}\u{308}\u{ac01}", - &["\u{ac01}\u{308}", "\u{ac01}"]), ("\u{ac01}\u{1f1e6}", &["\u{ac01}", "\u{1f1e6}"]), - ("\u{ac01}\u{308}\u{1f1e6}", &["\u{ac01}\u{308}", "\u{1f1e6}"]), ("\u{ac01}\u{261d}", - &["\u{ac01}", "\u{261d}"]), ("\u{ac01}\u{308}\u{261d}", &["\u{ac01}\u{308}", "\u{261d}"]), - ("\u{ac01}\u{1f3fb}", &["\u{ac01}", "\u{1f3fb}"]), ("\u{ac01}\u{308}\u{1f3fb}", - &["\u{ac01}\u{308}", "\u{1f3fb}"]), ("\u{ac01}\u{200d}", &["\u{ac01}\u{200d}"]), - ("\u{ac01}\u{308}\u{200d}", &["\u{ac01}\u{308}\u{200d}"]), ("\u{ac01}\u{2764}", - &["\u{ac01}", "\u{2764}"]), ("\u{ac01}\u{308}\u{2764}", &["\u{ac01}\u{308}", "\u{2764}"]), - ("\u{ac01}\u{1f466}", &["\u{ac01}", "\u{1f466}"]), ("\u{ac01}\u{308}\u{1f466}", - &["\u{ac01}\u{308}", "\u{1f466}"]), ("\u{ac01}\u{378}", &["\u{ac01}", "\u{378}"]), - ("\u{ac01}\u{308}\u{378}", &["\u{ac01}\u{308}", "\u{378}"]), ("\u{1f1e6}\u{20}", - &["\u{1f1e6}", "\u{20}"]), ("\u{1f1e6}\u{308}\u{20}", &["\u{1f1e6}\u{308}", "\u{20}"]), - ("\u{1f1e6}\u{d}", &["\u{1f1e6}", "\u{d}"]), ("\u{1f1e6}\u{308}\u{d}", &["\u{1f1e6}\u{308}", - "\u{d}"]), ("\u{1f1e6}\u{a}", &["\u{1f1e6}", "\u{a}"]), ("\u{1f1e6}\u{308}\u{a}", - &["\u{1f1e6}\u{308}", "\u{a}"]), ("\u{1f1e6}\u{1}", &["\u{1f1e6}", "\u{1}"]), - ("\u{1f1e6}\u{308}\u{1}", &["\u{1f1e6}\u{308}", "\u{1}"]), ("\u{1f1e6}\u{300}", - &["\u{1f1e6}\u{300}"]), ("\u{1f1e6}\u{308}\u{300}", &["\u{1f1e6}\u{308}\u{300}"]), - ("\u{1f1e6}\u{600}", &["\u{1f1e6}", "\u{600}"]), ("\u{1f1e6}\u{308}\u{600}", - &["\u{1f1e6}\u{308}", "\u{600}"]), ("\u{1f1e6}\u{1100}", &["\u{1f1e6}", "\u{1100}"]), - ("\u{1f1e6}\u{308}\u{1100}", &["\u{1f1e6}\u{308}", "\u{1100}"]), ("\u{1f1e6}\u{1160}", - &["\u{1f1e6}", "\u{1160}"]), ("\u{1f1e6}\u{308}\u{1160}", &["\u{1f1e6}\u{308}", - "\u{1160}"]), ("\u{1f1e6}\u{11a8}", &["\u{1f1e6}", "\u{11a8}"]), - ("\u{1f1e6}\u{308}\u{11a8}", &["\u{1f1e6}\u{308}", "\u{11a8}"]), ("\u{1f1e6}\u{ac00}", - &["\u{1f1e6}", "\u{ac00}"]), ("\u{1f1e6}\u{308}\u{ac00}", &["\u{1f1e6}\u{308}", - "\u{ac00}"]), ("\u{1f1e6}\u{ac01}", &["\u{1f1e6}", "\u{ac01}"]), - ("\u{1f1e6}\u{308}\u{ac01}", &["\u{1f1e6}\u{308}", "\u{ac01}"]), ("\u{1f1e6}\u{1f1e6}", - &["\u{1f1e6}\u{1f1e6}"]), ("\u{1f1e6}\u{308}\u{1f1e6}", &["\u{1f1e6}\u{308}", "\u{1f1e6}"]), - ("\u{1f1e6}\u{261d}", &["\u{1f1e6}", "\u{261d}"]), ("\u{1f1e6}\u{308}\u{261d}", - &["\u{1f1e6}\u{308}", "\u{261d}"]), ("\u{1f1e6}\u{1f3fb}", &["\u{1f1e6}", "\u{1f3fb}"]), - ("\u{1f1e6}\u{308}\u{1f3fb}", &["\u{1f1e6}\u{308}", "\u{1f3fb}"]), ("\u{1f1e6}\u{200d}", - &["\u{1f1e6}\u{200d}"]), ("\u{1f1e6}\u{308}\u{200d}", &["\u{1f1e6}\u{308}\u{200d}"]), - ("\u{1f1e6}\u{2764}", &["\u{1f1e6}", "\u{2764}"]), ("\u{1f1e6}\u{308}\u{2764}", - &["\u{1f1e6}\u{308}", "\u{2764}"]), ("\u{1f1e6}\u{1f466}", &["\u{1f1e6}", "\u{1f466}"]), - ("\u{1f1e6}\u{308}\u{1f466}", &["\u{1f1e6}\u{308}", "\u{1f466}"]), ("\u{1f1e6}\u{378}", - &["\u{1f1e6}", "\u{378}"]), ("\u{1f1e6}\u{308}\u{378}", &["\u{1f1e6}\u{308}", "\u{378}"]), - ("\u{261d}\u{20}", &["\u{261d}", "\u{20}"]), ("\u{261d}\u{308}\u{20}", &["\u{261d}\u{308}", - "\u{20}"]), ("\u{261d}\u{d}", &["\u{261d}", "\u{d}"]), ("\u{261d}\u{308}\u{d}", - &["\u{261d}\u{308}", "\u{d}"]), ("\u{261d}\u{a}", &["\u{261d}", "\u{a}"]), - ("\u{261d}\u{308}\u{a}", &["\u{261d}\u{308}", "\u{a}"]), ("\u{261d}\u{1}", &["\u{261d}", - "\u{1}"]), ("\u{261d}\u{308}\u{1}", &["\u{261d}\u{308}", "\u{1}"]), ("\u{261d}\u{300}", - &["\u{261d}\u{300}"]), ("\u{261d}\u{308}\u{300}", &["\u{261d}\u{308}\u{300}"]), - ("\u{261d}\u{600}", &["\u{261d}", "\u{600}"]), ("\u{261d}\u{308}\u{600}", - &["\u{261d}\u{308}", "\u{600}"]), ("\u{261d}\u{1100}", &["\u{261d}", "\u{1100}"]), - ("\u{261d}\u{308}\u{1100}", &["\u{261d}\u{308}", "\u{1100}"]), ("\u{261d}\u{1160}", - &["\u{261d}", "\u{1160}"]), ("\u{261d}\u{308}\u{1160}", &["\u{261d}\u{308}", "\u{1160}"]), - ("\u{261d}\u{11a8}", &["\u{261d}", "\u{11a8}"]), ("\u{261d}\u{308}\u{11a8}", - &["\u{261d}\u{308}", "\u{11a8}"]), ("\u{261d}\u{ac00}", &["\u{261d}", "\u{ac00}"]), - ("\u{261d}\u{308}\u{ac00}", &["\u{261d}\u{308}", "\u{ac00}"]), ("\u{261d}\u{ac01}", - &["\u{261d}", "\u{ac01}"]), ("\u{261d}\u{308}\u{ac01}", &["\u{261d}\u{308}", "\u{ac01}"]), - ("\u{261d}\u{1f1e6}", &["\u{261d}", "\u{1f1e6}"]), ("\u{261d}\u{308}\u{1f1e6}", - &["\u{261d}\u{308}", "\u{1f1e6}"]), ("\u{261d}\u{261d}", &["\u{261d}", "\u{261d}"]), - ("\u{261d}\u{308}\u{261d}", &["\u{261d}\u{308}", "\u{261d}"]), ("\u{261d}\u{1f3fb}", - &["\u{261d}\u{1f3fb}"]), ("\u{261d}\u{308}\u{1f3fb}", &["\u{261d}\u{308}\u{1f3fb}"]), - ("\u{261d}\u{200d}", &["\u{261d}\u{200d}"]), ("\u{261d}\u{308}\u{200d}", - &["\u{261d}\u{308}\u{200d}"]), ("\u{261d}\u{2764}", &["\u{261d}", "\u{2764}"]), - ("\u{261d}\u{308}\u{2764}", &["\u{261d}\u{308}", "\u{2764}"]), ("\u{261d}\u{1f466}", - &["\u{261d}", "\u{1f466}"]), ("\u{261d}\u{308}\u{1f466}", &["\u{261d}\u{308}", - "\u{1f466}"]), ("\u{261d}\u{378}", &["\u{261d}", "\u{378}"]), ("\u{261d}\u{308}\u{378}", - &["\u{261d}\u{308}", "\u{378}"]), ("\u{1f3fb}\u{20}", &["\u{1f3fb}", "\u{20}"]), - ("\u{1f3fb}\u{308}\u{20}", &["\u{1f3fb}\u{308}", "\u{20}"]), ("\u{1f3fb}\u{d}", - &["\u{1f3fb}", "\u{d}"]), ("\u{1f3fb}\u{308}\u{d}", &["\u{1f3fb}\u{308}", "\u{d}"]), - ("\u{1f3fb}\u{a}", &["\u{1f3fb}", "\u{a}"]), ("\u{1f3fb}\u{308}\u{a}", &["\u{1f3fb}\u{308}", - "\u{a}"]), ("\u{1f3fb}\u{1}", &["\u{1f3fb}", "\u{1}"]), ("\u{1f3fb}\u{308}\u{1}", - &["\u{1f3fb}\u{308}", "\u{1}"]), ("\u{1f3fb}\u{300}", &["\u{1f3fb}\u{300}"]), - ("\u{1f3fb}\u{308}\u{300}", &["\u{1f3fb}\u{308}\u{300}"]), ("\u{1f3fb}\u{600}", - &["\u{1f3fb}", "\u{600}"]), ("\u{1f3fb}\u{308}\u{600}", &["\u{1f3fb}\u{308}", "\u{600}"]), - ("\u{1f3fb}\u{1100}", &["\u{1f3fb}", "\u{1100}"]), ("\u{1f3fb}\u{308}\u{1100}", - &["\u{1f3fb}\u{308}", "\u{1100}"]), ("\u{1f3fb}\u{1160}", &["\u{1f3fb}", "\u{1160}"]), - ("\u{1f3fb}\u{308}\u{1160}", &["\u{1f3fb}\u{308}", "\u{1160}"]), ("\u{1f3fb}\u{11a8}", - &["\u{1f3fb}", "\u{11a8}"]), ("\u{1f3fb}\u{308}\u{11a8}", &["\u{1f3fb}\u{308}", - "\u{11a8}"]), ("\u{1f3fb}\u{ac00}", &["\u{1f3fb}", "\u{ac00}"]), - ("\u{1f3fb}\u{308}\u{ac00}", &["\u{1f3fb}\u{308}", "\u{ac00}"]), ("\u{1f3fb}\u{ac01}", - &["\u{1f3fb}", "\u{ac01}"]), ("\u{1f3fb}\u{308}\u{ac01}", &["\u{1f3fb}\u{308}", - "\u{ac01}"]), ("\u{1f3fb}\u{1f1e6}", &["\u{1f3fb}", "\u{1f1e6}"]), - ("\u{1f3fb}\u{308}\u{1f1e6}", &["\u{1f3fb}\u{308}", "\u{1f1e6}"]), ("\u{1f3fb}\u{261d}", - &["\u{1f3fb}", "\u{261d}"]), ("\u{1f3fb}\u{308}\u{261d}", &["\u{1f3fb}\u{308}", - "\u{261d}"]), ("\u{1f3fb}\u{1f3fb}", &["\u{1f3fb}", "\u{1f3fb}"]), - ("\u{1f3fb}\u{308}\u{1f3fb}", &["\u{1f3fb}\u{308}", "\u{1f3fb}"]), ("\u{1f3fb}\u{200d}", - &["\u{1f3fb}\u{200d}"]), ("\u{1f3fb}\u{308}\u{200d}", &["\u{1f3fb}\u{308}\u{200d}"]), - ("\u{1f3fb}\u{2764}", &["\u{1f3fb}", "\u{2764}"]), ("\u{1f3fb}\u{308}\u{2764}", - &["\u{1f3fb}\u{308}", "\u{2764}"]), ("\u{1f3fb}\u{1f466}", &["\u{1f3fb}", "\u{1f466}"]), - ("\u{1f3fb}\u{308}\u{1f466}", &["\u{1f3fb}\u{308}", "\u{1f466}"]), ("\u{1f3fb}\u{378}", - &["\u{1f3fb}", "\u{378}"]), ("\u{1f3fb}\u{308}\u{378}", &["\u{1f3fb}\u{308}", "\u{378}"]), - ("\u{200d}\u{20}", &["\u{200d}", "\u{20}"]), ("\u{200d}\u{308}\u{20}", &["\u{200d}\u{308}", - "\u{20}"]), ("\u{200d}\u{d}", &["\u{200d}", "\u{d}"]), ("\u{200d}\u{308}\u{d}", - &["\u{200d}\u{308}", "\u{d}"]), ("\u{200d}\u{a}", &["\u{200d}", "\u{a}"]), - ("\u{200d}\u{308}\u{a}", &["\u{200d}\u{308}", "\u{a}"]), ("\u{200d}\u{1}", &["\u{200d}", - "\u{1}"]), ("\u{200d}\u{308}\u{1}", &["\u{200d}\u{308}", "\u{1}"]), ("\u{200d}\u{300}", - &["\u{200d}\u{300}"]), ("\u{200d}\u{308}\u{300}", &["\u{200d}\u{308}\u{300}"]), - ("\u{200d}\u{600}", &["\u{200d}", "\u{600}"]), ("\u{200d}\u{308}\u{600}", - &["\u{200d}\u{308}", "\u{600}"]), ("\u{200d}\u{1100}", &["\u{200d}", "\u{1100}"]), - ("\u{200d}\u{308}\u{1100}", &["\u{200d}\u{308}", "\u{1100}"]), ("\u{200d}\u{1160}", - &["\u{200d}", "\u{1160}"]), ("\u{200d}\u{308}\u{1160}", &["\u{200d}\u{308}", "\u{1160}"]), - ("\u{200d}\u{11a8}", &["\u{200d}", "\u{11a8}"]), ("\u{200d}\u{308}\u{11a8}", - &["\u{200d}\u{308}", "\u{11a8}"]), ("\u{200d}\u{ac00}", &["\u{200d}", "\u{ac00}"]), - ("\u{200d}\u{308}\u{ac00}", &["\u{200d}\u{308}", "\u{ac00}"]), ("\u{200d}\u{ac01}", - &["\u{200d}", "\u{ac01}"]), ("\u{200d}\u{308}\u{ac01}", &["\u{200d}\u{308}", "\u{ac01}"]), - ("\u{200d}\u{1f1e6}", &["\u{200d}", "\u{1f1e6}"]), ("\u{200d}\u{308}\u{1f1e6}", - &["\u{200d}\u{308}", "\u{1f1e6}"]), ("\u{200d}\u{261d}", &["\u{200d}", "\u{261d}"]), - ("\u{200d}\u{308}\u{261d}", &["\u{200d}\u{308}", "\u{261d}"]), ("\u{200d}\u{1f3fb}", - &["\u{200d}", "\u{1f3fb}"]), ("\u{200d}\u{308}\u{1f3fb}", &["\u{200d}\u{308}", - "\u{1f3fb}"]), ("\u{200d}\u{200d}", &["\u{200d}\u{200d}"]), ("\u{200d}\u{308}\u{200d}", - &["\u{200d}\u{308}\u{200d}"]), ("\u{200d}\u{2764}", &["\u{200d}\u{2764}"]), - ("\u{200d}\u{308}\u{2764}", &["\u{200d}\u{308}", "\u{2764}"]), ("\u{200d}\u{1f466}", - &["\u{200d}\u{1f466}"]), ("\u{200d}\u{308}\u{1f466}", &["\u{200d}\u{308}", "\u{1f466}"]), - ("\u{200d}\u{378}", &["\u{200d}", "\u{378}"]), ("\u{200d}\u{308}\u{378}", - &["\u{200d}\u{308}", "\u{378}"]), ("\u{2764}\u{20}", &["\u{2764}", "\u{20}"]), - ("\u{2764}\u{308}\u{20}", &["\u{2764}\u{308}", "\u{20}"]), ("\u{2764}\u{d}", &["\u{2764}", - "\u{d}"]), ("\u{2764}\u{308}\u{d}", &["\u{2764}\u{308}", "\u{d}"]), ("\u{2764}\u{a}", - &["\u{2764}", "\u{a}"]), ("\u{2764}\u{308}\u{a}", &["\u{2764}\u{308}", "\u{a}"]), - ("\u{2764}\u{1}", &["\u{2764}", "\u{1}"]), ("\u{2764}\u{308}\u{1}", &["\u{2764}\u{308}", - "\u{1}"]), ("\u{2764}\u{300}", &["\u{2764}\u{300}"]), ("\u{2764}\u{308}\u{300}", - &["\u{2764}\u{308}\u{300}"]), ("\u{2764}\u{600}", &["\u{2764}", "\u{600}"]), - ("\u{2764}\u{308}\u{600}", &["\u{2764}\u{308}", "\u{600}"]), ("\u{2764}\u{1100}", - &["\u{2764}", "\u{1100}"]), ("\u{2764}\u{308}\u{1100}", &["\u{2764}\u{308}", "\u{1100}"]), - ("\u{2764}\u{1160}", &["\u{2764}", "\u{1160}"]), ("\u{2764}\u{308}\u{1160}", - &["\u{2764}\u{308}", "\u{1160}"]), ("\u{2764}\u{11a8}", &["\u{2764}", "\u{11a8}"]), - ("\u{2764}\u{308}\u{11a8}", &["\u{2764}\u{308}", "\u{11a8}"]), ("\u{2764}\u{ac00}", - &["\u{2764}", "\u{ac00}"]), ("\u{2764}\u{308}\u{ac00}", &["\u{2764}\u{308}", "\u{ac00}"]), - ("\u{2764}\u{ac01}", &["\u{2764}", "\u{ac01}"]), ("\u{2764}\u{308}\u{ac01}", - &["\u{2764}\u{308}", "\u{ac01}"]), ("\u{2764}\u{1f1e6}", &["\u{2764}", "\u{1f1e6}"]), - ("\u{2764}\u{308}\u{1f1e6}", &["\u{2764}\u{308}", "\u{1f1e6}"]), ("\u{2764}\u{261d}", - &["\u{2764}", "\u{261d}"]), ("\u{2764}\u{308}\u{261d}", &["\u{2764}\u{308}", "\u{261d}"]), - ("\u{2764}\u{1f3fb}", &["\u{2764}", "\u{1f3fb}"]), ("\u{2764}\u{308}\u{1f3fb}", - &["\u{2764}\u{308}", "\u{1f3fb}"]), ("\u{2764}\u{200d}", &["\u{2764}\u{200d}"]), - ("\u{2764}\u{308}\u{200d}", &["\u{2764}\u{308}\u{200d}"]), ("\u{2764}\u{2764}", - &["\u{2764}", "\u{2764}"]), ("\u{2764}\u{308}\u{2764}", &["\u{2764}\u{308}", "\u{2764}"]), - ("\u{2764}\u{1f466}", &["\u{2764}", "\u{1f466}"]), ("\u{2764}\u{308}\u{1f466}", - &["\u{2764}\u{308}", "\u{1f466}"]), ("\u{2764}\u{378}", &["\u{2764}", "\u{378}"]), - ("\u{2764}\u{308}\u{378}", &["\u{2764}\u{308}", "\u{378}"]), ("\u{1f466}\u{20}", - &["\u{1f466}", "\u{20}"]), ("\u{1f466}\u{308}\u{20}", &["\u{1f466}\u{308}", "\u{20}"]), - ("\u{1f466}\u{d}", &["\u{1f466}", "\u{d}"]), ("\u{1f466}\u{308}\u{d}", &["\u{1f466}\u{308}", - "\u{d}"]), ("\u{1f466}\u{a}", &["\u{1f466}", "\u{a}"]), ("\u{1f466}\u{308}\u{a}", - &["\u{1f466}\u{308}", "\u{a}"]), ("\u{1f466}\u{1}", &["\u{1f466}", "\u{1}"]), - ("\u{1f466}\u{308}\u{1}", &["\u{1f466}\u{308}", "\u{1}"]), ("\u{1f466}\u{300}", - &["\u{1f466}\u{300}"]), ("\u{1f466}\u{308}\u{300}", &["\u{1f466}\u{308}\u{300}"]), - ("\u{1f466}\u{600}", &["\u{1f466}", "\u{600}"]), ("\u{1f466}\u{308}\u{600}", - &["\u{1f466}\u{308}", "\u{600}"]), ("\u{1f466}\u{1100}", &["\u{1f466}", "\u{1100}"]), - ("\u{1f466}\u{308}\u{1100}", &["\u{1f466}\u{308}", "\u{1100}"]), ("\u{1f466}\u{1160}", - &["\u{1f466}", "\u{1160}"]), ("\u{1f466}\u{308}\u{1160}", &["\u{1f466}\u{308}", - "\u{1160}"]), ("\u{1f466}\u{11a8}", &["\u{1f466}", "\u{11a8}"]), - ("\u{1f466}\u{308}\u{11a8}", &["\u{1f466}\u{308}", "\u{11a8}"]), ("\u{1f466}\u{ac00}", - &["\u{1f466}", "\u{ac00}"]), ("\u{1f466}\u{308}\u{ac00}", &["\u{1f466}\u{308}", - "\u{ac00}"]), ("\u{1f466}\u{ac01}", &["\u{1f466}", "\u{ac01}"]), - ("\u{1f466}\u{308}\u{ac01}", &["\u{1f466}\u{308}", "\u{ac01}"]), ("\u{1f466}\u{1f1e6}", - &["\u{1f466}", "\u{1f1e6}"]), ("\u{1f466}\u{308}\u{1f1e6}", &["\u{1f466}\u{308}", - "\u{1f1e6}"]), ("\u{1f466}\u{261d}", &["\u{1f466}", "\u{261d}"]), - ("\u{1f466}\u{308}\u{261d}", &["\u{1f466}\u{308}", "\u{261d}"]), ("\u{1f466}\u{1f3fb}", - &["\u{1f466}\u{1f3fb}"]), ("\u{1f466}\u{308}\u{1f3fb}", &["\u{1f466}\u{308}\u{1f3fb}"]), - ("\u{1f466}\u{200d}", &["\u{1f466}\u{200d}"]), ("\u{1f466}\u{308}\u{200d}", - &["\u{1f466}\u{308}\u{200d}"]), ("\u{1f466}\u{2764}", &["\u{1f466}", "\u{2764}"]), - ("\u{1f466}\u{308}\u{2764}", &["\u{1f466}\u{308}", "\u{2764}"]), ("\u{1f466}\u{1f466}", - &["\u{1f466}", "\u{1f466}"]), ("\u{1f466}\u{308}\u{1f466}", &["\u{1f466}\u{308}", - "\u{1f466}"]), ("\u{1f466}\u{378}", &["\u{1f466}", "\u{378}"]), ("\u{1f466}\u{308}\u{378}", - &["\u{1f466}\u{308}", "\u{378}"]), ("\u{378}\u{20}", &["\u{378}", "\u{20}"]), - ("\u{378}\u{308}\u{20}", &["\u{378}\u{308}", "\u{20}"]), ("\u{378}\u{d}", &["\u{378}", - "\u{d}"]), ("\u{378}\u{308}\u{d}", &["\u{378}\u{308}", "\u{d}"]), ("\u{378}\u{a}", - &["\u{378}", "\u{a}"]), ("\u{378}\u{308}\u{a}", &["\u{378}\u{308}", "\u{a}"]), - ("\u{378}\u{1}", &["\u{378}", "\u{1}"]), ("\u{378}\u{308}\u{1}", &["\u{378}\u{308}", - "\u{1}"]), ("\u{378}\u{300}", &["\u{378}\u{300}"]), ("\u{378}\u{308}\u{300}", - &["\u{378}\u{308}\u{300}"]), ("\u{378}\u{600}", &["\u{378}", "\u{600}"]), - ("\u{378}\u{308}\u{600}", &["\u{378}\u{308}", "\u{600}"]), ("\u{378}\u{1100}", &["\u{378}", - "\u{1100}"]), ("\u{378}\u{308}\u{1100}", &["\u{378}\u{308}", "\u{1100}"]), - ("\u{378}\u{1160}", &["\u{378}", "\u{1160}"]), ("\u{378}\u{308}\u{1160}", - &["\u{378}\u{308}", "\u{1160}"]), ("\u{378}\u{11a8}", &["\u{378}", "\u{11a8}"]), - ("\u{378}\u{308}\u{11a8}", &["\u{378}\u{308}", "\u{11a8}"]), ("\u{378}\u{ac00}", - &["\u{378}", "\u{ac00}"]), ("\u{378}\u{308}\u{ac00}", &["\u{378}\u{308}", "\u{ac00}"]), - ("\u{378}\u{ac01}", &["\u{378}", "\u{ac01}"]), ("\u{378}\u{308}\u{ac01}", - &["\u{378}\u{308}", "\u{ac01}"]), ("\u{378}\u{1f1e6}", &["\u{378}", "\u{1f1e6}"]), - ("\u{378}\u{308}\u{1f1e6}", &["\u{378}\u{308}", "\u{1f1e6}"]), ("\u{378}\u{261d}", - &["\u{378}", "\u{261d}"]), ("\u{378}\u{308}\u{261d}", &["\u{378}\u{308}", "\u{261d}"]), - ("\u{378}\u{1f3fb}", &["\u{378}", "\u{1f3fb}"]), ("\u{378}\u{308}\u{1f3fb}", - &["\u{378}\u{308}", "\u{1f3fb}"]), ("\u{378}\u{200d}", &["\u{378}\u{200d}"]), - ("\u{378}\u{308}\u{200d}", &["\u{378}\u{308}\u{200d}"]), ("\u{378}\u{2764}", &["\u{378}", - "\u{2764}"]), ("\u{378}\u{308}\u{2764}", &["\u{378}\u{308}", "\u{2764}"]), - ("\u{378}\u{1f466}", &["\u{378}", "\u{1f466}"]), ("\u{378}\u{308}\u{1f466}", - &["\u{378}\u{308}", "\u{1f466}"]), ("\u{378}\u{378}", &["\u{378}", "\u{378}"]), - ("\u{378}\u{308}\u{378}", &["\u{378}\u{308}", "\u{378}"]), ("\u{d}\u{a}\u{61}\u{a}\u{308}", - &["\u{d}\u{a}", "\u{61}", "\u{a}", "\u{308}"]), ("\u{61}\u{308}", &["\u{61}\u{308}"]), - ("\u{20}\u{200d}\u{646}", &["\u{20}\u{200d}", "\u{646}"]), ("\u{646}\u{200d}\u{20}", - &["\u{646}\u{200d}", "\u{20}"]), ("\u{1100}\u{1100}", &["\u{1100}\u{1100}"]), - ("\u{ac00}\u{11a8}\u{1100}", &["\u{ac00}\u{11a8}", "\u{1100}"]), - ("\u{ac01}\u{11a8}\u{1100}", &["\u{ac01}\u{11a8}", "\u{1100}"]), - ("\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{62}", &["\u{1f1e6}\u{1f1e7}", "\u{1f1e8}", "\u{62}"]), - ("\u{61}\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{62}", &["\u{61}", "\u{1f1e6}\u{1f1e7}", "\u{1f1e8}", - "\u{62}"]), ("\u{61}\u{1f1e6}\u{1f1e7}\u{200d}\u{1f1e8}\u{62}", &["\u{61}", - "\u{1f1e6}\u{1f1e7}\u{200d}", "\u{1f1e8}", "\u{62}"]), - ("\u{61}\u{1f1e6}\u{200d}\u{1f1e7}\u{1f1e8}\u{62}", &["\u{61}", "\u{1f1e6}\u{200d}", - "\u{1f1e7}\u{1f1e8}", "\u{62}"]), ("\u{61}\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{1f1e9}\u{62}", - &["\u{61}", "\u{1f1e6}\u{1f1e7}", "\u{1f1e8}\u{1f1e9}", "\u{62}"]), ("\u{61}\u{200d}", - &["\u{61}\u{200d}"]), ("\u{61}\u{308}\u{62}", &["\u{61}\u{308}", "\u{62}"]), - ("\u{261d}\u{1f3fb}\u{261d}", &["\u{261d}\u{1f3fb}", "\u{261d}"]), ("\u{1f466}\u{1f3fb}", - &["\u{1f466}\u{1f3fb}"]), ("\u{200d}\u{1f466}\u{1f3fb}", &["\u{200d}\u{1f466}\u{1f3fb}"]), - ("\u{200d}\u{2764}", &["\u{200d}\u{2764}"]), ("\u{200d}\u{1f466}", &["\u{200d}\u{1f466}"]), - ("\u{1f466}\u{1f466}", &["\u{1f466}", "\u{1f466}"]) - ]; - - pub const TEST_DIFF: &'static [(&'static str, &'static [&'static str], &'static [&'static str])] = &[ - ("\u{20}\u{903}", &["\u{20}\u{903}"], &["\u{20}", "\u{903}"]), ("\u{20}\u{308}\u{903}", - &["\u{20}\u{308}\u{903}"], &["\u{20}\u{308}", "\u{903}"]), ("\u{d}\u{308}\u{903}", - &["\u{d}", "\u{308}\u{903}"], &["\u{d}", "\u{308}", "\u{903}"]), ("\u{a}\u{308}\u{903}", - &["\u{a}", "\u{308}\u{903}"], &["\u{a}", "\u{308}", "\u{903}"]), ("\u{1}\u{308}\u{903}", - &["\u{1}", "\u{308}\u{903}"], &["\u{1}", "\u{308}", "\u{903}"]), ("\u{300}\u{903}", - &["\u{300}\u{903}"], &["\u{300}", "\u{903}"]), ("\u{300}\u{308}\u{903}", - &["\u{300}\u{308}\u{903}"], &["\u{300}\u{308}", "\u{903}"]), ("\u{600}\u{20}", - &["\u{600}\u{20}"], &["\u{600}", "\u{20}"]), ("\u{600}\u{600}", &["\u{600}\u{600}"], - &["\u{600}", "\u{600}"]), ("\u{600}\u{903}", &["\u{600}\u{903}"], &["\u{600}", "\u{903}"]), - ("\u{600}\u{308}\u{903}", &["\u{600}\u{308}\u{903}"], &["\u{600}\u{308}", "\u{903}"]), - ("\u{600}\u{1100}", &["\u{600}\u{1100}"], &["\u{600}", "\u{1100}"]), ("\u{600}\u{1160}", - &["\u{600}\u{1160}"], &["\u{600}", "\u{1160}"]), ("\u{600}\u{11a8}", &["\u{600}\u{11a8}"], - &["\u{600}", "\u{11a8}"]), ("\u{600}\u{ac00}", &["\u{600}\u{ac00}"], &["\u{600}", - "\u{ac00}"]), ("\u{600}\u{ac01}", &["\u{600}\u{ac01}"], &["\u{600}", "\u{ac01}"]), - ("\u{600}\u{1f1e6}", &["\u{600}\u{1f1e6}"], &["\u{600}", "\u{1f1e6}"]), ("\u{600}\u{261d}", - &["\u{600}\u{261d}"], &["\u{600}", "\u{261d}"]), ("\u{600}\u{1f3fb}", &["\u{600}\u{1f3fb}"], - &["\u{600}", "\u{1f3fb}"]), ("\u{600}\u{2764}", &["\u{600}\u{2764}"], &["\u{600}", - "\u{2764}"]), ("\u{600}\u{1f466}", &["\u{600}\u{1f466}"], &["\u{600}", "\u{1f466}"]), - ("\u{600}\u{378}", &["\u{600}\u{378}"], &["\u{600}", "\u{378}"]), ("\u{903}\u{903}", - &["\u{903}\u{903}"], &["\u{903}", "\u{903}"]), ("\u{903}\u{308}\u{903}", - &["\u{903}\u{308}\u{903}"], &["\u{903}\u{308}", "\u{903}"]), ("\u{1100}\u{903}", - &["\u{1100}\u{903}"], &["\u{1100}", "\u{903}"]), ("\u{1100}\u{308}\u{903}", - &["\u{1100}\u{308}\u{903}"], &["\u{1100}\u{308}", "\u{903}"]), ("\u{1160}\u{903}", - &["\u{1160}\u{903}"], &["\u{1160}", "\u{903}"]), ("\u{1160}\u{308}\u{903}", - &["\u{1160}\u{308}\u{903}"], &["\u{1160}\u{308}", "\u{903}"]), ("\u{11a8}\u{903}", - &["\u{11a8}\u{903}"], &["\u{11a8}", "\u{903}"]), ("\u{11a8}\u{308}\u{903}", - &["\u{11a8}\u{308}\u{903}"], &["\u{11a8}\u{308}", "\u{903}"]), ("\u{ac00}\u{903}", - &["\u{ac00}\u{903}"], &["\u{ac00}", "\u{903}"]), ("\u{ac00}\u{308}\u{903}", - &["\u{ac00}\u{308}\u{903}"], &["\u{ac00}\u{308}", "\u{903}"]), ("\u{ac01}\u{903}", - &["\u{ac01}\u{903}"], &["\u{ac01}", "\u{903}"]), ("\u{ac01}\u{308}\u{903}", - &["\u{ac01}\u{308}\u{903}"], &["\u{ac01}\u{308}", "\u{903}"]), ("\u{1f1e6}\u{903}", - &["\u{1f1e6}\u{903}"], &["\u{1f1e6}", "\u{903}"]), ("\u{1f1e6}\u{308}\u{903}", - &["\u{1f1e6}\u{308}\u{903}"], &["\u{1f1e6}\u{308}", "\u{903}"]), ("\u{261d}\u{903}", - &["\u{261d}\u{903}"], &["\u{261d}", "\u{903}"]), ("\u{261d}\u{308}\u{903}", - &["\u{261d}\u{308}\u{903}"], &["\u{261d}\u{308}", "\u{903}"]), ("\u{1f3fb}\u{903}", - &["\u{1f3fb}\u{903}"], &["\u{1f3fb}", "\u{903}"]), ("\u{1f3fb}\u{308}\u{903}", - &["\u{1f3fb}\u{308}\u{903}"], &["\u{1f3fb}\u{308}", "\u{903}"]), ("\u{200d}\u{903}", - &["\u{200d}\u{903}"], &["\u{200d}", "\u{903}"]), ("\u{200d}\u{308}\u{903}", - &["\u{200d}\u{308}\u{903}"], &["\u{200d}\u{308}", "\u{903}"]), ("\u{2764}\u{903}", - &["\u{2764}\u{903}"], &["\u{2764}", "\u{903}"]), ("\u{2764}\u{308}\u{903}", - &["\u{2764}\u{308}\u{903}"], &["\u{2764}\u{308}", "\u{903}"]), ("\u{1f466}\u{903}", - &["\u{1f466}\u{903}"], &["\u{1f466}", "\u{903}"]), ("\u{1f466}\u{308}\u{903}", - &["\u{1f466}\u{308}\u{903}"], &["\u{1f466}\u{308}", "\u{903}"]), ("\u{378}\u{903}", - &["\u{378}\u{903}"], &["\u{378}", "\u{903}"]), ("\u{378}\u{308}\u{903}", - &["\u{378}\u{308}\u{903}"], &["\u{378}\u{308}", "\u{903}"]), ("\u{61}\u{903}\u{62}", - &["\u{61}\u{903}", "\u{62}"], &["\u{61}", "\u{903}", "\u{62}"]), ("\u{61}\u{600}\u{62}", - &["\u{61}", "\u{600}\u{62}"], &["\u{61}", "\u{600}", "\u{62}"]) - ]; - - // official Unicode test data - // http://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakTest.txt - pub const TEST_WORD: &'static [(&'static str, &'static [&'static str])] = &[ - ("\u{1}\u{1}", &["\u{1}", "\u{1}"]), ("\u{1}\u{308}\u{1}", &["\u{1}\u{308}", "\u{1}"]), - ("\u{1}\u{d}", &["\u{1}", "\u{d}"]), ("\u{1}\u{308}\u{d}", &["\u{1}\u{308}", "\u{d}"]), - ("\u{1}\u{a}", &["\u{1}", "\u{a}"]), ("\u{1}\u{308}\u{a}", &["\u{1}\u{308}", "\u{a}"]), - ("\u{1}\u{b}", &["\u{1}", "\u{b}"]), ("\u{1}\u{308}\u{b}", &["\u{1}\u{308}", "\u{b}"]), - ("\u{1}\u{3031}", &["\u{1}", "\u{3031}"]), ("\u{1}\u{308}\u{3031}", &["\u{1}\u{308}", - "\u{3031}"]), ("\u{1}\u{41}", &["\u{1}", "\u{41}"]), ("\u{1}\u{308}\u{41}", - &["\u{1}\u{308}", "\u{41}"]), ("\u{1}\u{3a}", &["\u{1}", "\u{3a}"]), ("\u{1}\u{308}\u{3a}", - &["\u{1}\u{308}", "\u{3a}"]), ("\u{1}\u{2c}", &["\u{1}", "\u{2c}"]), ("\u{1}\u{308}\u{2c}", - &["\u{1}\u{308}", "\u{2c}"]), ("\u{1}\u{2e}", &["\u{1}", "\u{2e}"]), ("\u{1}\u{308}\u{2e}", - &["\u{1}\u{308}", "\u{2e}"]), ("\u{1}\u{30}", &["\u{1}", "\u{30}"]), ("\u{1}\u{308}\u{30}", - &["\u{1}\u{308}", "\u{30}"]), ("\u{1}\u{5f}", &["\u{1}", "\u{5f}"]), ("\u{1}\u{308}\u{5f}", - &["\u{1}\u{308}", "\u{5f}"]), ("\u{1}\u{1f1e6}", &["\u{1}", "\u{1f1e6}"]), - ("\u{1}\u{308}\u{1f1e6}", &["\u{1}\u{308}", "\u{1f1e6}"]), ("\u{1}\u{5d0}", &["\u{1}", - "\u{5d0}"]), ("\u{1}\u{308}\u{5d0}", &["\u{1}\u{308}", "\u{5d0}"]), ("\u{1}\u{22}", - &["\u{1}", "\u{22}"]), ("\u{1}\u{308}\u{22}", &["\u{1}\u{308}", "\u{22}"]), ("\u{1}\u{27}", - &["\u{1}", "\u{27}"]), ("\u{1}\u{308}\u{27}", &["\u{1}\u{308}", "\u{27}"]), - ("\u{1}\u{261d}", &["\u{1}", "\u{261d}"]), ("\u{1}\u{308}\u{261d}", &["\u{1}\u{308}", - "\u{261d}"]), ("\u{1}\u{1f3fb}", &["\u{1}", "\u{1f3fb}"]), ("\u{1}\u{308}\u{1f3fb}", - &["\u{1}\u{308}", "\u{1f3fb}"]), ("\u{1}\u{2764}", &["\u{1}", "\u{2764}"]), - ("\u{1}\u{308}\u{2764}", &["\u{1}\u{308}", "\u{2764}"]), ("\u{1}\u{1f466}", &["\u{1}", - "\u{1f466}"]), ("\u{1}\u{308}\u{1f466}", &["\u{1}\u{308}", "\u{1f466}"]), ("\u{1}\u{ad}", - &["\u{1}\u{ad}"]), ("\u{1}\u{308}\u{ad}", &["\u{1}\u{308}\u{ad}"]), ("\u{1}\u{300}", - &["\u{1}\u{300}"]), ("\u{1}\u{308}\u{300}", &["\u{1}\u{308}\u{300}"]), ("\u{1}\u{200d}", - &["\u{1}\u{200d}"]), ("\u{1}\u{308}\u{200d}", &["\u{1}\u{308}\u{200d}"]), - ("\u{1}\u{61}\u{2060}", &["\u{1}", "\u{61}\u{2060}"]), ("\u{1}\u{308}\u{61}\u{2060}", - &["\u{1}\u{308}", "\u{61}\u{2060}"]), ("\u{1}\u{61}\u{3a}", &["\u{1}", "\u{61}", "\u{3a}"]), - ("\u{1}\u{308}\u{61}\u{3a}", &["\u{1}\u{308}", "\u{61}", "\u{3a}"]), ("\u{1}\u{61}\u{27}", - &["\u{1}", "\u{61}", "\u{27}"]), ("\u{1}\u{308}\u{61}\u{27}", &["\u{1}\u{308}", "\u{61}", - "\u{27}"]), ("\u{1}\u{61}\u{27}\u{2060}", &["\u{1}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1}\u{308}\u{61}\u{27}\u{2060}", &["\u{1}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1}\u{61}\u{2c}", &["\u{1}", "\u{61}", "\u{2c}"]), ("\u{1}\u{308}\u{61}\u{2c}", - &["\u{1}\u{308}", "\u{61}", "\u{2c}"]), ("\u{1}\u{31}\u{3a}", &["\u{1}", "\u{31}", - "\u{3a}"]), ("\u{1}\u{308}\u{31}\u{3a}", &["\u{1}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{1}\u{31}\u{27}", &["\u{1}", "\u{31}", "\u{27}"]), ("\u{1}\u{308}\u{31}\u{27}", - &["\u{1}\u{308}", "\u{31}", "\u{27}"]), ("\u{1}\u{31}\u{2c}", &["\u{1}", "\u{31}", - "\u{2c}"]), ("\u{1}\u{308}\u{31}\u{2c}", &["\u{1}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{1}\u{31}\u{2e}\u{2060}", &["\u{1}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1}\u{308}\u{31}\u{2e}\u{2060}", &["\u{1}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{d}\u{1}", &["\u{d}", "\u{1}"]), ("\u{d}\u{308}\u{1}", &["\u{d}", "\u{308}", "\u{1}"]), - ("\u{d}\u{d}", &["\u{d}", "\u{d}"]), ("\u{d}\u{308}\u{d}", &["\u{d}", "\u{308}", "\u{d}"]), - ("\u{d}\u{a}", &["\u{d}\u{a}"]), ("\u{d}\u{308}\u{a}", &["\u{d}", "\u{308}", "\u{a}"]), - ("\u{d}\u{b}", &["\u{d}", "\u{b}"]), ("\u{d}\u{308}\u{b}", &["\u{d}", "\u{308}", "\u{b}"]), - ("\u{d}\u{3031}", &["\u{d}", "\u{3031}"]), ("\u{d}\u{308}\u{3031}", &["\u{d}", "\u{308}", - "\u{3031}"]), ("\u{d}\u{41}", &["\u{d}", "\u{41}"]), ("\u{d}\u{308}\u{41}", &["\u{d}", - "\u{308}", "\u{41}"]), ("\u{d}\u{3a}", &["\u{d}", "\u{3a}"]), ("\u{d}\u{308}\u{3a}", - &["\u{d}", "\u{308}", "\u{3a}"]), ("\u{d}\u{2c}", &["\u{d}", "\u{2c}"]), - ("\u{d}\u{308}\u{2c}", &["\u{d}", "\u{308}", "\u{2c}"]), ("\u{d}\u{2e}", &["\u{d}", - "\u{2e}"]), ("\u{d}\u{308}\u{2e}", &["\u{d}", "\u{308}", "\u{2e}"]), ("\u{d}\u{30}", - &["\u{d}", "\u{30}"]), ("\u{d}\u{308}\u{30}", &["\u{d}", "\u{308}", "\u{30}"]), - ("\u{d}\u{5f}", &["\u{d}", "\u{5f}"]), ("\u{d}\u{308}\u{5f}", &["\u{d}", "\u{308}", - "\u{5f}"]), ("\u{d}\u{1f1e6}", &["\u{d}", "\u{1f1e6}"]), ("\u{d}\u{308}\u{1f1e6}", - &["\u{d}", "\u{308}", "\u{1f1e6}"]), ("\u{d}\u{5d0}", &["\u{d}", "\u{5d0}"]), - ("\u{d}\u{308}\u{5d0}", &["\u{d}", "\u{308}", "\u{5d0}"]), ("\u{d}\u{22}", &["\u{d}", - "\u{22}"]), ("\u{d}\u{308}\u{22}", &["\u{d}", "\u{308}", "\u{22}"]), ("\u{d}\u{27}", - &["\u{d}", "\u{27}"]), ("\u{d}\u{308}\u{27}", &["\u{d}", "\u{308}", "\u{27}"]), - ("\u{d}\u{261d}", &["\u{d}", "\u{261d}"]), ("\u{d}\u{308}\u{261d}", &["\u{d}", "\u{308}", - "\u{261d}"]), ("\u{d}\u{1f3fb}", &["\u{d}", "\u{1f3fb}"]), ("\u{d}\u{308}\u{1f3fb}", - &["\u{d}", "\u{308}", "\u{1f3fb}"]), ("\u{d}\u{2764}", &["\u{d}", "\u{2764}"]), - ("\u{d}\u{308}\u{2764}", &["\u{d}", "\u{308}", "\u{2764}"]), ("\u{d}\u{1f466}", &["\u{d}", - "\u{1f466}"]), ("\u{d}\u{308}\u{1f466}", &["\u{d}", "\u{308}", "\u{1f466}"]), - ("\u{d}\u{ad}", &["\u{d}", "\u{ad}"]), ("\u{d}\u{308}\u{ad}", &["\u{d}", "\u{308}\u{ad}"]), - ("\u{d}\u{300}", &["\u{d}", "\u{300}"]), ("\u{d}\u{308}\u{300}", &["\u{d}", - "\u{308}\u{300}"]), ("\u{d}\u{200d}", &["\u{d}", "\u{200d}"]), ("\u{d}\u{308}\u{200d}", - &["\u{d}", "\u{308}\u{200d}"]), ("\u{d}\u{61}\u{2060}", &["\u{d}", "\u{61}\u{2060}"]), - ("\u{d}\u{308}\u{61}\u{2060}", &["\u{d}", "\u{308}", "\u{61}\u{2060}"]), - ("\u{d}\u{61}\u{3a}", &["\u{d}", "\u{61}", "\u{3a}"]), ("\u{d}\u{308}\u{61}\u{3a}", - &["\u{d}", "\u{308}", "\u{61}", "\u{3a}"]), ("\u{d}\u{61}\u{27}", &["\u{d}", "\u{61}", - "\u{27}"]), ("\u{d}\u{308}\u{61}\u{27}", &["\u{d}", "\u{308}", "\u{61}", "\u{27}"]), - ("\u{d}\u{61}\u{27}\u{2060}", &["\u{d}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{d}\u{308}\u{61}\u{27}\u{2060}", &["\u{d}", "\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{d}\u{61}\u{2c}", &["\u{d}", "\u{61}", "\u{2c}"]), ("\u{d}\u{308}\u{61}\u{2c}", - &["\u{d}", "\u{308}", "\u{61}", "\u{2c}"]), ("\u{d}\u{31}\u{3a}", &["\u{d}", "\u{31}", - "\u{3a}"]), ("\u{d}\u{308}\u{31}\u{3a}", &["\u{d}", "\u{308}", "\u{31}", "\u{3a}"]), - ("\u{d}\u{31}\u{27}", &["\u{d}", "\u{31}", "\u{27}"]), ("\u{d}\u{308}\u{31}\u{27}", - &["\u{d}", "\u{308}", "\u{31}", "\u{27}"]), ("\u{d}\u{31}\u{2c}", &["\u{d}", "\u{31}", - "\u{2c}"]), ("\u{d}\u{308}\u{31}\u{2c}", &["\u{d}", "\u{308}", "\u{31}", "\u{2c}"]), - ("\u{d}\u{31}\u{2e}\u{2060}", &["\u{d}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{d}\u{308}\u{31}\u{2e}\u{2060}", &["\u{d}", "\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{a}\u{1}", &["\u{a}", "\u{1}"]), ("\u{a}\u{308}\u{1}", &["\u{a}", "\u{308}", "\u{1}"]), - ("\u{a}\u{d}", &["\u{a}", "\u{d}"]), ("\u{a}\u{308}\u{d}", &["\u{a}", "\u{308}", "\u{d}"]), - ("\u{a}\u{a}", &["\u{a}", "\u{a}"]), ("\u{a}\u{308}\u{a}", &["\u{a}", "\u{308}", "\u{a}"]), - ("\u{a}\u{b}", &["\u{a}", "\u{b}"]), ("\u{a}\u{308}\u{b}", &["\u{a}", "\u{308}", "\u{b}"]), - ("\u{a}\u{3031}", &["\u{a}", "\u{3031}"]), ("\u{a}\u{308}\u{3031}", &["\u{a}", "\u{308}", - "\u{3031}"]), ("\u{a}\u{41}", &["\u{a}", "\u{41}"]), ("\u{a}\u{308}\u{41}", &["\u{a}", - "\u{308}", "\u{41}"]), ("\u{a}\u{3a}", &["\u{a}", "\u{3a}"]), ("\u{a}\u{308}\u{3a}", - &["\u{a}", "\u{308}", "\u{3a}"]), ("\u{a}\u{2c}", &["\u{a}", "\u{2c}"]), - ("\u{a}\u{308}\u{2c}", &["\u{a}", "\u{308}", "\u{2c}"]), ("\u{a}\u{2e}", &["\u{a}", - "\u{2e}"]), ("\u{a}\u{308}\u{2e}", &["\u{a}", "\u{308}", "\u{2e}"]), ("\u{a}\u{30}", - &["\u{a}", "\u{30}"]), ("\u{a}\u{308}\u{30}", &["\u{a}", "\u{308}", "\u{30}"]), - ("\u{a}\u{5f}", &["\u{a}", "\u{5f}"]), ("\u{a}\u{308}\u{5f}", &["\u{a}", "\u{308}", - "\u{5f}"]), ("\u{a}\u{1f1e6}", &["\u{a}", "\u{1f1e6}"]), ("\u{a}\u{308}\u{1f1e6}", - &["\u{a}", "\u{308}", "\u{1f1e6}"]), ("\u{a}\u{5d0}", &["\u{a}", "\u{5d0}"]), - ("\u{a}\u{308}\u{5d0}", &["\u{a}", "\u{308}", "\u{5d0}"]), ("\u{a}\u{22}", &["\u{a}", - "\u{22}"]), ("\u{a}\u{308}\u{22}", &["\u{a}", "\u{308}", "\u{22}"]), ("\u{a}\u{27}", - &["\u{a}", "\u{27}"]), ("\u{a}\u{308}\u{27}", &["\u{a}", "\u{308}", "\u{27}"]), - ("\u{a}\u{261d}", &["\u{a}", "\u{261d}"]), ("\u{a}\u{308}\u{261d}", &["\u{a}", "\u{308}", - "\u{261d}"]), ("\u{a}\u{1f3fb}", &["\u{a}", "\u{1f3fb}"]), ("\u{a}\u{308}\u{1f3fb}", - &["\u{a}", "\u{308}", "\u{1f3fb}"]), ("\u{a}\u{2764}", &["\u{a}", "\u{2764}"]), - ("\u{a}\u{308}\u{2764}", &["\u{a}", "\u{308}", "\u{2764}"]), ("\u{a}\u{1f466}", &["\u{a}", - "\u{1f466}"]), ("\u{a}\u{308}\u{1f466}", &["\u{a}", "\u{308}", "\u{1f466}"]), - ("\u{a}\u{ad}", &["\u{a}", "\u{ad}"]), ("\u{a}\u{308}\u{ad}", &["\u{a}", "\u{308}\u{ad}"]), - ("\u{a}\u{300}", &["\u{a}", "\u{300}"]), ("\u{a}\u{308}\u{300}", &["\u{a}", - "\u{308}\u{300}"]), ("\u{a}\u{200d}", &["\u{a}", "\u{200d}"]), ("\u{a}\u{308}\u{200d}", - &["\u{a}", "\u{308}\u{200d}"]), ("\u{a}\u{61}\u{2060}", &["\u{a}", "\u{61}\u{2060}"]), - ("\u{a}\u{308}\u{61}\u{2060}", &["\u{a}", "\u{308}", "\u{61}\u{2060}"]), - ("\u{a}\u{61}\u{3a}", &["\u{a}", "\u{61}", "\u{3a}"]), ("\u{a}\u{308}\u{61}\u{3a}", - &["\u{a}", "\u{308}", "\u{61}", "\u{3a}"]), ("\u{a}\u{61}\u{27}", &["\u{a}", "\u{61}", - "\u{27}"]), ("\u{a}\u{308}\u{61}\u{27}", &["\u{a}", "\u{308}", "\u{61}", "\u{27}"]), - ("\u{a}\u{61}\u{27}\u{2060}", &["\u{a}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{a}\u{308}\u{61}\u{27}\u{2060}", &["\u{a}", "\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{a}\u{61}\u{2c}", &["\u{a}", "\u{61}", "\u{2c}"]), ("\u{a}\u{308}\u{61}\u{2c}", - &["\u{a}", "\u{308}", "\u{61}", "\u{2c}"]), ("\u{a}\u{31}\u{3a}", &["\u{a}", "\u{31}", - "\u{3a}"]), ("\u{a}\u{308}\u{31}\u{3a}", &["\u{a}", "\u{308}", "\u{31}", "\u{3a}"]), - ("\u{a}\u{31}\u{27}", &["\u{a}", "\u{31}", "\u{27}"]), ("\u{a}\u{308}\u{31}\u{27}", - &["\u{a}", "\u{308}", "\u{31}", "\u{27}"]), ("\u{a}\u{31}\u{2c}", &["\u{a}", "\u{31}", - "\u{2c}"]), ("\u{a}\u{308}\u{31}\u{2c}", &["\u{a}", "\u{308}", "\u{31}", "\u{2c}"]), - ("\u{a}\u{31}\u{2e}\u{2060}", &["\u{a}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{a}\u{308}\u{31}\u{2e}\u{2060}", &["\u{a}", "\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{b}\u{1}", &["\u{b}", "\u{1}"]), ("\u{b}\u{308}\u{1}", &["\u{b}", "\u{308}", "\u{1}"]), - ("\u{b}\u{d}", &["\u{b}", "\u{d}"]), ("\u{b}\u{308}\u{d}", &["\u{b}", "\u{308}", "\u{d}"]), - ("\u{b}\u{a}", &["\u{b}", "\u{a}"]), ("\u{b}\u{308}\u{a}", &["\u{b}", "\u{308}", "\u{a}"]), - ("\u{b}\u{b}", &["\u{b}", "\u{b}"]), ("\u{b}\u{308}\u{b}", &["\u{b}", "\u{308}", "\u{b}"]), - ("\u{b}\u{3031}", &["\u{b}", "\u{3031}"]), ("\u{b}\u{308}\u{3031}", &["\u{b}", "\u{308}", - "\u{3031}"]), ("\u{b}\u{41}", &["\u{b}", "\u{41}"]), ("\u{b}\u{308}\u{41}", &["\u{b}", - "\u{308}", "\u{41}"]), ("\u{b}\u{3a}", &["\u{b}", "\u{3a}"]), ("\u{b}\u{308}\u{3a}", - &["\u{b}", "\u{308}", "\u{3a}"]), ("\u{b}\u{2c}", &["\u{b}", "\u{2c}"]), - ("\u{b}\u{308}\u{2c}", &["\u{b}", "\u{308}", "\u{2c}"]), ("\u{b}\u{2e}", &["\u{b}", - "\u{2e}"]), ("\u{b}\u{308}\u{2e}", &["\u{b}", "\u{308}", "\u{2e}"]), ("\u{b}\u{30}", - &["\u{b}", "\u{30}"]), ("\u{b}\u{308}\u{30}", &["\u{b}", "\u{308}", "\u{30}"]), - ("\u{b}\u{5f}", &["\u{b}", "\u{5f}"]), ("\u{b}\u{308}\u{5f}", &["\u{b}", "\u{308}", - "\u{5f}"]), ("\u{b}\u{1f1e6}", &["\u{b}", "\u{1f1e6}"]), ("\u{b}\u{308}\u{1f1e6}", - &["\u{b}", "\u{308}", "\u{1f1e6}"]), ("\u{b}\u{5d0}", &["\u{b}", "\u{5d0}"]), - ("\u{b}\u{308}\u{5d0}", &["\u{b}", "\u{308}", "\u{5d0}"]), ("\u{b}\u{22}", &["\u{b}", - "\u{22}"]), ("\u{b}\u{308}\u{22}", &["\u{b}", "\u{308}", "\u{22}"]), ("\u{b}\u{27}", - &["\u{b}", "\u{27}"]), ("\u{b}\u{308}\u{27}", &["\u{b}", "\u{308}", "\u{27}"]), - ("\u{b}\u{261d}", &["\u{b}", "\u{261d}"]), ("\u{b}\u{308}\u{261d}", &["\u{b}", "\u{308}", - "\u{261d}"]), ("\u{b}\u{1f3fb}", &["\u{b}", "\u{1f3fb}"]), ("\u{b}\u{308}\u{1f3fb}", - &["\u{b}", "\u{308}", "\u{1f3fb}"]), ("\u{b}\u{2764}", &["\u{b}", "\u{2764}"]), - ("\u{b}\u{308}\u{2764}", &["\u{b}", "\u{308}", "\u{2764}"]), ("\u{b}\u{1f466}", &["\u{b}", - "\u{1f466}"]), ("\u{b}\u{308}\u{1f466}", &["\u{b}", "\u{308}", "\u{1f466}"]), - ("\u{b}\u{ad}", &["\u{b}", "\u{ad}"]), ("\u{b}\u{308}\u{ad}", &["\u{b}", "\u{308}\u{ad}"]), - ("\u{b}\u{300}", &["\u{b}", "\u{300}"]), ("\u{b}\u{308}\u{300}", &["\u{b}", - "\u{308}\u{300}"]), ("\u{b}\u{200d}", &["\u{b}", "\u{200d}"]), ("\u{b}\u{308}\u{200d}", - &["\u{b}", "\u{308}\u{200d}"]), ("\u{b}\u{61}\u{2060}", &["\u{b}", "\u{61}\u{2060}"]), - ("\u{b}\u{308}\u{61}\u{2060}", &["\u{b}", "\u{308}", "\u{61}\u{2060}"]), - ("\u{b}\u{61}\u{3a}", &["\u{b}", "\u{61}", "\u{3a}"]), ("\u{b}\u{308}\u{61}\u{3a}", - &["\u{b}", "\u{308}", "\u{61}", "\u{3a}"]), ("\u{b}\u{61}\u{27}", &["\u{b}", "\u{61}", - "\u{27}"]), ("\u{b}\u{308}\u{61}\u{27}", &["\u{b}", "\u{308}", "\u{61}", "\u{27}"]), - ("\u{b}\u{61}\u{27}\u{2060}", &["\u{b}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{b}\u{308}\u{61}\u{27}\u{2060}", &["\u{b}", "\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{b}\u{61}\u{2c}", &["\u{b}", "\u{61}", "\u{2c}"]), ("\u{b}\u{308}\u{61}\u{2c}", - &["\u{b}", "\u{308}", "\u{61}", "\u{2c}"]), ("\u{b}\u{31}\u{3a}", &["\u{b}", "\u{31}", - "\u{3a}"]), ("\u{b}\u{308}\u{31}\u{3a}", &["\u{b}", "\u{308}", "\u{31}", "\u{3a}"]), - ("\u{b}\u{31}\u{27}", &["\u{b}", "\u{31}", "\u{27}"]), ("\u{b}\u{308}\u{31}\u{27}", - &["\u{b}", "\u{308}", "\u{31}", "\u{27}"]), ("\u{b}\u{31}\u{2c}", &["\u{b}", "\u{31}", - "\u{2c}"]), ("\u{b}\u{308}\u{31}\u{2c}", &["\u{b}", "\u{308}", "\u{31}", "\u{2c}"]), - ("\u{b}\u{31}\u{2e}\u{2060}", &["\u{b}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{b}\u{308}\u{31}\u{2e}\u{2060}", &["\u{b}", "\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{3031}\u{1}", &["\u{3031}", "\u{1}"]), ("\u{3031}\u{308}\u{1}", &["\u{3031}\u{308}", - "\u{1}"]), ("\u{3031}\u{d}", &["\u{3031}", "\u{d}"]), ("\u{3031}\u{308}\u{d}", - &["\u{3031}\u{308}", "\u{d}"]), ("\u{3031}\u{a}", &["\u{3031}", "\u{a}"]), - ("\u{3031}\u{308}\u{a}", &["\u{3031}\u{308}", "\u{a}"]), ("\u{3031}\u{b}", &["\u{3031}", - "\u{b}"]), ("\u{3031}\u{308}\u{b}", &["\u{3031}\u{308}", "\u{b}"]), ("\u{3031}\u{3031}", - &["\u{3031}\u{3031}"]), ("\u{3031}\u{308}\u{3031}", &["\u{3031}\u{308}\u{3031}"]), - ("\u{3031}\u{41}", &["\u{3031}", "\u{41}"]), ("\u{3031}\u{308}\u{41}", &["\u{3031}\u{308}", - "\u{41}"]), ("\u{3031}\u{3a}", &["\u{3031}", "\u{3a}"]), ("\u{3031}\u{308}\u{3a}", - &["\u{3031}\u{308}", "\u{3a}"]), ("\u{3031}\u{2c}", &["\u{3031}", "\u{2c}"]), - ("\u{3031}\u{308}\u{2c}", &["\u{3031}\u{308}", "\u{2c}"]), ("\u{3031}\u{2e}", &["\u{3031}", - "\u{2e}"]), ("\u{3031}\u{308}\u{2e}", &["\u{3031}\u{308}", "\u{2e}"]), ("\u{3031}\u{30}", - &["\u{3031}", "\u{30}"]), ("\u{3031}\u{308}\u{30}", &["\u{3031}\u{308}", "\u{30}"]), - ("\u{3031}\u{5f}", &["\u{3031}\u{5f}"]), ("\u{3031}\u{308}\u{5f}", - &["\u{3031}\u{308}\u{5f}"]), ("\u{3031}\u{1f1e6}", &["\u{3031}", "\u{1f1e6}"]), - ("\u{3031}\u{308}\u{1f1e6}", &["\u{3031}\u{308}", "\u{1f1e6}"]), ("\u{3031}\u{5d0}", - &["\u{3031}", "\u{5d0}"]), ("\u{3031}\u{308}\u{5d0}", &["\u{3031}\u{308}", "\u{5d0}"]), - ("\u{3031}\u{22}", &["\u{3031}", "\u{22}"]), ("\u{3031}\u{308}\u{22}", &["\u{3031}\u{308}", - "\u{22}"]), ("\u{3031}\u{27}", &["\u{3031}", "\u{27}"]), ("\u{3031}\u{308}\u{27}", - &["\u{3031}\u{308}", "\u{27}"]), ("\u{3031}\u{261d}", &["\u{3031}", "\u{261d}"]), - ("\u{3031}\u{308}\u{261d}", &["\u{3031}\u{308}", "\u{261d}"]), ("\u{3031}\u{1f3fb}", - &["\u{3031}", "\u{1f3fb}"]), ("\u{3031}\u{308}\u{1f3fb}", &["\u{3031}\u{308}", - "\u{1f3fb}"]), ("\u{3031}\u{2764}", &["\u{3031}", "\u{2764}"]), ("\u{3031}\u{308}\u{2764}", - &["\u{3031}\u{308}", "\u{2764}"]), ("\u{3031}\u{1f466}", &["\u{3031}", "\u{1f466}"]), - ("\u{3031}\u{308}\u{1f466}", &["\u{3031}\u{308}", "\u{1f466}"]), ("\u{3031}\u{ad}", - &["\u{3031}\u{ad}"]), ("\u{3031}\u{308}\u{ad}", &["\u{3031}\u{308}\u{ad}"]), - ("\u{3031}\u{300}", &["\u{3031}\u{300}"]), ("\u{3031}\u{308}\u{300}", - &["\u{3031}\u{308}\u{300}"]), ("\u{3031}\u{200d}", &["\u{3031}\u{200d}"]), - ("\u{3031}\u{308}\u{200d}", &["\u{3031}\u{308}\u{200d}"]), ("\u{3031}\u{61}\u{2060}", - &["\u{3031}", "\u{61}\u{2060}"]), ("\u{3031}\u{308}\u{61}\u{2060}", &["\u{3031}\u{308}", - "\u{61}\u{2060}"]), ("\u{3031}\u{61}\u{3a}", &["\u{3031}", "\u{61}", "\u{3a}"]), - ("\u{3031}\u{308}\u{61}\u{3a}", &["\u{3031}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{3031}\u{61}\u{27}", &["\u{3031}", "\u{61}", "\u{27}"]), ("\u{3031}\u{308}\u{61}\u{27}", - &["\u{3031}\u{308}", "\u{61}", "\u{27}"]), ("\u{3031}\u{61}\u{27}\u{2060}", &["\u{3031}", - "\u{61}", "\u{27}\u{2060}"]), ("\u{3031}\u{308}\u{61}\u{27}\u{2060}", &["\u{3031}\u{308}", - "\u{61}", "\u{27}\u{2060}"]), ("\u{3031}\u{61}\u{2c}", &["\u{3031}", "\u{61}", "\u{2c}"]), - ("\u{3031}\u{308}\u{61}\u{2c}", &["\u{3031}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{3031}\u{31}\u{3a}", &["\u{3031}", "\u{31}", "\u{3a}"]), ("\u{3031}\u{308}\u{31}\u{3a}", - &["\u{3031}\u{308}", "\u{31}", "\u{3a}"]), ("\u{3031}\u{31}\u{27}", &["\u{3031}", "\u{31}", - "\u{27}"]), ("\u{3031}\u{308}\u{31}\u{27}", &["\u{3031}\u{308}", "\u{31}", "\u{27}"]), - ("\u{3031}\u{31}\u{2c}", &["\u{3031}", "\u{31}", "\u{2c}"]), ("\u{3031}\u{308}\u{31}\u{2c}", - &["\u{3031}\u{308}", "\u{31}", "\u{2c}"]), ("\u{3031}\u{31}\u{2e}\u{2060}", &["\u{3031}", - "\u{31}", "\u{2e}\u{2060}"]), ("\u{3031}\u{308}\u{31}\u{2e}\u{2060}", &["\u{3031}\u{308}", - "\u{31}", "\u{2e}\u{2060}"]), ("\u{41}\u{1}", &["\u{41}", "\u{1}"]), ("\u{41}\u{308}\u{1}", - &["\u{41}\u{308}", "\u{1}"]), ("\u{41}\u{d}", &["\u{41}", "\u{d}"]), ("\u{41}\u{308}\u{d}", - &["\u{41}\u{308}", "\u{d}"]), ("\u{41}\u{a}", &["\u{41}", "\u{a}"]), ("\u{41}\u{308}\u{a}", - &["\u{41}\u{308}", "\u{a}"]), ("\u{41}\u{b}", &["\u{41}", "\u{b}"]), ("\u{41}\u{308}\u{b}", - &["\u{41}\u{308}", "\u{b}"]), ("\u{41}\u{3031}", &["\u{41}", "\u{3031}"]), - ("\u{41}\u{308}\u{3031}", &["\u{41}\u{308}", "\u{3031}"]), ("\u{41}\u{41}", - &["\u{41}\u{41}"]), ("\u{41}\u{308}\u{41}", &["\u{41}\u{308}\u{41}"]), ("\u{41}\u{3a}", - &["\u{41}", "\u{3a}"]), ("\u{41}\u{308}\u{3a}", &["\u{41}\u{308}", "\u{3a}"]), - ("\u{41}\u{2c}", &["\u{41}", "\u{2c}"]), ("\u{41}\u{308}\u{2c}", &["\u{41}\u{308}", - "\u{2c}"]), ("\u{41}\u{2e}", &["\u{41}", "\u{2e}"]), ("\u{41}\u{308}\u{2e}", - &["\u{41}\u{308}", "\u{2e}"]), ("\u{41}\u{30}", &["\u{41}\u{30}"]), ("\u{41}\u{308}\u{30}", - &["\u{41}\u{308}\u{30}"]), ("\u{41}\u{5f}", &["\u{41}\u{5f}"]), ("\u{41}\u{308}\u{5f}", - &["\u{41}\u{308}\u{5f}"]), ("\u{41}\u{1f1e6}", &["\u{41}", "\u{1f1e6}"]), - ("\u{41}\u{308}\u{1f1e6}", &["\u{41}\u{308}", "\u{1f1e6}"]), ("\u{41}\u{5d0}", - &["\u{41}\u{5d0}"]), ("\u{41}\u{308}\u{5d0}", &["\u{41}\u{308}\u{5d0}"]), ("\u{41}\u{22}", - &["\u{41}", "\u{22}"]), ("\u{41}\u{308}\u{22}", &["\u{41}\u{308}", "\u{22}"]), - ("\u{41}\u{27}", &["\u{41}", "\u{27}"]), ("\u{41}\u{308}\u{27}", &["\u{41}\u{308}", - "\u{27}"]), ("\u{41}\u{261d}", &["\u{41}", "\u{261d}"]), ("\u{41}\u{308}\u{261d}", - &["\u{41}\u{308}", "\u{261d}"]), ("\u{41}\u{1f3fb}", &["\u{41}", "\u{1f3fb}"]), - ("\u{41}\u{308}\u{1f3fb}", &["\u{41}\u{308}", "\u{1f3fb}"]), ("\u{41}\u{2764}", &["\u{41}", - "\u{2764}"]), ("\u{41}\u{308}\u{2764}", &["\u{41}\u{308}", "\u{2764}"]), ("\u{41}\u{1f466}", - &["\u{41}", "\u{1f466}"]), ("\u{41}\u{308}\u{1f466}", &["\u{41}\u{308}", "\u{1f466}"]), - ("\u{41}\u{ad}", &["\u{41}\u{ad}"]), ("\u{41}\u{308}\u{ad}", &["\u{41}\u{308}\u{ad}"]), - ("\u{41}\u{300}", &["\u{41}\u{300}"]), ("\u{41}\u{308}\u{300}", &["\u{41}\u{308}\u{300}"]), - ("\u{41}\u{200d}", &["\u{41}\u{200d}"]), ("\u{41}\u{308}\u{200d}", - &["\u{41}\u{308}\u{200d}"]), ("\u{41}\u{61}\u{2060}", &["\u{41}\u{61}\u{2060}"]), - ("\u{41}\u{308}\u{61}\u{2060}", &["\u{41}\u{308}\u{61}\u{2060}"]), ("\u{41}\u{61}\u{3a}", - &["\u{41}\u{61}", "\u{3a}"]), ("\u{41}\u{308}\u{61}\u{3a}", &["\u{41}\u{308}\u{61}", - "\u{3a}"]), ("\u{41}\u{61}\u{27}", &["\u{41}\u{61}", "\u{27}"]), - ("\u{41}\u{308}\u{61}\u{27}", &["\u{41}\u{308}\u{61}", "\u{27}"]), - ("\u{41}\u{61}\u{27}\u{2060}", &["\u{41}\u{61}", "\u{27}\u{2060}"]), - ("\u{41}\u{308}\u{61}\u{27}\u{2060}", &["\u{41}\u{308}\u{61}", "\u{27}\u{2060}"]), - ("\u{41}\u{61}\u{2c}", &["\u{41}\u{61}", "\u{2c}"]), ("\u{41}\u{308}\u{61}\u{2c}", - &["\u{41}\u{308}\u{61}", "\u{2c}"]), ("\u{41}\u{31}\u{3a}", &["\u{41}\u{31}", "\u{3a}"]), - ("\u{41}\u{308}\u{31}\u{3a}", &["\u{41}\u{308}\u{31}", "\u{3a}"]), ("\u{41}\u{31}\u{27}", - &["\u{41}\u{31}", "\u{27}"]), ("\u{41}\u{308}\u{31}\u{27}", &["\u{41}\u{308}\u{31}", - "\u{27}"]), ("\u{41}\u{31}\u{2c}", &["\u{41}\u{31}", "\u{2c}"]), - ("\u{41}\u{308}\u{31}\u{2c}", &["\u{41}\u{308}\u{31}", "\u{2c}"]), - ("\u{41}\u{31}\u{2e}\u{2060}", &["\u{41}\u{31}", "\u{2e}\u{2060}"]), - ("\u{41}\u{308}\u{31}\u{2e}\u{2060}", &["\u{41}\u{308}\u{31}", "\u{2e}\u{2060}"]), - ("\u{3a}\u{1}", &["\u{3a}", "\u{1}"]), ("\u{3a}\u{308}\u{1}", &["\u{3a}\u{308}", "\u{1}"]), - ("\u{3a}\u{d}", &["\u{3a}", "\u{d}"]), ("\u{3a}\u{308}\u{d}", &["\u{3a}\u{308}", "\u{d}"]), - ("\u{3a}\u{a}", &["\u{3a}", "\u{a}"]), ("\u{3a}\u{308}\u{a}", &["\u{3a}\u{308}", "\u{a}"]), - ("\u{3a}\u{b}", &["\u{3a}", "\u{b}"]), ("\u{3a}\u{308}\u{b}", &["\u{3a}\u{308}", "\u{b}"]), - ("\u{3a}\u{3031}", &["\u{3a}", "\u{3031}"]), ("\u{3a}\u{308}\u{3031}", &["\u{3a}\u{308}", - "\u{3031}"]), ("\u{3a}\u{41}", &["\u{3a}", "\u{41}"]), ("\u{3a}\u{308}\u{41}", - &["\u{3a}\u{308}", "\u{41}"]), ("\u{3a}\u{3a}", &["\u{3a}", "\u{3a}"]), - ("\u{3a}\u{308}\u{3a}", &["\u{3a}\u{308}", "\u{3a}"]), ("\u{3a}\u{2c}", &["\u{3a}", - "\u{2c}"]), ("\u{3a}\u{308}\u{2c}", &["\u{3a}\u{308}", "\u{2c}"]), ("\u{3a}\u{2e}", - &["\u{3a}", "\u{2e}"]), ("\u{3a}\u{308}\u{2e}", &["\u{3a}\u{308}", "\u{2e}"]), - ("\u{3a}\u{30}", &["\u{3a}", "\u{30}"]), ("\u{3a}\u{308}\u{30}", &["\u{3a}\u{308}", - "\u{30}"]), ("\u{3a}\u{5f}", &["\u{3a}", "\u{5f}"]), ("\u{3a}\u{308}\u{5f}", - &["\u{3a}\u{308}", "\u{5f}"]), ("\u{3a}\u{1f1e6}", &["\u{3a}", "\u{1f1e6}"]), - ("\u{3a}\u{308}\u{1f1e6}", &["\u{3a}\u{308}", "\u{1f1e6}"]), ("\u{3a}\u{5d0}", &["\u{3a}", - "\u{5d0}"]), ("\u{3a}\u{308}\u{5d0}", &["\u{3a}\u{308}", "\u{5d0}"]), ("\u{3a}\u{22}", - &["\u{3a}", "\u{22}"]), ("\u{3a}\u{308}\u{22}", &["\u{3a}\u{308}", "\u{22}"]), - ("\u{3a}\u{27}", &["\u{3a}", "\u{27}"]), ("\u{3a}\u{308}\u{27}", &["\u{3a}\u{308}", - "\u{27}"]), ("\u{3a}\u{261d}", &["\u{3a}", "\u{261d}"]), ("\u{3a}\u{308}\u{261d}", - &["\u{3a}\u{308}", "\u{261d}"]), ("\u{3a}\u{1f3fb}", &["\u{3a}", "\u{1f3fb}"]), - ("\u{3a}\u{308}\u{1f3fb}", &["\u{3a}\u{308}", "\u{1f3fb}"]), ("\u{3a}\u{2764}", &["\u{3a}", - "\u{2764}"]), ("\u{3a}\u{308}\u{2764}", &["\u{3a}\u{308}", "\u{2764}"]), ("\u{3a}\u{1f466}", - &["\u{3a}", "\u{1f466}"]), ("\u{3a}\u{308}\u{1f466}", &["\u{3a}\u{308}", "\u{1f466}"]), - ("\u{3a}\u{ad}", &["\u{3a}\u{ad}"]), ("\u{3a}\u{308}\u{ad}", &["\u{3a}\u{308}\u{ad}"]), - ("\u{3a}\u{300}", &["\u{3a}\u{300}"]), ("\u{3a}\u{308}\u{300}", &["\u{3a}\u{308}\u{300}"]), - ("\u{3a}\u{200d}", &["\u{3a}\u{200d}"]), ("\u{3a}\u{308}\u{200d}", - &["\u{3a}\u{308}\u{200d}"]), ("\u{3a}\u{61}\u{2060}", &["\u{3a}", "\u{61}\u{2060}"]), - ("\u{3a}\u{308}\u{61}\u{2060}", &["\u{3a}\u{308}", "\u{61}\u{2060}"]), - ("\u{3a}\u{61}\u{3a}", &["\u{3a}", "\u{61}", "\u{3a}"]), ("\u{3a}\u{308}\u{61}\u{3a}", - &["\u{3a}\u{308}", "\u{61}", "\u{3a}"]), ("\u{3a}\u{61}\u{27}", &["\u{3a}", "\u{61}", - "\u{27}"]), ("\u{3a}\u{308}\u{61}\u{27}", &["\u{3a}\u{308}", "\u{61}", "\u{27}"]), - ("\u{3a}\u{61}\u{27}\u{2060}", &["\u{3a}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{3a}\u{308}\u{61}\u{27}\u{2060}", &["\u{3a}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{3a}\u{61}\u{2c}", &["\u{3a}", "\u{61}", "\u{2c}"]), ("\u{3a}\u{308}\u{61}\u{2c}", - &["\u{3a}\u{308}", "\u{61}", "\u{2c}"]), ("\u{3a}\u{31}\u{3a}", &["\u{3a}", "\u{31}", - "\u{3a}"]), ("\u{3a}\u{308}\u{31}\u{3a}", &["\u{3a}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{3a}\u{31}\u{27}", &["\u{3a}", "\u{31}", "\u{27}"]), ("\u{3a}\u{308}\u{31}\u{27}", - &["\u{3a}\u{308}", "\u{31}", "\u{27}"]), ("\u{3a}\u{31}\u{2c}", &["\u{3a}", "\u{31}", - "\u{2c}"]), ("\u{3a}\u{308}\u{31}\u{2c}", &["\u{3a}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{3a}\u{31}\u{2e}\u{2060}", &["\u{3a}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{3a}\u{308}\u{31}\u{2e}\u{2060}", &["\u{3a}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2c}\u{1}", &["\u{2c}", "\u{1}"]), ("\u{2c}\u{308}\u{1}", &["\u{2c}\u{308}", "\u{1}"]), - ("\u{2c}\u{d}", &["\u{2c}", "\u{d}"]), ("\u{2c}\u{308}\u{d}", &["\u{2c}\u{308}", "\u{d}"]), - ("\u{2c}\u{a}", &["\u{2c}", "\u{a}"]), ("\u{2c}\u{308}\u{a}", &["\u{2c}\u{308}", "\u{a}"]), - ("\u{2c}\u{b}", &["\u{2c}", "\u{b}"]), ("\u{2c}\u{308}\u{b}", &["\u{2c}\u{308}", "\u{b}"]), - ("\u{2c}\u{3031}", &["\u{2c}", "\u{3031}"]), ("\u{2c}\u{308}\u{3031}", &["\u{2c}\u{308}", - "\u{3031}"]), ("\u{2c}\u{41}", &["\u{2c}", "\u{41}"]), ("\u{2c}\u{308}\u{41}", - &["\u{2c}\u{308}", "\u{41}"]), ("\u{2c}\u{3a}", &["\u{2c}", "\u{3a}"]), - ("\u{2c}\u{308}\u{3a}", &["\u{2c}\u{308}", "\u{3a}"]), ("\u{2c}\u{2c}", &["\u{2c}", - "\u{2c}"]), ("\u{2c}\u{308}\u{2c}", &["\u{2c}\u{308}", "\u{2c}"]), ("\u{2c}\u{2e}", - &["\u{2c}", "\u{2e}"]), ("\u{2c}\u{308}\u{2e}", &["\u{2c}\u{308}", "\u{2e}"]), - ("\u{2c}\u{30}", &["\u{2c}", "\u{30}"]), ("\u{2c}\u{308}\u{30}", &["\u{2c}\u{308}", - "\u{30}"]), ("\u{2c}\u{5f}", &["\u{2c}", "\u{5f}"]), ("\u{2c}\u{308}\u{5f}", - &["\u{2c}\u{308}", "\u{5f}"]), ("\u{2c}\u{1f1e6}", &["\u{2c}", "\u{1f1e6}"]), - ("\u{2c}\u{308}\u{1f1e6}", &["\u{2c}\u{308}", "\u{1f1e6}"]), ("\u{2c}\u{5d0}", &["\u{2c}", - "\u{5d0}"]), ("\u{2c}\u{308}\u{5d0}", &["\u{2c}\u{308}", "\u{5d0}"]), ("\u{2c}\u{22}", - &["\u{2c}", "\u{22}"]), ("\u{2c}\u{308}\u{22}", &["\u{2c}\u{308}", "\u{22}"]), - ("\u{2c}\u{27}", &["\u{2c}", "\u{27}"]), ("\u{2c}\u{308}\u{27}", &["\u{2c}\u{308}", - "\u{27}"]), ("\u{2c}\u{261d}", &["\u{2c}", "\u{261d}"]), ("\u{2c}\u{308}\u{261d}", - &["\u{2c}\u{308}", "\u{261d}"]), ("\u{2c}\u{1f3fb}", &["\u{2c}", "\u{1f3fb}"]), - ("\u{2c}\u{308}\u{1f3fb}", &["\u{2c}\u{308}", "\u{1f3fb}"]), ("\u{2c}\u{2764}", &["\u{2c}", - "\u{2764}"]), ("\u{2c}\u{308}\u{2764}", &["\u{2c}\u{308}", "\u{2764}"]), ("\u{2c}\u{1f466}", - &["\u{2c}", "\u{1f466}"]), ("\u{2c}\u{308}\u{1f466}", &["\u{2c}\u{308}", "\u{1f466}"]), - ("\u{2c}\u{ad}", &["\u{2c}\u{ad}"]), ("\u{2c}\u{308}\u{ad}", &["\u{2c}\u{308}\u{ad}"]), - ("\u{2c}\u{300}", &["\u{2c}\u{300}"]), ("\u{2c}\u{308}\u{300}", &["\u{2c}\u{308}\u{300}"]), - ("\u{2c}\u{200d}", &["\u{2c}\u{200d}"]), ("\u{2c}\u{308}\u{200d}", - &["\u{2c}\u{308}\u{200d}"]), ("\u{2c}\u{61}\u{2060}", &["\u{2c}", "\u{61}\u{2060}"]), - ("\u{2c}\u{308}\u{61}\u{2060}", &["\u{2c}\u{308}", "\u{61}\u{2060}"]), - ("\u{2c}\u{61}\u{3a}", &["\u{2c}", "\u{61}", "\u{3a}"]), ("\u{2c}\u{308}\u{61}\u{3a}", - &["\u{2c}\u{308}", "\u{61}", "\u{3a}"]), ("\u{2c}\u{61}\u{27}", &["\u{2c}", "\u{61}", - "\u{27}"]), ("\u{2c}\u{308}\u{61}\u{27}", &["\u{2c}\u{308}", "\u{61}", "\u{27}"]), - ("\u{2c}\u{61}\u{27}\u{2060}", &["\u{2c}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2c}\u{308}\u{61}\u{27}\u{2060}", &["\u{2c}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2c}\u{61}\u{2c}", &["\u{2c}", "\u{61}", "\u{2c}"]), ("\u{2c}\u{308}\u{61}\u{2c}", - &["\u{2c}\u{308}", "\u{61}", "\u{2c}"]), ("\u{2c}\u{31}\u{3a}", &["\u{2c}", "\u{31}", - "\u{3a}"]), ("\u{2c}\u{308}\u{31}\u{3a}", &["\u{2c}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{2c}\u{31}\u{27}", &["\u{2c}", "\u{31}", "\u{27}"]), ("\u{2c}\u{308}\u{31}\u{27}", - &["\u{2c}\u{308}", "\u{31}", "\u{27}"]), ("\u{2c}\u{31}\u{2c}", &["\u{2c}", "\u{31}", - "\u{2c}"]), ("\u{2c}\u{308}\u{31}\u{2c}", &["\u{2c}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{2c}\u{31}\u{2e}\u{2060}", &["\u{2c}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2c}\u{308}\u{31}\u{2e}\u{2060}", &["\u{2c}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2e}\u{1}", &["\u{2e}", "\u{1}"]), ("\u{2e}\u{308}\u{1}", &["\u{2e}\u{308}", "\u{1}"]), - ("\u{2e}\u{d}", &["\u{2e}", "\u{d}"]), ("\u{2e}\u{308}\u{d}", &["\u{2e}\u{308}", "\u{d}"]), - ("\u{2e}\u{a}", &["\u{2e}", "\u{a}"]), ("\u{2e}\u{308}\u{a}", &["\u{2e}\u{308}", "\u{a}"]), - ("\u{2e}\u{b}", &["\u{2e}", "\u{b}"]), ("\u{2e}\u{308}\u{b}", &["\u{2e}\u{308}", "\u{b}"]), - ("\u{2e}\u{3031}", &["\u{2e}", "\u{3031}"]), ("\u{2e}\u{308}\u{3031}", &["\u{2e}\u{308}", - "\u{3031}"]), ("\u{2e}\u{41}", &["\u{2e}", "\u{41}"]), ("\u{2e}\u{308}\u{41}", - &["\u{2e}\u{308}", "\u{41}"]), ("\u{2e}\u{3a}", &["\u{2e}", "\u{3a}"]), - ("\u{2e}\u{308}\u{3a}", &["\u{2e}\u{308}", "\u{3a}"]), ("\u{2e}\u{2c}", &["\u{2e}", - "\u{2c}"]), ("\u{2e}\u{308}\u{2c}", &["\u{2e}\u{308}", "\u{2c}"]), ("\u{2e}\u{2e}", - &["\u{2e}", "\u{2e}"]), ("\u{2e}\u{308}\u{2e}", &["\u{2e}\u{308}", "\u{2e}"]), - ("\u{2e}\u{30}", &["\u{2e}", "\u{30}"]), ("\u{2e}\u{308}\u{30}", &["\u{2e}\u{308}", - "\u{30}"]), ("\u{2e}\u{5f}", &["\u{2e}", "\u{5f}"]), ("\u{2e}\u{308}\u{5f}", - &["\u{2e}\u{308}", "\u{5f}"]), ("\u{2e}\u{1f1e6}", &["\u{2e}", "\u{1f1e6}"]), - ("\u{2e}\u{308}\u{1f1e6}", &["\u{2e}\u{308}", "\u{1f1e6}"]), ("\u{2e}\u{5d0}", &["\u{2e}", - "\u{5d0}"]), ("\u{2e}\u{308}\u{5d0}", &["\u{2e}\u{308}", "\u{5d0}"]), ("\u{2e}\u{22}", - &["\u{2e}", "\u{22}"]), ("\u{2e}\u{308}\u{22}", &["\u{2e}\u{308}", "\u{22}"]), - ("\u{2e}\u{27}", &["\u{2e}", "\u{27}"]), ("\u{2e}\u{308}\u{27}", &["\u{2e}\u{308}", - "\u{27}"]), ("\u{2e}\u{261d}", &["\u{2e}", "\u{261d}"]), ("\u{2e}\u{308}\u{261d}", - &["\u{2e}\u{308}", "\u{261d}"]), ("\u{2e}\u{1f3fb}", &["\u{2e}", "\u{1f3fb}"]), - ("\u{2e}\u{308}\u{1f3fb}", &["\u{2e}\u{308}", "\u{1f3fb}"]), ("\u{2e}\u{2764}", &["\u{2e}", - "\u{2764}"]), ("\u{2e}\u{308}\u{2764}", &["\u{2e}\u{308}", "\u{2764}"]), ("\u{2e}\u{1f466}", - &["\u{2e}", "\u{1f466}"]), ("\u{2e}\u{308}\u{1f466}", &["\u{2e}\u{308}", "\u{1f466}"]), - ("\u{2e}\u{ad}", &["\u{2e}\u{ad}"]), ("\u{2e}\u{308}\u{ad}", &["\u{2e}\u{308}\u{ad}"]), - ("\u{2e}\u{300}", &["\u{2e}\u{300}"]), ("\u{2e}\u{308}\u{300}", &["\u{2e}\u{308}\u{300}"]), - ("\u{2e}\u{200d}", &["\u{2e}\u{200d}"]), ("\u{2e}\u{308}\u{200d}", - &["\u{2e}\u{308}\u{200d}"]), ("\u{2e}\u{61}\u{2060}", &["\u{2e}", "\u{61}\u{2060}"]), - ("\u{2e}\u{308}\u{61}\u{2060}", &["\u{2e}\u{308}", "\u{61}\u{2060}"]), - ("\u{2e}\u{61}\u{3a}", &["\u{2e}", "\u{61}", "\u{3a}"]), ("\u{2e}\u{308}\u{61}\u{3a}", - &["\u{2e}\u{308}", "\u{61}", "\u{3a}"]), ("\u{2e}\u{61}\u{27}", &["\u{2e}", "\u{61}", - "\u{27}"]), ("\u{2e}\u{308}\u{61}\u{27}", &["\u{2e}\u{308}", "\u{61}", "\u{27}"]), - ("\u{2e}\u{61}\u{27}\u{2060}", &["\u{2e}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2e}\u{308}\u{61}\u{27}\u{2060}", &["\u{2e}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2e}\u{61}\u{2c}", &["\u{2e}", "\u{61}", "\u{2c}"]), ("\u{2e}\u{308}\u{61}\u{2c}", - &["\u{2e}\u{308}", "\u{61}", "\u{2c}"]), ("\u{2e}\u{31}\u{3a}", &["\u{2e}", "\u{31}", - "\u{3a}"]), ("\u{2e}\u{308}\u{31}\u{3a}", &["\u{2e}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{2e}\u{31}\u{27}", &["\u{2e}", "\u{31}", "\u{27}"]), ("\u{2e}\u{308}\u{31}\u{27}", - &["\u{2e}\u{308}", "\u{31}", "\u{27}"]), ("\u{2e}\u{31}\u{2c}", &["\u{2e}", "\u{31}", - "\u{2c}"]), ("\u{2e}\u{308}\u{31}\u{2c}", &["\u{2e}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{2e}\u{31}\u{2e}\u{2060}", &["\u{2e}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2e}\u{308}\u{31}\u{2e}\u{2060}", &["\u{2e}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{30}\u{1}", &["\u{30}", "\u{1}"]), ("\u{30}\u{308}\u{1}", &["\u{30}\u{308}", "\u{1}"]), - ("\u{30}\u{d}", &["\u{30}", "\u{d}"]), ("\u{30}\u{308}\u{d}", &["\u{30}\u{308}", "\u{d}"]), - ("\u{30}\u{a}", &["\u{30}", "\u{a}"]), ("\u{30}\u{308}\u{a}", &["\u{30}\u{308}", "\u{a}"]), - ("\u{30}\u{b}", &["\u{30}", "\u{b}"]), ("\u{30}\u{308}\u{b}", &["\u{30}\u{308}", "\u{b}"]), - ("\u{30}\u{3031}", &["\u{30}", "\u{3031}"]), ("\u{30}\u{308}\u{3031}", &["\u{30}\u{308}", - "\u{3031}"]), ("\u{30}\u{41}", &["\u{30}\u{41}"]), ("\u{30}\u{308}\u{41}", - &["\u{30}\u{308}\u{41}"]), ("\u{30}\u{3a}", &["\u{30}", "\u{3a}"]), ("\u{30}\u{308}\u{3a}", - &["\u{30}\u{308}", "\u{3a}"]), ("\u{30}\u{2c}", &["\u{30}", "\u{2c}"]), - ("\u{30}\u{308}\u{2c}", &["\u{30}\u{308}", "\u{2c}"]), ("\u{30}\u{2e}", &["\u{30}", - "\u{2e}"]), ("\u{30}\u{308}\u{2e}", &["\u{30}\u{308}", "\u{2e}"]), ("\u{30}\u{30}", - &["\u{30}\u{30}"]), ("\u{30}\u{308}\u{30}", &["\u{30}\u{308}\u{30}"]), ("\u{30}\u{5f}", - &["\u{30}\u{5f}"]), ("\u{30}\u{308}\u{5f}", &["\u{30}\u{308}\u{5f}"]), ("\u{30}\u{1f1e6}", - &["\u{30}", "\u{1f1e6}"]), ("\u{30}\u{308}\u{1f1e6}", &["\u{30}\u{308}", "\u{1f1e6}"]), - ("\u{30}\u{5d0}", &["\u{30}\u{5d0}"]), ("\u{30}\u{308}\u{5d0}", &["\u{30}\u{308}\u{5d0}"]), - ("\u{30}\u{22}", &["\u{30}", "\u{22}"]), ("\u{30}\u{308}\u{22}", &["\u{30}\u{308}", - "\u{22}"]), ("\u{30}\u{27}", &["\u{30}", "\u{27}"]), ("\u{30}\u{308}\u{27}", - &["\u{30}\u{308}", "\u{27}"]), ("\u{30}\u{261d}", &["\u{30}", "\u{261d}"]), - ("\u{30}\u{308}\u{261d}", &["\u{30}\u{308}", "\u{261d}"]), ("\u{30}\u{1f3fb}", &["\u{30}", - "\u{1f3fb}"]), ("\u{30}\u{308}\u{1f3fb}", &["\u{30}\u{308}", "\u{1f3fb}"]), - ("\u{30}\u{2764}", &["\u{30}", "\u{2764}"]), ("\u{30}\u{308}\u{2764}", &["\u{30}\u{308}", - "\u{2764}"]), ("\u{30}\u{1f466}", &["\u{30}", "\u{1f466}"]), ("\u{30}\u{308}\u{1f466}", - &["\u{30}\u{308}", "\u{1f466}"]), ("\u{30}\u{ad}", &["\u{30}\u{ad}"]), - ("\u{30}\u{308}\u{ad}", &["\u{30}\u{308}\u{ad}"]), ("\u{30}\u{300}", &["\u{30}\u{300}"]), - ("\u{30}\u{308}\u{300}", &["\u{30}\u{308}\u{300}"]), ("\u{30}\u{200d}", - &["\u{30}\u{200d}"]), ("\u{30}\u{308}\u{200d}", &["\u{30}\u{308}\u{200d}"]), - ("\u{30}\u{61}\u{2060}", &["\u{30}\u{61}\u{2060}"]), ("\u{30}\u{308}\u{61}\u{2060}", - &["\u{30}\u{308}\u{61}\u{2060}"]), ("\u{30}\u{61}\u{3a}", &["\u{30}\u{61}", "\u{3a}"]), - ("\u{30}\u{308}\u{61}\u{3a}", &["\u{30}\u{308}\u{61}", "\u{3a}"]), ("\u{30}\u{61}\u{27}", - &["\u{30}\u{61}", "\u{27}"]), ("\u{30}\u{308}\u{61}\u{27}", &["\u{30}\u{308}\u{61}", - "\u{27}"]), ("\u{30}\u{61}\u{27}\u{2060}", &["\u{30}\u{61}", "\u{27}\u{2060}"]), - ("\u{30}\u{308}\u{61}\u{27}\u{2060}", &["\u{30}\u{308}\u{61}", "\u{27}\u{2060}"]), - ("\u{30}\u{61}\u{2c}", &["\u{30}\u{61}", "\u{2c}"]), ("\u{30}\u{308}\u{61}\u{2c}", - &["\u{30}\u{308}\u{61}", "\u{2c}"]), ("\u{30}\u{31}\u{3a}", &["\u{30}\u{31}", "\u{3a}"]), - ("\u{30}\u{308}\u{31}\u{3a}", &["\u{30}\u{308}\u{31}", "\u{3a}"]), ("\u{30}\u{31}\u{27}", - &["\u{30}\u{31}", "\u{27}"]), ("\u{30}\u{308}\u{31}\u{27}", &["\u{30}\u{308}\u{31}", - "\u{27}"]), ("\u{30}\u{31}\u{2c}", &["\u{30}\u{31}", "\u{2c}"]), - ("\u{30}\u{308}\u{31}\u{2c}", &["\u{30}\u{308}\u{31}", "\u{2c}"]), - ("\u{30}\u{31}\u{2e}\u{2060}", &["\u{30}\u{31}", "\u{2e}\u{2060}"]), - ("\u{30}\u{308}\u{31}\u{2e}\u{2060}", &["\u{30}\u{308}\u{31}", "\u{2e}\u{2060}"]), - ("\u{5f}\u{1}", &["\u{5f}", "\u{1}"]), ("\u{5f}\u{308}\u{1}", &["\u{5f}\u{308}", "\u{1}"]), - ("\u{5f}\u{d}", &["\u{5f}", "\u{d}"]), ("\u{5f}\u{308}\u{d}", &["\u{5f}\u{308}", "\u{d}"]), - ("\u{5f}\u{a}", &["\u{5f}", "\u{a}"]), ("\u{5f}\u{308}\u{a}", &["\u{5f}\u{308}", "\u{a}"]), - ("\u{5f}\u{b}", &["\u{5f}", "\u{b}"]), ("\u{5f}\u{308}\u{b}", &["\u{5f}\u{308}", "\u{b}"]), - ("\u{5f}\u{3031}", &["\u{5f}\u{3031}"]), ("\u{5f}\u{308}\u{3031}", - &["\u{5f}\u{308}\u{3031}"]), ("\u{5f}\u{41}", &["\u{5f}\u{41}"]), ("\u{5f}\u{308}\u{41}", - &["\u{5f}\u{308}\u{41}"]), ("\u{5f}\u{3a}", &["\u{5f}", "\u{3a}"]), ("\u{5f}\u{308}\u{3a}", - &["\u{5f}\u{308}", "\u{3a}"]), ("\u{5f}\u{2c}", &["\u{5f}", "\u{2c}"]), - ("\u{5f}\u{308}\u{2c}", &["\u{5f}\u{308}", "\u{2c}"]), ("\u{5f}\u{2e}", &["\u{5f}", - "\u{2e}"]), ("\u{5f}\u{308}\u{2e}", &["\u{5f}\u{308}", "\u{2e}"]), ("\u{5f}\u{30}", - &["\u{5f}\u{30}"]), ("\u{5f}\u{308}\u{30}", &["\u{5f}\u{308}\u{30}"]), ("\u{5f}\u{5f}", - &["\u{5f}\u{5f}"]), ("\u{5f}\u{308}\u{5f}", &["\u{5f}\u{308}\u{5f}"]), ("\u{5f}\u{1f1e6}", - &["\u{5f}", "\u{1f1e6}"]), ("\u{5f}\u{308}\u{1f1e6}", &["\u{5f}\u{308}", "\u{1f1e6}"]), - ("\u{5f}\u{5d0}", &["\u{5f}\u{5d0}"]), ("\u{5f}\u{308}\u{5d0}", &["\u{5f}\u{308}\u{5d0}"]), - ("\u{5f}\u{22}", &["\u{5f}", "\u{22}"]), ("\u{5f}\u{308}\u{22}", &["\u{5f}\u{308}", - "\u{22}"]), ("\u{5f}\u{27}", &["\u{5f}", "\u{27}"]), ("\u{5f}\u{308}\u{27}", - &["\u{5f}\u{308}", "\u{27}"]), ("\u{5f}\u{261d}", &["\u{5f}", "\u{261d}"]), - ("\u{5f}\u{308}\u{261d}", &["\u{5f}\u{308}", "\u{261d}"]), ("\u{5f}\u{1f3fb}", &["\u{5f}", - "\u{1f3fb}"]), ("\u{5f}\u{308}\u{1f3fb}", &["\u{5f}\u{308}", "\u{1f3fb}"]), - ("\u{5f}\u{2764}", &["\u{5f}", "\u{2764}"]), ("\u{5f}\u{308}\u{2764}", &["\u{5f}\u{308}", - "\u{2764}"]), ("\u{5f}\u{1f466}", &["\u{5f}", "\u{1f466}"]), ("\u{5f}\u{308}\u{1f466}", - &["\u{5f}\u{308}", "\u{1f466}"]), ("\u{5f}\u{ad}", &["\u{5f}\u{ad}"]), - ("\u{5f}\u{308}\u{ad}", &["\u{5f}\u{308}\u{ad}"]), ("\u{5f}\u{300}", &["\u{5f}\u{300}"]), - ("\u{5f}\u{308}\u{300}", &["\u{5f}\u{308}\u{300}"]), ("\u{5f}\u{200d}", - &["\u{5f}\u{200d}"]), ("\u{5f}\u{308}\u{200d}", &["\u{5f}\u{308}\u{200d}"]), - ("\u{5f}\u{61}\u{2060}", &["\u{5f}\u{61}\u{2060}"]), ("\u{5f}\u{308}\u{61}\u{2060}", - &["\u{5f}\u{308}\u{61}\u{2060}"]), ("\u{5f}\u{61}\u{3a}", &["\u{5f}\u{61}", "\u{3a}"]), - ("\u{5f}\u{308}\u{61}\u{3a}", &["\u{5f}\u{308}\u{61}", "\u{3a}"]), ("\u{5f}\u{61}\u{27}", - &["\u{5f}\u{61}", "\u{27}"]), ("\u{5f}\u{308}\u{61}\u{27}", &["\u{5f}\u{308}\u{61}", - "\u{27}"]), ("\u{5f}\u{61}\u{27}\u{2060}", &["\u{5f}\u{61}", "\u{27}\u{2060}"]), - ("\u{5f}\u{308}\u{61}\u{27}\u{2060}", &["\u{5f}\u{308}\u{61}", "\u{27}\u{2060}"]), - ("\u{5f}\u{61}\u{2c}", &["\u{5f}\u{61}", "\u{2c}"]), ("\u{5f}\u{308}\u{61}\u{2c}", - &["\u{5f}\u{308}\u{61}", "\u{2c}"]), ("\u{5f}\u{31}\u{3a}", &["\u{5f}\u{31}", "\u{3a}"]), - ("\u{5f}\u{308}\u{31}\u{3a}", &["\u{5f}\u{308}\u{31}", "\u{3a}"]), ("\u{5f}\u{31}\u{27}", - &["\u{5f}\u{31}", "\u{27}"]), ("\u{5f}\u{308}\u{31}\u{27}", &["\u{5f}\u{308}\u{31}", - "\u{27}"]), ("\u{5f}\u{31}\u{2c}", &["\u{5f}\u{31}", "\u{2c}"]), - ("\u{5f}\u{308}\u{31}\u{2c}", &["\u{5f}\u{308}\u{31}", "\u{2c}"]), - ("\u{5f}\u{31}\u{2e}\u{2060}", &["\u{5f}\u{31}", "\u{2e}\u{2060}"]), - ("\u{5f}\u{308}\u{31}\u{2e}\u{2060}", &["\u{5f}\u{308}\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f1e6}\u{1}", &["\u{1f1e6}", "\u{1}"]), ("\u{1f1e6}\u{308}\u{1}", &["\u{1f1e6}\u{308}", - "\u{1}"]), ("\u{1f1e6}\u{d}", &["\u{1f1e6}", "\u{d}"]), ("\u{1f1e6}\u{308}\u{d}", - &["\u{1f1e6}\u{308}", "\u{d}"]), ("\u{1f1e6}\u{a}", &["\u{1f1e6}", "\u{a}"]), - ("\u{1f1e6}\u{308}\u{a}", &["\u{1f1e6}\u{308}", "\u{a}"]), ("\u{1f1e6}\u{b}", &["\u{1f1e6}", - "\u{b}"]), ("\u{1f1e6}\u{308}\u{b}", &["\u{1f1e6}\u{308}", "\u{b}"]), ("\u{1f1e6}\u{3031}", - &["\u{1f1e6}", "\u{3031}"]), ("\u{1f1e6}\u{308}\u{3031}", &["\u{1f1e6}\u{308}", - "\u{3031}"]), ("\u{1f1e6}\u{41}", &["\u{1f1e6}", "\u{41}"]), ("\u{1f1e6}\u{308}\u{41}", - &["\u{1f1e6}\u{308}", "\u{41}"]), ("\u{1f1e6}\u{3a}", &["\u{1f1e6}", "\u{3a}"]), - ("\u{1f1e6}\u{308}\u{3a}", &["\u{1f1e6}\u{308}", "\u{3a}"]), ("\u{1f1e6}\u{2c}", - &["\u{1f1e6}", "\u{2c}"]), ("\u{1f1e6}\u{308}\u{2c}", &["\u{1f1e6}\u{308}", "\u{2c}"]), - ("\u{1f1e6}\u{2e}", &["\u{1f1e6}", "\u{2e}"]), ("\u{1f1e6}\u{308}\u{2e}", - &["\u{1f1e6}\u{308}", "\u{2e}"]), ("\u{1f1e6}\u{30}", &["\u{1f1e6}", "\u{30}"]), - ("\u{1f1e6}\u{308}\u{30}", &["\u{1f1e6}\u{308}", "\u{30}"]), ("\u{1f1e6}\u{5f}", - &["\u{1f1e6}", "\u{5f}"]), ("\u{1f1e6}\u{308}\u{5f}", &["\u{1f1e6}\u{308}", "\u{5f}"]), - ("\u{1f1e6}\u{1f1e6}", &["\u{1f1e6}\u{1f1e6}"]), ("\u{1f1e6}\u{308}\u{1f1e6}", - &["\u{1f1e6}\u{308}\u{1f1e6}"]), ("\u{1f1e6}\u{5d0}", &["\u{1f1e6}", "\u{5d0}"]), - ("\u{1f1e6}\u{308}\u{5d0}", &["\u{1f1e6}\u{308}", "\u{5d0}"]), ("\u{1f1e6}\u{22}", - &["\u{1f1e6}", "\u{22}"]), ("\u{1f1e6}\u{308}\u{22}", &["\u{1f1e6}\u{308}", "\u{22}"]), - ("\u{1f1e6}\u{27}", &["\u{1f1e6}", "\u{27}"]), ("\u{1f1e6}\u{308}\u{27}", - &["\u{1f1e6}\u{308}", "\u{27}"]), ("\u{1f1e6}\u{261d}", &["\u{1f1e6}", "\u{261d}"]), - ("\u{1f1e6}\u{308}\u{261d}", &["\u{1f1e6}\u{308}", "\u{261d}"]), ("\u{1f1e6}\u{1f3fb}", - &["\u{1f1e6}", "\u{1f3fb}"]), ("\u{1f1e6}\u{308}\u{1f3fb}", &["\u{1f1e6}\u{308}", - "\u{1f3fb}"]), ("\u{1f1e6}\u{2764}", &["\u{1f1e6}", "\u{2764}"]), - ("\u{1f1e6}\u{308}\u{2764}", &["\u{1f1e6}\u{308}", "\u{2764}"]), ("\u{1f1e6}\u{1f466}", - &["\u{1f1e6}", "\u{1f466}"]), ("\u{1f1e6}\u{308}\u{1f466}", &["\u{1f1e6}\u{308}", - "\u{1f466}"]), ("\u{1f1e6}\u{ad}", &["\u{1f1e6}\u{ad}"]), ("\u{1f1e6}\u{308}\u{ad}", - &["\u{1f1e6}\u{308}\u{ad}"]), ("\u{1f1e6}\u{300}", &["\u{1f1e6}\u{300}"]), - ("\u{1f1e6}\u{308}\u{300}", &["\u{1f1e6}\u{308}\u{300}"]), ("\u{1f1e6}\u{200d}", - &["\u{1f1e6}\u{200d}"]), ("\u{1f1e6}\u{308}\u{200d}", &["\u{1f1e6}\u{308}\u{200d}"]), - ("\u{1f1e6}\u{61}\u{2060}", &["\u{1f1e6}", "\u{61}\u{2060}"]), - ("\u{1f1e6}\u{308}\u{61}\u{2060}", &["\u{1f1e6}\u{308}", "\u{61}\u{2060}"]), - ("\u{1f1e6}\u{61}\u{3a}", &["\u{1f1e6}", "\u{61}", "\u{3a}"]), - ("\u{1f1e6}\u{308}\u{61}\u{3a}", &["\u{1f1e6}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{1f1e6}\u{61}\u{27}", &["\u{1f1e6}", "\u{61}", "\u{27}"]), - ("\u{1f1e6}\u{308}\u{61}\u{27}", &["\u{1f1e6}\u{308}", "\u{61}", "\u{27}"]), - ("\u{1f1e6}\u{61}\u{27}\u{2060}", &["\u{1f1e6}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f1e6}\u{308}\u{61}\u{27}\u{2060}", &["\u{1f1e6}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f1e6}\u{61}\u{2c}", &["\u{1f1e6}", "\u{61}", "\u{2c}"]), - ("\u{1f1e6}\u{308}\u{61}\u{2c}", &["\u{1f1e6}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{1f1e6}\u{31}\u{3a}", &["\u{1f1e6}", "\u{31}", "\u{3a}"]), - ("\u{1f1e6}\u{308}\u{31}\u{3a}", &["\u{1f1e6}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{1f1e6}\u{31}\u{27}", &["\u{1f1e6}", "\u{31}", "\u{27}"]), - ("\u{1f1e6}\u{308}\u{31}\u{27}", &["\u{1f1e6}\u{308}", "\u{31}", "\u{27}"]), - ("\u{1f1e6}\u{31}\u{2c}", &["\u{1f1e6}", "\u{31}", "\u{2c}"]), - ("\u{1f1e6}\u{308}\u{31}\u{2c}", &["\u{1f1e6}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{1f1e6}\u{31}\u{2e}\u{2060}", &["\u{1f1e6}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f1e6}\u{308}\u{31}\u{2e}\u{2060}", &["\u{1f1e6}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{5d0}\u{1}", &["\u{5d0}", "\u{1}"]), ("\u{5d0}\u{308}\u{1}", &["\u{5d0}\u{308}", - "\u{1}"]), ("\u{5d0}\u{d}", &["\u{5d0}", "\u{d}"]), ("\u{5d0}\u{308}\u{d}", - &["\u{5d0}\u{308}", "\u{d}"]), ("\u{5d0}\u{a}", &["\u{5d0}", "\u{a}"]), - ("\u{5d0}\u{308}\u{a}", &["\u{5d0}\u{308}", "\u{a}"]), ("\u{5d0}\u{b}", &["\u{5d0}", - "\u{b}"]), ("\u{5d0}\u{308}\u{b}", &["\u{5d0}\u{308}", "\u{b}"]), ("\u{5d0}\u{3031}", - &["\u{5d0}", "\u{3031}"]), ("\u{5d0}\u{308}\u{3031}", &["\u{5d0}\u{308}", "\u{3031}"]), - ("\u{5d0}\u{41}", &["\u{5d0}\u{41}"]), ("\u{5d0}\u{308}\u{41}", &["\u{5d0}\u{308}\u{41}"]), - ("\u{5d0}\u{3a}", &["\u{5d0}", "\u{3a}"]), ("\u{5d0}\u{308}\u{3a}", &["\u{5d0}\u{308}", - "\u{3a}"]), ("\u{5d0}\u{2c}", &["\u{5d0}", "\u{2c}"]), ("\u{5d0}\u{308}\u{2c}", - &["\u{5d0}\u{308}", "\u{2c}"]), ("\u{5d0}\u{2e}", &["\u{5d0}", "\u{2e}"]), - ("\u{5d0}\u{308}\u{2e}", &["\u{5d0}\u{308}", "\u{2e}"]), ("\u{5d0}\u{30}", - &["\u{5d0}\u{30}"]), ("\u{5d0}\u{308}\u{30}", &["\u{5d0}\u{308}\u{30}"]), ("\u{5d0}\u{5f}", - &["\u{5d0}\u{5f}"]), ("\u{5d0}\u{308}\u{5f}", &["\u{5d0}\u{308}\u{5f}"]), - ("\u{5d0}\u{1f1e6}", &["\u{5d0}", "\u{1f1e6}"]), ("\u{5d0}\u{308}\u{1f1e6}", - &["\u{5d0}\u{308}", "\u{1f1e6}"]), ("\u{5d0}\u{5d0}", &["\u{5d0}\u{5d0}"]), - ("\u{5d0}\u{308}\u{5d0}", &["\u{5d0}\u{308}\u{5d0}"]), ("\u{5d0}\u{22}", &["\u{5d0}", - "\u{22}"]), ("\u{5d0}\u{308}\u{22}", &["\u{5d0}\u{308}", "\u{22}"]), ("\u{5d0}\u{27}", - &["\u{5d0}\u{27}"]), ("\u{5d0}\u{308}\u{27}", &["\u{5d0}\u{308}\u{27}"]), - ("\u{5d0}\u{261d}", &["\u{5d0}", "\u{261d}"]), ("\u{5d0}\u{308}\u{261d}", - &["\u{5d0}\u{308}", "\u{261d}"]), ("\u{5d0}\u{1f3fb}", &["\u{5d0}", "\u{1f3fb}"]), - ("\u{5d0}\u{308}\u{1f3fb}", &["\u{5d0}\u{308}", "\u{1f3fb}"]), ("\u{5d0}\u{2764}", - &["\u{5d0}", "\u{2764}"]), ("\u{5d0}\u{308}\u{2764}", &["\u{5d0}\u{308}", "\u{2764}"]), - ("\u{5d0}\u{1f466}", &["\u{5d0}", "\u{1f466}"]), ("\u{5d0}\u{308}\u{1f466}", - &["\u{5d0}\u{308}", "\u{1f466}"]), ("\u{5d0}\u{ad}", &["\u{5d0}\u{ad}"]), - ("\u{5d0}\u{308}\u{ad}", &["\u{5d0}\u{308}\u{ad}"]), ("\u{5d0}\u{300}", - &["\u{5d0}\u{300}"]), ("\u{5d0}\u{308}\u{300}", &["\u{5d0}\u{308}\u{300}"]), - ("\u{5d0}\u{200d}", &["\u{5d0}\u{200d}"]), ("\u{5d0}\u{308}\u{200d}", - &["\u{5d0}\u{308}\u{200d}"]), ("\u{5d0}\u{61}\u{2060}", &["\u{5d0}\u{61}\u{2060}"]), - ("\u{5d0}\u{308}\u{61}\u{2060}", &["\u{5d0}\u{308}\u{61}\u{2060}"]), ("\u{5d0}\u{61}\u{3a}", - &["\u{5d0}\u{61}", "\u{3a}"]), ("\u{5d0}\u{308}\u{61}\u{3a}", &["\u{5d0}\u{308}\u{61}", - "\u{3a}"]), ("\u{5d0}\u{61}\u{27}", &["\u{5d0}\u{61}", "\u{27}"]), - ("\u{5d0}\u{308}\u{61}\u{27}", &["\u{5d0}\u{308}\u{61}", "\u{27}"]), - ("\u{5d0}\u{61}\u{27}\u{2060}", &["\u{5d0}\u{61}", "\u{27}\u{2060}"]), - ("\u{5d0}\u{308}\u{61}\u{27}\u{2060}", &["\u{5d0}\u{308}\u{61}", "\u{27}\u{2060}"]), - ("\u{5d0}\u{61}\u{2c}", &["\u{5d0}\u{61}", "\u{2c}"]), ("\u{5d0}\u{308}\u{61}\u{2c}", - &["\u{5d0}\u{308}\u{61}", "\u{2c}"]), ("\u{5d0}\u{31}\u{3a}", &["\u{5d0}\u{31}", "\u{3a}"]), - ("\u{5d0}\u{308}\u{31}\u{3a}", &["\u{5d0}\u{308}\u{31}", "\u{3a}"]), ("\u{5d0}\u{31}\u{27}", - &["\u{5d0}\u{31}", "\u{27}"]), ("\u{5d0}\u{308}\u{31}\u{27}", &["\u{5d0}\u{308}\u{31}", - "\u{27}"]), ("\u{5d0}\u{31}\u{2c}", &["\u{5d0}\u{31}", "\u{2c}"]), - ("\u{5d0}\u{308}\u{31}\u{2c}", &["\u{5d0}\u{308}\u{31}", "\u{2c}"]), - ("\u{5d0}\u{31}\u{2e}\u{2060}", &["\u{5d0}\u{31}", "\u{2e}\u{2060}"]), - ("\u{5d0}\u{308}\u{31}\u{2e}\u{2060}", &["\u{5d0}\u{308}\u{31}", "\u{2e}\u{2060}"]), - ("\u{22}\u{1}", &["\u{22}", "\u{1}"]), ("\u{22}\u{308}\u{1}", &["\u{22}\u{308}", "\u{1}"]), - ("\u{22}\u{d}", &["\u{22}", "\u{d}"]), ("\u{22}\u{308}\u{d}", &["\u{22}\u{308}", "\u{d}"]), - ("\u{22}\u{a}", &["\u{22}", "\u{a}"]), ("\u{22}\u{308}\u{a}", &["\u{22}\u{308}", "\u{a}"]), - ("\u{22}\u{b}", &["\u{22}", "\u{b}"]), ("\u{22}\u{308}\u{b}", &["\u{22}\u{308}", "\u{b}"]), - ("\u{22}\u{3031}", &["\u{22}", "\u{3031}"]), ("\u{22}\u{308}\u{3031}", &["\u{22}\u{308}", - "\u{3031}"]), ("\u{22}\u{41}", &["\u{22}", "\u{41}"]), ("\u{22}\u{308}\u{41}", - &["\u{22}\u{308}", "\u{41}"]), ("\u{22}\u{3a}", &["\u{22}", "\u{3a}"]), - ("\u{22}\u{308}\u{3a}", &["\u{22}\u{308}", "\u{3a}"]), ("\u{22}\u{2c}", &["\u{22}", - "\u{2c}"]), ("\u{22}\u{308}\u{2c}", &["\u{22}\u{308}", "\u{2c}"]), ("\u{22}\u{2e}", - &["\u{22}", "\u{2e}"]), ("\u{22}\u{308}\u{2e}", &["\u{22}\u{308}", "\u{2e}"]), - ("\u{22}\u{30}", &["\u{22}", "\u{30}"]), ("\u{22}\u{308}\u{30}", &["\u{22}\u{308}", - "\u{30}"]), ("\u{22}\u{5f}", &["\u{22}", "\u{5f}"]), ("\u{22}\u{308}\u{5f}", - &["\u{22}\u{308}", "\u{5f}"]), ("\u{22}\u{1f1e6}", &["\u{22}", "\u{1f1e6}"]), - ("\u{22}\u{308}\u{1f1e6}", &["\u{22}\u{308}", "\u{1f1e6}"]), ("\u{22}\u{5d0}", &["\u{22}", - "\u{5d0}"]), ("\u{22}\u{308}\u{5d0}", &["\u{22}\u{308}", "\u{5d0}"]), ("\u{22}\u{22}", - &["\u{22}", "\u{22}"]), ("\u{22}\u{308}\u{22}", &["\u{22}\u{308}", "\u{22}"]), - ("\u{22}\u{27}", &["\u{22}", "\u{27}"]), ("\u{22}\u{308}\u{27}", &["\u{22}\u{308}", - "\u{27}"]), ("\u{22}\u{261d}", &["\u{22}", "\u{261d}"]), ("\u{22}\u{308}\u{261d}", - &["\u{22}\u{308}", "\u{261d}"]), ("\u{22}\u{1f3fb}", &["\u{22}", "\u{1f3fb}"]), - ("\u{22}\u{308}\u{1f3fb}", &["\u{22}\u{308}", "\u{1f3fb}"]), ("\u{22}\u{2764}", &["\u{22}", - "\u{2764}"]), ("\u{22}\u{308}\u{2764}", &["\u{22}\u{308}", "\u{2764}"]), ("\u{22}\u{1f466}", - &["\u{22}", "\u{1f466}"]), ("\u{22}\u{308}\u{1f466}", &["\u{22}\u{308}", "\u{1f466}"]), - ("\u{22}\u{ad}", &["\u{22}\u{ad}"]), ("\u{22}\u{308}\u{ad}", &["\u{22}\u{308}\u{ad}"]), - ("\u{22}\u{300}", &["\u{22}\u{300}"]), ("\u{22}\u{308}\u{300}", &["\u{22}\u{308}\u{300}"]), - ("\u{22}\u{200d}", &["\u{22}\u{200d}"]), ("\u{22}\u{308}\u{200d}", - &["\u{22}\u{308}\u{200d}"]), ("\u{22}\u{61}\u{2060}", &["\u{22}", "\u{61}\u{2060}"]), - ("\u{22}\u{308}\u{61}\u{2060}", &["\u{22}\u{308}", "\u{61}\u{2060}"]), - ("\u{22}\u{61}\u{3a}", &["\u{22}", "\u{61}", "\u{3a}"]), ("\u{22}\u{308}\u{61}\u{3a}", - &["\u{22}\u{308}", "\u{61}", "\u{3a}"]), ("\u{22}\u{61}\u{27}", &["\u{22}", "\u{61}", - "\u{27}"]), ("\u{22}\u{308}\u{61}\u{27}", &["\u{22}\u{308}", "\u{61}", "\u{27}"]), - ("\u{22}\u{61}\u{27}\u{2060}", &["\u{22}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{22}\u{308}\u{61}\u{27}\u{2060}", &["\u{22}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{22}\u{61}\u{2c}", &["\u{22}", "\u{61}", "\u{2c}"]), ("\u{22}\u{308}\u{61}\u{2c}", - &["\u{22}\u{308}", "\u{61}", "\u{2c}"]), ("\u{22}\u{31}\u{3a}", &["\u{22}", "\u{31}", - "\u{3a}"]), ("\u{22}\u{308}\u{31}\u{3a}", &["\u{22}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{22}\u{31}\u{27}", &["\u{22}", "\u{31}", "\u{27}"]), ("\u{22}\u{308}\u{31}\u{27}", - &["\u{22}\u{308}", "\u{31}", "\u{27}"]), ("\u{22}\u{31}\u{2c}", &["\u{22}", "\u{31}", - "\u{2c}"]), ("\u{22}\u{308}\u{31}\u{2c}", &["\u{22}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{22}\u{31}\u{2e}\u{2060}", &["\u{22}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{22}\u{308}\u{31}\u{2e}\u{2060}", &["\u{22}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{27}\u{1}", &["\u{27}", "\u{1}"]), ("\u{27}\u{308}\u{1}", &["\u{27}\u{308}", "\u{1}"]), - ("\u{27}\u{d}", &["\u{27}", "\u{d}"]), ("\u{27}\u{308}\u{d}", &["\u{27}\u{308}", "\u{d}"]), - ("\u{27}\u{a}", &["\u{27}", "\u{a}"]), ("\u{27}\u{308}\u{a}", &["\u{27}\u{308}", "\u{a}"]), - ("\u{27}\u{b}", &["\u{27}", "\u{b}"]), ("\u{27}\u{308}\u{b}", &["\u{27}\u{308}", "\u{b}"]), - ("\u{27}\u{3031}", &["\u{27}", "\u{3031}"]), ("\u{27}\u{308}\u{3031}", &["\u{27}\u{308}", - "\u{3031}"]), ("\u{27}\u{41}", &["\u{27}", "\u{41}"]), ("\u{27}\u{308}\u{41}", - &["\u{27}\u{308}", "\u{41}"]), ("\u{27}\u{3a}", &["\u{27}", "\u{3a}"]), - ("\u{27}\u{308}\u{3a}", &["\u{27}\u{308}", "\u{3a}"]), ("\u{27}\u{2c}", &["\u{27}", - "\u{2c}"]), ("\u{27}\u{308}\u{2c}", &["\u{27}\u{308}", "\u{2c}"]), ("\u{27}\u{2e}", - &["\u{27}", "\u{2e}"]), ("\u{27}\u{308}\u{2e}", &["\u{27}\u{308}", "\u{2e}"]), - ("\u{27}\u{30}", &["\u{27}", "\u{30}"]), ("\u{27}\u{308}\u{30}", &["\u{27}\u{308}", - "\u{30}"]), ("\u{27}\u{5f}", &["\u{27}", "\u{5f}"]), ("\u{27}\u{308}\u{5f}", - &["\u{27}\u{308}", "\u{5f}"]), ("\u{27}\u{1f1e6}", &["\u{27}", "\u{1f1e6}"]), - ("\u{27}\u{308}\u{1f1e6}", &["\u{27}\u{308}", "\u{1f1e6}"]), ("\u{27}\u{5d0}", &["\u{27}", - "\u{5d0}"]), ("\u{27}\u{308}\u{5d0}", &["\u{27}\u{308}", "\u{5d0}"]), ("\u{27}\u{22}", - &["\u{27}", "\u{22}"]), ("\u{27}\u{308}\u{22}", &["\u{27}\u{308}", "\u{22}"]), - ("\u{27}\u{27}", &["\u{27}", "\u{27}"]), ("\u{27}\u{308}\u{27}", &["\u{27}\u{308}", - "\u{27}"]), ("\u{27}\u{261d}", &["\u{27}", "\u{261d}"]), ("\u{27}\u{308}\u{261d}", - &["\u{27}\u{308}", "\u{261d}"]), ("\u{27}\u{1f3fb}", &["\u{27}", "\u{1f3fb}"]), - ("\u{27}\u{308}\u{1f3fb}", &["\u{27}\u{308}", "\u{1f3fb}"]), ("\u{27}\u{2764}", &["\u{27}", - "\u{2764}"]), ("\u{27}\u{308}\u{2764}", &["\u{27}\u{308}", "\u{2764}"]), ("\u{27}\u{1f466}", - &["\u{27}", "\u{1f466}"]), ("\u{27}\u{308}\u{1f466}", &["\u{27}\u{308}", "\u{1f466}"]), - ("\u{27}\u{ad}", &["\u{27}\u{ad}"]), ("\u{27}\u{308}\u{ad}", &["\u{27}\u{308}\u{ad}"]), - ("\u{27}\u{300}", &["\u{27}\u{300}"]), ("\u{27}\u{308}\u{300}", &["\u{27}\u{308}\u{300}"]), - ("\u{27}\u{200d}", &["\u{27}\u{200d}"]), ("\u{27}\u{308}\u{200d}", - &["\u{27}\u{308}\u{200d}"]), ("\u{27}\u{61}\u{2060}", &["\u{27}", "\u{61}\u{2060}"]), - ("\u{27}\u{308}\u{61}\u{2060}", &["\u{27}\u{308}", "\u{61}\u{2060}"]), - ("\u{27}\u{61}\u{3a}", &["\u{27}", "\u{61}", "\u{3a}"]), ("\u{27}\u{308}\u{61}\u{3a}", - &["\u{27}\u{308}", "\u{61}", "\u{3a}"]), ("\u{27}\u{61}\u{27}", &["\u{27}", "\u{61}", - "\u{27}"]), ("\u{27}\u{308}\u{61}\u{27}", &["\u{27}\u{308}", "\u{61}", "\u{27}"]), - ("\u{27}\u{61}\u{27}\u{2060}", &["\u{27}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{27}\u{308}\u{61}\u{27}\u{2060}", &["\u{27}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{27}\u{61}\u{2c}", &["\u{27}", "\u{61}", "\u{2c}"]), ("\u{27}\u{308}\u{61}\u{2c}", - &["\u{27}\u{308}", "\u{61}", "\u{2c}"]), ("\u{27}\u{31}\u{3a}", &["\u{27}", "\u{31}", - "\u{3a}"]), ("\u{27}\u{308}\u{31}\u{3a}", &["\u{27}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{27}\u{31}\u{27}", &["\u{27}", "\u{31}", "\u{27}"]), ("\u{27}\u{308}\u{31}\u{27}", - &["\u{27}\u{308}", "\u{31}", "\u{27}"]), ("\u{27}\u{31}\u{2c}", &["\u{27}", "\u{31}", - "\u{2c}"]), ("\u{27}\u{308}\u{31}\u{2c}", &["\u{27}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{27}\u{31}\u{2e}\u{2060}", &["\u{27}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{27}\u{308}\u{31}\u{2e}\u{2060}", &["\u{27}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{261d}\u{1}", &["\u{261d}", "\u{1}"]), ("\u{261d}\u{308}\u{1}", &["\u{261d}\u{308}", - "\u{1}"]), ("\u{261d}\u{d}", &["\u{261d}", "\u{d}"]), ("\u{261d}\u{308}\u{d}", - &["\u{261d}\u{308}", "\u{d}"]), ("\u{261d}\u{a}", &["\u{261d}", "\u{a}"]), - ("\u{261d}\u{308}\u{a}", &["\u{261d}\u{308}", "\u{a}"]), ("\u{261d}\u{b}", &["\u{261d}", - "\u{b}"]), ("\u{261d}\u{308}\u{b}", &["\u{261d}\u{308}", "\u{b}"]), ("\u{261d}\u{3031}", - &["\u{261d}", "\u{3031}"]), ("\u{261d}\u{308}\u{3031}", &["\u{261d}\u{308}", "\u{3031}"]), - ("\u{261d}\u{41}", &["\u{261d}", "\u{41}"]), ("\u{261d}\u{308}\u{41}", &["\u{261d}\u{308}", - "\u{41}"]), ("\u{261d}\u{3a}", &["\u{261d}", "\u{3a}"]), ("\u{261d}\u{308}\u{3a}", - &["\u{261d}\u{308}", "\u{3a}"]), ("\u{261d}\u{2c}", &["\u{261d}", "\u{2c}"]), - ("\u{261d}\u{308}\u{2c}", &["\u{261d}\u{308}", "\u{2c}"]), ("\u{261d}\u{2e}", &["\u{261d}", - "\u{2e}"]), ("\u{261d}\u{308}\u{2e}", &["\u{261d}\u{308}", "\u{2e}"]), ("\u{261d}\u{30}", - &["\u{261d}", "\u{30}"]), ("\u{261d}\u{308}\u{30}", &["\u{261d}\u{308}", "\u{30}"]), - ("\u{261d}\u{5f}", &["\u{261d}", "\u{5f}"]), ("\u{261d}\u{308}\u{5f}", &["\u{261d}\u{308}", - "\u{5f}"]), ("\u{261d}\u{1f1e6}", &["\u{261d}", "\u{1f1e6}"]), ("\u{261d}\u{308}\u{1f1e6}", - &["\u{261d}\u{308}", "\u{1f1e6}"]), ("\u{261d}\u{5d0}", &["\u{261d}", "\u{5d0}"]), - ("\u{261d}\u{308}\u{5d0}", &["\u{261d}\u{308}", "\u{5d0}"]), ("\u{261d}\u{22}", - &["\u{261d}", "\u{22}"]), ("\u{261d}\u{308}\u{22}", &["\u{261d}\u{308}", "\u{22}"]), - ("\u{261d}\u{27}", &["\u{261d}", "\u{27}"]), ("\u{261d}\u{308}\u{27}", &["\u{261d}\u{308}", - "\u{27}"]), ("\u{261d}\u{261d}", &["\u{261d}", "\u{261d}"]), ("\u{261d}\u{308}\u{261d}", - &["\u{261d}\u{308}", "\u{261d}"]), ("\u{261d}\u{1f3fb}", &["\u{261d}\u{1f3fb}"]), - ("\u{261d}\u{308}\u{1f3fb}", &["\u{261d}\u{308}\u{1f3fb}"]), ("\u{261d}\u{2764}", - &["\u{261d}", "\u{2764}"]), ("\u{261d}\u{308}\u{2764}", &["\u{261d}\u{308}", "\u{2764}"]), - ("\u{261d}\u{1f466}", &["\u{261d}", "\u{1f466}"]), ("\u{261d}\u{308}\u{1f466}", - &["\u{261d}\u{308}", "\u{1f466}"]), ("\u{261d}\u{ad}", &["\u{261d}\u{ad}"]), - ("\u{261d}\u{308}\u{ad}", &["\u{261d}\u{308}\u{ad}"]), ("\u{261d}\u{300}", - &["\u{261d}\u{300}"]), ("\u{261d}\u{308}\u{300}", &["\u{261d}\u{308}\u{300}"]), - ("\u{261d}\u{200d}", &["\u{261d}\u{200d}"]), ("\u{261d}\u{308}\u{200d}", - &["\u{261d}\u{308}\u{200d}"]), ("\u{261d}\u{61}\u{2060}", &["\u{261d}", "\u{61}\u{2060}"]), - ("\u{261d}\u{308}\u{61}\u{2060}", &["\u{261d}\u{308}", "\u{61}\u{2060}"]), - ("\u{261d}\u{61}\u{3a}", &["\u{261d}", "\u{61}", "\u{3a}"]), ("\u{261d}\u{308}\u{61}\u{3a}", - &["\u{261d}\u{308}", "\u{61}", "\u{3a}"]), ("\u{261d}\u{61}\u{27}", &["\u{261d}", "\u{61}", - "\u{27}"]), ("\u{261d}\u{308}\u{61}\u{27}", &["\u{261d}\u{308}", "\u{61}", "\u{27}"]), - ("\u{261d}\u{61}\u{27}\u{2060}", &["\u{261d}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{261d}\u{308}\u{61}\u{27}\u{2060}", &["\u{261d}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{261d}\u{61}\u{2c}", &["\u{261d}", "\u{61}", "\u{2c}"]), ("\u{261d}\u{308}\u{61}\u{2c}", - &["\u{261d}\u{308}", "\u{61}", "\u{2c}"]), ("\u{261d}\u{31}\u{3a}", &["\u{261d}", "\u{31}", - "\u{3a}"]), ("\u{261d}\u{308}\u{31}\u{3a}", &["\u{261d}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{261d}\u{31}\u{27}", &["\u{261d}", "\u{31}", "\u{27}"]), ("\u{261d}\u{308}\u{31}\u{27}", - &["\u{261d}\u{308}", "\u{31}", "\u{27}"]), ("\u{261d}\u{31}\u{2c}", &["\u{261d}", "\u{31}", - "\u{2c}"]), ("\u{261d}\u{308}\u{31}\u{2c}", &["\u{261d}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{261d}\u{31}\u{2e}\u{2060}", &["\u{261d}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{261d}\u{308}\u{31}\u{2e}\u{2060}", &["\u{261d}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f3fb}\u{1}", &["\u{1f3fb}", "\u{1}"]), ("\u{1f3fb}\u{308}\u{1}", &["\u{1f3fb}\u{308}", - "\u{1}"]), ("\u{1f3fb}\u{d}", &["\u{1f3fb}", "\u{d}"]), ("\u{1f3fb}\u{308}\u{d}", - &["\u{1f3fb}\u{308}", "\u{d}"]), ("\u{1f3fb}\u{a}", &["\u{1f3fb}", "\u{a}"]), - ("\u{1f3fb}\u{308}\u{a}", &["\u{1f3fb}\u{308}", "\u{a}"]), ("\u{1f3fb}\u{b}", &["\u{1f3fb}", - "\u{b}"]), ("\u{1f3fb}\u{308}\u{b}", &["\u{1f3fb}\u{308}", "\u{b}"]), ("\u{1f3fb}\u{3031}", - &["\u{1f3fb}", "\u{3031}"]), ("\u{1f3fb}\u{308}\u{3031}", &["\u{1f3fb}\u{308}", - "\u{3031}"]), ("\u{1f3fb}\u{41}", &["\u{1f3fb}", "\u{41}"]), ("\u{1f3fb}\u{308}\u{41}", - &["\u{1f3fb}\u{308}", "\u{41}"]), ("\u{1f3fb}\u{3a}", &["\u{1f3fb}", "\u{3a}"]), - ("\u{1f3fb}\u{308}\u{3a}", &["\u{1f3fb}\u{308}", "\u{3a}"]), ("\u{1f3fb}\u{2c}", - &["\u{1f3fb}", "\u{2c}"]), ("\u{1f3fb}\u{308}\u{2c}", &["\u{1f3fb}\u{308}", "\u{2c}"]), - ("\u{1f3fb}\u{2e}", &["\u{1f3fb}", "\u{2e}"]), ("\u{1f3fb}\u{308}\u{2e}", - &["\u{1f3fb}\u{308}", "\u{2e}"]), ("\u{1f3fb}\u{30}", &["\u{1f3fb}", "\u{30}"]), - ("\u{1f3fb}\u{308}\u{30}", &["\u{1f3fb}\u{308}", "\u{30}"]), ("\u{1f3fb}\u{5f}", - &["\u{1f3fb}", "\u{5f}"]), ("\u{1f3fb}\u{308}\u{5f}", &["\u{1f3fb}\u{308}", "\u{5f}"]), - ("\u{1f3fb}\u{1f1e6}", &["\u{1f3fb}", "\u{1f1e6}"]), ("\u{1f3fb}\u{308}\u{1f1e6}", - &["\u{1f3fb}\u{308}", "\u{1f1e6}"]), ("\u{1f3fb}\u{5d0}", &["\u{1f3fb}", "\u{5d0}"]), - ("\u{1f3fb}\u{308}\u{5d0}", &["\u{1f3fb}\u{308}", "\u{5d0}"]), ("\u{1f3fb}\u{22}", - &["\u{1f3fb}", "\u{22}"]), ("\u{1f3fb}\u{308}\u{22}", &["\u{1f3fb}\u{308}", "\u{22}"]), - ("\u{1f3fb}\u{27}", &["\u{1f3fb}", "\u{27}"]), ("\u{1f3fb}\u{308}\u{27}", - &["\u{1f3fb}\u{308}", "\u{27}"]), ("\u{1f3fb}\u{261d}", &["\u{1f3fb}", "\u{261d}"]), - ("\u{1f3fb}\u{308}\u{261d}", &["\u{1f3fb}\u{308}", "\u{261d}"]), ("\u{1f3fb}\u{1f3fb}", - &["\u{1f3fb}", "\u{1f3fb}"]), ("\u{1f3fb}\u{308}\u{1f3fb}", &["\u{1f3fb}\u{308}", - "\u{1f3fb}"]), ("\u{1f3fb}\u{2764}", &["\u{1f3fb}", "\u{2764}"]), - ("\u{1f3fb}\u{308}\u{2764}", &["\u{1f3fb}\u{308}", "\u{2764}"]), ("\u{1f3fb}\u{1f466}", - &["\u{1f3fb}", "\u{1f466}"]), ("\u{1f3fb}\u{308}\u{1f466}", &["\u{1f3fb}\u{308}", - "\u{1f466}"]), ("\u{1f3fb}\u{ad}", &["\u{1f3fb}\u{ad}"]), ("\u{1f3fb}\u{308}\u{ad}", - &["\u{1f3fb}\u{308}\u{ad}"]), ("\u{1f3fb}\u{300}", &["\u{1f3fb}\u{300}"]), - ("\u{1f3fb}\u{308}\u{300}", &["\u{1f3fb}\u{308}\u{300}"]), ("\u{1f3fb}\u{200d}", - &["\u{1f3fb}\u{200d}"]), ("\u{1f3fb}\u{308}\u{200d}", &["\u{1f3fb}\u{308}\u{200d}"]), - ("\u{1f3fb}\u{61}\u{2060}", &["\u{1f3fb}", "\u{61}\u{2060}"]), - ("\u{1f3fb}\u{308}\u{61}\u{2060}", &["\u{1f3fb}\u{308}", "\u{61}\u{2060}"]), - ("\u{1f3fb}\u{61}\u{3a}", &["\u{1f3fb}", "\u{61}", "\u{3a}"]), - ("\u{1f3fb}\u{308}\u{61}\u{3a}", &["\u{1f3fb}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{1f3fb}\u{61}\u{27}", &["\u{1f3fb}", "\u{61}", "\u{27}"]), - ("\u{1f3fb}\u{308}\u{61}\u{27}", &["\u{1f3fb}\u{308}", "\u{61}", "\u{27}"]), - ("\u{1f3fb}\u{61}\u{27}\u{2060}", &["\u{1f3fb}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f3fb}\u{308}\u{61}\u{27}\u{2060}", &["\u{1f3fb}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f3fb}\u{61}\u{2c}", &["\u{1f3fb}", "\u{61}", "\u{2c}"]), - ("\u{1f3fb}\u{308}\u{61}\u{2c}", &["\u{1f3fb}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{1f3fb}\u{31}\u{3a}", &["\u{1f3fb}", "\u{31}", "\u{3a}"]), - ("\u{1f3fb}\u{308}\u{31}\u{3a}", &["\u{1f3fb}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{1f3fb}\u{31}\u{27}", &["\u{1f3fb}", "\u{31}", "\u{27}"]), - ("\u{1f3fb}\u{308}\u{31}\u{27}", &["\u{1f3fb}\u{308}", "\u{31}", "\u{27}"]), - ("\u{1f3fb}\u{31}\u{2c}", &["\u{1f3fb}", "\u{31}", "\u{2c}"]), - ("\u{1f3fb}\u{308}\u{31}\u{2c}", &["\u{1f3fb}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{1f3fb}\u{31}\u{2e}\u{2060}", &["\u{1f3fb}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f3fb}\u{308}\u{31}\u{2e}\u{2060}", &["\u{1f3fb}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2764}\u{1}", &["\u{2764}", "\u{1}"]), ("\u{2764}\u{308}\u{1}", &["\u{2764}\u{308}", - "\u{1}"]), ("\u{2764}\u{d}", &["\u{2764}", "\u{d}"]), ("\u{2764}\u{308}\u{d}", - &["\u{2764}\u{308}", "\u{d}"]), ("\u{2764}\u{a}", &["\u{2764}", "\u{a}"]), - ("\u{2764}\u{308}\u{a}", &["\u{2764}\u{308}", "\u{a}"]), ("\u{2764}\u{b}", &["\u{2764}", - "\u{b}"]), ("\u{2764}\u{308}\u{b}", &["\u{2764}\u{308}", "\u{b}"]), ("\u{2764}\u{3031}", - &["\u{2764}", "\u{3031}"]), ("\u{2764}\u{308}\u{3031}", &["\u{2764}\u{308}", "\u{3031}"]), - ("\u{2764}\u{41}", &["\u{2764}", "\u{41}"]), ("\u{2764}\u{308}\u{41}", &["\u{2764}\u{308}", - "\u{41}"]), ("\u{2764}\u{3a}", &["\u{2764}", "\u{3a}"]), ("\u{2764}\u{308}\u{3a}", - &["\u{2764}\u{308}", "\u{3a}"]), ("\u{2764}\u{2c}", &["\u{2764}", "\u{2c}"]), - ("\u{2764}\u{308}\u{2c}", &["\u{2764}\u{308}", "\u{2c}"]), ("\u{2764}\u{2e}", &["\u{2764}", - "\u{2e}"]), ("\u{2764}\u{308}\u{2e}", &["\u{2764}\u{308}", "\u{2e}"]), ("\u{2764}\u{30}", - &["\u{2764}", "\u{30}"]), ("\u{2764}\u{308}\u{30}", &["\u{2764}\u{308}", "\u{30}"]), - ("\u{2764}\u{5f}", &["\u{2764}", "\u{5f}"]), ("\u{2764}\u{308}\u{5f}", &["\u{2764}\u{308}", - "\u{5f}"]), ("\u{2764}\u{1f1e6}", &["\u{2764}", "\u{1f1e6}"]), ("\u{2764}\u{308}\u{1f1e6}", - &["\u{2764}\u{308}", "\u{1f1e6}"]), ("\u{2764}\u{5d0}", &["\u{2764}", "\u{5d0}"]), - ("\u{2764}\u{308}\u{5d0}", &["\u{2764}\u{308}", "\u{5d0}"]), ("\u{2764}\u{22}", - &["\u{2764}", "\u{22}"]), ("\u{2764}\u{308}\u{22}", &["\u{2764}\u{308}", "\u{22}"]), - ("\u{2764}\u{27}", &["\u{2764}", "\u{27}"]), ("\u{2764}\u{308}\u{27}", &["\u{2764}\u{308}", - "\u{27}"]), ("\u{2764}\u{261d}", &["\u{2764}", "\u{261d}"]), ("\u{2764}\u{308}\u{261d}", - &["\u{2764}\u{308}", "\u{261d}"]), ("\u{2764}\u{1f3fb}", &["\u{2764}", "\u{1f3fb}"]), - ("\u{2764}\u{308}\u{1f3fb}", &["\u{2764}\u{308}", "\u{1f3fb}"]), ("\u{2764}\u{2764}", - &["\u{2764}", "\u{2764}"]), ("\u{2764}\u{308}\u{2764}", &["\u{2764}\u{308}", "\u{2764}"]), - ("\u{2764}\u{1f466}", &["\u{2764}", "\u{1f466}"]), ("\u{2764}\u{308}\u{1f466}", - &["\u{2764}\u{308}", "\u{1f466}"]), ("\u{2764}\u{ad}", &["\u{2764}\u{ad}"]), - ("\u{2764}\u{308}\u{ad}", &["\u{2764}\u{308}\u{ad}"]), ("\u{2764}\u{300}", - &["\u{2764}\u{300}"]), ("\u{2764}\u{308}\u{300}", &["\u{2764}\u{308}\u{300}"]), - ("\u{2764}\u{200d}", &["\u{2764}\u{200d}"]), ("\u{2764}\u{308}\u{200d}", - &["\u{2764}\u{308}\u{200d}"]), ("\u{2764}\u{61}\u{2060}", &["\u{2764}", "\u{61}\u{2060}"]), - ("\u{2764}\u{308}\u{61}\u{2060}", &["\u{2764}\u{308}", "\u{61}\u{2060}"]), - ("\u{2764}\u{61}\u{3a}", &["\u{2764}", "\u{61}", "\u{3a}"]), ("\u{2764}\u{308}\u{61}\u{3a}", - &["\u{2764}\u{308}", "\u{61}", "\u{3a}"]), ("\u{2764}\u{61}\u{27}", &["\u{2764}", "\u{61}", - "\u{27}"]), ("\u{2764}\u{308}\u{61}\u{27}", &["\u{2764}\u{308}", "\u{61}", "\u{27}"]), - ("\u{2764}\u{61}\u{27}\u{2060}", &["\u{2764}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2764}\u{308}\u{61}\u{27}\u{2060}", &["\u{2764}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{2764}\u{61}\u{2c}", &["\u{2764}", "\u{61}", "\u{2c}"]), ("\u{2764}\u{308}\u{61}\u{2c}", - &["\u{2764}\u{308}", "\u{61}", "\u{2c}"]), ("\u{2764}\u{31}\u{3a}", &["\u{2764}", "\u{31}", - "\u{3a}"]), ("\u{2764}\u{308}\u{31}\u{3a}", &["\u{2764}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{2764}\u{31}\u{27}", &["\u{2764}", "\u{31}", "\u{27}"]), ("\u{2764}\u{308}\u{31}\u{27}", - &["\u{2764}\u{308}", "\u{31}", "\u{27}"]), ("\u{2764}\u{31}\u{2c}", &["\u{2764}", "\u{31}", - "\u{2c}"]), ("\u{2764}\u{308}\u{31}\u{2c}", &["\u{2764}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{2764}\u{31}\u{2e}\u{2060}", &["\u{2764}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{2764}\u{308}\u{31}\u{2e}\u{2060}", &["\u{2764}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f466}\u{1}", &["\u{1f466}", "\u{1}"]), ("\u{1f466}\u{308}\u{1}", &["\u{1f466}\u{308}", - "\u{1}"]), ("\u{1f466}\u{d}", &["\u{1f466}", "\u{d}"]), ("\u{1f466}\u{308}\u{d}", - &["\u{1f466}\u{308}", "\u{d}"]), ("\u{1f466}\u{a}", &["\u{1f466}", "\u{a}"]), - ("\u{1f466}\u{308}\u{a}", &["\u{1f466}\u{308}", "\u{a}"]), ("\u{1f466}\u{b}", &["\u{1f466}", - "\u{b}"]), ("\u{1f466}\u{308}\u{b}", &["\u{1f466}\u{308}", "\u{b}"]), ("\u{1f466}\u{3031}", - &["\u{1f466}", "\u{3031}"]), ("\u{1f466}\u{308}\u{3031}", &["\u{1f466}\u{308}", - "\u{3031}"]), ("\u{1f466}\u{41}", &["\u{1f466}", "\u{41}"]), ("\u{1f466}\u{308}\u{41}", - &["\u{1f466}\u{308}", "\u{41}"]), ("\u{1f466}\u{3a}", &["\u{1f466}", "\u{3a}"]), - ("\u{1f466}\u{308}\u{3a}", &["\u{1f466}\u{308}", "\u{3a}"]), ("\u{1f466}\u{2c}", - &["\u{1f466}", "\u{2c}"]), ("\u{1f466}\u{308}\u{2c}", &["\u{1f466}\u{308}", "\u{2c}"]), - ("\u{1f466}\u{2e}", &["\u{1f466}", "\u{2e}"]), ("\u{1f466}\u{308}\u{2e}", - &["\u{1f466}\u{308}", "\u{2e}"]), ("\u{1f466}\u{30}", &["\u{1f466}", "\u{30}"]), - ("\u{1f466}\u{308}\u{30}", &["\u{1f466}\u{308}", "\u{30}"]), ("\u{1f466}\u{5f}", - &["\u{1f466}", "\u{5f}"]), ("\u{1f466}\u{308}\u{5f}", &["\u{1f466}\u{308}", "\u{5f}"]), - ("\u{1f466}\u{1f1e6}", &["\u{1f466}", "\u{1f1e6}"]), ("\u{1f466}\u{308}\u{1f1e6}", - &["\u{1f466}\u{308}", "\u{1f1e6}"]), ("\u{1f466}\u{5d0}", &["\u{1f466}", "\u{5d0}"]), - ("\u{1f466}\u{308}\u{5d0}", &["\u{1f466}\u{308}", "\u{5d0}"]), ("\u{1f466}\u{22}", - &["\u{1f466}", "\u{22}"]), ("\u{1f466}\u{308}\u{22}", &["\u{1f466}\u{308}", "\u{22}"]), - ("\u{1f466}\u{27}", &["\u{1f466}", "\u{27}"]), ("\u{1f466}\u{308}\u{27}", - &["\u{1f466}\u{308}", "\u{27}"]), ("\u{1f466}\u{261d}", &["\u{1f466}", "\u{261d}"]), - ("\u{1f466}\u{308}\u{261d}", &["\u{1f466}\u{308}", "\u{261d}"]), ("\u{1f466}\u{1f3fb}", - &["\u{1f466}\u{1f3fb}"]), ("\u{1f466}\u{308}\u{1f3fb}", &["\u{1f466}\u{308}\u{1f3fb}"]), - ("\u{1f466}\u{2764}", &["\u{1f466}", "\u{2764}"]), ("\u{1f466}\u{308}\u{2764}", - &["\u{1f466}\u{308}", "\u{2764}"]), ("\u{1f466}\u{1f466}", &["\u{1f466}", "\u{1f466}"]), - ("\u{1f466}\u{308}\u{1f466}", &["\u{1f466}\u{308}", "\u{1f466}"]), ("\u{1f466}\u{ad}", - &["\u{1f466}\u{ad}"]), ("\u{1f466}\u{308}\u{ad}", &["\u{1f466}\u{308}\u{ad}"]), - ("\u{1f466}\u{300}", &["\u{1f466}\u{300}"]), ("\u{1f466}\u{308}\u{300}", - &["\u{1f466}\u{308}\u{300}"]), ("\u{1f466}\u{200d}", &["\u{1f466}\u{200d}"]), - ("\u{1f466}\u{308}\u{200d}", &["\u{1f466}\u{308}\u{200d}"]), ("\u{1f466}\u{61}\u{2060}", - &["\u{1f466}", "\u{61}\u{2060}"]), ("\u{1f466}\u{308}\u{61}\u{2060}", &["\u{1f466}\u{308}", - "\u{61}\u{2060}"]), ("\u{1f466}\u{61}\u{3a}", &["\u{1f466}", "\u{61}", "\u{3a}"]), - ("\u{1f466}\u{308}\u{61}\u{3a}", &["\u{1f466}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{1f466}\u{61}\u{27}", &["\u{1f466}", "\u{61}", "\u{27}"]), - ("\u{1f466}\u{308}\u{61}\u{27}", &["\u{1f466}\u{308}", "\u{61}", "\u{27}"]), - ("\u{1f466}\u{61}\u{27}\u{2060}", &["\u{1f466}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f466}\u{308}\u{61}\u{27}\u{2060}", &["\u{1f466}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{1f466}\u{61}\u{2c}", &["\u{1f466}", "\u{61}", "\u{2c}"]), - ("\u{1f466}\u{308}\u{61}\u{2c}", &["\u{1f466}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{1f466}\u{31}\u{3a}", &["\u{1f466}", "\u{31}", "\u{3a}"]), - ("\u{1f466}\u{308}\u{31}\u{3a}", &["\u{1f466}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{1f466}\u{31}\u{27}", &["\u{1f466}", "\u{31}", "\u{27}"]), - ("\u{1f466}\u{308}\u{31}\u{27}", &["\u{1f466}\u{308}", "\u{31}", "\u{27}"]), - ("\u{1f466}\u{31}\u{2c}", &["\u{1f466}", "\u{31}", "\u{2c}"]), - ("\u{1f466}\u{308}\u{31}\u{2c}", &["\u{1f466}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{1f466}\u{31}\u{2e}\u{2060}", &["\u{1f466}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{1f466}\u{308}\u{31}\u{2e}\u{2060}", &["\u{1f466}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{ad}\u{1}", &["\u{ad}", "\u{1}"]), ("\u{ad}\u{308}\u{1}", &["\u{ad}\u{308}", "\u{1}"]), - ("\u{ad}\u{d}", &["\u{ad}", "\u{d}"]), ("\u{ad}\u{308}\u{d}", &["\u{ad}\u{308}", "\u{d}"]), - ("\u{ad}\u{a}", &["\u{ad}", "\u{a}"]), ("\u{ad}\u{308}\u{a}", &["\u{ad}\u{308}", "\u{a}"]), - ("\u{ad}\u{b}", &["\u{ad}", "\u{b}"]), ("\u{ad}\u{308}\u{b}", &["\u{ad}\u{308}", "\u{b}"]), - ("\u{ad}\u{3031}", &["\u{ad}", "\u{3031}"]), ("\u{ad}\u{308}\u{3031}", &["\u{ad}\u{308}", - "\u{3031}"]), ("\u{ad}\u{41}", &["\u{ad}", "\u{41}"]), ("\u{ad}\u{308}\u{41}", - &["\u{ad}\u{308}", "\u{41}"]), ("\u{ad}\u{3a}", &["\u{ad}", "\u{3a}"]), - ("\u{ad}\u{308}\u{3a}", &["\u{ad}\u{308}", "\u{3a}"]), ("\u{ad}\u{2c}", &["\u{ad}", - "\u{2c}"]), ("\u{ad}\u{308}\u{2c}", &["\u{ad}\u{308}", "\u{2c}"]), ("\u{ad}\u{2e}", - &["\u{ad}", "\u{2e}"]), ("\u{ad}\u{308}\u{2e}", &["\u{ad}\u{308}", "\u{2e}"]), - ("\u{ad}\u{30}", &["\u{ad}", "\u{30}"]), ("\u{ad}\u{308}\u{30}", &["\u{ad}\u{308}", - "\u{30}"]), ("\u{ad}\u{5f}", &["\u{ad}", "\u{5f}"]), ("\u{ad}\u{308}\u{5f}", - &["\u{ad}\u{308}", "\u{5f}"]), ("\u{ad}\u{1f1e6}", &["\u{ad}", "\u{1f1e6}"]), - ("\u{ad}\u{308}\u{1f1e6}", &["\u{ad}\u{308}", "\u{1f1e6}"]), ("\u{ad}\u{5d0}", &["\u{ad}", - "\u{5d0}"]), ("\u{ad}\u{308}\u{5d0}", &["\u{ad}\u{308}", "\u{5d0}"]), ("\u{ad}\u{22}", - &["\u{ad}", "\u{22}"]), ("\u{ad}\u{308}\u{22}", &["\u{ad}\u{308}", "\u{22}"]), - ("\u{ad}\u{27}", &["\u{ad}", "\u{27}"]), ("\u{ad}\u{308}\u{27}", &["\u{ad}\u{308}", - "\u{27}"]), ("\u{ad}\u{261d}", &["\u{ad}", "\u{261d}"]), ("\u{ad}\u{308}\u{261d}", - &["\u{ad}\u{308}", "\u{261d}"]), ("\u{ad}\u{1f3fb}", &["\u{ad}", "\u{1f3fb}"]), - ("\u{ad}\u{308}\u{1f3fb}", &["\u{ad}\u{308}", "\u{1f3fb}"]), ("\u{ad}\u{2764}", &["\u{ad}", - "\u{2764}"]), ("\u{ad}\u{308}\u{2764}", &["\u{ad}\u{308}", "\u{2764}"]), ("\u{ad}\u{1f466}", - &["\u{ad}", "\u{1f466}"]), ("\u{ad}\u{308}\u{1f466}", &["\u{ad}\u{308}", "\u{1f466}"]), - ("\u{ad}\u{ad}", &["\u{ad}\u{ad}"]), ("\u{ad}\u{308}\u{ad}", &["\u{ad}\u{308}\u{ad}"]), - ("\u{ad}\u{300}", &["\u{ad}\u{300}"]), ("\u{ad}\u{308}\u{300}", &["\u{ad}\u{308}\u{300}"]), - ("\u{ad}\u{200d}", &["\u{ad}\u{200d}"]), ("\u{ad}\u{308}\u{200d}", - &["\u{ad}\u{308}\u{200d}"]), ("\u{ad}\u{61}\u{2060}", &["\u{ad}", "\u{61}\u{2060}"]), - ("\u{ad}\u{308}\u{61}\u{2060}", &["\u{ad}\u{308}", "\u{61}\u{2060}"]), - ("\u{ad}\u{61}\u{3a}", &["\u{ad}", "\u{61}", "\u{3a}"]), ("\u{ad}\u{308}\u{61}\u{3a}", - &["\u{ad}\u{308}", "\u{61}", "\u{3a}"]), ("\u{ad}\u{61}\u{27}", &["\u{ad}", "\u{61}", - "\u{27}"]), ("\u{ad}\u{308}\u{61}\u{27}", &["\u{ad}\u{308}", "\u{61}", "\u{27}"]), - ("\u{ad}\u{61}\u{27}\u{2060}", &["\u{ad}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{ad}\u{308}\u{61}\u{27}\u{2060}", &["\u{ad}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{ad}\u{61}\u{2c}", &["\u{ad}", "\u{61}", "\u{2c}"]), ("\u{ad}\u{308}\u{61}\u{2c}", - &["\u{ad}\u{308}", "\u{61}", "\u{2c}"]), ("\u{ad}\u{31}\u{3a}", &["\u{ad}", "\u{31}", - "\u{3a}"]), ("\u{ad}\u{308}\u{31}\u{3a}", &["\u{ad}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{ad}\u{31}\u{27}", &["\u{ad}", "\u{31}", "\u{27}"]), ("\u{ad}\u{308}\u{31}\u{27}", - &["\u{ad}\u{308}", "\u{31}", "\u{27}"]), ("\u{ad}\u{31}\u{2c}", &["\u{ad}", "\u{31}", - "\u{2c}"]), ("\u{ad}\u{308}\u{31}\u{2c}", &["\u{ad}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{ad}\u{31}\u{2e}\u{2060}", &["\u{ad}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{ad}\u{308}\u{31}\u{2e}\u{2060}", &["\u{ad}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{300}\u{1}", &["\u{300}", "\u{1}"]), ("\u{300}\u{308}\u{1}", &["\u{300}\u{308}", - "\u{1}"]), ("\u{300}\u{d}", &["\u{300}", "\u{d}"]), ("\u{300}\u{308}\u{d}", - &["\u{300}\u{308}", "\u{d}"]), ("\u{300}\u{a}", &["\u{300}", "\u{a}"]), - ("\u{300}\u{308}\u{a}", &["\u{300}\u{308}", "\u{a}"]), ("\u{300}\u{b}", &["\u{300}", - "\u{b}"]), ("\u{300}\u{308}\u{b}", &["\u{300}\u{308}", "\u{b}"]), ("\u{300}\u{3031}", - &["\u{300}", "\u{3031}"]), ("\u{300}\u{308}\u{3031}", &["\u{300}\u{308}", "\u{3031}"]), - ("\u{300}\u{41}", &["\u{300}", "\u{41}"]), ("\u{300}\u{308}\u{41}", &["\u{300}\u{308}", - "\u{41}"]), ("\u{300}\u{3a}", &["\u{300}", "\u{3a}"]), ("\u{300}\u{308}\u{3a}", - &["\u{300}\u{308}", "\u{3a}"]), ("\u{300}\u{2c}", &["\u{300}", "\u{2c}"]), - ("\u{300}\u{308}\u{2c}", &["\u{300}\u{308}", "\u{2c}"]), ("\u{300}\u{2e}", &["\u{300}", - "\u{2e}"]), ("\u{300}\u{308}\u{2e}", &["\u{300}\u{308}", "\u{2e}"]), ("\u{300}\u{30}", - &["\u{300}", "\u{30}"]), ("\u{300}\u{308}\u{30}", &["\u{300}\u{308}", "\u{30}"]), - ("\u{300}\u{5f}", &["\u{300}", "\u{5f}"]), ("\u{300}\u{308}\u{5f}", &["\u{300}\u{308}", - "\u{5f}"]), ("\u{300}\u{1f1e6}", &["\u{300}", "\u{1f1e6}"]), ("\u{300}\u{308}\u{1f1e6}", - &["\u{300}\u{308}", "\u{1f1e6}"]), ("\u{300}\u{5d0}", &["\u{300}", "\u{5d0}"]), - ("\u{300}\u{308}\u{5d0}", &["\u{300}\u{308}", "\u{5d0}"]), ("\u{300}\u{22}", &["\u{300}", - "\u{22}"]), ("\u{300}\u{308}\u{22}", &["\u{300}\u{308}", "\u{22}"]), ("\u{300}\u{27}", - &["\u{300}", "\u{27}"]), ("\u{300}\u{308}\u{27}", &["\u{300}\u{308}", "\u{27}"]), - ("\u{300}\u{261d}", &["\u{300}", "\u{261d}"]), ("\u{300}\u{308}\u{261d}", - &["\u{300}\u{308}", "\u{261d}"]), ("\u{300}\u{1f3fb}", &["\u{300}", "\u{1f3fb}"]), - ("\u{300}\u{308}\u{1f3fb}", &["\u{300}\u{308}", "\u{1f3fb}"]), ("\u{300}\u{2764}", - &["\u{300}", "\u{2764}"]), ("\u{300}\u{308}\u{2764}", &["\u{300}\u{308}", "\u{2764}"]), - ("\u{300}\u{1f466}", &["\u{300}", "\u{1f466}"]), ("\u{300}\u{308}\u{1f466}", - &["\u{300}\u{308}", "\u{1f466}"]), ("\u{300}\u{ad}", &["\u{300}\u{ad}"]), - ("\u{300}\u{308}\u{ad}", &["\u{300}\u{308}\u{ad}"]), ("\u{300}\u{300}", - &["\u{300}\u{300}"]), ("\u{300}\u{308}\u{300}", &["\u{300}\u{308}\u{300}"]), - ("\u{300}\u{200d}", &["\u{300}\u{200d}"]), ("\u{300}\u{308}\u{200d}", - &["\u{300}\u{308}\u{200d}"]), ("\u{300}\u{61}\u{2060}", &["\u{300}", "\u{61}\u{2060}"]), - ("\u{300}\u{308}\u{61}\u{2060}", &["\u{300}\u{308}", "\u{61}\u{2060}"]), - ("\u{300}\u{61}\u{3a}", &["\u{300}", "\u{61}", "\u{3a}"]), ("\u{300}\u{308}\u{61}\u{3a}", - &["\u{300}\u{308}", "\u{61}", "\u{3a}"]), ("\u{300}\u{61}\u{27}", &["\u{300}", "\u{61}", - "\u{27}"]), ("\u{300}\u{308}\u{61}\u{27}", &["\u{300}\u{308}", "\u{61}", "\u{27}"]), - ("\u{300}\u{61}\u{27}\u{2060}", &["\u{300}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{300}\u{308}\u{61}\u{27}\u{2060}", &["\u{300}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{300}\u{61}\u{2c}", &["\u{300}", "\u{61}", "\u{2c}"]), ("\u{300}\u{308}\u{61}\u{2c}", - &["\u{300}\u{308}", "\u{61}", "\u{2c}"]), ("\u{300}\u{31}\u{3a}", &["\u{300}", "\u{31}", - "\u{3a}"]), ("\u{300}\u{308}\u{31}\u{3a}", &["\u{300}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{300}\u{31}\u{27}", &["\u{300}", "\u{31}", "\u{27}"]), ("\u{300}\u{308}\u{31}\u{27}", - &["\u{300}\u{308}", "\u{31}", "\u{27}"]), ("\u{300}\u{31}\u{2c}", &["\u{300}", "\u{31}", - "\u{2c}"]), ("\u{300}\u{308}\u{31}\u{2c}", &["\u{300}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{300}\u{31}\u{2e}\u{2060}", &["\u{300}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{300}\u{308}\u{31}\u{2e}\u{2060}", &["\u{300}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{200d}\u{1}", &["\u{200d}", "\u{1}"]), ("\u{200d}\u{308}\u{1}", &["\u{200d}\u{308}", - "\u{1}"]), ("\u{200d}\u{d}", &["\u{200d}", "\u{d}"]), ("\u{200d}\u{308}\u{d}", - &["\u{200d}\u{308}", "\u{d}"]), ("\u{200d}\u{a}", &["\u{200d}", "\u{a}"]), - ("\u{200d}\u{308}\u{a}", &["\u{200d}\u{308}", "\u{a}"]), ("\u{200d}\u{b}", &["\u{200d}", - "\u{b}"]), ("\u{200d}\u{308}\u{b}", &["\u{200d}\u{308}", "\u{b}"]), ("\u{200d}\u{3031}", - &["\u{200d}", "\u{3031}"]), ("\u{200d}\u{308}\u{3031}", &["\u{200d}\u{308}", "\u{3031}"]), - ("\u{200d}\u{41}", &["\u{200d}", "\u{41}"]), ("\u{200d}\u{308}\u{41}", &["\u{200d}\u{308}", - "\u{41}"]), ("\u{200d}\u{3a}", &["\u{200d}", "\u{3a}"]), ("\u{200d}\u{308}\u{3a}", - &["\u{200d}\u{308}", "\u{3a}"]), ("\u{200d}\u{2c}", &["\u{200d}", "\u{2c}"]), - ("\u{200d}\u{308}\u{2c}", &["\u{200d}\u{308}", "\u{2c}"]), ("\u{200d}\u{2e}", &["\u{200d}", - "\u{2e}"]), ("\u{200d}\u{308}\u{2e}", &["\u{200d}\u{308}", "\u{2e}"]), ("\u{200d}\u{30}", - &["\u{200d}", "\u{30}"]), ("\u{200d}\u{308}\u{30}", &["\u{200d}\u{308}", "\u{30}"]), - ("\u{200d}\u{5f}", &["\u{200d}", "\u{5f}"]), ("\u{200d}\u{308}\u{5f}", &["\u{200d}\u{308}", - "\u{5f}"]), ("\u{200d}\u{1f1e6}", &["\u{200d}", "\u{1f1e6}"]), ("\u{200d}\u{308}\u{1f1e6}", - &["\u{200d}\u{308}", "\u{1f1e6}"]), ("\u{200d}\u{5d0}", &["\u{200d}", "\u{5d0}"]), - ("\u{200d}\u{308}\u{5d0}", &["\u{200d}\u{308}", "\u{5d0}"]), ("\u{200d}\u{22}", - &["\u{200d}", "\u{22}"]), ("\u{200d}\u{308}\u{22}", &["\u{200d}\u{308}", "\u{22}"]), - ("\u{200d}\u{27}", &["\u{200d}", "\u{27}"]), ("\u{200d}\u{308}\u{27}", &["\u{200d}\u{308}", - "\u{27}"]), ("\u{200d}\u{261d}", &["\u{200d}", "\u{261d}"]), ("\u{200d}\u{308}\u{261d}", - &["\u{200d}\u{308}", "\u{261d}"]), ("\u{200d}\u{1f3fb}", &["\u{200d}", "\u{1f3fb}"]), - ("\u{200d}\u{308}\u{1f3fb}", &["\u{200d}\u{308}", "\u{1f3fb}"]), ("\u{200d}\u{2764}", - &["\u{200d}\u{2764}"]), ("\u{200d}\u{308}\u{2764}", &["\u{200d}\u{308}", "\u{2764}"]), - ("\u{200d}\u{1f466}", &["\u{200d}\u{1f466}"]), ("\u{200d}\u{308}\u{1f466}", - &["\u{200d}\u{308}", "\u{1f466}"]), ("\u{200d}\u{ad}", &["\u{200d}\u{ad}"]), - ("\u{200d}\u{308}\u{ad}", &["\u{200d}\u{308}\u{ad}"]), ("\u{200d}\u{300}", - &["\u{200d}\u{300}"]), ("\u{200d}\u{308}\u{300}", &["\u{200d}\u{308}\u{300}"]), - ("\u{200d}\u{200d}", &["\u{200d}\u{200d}"]), ("\u{200d}\u{308}\u{200d}", - &["\u{200d}\u{308}\u{200d}"]), ("\u{200d}\u{61}\u{2060}", &["\u{200d}", "\u{61}\u{2060}"]), - ("\u{200d}\u{308}\u{61}\u{2060}", &["\u{200d}\u{308}", "\u{61}\u{2060}"]), - ("\u{200d}\u{61}\u{3a}", &["\u{200d}", "\u{61}", "\u{3a}"]), ("\u{200d}\u{308}\u{61}\u{3a}", - &["\u{200d}\u{308}", "\u{61}", "\u{3a}"]), ("\u{200d}\u{61}\u{27}", &["\u{200d}", "\u{61}", - "\u{27}"]), ("\u{200d}\u{308}\u{61}\u{27}", &["\u{200d}\u{308}", "\u{61}", "\u{27}"]), - ("\u{200d}\u{61}\u{27}\u{2060}", &["\u{200d}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{200d}\u{308}\u{61}\u{27}\u{2060}", &["\u{200d}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{200d}\u{61}\u{2c}", &["\u{200d}", "\u{61}", "\u{2c}"]), ("\u{200d}\u{308}\u{61}\u{2c}", - &["\u{200d}\u{308}", "\u{61}", "\u{2c}"]), ("\u{200d}\u{31}\u{3a}", &["\u{200d}", "\u{31}", - "\u{3a}"]), ("\u{200d}\u{308}\u{31}\u{3a}", &["\u{200d}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{200d}\u{31}\u{27}", &["\u{200d}", "\u{31}", "\u{27}"]), ("\u{200d}\u{308}\u{31}\u{27}", - &["\u{200d}\u{308}", "\u{31}", "\u{27}"]), ("\u{200d}\u{31}\u{2c}", &["\u{200d}", "\u{31}", - "\u{2c}"]), ("\u{200d}\u{308}\u{31}\u{2c}", &["\u{200d}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{200d}\u{31}\u{2e}\u{2060}", &["\u{200d}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{200d}\u{308}\u{31}\u{2e}\u{2060}", &["\u{200d}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{61}\u{2060}\u{1}", &["\u{61}\u{2060}", "\u{1}"]), ("\u{61}\u{2060}\u{308}\u{1}", - &["\u{61}\u{2060}\u{308}", "\u{1}"]), ("\u{61}\u{2060}\u{d}", &["\u{61}\u{2060}", "\u{d}"]), - ("\u{61}\u{2060}\u{308}\u{d}", &["\u{61}\u{2060}\u{308}", "\u{d}"]), ("\u{61}\u{2060}\u{a}", - &["\u{61}\u{2060}", "\u{a}"]), ("\u{61}\u{2060}\u{308}\u{a}", &["\u{61}\u{2060}\u{308}", - "\u{a}"]), ("\u{61}\u{2060}\u{b}", &["\u{61}\u{2060}", "\u{b}"]), - ("\u{61}\u{2060}\u{308}\u{b}", &["\u{61}\u{2060}\u{308}", "\u{b}"]), - ("\u{61}\u{2060}\u{3031}", &["\u{61}\u{2060}", "\u{3031}"]), - ("\u{61}\u{2060}\u{308}\u{3031}", &["\u{61}\u{2060}\u{308}", "\u{3031}"]), - ("\u{61}\u{2060}\u{41}", &["\u{61}\u{2060}\u{41}"]), ("\u{61}\u{2060}\u{308}\u{41}", - &["\u{61}\u{2060}\u{308}\u{41}"]), ("\u{61}\u{2060}\u{3a}", &["\u{61}\u{2060}", "\u{3a}"]), - ("\u{61}\u{2060}\u{308}\u{3a}", &["\u{61}\u{2060}\u{308}", "\u{3a}"]), - ("\u{61}\u{2060}\u{2c}", &["\u{61}\u{2060}", "\u{2c}"]), ("\u{61}\u{2060}\u{308}\u{2c}", - &["\u{61}\u{2060}\u{308}", "\u{2c}"]), ("\u{61}\u{2060}\u{2e}", &["\u{61}\u{2060}", - "\u{2e}"]), ("\u{61}\u{2060}\u{308}\u{2e}", &["\u{61}\u{2060}\u{308}", "\u{2e}"]), - ("\u{61}\u{2060}\u{30}", &["\u{61}\u{2060}\u{30}"]), ("\u{61}\u{2060}\u{308}\u{30}", - &["\u{61}\u{2060}\u{308}\u{30}"]), ("\u{61}\u{2060}\u{5f}", &["\u{61}\u{2060}\u{5f}"]), - ("\u{61}\u{2060}\u{308}\u{5f}", &["\u{61}\u{2060}\u{308}\u{5f}"]), - ("\u{61}\u{2060}\u{1f1e6}", &["\u{61}\u{2060}", "\u{1f1e6}"]), - ("\u{61}\u{2060}\u{308}\u{1f1e6}", &["\u{61}\u{2060}\u{308}", "\u{1f1e6}"]), - ("\u{61}\u{2060}\u{5d0}", &["\u{61}\u{2060}\u{5d0}"]), ("\u{61}\u{2060}\u{308}\u{5d0}", - &["\u{61}\u{2060}\u{308}\u{5d0}"]), ("\u{61}\u{2060}\u{22}", &["\u{61}\u{2060}", "\u{22}"]), - ("\u{61}\u{2060}\u{308}\u{22}", &["\u{61}\u{2060}\u{308}", "\u{22}"]), - ("\u{61}\u{2060}\u{27}", &["\u{61}\u{2060}", "\u{27}"]), ("\u{61}\u{2060}\u{308}\u{27}", - &["\u{61}\u{2060}\u{308}", "\u{27}"]), ("\u{61}\u{2060}\u{261d}", &["\u{61}\u{2060}", - "\u{261d}"]), ("\u{61}\u{2060}\u{308}\u{261d}", &["\u{61}\u{2060}\u{308}", "\u{261d}"]), - ("\u{61}\u{2060}\u{1f3fb}", &["\u{61}\u{2060}", "\u{1f3fb}"]), - ("\u{61}\u{2060}\u{308}\u{1f3fb}", &["\u{61}\u{2060}\u{308}", "\u{1f3fb}"]), - ("\u{61}\u{2060}\u{2764}", &["\u{61}\u{2060}", "\u{2764}"]), - ("\u{61}\u{2060}\u{308}\u{2764}", &["\u{61}\u{2060}\u{308}", "\u{2764}"]), - ("\u{61}\u{2060}\u{1f466}", &["\u{61}\u{2060}", "\u{1f466}"]), - ("\u{61}\u{2060}\u{308}\u{1f466}", &["\u{61}\u{2060}\u{308}", "\u{1f466}"]), - ("\u{61}\u{2060}\u{ad}", &["\u{61}\u{2060}\u{ad}"]), ("\u{61}\u{2060}\u{308}\u{ad}", - &["\u{61}\u{2060}\u{308}\u{ad}"]), ("\u{61}\u{2060}\u{300}", &["\u{61}\u{2060}\u{300}"]), - ("\u{61}\u{2060}\u{308}\u{300}", &["\u{61}\u{2060}\u{308}\u{300}"]), - ("\u{61}\u{2060}\u{200d}", &["\u{61}\u{2060}\u{200d}"]), ("\u{61}\u{2060}\u{308}\u{200d}", - &["\u{61}\u{2060}\u{308}\u{200d}"]), ("\u{61}\u{2060}\u{61}\u{2060}", - &["\u{61}\u{2060}\u{61}\u{2060}"]), ("\u{61}\u{2060}\u{308}\u{61}\u{2060}", - &["\u{61}\u{2060}\u{308}\u{61}\u{2060}"]), ("\u{61}\u{2060}\u{61}\u{3a}", - &["\u{61}\u{2060}\u{61}", "\u{3a}"]), ("\u{61}\u{2060}\u{308}\u{61}\u{3a}", - &["\u{61}\u{2060}\u{308}\u{61}", "\u{3a}"]), ("\u{61}\u{2060}\u{61}\u{27}", - &["\u{61}\u{2060}\u{61}", "\u{27}"]), ("\u{61}\u{2060}\u{308}\u{61}\u{27}", - &["\u{61}\u{2060}\u{308}\u{61}", "\u{27}"]), ("\u{61}\u{2060}\u{61}\u{27}\u{2060}", - &["\u{61}\u{2060}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{2060}\u{308}\u{61}\u{27}\u{2060}", - &["\u{61}\u{2060}\u{308}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{2060}\u{61}\u{2c}", - &["\u{61}\u{2060}\u{61}", "\u{2c}"]), ("\u{61}\u{2060}\u{308}\u{61}\u{2c}", - &["\u{61}\u{2060}\u{308}\u{61}", "\u{2c}"]), ("\u{61}\u{2060}\u{31}\u{3a}", - &["\u{61}\u{2060}\u{31}", "\u{3a}"]), ("\u{61}\u{2060}\u{308}\u{31}\u{3a}", - &["\u{61}\u{2060}\u{308}\u{31}", "\u{3a}"]), ("\u{61}\u{2060}\u{31}\u{27}", - &["\u{61}\u{2060}\u{31}", "\u{27}"]), ("\u{61}\u{2060}\u{308}\u{31}\u{27}", - &["\u{61}\u{2060}\u{308}\u{31}", "\u{27}"]), ("\u{61}\u{2060}\u{31}\u{2c}", - &["\u{61}\u{2060}\u{31}", "\u{2c}"]), ("\u{61}\u{2060}\u{308}\u{31}\u{2c}", - &["\u{61}\u{2060}\u{308}\u{31}", "\u{2c}"]), ("\u{61}\u{2060}\u{31}\u{2e}\u{2060}", - &["\u{61}\u{2060}\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{2060}\u{308}\u{31}\u{2e}\u{2060}", - &["\u{61}\u{2060}\u{308}\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{3a}\u{1}", &["\u{61}", - "\u{3a}", "\u{1}"]), ("\u{61}\u{3a}\u{308}\u{1}", &["\u{61}", "\u{3a}\u{308}", "\u{1}"]), - ("\u{61}\u{3a}\u{d}", &["\u{61}", "\u{3a}", "\u{d}"]), ("\u{61}\u{3a}\u{308}\u{d}", - &["\u{61}", "\u{3a}\u{308}", "\u{d}"]), ("\u{61}\u{3a}\u{a}", &["\u{61}", "\u{3a}", - "\u{a}"]), ("\u{61}\u{3a}\u{308}\u{a}", &["\u{61}", "\u{3a}\u{308}", "\u{a}"]), - ("\u{61}\u{3a}\u{b}", &["\u{61}", "\u{3a}", "\u{b}"]), ("\u{61}\u{3a}\u{308}\u{b}", - &["\u{61}", "\u{3a}\u{308}", "\u{b}"]), ("\u{61}\u{3a}\u{3031}", &["\u{61}", "\u{3a}", - "\u{3031}"]), ("\u{61}\u{3a}\u{308}\u{3031}", &["\u{61}", "\u{3a}\u{308}", "\u{3031}"]), - ("\u{61}\u{3a}\u{41}", &["\u{61}\u{3a}\u{41}"]), ("\u{61}\u{3a}\u{308}\u{41}", - &["\u{61}\u{3a}\u{308}\u{41}"]), ("\u{61}\u{3a}\u{3a}", &["\u{61}", "\u{3a}", "\u{3a}"]), - ("\u{61}\u{3a}\u{308}\u{3a}", &["\u{61}", "\u{3a}\u{308}", "\u{3a}"]), - ("\u{61}\u{3a}\u{2c}", &["\u{61}", "\u{3a}", "\u{2c}"]), ("\u{61}\u{3a}\u{308}\u{2c}", - &["\u{61}", "\u{3a}\u{308}", "\u{2c}"]), ("\u{61}\u{3a}\u{2e}", &["\u{61}", "\u{3a}", - "\u{2e}"]), ("\u{61}\u{3a}\u{308}\u{2e}", &["\u{61}", "\u{3a}\u{308}", "\u{2e}"]), - ("\u{61}\u{3a}\u{30}", &["\u{61}", "\u{3a}", "\u{30}"]), ("\u{61}\u{3a}\u{308}\u{30}", - &["\u{61}", "\u{3a}\u{308}", "\u{30}"]), ("\u{61}\u{3a}\u{5f}", &["\u{61}", "\u{3a}", - "\u{5f}"]), ("\u{61}\u{3a}\u{308}\u{5f}", &["\u{61}", "\u{3a}\u{308}", "\u{5f}"]), - ("\u{61}\u{3a}\u{1f1e6}", &["\u{61}", "\u{3a}", "\u{1f1e6}"]), - ("\u{61}\u{3a}\u{308}\u{1f1e6}", &["\u{61}", "\u{3a}\u{308}", "\u{1f1e6}"]), - ("\u{61}\u{3a}\u{5d0}", &["\u{61}\u{3a}\u{5d0}"]), ("\u{61}\u{3a}\u{308}\u{5d0}", - &["\u{61}\u{3a}\u{308}\u{5d0}"]), ("\u{61}\u{3a}\u{22}", &["\u{61}", "\u{3a}", "\u{22}"]), - ("\u{61}\u{3a}\u{308}\u{22}", &["\u{61}", "\u{3a}\u{308}", "\u{22}"]), - ("\u{61}\u{3a}\u{27}", &["\u{61}", "\u{3a}", "\u{27}"]), ("\u{61}\u{3a}\u{308}\u{27}", - &["\u{61}", "\u{3a}\u{308}", "\u{27}"]), ("\u{61}\u{3a}\u{261d}", &["\u{61}", "\u{3a}", - "\u{261d}"]), ("\u{61}\u{3a}\u{308}\u{261d}", &["\u{61}", "\u{3a}\u{308}", "\u{261d}"]), - ("\u{61}\u{3a}\u{1f3fb}", &["\u{61}", "\u{3a}", "\u{1f3fb}"]), - ("\u{61}\u{3a}\u{308}\u{1f3fb}", &["\u{61}", "\u{3a}\u{308}", "\u{1f3fb}"]), - ("\u{61}\u{3a}\u{2764}", &["\u{61}", "\u{3a}", "\u{2764}"]), ("\u{61}\u{3a}\u{308}\u{2764}", - &["\u{61}", "\u{3a}\u{308}", "\u{2764}"]), ("\u{61}\u{3a}\u{1f466}", &["\u{61}", "\u{3a}", - "\u{1f466}"]), ("\u{61}\u{3a}\u{308}\u{1f466}", &["\u{61}", "\u{3a}\u{308}", "\u{1f466}"]), - ("\u{61}\u{3a}\u{ad}", &["\u{61}", "\u{3a}\u{ad}"]), ("\u{61}\u{3a}\u{308}\u{ad}", - &["\u{61}", "\u{3a}\u{308}\u{ad}"]), ("\u{61}\u{3a}\u{300}", &["\u{61}", "\u{3a}\u{300}"]), - ("\u{61}\u{3a}\u{308}\u{300}", &["\u{61}", "\u{3a}\u{308}\u{300}"]), - ("\u{61}\u{3a}\u{200d}", &["\u{61}", "\u{3a}\u{200d}"]), ("\u{61}\u{3a}\u{308}\u{200d}", - &["\u{61}", "\u{3a}\u{308}\u{200d}"]), ("\u{61}\u{3a}\u{61}\u{2060}", - &["\u{61}\u{3a}\u{61}\u{2060}"]), ("\u{61}\u{3a}\u{308}\u{61}\u{2060}", - &["\u{61}\u{3a}\u{308}\u{61}\u{2060}"]), ("\u{61}\u{3a}\u{61}\u{3a}", - &["\u{61}\u{3a}\u{61}", "\u{3a}"]), ("\u{61}\u{3a}\u{308}\u{61}\u{3a}", - &["\u{61}\u{3a}\u{308}\u{61}", "\u{3a}"]), ("\u{61}\u{3a}\u{61}\u{27}", - &["\u{61}\u{3a}\u{61}", "\u{27}"]), ("\u{61}\u{3a}\u{308}\u{61}\u{27}", - &["\u{61}\u{3a}\u{308}\u{61}", "\u{27}"]), ("\u{61}\u{3a}\u{61}\u{27}\u{2060}", - &["\u{61}\u{3a}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{3a}\u{308}\u{61}\u{27}\u{2060}", - &["\u{61}\u{3a}\u{308}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{3a}\u{61}\u{2c}", - &["\u{61}\u{3a}\u{61}", "\u{2c}"]), ("\u{61}\u{3a}\u{308}\u{61}\u{2c}", - &["\u{61}\u{3a}\u{308}\u{61}", "\u{2c}"]), ("\u{61}\u{3a}\u{31}\u{3a}", &["\u{61}", - "\u{3a}", "\u{31}", "\u{3a}"]), ("\u{61}\u{3a}\u{308}\u{31}\u{3a}", &["\u{61}", - "\u{3a}\u{308}", "\u{31}", "\u{3a}"]), ("\u{61}\u{3a}\u{31}\u{27}", &["\u{61}", "\u{3a}", - "\u{31}", "\u{27}"]), ("\u{61}\u{3a}\u{308}\u{31}\u{27}", &["\u{61}", "\u{3a}\u{308}", - "\u{31}", "\u{27}"]), ("\u{61}\u{3a}\u{31}\u{2c}", &["\u{61}", "\u{3a}", "\u{31}", - "\u{2c}"]), ("\u{61}\u{3a}\u{308}\u{31}\u{2c}", &["\u{61}", "\u{3a}\u{308}", "\u{31}", - "\u{2c}"]), ("\u{61}\u{3a}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{3a}", "\u{31}", - "\u{2e}\u{2060}"]), ("\u{61}\u{3a}\u{308}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{3a}\u{308}", - "\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{27}\u{1}", &["\u{61}", "\u{27}", "\u{1}"]), - ("\u{61}\u{27}\u{308}\u{1}", &["\u{61}", "\u{27}\u{308}", "\u{1}"]), ("\u{61}\u{27}\u{d}", - &["\u{61}", "\u{27}", "\u{d}"]), ("\u{61}\u{27}\u{308}\u{d}", &["\u{61}", "\u{27}\u{308}", - "\u{d}"]), ("\u{61}\u{27}\u{a}", &["\u{61}", "\u{27}", "\u{a}"]), - ("\u{61}\u{27}\u{308}\u{a}", &["\u{61}", "\u{27}\u{308}", "\u{a}"]), ("\u{61}\u{27}\u{b}", - &["\u{61}", "\u{27}", "\u{b}"]), ("\u{61}\u{27}\u{308}\u{b}", &["\u{61}", "\u{27}\u{308}", - "\u{b}"]), ("\u{61}\u{27}\u{3031}", &["\u{61}", "\u{27}", "\u{3031}"]), - ("\u{61}\u{27}\u{308}\u{3031}", &["\u{61}", "\u{27}\u{308}", "\u{3031}"]), - ("\u{61}\u{27}\u{41}", &["\u{61}\u{27}\u{41}"]), ("\u{61}\u{27}\u{308}\u{41}", - &["\u{61}\u{27}\u{308}\u{41}"]), ("\u{61}\u{27}\u{3a}", &["\u{61}", "\u{27}", "\u{3a}"]), - ("\u{61}\u{27}\u{308}\u{3a}", &["\u{61}", "\u{27}\u{308}", "\u{3a}"]), - ("\u{61}\u{27}\u{2c}", &["\u{61}", "\u{27}", "\u{2c}"]), ("\u{61}\u{27}\u{308}\u{2c}", - &["\u{61}", "\u{27}\u{308}", "\u{2c}"]), ("\u{61}\u{27}\u{2e}", &["\u{61}", "\u{27}", - "\u{2e}"]), ("\u{61}\u{27}\u{308}\u{2e}", &["\u{61}", "\u{27}\u{308}", "\u{2e}"]), - ("\u{61}\u{27}\u{30}", &["\u{61}", "\u{27}", "\u{30}"]), ("\u{61}\u{27}\u{308}\u{30}", - &["\u{61}", "\u{27}\u{308}", "\u{30}"]), ("\u{61}\u{27}\u{5f}", &["\u{61}", "\u{27}", - "\u{5f}"]), ("\u{61}\u{27}\u{308}\u{5f}", &["\u{61}", "\u{27}\u{308}", "\u{5f}"]), - ("\u{61}\u{27}\u{1f1e6}", &["\u{61}", "\u{27}", "\u{1f1e6}"]), - ("\u{61}\u{27}\u{308}\u{1f1e6}", &["\u{61}", "\u{27}\u{308}", "\u{1f1e6}"]), - ("\u{61}\u{27}\u{5d0}", &["\u{61}\u{27}\u{5d0}"]), ("\u{61}\u{27}\u{308}\u{5d0}", - &["\u{61}\u{27}\u{308}\u{5d0}"]), ("\u{61}\u{27}\u{22}", &["\u{61}", "\u{27}", "\u{22}"]), - ("\u{61}\u{27}\u{308}\u{22}", &["\u{61}", "\u{27}\u{308}", "\u{22}"]), - ("\u{61}\u{27}\u{27}", &["\u{61}", "\u{27}", "\u{27}"]), ("\u{61}\u{27}\u{308}\u{27}", - &["\u{61}", "\u{27}\u{308}", "\u{27}"]), ("\u{61}\u{27}\u{261d}", &["\u{61}", "\u{27}", - "\u{261d}"]), ("\u{61}\u{27}\u{308}\u{261d}", &["\u{61}", "\u{27}\u{308}", "\u{261d}"]), - ("\u{61}\u{27}\u{1f3fb}", &["\u{61}", "\u{27}", "\u{1f3fb}"]), - ("\u{61}\u{27}\u{308}\u{1f3fb}", &["\u{61}", "\u{27}\u{308}", "\u{1f3fb}"]), - ("\u{61}\u{27}\u{2764}", &["\u{61}", "\u{27}", "\u{2764}"]), ("\u{61}\u{27}\u{308}\u{2764}", - &["\u{61}", "\u{27}\u{308}", "\u{2764}"]), ("\u{61}\u{27}\u{1f466}", &["\u{61}", "\u{27}", - "\u{1f466}"]), ("\u{61}\u{27}\u{308}\u{1f466}", &["\u{61}", "\u{27}\u{308}", "\u{1f466}"]), - ("\u{61}\u{27}\u{ad}", &["\u{61}", "\u{27}\u{ad}"]), ("\u{61}\u{27}\u{308}\u{ad}", - &["\u{61}", "\u{27}\u{308}\u{ad}"]), ("\u{61}\u{27}\u{300}", &["\u{61}", "\u{27}\u{300}"]), - ("\u{61}\u{27}\u{308}\u{300}", &["\u{61}", "\u{27}\u{308}\u{300}"]), - ("\u{61}\u{27}\u{200d}", &["\u{61}", "\u{27}\u{200d}"]), ("\u{61}\u{27}\u{308}\u{200d}", - &["\u{61}", "\u{27}\u{308}\u{200d}"]), ("\u{61}\u{27}\u{61}\u{2060}", - &["\u{61}\u{27}\u{61}\u{2060}"]), ("\u{61}\u{27}\u{308}\u{61}\u{2060}", - &["\u{61}\u{27}\u{308}\u{61}\u{2060}"]), ("\u{61}\u{27}\u{61}\u{3a}", - &["\u{61}\u{27}\u{61}", "\u{3a}"]), ("\u{61}\u{27}\u{308}\u{61}\u{3a}", - &["\u{61}\u{27}\u{308}\u{61}", "\u{3a}"]), ("\u{61}\u{27}\u{61}\u{27}", - &["\u{61}\u{27}\u{61}", "\u{27}"]), ("\u{61}\u{27}\u{308}\u{61}\u{27}", - &["\u{61}\u{27}\u{308}\u{61}", "\u{27}"]), ("\u{61}\u{27}\u{61}\u{27}\u{2060}", - &["\u{61}\u{27}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{27}\u{308}\u{61}\u{27}\u{2060}", - &["\u{61}\u{27}\u{308}\u{61}", "\u{27}\u{2060}"]), ("\u{61}\u{27}\u{61}\u{2c}", - &["\u{61}\u{27}\u{61}", "\u{2c}"]), ("\u{61}\u{27}\u{308}\u{61}\u{2c}", - &["\u{61}\u{27}\u{308}\u{61}", "\u{2c}"]), ("\u{61}\u{27}\u{31}\u{3a}", &["\u{61}", - "\u{27}", "\u{31}", "\u{3a}"]), ("\u{61}\u{27}\u{308}\u{31}\u{3a}", &["\u{61}", - "\u{27}\u{308}", "\u{31}", "\u{3a}"]), ("\u{61}\u{27}\u{31}\u{27}", &["\u{61}", "\u{27}", - "\u{31}", "\u{27}"]), ("\u{61}\u{27}\u{308}\u{31}\u{27}", &["\u{61}", "\u{27}\u{308}", - "\u{31}", "\u{27}"]), ("\u{61}\u{27}\u{31}\u{2c}", &["\u{61}", "\u{27}", "\u{31}", - "\u{2c}"]), ("\u{61}\u{27}\u{308}\u{31}\u{2c}", &["\u{61}", "\u{27}\u{308}", "\u{31}", - "\u{2c}"]), ("\u{61}\u{27}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{27}", "\u{31}", - "\u{2e}\u{2060}"]), ("\u{61}\u{27}\u{308}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{27}\u{308}", - "\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{27}\u{2060}\u{1}", &["\u{61}", "\u{27}\u{2060}", - "\u{1}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{1}", &["\u{61}", "\u{27}\u{2060}\u{308}", - "\u{1}"]), ("\u{61}\u{27}\u{2060}\u{d}", &["\u{61}", "\u{27}\u{2060}", "\u{d}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{d}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{d}"]), - ("\u{61}\u{27}\u{2060}\u{a}", &["\u{61}", "\u{27}\u{2060}", "\u{a}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{a}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{a}"]), - ("\u{61}\u{27}\u{2060}\u{b}", &["\u{61}", "\u{27}\u{2060}", "\u{b}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{b}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{b}"]), - ("\u{61}\u{27}\u{2060}\u{3031}", &["\u{61}", "\u{27}\u{2060}", "\u{3031}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{3031}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{3031}"]), - ("\u{61}\u{27}\u{2060}\u{41}", &["\u{61}\u{27}\u{2060}\u{41}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{41}", &["\u{61}\u{27}\u{2060}\u{308}\u{41}"]), - ("\u{61}\u{27}\u{2060}\u{3a}", &["\u{61}", "\u{27}\u{2060}", "\u{3a}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{3a}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{3a}"]), - ("\u{61}\u{27}\u{2060}\u{2c}", &["\u{61}", "\u{27}\u{2060}", "\u{2c}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{2c}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{2c}"]), - ("\u{61}\u{27}\u{2060}\u{2e}", &["\u{61}", "\u{27}\u{2060}", "\u{2e}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{2e}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{2e}"]), - ("\u{61}\u{27}\u{2060}\u{30}", &["\u{61}", "\u{27}\u{2060}", "\u{30}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{30}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{30}"]), - ("\u{61}\u{27}\u{2060}\u{5f}", &["\u{61}", "\u{27}\u{2060}", "\u{5f}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{5f}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{5f}"]), - ("\u{61}\u{27}\u{2060}\u{1f1e6}", &["\u{61}", "\u{27}\u{2060}", "\u{1f1e6}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{1f1e6}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{1f1e6}"]), - ("\u{61}\u{27}\u{2060}\u{5d0}", &["\u{61}\u{27}\u{2060}\u{5d0}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{5d0}", &["\u{61}\u{27}\u{2060}\u{308}\u{5d0}"]), - ("\u{61}\u{27}\u{2060}\u{22}", &["\u{61}", "\u{27}\u{2060}", "\u{22}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{22}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{22}"]), - ("\u{61}\u{27}\u{2060}\u{27}", &["\u{61}", "\u{27}\u{2060}", "\u{27}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{27}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{27}"]), - ("\u{61}\u{27}\u{2060}\u{261d}", &["\u{61}", "\u{27}\u{2060}", "\u{261d}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{261d}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{261d}"]), - ("\u{61}\u{27}\u{2060}\u{1f3fb}", &["\u{61}", "\u{27}\u{2060}", "\u{1f3fb}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{1f3fb}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{1f3fb}"]), - ("\u{61}\u{27}\u{2060}\u{2764}", &["\u{61}", "\u{27}\u{2060}", "\u{2764}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{2764}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{2764}"]), - ("\u{61}\u{27}\u{2060}\u{1f466}", &["\u{61}", "\u{27}\u{2060}", "\u{1f466}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{1f466}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{1f466}"]), - ("\u{61}\u{27}\u{2060}\u{ad}", &["\u{61}", "\u{27}\u{2060}\u{ad}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{ad}", &["\u{61}", "\u{27}\u{2060}\u{308}\u{ad}"]), - ("\u{61}\u{27}\u{2060}\u{300}", &["\u{61}", "\u{27}\u{2060}\u{300}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{300}", &["\u{61}", "\u{27}\u{2060}\u{308}\u{300}"]), - ("\u{61}\u{27}\u{2060}\u{200d}", &["\u{61}", "\u{27}\u{2060}\u{200d}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{200d}", &["\u{61}", "\u{27}\u{2060}\u{308}\u{200d}"]), - ("\u{61}\u{27}\u{2060}\u{61}\u{2060}", &["\u{61}\u{27}\u{2060}\u{61}\u{2060}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{61}\u{2060}", - &["\u{61}\u{27}\u{2060}\u{308}\u{61}\u{2060}"]), ("\u{61}\u{27}\u{2060}\u{61}\u{3a}", - &["\u{61}\u{27}\u{2060}\u{61}", "\u{3a}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{61}\u{3a}", - &["\u{61}\u{27}\u{2060}\u{308}\u{61}", "\u{3a}"]), ("\u{61}\u{27}\u{2060}\u{61}\u{27}", - &["\u{61}\u{27}\u{2060}\u{61}", "\u{27}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{61}\u{27}", - &["\u{61}\u{27}\u{2060}\u{308}\u{61}", "\u{27}"]), - ("\u{61}\u{27}\u{2060}\u{61}\u{27}\u{2060}", &["\u{61}\u{27}\u{2060}\u{61}", - "\u{27}\u{2060}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{61}\u{27}\u{2060}", - &["\u{61}\u{27}\u{2060}\u{308}\u{61}", "\u{27}\u{2060}"]), - ("\u{61}\u{27}\u{2060}\u{61}\u{2c}", &["\u{61}\u{27}\u{2060}\u{61}", "\u{2c}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{61}\u{2c}", &["\u{61}\u{27}\u{2060}\u{308}\u{61}", - "\u{2c}"]), ("\u{61}\u{27}\u{2060}\u{31}\u{3a}", &["\u{61}", "\u{27}\u{2060}", "\u{31}", - "\u{3a}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{31}\u{3a}", &["\u{61}", "\u{27}\u{2060}\u{308}", - "\u{31}", "\u{3a}"]), ("\u{61}\u{27}\u{2060}\u{31}\u{27}", &["\u{61}", "\u{27}\u{2060}", - "\u{31}", "\u{27}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{31}\u{27}", &["\u{61}", - "\u{27}\u{2060}\u{308}", "\u{31}", "\u{27}"]), ("\u{61}\u{27}\u{2060}\u{31}\u{2c}", - &["\u{61}", "\u{27}\u{2060}", "\u{31}", "\u{2c}"]), - ("\u{61}\u{27}\u{2060}\u{308}\u{31}\u{2c}", &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{31}", - "\u{2c}"]), ("\u{61}\u{27}\u{2060}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{27}\u{2060}", - "\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{27}\u{2060}\u{308}\u{31}\u{2e}\u{2060}", - &["\u{61}", "\u{27}\u{2060}\u{308}", "\u{31}", "\u{2e}\u{2060}"]), ("\u{61}\u{2c}\u{1}", - &["\u{61}", "\u{2c}", "\u{1}"]), ("\u{61}\u{2c}\u{308}\u{1}", &["\u{61}", "\u{2c}\u{308}", - "\u{1}"]), ("\u{61}\u{2c}\u{d}", &["\u{61}", "\u{2c}", "\u{d}"]), - ("\u{61}\u{2c}\u{308}\u{d}", &["\u{61}", "\u{2c}\u{308}", "\u{d}"]), ("\u{61}\u{2c}\u{a}", - &["\u{61}", "\u{2c}", "\u{a}"]), ("\u{61}\u{2c}\u{308}\u{a}", &["\u{61}", "\u{2c}\u{308}", - "\u{a}"]), ("\u{61}\u{2c}\u{b}", &["\u{61}", "\u{2c}", "\u{b}"]), - ("\u{61}\u{2c}\u{308}\u{b}", &["\u{61}", "\u{2c}\u{308}", "\u{b}"]), - ("\u{61}\u{2c}\u{3031}", &["\u{61}", "\u{2c}", "\u{3031}"]), ("\u{61}\u{2c}\u{308}\u{3031}", - &["\u{61}", "\u{2c}\u{308}", "\u{3031}"]), ("\u{61}\u{2c}\u{41}", &["\u{61}", "\u{2c}", - "\u{41}"]), ("\u{61}\u{2c}\u{308}\u{41}", &["\u{61}", "\u{2c}\u{308}", "\u{41}"]), - ("\u{61}\u{2c}\u{3a}", &["\u{61}", "\u{2c}", "\u{3a}"]), ("\u{61}\u{2c}\u{308}\u{3a}", - &["\u{61}", "\u{2c}\u{308}", "\u{3a}"]), ("\u{61}\u{2c}\u{2c}", &["\u{61}", "\u{2c}", - "\u{2c}"]), ("\u{61}\u{2c}\u{308}\u{2c}", &["\u{61}", "\u{2c}\u{308}", "\u{2c}"]), - ("\u{61}\u{2c}\u{2e}", &["\u{61}", "\u{2c}", "\u{2e}"]), ("\u{61}\u{2c}\u{308}\u{2e}", - &["\u{61}", "\u{2c}\u{308}", "\u{2e}"]), ("\u{61}\u{2c}\u{30}", &["\u{61}", "\u{2c}", - "\u{30}"]), ("\u{61}\u{2c}\u{308}\u{30}", &["\u{61}", "\u{2c}\u{308}", "\u{30}"]), - ("\u{61}\u{2c}\u{5f}", &["\u{61}", "\u{2c}", "\u{5f}"]), ("\u{61}\u{2c}\u{308}\u{5f}", - &["\u{61}", "\u{2c}\u{308}", "\u{5f}"]), ("\u{61}\u{2c}\u{1f1e6}", &["\u{61}", "\u{2c}", - "\u{1f1e6}"]), ("\u{61}\u{2c}\u{308}\u{1f1e6}", &["\u{61}", "\u{2c}\u{308}", "\u{1f1e6}"]), - ("\u{61}\u{2c}\u{5d0}", &["\u{61}", "\u{2c}", "\u{5d0}"]), ("\u{61}\u{2c}\u{308}\u{5d0}", - &["\u{61}", "\u{2c}\u{308}", "\u{5d0}"]), ("\u{61}\u{2c}\u{22}", &["\u{61}", "\u{2c}", - "\u{22}"]), ("\u{61}\u{2c}\u{308}\u{22}", &["\u{61}", "\u{2c}\u{308}", "\u{22}"]), - ("\u{61}\u{2c}\u{27}", &["\u{61}", "\u{2c}", "\u{27}"]), ("\u{61}\u{2c}\u{308}\u{27}", - &["\u{61}", "\u{2c}\u{308}", "\u{27}"]), ("\u{61}\u{2c}\u{261d}", &["\u{61}", "\u{2c}", - "\u{261d}"]), ("\u{61}\u{2c}\u{308}\u{261d}", &["\u{61}", "\u{2c}\u{308}", "\u{261d}"]), - ("\u{61}\u{2c}\u{1f3fb}", &["\u{61}", "\u{2c}", "\u{1f3fb}"]), - ("\u{61}\u{2c}\u{308}\u{1f3fb}", &["\u{61}", "\u{2c}\u{308}", "\u{1f3fb}"]), - ("\u{61}\u{2c}\u{2764}", &["\u{61}", "\u{2c}", "\u{2764}"]), ("\u{61}\u{2c}\u{308}\u{2764}", - &["\u{61}", "\u{2c}\u{308}", "\u{2764}"]), ("\u{61}\u{2c}\u{1f466}", &["\u{61}", "\u{2c}", - "\u{1f466}"]), ("\u{61}\u{2c}\u{308}\u{1f466}", &["\u{61}", "\u{2c}\u{308}", "\u{1f466}"]), - ("\u{61}\u{2c}\u{ad}", &["\u{61}", "\u{2c}\u{ad}"]), ("\u{61}\u{2c}\u{308}\u{ad}", - &["\u{61}", "\u{2c}\u{308}\u{ad}"]), ("\u{61}\u{2c}\u{300}", &["\u{61}", "\u{2c}\u{300}"]), - ("\u{61}\u{2c}\u{308}\u{300}", &["\u{61}", "\u{2c}\u{308}\u{300}"]), - ("\u{61}\u{2c}\u{200d}", &["\u{61}", "\u{2c}\u{200d}"]), ("\u{61}\u{2c}\u{308}\u{200d}", - &["\u{61}", "\u{2c}\u{308}\u{200d}"]), ("\u{61}\u{2c}\u{61}\u{2060}", &["\u{61}", "\u{2c}", - "\u{61}\u{2060}"]), ("\u{61}\u{2c}\u{308}\u{61}\u{2060}", &["\u{61}", "\u{2c}\u{308}", - "\u{61}\u{2060}"]), ("\u{61}\u{2c}\u{61}\u{3a}", &["\u{61}", "\u{2c}", "\u{61}", "\u{3a}"]), - ("\u{61}\u{2c}\u{308}\u{61}\u{3a}", &["\u{61}", "\u{2c}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{61}\u{2c}\u{61}\u{27}", &["\u{61}", "\u{2c}", "\u{61}", "\u{27}"]), - ("\u{61}\u{2c}\u{308}\u{61}\u{27}", &["\u{61}", "\u{2c}\u{308}", "\u{61}", "\u{27}"]), - ("\u{61}\u{2c}\u{61}\u{27}\u{2060}", &["\u{61}", "\u{2c}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{61}\u{2c}\u{308}\u{61}\u{27}\u{2060}", &["\u{61}", "\u{2c}\u{308}", "\u{61}", - "\u{27}\u{2060}"]), ("\u{61}\u{2c}\u{61}\u{2c}", &["\u{61}", "\u{2c}", "\u{61}", "\u{2c}"]), - ("\u{61}\u{2c}\u{308}\u{61}\u{2c}", &["\u{61}", "\u{2c}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{61}\u{2c}\u{31}\u{3a}", &["\u{61}", "\u{2c}", "\u{31}", "\u{3a}"]), - ("\u{61}\u{2c}\u{308}\u{31}\u{3a}", &["\u{61}", "\u{2c}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{61}\u{2c}\u{31}\u{27}", &["\u{61}", "\u{2c}", "\u{31}", "\u{27}"]), - ("\u{61}\u{2c}\u{308}\u{31}\u{27}", &["\u{61}", "\u{2c}\u{308}", "\u{31}", "\u{27}"]), - ("\u{61}\u{2c}\u{31}\u{2c}", &["\u{61}", "\u{2c}", "\u{31}", "\u{2c}"]), - ("\u{61}\u{2c}\u{308}\u{31}\u{2c}", &["\u{61}", "\u{2c}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{61}\u{2c}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{2c}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{61}\u{2c}\u{308}\u{31}\u{2e}\u{2060}", &["\u{61}", "\u{2c}\u{308}", "\u{31}", - "\u{2e}\u{2060}"]), ("\u{31}\u{3a}\u{1}", &["\u{31}", "\u{3a}", "\u{1}"]), - ("\u{31}\u{3a}\u{308}\u{1}", &["\u{31}", "\u{3a}\u{308}", "\u{1}"]), ("\u{31}\u{3a}\u{d}", - &["\u{31}", "\u{3a}", "\u{d}"]), ("\u{31}\u{3a}\u{308}\u{d}", &["\u{31}", "\u{3a}\u{308}", - "\u{d}"]), ("\u{31}\u{3a}\u{a}", &["\u{31}", "\u{3a}", "\u{a}"]), - ("\u{31}\u{3a}\u{308}\u{a}", &["\u{31}", "\u{3a}\u{308}", "\u{a}"]), ("\u{31}\u{3a}\u{b}", - &["\u{31}", "\u{3a}", "\u{b}"]), ("\u{31}\u{3a}\u{308}\u{b}", &["\u{31}", "\u{3a}\u{308}", - "\u{b}"]), ("\u{31}\u{3a}\u{3031}", &["\u{31}", "\u{3a}", "\u{3031}"]), - ("\u{31}\u{3a}\u{308}\u{3031}", &["\u{31}", "\u{3a}\u{308}", "\u{3031}"]), - ("\u{31}\u{3a}\u{41}", &["\u{31}", "\u{3a}", "\u{41}"]), ("\u{31}\u{3a}\u{308}\u{41}", - &["\u{31}", "\u{3a}\u{308}", "\u{41}"]), ("\u{31}\u{3a}\u{3a}", &["\u{31}", "\u{3a}", - "\u{3a}"]), ("\u{31}\u{3a}\u{308}\u{3a}", &["\u{31}", "\u{3a}\u{308}", "\u{3a}"]), - ("\u{31}\u{3a}\u{2c}", &["\u{31}", "\u{3a}", "\u{2c}"]), ("\u{31}\u{3a}\u{308}\u{2c}", - &["\u{31}", "\u{3a}\u{308}", "\u{2c}"]), ("\u{31}\u{3a}\u{2e}", &["\u{31}", "\u{3a}", - "\u{2e}"]), ("\u{31}\u{3a}\u{308}\u{2e}", &["\u{31}", "\u{3a}\u{308}", "\u{2e}"]), - ("\u{31}\u{3a}\u{30}", &["\u{31}", "\u{3a}", "\u{30}"]), ("\u{31}\u{3a}\u{308}\u{30}", - &["\u{31}", "\u{3a}\u{308}", "\u{30}"]), ("\u{31}\u{3a}\u{5f}", &["\u{31}", "\u{3a}", - "\u{5f}"]), ("\u{31}\u{3a}\u{308}\u{5f}", &["\u{31}", "\u{3a}\u{308}", "\u{5f}"]), - ("\u{31}\u{3a}\u{1f1e6}", &["\u{31}", "\u{3a}", "\u{1f1e6}"]), - ("\u{31}\u{3a}\u{308}\u{1f1e6}", &["\u{31}", "\u{3a}\u{308}", "\u{1f1e6}"]), - ("\u{31}\u{3a}\u{5d0}", &["\u{31}", "\u{3a}", "\u{5d0}"]), ("\u{31}\u{3a}\u{308}\u{5d0}", - &["\u{31}", "\u{3a}\u{308}", "\u{5d0}"]), ("\u{31}\u{3a}\u{22}", &["\u{31}", "\u{3a}", - "\u{22}"]), ("\u{31}\u{3a}\u{308}\u{22}", &["\u{31}", "\u{3a}\u{308}", "\u{22}"]), - ("\u{31}\u{3a}\u{27}", &["\u{31}", "\u{3a}", "\u{27}"]), ("\u{31}\u{3a}\u{308}\u{27}", - &["\u{31}", "\u{3a}\u{308}", "\u{27}"]), ("\u{31}\u{3a}\u{261d}", &["\u{31}", "\u{3a}", - "\u{261d}"]), ("\u{31}\u{3a}\u{308}\u{261d}", &["\u{31}", "\u{3a}\u{308}", "\u{261d}"]), - ("\u{31}\u{3a}\u{1f3fb}", &["\u{31}", "\u{3a}", "\u{1f3fb}"]), - ("\u{31}\u{3a}\u{308}\u{1f3fb}", &["\u{31}", "\u{3a}\u{308}", "\u{1f3fb}"]), - ("\u{31}\u{3a}\u{2764}", &["\u{31}", "\u{3a}", "\u{2764}"]), ("\u{31}\u{3a}\u{308}\u{2764}", - &["\u{31}", "\u{3a}\u{308}", "\u{2764}"]), ("\u{31}\u{3a}\u{1f466}", &["\u{31}", "\u{3a}", - "\u{1f466}"]), ("\u{31}\u{3a}\u{308}\u{1f466}", &["\u{31}", "\u{3a}\u{308}", "\u{1f466}"]), - ("\u{31}\u{3a}\u{ad}", &["\u{31}", "\u{3a}\u{ad}"]), ("\u{31}\u{3a}\u{308}\u{ad}", - &["\u{31}", "\u{3a}\u{308}\u{ad}"]), ("\u{31}\u{3a}\u{300}", &["\u{31}", "\u{3a}\u{300}"]), - ("\u{31}\u{3a}\u{308}\u{300}", &["\u{31}", "\u{3a}\u{308}\u{300}"]), - ("\u{31}\u{3a}\u{200d}", &["\u{31}", "\u{3a}\u{200d}"]), ("\u{31}\u{3a}\u{308}\u{200d}", - &["\u{31}", "\u{3a}\u{308}\u{200d}"]), ("\u{31}\u{3a}\u{61}\u{2060}", &["\u{31}", "\u{3a}", - "\u{61}\u{2060}"]), ("\u{31}\u{3a}\u{308}\u{61}\u{2060}", &["\u{31}", "\u{3a}\u{308}", - "\u{61}\u{2060}"]), ("\u{31}\u{3a}\u{61}\u{3a}", &["\u{31}", "\u{3a}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{3a}\u{308}\u{61}\u{3a}", &["\u{31}", "\u{3a}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{3a}\u{61}\u{27}", &["\u{31}", "\u{3a}", "\u{61}", "\u{27}"]), - ("\u{31}\u{3a}\u{308}\u{61}\u{27}", &["\u{31}", "\u{3a}\u{308}", "\u{61}", "\u{27}"]), - ("\u{31}\u{3a}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{3a}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{31}\u{3a}\u{308}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{3a}\u{308}", "\u{61}", - "\u{27}\u{2060}"]), ("\u{31}\u{3a}\u{61}\u{2c}", &["\u{31}", "\u{3a}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{3a}\u{308}\u{61}\u{2c}", &["\u{31}", "\u{3a}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{3a}\u{31}\u{3a}", &["\u{31}", "\u{3a}", "\u{31}", "\u{3a}"]), - ("\u{31}\u{3a}\u{308}\u{31}\u{3a}", &["\u{31}", "\u{3a}\u{308}", "\u{31}", "\u{3a}"]), - ("\u{31}\u{3a}\u{31}\u{27}", &["\u{31}", "\u{3a}", "\u{31}", "\u{27}"]), - ("\u{31}\u{3a}\u{308}\u{31}\u{27}", &["\u{31}", "\u{3a}\u{308}", "\u{31}", "\u{27}"]), - ("\u{31}\u{3a}\u{31}\u{2c}", &["\u{31}", "\u{3a}", "\u{31}", "\u{2c}"]), - ("\u{31}\u{3a}\u{308}\u{31}\u{2c}", &["\u{31}", "\u{3a}\u{308}", "\u{31}", "\u{2c}"]), - ("\u{31}\u{3a}\u{31}\u{2e}\u{2060}", &["\u{31}", "\u{3a}", "\u{31}", "\u{2e}\u{2060}"]), - ("\u{31}\u{3a}\u{308}\u{31}\u{2e}\u{2060}", &["\u{31}", "\u{3a}\u{308}", "\u{31}", - "\u{2e}\u{2060}"]), ("\u{31}\u{27}\u{1}", &["\u{31}", "\u{27}", "\u{1}"]), - ("\u{31}\u{27}\u{308}\u{1}", &["\u{31}", "\u{27}\u{308}", "\u{1}"]), ("\u{31}\u{27}\u{d}", - &["\u{31}", "\u{27}", "\u{d}"]), ("\u{31}\u{27}\u{308}\u{d}", &["\u{31}", "\u{27}\u{308}", - "\u{d}"]), ("\u{31}\u{27}\u{a}", &["\u{31}", "\u{27}", "\u{a}"]), - ("\u{31}\u{27}\u{308}\u{a}", &["\u{31}", "\u{27}\u{308}", "\u{a}"]), ("\u{31}\u{27}\u{b}", - &["\u{31}", "\u{27}", "\u{b}"]), ("\u{31}\u{27}\u{308}\u{b}", &["\u{31}", "\u{27}\u{308}", - "\u{b}"]), ("\u{31}\u{27}\u{3031}", &["\u{31}", "\u{27}", "\u{3031}"]), - ("\u{31}\u{27}\u{308}\u{3031}", &["\u{31}", "\u{27}\u{308}", "\u{3031}"]), - ("\u{31}\u{27}\u{41}", &["\u{31}", "\u{27}", "\u{41}"]), ("\u{31}\u{27}\u{308}\u{41}", - &["\u{31}", "\u{27}\u{308}", "\u{41}"]), ("\u{31}\u{27}\u{3a}", &["\u{31}", "\u{27}", - "\u{3a}"]), ("\u{31}\u{27}\u{308}\u{3a}", &["\u{31}", "\u{27}\u{308}", "\u{3a}"]), - ("\u{31}\u{27}\u{2c}", &["\u{31}", "\u{27}", "\u{2c}"]), ("\u{31}\u{27}\u{308}\u{2c}", - &["\u{31}", "\u{27}\u{308}", "\u{2c}"]), ("\u{31}\u{27}\u{2e}", &["\u{31}", "\u{27}", - "\u{2e}"]), ("\u{31}\u{27}\u{308}\u{2e}", &["\u{31}", "\u{27}\u{308}", "\u{2e}"]), - ("\u{31}\u{27}\u{30}", &["\u{31}\u{27}\u{30}"]), ("\u{31}\u{27}\u{308}\u{30}", - &["\u{31}\u{27}\u{308}\u{30}"]), ("\u{31}\u{27}\u{5f}", &["\u{31}", "\u{27}", "\u{5f}"]), - ("\u{31}\u{27}\u{308}\u{5f}", &["\u{31}", "\u{27}\u{308}", "\u{5f}"]), - ("\u{31}\u{27}\u{1f1e6}", &["\u{31}", "\u{27}", "\u{1f1e6}"]), - ("\u{31}\u{27}\u{308}\u{1f1e6}", &["\u{31}", "\u{27}\u{308}", "\u{1f1e6}"]), - ("\u{31}\u{27}\u{5d0}", &["\u{31}", "\u{27}", "\u{5d0}"]), ("\u{31}\u{27}\u{308}\u{5d0}", - &["\u{31}", "\u{27}\u{308}", "\u{5d0}"]), ("\u{31}\u{27}\u{22}", &["\u{31}", "\u{27}", - "\u{22}"]), ("\u{31}\u{27}\u{308}\u{22}", &["\u{31}", "\u{27}\u{308}", "\u{22}"]), - ("\u{31}\u{27}\u{27}", &["\u{31}", "\u{27}", "\u{27}"]), ("\u{31}\u{27}\u{308}\u{27}", - &["\u{31}", "\u{27}\u{308}", "\u{27}"]), ("\u{31}\u{27}\u{261d}", &["\u{31}", "\u{27}", - "\u{261d}"]), ("\u{31}\u{27}\u{308}\u{261d}", &["\u{31}", "\u{27}\u{308}", "\u{261d}"]), - ("\u{31}\u{27}\u{1f3fb}", &["\u{31}", "\u{27}", "\u{1f3fb}"]), - ("\u{31}\u{27}\u{308}\u{1f3fb}", &["\u{31}", "\u{27}\u{308}", "\u{1f3fb}"]), - ("\u{31}\u{27}\u{2764}", &["\u{31}", "\u{27}", "\u{2764}"]), ("\u{31}\u{27}\u{308}\u{2764}", - &["\u{31}", "\u{27}\u{308}", "\u{2764}"]), ("\u{31}\u{27}\u{1f466}", &["\u{31}", "\u{27}", - "\u{1f466}"]), ("\u{31}\u{27}\u{308}\u{1f466}", &["\u{31}", "\u{27}\u{308}", "\u{1f466}"]), - ("\u{31}\u{27}\u{ad}", &["\u{31}", "\u{27}\u{ad}"]), ("\u{31}\u{27}\u{308}\u{ad}", - &["\u{31}", "\u{27}\u{308}\u{ad}"]), ("\u{31}\u{27}\u{300}", &["\u{31}", "\u{27}\u{300}"]), - ("\u{31}\u{27}\u{308}\u{300}", &["\u{31}", "\u{27}\u{308}\u{300}"]), - ("\u{31}\u{27}\u{200d}", &["\u{31}", "\u{27}\u{200d}"]), ("\u{31}\u{27}\u{308}\u{200d}", - &["\u{31}", "\u{27}\u{308}\u{200d}"]), ("\u{31}\u{27}\u{61}\u{2060}", &["\u{31}", "\u{27}", - "\u{61}\u{2060}"]), ("\u{31}\u{27}\u{308}\u{61}\u{2060}", &["\u{31}", "\u{27}\u{308}", - "\u{61}\u{2060}"]), ("\u{31}\u{27}\u{61}\u{3a}", &["\u{31}", "\u{27}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{27}\u{308}\u{61}\u{3a}", &["\u{31}", "\u{27}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{27}\u{61}\u{27}", &["\u{31}", "\u{27}", "\u{61}", "\u{27}"]), - ("\u{31}\u{27}\u{308}\u{61}\u{27}", &["\u{31}", "\u{27}\u{308}", "\u{61}", "\u{27}"]), - ("\u{31}\u{27}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{27}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{31}\u{27}\u{308}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{27}\u{308}", "\u{61}", - "\u{27}\u{2060}"]), ("\u{31}\u{27}\u{61}\u{2c}", &["\u{31}", "\u{27}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{27}\u{308}\u{61}\u{2c}", &["\u{31}", "\u{27}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{27}\u{31}\u{3a}", &["\u{31}\u{27}\u{31}", "\u{3a}"]), - ("\u{31}\u{27}\u{308}\u{31}\u{3a}", &["\u{31}\u{27}\u{308}\u{31}", "\u{3a}"]), - ("\u{31}\u{27}\u{31}\u{27}", &["\u{31}\u{27}\u{31}", "\u{27}"]), - ("\u{31}\u{27}\u{308}\u{31}\u{27}", &["\u{31}\u{27}\u{308}\u{31}", "\u{27}"]), - ("\u{31}\u{27}\u{31}\u{2c}", &["\u{31}\u{27}\u{31}", "\u{2c}"]), - ("\u{31}\u{27}\u{308}\u{31}\u{2c}", &["\u{31}\u{27}\u{308}\u{31}", "\u{2c}"]), - ("\u{31}\u{27}\u{31}\u{2e}\u{2060}", &["\u{31}\u{27}\u{31}", "\u{2e}\u{2060}"]), - ("\u{31}\u{27}\u{308}\u{31}\u{2e}\u{2060}", &["\u{31}\u{27}\u{308}\u{31}", - "\u{2e}\u{2060}"]), ("\u{31}\u{2c}\u{1}", &["\u{31}", "\u{2c}", "\u{1}"]), - ("\u{31}\u{2c}\u{308}\u{1}", &["\u{31}", "\u{2c}\u{308}", "\u{1}"]), ("\u{31}\u{2c}\u{d}", - &["\u{31}", "\u{2c}", "\u{d}"]), ("\u{31}\u{2c}\u{308}\u{d}", &["\u{31}", "\u{2c}\u{308}", - "\u{d}"]), ("\u{31}\u{2c}\u{a}", &["\u{31}", "\u{2c}", "\u{a}"]), - ("\u{31}\u{2c}\u{308}\u{a}", &["\u{31}", "\u{2c}\u{308}", "\u{a}"]), ("\u{31}\u{2c}\u{b}", - &["\u{31}", "\u{2c}", "\u{b}"]), ("\u{31}\u{2c}\u{308}\u{b}", &["\u{31}", "\u{2c}\u{308}", - "\u{b}"]), ("\u{31}\u{2c}\u{3031}", &["\u{31}", "\u{2c}", "\u{3031}"]), - ("\u{31}\u{2c}\u{308}\u{3031}", &["\u{31}", "\u{2c}\u{308}", "\u{3031}"]), - ("\u{31}\u{2c}\u{41}", &["\u{31}", "\u{2c}", "\u{41}"]), ("\u{31}\u{2c}\u{308}\u{41}", - &["\u{31}", "\u{2c}\u{308}", "\u{41}"]), ("\u{31}\u{2c}\u{3a}", &["\u{31}", "\u{2c}", - "\u{3a}"]), ("\u{31}\u{2c}\u{308}\u{3a}", &["\u{31}", "\u{2c}\u{308}", "\u{3a}"]), - ("\u{31}\u{2c}\u{2c}", &["\u{31}", "\u{2c}", "\u{2c}"]), ("\u{31}\u{2c}\u{308}\u{2c}", - &["\u{31}", "\u{2c}\u{308}", "\u{2c}"]), ("\u{31}\u{2c}\u{2e}", &["\u{31}", "\u{2c}", - "\u{2e}"]), ("\u{31}\u{2c}\u{308}\u{2e}", &["\u{31}", "\u{2c}\u{308}", "\u{2e}"]), - ("\u{31}\u{2c}\u{30}", &["\u{31}\u{2c}\u{30}"]), ("\u{31}\u{2c}\u{308}\u{30}", - &["\u{31}\u{2c}\u{308}\u{30}"]), ("\u{31}\u{2c}\u{5f}", &["\u{31}", "\u{2c}", "\u{5f}"]), - ("\u{31}\u{2c}\u{308}\u{5f}", &["\u{31}", "\u{2c}\u{308}", "\u{5f}"]), - ("\u{31}\u{2c}\u{1f1e6}", &["\u{31}", "\u{2c}", "\u{1f1e6}"]), - ("\u{31}\u{2c}\u{308}\u{1f1e6}", &["\u{31}", "\u{2c}\u{308}", "\u{1f1e6}"]), - ("\u{31}\u{2c}\u{5d0}", &["\u{31}", "\u{2c}", "\u{5d0}"]), ("\u{31}\u{2c}\u{308}\u{5d0}", - &["\u{31}", "\u{2c}\u{308}", "\u{5d0}"]), ("\u{31}\u{2c}\u{22}", &["\u{31}", "\u{2c}", - "\u{22}"]), ("\u{31}\u{2c}\u{308}\u{22}", &["\u{31}", "\u{2c}\u{308}", "\u{22}"]), - ("\u{31}\u{2c}\u{27}", &["\u{31}", "\u{2c}", "\u{27}"]), ("\u{31}\u{2c}\u{308}\u{27}", - &["\u{31}", "\u{2c}\u{308}", "\u{27}"]), ("\u{31}\u{2c}\u{261d}", &["\u{31}", "\u{2c}", - "\u{261d}"]), ("\u{31}\u{2c}\u{308}\u{261d}", &["\u{31}", "\u{2c}\u{308}", "\u{261d}"]), - ("\u{31}\u{2c}\u{1f3fb}", &["\u{31}", "\u{2c}", "\u{1f3fb}"]), - ("\u{31}\u{2c}\u{308}\u{1f3fb}", &["\u{31}", "\u{2c}\u{308}", "\u{1f3fb}"]), - ("\u{31}\u{2c}\u{2764}", &["\u{31}", "\u{2c}", "\u{2764}"]), ("\u{31}\u{2c}\u{308}\u{2764}", - &["\u{31}", "\u{2c}\u{308}", "\u{2764}"]), ("\u{31}\u{2c}\u{1f466}", &["\u{31}", "\u{2c}", - "\u{1f466}"]), ("\u{31}\u{2c}\u{308}\u{1f466}", &["\u{31}", "\u{2c}\u{308}", "\u{1f466}"]), - ("\u{31}\u{2c}\u{ad}", &["\u{31}", "\u{2c}\u{ad}"]), ("\u{31}\u{2c}\u{308}\u{ad}", - &["\u{31}", "\u{2c}\u{308}\u{ad}"]), ("\u{31}\u{2c}\u{300}", &["\u{31}", "\u{2c}\u{300}"]), - ("\u{31}\u{2c}\u{308}\u{300}", &["\u{31}", "\u{2c}\u{308}\u{300}"]), - ("\u{31}\u{2c}\u{200d}", &["\u{31}", "\u{2c}\u{200d}"]), ("\u{31}\u{2c}\u{308}\u{200d}", - &["\u{31}", "\u{2c}\u{308}\u{200d}"]), ("\u{31}\u{2c}\u{61}\u{2060}", &["\u{31}", "\u{2c}", - "\u{61}\u{2060}"]), ("\u{31}\u{2c}\u{308}\u{61}\u{2060}", &["\u{31}", "\u{2c}\u{308}", - "\u{61}\u{2060}"]), ("\u{31}\u{2c}\u{61}\u{3a}", &["\u{31}", "\u{2c}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{2c}\u{308}\u{61}\u{3a}", &["\u{31}", "\u{2c}\u{308}", "\u{61}", "\u{3a}"]), - ("\u{31}\u{2c}\u{61}\u{27}", &["\u{31}", "\u{2c}", "\u{61}", "\u{27}"]), - ("\u{31}\u{2c}\u{308}\u{61}\u{27}", &["\u{31}", "\u{2c}\u{308}", "\u{61}", "\u{27}"]), - ("\u{31}\u{2c}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{2c}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{31}\u{2c}\u{308}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{2c}\u{308}", "\u{61}", - "\u{27}\u{2060}"]), ("\u{31}\u{2c}\u{61}\u{2c}", &["\u{31}", "\u{2c}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{2c}\u{308}\u{61}\u{2c}", &["\u{31}", "\u{2c}\u{308}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{2c}\u{31}\u{3a}", &["\u{31}\u{2c}\u{31}", "\u{3a}"]), - ("\u{31}\u{2c}\u{308}\u{31}\u{3a}", &["\u{31}\u{2c}\u{308}\u{31}", "\u{3a}"]), - ("\u{31}\u{2c}\u{31}\u{27}", &["\u{31}\u{2c}\u{31}", "\u{27}"]), - ("\u{31}\u{2c}\u{308}\u{31}\u{27}", &["\u{31}\u{2c}\u{308}\u{31}", "\u{27}"]), - ("\u{31}\u{2c}\u{31}\u{2c}", &["\u{31}\u{2c}\u{31}", "\u{2c}"]), - ("\u{31}\u{2c}\u{308}\u{31}\u{2c}", &["\u{31}\u{2c}\u{308}\u{31}", "\u{2c}"]), - ("\u{31}\u{2c}\u{31}\u{2e}\u{2060}", &["\u{31}\u{2c}\u{31}", "\u{2e}\u{2060}"]), - ("\u{31}\u{2c}\u{308}\u{31}\u{2e}\u{2060}", &["\u{31}\u{2c}\u{308}\u{31}", - "\u{2e}\u{2060}"]), ("\u{31}\u{2e}\u{2060}\u{1}", &["\u{31}", "\u{2e}\u{2060}", "\u{1}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{1}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{1}"]), - ("\u{31}\u{2e}\u{2060}\u{d}", &["\u{31}", "\u{2e}\u{2060}", "\u{d}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{d}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{d}"]), - ("\u{31}\u{2e}\u{2060}\u{a}", &["\u{31}", "\u{2e}\u{2060}", "\u{a}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{a}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{a}"]), - ("\u{31}\u{2e}\u{2060}\u{b}", &["\u{31}", "\u{2e}\u{2060}", "\u{b}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{b}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{b}"]), - ("\u{31}\u{2e}\u{2060}\u{3031}", &["\u{31}", "\u{2e}\u{2060}", "\u{3031}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{3031}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{3031}"]), - ("\u{31}\u{2e}\u{2060}\u{41}", &["\u{31}", "\u{2e}\u{2060}", "\u{41}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{41}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{41}"]), - ("\u{31}\u{2e}\u{2060}\u{3a}", &["\u{31}", "\u{2e}\u{2060}", "\u{3a}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{3a}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{3a}"]), - ("\u{31}\u{2e}\u{2060}\u{2c}", &["\u{31}", "\u{2e}\u{2060}", "\u{2c}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{2c}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{2c}"]), - ("\u{31}\u{2e}\u{2060}\u{2e}", &["\u{31}", "\u{2e}\u{2060}", "\u{2e}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{2e}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{2e}"]), - ("\u{31}\u{2e}\u{2060}\u{30}", &["\u{31}\u{2e}\u{2060}\u{30}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{30}", &["\u{31}\u{2e}\u{2060}\u{308}\u{30}"]), - ("\u{31}\u{2e}\u{2060}\u{5f}", &["\u{31}", "\u{2e}\u{2060}", "\u{5f}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{5f}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{5f}"]), - ("\u{31}\u{2e}\u{2060}\u{1f1e6}", &["\u{31}", "\u{2e}\u{2060}", "\u{1f1e6}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{1f1e6}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{1f1e6}"]), - ("\u{31}\u{2e}\u{2060}\u{5d0}", &["\u{31}", "\u{2e}\u{2060}", "\u{5d0}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{5d0}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{5d0}"]), - ("\u{31}\u{2e}\u{2060}\u{22}", &["\u{31}", "\u{2e}\u{2060}", "\u{22}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{22}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{22}"]), - ("\u{31}\u{2e}\u{2060}\u{27}", &["\u{31}", "\u{2e}\u{2060}", "\u{27}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{27}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{27}"]), - ("\u{31}\u{2e}\u{2060}\u{261d}", &["\u{31}", "\u{2e}\u{2060}", "\u{261d}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{261d}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{261d}"]), - ("\u{31}\u{2e}\u{2060}\u{1f3fb}", &["\u{31}", "\u{2e}\u{2060}", "\u{1f3fb}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{1f3fb}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{1f3fb}"]), - ("\u{31}\u{2e}\u{2060}\u{2764}", &["\u{31}", "\u{2e}\u{2060}", "\u{2764}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{2764}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{2764}"]), - ("\u{31}\u{2e}\u{2060}\u{1f466}", &["\u{31}", "\u{2e}\u{2060}", "\u{1f466}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{1f466}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{1f466}"]), - ("\u{31}\u{2e}\u{2060}\u{ad}", &["\u{31}", "\u{2e}\u{2060}\u{ad}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{ad}", &["\u{31}", "\u{2e}\u{2060}\u{308}\u{ad}"]), - ("\u{31}\u{2e}\u{2060}\u{300}", &["\u{31}", "\u{2e}\u{2060}\u{300}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{300}", &["\u{31}", "\u{2e}\u{2060}\u{308}\u{300}"]), - ("\u{31}\u{2e}\u{2060}\u{200d}", &["\u{31}", "\u{2e}\u{2060}\u{200d}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{200d}", &["\u{31}", "\u{2e}\u{2060}\u{308}\u{200d}"]), - ("\u{31}\u{2e}\u{2060}\u{61}\u{2060}", &["\u{31}", "\u{2e}\u{2060}", "\u{61}\u{2060}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{61}\u{2060}", &["\u{31}", "\u{2e}\u{2060}\u{308}", - "\u{61}\u{2060}"]), ("\u{31}\u{2e}\u{2060}\u{61}\u{3a}", &["\u{31}", "\u{2e}\u{2060}", - "\u{61}", "\u{3a}"]), ("\u{31}\u{2e}\u{2060}\u{308}\u{61}\u{3a}", &["\u{31}", - "\u{2e}\u{2060}\u{308}", "\u{61}", "\u{3a}"]), ("\u{31}\u{2e}\u{2060}\u{61}\u{27}", - &["\u{31}", "\u{2e}\u{2060}", "\u{61}", "\u{27}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{61}\u{27}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{61}", - "\u{27}"]), ("\u{31}\u{2e}\u{2060}\u{61}\u{27}\u{2060}", &["\u{31}", "\u{2e}\u{2060}", - "\u{61}", "\u{27}\u{2060}"]), ("\u{31}\u{2e}\u{2060}\u{308}\u{61}\u{27}\u{2060}", - &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{61}", "\u{27}\u{2060}"]), - ("\u{31}\u{2e}\u{2060}\u{61}\u{2c}", &["\u{31}", "\u{2e}\u{2060}", "\u{61}", "\u{2c}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{61}\u{2c}", &["\u{31}", "\u{2e}\u{2060}\u{308}", "\u{61}", - "\u{2c}"]), ("\u{31}\u{2e}\u{2060}\u{31}\u{3a}", &["\u{31}\u{2e}\u{2060}\u{31}", "\u{3a}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{31}\u{3a}", &["\u{31}\u{2e}\u{2060}\u{308}\u{31}", - "\u{3a}"]), ("\u{31}\u{2e}\u{2060}\u{31}\u{27}", &["\u{31}\u{2e}\u{2060}\u{31}", "\u{27}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{31}\u{27}", &["\u{31}\u{2e}\u{2060}\u{308}\u{31}", - "\u{27}"]), ("\u{31}\u{2e}\u{2060}\u{31}\u{2c}", &["\u{31}\u{2e}\u{2060}\u{31}", "\u{2c}"]), - ("\u{31}\u{2e}\u{2060}\u{308}\u{31}\u{2c}", &["\u{31}\u{2e}\u{2060}\u{308}\u{31}", - "\u{2c}"]), ("\u{31}\u{2e}\u{2060}\u{31}\u{2e}\u{2060}", &["\u{31}\u{2e}\u{2060}\u{31}", - "\u{2e}\u{2060}"]), ("\u{31}\u{2e}\u{2060}\u{308}\u{31}\u{2e}\u{2060}", - &["\u{31}\u{2e}\u{2060}\u{308}\u{31}", "\u{2e}\u{2060}"]), ("\u{d}\u{a}\u{61}\u{a}\u{308}", - &["\u{d}\u{a}", "\u{61}", "\u{a}", "\u{308}"]), ("\u{61}\u{308}", &["\u{61}\u{308}"]), - ("\u{20}\u{200d}\u{646}", &["\u{20}\u{200d}", "\u{646}"]), ("\u{646}\u{200d}\u{20}", - &["\u{646}\u{200d}", "\u{20}"]), ("\u{41}\u{41}\u{41}", &["\u{41}\u{41}\u{41}"]), - ("\u{41}\u{3a}\u{41}", &["\u{41}\u{3a}\u{41}"]), ("\u{41}\u{3a}\u{3a}\u{41}", &["\u{41}", - "\u{3a}", "\u{3a}", "\u{41}"]), ("\u{5d0}\u{27}", &["\u{5d0}\u{27}"]), - ("\u{5d0}\u{22}\u{5d0}", &["\u{5d0}\u{22}\u{5d0}"]), ("\u{41}\u{30}\u{30}\u{41}", - &["\u{41}\u{30}\u{30}\u{41}"]), ("\u{30}\u{2c}\u{30}", &["\u{30}\u{2c}\u{30}"]), - ("\u{30}\u{2c}\u{2c}\u{30}", &["\u{30}", "\u{2c}", "\u{2c}", "\u{30}"]), - ("\u{3031}\u{3031}", &["\u{3031}\u{3031}"]), ("\u{41}\u{5f}\u{30}\u{5f}\u{3031}\u{5f}", - &["\u{41}\u{5f}\u{30}\u{5f}\u{3031}\u{5f}"]), ("\u{41}\u{5f}\u{5f}\u{41}", - &["\u{41}\u{5f}\u{5f}\u{41}"]), ("\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{62}", - &["\u{1f1e6}\u{1f1e7}", "\u{1f1e8}", "\u{62}"]), ("\u{61}\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{62}", - &["\u{61}", "\u{1f1e6}\u{1f1e7}", "\u{1f1e8}", "\u{62}"]), - ("\u{61}\u{1f1e6}\u{1f1e7}\u{200d}\u{1f1e8}\u{62}", &["\u{61}", - "\u{1f1e6}\u{1f1e7}\u{200d}", "\u{1f1e8}", "\u{62}"]), - ("\u{61}\u{1f1e6}\u{200d}\u{1f1e7}\u{1f1e8}\u{62}", &["\u{61}", - "\u{1f1e6}\u{200d}\u{1f1e7}", "\u{1f1e8}", "\u{62}"]), - ("\u{61}\u{1f1e6}\u{1f1e7}\u{1f1e8}\u{1f1e9}\u{62}", &["\u{61}", "\u{1f1e6}\u{1f1e7}", - "\u{1f1e8}\u{1f1e9}", "\u{62}"]), ("\u{261d}\u{1f3fb}\u{261d}", &["\u{261d}\u{1f3fb}", - "\u{261d}"]), ("\u{1f466}\u{1f3fb}", &["\u{1f466}\u{1f3fb}"]), - ("\u{200d}\u{1f466}\u{1f3fb}", &["\u{200d}\u{1f466}\u{1f3fb}"]), ("\u{200d}\u{2764}", - &["\u{200d}\u{2764}"]), ("\u{200d}\u{1f466}", &["\u{200d}\u{1f466}"]), - ("\u{1f466}\u{1f466}", &["\u{1f466}", "\u{1f466}"]), ("\u{61}\u{308}\u{200d}\u{308}\u{62}", - &["\u{61}\u{308}\u{200d}\u{308}\u{62}"]), ("\u{31}\u{3a}\u{3a}\u{31}", &["\u{31}", "\u{3a}", - "\u{3a}", "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{3a}\u{3a}\u{31}", &["\u{31}\u{5f}\u{31}", - "\u{3a}", "\u{3a}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{3a}\u{3a}\u{31}", - &["\u{31}\u{5f}\u{61}", "\u{3a}", "\u{3a}", "\u{31}"]), ("\u{31}\u{3a}\u{3a}\u{61}", - &["\u{31}", "\u{3a}", "\u{3a}", "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{3a}\u{3a}\u{61}", - &["\u{31}\u{5f}\u{31}", "\u{3a}", "\u{3a}", "\u{61}"]), - ("\u{31}\u{5f}\u{61}\u{3a}\u{3a}\u{61}", &["\u{31}\u{5f}\u{61}", "\u{3a}", "\u{3a}", - "\u{61}"]), ("\u{31}\u{3a}\u{2e}\u{31}", &["\u{31}", "\u{3a}", "\u{2e}", "\u{31}"]), - ("\u{31}\u{5f}\u{31}\u{3a}\u{2e}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{3a}", "\u{2e}", - "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{3a}\u{2e}\u{31}", &["\u{31}\u{5f}\u{61}", "\u{3a}", - "\u{2e}", "\u{31}"]), ("\u{31}\u{3a}\u{2e}\u{61}", &["\u{31}", "\u{3a}", "\u{2e}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{3a}\u{2e}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{3a}", - "\u{2e}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{3a}\u{2e}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{3a}", "\u{2e}", "\u{61}"]), ("\u{31}\u{3a}\u{2c}\u{31}", &["\u{31}", "\u{3a}", "\u{2c}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{3a}\u{2c}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{3a}", - "\u{2c}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{3a}\u{2c}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{3a}", "\u{2c}", "\u{31}"]), ("\u{31}\u{3a}\u{2c}\u{61}", &["\u{31}", "\u{3a}", "\u{2c}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{3a}\u{2c}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{3a}", - "\u{2c}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{3a}\u{2c}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{3a}", "\u{2c}", "\u{61}"]), ("\u{31}\u{2e}\u{3a}\u{31}", &["\u{31}", "\u{2e}", "\u{3a}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{3a}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{3a}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{3a}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{3a}", "\u{31}"]), ("\u{31}\u{2e}\u{3a}\u{61}", &["\u{31}", "\u{2e}", "\u{3a}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{3a}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{3a}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{3a}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{3a}", "\u{61}"]), ("\u{31}\u{2e}\u{2e}\u{31}", &["\u{31}", "\u{2e}", "\u{2e}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{2e}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{2e}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{2e}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{2e}", "\u{31}"]), ("\u{31}\u{2e}\u{2e}\u{61}", &["\u{31}", "\u{2e}", "\u{2e}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{2e}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{2e}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{2e}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{2e}", "\u{61}"]), ("\u{31}\u{2e}\u{2c}\u{31}", &["\u{31}", "\u{2e}", "\u{2c}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{2c}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{2c}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{2c}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{2c}", "\u{31}"]), ("\u{31}\u{2e}\u{2c}\u{61}", &["\u{31}", "\u{2e}", "\u{2c}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2e}\u{2c}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2e}", - "\u{2c}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2e}\u{2c}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2e}", "\u{2c}", "\u{61}"]), ("\u{31}\u{2c}\u{3a}\u{31}", &["\u{31}", "\u{2c}", "\u{3a}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{3a}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{3a}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{3a}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{3a}", "\u{31}"]), ("\u{31}\u{2c}\u{3a}\u{61}", &["\u{31}", "\u{2c}", "\u{3a}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{3a}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{3a}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{3a}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{3a}", "\u{61}"]), ("\u{31}\u{2c}\u{2e}\u{31}", &["\u{31}", "\u{2c}", "\u{2e}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{2e}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{2e}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{2e}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{2e}", "\u{31}"]), ("\u{31}\u{2c}\u{2e}\u{61}", &["\u{31}", "\u{2c}", "\u{2e}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{2e}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{2e}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{2e}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{2e}", "\u{61}"]), ("\u{31}\u{2c}\u{2c}\u{31}", &["\u{31}", "\u{2c}", "\u{2c}", - "\u{31}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{2c}\u{31}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{2c}", "\u{31}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{2c}\u{31}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{2c}", "\u{31}"]), ("\u{31}\u{2c}\u{2c}\u{61}", &["\u{31}", "\u{2c}", "\u{2c}", - "\u{61}"]), ("\u{31}\u{5f}\u{31}\u{2c}\u{2c}\u{61}", &["\u{31}\u{5f}\u{31}", "\u{2c}", - "\u{2c}", "\u{61}"]), ("\u{31}\u{5f}\u{61}\u{2c}\u{2c}\u{61}", &["\u{31}\u{5f}\u{61}", - "\u{2c}", "\u{2c}", "\u{61}"]), ("\u{61}\u{3a}\u{3a}\u{31}", &["\u{61}", "\u{3a}", "\u{3a}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{3a}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{3a}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{3a}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{3a}", "\u{31}"]), ("\u{61}\u{3a}\u{3a}\u{61}", &["\u{61}", "\u{3a}", "\u{3a}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{3a}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{3a}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{3a}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{3a}", "\u{61}"]), ("\u{61}\u{3a}\u{2e}\u{31}", &["\u{61}", "\u{3a}", "\u{2e}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{2e}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{2e}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{2e}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{2e}", "\u{31}"]), ("\u{61}\u{3a}\u{2e}\u{61}", &["\u{61}", "\u{3a}", "\u{2e}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{2e}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{2e}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{2e}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{2e}", "\u{61}"]), ("\u{61}\u{3a}\u{2c}\u{31}", &["\u{61}", "\u{3a}", "\u{2c}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{2c}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{2c}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{2c}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{2c}", "\u{31}"]), ("\u{61}\u{3a}\u{2c}\u{61}", &["\u{61}", "\u{3a}", "\u{2c}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{3a}\u{2c}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{3a}", - "\u{2c}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{3a}\u{2c}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{3a}", "\u{2c}", "\u{61}"]), ("\u{61}\u{2e}\u{3a}\u{31}", &["\u{61}", "\u{2e}", "\u{3a}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{3a}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{3a}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{3a}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{3a}", "\u{31}"]), ("\u{61}\u{2e}\u{3a}\u{61}", &["\u{61}", "\u{2e}", "\u{3a}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{3a}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{3a}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{3a}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{3a}", "\u{61}"]), ("\u{61}\u{2e}\u{2e}\u{31}", &["\u{61}", "\u{2e}", "\u{2e}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{2e}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{2e}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{2e}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{2e}", "\u{31}"]), ("\u{61}\u{2e}\u{2e}\u{61}", &["\u{61}", "\u{2e}", "\u{2e}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{2e}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{2e}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{2e}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{2e}", "\u{61}"]), ("\u{61}\u{2e}\u{2c}\u{31}", &["\u{61}", "\u{2e}", "\u{2c}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{2c}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{2c}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{2c}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{2c}", "\u{31}"]), ("\u{61}\u{2e}\u{2c}\u{61}", &["\u{61}", "\u{2e}", "\u{2c}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2e}\u{2c}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2e}", - "\u{2c}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2e}\u{2c}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2e}", "\u{2c}", "\u{61}"]), ("\u{61}\u{2c}\u{3a}\u{31}", &["\u{61}", "\u{2c}", "\u{3a}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{3a}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{3a}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{3a}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{3a}", "\u{31}"]), ("\u{61}\u{2c}\u{3a}\u{61}", &["\u{61}", "\u{2c}", "\u{3a}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{3a}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{3a}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{3a}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{3a}", "\u{61}"]), ("\u{61}\u{2c}\u{2e}\u{31}", &["\u{61}", "\u{2c}", "\u{2e}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{2e}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{2e}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{2e}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{2e}", "\u{31}"]), ("\u{61}\u{2c}\u{2e}\u{61}", &["\u{61}", "\u{2c}", "\u{2e}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{2e}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{2e}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{2e}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{2e}", "\u{61}"]), ("\u{61}\u{2c}\u{2c}\u{31}", &["\u{61}", "\u{2c}", "\u{2c}", - "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{2c}\u{31}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{2c}", "\u{31}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{2c}\u{31}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{2c}", "\u{31}"]), ("\u{61}\u{2c}\u{2c}\u{61}", &["\u{61}", "\u{2c}", "\u{2c}", - "\u{61}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{2c}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2c}", - "\u{2c}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{2c}\u{61}", &["\u{61}\u{5f}\u{61}", - "\u{2c}", "\u{2c}", "\u{61}"]) - ]; - diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/test.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/test.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/test.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/test.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use super::UnicodeSegmentation; - -use std::prelude::v1::*; - -#[test] -fn test_graphemes() { - use testdata::{TEST_SAME, TEST_DIFF}; - - pub const EXTRA_DIFF: &'static [(&'static str, - &'static [&'static str], - &'static [&'static str])] = &[ - // Official test suite doesn't include two Prepend chars between two other chars. - ("\u{20}\u{600}\u{600}\u{20}", - &["\u{20}", "\u{600}\u{600}\u{20}"], - &["\u{20}", "\u{600}", "\u{600}", "\u{20}"]), - - // Test for Prepend followed by two Any chars - ("\u{600}\u{20}\u{20}", - &["\u{600}\u{20}", "\u{20}"], - &["\u{600}", "\u{20}", "\u{20}"]), - ]; - - pub const EXTRA_SAME: &'static [(&'static str, &'static [&'static str])] = &[ - // family emoji (more than two emoji joined by ZWJ) - ("\u{1f468}\u{200d}\u{1f467}\u{200d}\u{1f466}", - &["\u{1f468}\u{200d}\u{1f467}\u{200d}\u{1f466}"]), - // cartwheel emoji followed by two fitzpatrick skin tone modifiers - // (test case from issue #19) - ("\u{1F938}\u{1F3FE}\u{1F3FE}", - &["\u{1F938}\u{1F3FE}", "\u{1F3FE}"]), - ]; - - for &(s, g) in TEST_SAME.iter().chain(EXTRA_SAME) { - // test forward iterator - assert!(UnicodeSegmentation::graphemes(s, true).eq(g.iter().cloned())); - assert!(UnicodeSegmentation::graphemes(s, false).eq(g.iter().cloned())); - - // test reverse iterator - assert!(UnicodeSegmentation::graphemes(s, true).rev().eq(g.iter().rev().cloned())); - assert!(UnicodeSegmentation::graphemes(s, false).rev().eq(g.iter().rev().cloned())); - } - - for &(s, gt, gf) in TEST_DIFF.iter().chain(EXTRA_DIFF) { - // test forward iterator - assert!(UnicodeSegmentation::graphemes(s, true).eq(gt.iter().cloned())); - assert!(UnicodeSegmentation::graphemes(s, false).eq(gf.iter().cloned())); - - // test reverse iterator - assert!(UnicodeSegmentation::graphemes(s, true).rev().eq(gt.iter().rev().cloned())); - assert!(UnicodeSegmentation::graphemes(s, false).rev().eq(gf.iter().rev().cloned())); - } - - // test the indices iterators - let s = "a̐éö̲\r\n"; - let gr_inds = UnicodeSegmentation::grapheme_indices(s, true).collect::>(); - let b: &[_] = &[(0, "a̐"), (3, "é"), (6, "ö̲"), (11, "\r\n")]; - assert_eq!(gr_inds, b); - let gr_inds = UnicodeSegmentation::grapheme_indices(s, true).rev().collect::>(); - let b: &[_] = &[(11, "\r\n"), (6, "ö̲"), (3, "é"), (0, "a̐")]; - assert_eq!(gr_inds, b); - let mut gr_inds_iter = UnicodeSegmentation::grapheme_indices(s, true); - { - let gr_inds = gr_inds_iter.by_ref(); - let e1 = gr_inds.size_hint(); - assert_eq!(e1, (1, Some(13))); - let c = gr_inds.count(); - assert_eq!(c, 4); - } - let e2 = gr_inds_iter.size_hint(); - assert_eq!(e2, (0, Some(0))); - - // make sure the reverse iterator does the right thing with "\n" at beginning of string - let s = "\n\r\n\r"; - let gr = UnicodeSegmentation::graphemes(s, true).rev().collect::>(); - let b: &[_] = &["\r", "\r\n", "\n"]; - assert_eq!(gr, b); -} - -#[test] -fn test_words() { - use testdata::TEST_WORD; - - // Unicode's official tests don't really test longer chains of flag emoji - // TODO This could be improved with more tests like flag emoji with interspersed Extend chars and ZWJ - const EXTRA_TESTS: &'static [(&'static str, &'static [&'static str])] = &[ - ("🇦🇫🇦🇽🇦🇱🇩🇿🇦🇸🇦🇩🇦🇴", &["🇦🇫", "🇦🇽", "🇦🇱", "🇩🇿", "🇦🇸", "🇦🇩", "🇦🇴"]), - ("🇦🇫🇦🇽🇦🇱🇩🇿🇦🇸🇦🇩🇦", &["🇦🇫", "🇦🇽", "🇦🇱", "🇩🇿", "🇦🇸", "🇦🇩", "🇦"]), - ("🇦a🇫🇦🇽a🇦🇱🇩🇿🇦🇸🇦🇩🇦", &["🇦", "a", "🇫🇦", "🇽", "a", "🇦🇱", "🇩🇿", "🇦🇸", "🇦🇩", "🇦"]), - ("\u{1f468}\u{200d}\u{1f468}\u{200d}\u{1f466}", &["\u{1f468}\u{200d}\u{1f468}\u{200d}\u{1f466}"]), - ("😌👎🏼", &["😌", "👎🏼"]), - // perhaps wrong, spaces should not be included? - ("hello world", &["hello", " ", "world"]), - ("🇨🇦🇨🇭🇿🇲🇿 hi", &["🇨🇦", "🇨🇭", "🇿🇲", "🇿", " ", "hi"]), - ]; - for &(s, w) in TEST_WORD.iter().chain(EXTRA_TESTS.iter()) { - macro_rules! assert_ { - ($test:expr, $exp:expr, $name:expr) => { - // collect into vector for better diagnostics in failure case - let testing = $test.collect::>(); - let expected = $exp.collect::>(); - assert_eq!(testing, expected, "{} test for testcase ({:?}, {:?}) failed.", $name, s, w) - } - } - // test forward iterator - assert_!(s.split_word_bounds(), - w.iter().cloned(), - "Forward word boundaries"); - - // test reverse iterator - assert_!(s.split_word_bounds().rev(), - w.iter().rev().cloned(), - "Reverse word boundaries"); - - // generate offsets from word string lengths - let mut indices = vec![0]; - for i in w.iter().cloned().map(|s| s.len()).scan(0, |t, n| { *t += n; Some(*t) }) { - indices.push(i); - } - indices.pop(); - let indices = indices; - - // test forward indices iterator - assert_!(s.split_word_bound_indices().map(|(l,_)| l), - indices.iter().cloned(), - "Forward word indices"); - - // test backward indices iterator - assert_!(s.split_word_bound_indices().rev().map(|(l,_)| l), - indices.iter().rev().cloned(), - "Reverse word indices"); - } -} - -quickcheck! { - fn quickcheck_forward_reverse_graphemes_extended(s: String) -> bool { - let a = s.graphemes(true).collect::>(); - let mut b = s.graphemes(true).rev().collect::>(); - b.reverse(); - a == b - } - - fn quickcheck_forward_reverse_graphemes_legacy(s: String) -> bool { - let a = s.graphemes(false).collect::>(); - let mut b = s.graphemes(false).rev().collect::>(); - b.reverse(); - a == b - } - - fn quickcheck_join_graphemes(s: String) -> bool { - let a = s.graphemes(true).collect::(); - let b = s.graphemes(false).collect::(); - a == s && b == s - } - - fn quickcheck_forward_reverse_words(s: String) -> bool { - let a = s.split_word_bounds().collect::>(); - let mut b = s.split_word_bounds().rev().collect::>(); - b.reverse(); - a == b - } - - fn quickcheck_join_words(s: String) -> bool { - let a = s.split_word_bounds().collect::(); - a == s - } -} diff -Nru distinst-0.1.0/vendor/unicode-segmentation/src/word.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/word.rs --- distinst-0.1.0/vendor/unicode-segmentation/src/word.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/src/word.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,649 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use core::cmp; -use core::iter::Filter; - -use tables::word::WordCat; - -/// An iterator over the substrings of a string which, after splitting the string on -/// [word boundaries](http://www.unicode.org/reports/tr29/#Word_Boundaries), -/// contain any characters with the -/// [Alphabetic](http://unicode.org/reports/tr44/#Alphabetic) -/// property, or with -/// [General_Category=Number](http://unicode.org/reports/tr44/#General_Category_Values). -pub struct UnicodeWords<'a> { - inner: Filter, fn(&&str) -> bool>, -} - -impl<'a> Iterator for UnicodeWords<'a> { - type Item = &'a str; - - #[inline] - fn next(&mut self) -> Option<&'a str> { self.inner.next() } -} -impl<'a> DoubleEndedIterator for UnicodeWords<'a> { - #[inline] - fn next_back(&mut self) -> Option<&'a str> { self.inner.next_back() } -} - -/// External iterator for a string's -/// [word boundaries](http://www.unicode.org/reports/tr29/#Word_Boundaries). -#[derive(Clone)] -pub struct UWordBounds<'a> { - string: &'a str, - cat: Option, - catb: Option, -} - -/// External iterator for word boundaries and byte offsets. -#[derive(Clone)] -pub struct UWordBoundIndices<'a> { - start_offset: usize, - iter: UWordBounds<'a>, -} - -impl<'a> UWordBoundIndices<'a> { - #[inline] - /// View the underlying data (the part yet to be iterated) as a slice of the original string. - /// - /// ```rust - /// # use unicode_segmentation::UnicodeSegmentation; - /// let mut iter = "Hello world".split_word_bound_indices(); - /// assert_eq!(iter.as_str(), "Hello world"); - /// iter.next(); - /// assert_eq!(iter.as_str(), " world"); - /// iter.next(); - /// assert_eq!(iter.as_str(), "world"); - /// ``` - pub fn as_str(&self) -> &'a str { - self.iter.as_str() - } -} - -impl<'a> Iterator for UWordBoundIndices<'a> { - type Item = (usize, &'a str); - - #[inline] - fn next(&mut self) -> Option<(usize, &'a str)> { - self.iter.next().map(|s| (s.as_ptr() as usize - self.start_offset, s)) - } - - #[inline] - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -impl<'a> DoubleEndedIterator for UWordBoundIndices<'a> { - #[inline] - fn next_back(&mut self) -> Option<(usize, &'a str)> { - self.iter.next_back().map(|s| (s.as_ptr() as usize - self.start_offset, s)) - } -} - -// state machine for word boundary rules -#[derive(Clone,Copy,PartialEq,Eq,Debug)] -enum UWordBoundsState { - Start, - Letter, - HLetter, - Numeric, - Katakana, - ExtendNumLet, - Regional(RegionalState), - FormatExtend(FormatExtendType), - Zwj, - Emoji, -} - -// subtypes for FormatExtend state in UWordBoundsState -#[derive(Clone,Copy,PartialEq,Eq,Debug)] -enum FormatExtendType { - AcceptAny, - AcceptNone, - RequireLetter, - RequireHLetter, - AcceptQLetter, - RequireNumeric, -} - -#[derive(Clone,Copy,PartialEq,Eq,Debug)] -enum RegionalState { - Half, - Full, - Unknown, -} - -impl<'a> Iterator for UWordBounds<'a> { - type Item = &'a str; - - #[inline] - fn size_hint(&self) -> (usize, Option) { - let slen = self.string.len(); - (cmp::min(slen, 1), Some(slen)) - } - - #[inline] - fn next(&mut self) -> Option<&'a str> { - use self::UWordBoundsState::*; - use self::FormatExtendType::*; - use tables::word as wd; - if self.string.len() == 0 { - return None; - } - - let mut take_curr = true; - let mut take_cat = true; - let mut idx = 0; - let mut saveidx = 0; - let mut state = Start; - let mut cat = wd::WC_Any; - let mut savecat = wd::WC_Any; - - // Whether or not the previous category was ZWJ - // ZWJs get collapsed, so this handles precedence of WB3c over WB4 - let mut prev_zwj; - for (curr, ch) in self.string.char_indices() { - idx = curr; - prev_zwj = cat == wd::WC_ZWJ; - // if there's a category cached, grab it - cat = match self.cat { - None => wd::word_category(ch), - _ => self.cat.take().unwrap() - }; - take_cat = true; - - // handle rule WB4 - // just skip all format, extend, and zwj chars - // note that Start is a special case: if there's a bunch of Format | Extend - // characters at the beginning of a block of text, dump them out as one unit. - // - // (This is not obvious from the wording of UAX#29, but if you look at the - // test cases http://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakTest.txt - // then the "correct" interpretation of WB4 becomes apparent.) - if state != Start { - match cat { - wd::WC_Extend | wd::WC_Format | wd::WC_ZWJ => { - continue - } - _ => {} - } - } - - // rule WB3c - // WB4 makes all ZWJs collapse into the previous state - // but you can still be in a Zwj state if you started with Zwj - // - // This means that Zwj + Extend will collapse into Zwj, which is wrong, - // since Extend has a boundary with following EBG/GAZ chars but ZWJ doesn't, - // and that rule (WB3c) has higher priority - // - // Additionally, Emoji_Base+ZWJ+(EBG/GAZ) will collapse into Emoji_Base+EBG/GAZ - // which won't have a boundary even though EB+ZWJ+GAZ should have a boundary. - // - // Thus, we separately keep track of whether or not the last character - // was a ZWJ. This is an additional bit of state tracked outside of the - // state enum; the state enum represents the last non-zwj state encountered. - // When prev_zwj is true, for the purposes of WB3c, we are in the Zwj state, - // however we are in the previous state for the purposes of all other rules. - if prev_zwj { - match cat { - wd::WC_Glue_After_Zwj => continue, - wd::WC_E_Base_GAZ => { - state = Emoji; - continue; - }, - _ => () - } - } - // Don't use `continue` in this match without updating `cat` - state = match state { - Start if cat == wd::WC_CR => { - idx += match self.get_next_cat(idx) { - Some(ncat) if ncat == wd::WC_LF => 1, // rule WB3 - _ => 0 - }; - break; // rule WB3a - }, - Start => match cat { - wd::WC_ALetter => Letter, // rule WB5, WB6, WB9, WB13a - wd::WC_Hebrew_Letter => HLetter, // rule WB5, WB6, WB7a, WB7b, WB9, WB13a - wd::WC_Numeric => Numeric, // rule WB8, WB10, WB12, WB13a - wd::WC_Katakana => Katakana, // rule WB13, WB13a - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a, WB13b - wd::WC_Regional_Indicator => Regional(RegionalState::Half), // rule WB13c - wd::WC_LF | wd::WC_Newline => break, // rule WB3a - wd::WC_ZWJ => Zwj, // rule WB3c - wd::WC_E_Base | wd::WC_E_Base_GAZ => Emoji, // rule WB14 - _ => { - if let Some(ncat) = self.get_next_cat(idx) { // rule WB4 - if ncat == wd::WC_Format || ncat == wd::WC_Extend || ncat == wd::WC_ZWJ { - state = FormatExtend(AcceptNone); - self.cat = Some(ncat); - continue; - } - } - break; // rule WB999 - } - }, - Zwj => { - // We already handle WB3c above. At this point, - // the current category is not GAZ or EBG, - // or the previous character was not actually a ZWJ - take_curr = false; - break; - } - Letter | HLetter => match cat { - wd::WC_ALetter => Letter, // rule WB5 - wd::WC_Hebrew_Letter => HLetter, // rule WB5 - wd::WC_Numeric => Numeric, // rule WB9 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - wd::WC_Double_Quote if state == HLetter => { - savecat = cat; - saveidx = idx; - FormatExtend(RequireHLetter) // rule WB7b - }, - wd::WC_Single_Quote if state == HLetter => { - FormatExtend(AcceptQLetter) // rule WB7a - }, - wd::WC_MidLetter | wd::WC_MidNumLet | wd::WC_Single_Quote => { - savecat = cat; - saveidx = idx; - FormatExtend(RequireLetter) // rule WB6 - }, - _ => { - take_curr = false; - break; - } - }, - Numeric => match cat { - wd::WC_Numeric => Numeric, // rule WB8 - wd::WC_ALetter => Letter, // rule WB10 - wd::WC_Hebrew_Letter => HLetter, // rule WB10 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - wd::WC_MidNum | wd::WC_MidNumLet | wd::WC_Single_Quote => { - savecat = cat; - saveidx = idx; - FormatExtend(RequireNumeric) // rule WB12 - }, - _ => { - take_curr = false; - break; - } - }, - Katakana => match cat { - wd::WC_Katakana => Katakana, // rule WB13 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - _ => { - take_curr = false; - break; - } - }, - ExtendNumLet => match cat { - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - wd::WC_ALetter => Letter, // rule WB13b - wd::WC_Hebrew_Letter => HLetter, // rule WB13b - wd::WC_Numeric => Numeric, // rule WB13b - wd::WC_Katakana => Katakana, // rule WB13b - _ => { - take_curr = false; - break; - } - }, - Regional(RegionalState::Full) => { - // if it reaches here we've gone too far, - // a full flag can only compose with ZWJ/Extend/Format - // proceeding it. - take_curr = false; - break; - } - Regional(RegionalState::Half) => match cat { - wd::WC_Regional_Indicator => Regional(RegionalState::Full), // rule WB13c - _ => { - take_curr = false; - break; - } - }, - Regional(_) => unreachable!("RegionalState::Unknown should not occur on forward iteration"), - Emoji => match cat { // rule WB14 - wd::WC_E_Modifier => state, - _ => { - take_curr = false; - break; - } - }, - FormatExtend(t) => match t { // handle FormatExtends depending on what type - RequireNumeric if cat == wd::WC_Numeric => Numeric, // rule WB11 - RequireLetter | AcceptQLetter if cat == wd::WC_ALetter => Letter, // rule WB7 - RequireLetter | AcceptQLetter if cat == wd::WC_Hebrew_Letter => HLetter, // WB7a - RequireHLetter if cat == wd::WC_Hebrew_Letter => HLetter, // rule WB7b - AcceptNone | AcceptQLetter => { - take_curr = false; // emit all the Format|Extend characters - take_cat = false; - break; - }, - _ => break // rewind (in if statement below) - } - } - } - - if let FormatExtend(t) = state { - // we were looking for something and didn't find it; we have to back up - if t == RequireLetter || t == RequireHLetter || t == RequireNumeric { - idx = saveidx; - cat = savecat; - take_curr = false; - } - } - - self.cat = if take_curr { - idx = idx + self.string[idx..].chars().next().unwrap().len_utf8(); - None - } else if take_cat { - Some(cat) - } else { - None - }; - - let retstr = &self.string[..idx]; - self.string = &self.string[idx..]; - Some(retstr) - } -} - -impl<'a> DoubleEndedIterator for UWordBounds<'a> { - #[inline] - fn next_back(&mut self) -> Option<&'a str> { - use self::UWordBoundsState::*; - use self::FormatExtendType::*; - use tables::word as wd; - if self.string.len() == 0 { - return None; - } - - let mut take_curr = true; - let mut take_cat = true; - let mut idx = self.string.len(); - idx -= self.string.chars().next_back().unwrap().len_utf8(); - let mut previdx = idx; - let mut saveidx = idx; - let mut state = Start; - let mut savestate = Start; - let mut cat = wd::WC_Any; - - for (curr, ch) in self.string.char_indices().rev() { - previdx = idx; - idx = curr; - - // if there's a category cached, grab it - cat = match self.catb { - None => wd::word_category(ch), - _ => self.catb.take().unwrap() - }; - take_cat = true; - - // backward iterator over word boundaries. Mostly the same as the forward - // iterator, with two weirdnesses: - // (1) If we encounter a single quote in the Start state, we have to check for a - // Hebrew Letter immediately before it. - // (2) Format and Extend char handling takes some gymnastics. - - if cat == wd::WC_Extend - || cat == wd::WC_Format - || (cat == wd::WC_ZWJ && state != Zwj) { // WB3c has more priority so we should not - // fold in that case - if match state { - FormatExtend(_) | Start => false, - _ => true - } { - saveidx = previdx; - savestate = state; - state = FormatExtend(AcceptNone); - } - - if state != Start { - continue; - } - } else if state == FormatExtend(AcceptNone) { - // finished a scan of some Format|Extend chars, restore previous state - state = savestate; - previdx = saveidx; - take_cat = false; - } - - // Don't use `continue` in this match without updating `catb` - state = match state { - Start | FormatExtend(AcceptAny) => match cat { - wd::WC_ALetter => Letter, // rule WB5, WB7, WB10, WB13b - wd::WC_Hebrew_Letter => HLetter, // rule WB5, WB7, WB7c, WB10, WB13b - wd::WC_Numeric => Numeric, // rule WB8, WB9, WB11, WB13b - wd::WC_Katakana => Katakana, // rule WB13, WB13b - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - wd::WC_Regional_Indicator => Regional(RegionalState::Unknown), // rule WB13c - wd::WC_Glue_After_Zwj | wd::WC_E_Base_GAZ => Zwj, // rule WB3c - // rule WB4: - wd::WC_Extend | wd::WC_Format | wd::WC_ZWJ => FormatExtend(AcceptAny), - wd::WC_Single_Quote => { - saveidx = idx; - FormatExtend(AcceptQLetter) // rule WB7a - }, - wd::WC_E_Modifier => Emoji, // rule WB14 - wd::WC_CR | wd::WC_LF | wd::WC_Newline => { - if state == Start { - if cat == wd::WC_LF { - idx -= match self.get_prev_cat(idx) { - Some(pcat) if pcat == wd::WC_CR => 1, // rule WB3 - _ => 0 - }; - } - } else { - take_curr = false; - } - break; // rule WB3a - }, - _ => break // rule WB999 - }, - Zwj => match cat { // rule WB3c - wd::WC_ZWJ => { - FormatExtend(AcceptAny) - } - _ => { - take_curr = false; - break; - } - }, - Letter | HLetter => match cat { - wd::WC_ALetter => Letter, // rule WB5 - wd::WC_Hebrew_Letter => HLetter, // rule WB5 - wd::WC_Numeric => Numeric, // rule WB10 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13b - wd::WC_Double_Quote if state == HLetter => { - saveidx = previdx; - FormatExtend(RequireHLetter) // rule WB7c - }, - wd::WC_MidLetter | wd::WC_MidNumLet | wd::WC_Single_Quote => { - saveidx = previdx; - FormatExtend(RequireLetter) // rule WB7 - }, - _ => { - take_curr = false; - break; - } - }, - Numeric => match cat { - wd::WC_Numeric => Numeric, // rule WB8 - wd::WC_ALetter => Letter, // rule WB9 - wd::WC_Hebrew_Letter => HLetter, // rule WB9 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13b - wd::WC_MidNum | wd::WC_MidNumLet | wd::WC_Single_Quote => { - saveidx = previdx; - FormatExtend(RequireNumeric) // rule WB11 - }, - _ => { - take_curr = false; - break; - } - }, - Katakana => match cat { - wd::WC_Katakana => Katakana, // rule WB13 - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13b - _ => { - take_curr = false; - break; - } - }, - ExtendNumLet => match cat { - wd::WC_ExtendNumLet => ExtendNumLet, // rule WB13a - wd::WC_ALetter => Letter, // rule WB13a - wd::WC_Hebrew_Letter => HLetter, // rule WB13a - wd::WC_Numeric => Numeric, // rule WB13a - wd::WC_Katakana => Katakana, // rule WB13a - _ => { - take_curr = false; - break; - } - }, - Regional(mut regional_state) => match cat { - // rule WB13c - wd::WC_Regional_Indicator => { - if regional_state == RegionalState::Unknown { - let count = self.string[..previdx] - .chars().rev() - .map(|c| wd::word_category(c)) - .filter(|&c| ! (c == wd::WC_ZWJ || c == wd::WC_Extend || c == wd::WC_Format)) - .take_while(|&c| c == wd::WC_Regional_Indicator) - .count(); - regional_state = if count % 2 == 0 { - RegionalState::Full - } else { - RegionalState::Half - }; - } - if regional_state == RegionalState::Full { - take_curr = false; - break; - } else { - Regional(RegionalState::Full) - } - } - _ => { - take_curr = false; - break; - } - }, - Emoji => match cat { // rule WB14 - wd::WC_E_Base | wd::WC_E_Base_GAZ => { - Zwj - }, - _ => { - take_curr = false; - break; - } - }, - FormatExtend(t) => match t { - RequireNumeric if cat == wd::WC_Numeric => Numeric, // rule WB12 - RequireLetter if cat == wd::WC_ALetter => Letter, // rule WB6 - RequireLetter if cat == wd::WC_Hebrew_Letter => HLetter, // rule WB6 - AcceptQLetter if cat == wd::WC_Hebrew_Letter => HLetter, // rule WB7a - RequireHLetter if cat == wd::WC_Hebrew_Letter => HLetter, // rule WB7b - _ => break // backtrack will happens - } - } - } - - if let FormatExtend(t) = state { - // if we required something but didn't find it, backtrack - if t == RequireLetter || t == RequireHLetter || - t == RequireNumeric || t == AcceptNone || t == AcceptQLetter { - previdx = saveidx; - take_cat = false; - take_curr = false; - } - } - - self.catb = if take_curr { - None - } else { - idx = previdx; - if take_cat { - Some(cat) - } else { - None - } - }; - - let retstr = &self.string[idx..]; - self.string = &self.string[..idx]; - Some(retstr) - } -} - -impl<'a> UWordBounds<'a> { - #[inline] - /// View the underlying data (the part yet to be iterated) as a slice of the original string. - /// - /// ```rust - /// # use unicode_segmentation::UnicodeSegmentation; - /// let mut iter = "Hello world".split_word_bounds(); - /// assert_eq!(iter.as_str(), "Hello world"); - /// iter.next(); - /// assert_eq!(iter.as_str(), " world"); - /// iter.next(); - /// assert_eq!(iter.as_str(), "world"); - /// ``` - pub fn as_str(&self) -> &'a str { - self.string - } - - #[inline] - fn get_next_cat(&self, idx: usize) -> Option { - use tables::word as wd; - let nidx = idx + self.string[idx..].chars().next().unwrap().len_utf8(); - if nidx < self.string.len() { - let nch = self.string[nidx..].chars().next().unwrap(); - Some(wd::word_category(nch)) - } else { - None - } - } - - #[inline] - fn get_prev_cat(&self, idx: usize) -> Option { - use tables::word as wd; - if idx > 0 { - let nch = self.string[..idx].chars().next_back().unwrap(); - Some(wd::word_category(nch)) - } else { - None - } - } -} - -#[inline] -pub fn new_word_bounds<'b>(s: &'b str) -> UWordBounds<'b> { - UWordBounds { string: s, cat: None, catb: None } -} - -#[inline] -pub fn new_word_bound_indices<'b>(s: &'b str) -> UWordBoundIndices<'b> { - UWordBoundIndices { start_offset: s.as_ptr() as usize, iter: new_word_bounds(s) } -} - -#[inline] -pub fn new_unicode_words<'b>(s: &'b str) -> UnicodeWords<'b> { - use super::UnicodeSegmentation; - use tables::util::is_alphanumeric; - - fn has_alphanumeric(s: &&str) -> bool { s.chars().any(|c| is_alphanumeric(c)) } - let has_alphanumeric: fn(&&str) -> bool = has_alphanumeric; // coerce to fn pointer - - UnicodeWords { inner: s.split_word_bounds().filter(has_alphanumeric) } -} diff -Nru distinst-0.1.0/vendor/unicode-segmentation/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/.travis.yml --- distinst-0.1.0/vendor/unicode-segmentation/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-segmentation/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -language: rust -rust: stable -os: linux -script: - - cargo build --verbose - - cargo test --verbose - - rustdoc --test README.md -L target/debug -L target/debug/deps - - cargo doc -after_success: | - [ $TRAVIS_BRANCH = master ] && - [ $TRAVIS_PULL_REQUEST = false ] && - echo '' > target/doc/index.html && - pip install ghp-import --user && - $HOME/.local/bin/ghp-import -n target/doc && - git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages -env: - global: - secure: d3xB8MAHhj88le5WjaDmIsharVeZ+eDIbQtuPEkg5VjIsD+ZOc9ZY/y1Nrz3q8Xh3ytjYv78IWmxwn8UsRhimCZbgR4V4xkz8hSgIGn9dFbOvIpbeg6Tfvu2UO2YUOcNc/WtI/uymaMuZ2g8Fcg7K2ITEO2lXAcOFRpnBh2dXmA= -notifications: - email: - on_success: never diff -Nru distinst-0.1.0/vendor/unicode-width/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-width/.cargo-checksum.json --- distinst-0.1.0/vendor/unicode-width/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-width/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"943c3673d6a8d9ff561c0e2a8f07e3dd2317905c1ed1bbacf3fb550ee71c77d9","COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"82b0ec86c17e2523fdf7134dc5e4d50244f22776f2efb62543814014e51e7df4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"602d72a5273b1ff9edb4d5cb20db219e57a44c53a9cb19b2f6866b1c3e68ad60","scripts/unicode.py":"ba4b17f8715364e2a06e28f26c46a840757891716a835fce1663370c774dc570","src/lib.rs":"a9dafae4878a1f235ec33d773226db2cb6124ca8e9e0c4aee8ab50bc89515a65","src/tables.rs":"ae4ab8e047368ad9473ca20e76cda0e680bdb6334bc118697319b280e843d80b","src/tests.rs":"b8ca0b224a70f0c12ae5f533c25f8ee1c6a445a6e615d64027f486b8e100f7f2"},"package":"bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"} \ No newline at end of file +{"files":{".travis.yml":"943c3673d6a8d9ff561c0e2a8f07e3dd2317905c1ed1bbacf3fb550ee71c77d9","COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"82b0ec86c17e2523fdf7134dc5e4d50244f22776f2efb62543814014e51e7df4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"602d72a5273b1ff9edb4d5cb20db219e57a44c53a9cb19b2f6866b1c3e68ad60","scripts/unicode.py":"ba4b17f8715364e2a06e28f26c46a840757891716a835fce1663370c774dc570","src/lib.rs":"a9dafae4878a1f235ec33d773226db2cb6124ca8e9e0c4aee8ab50bc89515a65","src/tables.rs":"ae4ab8e047368ad9473ca20e76cda0e680bdb6334bc118697319b280e843d80b","src/tests.rs":"b8ca0b224a70f0c12ae5f533c25f8ee1c6a445a6e615d64027f486b8e100f7f2"},"package":"bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/unicode-xid/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-xid/.cargo-checksum.json --- distinst-0.1.0/vendor/unicode-xid/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unicode-xid/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"f3e106aaaa534eb9090f1213ff5d0c7f9861ede7f1c973d9e0e13b4a84cb7791","COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"1be08526c07c40136071faf603a382456ad1a6bafbb45d9ace01c52b50a9a55c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"67998486b32f4fe46abbbaa411b92528750e7f0e22452dc8a5b95d87d80fde75","scripts/unicode.py":"762eea92dd51238c6bf877570bde1149932ba15cf87be1618fc21cd53e941733","src/lib.rs":"4a89fadf452ae7c53536eaa4496f951a3153f8189dd1cbc532648731d30f0b11","src/tables.rs":"0643459b6ebeeed83aecd7604f0ea29c06bea7ce6c1cd9acd4988d27ace1ec53","src/tests.rs":"35a459382e190197e7b9a78832ae79f310b48a02a5b4227bf9bbc89d46c8deac"},"package":"8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"} \ No newline at end of file +{"files":{".travis.yml":"f3e106aaaa534eb9090f1213ff5d0c7f9861ede7f1c973d9e0e13b4a84cb7791","COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"1be08526c07c40136071faf603a382456ad1a6bafbb45d9ace01c52b50a9a55c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"67998486b32f4fe46abbbaa411b92528750e7f0e22452dc8a5b95d87d80fde75","scripts/unicode.py":"762eea92dd51238c6bf877570bde1149932ba15cf87be1618fc21cd53e941733","src/lib.rs":"4a89fadf452ae7c53536eaa4496f951a3153f8189dd1cbc532648731d30f0b11","src/tables.rs":"0643459b6ebeeed83aecd7604f0ea29c06bea7ce6c1cd9acd4988d27ace1ec53","src/tests.rs":"35a459382e190197e7b9a78832ae79f310b48a02a5b4227bf9bbc89d46c8deac"},"package":"8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/unix_socket/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/.cargo-checksum.json --- distinst-0.1.0/vendor/unix_socket/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"e6fd9818745bd70a6636ef51f6fa0fa8a35b1c3a3ebc47aa2fdd2f9300eb8169","Cargo.toml":"4797f544ab47bb0d0095100547b81f931c9f3802c4770924c7207b23840864cc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"9a6e9bd4ddad6dd80f8d6304cd071182dc3e9a31e4b4a2ec0d91a791f36b4fab","README.md":"dbe7aafbed574e8aa813efa660f49c349518e3016ec84138ea6168d7e9ed5cf1","src/lib.rs":"dc5f9a1351f1f2d271998830fbaf3230b6ba595b0055a18946c4efee63895baf"},"package":"6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/unix_socket/Cargo.toml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/Cargo.toml --- distinst-0.1.0/vendor/unix_socket/Cargo.toml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -[package] -name = "unix_socket" -version = "0.5.0" -authors = ["Steven Fackler "] -license = "MIT/Apache-2.0" -description = "Unix domain socket bindings" -repository = "https://github.com/rust-lang-nursery/unix-socket" -documentation = "https://doc.rust-lang.org/unix-socket/doc/v0.5.0/unix_socket" -readme = "README.md" -keywords = ["posix", "unix", "socket", "domain"] - -[dependencies] -libc = "0.2.1" -cfg-if = "0.1" - -[dev-dependencies] -tempdir = "0.3" diff -Nru distinst-0.1.0/vendor/unix_socket/LICENSE-APACHE distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/LICENSE-APACHE --- distinst-0.1.0/vendor/unix_socket/LICENSE-APACHE 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff -Nru distinst-0.1.0/vendor/unix_socket/LICENSE-MIT distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/LICENSE-MIT --- distinst-0.1.0/vendor/unix_socket/LICENSE-MIT 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Steven Fackler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff -Nru distinst-0.1.0/vendor/unix_socket/README.md distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/README.md --- distinst-0.1.0/vendor/unix_socket/README.md 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# unix-socket - -[![Build Status](https://travis-ci.org/rust-lang-nursery/unix-socket.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/unix-socket) [![Latest Version](https://img.shields.io/crates/v/unix_socket.svg)](https://crates.io/crates/unix_socket) - -Support for Unix domain socket clients and servers. - -[Documentation](https://doc.rust-lang.org/unix-socket/doc/v0.4.6/unix_socket) diff -Nru distinst-0.1.0/vendor/unix_socket/src/lib.rs distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/src/lib.rs --- distinst-0.1.0/vendor/unix_socket/src/lib.rs 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/src/lib.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,1242 +0,0 @@ -//! Support for Unix domain socket clients and servers. -#![warn(missing_docs)] -#![doc(html_root_url="https://doc.rust-lang.org/unix-socket/doc/v0.5.0")] - -#[macro_use] -extern crate cfg_if; -extern crate libc; - -use std::ascii; -use std::cmp::Ordering; -use std::convert::AsRef; -use std::ffi::OsStr; -use std::fmt; -use std::io; -use std::iter::IntoIterator; -use std::mem; -use std::mem::size_of; -use std::net::Shutdown; -use std::os::unix::ffi::OsStrExt; -use std::os::unix::io::{RawFd, AsRawFd, FromRawFd, IntoRawFd}; -use std::path::Path; -use std::time::Duration; - -fn sun_path_offset() -> usize { - unsafe { - // Work with an actual instance of the type since using a null pointer is UB - let addr: libc::sockaddr_un = mem::uninitialized(); - let base = &addr as *const _ as usize; - let path = &addr.sun_path as *const _ as usize; - path - base - } -} - -fn cvt(v: libc::c_int) -> io::Result { - if v < 0 { - Err(io::Error::last_os_error()) - } else { - Ok(v) - } -} - -fn cvt_s(v: libc::ssize_t) -> io::Result { - if v < 0 { - Err(io::Error::last_os_error()) - } else { - Ok(v) - } -} - -struct Inner(RawFd); - -impl Drop for Inner { - fn drop(&mut self) { - unsafe { - libc::close(self.0); - } - } -} - -impl Inner { - fn new(kind: libc::c_int) -> io::Result { - unsafe { cvt(libc::socket(libc::AF_UNIX, kind, 0)).map(Inner) } - } - - fn new_pair(kind: libc::c_int) -> io::Result<(Inner, Inner)> { - unsafe { - let mut fds = [0, 0]; - try!(cvt(libc::socketpair(libc::AF_UNIX, kind, 0, fds.as_mut_ptr()))); - Ok((Inner(fds[0]), Inner(fds[1]))) - } - } - - fn try_clone(&self) -> io::Result { - unsafe { cvt(libc::dup(self.0)).map(Inner) } - } - - fn shutdown(&self, how: Shutdown) -> io::Result<()> { - let how = match how { - Shutdown::Read => libc::SHUT_RD, - Shutdown::Write => libc::SHUT_WR, - Shutdown::Both => libc::SHUT_RDWR, - }; - - unsafe { cvt(libc::shutdown(self.0, how)).map(|_| ()) } - } - - fn timeout(&self, kind: libc::c_int) -> io::Result> { - let timeout = unsafe { - let mut timeout: libc::timeval = mem::zeroed(); - let mut size = mem::size_of::() as libc::socklen_t; - try!(cvt(libc::getsockopt(self.0, - libc::SOL_SOCKET, - kind, - &mut timeout as *mut _ as *mut _, - &mut size as *mut _ as *mut _))); - timeout - }; - - if timeout.tv_sec == 0 && timeout.tv_usec == 0 { - Ok(None) - } else { - Ok(Some(Duration::new(timeout.tv_sec as u64, (timeout.tv_usec as u32) * 1000))) - } - } - - fn set_timeout(&self, dur: Option, kind: libc::c_int) -> io::Result<()> { - let timeout = match dur { - Some(dur) => { - if dur.as_secs() == 0 && dur.subsec_nanos() == 0 { - return Err(io::Error::new(io::ErrorKind::InvalidInput, - "cannot set a 0 duration timeout")); - } - - let (secs, usecs) = if dur.as_secs() > libc::time_t::max_value() as u64 { - (libc::time_t::max_value(), 999_999) - } else { - (dur.as_secs() as libc::time_t, - (dur.subsec_nanos() / 1000) as libc::suseconds_t) - }; - let mut timeout = libc::timeval { - tv_sec: secs, - tv_usec: usecs, - }; - if timeout.tv_sec == 0 && timeout.tv_usec == 0 { - timeout.tv_usec = 1; - } - timeout - } - None => { - libc::timeval { - tv_sec: 0, - tv_usec: 0, - } - } - }; - - unsafe { - cvt(libc::setsockopt(self.0, - libc::SOL_SOCKET, - kind, - &timeout as *const _ as *const _, - mem::size_of::() as libc::socklen_t)) - .map(|_| ()) - } - } - - fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - let mut nonblocking = nonblocking as libc::c_ulong; - unsafe { cvt(libc::ioctl(self.0, libc::FIONBIO, &mut nonblocking)).map(|_| ()) } - } - - fn take_error(&self) -> io::Result> { - let mut errno: libc::c_int = 0; - - unsafe { - try!(cvt(libc::getsockopt(self.0, - libc::SOL_SOCKET, - libc::SO_ERROR, - &mut errno as *mut _ as *mut _, - &mut mem::size_of_val(&errno) as *mut _ as *mut _))); - } - - if errno == 0 { - Ok(None) - } else { - Ok(Some(io::Error::from_raw_os_error(errno))) - } - } -} - -unsafe fn sockaddr_un>(path: P) -> io::Result<(libc::sockaddr_un, libc::socklen_t)> { - let mut addr: libc::sockaddr_un = mem::zeroed(); - addr.sun_family = libc::AF_UNIX as libc::sa_family_t; - - let bytes = path.as_ref().as_os_str().as_bytes(); - - match (bytes.get(0), bytes.len().cmp(&addr.sun_path.len())) { - // Abstract paths don't need a null terminator - (Some(&0), Ordering::Greater) => { - return Err(io::Error::new(io::ErrorKind::InvalidInput, - "path must be no longer than SUN_LEN")); - } - (_, Ordering::Greater) | (_, Ordering::Equal) => { - return Err(io::Error::new(io::ErrorKind::InvalidInput, - "path must be shorter than SUN_LEN")); - } - _ => {} - } - for (dst, src) in addr.sun_path.iter_mut().zip(bytes.iter()) { - *dst = *src as libc::c_char; - } - // null byte for pathname addresses is already there because we zeroed the - // struct - - let mut len = sun_path_offset() + bytes.len(); - match bytes.get(0) { - Some(&0) | None => {} - Some(_) => len += 1, - } - Ok((addr, len as libc::socklen_t)) -} - -enum AddressKind<'a> { - Unnamed, - Pathname(&'a Path), - Abstract(&'a [u8]), -} - -/// An address associated with a Unix socket. -#[derive(Clone)] -pub struct SocketAddr { - addr: libc::sockaddr_un, - len: libc::socklen_t, -} - -impl SocketAddr { - fn new(f: F) -> io::Result - where F: FnOnce(*mut libc::sockaddr, *mut libc::socklen_t) -> libc::c_int - { - unsafe { - let mut addr: libc::sockaddr_un = mem::zeroed(); - let mut len = mem::size_of::() as libc::socklen_t; - try!(cvt(f(&mut addr as *mut _ as *mut _, &mut len))); - - if len == 0 { - // When there is a datagram from unnamed unix socket - // linux returns zero bytes of address - len = sun_path_offset() as libc::socklen_t; // i.e. zero-length address - } else if addr.sun_family != libc::AF_UNIX as libc::sa_family_t { - return Err(io::Error::new(io::ErrorKind::InvalidInput, - "file descriptor did not correspond to a Unix socket")); - } - - Ok(SocketAddr { - addr: addr, - len: len, - }) - } - } - - /// Returns true iff the address is unnamed. - pub fn is_unnamed(&self) -> bool { - if let AddressKind::Unnamed = self.address() { - true - } else { - false - } - } - - /// Returns the contents of this address if it is a `pathname` address. - pub fn as_pathname(&self) -> Option<&Path> { - if let AddressKind::Pathname(path) = self.address() { - Some(path) - } else { - None - } - } - - fn address<'a>(&'a self) -> AddressKind<'a> { - let len = self.len as usize - sun_path_offset(); - let path = unsafe { mem::transmute::<&[libc::c_char], &[u8]>(&self.addr.sun_path) }; - - // OSX seems to return a len of 16 and a zeroed sun_path for unnamed addresses - if len == 0 || (cfg!(not(target_os = "linux")) && self.addr.sun_path[0] == 0) { - AddressKind::Unnamed - } else if self.addr.sun_path[0] == 0 { - AddressKind::Abstract(&path[1..len]) - } else { - AddressKind::Pathname(OsStr::from_bytes(&path[..len - 1]).as_ref()) - } - } -} - -impl fmt::Debug for SocketAddr { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - match self.address() { - AddressKind::Unnamed => write!(fmt, "(unnamed)"), - AddressKind::Abstract(name) => write!(fmt, "{} (abstract)", AsciiEscaped(name)), - AddressKind::Pathname(path) => write!(fmt, "{:?} (pathname)", path), - } - } -} - -struct AsciiEscaped<'a>(&'a [u8]); - -impl<'a> fmt::Display for AsciiEscaped<'a> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - try!(write!(fmt, "\"")); - for byte in self.0.iter().cloned().flat_map(ascii::escape_default) { - try!(write!(fmt, "{}", byte as char)); - } - write!(fmt, "\"") - } -} - -/// OS specific extension traits. -pub mod os { - /// Linux specific extension traits. - #[cfg(target_os = "linux")] - pub mod linux { - use {AddressKind, SocketAddr}; - - /// Linux specific extensions for the `SocketAddr` type. - pub trait SocketAddrExt { - /// Returns the contents of this address (without the leading - /// null byte) if it is an `abstract` address. - fn as_abstract(&self) -> Option<&[u8]>; - } - - impl SocketAddrExt for SocketAddr { - fn as_abstract(&self) -> Option<&[u8]> { - if let AddressKind::Abstract(path) = self.address() { - Some(path) - } else { - None - } - } - } - } -} - -/// A Unix stream socket. -/// -/// # Examples -/// -/// ```rust,no_run -/// use unix_socket::UnixStream; -/// use std::io::prelude::*; -/// -/// let mut stream = UnixStream::connect("/path/to/my/socket").unwrap(); -/// stream.write_all(b"hello world").unwrap(); -/// let mut response = String::new(); -/// stream.read_to_string(&mut response).unwrap(); -/// println!("{}", response); -/// ``` -pub struct UnixStream { - inner: Inner, -} - -impl fmt::Debug for UnixStream { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - let mut builder = fmt.debug_struct("UnixStream"); - builder.field("fd", &self.inner.0); - if let Ok(addr) = self.local_addr() { - builder.field("local", &addr); - } - if let Ok(addr) = self.peer_addr() { - builder.field("peer", &addr); - } - builder.finish() - } -} - -impl UnixStream { - /// Connects to the socket named by `path`. - /// - /// Linux provides, as a nonportable extension, a separate "abstract" - /// address namespace as opposed to filesystem-based addressing. If `path` - /// begins with a null byte, it will be interpreted as an "abstract" - /// address. Otherwise, it will be interpreted as a "pathname" address, - /// corresponding to a path on the filesystem. - pub fn connect>(path: P) -> io::Result { - unsafe { - let inner = try!(Inner::new(libc::SOCK_STREAM)); - let (addr, len) = try!(sockaddr_un(path)); - - let ret = libc::connect(inner.0, &addr as *const _ as *const _, len); - if ret < 0 { - Err(io::Error::last_os_error()) - } else { - Ok(UnixStream { inner: inner }) - } - } - } - - /// Creates an unnamed pair of connected sockets. - /// - /// Returns two `UnixStream`s which are connected to each other. - pub fn pair() -> io::Result<(UnixStream, UnixStream)> { - let (i1, i2) = try!(Inner::new_pair(libc::SOCK_STREAM)); - Ok((UnixStream { inner: i1 }, UnixStream { inner: i2 })) - } - - /// Creates a new independently owned handle to the underlying socket. - /// - /// The returned `UnixStream` is a reference to the same stream that this - /// object references. Both handles will read and write the same stream of - /// data, and options set on one stream will be propogated to the other - /// stream. - pub fn try_clone(&self) -> io::Result { - Ok(UnixStream { inner: try!(self.inner.try_clone()) }) - } - - /// Returns the socket address of the local half of this connection. - pub fn local_addr(&self) -> io::Result { - SocketAddr::new(|addr, len| unsafe { libc::getsockname(self.inner.0, addr, len) }) - } - - /// Returns the socket address of the remote half of this connection. - pub fn peer_addr(&self) -> io::Result { - SocketAddr::new(|addr, len| unsafe { libc::getpeername(self.inner.0, addr, len) }) - } - - /// Sets the read timeout for the socket. - /// - /// If the provided value is `None`, then `read` calls will block - /// indefinitely. It is an error to pass the zero `Duration` to this - /// method. - pub fn set_read_timeout(&self, timeout: Option) -> io::Result<()> { - self.inner.set_timeout(timeout, libc::SO_RCVTIMEO) - } - - /// Sets the write timeout for the socket. - /// - /// If the provided value is `None`, then `write` calls will block - /// indefinitely. It is an error to pass the zero `Duration` to this - /// method. - pub fn set_write_timeout(&self, timeout: Option) -> io::Result<()> { - self.inner.set_timeout(timeout, libc::SO_SNDTIMEO) - } - - /// Returns the read timeout of this socket. - pub fn read_timeout(&self) -> io::Result> { - self.inner.timeout(libc::SO_RCVTIMEO) - } - - /// Returns the write timeout of this socket. - pub fn write_timeout(&self) -> io::Result> { - self.inner.timeout(libc::SO_SNDTIMEO) - } - - /// Moves the socket into or out of nonblocking mode. - pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - self.inner.set_nonblocking(nonblocking) - } - - /// Returns the value of the `SO_ERROR` option. - pub fn take_error(&self) -> io::Result> { - self.inner.take_error() - } - - /// Shuts down the read, write, or both halves of this connection. - /// - /// This function will cause all pending and future I/O calls on the - /// specified portions to immediately return with an appropriate value - /// (see the documentation of `Shutdown`). - pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { - self.inner.shutdown(how) - } -} - -impl io::Read for UnixStream { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - io::Read::read(&mut &*self, buf) - } -} - -impl<'a> io::Read for &'a UnixStream { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - unsafe { - cvt_s(libc::recv(self.inner.0, buf.as_mut_ptr() as *mut _, buf.len(), 0)) - .map(|r| r as usize) - } - } -} - -impl io::Write for UnixStream { - fn write(&mut self, buf: &[u8]) -> io::Result { - io::Write::write(&mut &*self, buf) - } - - fn flush(&mut self) -> io::Result<()> { - io::Write::flush(&mut &*self) - } -} - -impl<'a> io::Write for &'a UnixStream { - fn write(&mut self, buf: &[u8]) -> io::Result { - unsafe { - cvt_s(libc::send(self.inner.0, buf.as_ptr() as *const _, buf.len(), 0)) - .map(|r| r as usize) - } - } - - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } -} - -impl AsRawFd for UnixStream { - fn as_raw_fd(&self) -> RawFd { - self.inner.0 - } -} - -impl FromRawFd for UnixStream { - unsafe fn from_raw_fd(fd: RawFd) -> UnixStream { - UnixStream { inner: Inner(fd) } - } -} - -impl IntoRawFd for UnixStream { - fn into_raw_fd(self) -> RawFd { - let fd = self.inner.0; - mem::forget(self); - fd - } -} - -/// A structure representing a Unix domain socket server. -/// -/// # Examples -/// -/// ```rust,no_run -/// use std::thread; -/// use unix_socket::{UnixStream, UnixListener}; -/// -/// fn handle_client(stream: UnixStream) { -/// // ... -/// } -/// -/// let listener = UnixListener::bind("/path/to/the/socket").unwrap(); -/// -/// // accept connections and process them, spawning a new thread for each one -/// for stream in listener.incoming() { -/// match stream { -/// Ok(stream) => { -/// /* connection succeeded */ -/// thread::spawn(|| handle_client(stream)); -/// } -/// Err(err) => { -/// /* connection failed */ -/// break; -/// } -/// } -/// } -/// -/// // close the listener socket -/// drop(listener); -/// ``` -pub struct UnixListener { - inner: Inner, -} - -impl fmt::Debug for UnixListener { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - let mut builder = fmt.debug_struct("UnixListener"); - builder.field("fd", &self.inner.0); - if let Ok(addr) = self.local_addr() { - builder.field("local", &addr); - } - builder.finish() - } -} - -impl UnixListener { - /// Creates a new `UnixListener` bound to the specified socket. - /// - /// Linux provides, as a nonportable extension, a separate "abstract" - /// address namespace as opposed to filesystem-based addressing. If `path` - /// begins with a null byte, it will be interpreted as an "abstract" - /// address. Otherwise, it will be interpreted as a "pathname" address, - /// corresponding to a path on the filesystem. - pub fn bind>(path: P) -> io::Result { - unsafe { - let inner = try!(Inner::new(libc::SOCK_STREAM)); - let (addr, len) = try!(sockaddr_un(path)); - - try!(cvt(libc::bind(inner.0, &addr as *const _ as *const _, len))); - try!(cvt(libc::listen(inner.0, 128))); - - Ok(UnixListener { inner: inner }) - } - } - - /// Accepts a new incoming connection to this listener. - /// - /// This function will block the calling thread until a new Unix connection - /// is established. When established, the corersponding `UnixStream` and - /// the remote peer's address will be returned. - pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { - unsafe { - let mut fd = 0; - let addr = try!(SocketAddr::new(|addr, len| { - fd = libc::accept(self.inner.0, addr, len); - fd - })); - - Ok((UnixStream { inner: Inner(fd) }, addr)) - } - } - - /// Creates a new independently owned handle to the underlying socket. - /// - /// The returned `UnixListener` is a reference to the same socket that this - /// object references. Both handles can be used to accept incoming - /// connections and options set on one listener will affect the other. - pub fn try_clone(&self) -> io::Result { - Ok(UnixListener { inner: try!(self.inner.try_clone()) }) - } - - /// Returns the local socket address of this listener. - pub fn local_addr(&self) -> io::Result { - SocketAddr::new(|addr, len| unsafe { libc::getsockname(self.inner.0, addr, len) }) - } - - /// Moves the socket into or out of nonblocking mode. - pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - self.inner.set_nonblocking(nonblocking) - } - - /// Returns the value of the `SO_ERROR` option. - pub fn take_error(&self) -> io::Result> { - self.inner.take_error() - } - - /// Returns an iterator over incoming connections. - /// - /// The iterator will never return `None` and will also not yield the - /// peer's `SocketAddr` structure. - pub fn incoming<'a>(&'a self) -> Incoming<'a> { - Incoming { listener: self } - } -} - -impl AsRawFd for UnixListener { - fn as_raw_fd(&self) -> RawFd { - self.inner.0 - } -} - -impl FromRawFd for UnixListener { - unsafe fn from_raw_fd(fd: RawFd) -> UnixListener { - UnixListener { inner: Inner(fd) } - } -} - -impl IntoRawFd for UnixListener { - fn into_raw_fd(self) -> RawFd { - let fd = self.inner.0; - mem::forget(self); - fd - } -} - -impl<'a> IntoIterator for &'a UnixListener { - type Item = io::Result; - type IntoIter = Incoming<'a>; - - fn into_iter(self) -> Incoming<'a> { - self.incoming() - } -} - -/// An iterator over incoming connections to a `UnixListener`. -/// -/// It will never return `None`. -#[derive(Debug)] -pub struct Incoming<'a> { - listener: &'a UnixListener, -} - -impl<'a> Iterator for Incoming<'a> { - type Item = io::Result; - - fn next(&mut self) -> Option> { - Some(self.listener.accept().map(|s| s.0)) - } - - fn size_hint(&self) -> (usize, Option) { - (usize::max_value(), None) - } -} - -/// A Unix datagram socket. -/// -/// # Examples -/// -/// ```rust,no_run -/// use unix_socket::UnixDatagram; -/// -/// let socket = UnixDatagram::bind("/path/to/my/socket").unwrap(); -/// socket.send_to(b"hello world", "/path/to/other/socket").unwrap(); -/// let mut buf = [0; 100]; -/// let (count, address) = socket.recv_from(&mut buf).unwrap(); -/// println!("socket {:?} sent {:?}", address, &buf[..count]); -/// ``` -pub struct UnixDatagram { - inner: Inner, -} - -impl fmt::Debug for UnixDatagram { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - let mut builder = fmt.debug_struct("UnixDatagram"); - builder.field("fd", &self.inner.0); - if let Ok(addr) = self.local_addr() { - builder.field("local", &addr); - } - if let Ok(addr) = self.peer_addr() { - builder.field("peer", &addr); - } - builder.finish() - } -} - -impl UnixDatagram { - /// Creates a Unix datagram socket bound to the given path. - /// - /// Linux provides, as a nonportable extension, a separate "abstract" - /// address namespace as opposed to filesystem-based addressing. If `path` - /// begins with a null byte, it will be interpreted as an "abstract" - /// address. Otherwise, it will be interpreted as a "pathname" address, - /// corresponding to a path on the filesystem. - pub fn bind>(path: P) -> io::Result { - unsafe { - let inner = try!(Inner::new(libc::SOCK_DGRAM)); - let (addr, len) = try!(sockaddr_un(path)); - - try!(cvt(libc::bind(inner.0, &addr as *const _ as *const _, len))); - - Ok(UnixDatagram { inner: inner }) - } - } - - /// Creates a Unix Datagram socket which is not bound to any address. - pub fn unbound() -> io::Result { - let inner = try!(Inner::new(libc::SOCK_DGRAM)); - Ok(UnixDatagram { inner: inner }) - } - - /// Create an unnamed pair of connected sockets. - /// - /// Returns two `UnixDatagrams`s which are connected to each other. - pub fn pair() -> io::Result<(UnixDatagram, UnixDatagram)> { - let (i1, i2) = try!(Inner::new_pair(libc::SOCK_DGRAM)); - Ok((UnixDatagram { inner: i1 }, UnixDatagram { inner: i2 })) - } - - /// Connects the socket to the specified address. - /// - /// The `send` method may be used to send data to the specified address. - /// `recv` and `recv_from` will only receive data from that address. - pub fn connect>(&self, path: P) -> io::Result<()> { - unsafe { - let (addr, len) = try!(sockaddr_un(path)); - - try!(cvt(libc::connect(self.inner.0, &addr as *const _ as *const _, len))); - - Ok(()) - } - } - - /// Returns the address of this socket. - pub fn local_addr(&self) -> io::Result { - SocketAddr::new(|addr, len| unsafe { libc::getsockname(self.inner.0, addr, len) }) - } - - /// Returns the address of this socket's peer. - /// - /// The `connect` method will connect the socket to a peer. - pub fn peer_addr(&self) -> io::Result { - SocketAddr::new(|addr, len| unsafe { libc::getpeername(self.inner.0, addr, len) }) - } - - /// Receives data from the socket. - /// - /// On success, returns the number of bytes read and the address from - /// whence the data came. - pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { - let mut count = 0; - let addr = try!(SocketAddr::new(|addr, len| { - unsafe { - count = libc::recvfrom(self.inner.0, - buf.as_mut_ptr() as *mut _, - buf.len(), - 0, - addr, - len); - if count > 0 { - 1 - } else if count == 0 { - 0 - } else { - -1 - } - } - })); - - Ok((count as usize, addr)) - } - - /// Receives data from the socket. - /// - /// On success, returns the number of bytes read. - pub fn recv(&self, buf: &mut [u8]) -> io::Result { - unsafe { - let count = try!(cvt_s(libc::recv(self.inner.0, - buf.as_mut_ptr() as *mut _, - buf.len(), - 0))); - Ok(count as usize) - } - } - - /// Sends data on the socket to the specified address. - /// - /// On success, returns the number of bytes written. - pub fn send_to>(&self, buf: &[u8], path: P) -> io::Result { - unsafe { - let (addr, len) = try!(sockaddr_un(path)); - - let count = try!(cvt_s(libc::sendto(self.inner.0, - buf.as_ptr() as *const _, - buf.len(), - 0, - &addr as *const _ as *const _, - len))); - Ok(count as usize) - } - } - - /// Sends data on the socket to the socket's peer. - /// - /// The peer address may be set by the `connect` method, and this method - /// will return an error if the socket has not already been connected. - /// - /// On success, returns the number of bytes written. - pub fn send(&self, buf: &[u8]) -> io::Result { - unsafe { - let count = try!(cvt_s(libc::send(self.inner.0, - buf.as_ptr() as *const _, - buf.len(), - 0))); - Ok(count as usize) - } - } - - /// Sets the read timeout for the socket. - /// - /// If the provided value is `None`, then `recv` and `recv_from` calls will - /// block indefinitely. It is an error to pass the zero `Duration` to this - /// method. - pub fn set_read_timeout(&self, timeout: Option) -> io::Result<()> { - self.inner.set_timeout(timeout, libc::SO_RCVTIMEO) - } - - /// Sets the write timeout for the socket. - /// - /// If the provided value is `None`, then `send` and `send_to` calls will - /// block indefinitely. It is an error to pass the zero `Duration` to this - /// method. - pub fn set_write_timeout(&self, timeout: Option) -> io::Result<()> { - self.inner.set_timeout(timeout, libc::SO_SNDTIMEO) - } - - /// Returns the read timeout of this socket. - pub fn read_timeout(&self) -> io::Result> { - self.inner.timeout(libc::SO_RCVTIMEO) - } - - /// Returns the write timeout of this socket. - pub fn write_timeout(&self) -> io::Result> { - self.inner.timeout(libc::SO_SNDTIMEO) - } - - /// Moves the socket into or out of nonblocking mode. - pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - self.inner.set_nonblocking(nonblocking) - } - - /// Returns the value of the `SO_ERROR` option. - pub fn take_error(&self) -> io::Result> { - self.inner.take_error() - } - - /// Shut down the read, write, or both halves of this connection. - /// - /// This function will cause all pending and future I/O calls on the - /// specified portions to immediately return with an appropriate value - /// (see the documentation of `Shutdown`). - pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { - self.inner.shutdown(how) - } -} - -impl AsRawFd for UnixDatagram { - fn as_raw_fd(&self) -> RawFd { - self.inner.0 - } -} - -impl FromRawFd for UnixDatagram { - unsafe fn from_raw_fd(fd: RawFd) -> UnixDatagram { - UnixDatagram { inner: Inner(fd) } - } -} - -impl IntoRawFd for UnixDatagram { - fn into_raw_fd(self) -> RawFd { - let fd = self.inner.0; - mem::forget(self); - fd - } -} - -#[cfg(test)] -mod test { - extern crate tempdir; - - use std::thread; - use std::io; - use std::io::prelude::*; - use std::time::Duration; - use self::tempdir::TempDir; - - use super::*; - - macro_rules! or_panic { - ($e:expr) => { - match $e { - Ok(e) => e, - Err(e) => panic!("{}", e), - } - } - } - - #[test] - fn basic() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - let msg1 = b"hello"; - let msg2 = b"world!"; - - let listener = or_panic!(UnixListener::bind(&socket_path)); - let thread = thread::spawn(move || { - let mut stream = or_panic!(listener.accept()).0; - let mut buf = [0; 5]; - or_panic!(stream.read(&mut buf)); - assert_eq!(&msg1[..], &buf[..]); - or_panic!(stream.write_all(msg2)); - }); - - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - assert_eq!(Some(&*socket_path), - stream.peer_addr().unwrap().as_pathname()); - or_panic!(stream.write_all(msg1)); - let mut buf = vec![]; - or_panic!(stream.read_to_end(&mut buf)); - assert_eq!(&msg2[..], &buf[..]); - drop(stream); - - thread.join().unwrap(); - } - - #[test] - fn pair() { - let msg1 = b"hello"; - let msg2 = b"world!"; - - let (mut s1, mut s2) = or_panic!(UnixStream::pair()); - let thread = thread::spawn(move || { - // s1 must be moved in or the test will hang! - let mut buf = [0; 5]; - or_panic!(s1.read(&mut buf)); - assert_eq!(&msg1[..], &buf[..]); - or_panic!(s1.write_all(msg2)); - }); - - or_panic!(s2.write_all(msg1)); - let mut buf = vec![]; - or_panic!(s2.read_to_end(&mut buf)); - assert_eq!(&msg2[..], &buf[..]); - drop(s2); - - thread.join().unwrap(); - } - - #[test] - #[cfg(target_os = "linux")] - fn abstract_address() { - use os::linux::SocketAddrExt; - - let socket_path = "\0the path"; - let msg1 = b"hello"; - let msg2 = b"world!"; - - let listener = or_panic!(UnixListener::bind(&socket_path)); - let thread = thread::spawn(move || { - let mut stream = or_panic!(listener.accept()).0; - let mut buf = [0; 5]; - or_panic!(stream.read(&mut buf)); - assert_eq!(&msg1[..], &buf[..]); - or_panic!(stream.write_all(msg2)); - }); - - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - assert_eq!(Some(&b"the path"[..]), - stream.peer_addr().unwrap().as_abstract()); - or_panic!(stream.write_all(msg1)); - let mut buf = vec![]; - or_panic!(stream.read_to_end(&mut buf)); - assert_eq!(&msg2[..], &buf[..]); - drop(stream); - - thread.join().unwrap(); - } - - #[test] - fn try_clone() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - let msg1 = b"hello"; - let msg2 = b"world"; - - let listener = or_panic!(UnixListener::bind(&socket_path)); - let thread = thread::spawn(move || { - let mut stream = or_panic!(listener.accept()).0; - or_panic!(stream.write_all(msg1)); - or_panic!(stream.write_all(msg2)); - }); - - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - let mut stream2 = or_panic!(stream.try_clone()); - - let mut buf = [0; 5]; - or_panic!(stream.read(&mut buf)); - assert_eq!(&msg1[..], &buf[..]); - or_panic!(stream2.read(&mut buf)); - assert_eq!(&msg2[..], &buf[..]); - - thread.join().unwrap(); - } - - #[test] - fn iter() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - - let listener = or_panic!(UnixListener::bind(&socket_path)); - let thread = thread::spawn(move || { - for stream in listener.incoming().take(2) { - let mut stream = or_panic!(stream); - let mut buf = [0]; - or_panic!(stream.read(&mut buf)); - } - }); - - for _ in 0..2 { - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - or_panic!(stream.write_all(&[0])); - } - - thread.join().unwrap(); - } - - #[test] - fn long_path() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path() - .join("asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfa\ - sasdfasdfasdasdfasdfasdfadfasdfasdfasdfasdfasdf"); - match UnixStream::connect(&socket_path) { - Err(ref e) if e.kind() == io::ErrorKind::InvalidInput => {} - Err(e) => panic!("unexpected error {}", e), - Ok(_) => panic!("unexpected success"), - } - - match UnixListener::bind(&socket_path) { - Err(ref e) if e.kind() == io::ErrorKind::InvalidInput => {} - Err(e) => panic!("unexpected error {}", e), - Ok(_) => panic!("unexpected success"), - } - - match UnixDatagram::bind(&socket_path) { - Err(ref e) if e.kind() == io::ErrorKind::InvalidInput => {} - Err(e) => panic!("unexpected error {}", e), - Ok(_) => panic!("unexpected success"), - } - } - - #[test] - fn timeouts() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - - let _listener = or_panic!(UnixListener::bind(&socket_path)); - - let stream = or_panic!(UnixStream::connect(&socket_path)); - let dur = Duration::new(15410, 0); - - assert_eq!(None, or_panic!(stream.read_timeout())); - - or_panic!(stream.set_read_timeout(Some(dur))); - assert_eq!(Some(dur), or_panic!(stream.read_timeout())); - - assert_eq!(None, or_panic!(stream.write_timeout())); - - or_panic!(stream.set_write_timeout(Some(dur))); - assert_eq!(Some(dur), or_panic!(stream.write_timeout())); - - or_panic!(stream.set_read_timeout(None)); - assert_eq!(None, or_panic!(stream.read_timeout())); - - or_panic!(stream.set_write_timeout(None)); - assert_eq!(None, or_panic!(stream.write_timeout())); - } - - #[test] - fn test_read_timeout() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - - let _listener = or_panic!(UnixListener::bind(&socket_path)); - - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - or_panic!(stream.set_read_timeout(Some(Duration::from_millis(1000)))); - - let mut buf = [0; 10]; - let kind = stream.read(&mut buf).err().expect("expected error").kind(); - assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); - } - - #[test] - fn test_read_with_timeout() { - let dir = or_panic!(TempDir::new("unix_socket")); - let socket_path = dir.path().join("sock"); - - let listener = or_panic!(UnixListener::bind(&socket_path)); - - let mut stream = or_panic!(UnixStream::connect(&socket_path)); - or_panic!(stream.set_read_timeout(Some(Duration::from_millis(1000)))); - - let mut other_end = or_panic!(listener.accept()).0; - or_panic!(other_end.write_all(b"hello world")); - - let mut buf = [0; 11]; - or_panic!(stream.read(&mut buf)); - assert_eq!(b"hello world", &buf[..]); - - let kind = stream.read(&mut buf).err().expect("expected error").kind(); - assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); - } - - #[test] - fn test_unix_datagram() { - let dir = or_panic!(TempDir::new("unix_socket")); - let path1 = dir.path().join("sock1"); - let path2 = dir.path().join("sock2"); - - let sock1 = or_panic!(UnixDatagram::bind(&path1)); - let sock2 = or_panic!(UnixDatagram::bind(&path2)); - - let msg = b"hello world"; - or_panic!(sock1.send_to(msg, &path2)); - let mut buf = [0; 11]; - or_panic!(sock2.recv_from(&mut buf)); - assert_eq!(msg, &buf[..]); - } - - #[test] - fn test_unnamed_unix_datagram() { - let dir = or_panic!(TempDir::new("unix_socket")); - let path1 = dir.path().join("sock1"); - - let sock1 = or_panic!(UnixDatagram::bind(&path1)); - let sock2 = or_panic!(UnixDatagram::unbound()); - - let msg = b"hello world"; - or_panic!(sock2.send_to(msg, &path1)); - let mut buf = [0; 11]; - let (usize, addr) = or_panic!(sock1.recv_from(&mut buf)); - assert_eq!(usize, 11); - assert!(addr.is_unnamed()); - assert_eq!(msg, &buf[..]); - } - - #[test] - fn test_connect_unix_datagram() { - let dir = or_panic!(TempDir::new("unix_socket")); - let path1 = dir.path().join("sock1"); - let path2 = dir.path().join("sock2"); - - let bsock1 = or_panic!(UnixDatagram::bind(&path1)); - let bsock2 = or_panic!(UnixDatagram::bind(&path2)); - let sock = or_panic!(UnixDatagram::unbound()); - or_panic!(sock.connect(&path1)); - - // Check send() - let msg = b"hello there"; - or_panic!(sock.send(msg)); - let mut buf = [0; 11]; - let (usize, addr) = or_panic!(bsock1.recv_from(&mut buf)); - assert_eq!(usize, 11); - assert!(addr.is_unnamed()); - assert_eq!(msg, &buf[..]); - - // Changing default socket works too - or_panic!(sock.connect(&path2)); - or_panic!(sock.send(msg)); - or_panic!(bsock2.recv_from(&mut buf)); - } - - #[test] - fn test_unix_datagram_recv() { - let dir = or_panic!(TempDir::new("unix_socket")); - let path1 = dir.path().join("sock1"); - - let sock1 = or_panic!(UnixDatagram::bind(&path1)); - let sock2 = or_panic!(UnixDatagram::unbound()); - or_panic!(sock2.connect(&path1)); - - let msg = b"hello world"; - or_panic!(sock2.send(msg)); - let mut buf = [0; 11]; - let size = or_panic!(sock1.recv(&mut buf)); - assert_eq!(size, 11); - assert_eq!(msg, &buf[..]); - } - - #[test] - fn datagram_pair() { - let msg1 = b"hello"; - let msg2 = b"world!"; - - let (s1, s2) = or_panic!(UnixDatagram::pair()); - let thread = thread::spawn(move || { - // s1 must be moved in or the test will hang! - let mut buf = [0; 5]; - or_panic!(s1.recv(&mut buf)); - assert_eq!(&msg1[..], &buf[..]); - or_panic!(s1.send(msg2)); - }); - - or_panic!(s2.send(msg1)); - let mut buf = [0; 6]; - or_panic!(s2.recv(&mut buf)); - assert_eq!(&msg2[..], &buf[..]); - drop(s2); - - thread.join().unwrap(); - } -} diff -Nru distinst-0.1.0/vendor/unix_socket/.travis.yml distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/.travis.yml --- distinst-0.1.0/vendor/unix_socket/.travis.yml 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/unix_socket/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -language: rust -rust: -- nightly -- beta -- 1.4.0 -script: -- cargo test diff -Nru distinst-0.1.0/vendor/vec_map/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/vec_map/.cargo-checksum.json --- distinst-0.1.0/vendor/vec_map/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/vec_map/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".travis.yml":"bcc37db7a32793acd551cbb2d0916f3f43144f6f640a08dedf2c55db79cd8c50","Cargo.toml":"8332de6a6ecdd4adb3098f3f88ee3ddc7fafd970226ae1651de6c4227f59dea9","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"5b5a70b8d04081089d905ae8a0df645703f4d7f8713962da4781ac88c9d1a653","deploy-docs.sh":"7b66111b124c1c7e59cb84cf110d98b5cb783bd35a676e970d9b3035e55f7dfd","src/lib.rs":"b2aefb23c21879f5da63231e4c2e8ea289826f56128217d19e8b1d22035ff149"},"package":"887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"} \ No newline at end of file +{"files":{".travis.yml":"bcc37db7a32793acd551cbb2d0916f3f43144f6f640a08dedf2c55db79cd8c50","Cargo.toml":"8332de6a6ecdd4adb3098f3f88ee3ddc7fafd970226ae1651de6c4227f59dea9","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"5b5a70b8d04081089d905ae8a0df645703f4d7f8713962da4781ac88c9d1a653","deploy-docs.sh":"7b66111b124c1c7e59cb84cf110d98b5cb783bd35a676e970d9b3035e55f7dfd","src/lib.rs":"b2aefb23c21879f5da63231e4c2e8ea289826f56128217d19e8b1d22035ff149"},"package":"887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/winapi/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/winapi/.cargo-checksum.json --- distinst-0.1.0/vendor/winapi/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/winapi/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"d15a0464554e57323507a2ff34925a2c592f3dffec9beb092c7ce985440f5bda","LICENSE.md":"fd232cfaeeff018cd3b9f22e0279b1c2237742999277596638800e967f6e4a29","src/activation.rs":"0e25834dfecd59391e2ecfdaa2e01bb5ac4d181778b47d0b9f67c56a6b2bd75f","src/audioclient.rs":"8c645d4ddb171620a527bcc14fa2904ff9aeb529262e68a0a9957d2ed77118be","src/audiosessiontypes.rs":"ba8cd1950cdab112861208ac1ecc35e656cbbe36e60c31315e547cfe47707685","src/basetsd.rs":"7b879d3164d5e6ec1b94d18a6b58f74a7f4e62fc279df32126e76c4f3138239d","src/bcrypt.rs":"05fe44190a37dd744bff8fc682f25a47c5f4239d417b213d18542aaa19b08b06","src/cfg.rs":"057ace203f04f8c09b6f68fefba7d3eb6644c46f2e44ca8f1364a8bc3bdd4970","src/cfgmgr32.rs":"714289f058283fc89fc79bbd4932bdbc0e9a88edd62a1787aac82c338f2dfb45","src/combaseapi.rs":"45458b1e0d918b237afd7e9581e2714b58ee009a91bbec45827694d1159a2e8b","src/commctrl.rs":"c0173aabd50f34a85c2523876fa0191d052d1d0c157f95ed228d98508806cc7d","src/commdlg.rs":"e75f64491eea54f651884eb3cc5353588c7fe54b086b43557d6d4917abbf95cd","src/corsym.rs":"301f937c7cb394675b2127a24595beef261d269d8f7cb45d6b4ac21a063985e3","src/d2d1.rs":"e7aa08883d85e2631f5327541e644b650ad009095daadef606bb06d9ac99afd3","src/d2dbasetypes.rs":"5a26048c997a580d8bb2a3512f1cb20dba411da99ffd6b23f4b0615ab9378058","src/d3d10shader.rs":"d6edf923fa8442be35b7f4ebebcd2e4bec4c3842ed5aee4bfd05c2de11edc4e0","src/d3d11.rs":"3f2f681357730df7ea954fb78903f0f0ad0bb3b577727307e751fd9598a4e837","src/d3d11shader.rs":"29612cc75ba238e2cd691fdcc01be9c79ca12b046e207d3cbfc5af23f04c4cb9","src/d3d12.rs":"906e512385e78756fe84f9a9622c510ce5a6daeb121127cf93f11af0f2fa3763","src/d3d12sdklayers.rs":"b50edb48a1c51bc7e3bf7176733c3dad4eb45a4e9747096e3b5a723052e130c8","src/d3d12shader.rs":"ff58932ef32c108348e41864f09ac6f909d641cac4f94c3e4f6c3dc4e5916521","src/d3d9.rs":"e01614130a4d68bb6e2a23f62ffb4d5016381e9026f8477aaca64851c8dcad53","src/d3d9caps.rs":"d4bcf91b7ae307388c91c19eacdb808506faea184b03178feee5c47959211b7b","src/d3d9types.rs":"1e10aae6297bc8dc083b111da496313ff19dcb9b88450e2637f8e98c0401519c","src/d3dcommon.rs":"f841b2e4df6dfccb9eb1955add24689db7b173780ec25e99b89097140a012152","src/d3dcompiler.rs":"02269410bd7f83f49391f852320ca0d76fd8d907ed22c68a003af65b3f5ab54a","src/dbghelp.rs":"c0ea5bcd04f414a696cd876439a7c4d6ee63627f4662705d189fd6e0412622f8","src/dcommon.rs":"8889ca66e2f89f1c275e5d6b7d6b203e7f25b4e7a262689b2ec6f04b9d1b5ae8","src/devpropdef.rs":"74948513ed623d3bdf1ea3fbf1f540b3e9e46efb9c1674ecccfe7f2fae5792f2","src/docobj.rs":"43e214d9d0c436a88ed2c620b8386e58e4d549ba9c8be51bf52291caf95e225d","src/dpapi.rs":"d44a1a6c9e52b34e8e87df1079b97081c646f07d0eee51f0d0cf66ae1c6fd58a","src/dsgetdc.rs":"5911c35ef3d80a5162fdbea6902f9b07033b746ff91bff2657a0971edb07bff2","src/dsound.rs":"53a5532d645e1b7995f0b4a0f0711fc66da8a27b7f8c87ce3d9e0882cfdca07c","src/dsrole.rs":"50b27a8afb11188ce24ab49620fe69ea21658148d8fd6076b8927175db5c1a9e","src/dwmapi.rs":"e65ca961eec0db275e211e04c59a8995c8c13d36ab08dc36ce197d9a4856266f","src/dwrite.rs":"f138d36e8b93778a7866cc755893b4da19cfd6ce42427139589a0bbaa294eb44","src/dxgi.rs":"5b6fcc5c665df1c0c6ed3de5d678a7bade1bb8ab1acbe952b784ce99fc817e53","src/dxgi1_2.rs":"6ba44755d715f2493236103fc5c24d7d45dff2e1fc3690aefbd4eb6c859dbc07","src/dxgi1_3.rs":"1f86a9db5fd45199fcc3ce56423e5fcf0c58df4001e2b50c5586d38ab820b78f","src/dxgi1_4.rs":"c578e6fcb82d535b20fc10232b75a7b9512d068919cc1e3f1c7cf55f3eb46460","src/dxgiformat.rs":"2e73df34f480b6ef3b5e21de0a520dacec91b00772e42786568fd162ca5e9aa6","src/dxgitype.rs":"204b8dae38c13a1dd8cd2ce6ca68851f743b416213d6db1cd0d96808bcbf7058","src/errhandlingapi.rs":"a70f9db3dd8ab60aba0daf39f12b527e54e312ca640e0b80d80c93ffdb6913c6","src/excpt.rs":"b07cf9ff0d23dd50c0776d048d0c579e401b7d729635f78998f85d35f33f05a4","src/fileapi.rs":"d31814c612bbd9372abbf6f8455fc2af89ac236c6b1855da10d66545e485ec57","src/gl.rs":"9429708bb97aeecb2c40030460ed0c3415fc0f2335c9513c68afa6157bd9b465","src/guiddef.rs":"86618dcd39c77048c7e453e6e86dafe90358eb7f97144f9672ae09e7b9855729","src/heapapi.rs":"21e420ba7641e507e8f2801d2b0ed25dbcb98e967924d711beb5cbfa8a5785e4","src/hidclass.rs":"a93380d35dc4d45807b10bbd69ee63eb8517b75989b68391685070a2fcfbefa1","src/hidpi.rs":"0b641fc119ac35761fe8e5eaed9a0781e9018598ea269d6cd386dbf5563ab9a0","src/hidsdi.rs":"50abb938ea8d0af90ccdea7ac3de4bc10fe42e34bc6a6d6eb4da1b330727da34","src/hidusage.rs":"44adc029bc89f0d4977b1295b7e998ddabf5283de66e1e33146bda8968d1d98b","src/hstring.rs":"51b3e63e3f1ed48f54c63c3e820e0563fb857b2743529d5f947f718d43425b89","src/http.rs":"ebb8b8db9e786e2683ad8b9a9066ef418df773ae7ce4d75f166cb5321f85f5a0","src/imm.rs":"b9277502f17f4cc6bde4f80f722ec1b976913355edbf162814ccfec2b3b080fd","src/inaddr.rs":"938143669da02c83a31d207be11e2176ed5219edf0e6f8f7a5534a5c6c3ce8d1","src/inspectable.rs":"b01f1814a233a77bf9f25c264747252c0464388c7d9c7302e5bde57502b8139b","src/ksmedia.rs":"acb96b1ea0cf3b5397f9037958093c6b4dbb54c4246516e57b9fed055e8e69c1","src/lib.rs":"8a7840b030f56883f68bdf90a1a04df8be2a5e2698a9ea86c73fac59c9f09b6e","src/libloaderapi.rs":"21a5d17c9f8ac4c006b515979964a8870f30710be4482083f45c6a41a16a36ce","src/lmaccess.rs":"712661c871569513334152bdcdf56c07776c560a22cd5b892a0f38e1957e28db","src/lmcons.rs":"3449aab4399cc36e7d7db551e384d82dfa4204178c4cfb9642f90645687fbc81","src/lmdfs.rs":"c351cdb2d10bf3a7c5ce7400dcdca41a792554e21e75fa9e5378ac18d8d3e4e7","src/lmerrlog.rs":"7937928544d27575e302c5e9c5e6803e9033e1f4d715e7ca29be202276d7d7a6","src/lmjoin.rs":"362cdc71f3f50099b862eff0733b3a57dd0f95cac15943135f794424f651b916","src/lsalookup.rs":"4aef1a95033444181f2b2b9df364ea165b0fdedb396c63e5d12db6b7398a3d5f","src/macros.rs":"5dacc570f226b6f1ad31d76a03675f0d182a3d578846920000fabb7cd92fc7f8","src/memoryapi.rs":"2273b8bfd7fc36dcf654c320826952ad502e8922a84174f8c1f7ed08aa555a04","src/minschannel.rs":"139828de63a0a4476de2bee454f5bca5e8a46cc29f1680339bb2804ee2d17322","src/minwinbase.rs":"6cd387a7f79e1a708bc48b5b27eaeaa7aadf0fff7a5e0a76cda0bdf3fa871863","src/minwindef.rs":"47ba4f2ec7789109ae339170715ed76288ae60ee57a4f06d5cc50a0e6855699f","src/mmdeviceapi.rs":"c8b7f7b6b78488d23ccba2b34e8765eac60ec9f08e19c96b377d957f65b1b6d1","src/mmreg.rs":"1621fad6eaa16d1e5ca95055fd11bf066b777b1343625f9fdc74e4d313d60dea","src/mmsystem.rs":"f6a2bff3bf80af1468de2c2a5f7ff2ced2b625adaf24f08f9b303965ed5ee371","src/mscat.rs":"9226a8e30546c4142e4fcdc716f8a15cc7c8081c9e875ec72ff9e8551f86f9a1","src/mssip.rs":"d7e2b91e358ff4986e700396d04f92aa1671aafada0d4889914a413177c091e1","src/nb30.rs":"dd85d7849111f04d33895835269929dc219e04de4373e91468eb053e3e0a5c52","src/ncrypt.rs":"29f168dcddeaa2cb231a7174cec672be83cca192ffc4632cead4c4a25189fb49","src/ntdef.rs":"3be66042d16a862f0fed8f48406b08c3091fbf92885a44efb7747f4a764d7de7","src/ntsecapi.rs":"dfb2cc7e23e8b20fa5ffd30ccecdb81b62d8ffeb68fdf99f93fb141ff4155afd","src/ntstatus.rs":"de6208f4e119a6405c1726433ea5e47a8b5f46b345f5809e9f580cce88360a79","src/oaidl.rs":"640c911e39888928baf77145cca34c1a768bfd759ec9709f70649a2946cb3246","src/objbase.rs":"7c9edb6a9ea72baddb15a6aec3602b3f9e7b1ce969dd655f440eae0ede1372e2","src/objidl.rs":"2a623b989f2a216edca3bd118eceff41267632839a3fd4410df9a7c126a87b64","src/objidlbase.rs":"3415a0bcd1b5b63ff48e17138ff87dae7c31eaeb323ae81f34b6712efade1d04","src/olectl.rs":"da2014c3d5858c5abff1635e1b8c8223333e7d22d28cac614aac3305a7f04ee4","src/pdh.rs":"eb01459c2acc456ecd204c6716d26027a6c77c2b4a9b698d3c922254fe2cc319","src/playsoundapi.rs":"7efddfc8601de565946c8c93074211c83b20866a1588e36e0518bba9864d0cf0","src/processsnapshot.rs":"df99a56280e6e41c5896341ffa1abe734f6c8662f4d7ea960cb97fb34c5b85d9","src/processthreadsapi.rs":"bf8edf8984ee97bc5054e68d02ec4633b5f15720602ab19c95d78e7d420c9cc8","src/propidl.rs":"88b5f176e4624063cadd8db95db52bf07cff421d73a8cfe319f992a9c99cd315","src/propsys.rs":"05c411639479f88e77383c585117a886f48ea7453260210db9f283e2cafdffbf","src/prsht.rs":"f862538c0010a51a02e5f24b3a44b54ba5993c32400b98a3b0558741ae7473a3","src/psapi.rs":"512523c5f8334c9ad221a73776c0ed2da93d8e2353dc4d2cee951ffa6ea7c163","src/qos.rs":"9ef6183b7c03b5b412f81f38ebb06048ff6266032bc236964dd994f173b82ec4","src/reason.rs":"c92aded3bbea859f110eed73b9b0fb40df6ac4a6ed6431ca69882b46b5ad5229","src/restrictederrorinfo.rs":"b8c53f4ae149ea806028cdafe699390a20202d72028b5f62836bcbf97720d133","src/roapi.rs":"dbbefb19f402a2aece66b500739b0a9e2c4d0133a8bc94d076510d5a67def175","src/roerrorapi.rs":"84a0a71a3f9ce67a577954ee5761cbd97d892eb5e7eb2c381f6bd29d4e1d4af7","src/rpc.rs":"e2293651222edf37f3ad3076adaae9033b25b06bd7b88ed7372585a4ae46c7d9","src/rpcdce.rs":"de77ca3c9b689ffaaf395a6882d3dfc3a1cec181efa6cb6075e605e4462bc3f6","src/sapi.rs":"05dbc1166b836251538c9e52a772fa584a1d0a1ad823e4336ab5e6cfefb96d57","src/schannel.rs":"e48926896227ffae5033bd634a7c71f5359d7a08b7b8c6e94e03864d87a37f8b","src/servprov.rs":"f086b4330162c7da711ea59d7023304a8fa2a53470b54d846ea1c11567703693","src/setupapi.rs":"4959862dd39597cd711022fcefbaf5c75b61410d57d04e9dbec2ddf7a2fa6f31","src/shellapi.rs":"ce3e3e7cd8aefe8068d6c51256827c0c3d51a449e4ab73e7125ea28d44dd6b6d","src/shellscalingapi.rs":"59c162b0215ff4b71b3535b6e142cca8cd99028031f47f0a6efb960c160a8776","src/shlguid.rs":"dcb7a1ada1b1b90f405e6dea8bcf1fc6994725b49a3165b7908670b2c31490e5","src/shlobj.rs":"53ff059ec6123001bed8f007c36e40812f83e4e04bd50b371319d10b4e38c36f","src/shobjidl.rs":"953d6ef4dc2a0d175d7133dc2f41255123ab8f778b22feaebd8ca1fa77356aa7","src/shtypes.rs":"ff785004e819bcfc521ab79327e58f98debab4e40c20412bbecdcee1b2801371","src/spapidef.rs":"9abe751425b6aaac7e4a7ea49f6d8e859f8f73164abd4d69b48e3e224d7de829","src/sql.rs":"004ed353b40bb4bceab55d6e8c33063a8eac992b076e47e6ead8303dbbc5b67f","src/sqltypes.rs":"0c5fa183c9f5b9e16e292de6a9afdf73f554730e651250856148ac04718803b8","src/sspi.rs":"dbd9d544abea4396983867ef4f7fbe2588673cc953dbeb74e7edc46503b16fa0","src/strmif.rs":"168040999cf99843cc1447988e46c56481a7a343ae41ab854db40ef566fa1119","src/subauth.rs":"183dd0df6436e9f0e859d62ca78e8ed42d4c1a5dc0690dcf22d42467fd2e0700","src/synchapi.rs":"cfce677c85377a340cb9307d9ac9eb06ffe9fd5e2ce08ed4a0390729e3a7d717","src/sysinfoapi.rs":"9a5579143263ce20d8c365b9874a0ae90ef28bc3295eab26ba3782efa48b464a","src/threadpoolapi.rs":"57876ea70b86d08663f7916ce076547f17596c26b8bf4dfafbad60e78264ff95","src/timezoneapi.rs":"5ccd80e6d16a858c56e20a7f3c5570e29777dab0fdfc057b6d2fb06463d56eb3","src/tlhelp32.rs":"c96ef7416bceab473463cc4ad98f037aeaac87bb7adf45cc16c281308537e82f","src/unknwnbase.rs":"2708c19491deb7364100025f3bb88a791c219551a65af70a776f8f3c5bf18b05","src/urlhist.rs":"8c8c0d0a613e59f68bf0e8cec061ea2126baa98d1479df4d07c8df5e41b50bc1","src/urlmon.rs":"0652e602ef2f5826360e5eab68bdf4f9365827a012c2c89289c54016ea001b74","src/usb.rs":"7e682ee819b237eabe796e604cff2434c450f724f4c86d919683eb7a5167c343","src/usbspec.rs":"d19671960838eb592cda4cd7c84c6f66cd9484f0904b5a28e1d8fd91e9c2c6af","src/usp10.rs":"baa2c1ef6ca5f064bc55b24f39c0553ede45a87b9183318572916fd4f1c679c6","src/vadefs.rs":"0e2f12fd1c521a943908669b2d10fceea409bac45242ec6e87c0e69706c1b3d0","src/vsbackup.rs":"af71cb851bd7eacde9d3e46a112497baef3ecebb472aae3c76c7faff804d33f9","src/vss.rs":"a626613810a69309b8f50d0a3bd75928d9de771c2287b6242487cb8cd55394a0","src/vsserror.rs":"f06b108d66ea9f06ad15d83b981117ed6a2a9cd218bb3bf53f13b0055acd9b2e","src/vswriter.rs":"8c4f5d27fa0883d187506538136cc610074941bb952afbe0984f7cb7c3c656f7","src/werapi.rs":"a2d692514ff3a61126971c5c2c5a7298c0f822559550a7f14501f8c96d1d951a","src/winbase.rs":"e224c40d827b1f1a9c74643c000f71e87ad18f749810cc611425af325c9472b8","src/wincon.rs":"402c5ebf80aa6ab1002935b7ddca17e8a243d0c714982054395862fe0ae40a04","src/wincred.rs":"e5fa987622dd880151ae190bb45daa666ffae3ae8e2da97407210afe01dd93d6","src/wincrypt.rs":"f7f8743b6a89d3f5e8b07405e43010bb3729aa8a8cf4546cc02705f802947ebc","src/windef.rs":"89fa9f5ab2909a4840f16979ebbc0afa2134abcb1d47cb7435b581f31b227658","src/windowscodecs.rs":"7c63bc4e2d0e7ce60c7bb13b93ef5aa12213f71a46845b6e034a9c224ef3eb3c","src/windowsx.rs":"414a9a841590f88804da3eb9ba55d583372a467cc50ab1ebdd7cfc653ce5f627","src/winerror.rs":"f3882eba4e299acbdedd548feb1ff89de958fb72d665bd6ba013b6a1f7596b52","src/winevt.rs":"64ae96f475ed98da7a84704d53d16caccbac2dbd525de0ef0f65fc58a6775ed1","src/wingdi.rs":"35aa9dd14b4b4c5a227ac3df0d312c19cbaede2d1388c26ad8eb910e80efeafd","src/winhttp.rs":"37769be104a2eb9efa70ffd74c8f38a09d9639cf575a677ad75d941e8d87cd58","src/winioctl.rs":"0f0efe0a41894a325b70428d04aeddec8dd7a87a91489a4e564a248e8498861b","src/winnetwk.rs":"d492c3d14a422f611166d39b895ddc6dd749ebc64a020bf3125af452494f91dd","src/winnls.rs":"90904d6adad70081a620165223fb4a71b64d747596c64d0df7de9511cd0f75c6","src/winnt.rs":"2c51ad0a065006010f1cfe7a3335274304e4747adc63f9798e1ca1f7091154a5","src/winreg.rs":"c687a5c6433daa13793815ef9af8befaedc9635be14eea0c618ad5334952dc31","src/winscard.rs":"78ab1d3ae22e486726740c343a4cc6268ca318de43f4b7d7ba51acbdf1b93936","src/winsmcrd.rs":"62be129c3d4cdea9dd31e769b587f071a94c347c8df71a43bb1eea18d52a60cc","src/winsock2.rs":"21dc0393f37f56c15c59d49a32861fb24c8f28d43ce26b56d958a174a5040a76","src/winspool.rs":"a3bd8e04f2db6118fe529bf52cb856a773cd8b816d197fc8edc8ac942578fd74","src/winstring.rs":"dc535f972d93be2fe067a5ca64edb45b6ad8e4549ecc0ce24486bd94555d5707","src/winsvc.rs":"7999f00b341f3e0e8701ea89f71986a6600650ff8cffdb1292e9f55d47bd0a3e","src/winusb.rs":"0ac355aa879a4aae501db04f1e8859dbef5e33fda9d46a7a12ef25e5524ec396","src/winusbio.rs":"8e2d64832999b59b2ea900396184c36d34cf94c97f31e15916c299213748a3e1","src/winuser.rs":"791bd8625812feccc8ec421489194d635c94cb4c4d754287a0caa54fa8f71c19","src/ws2def.rs":"0a1c7a69e4da8edc0584b0e3fb4ad1fa4aed621510b1bc1b0d104990577c6a38","src/ws2ipdef.rs":"c6a898cf25d187ad83e110af1e2286824868691a60818ecc44e68fa0bbbd4ff6","src/ws2spi.rs":"e63da700de55a317769230319eb9e4ec85cc0ac80b2baa076399367338b7ca0f","src/ws2tcpip.rs":"698084fd5d631a2ef236fe76001e7c44afd9b8958243e4ad4c098ac4beb4b352","src/wtypes.rs":"2689e8f442ccdc0b0e1ec82160a5cc3e80abf95dca82855ec595314062774a14","src/wtypesbase.rs":"f6dc0a8b09f3f003339c5dd366bdddb9dd671894be9dcf4a42058b226d2917a8","src/xinput.rs":"e15cd46bf18977481e22d609f8e0bb5508776902d7fa64477bb5b78596c0f67d"},"package":"167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"} \ No newline at end of file +{"files":{"Cargo.toml":"d15a0464554e57323507a2ff34925a2c592f3dffec9beb092c7ce985440f5bda","LICENSE.md":"fd232cfaeeff018cd3b9f22e0279b1c2237742999277596638800e967f6e4a29","src/activation.rs":"0e25834dfecd59391e2ecfdaa2e01bb5ac4d181778b47d0b9f67c56a6b2bd75f","src/audioclient.rs":"8c645d4ddb171620a527bcc14fa2904ff9aeb529262e68a0a9957d2ed77118be","src/audiosessiontypes.rs":"ba8cd1950cdab112861208ac1ecc35e656cbbe36e60c31315e547cfe47707685","src/basetsd.rs":"7b879d3164d5e6ec1b94d18a6b58f74a7f4e62fc279df32126e76c4f3138239d","src/bcrypt.rs":"05fe44190a37dd744bff8fc682f25a47c5f4239d417b213d18542aaa19b08b06","src/cfg.rs":"057ace203f04f8c09b6f68fefba7d3eb6644c46f2e44ca8f1364a8bc3bdd4970","src/cfgmgr32.rs":"714289f058283fc89fc79bbd4932bdbc0e9a88edd62a1787aac82c338f2dfb45","src/combaseapi.rs":"45458b1e0d918b237afd7e9581e2714b58ee009a91bbec45827694d1159a2e8b","src/commctrl.rs":"c0173aabd50f34a85c2523876fa0191d052d1d0c157f95ed228d98508806cc7d","src/commdlg.rs":"e75f64491eea54f651884eb3cc5353588c7fe54b086b43557d6d4917abbf95cd","src/corsym.rs":"301f937c7cb394675b2127a24595beef261d269d8f7cb45d6b4ac21a063985e3","src/d2d1.rs":"e7aa08883d85e2631f5327541e644b650ad009095daadef606bb06d9ac99afd3","src/d2dbasetypes.rs":"5a26048c997a580d8bb2a3512f1cb20dba411da99ffd6b23f4b0615ab9378058","src/d3d10shader.rs":"d6edf923fa8442be35b7f4ebebcd2e4bec4c3842ed5aee4bfd05c2de11edc4e0","src/d3d11.rs":"3f2f681357730df7ea954fb78903f0f0ad0bb3b577727307e751fd9598a4e837","src/d3d11shader.rs":"29612cc75ba238e2cd691fdcc01be9c79ca12b046e207d3cbfc5af23f04c4cb9","src/d3d12.rs":"906e512385e78756fe84f9a9622c510ce5a6daeb121127cf93f11af0f2fa3763","src/d3d12sdklayers.rs":"b50edb48a1c51bc7e3bf7176733c3dad4eb45a4e9747096e3b5a723052e130c8","src/d3d12shader.rs":"ff58932ef32c108348e41864f09ac6f909d641cac4f94c3e4f6c3dc4e5916521","src/d3d9.rs":"e01614130a4d68bb6e2a23f62ffb4d5016381e9026f8477aaca64851c8dcad53","src/d3d9caps.rs":"d4bcf91b7ae307388c91c19eacdb808506faea184b03178feee5c47959211b7b","src/d3d9types.rs":"1e10aae6297bc8dc083b111da496313ff19dcb9b88450e2637f8e98c0401519c","src/d3dcommon.rs":"f841b2e4df6dfccb9eb1955add24689db7b173780ec25e99b89097140a012152","src/d3dcompiler.rs":"02269410bd7f83f49391f852320ca0d76fd8d907ed22c68a003af65b3f5ab54a","src/dbghelp.rs":"c0ea5bcd04f414a696cd876439a7c4d6ee63627f4662705d189fd6e0412622f8","src/dcommon.rs":"8889ca66e2f89f1c275e5d6b7d6b203e7f25b4e7a262689b2ec6f04b9d1b5ae8","src/devpropdef.rs":"74948513ed623d3bdf1ea3fbf1f540b3e9e46efb9c1674ecccfe7f2fae5792f2","src/docobj.rs":"43e214d9d0c436a88ed2c620b8386e58e4d549ba9c8be51bf52291caf95e225d","src/dpapi.rs":"d44a1a6c9e52b34e8e87df1079b97081c646f07d0eee51f0d0cf66ae1c6fd58a","src/dsgetdc.rs":"5911c35ef3d80a5162fdbea6902f9b07033b746ff91bff2657a0971edb07bff2","src/dsound.rs":"53a5532d645e1b7995f0b4a0f0711fc66da8a27b7f8c87ce3d9e0882cfdca07c","src/dsrole.rs":"50b27a8afb11188ce24ab49620fe69ea21658148d8fd6076b8927175db5c1a9e","src/dwmapi.rs":"e65ca961eec0db275e211e04c59a8995c8c13d36ab08dc36ce197d9a4856266f","src/dwrite.rs":"f138d36e8b93778a7866cc755893b4da19cfd6ce42427139589a0bbaa294eb44","src/dxgi.rs":"5b6fcc5c665df1c0c6ed3de5d678a7bade1bb8ab1acbe952b784ce99fc817e53","src/dxgi1_2.rs":"6ba44755d715f2493236103fc5c24d7d45dff2e1fc3690aefbd4eb6c859dbc07","src/dxgi1_3.rs":"1f86a9db5fd45199fcc3ce56423e5fcf0c58df4001e2b50c5586d38ab820b78f","src/dxgi1_4.rs":"c578e6fcb82d535b20fc10232b75a7b9512d068919cc1e3f1c7cf55f3eb46460","src/dxgiformat.rs":"2e73df34f480b6ef3b5e21de0a520dacec91b00772e42786568fd162ca5e9aa6","src/dxgitype.rs":"204b8dae38c13a1dd8cd2ce6ca68851f743b416213d6db1cd0d96808bcbf7058","src/errhandlingapi.rs":"a70f9db3dd8ab60aba0daf39f12b527e54e312ca640e0b80d80c93ffdb6913c6","src/excpt.rs":"b07cf9ff0d23dd50c0776d048d0c579e401b7d729635f78998f85d35f33f05a4","src/fileapi.rs":"d31814c612bbd9372abbf6f8455fc2af89ac236c6b1855da10d66545e485ec57","src/gl.rs":"9429708bb97aeecb2c40030460ed0c3415fc0f2335c9513c68afa6157bd9b465","src/guiddef.rs":"86618dcd39c77048c7e453e6e86dafe90358eb7f97144f9672ae09e7b9855729","src/heapapi.rs":"21e420ba7641e507e8f2801d2b0ed25dbcb98e967924d711beb5cbfa8a5785e4","src/hidclass.rs":"a93380d35dc4d45807b10bbd69ee63eb8517b75989b68391685070a2fcfbefa1","src/hidpi.rs":"0b641fc119ac35761fe8e5eaed9a0781e9018598ea269d6cd386dbf5563ab9a0","src/hidsdi.rs":"50abb938ea8d0af90ccdea7ac3de4bc10fe42e34bc6a6d6eb4da1b330727da34","src/hidusage.rs":"44adc029bc89f0d4977b1295b7e998ddabf5283de66e1e33146bda8968d1d98b","src/hstring.rs":"51b3e63e3f1ed48f54c63c3e820e0563fb857b2743529d5f947f718d43425b89","src/http.rs":"ebb8b8db9e786e2683ad8b9a9066ef418df773ae7ce4d75f166cb5321f85f5a0","src/imm.rs":"b9277502f17f4cc6bde4f80f722ec1b976913355edbf162814ccfec2b3b080fd","src/inaddr.rs":"938143669da02c83a31d207be11e2176ed5219edf0e6f8f7a5534a5c6c3ce8d1","src/inspectable.rs":"b01f1814a233a77bf9f25c264747252c0464388c7d9c7302e5bde57502b8139b","src/ksmedia.rs":"acb96b1ea0cf3b5397f9037958093c6b4dbb54c4246516e57b9fed055e8e69c1","src/lib.rs":"8a7840b030f56883f68bdf90a1a04df8be2a5e2698a9ea86c73fac59c9f09b6e","src/libloaderapi.rs":"21a5d17c9f8ac4c006b515979964a8870f30710be4482083f45c6a41a16a36ce","src/lmaccess.rs":"712661c871569513334152bdcdf56c07776c560a22cd5b892a0f38e1957e28db","src/lmcons.rs":"3449aab4399cc36e7d7db551e384d82dfa4204178c4cfb9642f90645687fbc81","src/lmdfs.rs":"c351cdb2d10bf3a7c5ce7400dcdca41a792554e21e75fa9e5378ac18d8d3e4e7","src/lmerrlog.rs":"7937928544d27575e302c5e9c5e6803e9033e1f4d715e7ca29be202276d7d7a6","src/lmjoin.rs":"362cdc71f3f50099b862eff0733b3a57dd0f95cac15943135f794424f651b916","src/lsalookup.rs":"4aef1a95033444181f2b2b9df364ea165b0fdedb396c63e5d12db6b7398a3d5f","src/macros.rs":"5dacc570f226b6f1ad31d76a03675f0d182a3d578846920000fabb7cd92fc7f8","src/memoryapi.rs":"2273b8bfd7fc36dcf654c320826952ad502e8922a84174f8c1f7ed08aa555a04","src/minschannel.rs":"139828de63a0a4476de2bee454f5bca5e8a46cc29f1680339bb2804ee2d17322","src/minwinbase.rs":"6cd387a7f79e1a708bc48b5b27eaeaa7aadf0fff7a5e0a76cda0bdf3fa871863","src/minwindef.rs":"47ba4f2ec7789109ae339170715ed76288ae60ee57a4f06d5cc50a0e6855699f","src/mmdeviceapi.rs":"c8b7f7b6b78488d23ccba2b34e8765eac60ec9f08e19c96b377d957f65b1b6d1","src/mmreg.rs":"1621fad6eaa16d1e5ca95055fd11bf066b777b1343625f9fdc74e4d313d60dea","src/mmsystem.rs":"f6a2bff3bf80af1468de2c2a5f7ff2ced2b625adaf24f08f9b303965ed5ee371","src/mscat.rs":"9226a8e30546c4142e4fcdc716f8a15cc7c8081c9e875ec72ff9e8551f86f9a1","src/mssip.rs":"d7e2b91e358ff4986e700396d04f92aa1671aafada0d4889914a413177c091e1","src/nb30.rs":"dd85d7849111f04d33895835269929dc219e04de4373e91468eb053e3e0a5c52","src/ncrypt.rs":"29f168dcddeaa2cb231a7174cec672be83cca192ffc4632cead4c4a25189fb49","src/ntdef.rs":"3be66042d16a862f0fed8f48406b08c3091fbf92885a44efb7747f4a764d7de7","src/ntsecapi.rs":"dfb2cc7e23e8b20fa5ffd30ccecdb81b62d8ffeb68fdf99f93fb141ff4155afd","src/ntstatus.rs":"de6208f4e119a6405c1726433ea5e47a8b5f46b345f5809e9f580cce88360a79","src/oaidl.rs":"640c911e39888928baf77145cca34c1a768bfd759ec9709f70649a2946cb3246","src/objbase.rs":"7c9edb6a9ea72baddb15a6aec3602b3f9e7b1ce969dd655f440eae0ede1372e2","src/objidl.rs":"2a623b989f2a216edca3bd118eceff41267632839a3fd4410df9a7c126a87b64","src/objidlbase.rs":"3415a0bcd1b5b63ff48e17138ff87dae7c31eaeb323ae81f34b6712efade1d04","src/olectl.rs":"da2014c3d5858c5abff1635e1b8c8223333e7d22d28cac614aac3305a7f04ee4","src/pdh.rs":"eb01459c2acc456ecd204c6716d26027a6c77c2b4a9b698d3c922254fe2cc319","src/playsoundapi.rs":"7efddfc8601de565946c8c93074211c83b20866a1588e36e0518bba9864d0cf0","src/processsnapshot.rs":"df99a56280e6e41c5896341ffa1abe734f6c8662f4d7ea960cb97fb34c5b85d9","src/processthreadsapi.rs":"bf8edf8984ee97bc5054e68d02ec4633b5f15720602ab19c95d78e7d420c9cc8","src/propidl.rs":"88b5f176e4624063cadd8db95db52bf07cff421d73a8cfe319f992a9c99cd315","src/propsys.rs":"05c411639479f88e77383c585117a886f48ea7453260210db9f283e2cafdffbf","src/prsht.rs":"f862538c0010a51a02e5f24b3a44b54ba5993c32400b98a3b0558741ae7473a3","src/psapi.rs":"512523c5f8334c9ad221a73776c0ed2da93d8e2353dc4d2cee951ffa6ea7c163","src/qos.rs":"9ef6183b7c03b5b412f81f38ebb06048ff6266032bc236964dd994f173b82ec4","src/reason.rs":"c92aded3bbea859f110eed73b9b0fb40df6ac4a6ed6431ca69882b46b5ad5229","src/restrictederrorinfo.rs":"b8c53f4ae149ea806028cdafe699390a20202d72028b5f62836bcbf97720d133","src/roapi.rs":"dbbefb19f402a2aece66b500739b0a9e2c4d0133a8bc94d076510d5a67def175","src/roerrorapi.rs":"84a0a71a3f9ce67a577954ee5761cbd97d892eb5e7eb2c381f6bd29d4e1d4af7","src/rpc.rs":"e2293651222edf37f3ad3076adaae9033b25b06bd7b88ed7372585a4ae46c7d9","src/rpcdce.rs":"de77ca3c9b689ffaaf395a6882d3dfc3a1cec181efa6cb6075e605e4462bc3f6","src/sapi.rs":"05dbc1166b836251538c9e52a772fa584a1d0a1ad823e4336ab5e6cfefb96d57","src/schannel.rs":"e48926896227ffae5033bd634a7c71f5359d7a08b7b8c6e94e03864d87a37f8b","src/servprov.rs":"f086b4330162c7da711ea59d7023304a8fa2a53470b54d846ea1c11567703693","src/setupapi.rs":"4959862dd39597cd711022fcefbaf5c75b61410d57d04e9dbec2ddf7a2fa6f31","src/shellapi.rs":"ce3e3e7cd8aefe8068d6c51256827c0c3d51a449e4ab73e7125ea28d44dd6b6d","src/shellscalingapi.rs":"59c162b0215ff4b71b3535b6e142cca8cd99028031f47f0a6efb960c160a8776","src/shlguid.rs":"dcb7a1ada1b1b90f405e6dea8bcf1fc6994725b49a3165b7908670b2c31490e5","src/shlobj.rs":"53ff059ec6123001bed8f007c36e40812f83e4e04bd50b371319d10b4e38c36f","src/shobjidl.rs":"953d6ef4dc2a0d175d7133dc2f41255123ab8f778b22feaebd8ca1fa77356aa7","src/shtypes.rs":"ff785004e819bcfc521ab79327e58f98debab4e40c20412bbecdcee1b2801371","src/spapidef.rs":"9abe751425b6aaac7e4a7ea49f6d8e859f8f73164abd4d69b48e3e224d7de829","src/sql.rs":"004ed353b40bb4bceab55d6e8c33063a8eac992b076e47e6ead8303dbbc5b67f","src/sqltypes.rs":"0c5fa183c9f5b9e16e292de6a9afdf73f554730e651250856148ac04718803b8","src/sspi.rs":"dbd9d544abea4396983867ef4f7fbe2588673cc953dbeb74e7edc46503b16fa0","src/strmif.rs":"168040999cf99843cc1447988e46c56481a7a343ae41ab854db40ef566fa1119","src/subauth.rs":"183dd0df6436e9f0e859d62ca78e8ed42d4c1a5dc0690dcf22d42467fd2e0700","src/synchapi.rs":"cfce677c85377a340cb9307d9ac9eb06ffe9fd5e2ce08ed4a0390729e3a7d717","src/sysinfoapi.rs":"9a5579143263ce20d8c365b9874a0ae90ef28bc3295eab26ba3782efa48b464a","src/threadpoolapi.rs":"57876ea70b86d08663f7916ce076547f17596c26b8bf4dfafbad60e78264ff95","src/timezoneapi.rs":"5ccd80e6d16a858c56e20a7f3c5570e29777dab0fdfc057b6d2fb06463d56eb3","src/tlhelp32.rs":"c96ef7416bceab473463cc4ad98f037aeaac87bb7adf45cc16c281308537e82f","src/unknwnbase.rs":"2708c19491deb7364100025f3bb88a791c219551a65af70a776f8f3c5bf18b05","src/urlhist.rs":"8c8c0d0a613e59f68bf0e8cec061ea2126baa98d1479df4d07c8df5e41b50bc1","src/urlmon.rs":"0652e602ef2f5826360e5eab68bdf4f9365827a012c2c89289c54016ea001b74","src/usb.rs":"7e682ee819b237eabe796e604cff2434c450f724f4c86d919683eb7a5167c343","src/usbspec.rs":"d19671960838eb592cda4cd7c84c6f66cd9484f0904b5a28e1d8fd91e9c2c6af","src/usp10.rs":"baa2c1ef6ca5f064bc55b24f39c0553ede45a87b9183318572916fd4f1c679c6","src/vadefs.rs":"0e2f12fd1c521a943908669b2d10fceea409bac45242ec6e87c0e69706c1b3d0","src/vsbackup.rs":"af71cb851bd7eacde9d3e46a112497baef3ecebb472aae3c76c7faff804d33f9","src/vss.rs":"a626613810a69309b8f50d0a3bd75928d9de771c2287b6242487cb8cd55394a0","src/vsserror.rs":"f06b108d66ea9f06ad15d83b981117ed6a2a9cd218bb3bf53f13b0055acd9b2e","src/vswriter.rs":"8c4f5d27fa0883d187506538136cc610074941bb952afbe0984f7cb7c3c656f7","src/werapi.rs":"a2d692514ff3a61126971c5c2c5a7298c0f822559550a7f14501f8c96d1d951a","src/winbase.rs":"e224c40d827b1f1a9c74643c000f71e87ad18f749810cc611425af325c9472b8","src/wincon.rs":"402c5ebf80aa6ab1002935b7ddca17e8a243d0c714982054395862fe0ae40a04","src/wincred.rs":"e5fa987622dd880151ae190bb45daa666ffae3ae8e2da97407210afe01dd93d6","src/wincrypt.rs":"f7f8743b6a89d3f5e8b07405e43010bb3729aa8a8cf4546cc02705f802947ebc","src/windef.rs":"89fa9f5ab2909a4840f16979ebbc0afa2134abcb1d47cb7435b581f31b227658","src/windowscodecs.rs":"7c63bc4e2d0e7ce60c7bb13b93ef5aa12213f71a46845b6e034a9c224ef3eb3c","src/windowsx.rs":"414a9a841590f88804da3eb9ba55d583372a467cc50ab1ebdd7cfc653ce5f627","src/winerror.rs":"f3882eba4e299acbdedd548feb1ff89de958fb72d665bd6ba013b6a1f7596b52","src/winevt.rs":"64ae96f475ed98da7a84704d53d16caccbac2dbd525de0ef0f65fc58a6775ed1","src/wingdi.rs":"35aa9dd14b4b4c5a227ac3df0d312c19cbaede2d1388c26ad8eb910e80efeafd","src/winhttp.rs":"37769be104a2eb9efa70ffd74c8f38a09d9639cf575a677ad75d941e8d87cd58","src/winioctl.rs":"0f0efe0a41894a325b70428d04aeddec8dd7a87a91489a4e564a248e8498861b","src/winnetwk.rs":"d492c3d14a422f611166d39b895ddc6dd749ebc64a020bf3125af452494f91dd","src/winnls.rs":"90904d6adad70081a620165223fb4a71b64d747596c64d0df7de9511cd0f75c6","src/winnt.rs":"2c51ad0a065006010f1cfe7a3335274304e4747adc63f9798e1ca1f7091154a5","src/winreg.rs":"c687a5c6433daa13793815ef9af8befaedc9635be14eea0c618ad5334952dc31","src/winscard.rs":"78ab1d3ae22e486726740c343a4cc6268ca318de43f4b7d7ba51acbdf1b93936","src/winsmcrd.rs":"62be129c3d4cdea9dd31e769b587f071a94c347c8df71a43bb1eea18d52a60cc","src/winsock2.rs":"21dc0393f37f56c15c59d49a32861fb24c8f28d43ce26b56d958a174a5040a76","src/winspool.rs":"a3bd8e04f2db6118fe529bf52cb856a773cd8b816d197fc8edc8ac942578fd74","src/winstring.rs":"dc535f972d93be2fe067a5ca64edb45b6ad8e4549ecc0ce24486bd94555d5707","src/winsvc.rs":"7999f00b341f3e0e8701ea89f71986a6600650ff8cffdb1292e9f55d47bd0a3e","src/winusb.rs":"0ac355aa879a4aae501db04f1e8859dbef5e33fda9d46a7a12ef25e5524ec396","src/winusbio.rs":"8e2d64832999b59b2ea900396184c36d34cf94c97f31e15916c299213748a3e1","src/winuser.rs":"791bd8625812feccc8ec421489194d635c94cb4c4d754287a0caa54fa8f71c19","src/ws2def.rs":"0a1c7a69e4da8edc0584b0e3fb4ad1fa4aed621510b1bc1b0d104990577c6a38","src/ws2ipdef.rs":"c6a898cf25d187ad83e110af1e2286824868691a60818ecc44e68fa0bbbd4ff6","src/ws2spi.rs":"e63da700de55a317769230319eb9e4ec85cc0ac80b2baa076399367338b7ca0f","src/ws2tcpip.rs":"698084fd5d631a2ef236fe76001e7c44afd9b8958243e4ad4c098ac4beb4b352","src/wtypes.rs":"2689e8f442ccdc0b0e1ec82160a5cc3e80abf95dca82855ec595314062774a14","src/wtypesbase.rs":"f6dc0a8b09f3f003339c5dd366bdddb9dd671894be9dcf4a42058b226d2917a8","src/xinput.rs":"e15cd46bf18977481e22d609f8e0bb5508776902d7fa64477bb5b78596c0f67d"},"package":"167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor/winapi-build/.cargo-checksum.json distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/winapi-build/.cargo-checksum.json --- distinst-0.1.0/vendor/winapi-build/.cargo-checksum.json 2017-09-20 20:04:24.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor/winapi-build/.cargo-checksum.json 2017-12-21 19:00:07.000000000 +0000 @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"982633c62ba05c95429b1768896a54c9a032a40fbd1e11049a9b087e9fd89176","src/lib.rs":"1d88932534b784973d3d87ac18cd8f2a0294ce5166cf30488c68ca90443e1750"},"package":"2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"} \ No newline at end of file +{"files":{"Cargo.toml":"982633c62ba05c95429b1768896a54c9a032a40fbd1e11049a9b087e9fd89176","src/lib.rs":"1d88932534b784973d3d87ac18cd8f2a0294ce5166cf30488c68ca90443e1750"},"package":"2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"} \ No newline at end of file diff -Nru distinst-0.1.0/vendor_config distinst-0.2.0+1513882807+18.04~34a6ac4/vendor_config --- distinst-0.1.0/vendor_config 1970-01-01 00:00:00.000000000 +0000 +++ distinst-0.2.0+1513882807+18.04~34a6ac4/vendor_config 2017-12-21 19:00:07.000000000 +0000 @@ -0,0 +1,5 @@ +[source.crates-io] +replace-with = "vendor" + +[source.vendor] +directory = "vendor"