├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── README.md ├── cabal.project ├── example └── ffs │ ├── .gitignore │ ├── Cargo.toml │ └── lib.rs ├── exe └── Main.hs ├── lib ├── backtrace │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── benches │ │ └── benchmarks.rs │ ├── ci │ │ ├── android-ndk.sh │ │ ├── android-sdk.sh │ │ ├── docker │ │ │ ├── aarch64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── aarch64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── arm-linux-androideabi │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── armv7-linux-androideabi │ │ │ │ └── Dockerfile │ │ │ ├── armv7-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── i586-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── i686-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── i686-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-pc-windows-gnu │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ └── x86_64-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ ├── run-docker.sh │ │ ├── run.sh │ │ └── runtest-android.rs │ ├── crates │ │ ├── backtrace-sys │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE-APACHE │ │ │ ├── LICENSE-MIT │ │ │ ├── build.rs │ │ │ └── src │ │ │ │ ├── android-api.c │ │ │ │ └── lib.rs │ │ ├── cpp_smoke_test │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ ├── cpp │ │ │ │ └── trampoline.cpp │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── tests │ │ │ │ └── smoke.rs │ │ └── without_debuginfo │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ └── lib.rs │ │ │ └── tests │ │ │ └── smoke.rs │ ├── examples │ │ ├── backtrace.rs │ │ └── raw.rs │ ├── src │ │ ├── backtrace │ │ │ ├── dbghelp.rs │ │ │ ├── libunwind.rs │ │ │ ├── mod.rs │ │ │ ├── noop.rs │ │ │ └── unix_backtrace.rs │ │ ├── capture.rs │ │ ├── dbghelp.rs │ │ ├── lib.rs │ │ ├── print.rs │ │ ├── print │ │ │ └── fuchsia.rs │ │ ├── symbolize │ │ │ ├── coresymbolication.rs │ │ │ ├── dbghelp.rs │ │ │ ├── dladdr.rs │ │ │ ├── dladdr_resolve.rs │ │ │ ├── gimli.rs │ │ │ ├── libbacktrace.rs │ │ │ ├── mod.rs │ │ │ └── noop.rs │ │ ├── types.rs │ │ └── windows.rs │ └── tests │ │ ├── accuracy │ │ ├── auxiliary.rs │ │ └── main.rs │ │ ├── concurrent-panics.rs │ │ ├── long_fn_name.rs │ │ ├── skip_inner_frames.rs │ │ └── smoke.rs ├── bigint │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── benches │ │ └── bigint.rs │ ├── examples │ │ └── modular.rs │ └── src │ │ ├── lib.rs │ │ └── uint.rs ├── byteorder │ ├── LICENSE-MIT │ ├── io.rs │ └── lib.rs ├── bytes.rs ├── cfg-if │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ └── lib.rs │ └── tests │ │ └── xcrate.rs ├── compiler-builtins │ ├── Cargo.toml │ ├── LICENSE.TXT │ ├── PUBLISHING.md │ ├── README.md │ ├── build.rs │ ├── ci │ │ ├── docker │ │ │ ├── aarch64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-gnueabi │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── armv7-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── i586-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── i686-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── mips-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── mips64-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mips64el-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mipsel-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64le-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── thumbv6m-none-eabi │ │ │ │ └── Dockerfile │ │ │ ├── thumbv7em-none-eabi │ │ │ │ └── Dockerfile │ │ │ ├── thumbv7em-none-eabihf │ │ │ │ └── Dockerfile │ │ │ ├── thumbv7m-none-eabi │ │ │ │ └── Dockerfile │ │ │ └── x86_64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ ├── run-docker.sh │ │ └── run.sh │ ├── crates │ │ └── panic-handler │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── examples │ │ └── intrinsics.rs │ ├── src │ │ ├── arm.rs │ │ ├── arm_linux.rs │ │ ├── float │ │ │ ├── add.rs │ │ │ ├── cmp.rs │ │ │ ├── conv.rs │ │ │ ├── div.rs │ │ │ ├── extend.rs │ │ │ ├── mod.rs │ │ │ ├── mul.rs │ │ │ ├── pow.rs │ │ │ └── sub.rs │ │ ├── int │ │ │ ├── addsub.rs │ │ │ ├── mod.rs │ │ │ ├── mul.rs │ │ │ ├── sdiv.rs │ │ │ ├── shift.rs │ │ │ └── udiv.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── math.rs │ │ ├── mem.rs │ │ ├── probestack.rs │ │ ├── riscv32.rs │ │ ├── x86.rs │ │ └── x86_64.rs │ ├── test.c │ ├── testcrate │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ ├── aeabi_memclr.rs │ │ │ ├── aeabi_memcpy.rs │ │ │ ├── aeabi_memset.rs │ │ │ ├── count_leading_zeros.rs │ │ │ └── generated.rs │ ├── thumbv6m-linux-eabi.json │ ├── thumbv7em-linux-eabi.json │ ├── thumbv7em-linux-eabihf.json │ └── thumbv7m-linux-eabi.json ├── crucible │ ├── alloc.rs │ ├── array.rs │ ├── bitvector.rs │ ├── lib.rs │ ├── sym_bytes.rs │ ├── symbolic.rs │ └── vector.rs ├── getopts │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ ├── lib.rs │ │ └── tests │ │ │ └── mod.rs │ └── tests │ │ └── smoke.rs ├── hashbrown │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── bors.toml │ ├── build.rs │ ├── ci │ │ ├── miri.sh │ │ ├── run.sh │ │ └── tools.sh │ ├── clippy.toml │ ├── src │ │ ├── external_trait_impls │ │ │ ├── mod.rs │ │ │ ├── rayon │ │ │ │ ├── helpers.rs │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── raw.rs │ │ │ │ └── set.rs │ │ │ └── serde.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── map.rs │ │ ├── raw │ │ │ ├── bitmask.rs │ │ │ ├── generic.rs │ │ │ ├── mod.rs │ │ │ └── sse2.rs │ │ ├── rustc_entry.rs │ │ ├── scopeguard.rs │ │ └── set.rs │ └── tests │ │ ├── hasher.rs │ │ ├── rayon.rs │ │ ├── serde.rs │ │ └── set.rs ├── int512.rs ├── liballoc │ ├── Cargo.toml │ ├── alloc.rs │ ├── alloc │ │ └── tests.rs │ ├── benches │ │ ├── btree │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ └── set.rs │ │ ├── lib.rs │ │ ├── linked_list.rs │ │ ├── slice.rs │ │ ├── str.rs │ │ ├── string.rs │ │ ├── vec.rs │ │ ├── vec_deque.rs │ │ └── vec_deque_append.rs │ ├── borrow.rs │ ├── boxed.rs │ ├── collections │ │ ├── binary_heap.rs │ │ ├── btree │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ ├── navigate.rs │ │ │ ├── node.rs │ │ │ ├── search.rs │ │ │ └── set.rs │ │ ├── linked_list.rs │ │ ├── linked_list │ │ │ └── tests.rs │ │ ├── mod.rs │ │ ├── vec_deque.rs │ │ └── vec_deque │ │ │ ├── drain.rs │ │ │ └── tests.rs │ ├── fmt.rs │ ├── lib.rs │ ├── macros.rs │ ├── prelude │ │ ├── mod.rs │ │ └── v1.rs │ ├── raw_vec.rs │ ├── raw_vec │ │ └── tests.rs │ ├── rc.rs │ ├── rc │ │ └── tests.rs │ ├── slice.rs │ ├── str.rs │ ├── string.rs │ ├── sync.rs │ ├── sync │ │ └── tests.rs │ ├── tests.rs │ ├── tests │ │ ├── arc.rs │ │ ├── binary_heap.rs │ │ ├── boxed.rs │ │ ├── btree │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ └── set.rs │ │ ├── cow_str.rs │ │ ├── fmt.rs │ │ ├── heap.rs │ │ ├── lib.rs │ │ ├── linked_list.rs │ │ ├── rc.rs │ │ ├── slice.rs │ │ ├── str.rs │ │ ├── string.rs │ │ ├── vec.rs │ │ └── vec_deque.rs │ └── vec.rs ├── libc │ ├── CONTRIBUTING.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── build.rs │ ├── ci │ │ ├── README.md │ │ ├── android-install-ndk.sh │ │ ├── android-install-sdk.sh │ │ ├── android-sysimage.sh │ │ ├── azure-install-rust.yml │ │ ├── azure-master.yml │ │ ├── azure.yml │ │ ├── build.sh │ │ ├── docker │ │ │ ├── aarch64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── aarch64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── aarch64-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ │ ├── arm-linux-androideabi │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-musleabihf │ │ │ │ └── Dockerfile │ │ │ ├── asmjs-unknown-emscripten │ │ │ │ └── Dockerfile │ │ │ ├── i686-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── i686-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── i686-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ │ ├── mips-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── mips-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ │ ├── mips64-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mips64-unknown-linux-muslabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mips64el-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mips64el-unknown-linux-muslabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mipsel-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ │ ├── powerpc-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64le-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── s390x-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── sparc64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── wasm32-unknown-emscripten │ │ │ │ ├── Dockerfile │ │ │ │ └── node-wrapper.sh │ │ │ ├── wasm32-wasi │ │ │ │ ├── Dockerfile │ │ │ │ └── clang.sh │ │ │ ├── x86_64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-rumprun-netbsd │ │ │ │ ├── Dockerfile │ │ │ │ └── runtest.rs │ │ │ ├── x86_64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-unknown-linux-gnux32 │ │ │ │ └── Dockerfile │ │ │ └── x86_64-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ ├── dox.sh │ │ ├── emscripten-entry.sh │ │ ├── emscripten.sh │ │ ├── install-musl.sh │ │ ├── ios │ │ │ └── deploy_and_run_on_ios_simulator.rs │ │ ├── linux-s390x.sh │ │ ├── linux-sparc64.sh │ │ ├── run-docker.sh │ │ ├── run-qemu.sh │ │ ├── run.sh │ │ ├── runtest-android.rs │ │ ├── semver.sh │ │ ├── style.rs │ │ ├── style.sh │ │ ├── switch.json │ │ ├── sysinfo_guard.patch │ │ └── test-runner-linux │ ├── libc-test │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src │ │ │ ├── cmsg.c │ │ │ └── errqueue.c │ │ └── test │ │ │ ├── cmsg.rs │ │ │ ├── errqueue.rs │ │ │ ├── linux_elf.rs │ │ │ ├── linux_fcntl.rs │ │ │ ├── linux_ipv6.rs │ │ │ ├── linux_strerror_r.rs │ │ │ ├── linux_termios.rs │ │ │ └── main.rs │ ├── rustfmt.toml │ ├── src │ │ ├── cloudabi │ │ │ ├── aarch64.rs │ │ │ ├── arm.rs │ │ │ ├── mod.rs │ │ │ ├── x86.rs │ │ │ └── x86_64.rs │ │ ├── fixed_width_ints.rs │ │ ├── fuchsia │ │ │ ├── aarch64.rs │ │ │ ├── align.rs │ │ │ ├── mod.rs │ │ │ ├── no_align.rs │ │ │ └── x86_64.rs │ │ ├── hermit │ │ │ ├── aarch64.rs │ │ │ ├── mod.rs │ │ │ └── x86_64.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── sgx.rs │ │ ├── switch.rs │ │ ├── unix │ │ │ ├── align.rs │ │ │ ├── bsd │ │ │ │ ├── apple │ │ │ │ │ ├── b32 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── b64 │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── freebsdlike │ │ │ │ │ ├── dragonfly │ │ │ │ │ │ ├── errno.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── freebsd │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ ├── arm.rs │ │ │ │ │ │ ├── freebsd11 │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ │ ├── freebsd12 │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ └── x86_64.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ │ ├── x86.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── mod.rs │ │ │ │ └── netbsdlike │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── netbsd │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ ├── arm.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ ├── sparc64.rs │ │ │ │ │ ├── x86.rs │ │ │ │ │ └── x86_64.rs │ │ │ │ │ └── openbsd │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── sparc64.rs │ │ │ │ │ ├── x86.rs │ │ │ │ │ └── x86_64.rs │ │ │ ├── haiku │ │ │ │ ├── b32.rs │ │ │ │ ├── b64.rs │ │ │ │ └── mod.rs │ │ │ ├── hermit │ │ │ │ ├── aarch64.rs │ │ │ │ ├── mod.rs │ │ │ │ └── x86_64.rs │ │ │ ├── linux_like │ │ │ │ ├── android │ │ │ │ │ ├── b32 │ │ │ │ │ │ ├── arm.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── b64 │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── emscripten │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ ├── linux │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── gnu │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ ├── b32 │ │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ │ │ ├── sparc │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── b64 │ │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mips64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ ├── powerpc64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── riscv64 │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── s390x.rs │ │ │ │ │ │ │ ├── sparc64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ │ ├── not_x32.rs │ │ │ │ │ │ │ │ └── x32.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── no_align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── musl │ │ │ │ │ │ ├── b32 │ │ │ │ │ │ │ ├── arm │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── hexagon.rs │ │ │ │ │ │ │ ├── mips │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ │ │ └── x86 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── b64 │ │ │ │ │ │ │ ├── aarch64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ │ ├── mips64.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ │ │ └── x86_64 │ │ │ │ │ │ │ │ ├── align.rs │ │ │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ ├── newlib │ │ │ │ ├── aarch64 │ │ │ │ │ └── mod.rs │ │ │ │ ├── align.rs │ │ │ │ ├── arm │ │ │ │ │ └── mod.rs │ │ │ │ ├── mod.rs │ │ │ │ └── no_align.rs │ │ │ ├── no_align.rs │ │ │ ├── redox │ │ │ │ └── mod.rs │ │ │ ├── solarish │ │ │ │ ├── compat.rs │ │ │ │ └── mod.rs │ │ │ └── uclibc │ │ │ │ ├── align.rs │ │ │ │ ├── arm │ │ │ │ ├── align.rs │ │ │ │ ├── mod.rs │ │ │ │ └── no_align.rs │ │ │ │ ├── mips │ │ │ │ ├── mips32 │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ ├── mips64 │ │ │ │ │ ├── align.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── no_align.rs │ │ │ │ └── mod.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── no_align.rs │ │ │ │ └── x86_64 │ │ │ │ ├── align.rs │ │ │ │ ├── l4re.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── no_align.rs │ │ │ │ └── other.rs │ │ ├── vxworks │ │ │ ├── aarch64.rs │ │ │ ├── arm.rs │ │ │ ├── mod.rs │ │ │ ├── powerpc.rs │ │ │ ├── powerpc64.rs │ │ │ ├── x86.rs │ │ │ └── x86_64.rs │ │ ├── wasi.rs │ │ └── windows │ │ │ ├── gnu │ │ │ ├── align.rs │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ └── msvc.rs │ └── tests │ │ └── const_fn.rs ├── libcore │ ├── Cargo.toml │ ├── alloc.rs │ ├── any.rs │ ├── array │ │ ├── iter.rs │ │ └── mod.rs │ ├── ascii.rs │ ├── benches │ │ ├── any.rs │ │ ├── ascii.rs │ │ ├── char │ │ │ ├── methods.rs │ │ │ └── mod.rs │ │ ├── fmt.rs │ │ ├── hash │ │ │ ├── mod.rs │ │ │ └── sip.rs │ │ ├── iter.rs │ │ ├── lib.rs │ │ ├── num │ │ │ ├── dec2flt │ │ │ │ └── mod.rs │ │ │ ├── flt2dec │ │ │ │ ├── mod.rs │ │ │ │ └── strategy │ │ │ │ │ ├── dragon.rs │ │ │ │ │ └── grisu.rs │ │ │ └── mod.rs │ │ ├── ops.rs │ │ ├── pattern.rs │ │ └── slice.rs │ ├── bool.rs │ ├── borrow.rs │ ├── cell.rs │ ├── char │ │ ├── convert.rs │ │ ├── decode.rs │ │ ├── methods.rs │ │ └── mod.rs │ ├── clone.rs │ ├── cmp.rs │ ├── convert │ │ ├── mod.rs │ │ └── num.rs │ ├── crucible │ │ ├── any.rs │ │ ├── mod.rs │ │ └── ptr.rs │ ├── default.rs │ ├── ffi.rs │ ├── fmt │ │ ├── builders.rs │ │ ├── float.rs │ │ ├── mod.rs │ │ ├── num.rs │ │ └── rt │ │ │ └── v1.rs │ ├── future │ │ ├── future.rs │ │ └── mod.rs │ ├── hash │ │ ├── mod.rs │ │ └── sip.rs │ ├── hint.rs │ ├── internal_macros.rs │ ├── intrinsics.rs │ ├── iter │ │ ├── adapters │ │ │ ├── chain.rs │ │ │ ├── flatten.rs │ │ │ ├── mod.rs │ │ │ └── zip.rs │ │ ├── mod.rs │ │ ├── range.rs │ │ ├── sources.rs │ │ └── traits │ │ │ ├── accum.rs │ │ │ ├── collect.rs │ │ │ ├── double_ended.rs │ │ │ ├── exact_size.rs │ │ │ ├── iterator.rs │ │ │ ├── marker.rs │ │ │ └── mod.rs │ ├── lib.rs │ ├── macros │ │ ├── mod.rs │ │ └── panic.md │ ├── marker.rs │ ├── mem │ │ ├── manually_drop.rs │ │ ├── maybe_uninit.rs │ │ └── mod.rs │ ├── num │ │ ├── bignum.rs │ │ ├── dec2flt │ │ │ ├── algorithm.rs │ │ │ ├── mod.rs │ │ │ ├── num.rs │ │ │ ├── parse.rs │ │ │ ├── rawfp.rs │ │ │ └── table.rs │ │ ├── diy_float.rs │ │ ├── f32.rs │ │ ├── f64.rs │ │ ├── flt2dec │ │ │ ├── decoder.rs │ │ │ ├── estimator.rs │ │ │ ├── mod.rs │ │ │ └── strategy │ │ │ │ ├── dragon.rs │ │ │ │ └── grisu.rs │ │ ├── i128.rs │ │ ├── i16.rs │ │ ├── i32.rs │ │ ├── i64.rs │ │ ├── i8.rs │ │ ├── int_macros.rs │ │ ├── isize.rs │ │ ├── mod.rs │ │ ├── u128.rs │ │ ├── u16.rs │ │ ├── u32.rs │ │ ├── u64.rs │ │ ├── u8.rs │ │ ├── usize.rs │ │ └── wrapping.rs │ ├── ops │ │ ├── arith.rs │ │ ├── bit.rs │ │ ├── deref.rs │ │ ├── drop.rs │ │ ├── function.rs │ │ ├── generator.rs │ │ ├── index.rs │ │ ├── mod.rs │ │ ├── range.rs │ │ ├── try.rs │ │ └── unsize.rs │ ├── option.rs │ ├── panic.rs │ ├── panicking.rs │ ├── pin.rs │ ├── prelude │ │ ├── mod.rs │ │ └── v1.rs │ ├── primitive.rs │ ├── ptr │ │ ├── const_ptr.rs │ │ ├── mod.rs │ │ ├── mut_ptr.rs │ │ ├── non_null.rs │ │ └── unique.rs │ ├── raw.rs │ ├── result.rs │ ├── slice │ │ ├── memchr.rs │ │ ├── mod.rs │ │ ├── rotate.rs │ │ └── sort.rs │ ├── str │ │ ├── lossy.rs │ │ ├── mod.rs │ │ └── pattern.rs │ ├── sync │ │ ├── atomic.rs │ │ └── mod.rs │ ├── task │ │ ├── mod.rs │ │ ├── poll.rs │ │ └── wake.rs │ ├── tests │ │ ├── alloc.rs │ │ ├── any.rs │ │ ├── array.rs │ │ ├── ascii.rs │ │ ├── atomic.rs │ │ ├── bool.rs │ │ ├── cell.rs │ │ ├── char.rs │ │ ├── clone.rs │ │ ├── cmp.rs │ │ ├── fmt │ │ │ ├── builders.rs │ │ │ ├── float.rs │ │ │ ├── mod.rs │ │ │ └── num.rs │ │ ├── hash │ │ │ ├── mod.rs │ │ │ └── sip.rs │ │ ├── intrinsics.rs │ │ ├── iter.rs │ │ ├── lib.rs │ │ ├── manually_drop.rs │ │ ├── mem.rs │ │ ├── nonzero.rs │ │ ├── num │ │ │ ├── bignum.rs │ │ │ ├── dec2flt │ │ │ │ ├── mod.rs │ │ │ │ ├── parse.rs │ │ │ │ └── rawfp.rs │ │ │ ├── flt2dec │ │ │ │ ├── estimator.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── random.rs │ │ │ │ └── strategy │ │ │ │ │ ├── dragon.rs │ │ │ │ │ └── grisu.rs │ │ │ ├── i16.rs │ │ │ ├── i32.rs │ │ │ ├── i64.rs │ │ │ ├── i8.rs │ │ │ ├── int_macros.rs │ │ │ ├── mod.rs │ │ │ ├── u16.rs │ │ │ ├── u32.rs │ │ │ ├── u64.rs │ │ │ ├── u8.rs │ │ │ └── uint_macros.rs │ │ ├── ops.rs │ │ ├── option.rs │ │ ├── pattern.rs │ │ ├── ptr.rs │ │ ├── result.rs │ │ ├── slice.rs │ │ ├── str.rs │ │ ├── str_lossy.rs │ │ ├── time.rs │ │ └── tuple.rs │ ├── time.rs │ ├── tuple.rs │ ├── unicode │ │ ├── mod.rs │ │ ├── printable.py │ │ ├── printable.rs │ │ ├── unicode_data.rs │ │ └── version.rs │ └── unit.rs ├── libpanic_abort │ ├── Cargo.toml │ └── lib.rs ├── libpanic_unwind │ ├── Cargo.toml │ ├── dummy.rs │ ├── dwarf │ │ ├── eh.rs │ │ ├── mod.rs │ │ └── tests.rs │ ├── emcc.rs │ ├── gcc.rs │ ├── hermit.rs │ ├── lib.rs │ ├── miri.rs │ └── seh.rs ├── libstd │ ├── Cargo.toml │ ├── alloc.rs │ ├── ascii.rs │ ├── backtrace.rs │ ├── benches │ │ ├── hash │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ └── set_ops.rs │ │ └── lib.rs │ ├── build.rs │ ├── collections │ │ ├── hash │ │ │ ├── crucible_map.rs │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ └── set.rs │ │ └── mod.rs │ ├── env.rs │ ├── error.rs │ ├── f32.rs │ ├── f64.rs │ ├── ffi │ │ ├── c_str.rs │ │ ├── mod.rs │ │ └── os_str.rs │ ├── fs.rs │ ├── future.rs │ ├── io │ │ ├── buffered.rs │ │ ├── cursor.rs │ │ ├── error.rs │ │ ├── impls.rs │ │ ├── lazy.rs │ │ ├── mod.rs │ │ ├── prelude.rs │ │ ├── stdio.rs │ │ └── util.rs │ ├── keyword_docs.rs │ ├── lib.rs │ ├── macros.rs │ ├── memchr.rs │ ├── net │ │ ├── addr.rs │ │ ├── ip.rs │ │ ├── mod.rs │ │ ├── parser.rs │ │ ├── tcp.rs │ │ ├── test.rs │ │ └── udp.rs │ ├── num.rs │ ├── os │ │ ├── android │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── dragonfly │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── emscripten │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── fortanix_sgx │ │ │ └── mod.rs │ │ ├── freebsd │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── fuchsia │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── haiku │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── ios │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── linux │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── macos │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── mod.rs │ │ ├── netbsd │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── openbsd │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── raw │ │ │ ├── char.md │ │ │ ├── double.md │ │ │ ├── float.md │ │ │ ├── int.md │ │ │ ├── long.md │ │ │ ├── longlong.md │ │ │ ├── mod.rs │ │ │ ├── schar.md │ │ │ ├── short.md │ │ │ ├── uchar.md │ │ │ ├── uint.md │ │ │ ├── ulong.md │ │ │ ├── ulonglong.md │ │ │ └── ushort.md │ │ ├── redox │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── solaris │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ ├── vxworks │ │ │ ├── fs.rs │ │ │ ├── mod.rs │ │ │ └── raw.rs │ │ └── wasi.rs │ ├── panic.rs │ ├── panicking.rs │ ├── path.rs │ ├── prelude │ │ ├── mod.rs │ │ └── v1.rs │ ├── primitive_docs.rs │ ├── process.rs │ ├── rt.rs │ ├── sync │ │ ├── barrier.rs │ │ ├── condvar.rs │ │ ├── mod.rs │ │ ├── mpsc │ │ │ ├── blocking.rs │ │ │ ├── cache_aligned.rs │ │ │ ├── mod.rs │ │ │ ├── mpsc_queue.rs │ │ │ ├── oneshot.rs │ │ │ ├── shared.rs │ │ │ ├── spsc_queue.rs │ │ │ ├── stream.rs │ │ │ └── sync.rs │ │ ├── mutex.rs │ │ ├── once.rs │ │ └── rwlock.rs │ ├── sys │ │ ├── cloudabi │ │ │ ├── abi │ │ │ │ ├── bitflags.rs │ │ │ │ ├── cloudabi.rs │ │ │ │ └── mod.rs │ │ │ ├── args.rs │ │ │ ├── condvar.rs │ │ │ ├── io.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── os.rs │ │ │ ├── rwlock.rs │ │ │ ├── shims │ │ │ │ ├── args.rs │ │ │ │ ├── env.rs │ │ │ │ ├── fs.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── net.rs │ │ │ │ ├── os.rs │ │ │ │ ├── pipe.rs │ │ │ │ └── process.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ └── time.rs │ │ ├── crux │ │ │ ├── condvar.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── rwlock.rs │ │ │ └── time.rs │ │ ├── hermit │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── cmath.rs │ │ │ ├── condvar.rs │ │ │ ├── env.rs │ │ │ ├── fast_thread_local.rs │ │ │ ├── fd.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process.rs │ │ │ ├── rwlock.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ └── time.rs │ │ ├── mod.rs │ │ ├── sgx │ │ │ ├── abi │ │ │ │ ├── entry.S │ │ │ │ ├── mem.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── panic.rs │ │ │ │ ├── reloc.rs │ │ │ │ ├── thread.rs │ │ │ │ ├── tls.rs │ │ │ │ └── usercalls │ │ │ │ │ ├── alloc.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── raw.rs │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── cmath.rs │ │ │ ├── condvar.rs │ │ │ ├── env.rs │ │ │ ├── ext │ │ │ │ ├── arch.rs │ │ │ │ ├── ffi.rs │ │ │ │ ├── io.rs │ │ │ │ └── mod.rs │ │ │ ├── fd.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process.rs │ │ │ ├── rwlock.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ ├── time.rs │ │ │ └── waitqueue.rs │ │ ├── unix │ │ │ ├── alloc.rs │ │ │ ├── android.rs │ │ │ ├── args.rs │ │ │ ├── cmath.rs │ │ │ ├── condvar.rs │ │ │ ├── env.rs │ │ │ ├── ext │ │ │ │ ├── ffi.rs │ │ │ │ ├── fs.rs │ │ │ │ ├── io.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── net.rs │ │ │ │ ├── process.rs │ │ │ │ ├── raw.rs │ │ │ │ └── thread.rs │ │ │ ├── fast_thread_local.rs │ │ │ ├── fd.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── l4re.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process │ │ │ │ ├── mod.rs │ │ │ │ ├── process_common.rs │ │ │ │ ├── process_fuchsia.rs │ │ │ │ ├── process_unix.rs │ │ │ │ └── zircon.rs │ │ │ ├── rand.rs │ │ │ ├── rwlock.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ ├── time.rs │ │ │ └── weak.rs │ │ ├── vxworks │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── cmath.rs │ │ │ ├── condvar.rs │ │ │ ├── env.rs │ │ │ ├── ext │ │ │ │ ├── ffi.rs │ │ │ │ ├── fs.rs │ │ │ │ ├── io.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── process.rs │ │ │ │ └── raw.rs │ │ │ ├── fast_thread_local.rs │ │ │ ├── fd.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process │ │ │ │ ├── mod.rs │ │ │ │ ├── process_common.rs │ │ │ │ └── process_vxworks.rs │ │ │ ├── rand.rs │ │ │ ├── rwlock.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ └── time.rs │ │ ├── wasi │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── env.rs │ │ │ ├── ext │ │ │ │ ├── ffi.rs │ │ │ │ ├── fs.rs │ │ │ │ ├── io.rs │ │ │ │ └── mod.rs │ │ │ ├── fd.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── mod.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ └── time.rs │ │ ├── wasm │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── cmath.rs │ │ │ ├── condvar.rs │ │ │ ├── condvar_atomics.rs │ │ │ ├── env.rs │ │ │ ├── fast_thread_local.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── mutex_atomics.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process.rs │ │ │ ├── rwlock.rs │ │ │ ├── rwlock_atomics.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stdio.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ └── time.rs │ │ └── windows │ │ │ ├── alloc.rs │ │ │ ├── args.rs │ │ │ ├── c.rs │ │ │ ├── cmath.rs │ │ │ ├── compat.rs │ │ │ ├── condvar.rs │ │ │ ├── env.rs │ │ │ ├── ext │ │ │ ├── ffi.rs │ │ │ ├── fs.rs │ │ │ ├── io.rs │ │ │ ├── mod.rs │ │ │ ├── process.rs │ │ │ ├── raw.rs │ │ │ └── thread.rs │ │ │ ├── fast_thread_local.rs │ │ │ ├── fs.rs │ │ │ ├── handle.rs │ │ │ ├── io.rs │ │ │ ├── memchr.rs │ │ │ ├── mod.rs │ │ │ ├── mutex.rs │ │ │ ├── net.rs │ │ │ ├── os.rs │ │ │ ├── os_str.rs │ │ │ ├── path.rs │ │ │ ├── pipe.rs │ │ │ ├── process.rs │ │ │ ├── rand.rs │ │ │ ├── rwlock.rs │ │ │ ├── stack_overflow.rs │ │ │ ├── stack_overflow_uwp.rs │ │ │ ├── stdio.rs │ │ │ ├── stdio_uwp.rs │ │ │ ├── thread.rs │ │ │ ├── thread_local.rs │ │ │ └── time.rs │ ├── sys_common │ │ ├── alloc.rs │ │ ├── at_exit_imp.rs │ │ ├── backtrace.rs │ │ ├── bytestring.rs │ │ ├── condvar.rs │ │ ├── fs.rs │ │ ├── io.rs │ │ ├── mod.rs │ │ ├── mutex.rs │ │ ├── net.rs │ │ ├── os_str_bytes.rs │ │ ├── poison.rs │ │ ├── process.rs │ │ ├── remutex.rs │ │ ├── rwlock.rs │ │ ├── thread.rs │ │ ├── thread_info.rs │ │ ├── thread_local.rs │ │ ├── util.rs │ │ └── wtf8.rs │ ├── tests │ │ ├── env.rs │ │ └── run-time-detect.rs │ ├── thread │ │ ├── local.rs │ │ └── mod.rs │ └── time.rs ├── libterm │ ├── Cargo.toml │ ├── lib.rs │ ├── terminfo │ │ ├── mod.rs │ │ ├── parm.rs │ │ ├── parm │ │ │ └── tests.rs │ │ ├── parser │ │ │ ├── compiled.rs │ │ │ └── compiled │ │ │ │ └── tests.rs │ │ ├── searcher.rs │ │ └── searcher │ │ │ └── tests.rs │ └── win.rs ├── libtest │ ├── Cargo.toml │ ├── bench.rs │ ├── cli.rs │ ├── console.rs │ ├── event.rs │ ├── formatters │ │ ├── json.rs │ │ ├── mod.rs │ │ ├── pretty.rs │ │ └── terse.rs │ ├── helpers │ │ ├── concurrency.rs │ │ ├── exit_code.rs │ │ ├── isatty.rs │ │ ├── metrics.rs │ │ ├── mod.rs │ │ └── sink.rs │ ├── lib.rs │ ├── options.rs │ ├── stats.rs │ ├── stats │ │ └── tests.rs │ ├── test_result.rs │ ├── tests.rs │ ├── time.rs │ └── types.rs ├── libunwind │ ├── Cargo.toml │ ├── build.rs │ ├── lib.rs │ └── libunwind.rs ├── rustc-demangle │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ └── src │ │ └── lib.rs ├── stdarch │ ├── .cirrus.yml │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── CONTRIBUTING.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── ci │ │ ├── android-install-ndk.sh │ │ ├── android-install-sdk.sh │ │ ├── android-sysimage.sh │ │ ├── docker │ │ │ ├── aarch64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── aarch64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── arm-linux-androideabi │ │ │ │ └── Dockerfile │ │ │ ├── arm-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── armv7-unknown-linux-gnueabihf │ │ │ │ └── Dockerfile │ │ │ ├── i586-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── i686-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── mips-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── mips64-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mips64el-unknown-linux-gnuabi64 │ │ │ │ └── Dockerfile │ │ │ ├── mipsel-unknown-linux-musl │ │ │ │ └── Dockerfile │ │ │ ├── nvptx64-nvidia-cuda │ │ │ │ └── Dockerfile │ │ │ ├── powerpc-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── powerpc64le-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── s390x-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ │ ├── wasm32-unknown-unknown │ │ │ │ ├── Dockerfile │ │ │ │ └── wasm-entrypoint.sh │ │ │ ├── x86_64-linux-android │ │ │ │ └── Dockerfile │ │ │ ├── x86_64-unknown-linux-gnu-emulated │ │ │ │ └── Dockerfile │ │ │ └── x86_64-unknown-linux-gnu │ │ │ │ └── Dockerfile │ │ ├── dox.sh │ │ ├── gba.json │ │ ├── run-docker.sh │ │ ├── run.sh │ │ ├── runtest-android.rs │ │ └── style.sh │ ├── crates │ │ ├── assert-instr-macro │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── core_arch │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE-APACHE │ │ │ ├── LICENSE-MIT │ │ │ ├── README.md │ │ │ ├── build.rs │ │ │ ├── rustfmt.toml │ │ │ ├── src │ │ │ │ ├── aarch64 │ │ │ │ │ ├── crc.rs │ │ │ │ │ ├── crypto.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── neon.rs │ │ │ │ │ └── v8.rs │ │ │ │ ├── acle │ │ │ │ │ ├── barrier │ │ │ │ │ │ ├── common.rs │ │ │ │ │ │ ├── cp15.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── not_mclass.rs │ │ │ │ │ │ └── v8.rs │ │ │ │ │ ├── dsp.rs │ │ │ │ │ ├── ex.rs │ │ │ │ │ ├── hints.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── registers │ │ │ │ │ │ ├── aarch32.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── v6m.rs │ │ │ │ │ │ └── v7m.rs │ │ │ │ │ ├── sat.rs │ │ │ │ │ └── simd32.rs │ │ │ │ ├── arm │ │ │ │ │ ├── armclang.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── neon.rs │ │ │ │ │ ├── table_lookup_tests.rs │ │ │ │ │ ├── v6.rs │ │ │ │ │ └── v7.rs │ │ │ │ ├── core_arch_docs.md │ │ │ │ ├── lib.rs │ │ │ │ ├── macros.rs │ │ │ │ ├── mips │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── msa.rs │ │ │ │ │ └── msa │ │ │ │ │ │ └── macros.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── nvptx │ │ │ │ │ └── mod.rs │ │ │ │ ├── powerpc │ │ │ │ │ ├── altivec.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── vsx.rs │ │ │ │ ├── powerpc64 │ │ │ │ │ └── mod.rs │ │ │ │ ├── simd.rs │ │ │ │ ├── simd_llvm.rs │ │ │ │ ├── v64.rs │ │ │ │ ├── wasm32 │ │ │ │ │ ├── atomic.rs │ │ │ │ │ ├── memory.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── simd128.rs │ │ │ │ ├── x86 │ │ │ │ │ ├── abm.rs │ │ │ │ │ ├── adx.rs │ │ │ │ │ ├── aes.rs │ │ │ │ │ ├── avx.rs │ │ │ │ │ ├── avx2.rs │ │ │ │ │ ├── avx512f.rs │ │ │ │ │ ├── avx512ifma.rs │ │ │ │ │ ├── bmi1.rs │ │ │ │ │ ├── bmi2.rs │ │ │ │ │ ├── bswap.rs │ │ │ │ │ ├── bt.rs │ │ │ │ │ ├── cpuid.rs │ │ │ │ │ ├── eflags.rs │ │ │ │ │ ├── f16c.rs │ │ │ │ │ ├── fma.rs │ │ │ │ │ ├── fxsr.rs │ │ │ │ │ ├── macros.rs │ │ │ │ │ ├── mmx.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── pclmulqdq.rs │ │ │ │ │ ├── rdrand.rs │ │ │ │ │ ├── rdtsc.rs │ │ │ │ │ ├── rtm.rs │ │ │ │ │ ├── sha.rs │ │ │ │ │ ├── sse.rs │ │ │ │ │ ├── sse2.rs │ │ │ │ │ ├── sse3.rs │ │ │ │ │ ├── sse41.rs │ │ │ │ │ ├── sse42.rs │ │ │ │ │ ├── sse4a.rs │ │ │ │ │ ├── ssse3.rs │ │ │ │ │ ├── tbm.rs │ │ │ │ │ ├── test.rs │ │ │ │ │ └── xsave.rs │ │ │ │ └── x86_64 │ │ │ │ │ ├── abm.rs │ │ │ │ │ ├── adx.rs │ │ │ │ │ ├── avx.rs │ │ │ │ │ ├── avx2.rs │ │ │ │ │ ├── bmi.rs │ │ │ │ │ ├── bmi2.rs │ │ │ │ │ ├── bswap.rs │ │ │ │ │ ├── bt.rs │ │ │ │ │ ├── cmpxchg16b.rs │ │ │ │ │ ├── fxsr.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── rdrand.rs │ │ │ │ │ ├── sse.rs │ │ │ │ │ ├── sse2.rs │ │ │ │ │ ├── sse41.rs │ │ │ │ │ ├── sse42.rs │ │ │ │ │ └── xsave.rs │ │ │ └── tests │ │ │ │ └── cpu-detection.rs │ │ ├── simd-test-macro │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── std_detect │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE-APACHE │ │ │ ├── LICENSE-MIT │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── detect │ │ │ │ │ ├── arch │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ ├── arm.rs │ │ │ │ │ │ ├── mips.rs │ │ │ │ │ │ ├── mips64.rs │ │ │ │ │ │ ├── powerpc.rs │ │ │ │ │ │ ├── powerpc64.rs │ │ │ │ │ │ └── x86.rs │ │ │ │ │ ├── bit.rs │ │ │ │ │ ├── cache.rs │ │ │ │ │ ├── error_macros.rs │ │ │ │ │ ├── macros.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── os │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ ├── freebsd │ │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ │ ├── arm.rs │ │ │ │ │ │ │ ├── auxvec.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ └── powerpc.rs │ │ │ │ │ │ ├── linux │ │ │ │ │ │ │ ├── aarch64.rs │ │ │ │ │ │ │ ├── arm.rs │ │ │ │ │ │ │ ├── auxvec.rs │ │ │ │ │ │ │ ├── cpuinfo.rs │ │ │ │ │ │ │ ├── mips.rs │ │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ │ └── powerpc.rs │ │ │ │ │ │ ├── other.rs │ │ │ │ │ │ ├── windows │ │ │ │ │ │ │ └── aarch64.rs │ │ │ │ │ │ └── x86.rs │ │ │ │ │ └── test_data │ │ │ │ │ │ ├── linux-rpi3.auxv │ │ │ │ │ │ ├── linux-x64-i7-6850k.auxv │ │ │ │ │ │ └── macos-virtualbox-linux-x86-4850HQ.auxv │ │ │ │ ├── lib.rs │ │ │ │ └── mod.rs │ │ │ └── tests │ │ │ │ ├── cpu-detection.rs │ │ │ │ ├── macro_trailing_commas.rs │ │ │ │ └── x86-specific.rs │ │ ├── stdarch-test │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── disassembly.rs │ │ │ │ ├── lib.rs │ │ │ │ └── wasm.rs │ │ └── stdarch-verify │ │ │ ├── .gitattributes │ │ │ ├── Cargo.toml │ │ │ ├── arm-intrinsics.html │ │ │ ├── build.rs │ │ │ ├── mips-msa.h │ │ │ ├── src │ │ │ └── lib.rs │ │ │ ├── tests │ │ │ ├── arm.rs │ │ │ ├── mips.rs │ │ │ └── x86-intel.rs │ │ │ └── x86-intel.xml │ ├── examples │ │ ├── Cargo.toml │ │ ├── hex.rs │ │ └── wasm.rs │ └── vendor.yml └── unicode-width │ ├── COPYRIGHT │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── scripts │ └── unicode.py │ └── src │ ├── lib.rs │ ├── tables.rs │ └── tests.rs ├── mir-verifier.cabal ├── overview.md ├── src └── Mir │ ├── DefId.hs │ ├── FancyMuxTree.hs │ ├── Generate.hs │ ├── Generator.hs │ ├── GenericOps.hs │ ├── Intrinsics.hs │ ├── JSON.hs │ ├── Language.hs │ ├── Mir.hs │ ├── Overrides.hs │ ├── PP.hs │ ├── Pass.hs │ ├── Pass │ └── AllocateEnum.hs │ ├── Trans.hs │ ├── TransCustom.hs │ └── TransTy.hs ├── stack-ghc-8.4.yaml ├── stack.yaml ├── test ├── README.md ├── Test.hs ├── conc_eval │ ├── .gitignore │ ├── array │ │ ├── arg.rs │ │ ├── clone.rs │ │ ├── const.rs │ │ ├── const_impl.rs │ │ ├── from_slice.rs │ │ ├── iter.rs │ │ ├── mk_and_proj.rs │ │ ├── mut_arg.rs │ │ ├── mut_index.rs │ │ ├── wick1.rs │ │ ├── wick2.rs │ │ └── wick3.rs │ ├── box │ │ ├── mut.rs │ │ ├── mut_ref.rs │ │ ├── new.rs │ │ ├── struct.rs │ │ └── unsize.rs │ ├── cell │ │ ├── cell.rs │ │ ├── ref_cell.rs │ │ └── ref_cell2.rs │ ├── clos │ │ ├── as_fn_ptr.rs │ │ ├── conv_fnmut_fn.rs │ │ ├── conv_fnonce_fn.rs │ │ ├── conv_fnonce_fnmut.rs │ │ ├── direct_fn.rs │ │ ├── direct_fnmut.rs │ │ ├── direct_fnmut2.rs │ │ ├── direct_fnonce.rs │ │ ├── dispatch_fnmut.rs │ │ ├── fn_dyn.rs │ │ ├── fn_static.rs │ │ ├── fn_static_poly.rs │ │ ├── fnonce.rs │ │ ├── fnonce1.rs │ │ ├── fnptr_closure.rs │ │ ├── fnptr_fn.rs │ │ ├── fnptr_fnmut.rs │ │ ├── fnptr_fnonce.rs │ │ ├── fo.rs │ │ ├── poly.rs │ │ ├── promoted.rs │ │ ├── ref_fnmut.rs │ │ └── unique_borrow.rs │ ├── consts │ │ ├── enum_val.rs │ │ ├── fn_def.rs │ │ ├── local_key.rs │ │ ├── struct_unit.rs │ │ └── struct_val.rs │ ├── crypto │ │ ├── add.rs │ │ └── add_noL.rs │ ├── dyn │ │ ├── assoc_ty.rs │ │ ├── inherit.rs │ │ ├── plain_trait.rs │ │ └── trait_param.rs │ ├── enum │ │ ├── arg.rs │ │ ├── arg2.rs │ │ ├── cmp.rs │ │ ├── cow.rs │ │ ├── eq.rs │ │ ├── field_order.rs │ │ ├── inner.rs │ │ ├── match.rs │ │ ├── mixed_discrs.rs │ │ └── ret.rs │ ├── fnptr │ │ ├── call.rs │ │ ├── custom.rs │ │ ├── field.rs │ │ └── make.rs │ ├── hash_map │ │ ├── insert_get.rs │ │ ├── insert_iter.rs │ │ ├── insert_multi.rs │ │ └── insert_remove.rs │ ├── impl │ │ ├── self.rs │ │ ├── self_mut.rs │ │ └── simple.rs │ ├── intTest │ │ ├── test0038.rs │ │ └── test0039.rs │ ├── io │ │ ├── cursor_read.rs │ │ ├── cursor_write.rs │ │ └── cursor_write2.rs │ ├── iter │ │ ├── cloned.rs │ │ ├── filter_chain.rs │ │ ├── for.rs │ │ ├── from_fn.rs │ │ ├── loop.rs │ │ ├── peek.rs │ │ ├── sum.rs │ │ └── zip.rs │ ├── mem │ │ ├── maybe_uninit.rs │ │ └── maybe_uninit_array_cast.rs │ ├── num │ │ ├── from_bytes.rs │ │ ├── overflow.rs │ │ └── saturate.rs │ ├── ops │ │ ├── arith1.rs │ │ ├── deref1.rs │ │ ├── deref2.rs │ │ ├── deref3.rs │ │ ├── index1.rs │ │ ├── index2.rs │ │ └── index3.rs │ ├── prim │ │ ├── add1.rs │ │ ├── bool.rs │ │ ├── char_from_u32.rs │ │ ├── div.rs │ │ ├── ffs.rs │ │ ├── ge.rs │ │ ├── lit.rs │ │ ├── litbstring.rs │ │ ├── litstring.rs │ │ ├── mut.rs │ │ ├── mut_arg.rs │ │ ├── shift1.rs │ │ ├── shift2.rs │ │ ├── shift3.rs │ │ ├── shift4.rs │ │ ├── shift_exceeding.rs │ │ └── wrapping_sub.rs │ ├── ptr │ │ ├── cast_eq.rs │ │ ├── coerce_unsized.rs │ │ ├── copy.rs │ │ ├── dangling_eq.rs │ │ ├── is_null.rs │ │ ├── is_null_slice.rs │ │ ├── null_eq.rs │ │ ├── offset.rs │ │ ├── offset_from.rs │ │ ├── offset_mut.rs │ │ ├── read_write.rs │ │ ├── struct_eq.rs │ │ ├── unsize_slice.rs │ │ └── valid_eq.rs │ ├── refs │ │ ├── fn_ptr.rs │ │ ├── fn_ptr_mut.rs │ │ ├── imm_arg.rs │ │ ├── imm_raw.rs │ │ ├── imm_ref.rs │ │ ├── mut_arg.rs │ │ ├── mut_nested.rs │ │ ├── mut_raw.rs │ │ ├── mut_ref.rs │ │ ├── mut_tuple_field.rs │ │ ├── never.rs │ │ ├── never_mut.rs │ │ ├── promoted_imm.rs │ │ ├── promoted_mut.rs │ │ ├── static_mut.rs │ │ └── temp.rs │ ├── slice │ │ ├── eq.rs │ │ ├── get.rs │ │ ├── iter_mut.rs │ │ ├── last.rs │ │ ├── len.rs │ │ ├── mk_and_proj.rs │ │ ├── mut.rs │ │ ├── mut_range.rs │ │ ├── range_len.rs │ │ ├── range_len_mut.rs │ │ └── swap.rs │ ├── statics │ │ ├── promoted_fn.rs │ │ └── promoted_static.rs │ ├── stdlib │ │ ├── cvt.rs │ │ ├── default.rs │ │ ├── default_impl.rs │ │ ├── option.rs │ │ ├── option2.rs │ │ ├── option3.rs │ │ ├── poly.rs │ │ ├── range.rs │ │ ├── result.rs │ │ ├── result_interior.rs │ │ └── teq.rs │ ├── str │ │ ├── format.rs │ │ ├── format_array.rs │ │ ├── format_hex.rs │ │ ├── format_int.rs │ │ ├── format_struct.rs │ │ ├── string_push.rs │ │ └── to_owned.rs │ ├── struct │ │ ├── arg.rs │ │ ├── field_order.rs │ │ ├── proj.rs │ │ ├── ret.rs │ │ └── tup.rs │ ├── sync │ │ ├── arc.rs │ │ ├── arc_cell.rs │ │ ├── arc_clone.rs │ │ ├── atomic_add.rs │ │ ├── atomic_cxchg.rs │ │ ├── atomic_fence.rs │ │ ├── atomic_swap.rs │ │ ├── mutex.rs │ │ ├── mutex_multi.rs │ │ ├── rwlock.rs │ │ └── rwlock_multi.rs │ ├── time │ │ └── instant.rs │ ├── traits │ │ ├── assoc1.rs │ │ ├── assoc2.rs │ │ ├── assoc3.rs │ │ ├── basics1.rs │ │ ├── bounds1.rs │ │ ├── bounds2.rs │ │ ├── bounds3.rs │ │ ├── bounds4.rs │ │ ├── bounds5.rs │ │ ├── conv.rs │ │ ├── default.rs │ │ ├── dict_med.rs │ │ ├── dict_poly.rs │ │ ├── dict_polymem.rs │ │ ├── dict_simple.rs │ │ ├── dynamic_branch.rs │ │ ├── dynamic_med.rs │ │ ├── dynamic_poly.rs │ │ ├── dynamic_simple.rs │ │ ├── dynamic_two.rs │ │ ├── gen_trait.rs │ │ ├── gen_trait_poly.rs │ │ ├── generic1.rs │ │ ├── generic2.rs │ │ ├── generic3.rs │ │ ├── intoiter.rs │ │ ├── params.rs │ │ ├── static.rs │ │ ├── static_eq.rs │ │ ├── static_self.rs │ │ ├── static_three.rs │ │ ├── static_two.rs │ │ ├── subtrait.rs │ │ ├── subtrait2.rs │ │ ├── tyfam.rs │ │ ├── tyfam2.rs │ │ ├── tyfam3.rs │ │ ├── tyfam4.rs │ │ └── tyfam5.rs │ ├── tuple │ │ ├── clone.rs │ │ ├── clone_from.rs │ │ ├── clone_rec.rs │ │ └── clone_struct.rs │ ├── vec │ │ ├── collect.rs │ │ ├── drop.rs │ │ ├── extend.rs │ │ ├── extend_trusted_len.rs │ │ ├── from_elem_zero.rs │ │ ├── push.rs │ │ └── set_len.rs │ └── vec_deque │ │ ├── iter_clone.rs │ │ ├── pop.rs │ │ ├── push.rs │ │ ├── retain.rs │ │ ├── rotate_left.rs │ │ └── rotate_right.rs ├── crypto │ └── scalar.rs └── symb_eval │ ├── alloc │ ├── out_of_bounds.good │ ├── out_of_bounds.rs │ ├── uninit_read.good │ ├── uninit_read.rs │ ├── valid_read.good │ ├── valid_read.rs │ ├── zero_length.good │ └── zero_length.rs │ ├── any │ ├── downcast.good │ ├── downcast.rs │ ├── downcast_fail.good │ └── downcast_fail.rs │ ├── array │ ├── basic.good │ ├── basic.rs │ ├── mux_slice.good │ ├── mux_slice.rs │ ├── slice.good │ ├── slice.rs │ ├── slice_mut.good │ └── slice_mut.rs │ ├── bitvector │ ├── arith.good │ ├── arith.rs │ ├── cmp.good │ ├── cmp.rs │ ├── from_to.good │ ├── from_to.rs │ ├── leading_zeros.good │ ├── leading_zeros.rs │ ├── literals.good │ ├── literals.rs │ ├── overflowing_sub.good │ ├── overflowing_sub.rs │ ├── symbolic.good │ └── symbolic.rs │ ├── byteorder │ ├── read.good │ ├── read.rs │ ├── write.good │ └── write.rs │ ├── bytes │ ├── extend_bytes.good │ ├── extend_bytes.rs │ ├── new.good │ ├── new.rs │ ├── put.good │ ├── put.rs │ ├── put_overflow.good │ ├── put_overflow.rs │ ├── split_off.good │ ├── split_off.rs │ ├── split_to.good │ ├── split_to.rs │ ├── sym_len.good │ └── sym_len.rs │ ├── concretize │ ├── array.good │ ├── array.rs │ ├── assert.good │ ├── assert.rs │ ├── assert_ok.good │ ├── assert_ok.rs │ ├── conc.good │ ├── conc.rs │ ├── no_conc.good │ └── no_conc.rs │ ├── crux │ ├── early_fail.good │ ├── early_fail.rs │ ├── fail_return.good │ ├── fail_return.rs │ ├── mixed_fail.good │ ├── mixed_fail.rs │ ├── multi.good │ └── multi.rs │ ├── crypto │ ├── bytes.good │ ├── bytes.rs │ ├── bytes2.good │ ├── bytes2.rs │ ├── double.good │ ├── double.rs │ ├── ffs.good │ └── ffs.rs │ ├── enum │ ├── mux.good │ └── mux.rs │ ├── fnptr │ ├── mux.good │ └── mux.rs │ ├── io │ ├── vec_cursor_read.good │ ├── vec_cursor_read.rs │ ├── vec_write.good │ └── vec_write.rs │ ├── mux │ ├── array.good │ ├── array.rs │ ├── array_mut.good │ └── array_mut.rs │ ├── num │ ├── checked_add.good │ ├── checked_add.rs │ ├── checked_mul.good │ └── checked_mul.rs │ ├── overrides │ ├── bad_symb1.good │ ├── bad_symb1.rs │ ├── bad_symb2.good │ ├── bad_symb2.rs │ ├── override1.good │ ├── override1.rs │ ├── override2.good │ ├── override2.rs │ ├── override3.good │ ├── override3.rs │ ├── override4.good │ ├── override4.rs │ ├── override5.good │ └── override5.rs │ ├── refs │ ├── mux_init_imm.good │ ├── mux_init_imm.rs │ ├── mux_init_mut.good │ └── mux_init_mut.rs │ ├── scalar │ ├── test1.good │ └── test1.rs │ ├── sym_bytes │ ├── construct.good │ ├── construct.rs │ ├── deserialize.good │ └── deserialize.rs │ ├── vec │ ├── clone.good │ ├── clone.rs │ ├── into_iter.good │ ├── into_iter.rs │ ├── macro.good │ ├── macro.rs │ ├── sort_by_key.good │ └── sort_by_key.rs │ └── vector │ ├── as_mut_slice.good │ ├── as_mut_slice.rs │ ├── as_slice.good │ ├── as_slice.rs │ ├── concat.good │ ├── concat.rs │ ├── copy_from_slice.good │ ├── copy_from_slice.rs │ ├── mut.good │ ├── mut.rs │ ├── new.good │ ├── new.rs │ ├── pop.good │ ├── pop.rs │ ├── push.good │ ├── push.rs │ ├── replicate.good │ ├── replicate.rs │ ├── split_at.good │ └── split_at.rs ├── todo.org └── translate_libs.sh /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-* 3 | cabal-dev 4 | *.o 5 | *.hi 6 | *.chi 7 | *.chs.h 8 | *.dyn_o 9 | *.dyn_hi 10 | .hpc 11 | .hsenv 12 | .cabal_sandbox 13 | cabal.sandbox.config 14 | *.prof 15 | *.aux 16 | *.hp 17 | *.eventlog 18 | .stack-work/ 19 | cabal.project.local 20 | .HTF/ 21 | .ghc.environment.* 22 | *.rlib 23 | *.out 24 | *.mir 25 | report_data.js 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/crucible"] 2 | path = deps/crucible 3 | url = https://github.com/GaloisInc/crucible.git 4 | [submodule "deps/parameterized-utils"] 5 | path = deps/parameterized-utils 6 | url = https://github.com/GaloisInc/parameterized-utils.git 7 | [submodule "deps/aig"] 8 | path = deps/aig 9 | url = https://github.com/GaloisInc/aig 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # crux-mir has moved 2 | 3 | See the [`crux-mir` subdirectory](https://github.com/GaloisInc/crucible/tree/master/crux-mir) of [GaloisInc/crucible](https://github.com/GaloisInc/crucible). 4 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: 2 | mir-verifier.cabal 3 | deps/crucible/what4 4 | deps/crucible/crucible 5 | deps/crucible/crux 6 | deps/parameterized-utils 7 | deps/aig 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ffs/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /example/ffs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ffs" 3 | version = "0.1.0" 4 | authors = ["Stuart Pernsteiner "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | 11 | [lib] 12 | path = "lib.rs" 13 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/aarch64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | ca-certificates \ 5 | libc6-dev \ 6 | gcc-aarch64-linux-gnu \ 7 | libc6-dev-arm64-cross \ 8 | qemu-user 9 | 10 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ 11 | CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" 12 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | ca-certificates \ 5 | libc6-dev \ 6 | gcc-arm-linux-gnueabihf \ 7 | libc6-dev-armhf-cross \ 8 | qemu-user 9 | ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ 10 | CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" 11 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | ca-certificates \ 5 | libc6-dev \ 6 | gcc-arm-linux-gnueabihf \ 7 | libc6-dev-armhf-cross \ 8 | qemu-user 9 | ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ 10 | CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" 11 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/i586-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc-multilib \ 4 | libc6-dev \ 5 | ca-certificates 6 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/i686-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc-multilib \ 4 | libc6-dev \ 5 | ca-certificates 6 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/x86_64-pc-windows-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | libc6-dev \ 5 | ca-certificates \ 6 | gcc-mingw-w64-x86-64 7 | 8 | # No need to run tests, we're just testing that it compiles 9 | ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=echo \ 10 | CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc 11 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/x86_64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | libc6-dev \ 5 | ca-certificates 6 | -------------------------------------------------------------------------------- /lib/backtrace/ci/docker/x86_64-unknown-linux-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | libc6-dev \ 5 | ca-certificates \ 6 | musl-tools 7 | -------------------------------------------------------------------------------- /lib/backtrace/ci/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | cargo test --target $TARGET 6 | -------------------------------------------------------------------------------- /lib/backtrace/crates/backtrace-sys/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /lib/backtrace/crates/backtrace-sys/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /lib/backtrace/crates/backtrace-sys/src/android-api.c: -------------------------------------------------------------------------------- 1 | // Used from the build script to detect the value of the `__ANDROID_API__` 2 | // builtin #define 3 | 4 | APIVERSION __ANDROID_API__ 5 | -------------------------------------------------------------------------------- /lib/backtrace/crates/cpp_smoke_test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cpp_smoke_test" 3 | version = "0.1.0" 4 | authors = ["Nick Fitzgerald "] 5 | build = "build.rs" 6 | 7 | [build-dependencies] 8 | cc = "1.0" 9 | 10 | [dependencies] 11 | backtrace = { path = "../..", features = ["cpp_demangle"] } 12 | -------------------------------------------------------------------------------- /lib/backtrace/crates/cpp_smoke_test/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | compile_cpp(); 3 | } 4 | 5 | fn compile_cpp() { 6 | println!("cargo:rerun-if-changed=cpp/trampoline.cpp"); 7 | 8 | cc::Build::new() 9 | .cpp(true) 10 | .debug(true) 11 | .opt_level(0) 12 | .file("cpp/trampoline.cpp") 13 | .compile("libcpptrampoline.a"); 14 | } 15 | -------------------------------------------------------------------------------- /lib/backtrace/crates/cpp_smoke_test/cpp/trampoline.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace space { 4 | template 5 | void templated_trampoline(FuncT func) { 6 | func(); 7 | } 8 | } 9 | 10 | typedef void (*FuncPtr)(); 11 | 12 | extern "C" void cpp_trampoline(FuncPtr func) { 13 | space::templated_trampoline(func); 14 | } 15 | -------------------------------------------------------------------------------- /lib/backtrace/crates/cpp_smoke_test/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn it_works() {} 3 | -------------------------------------------------------------------------------- /lib/backtrace/crates/without_debuginfo/src/lib.rs: -------------------------------------------------------------------------------- 1 | // intentionally blank 2 | -------------------------------------------------------------------------------- /lib/backtrace/examples/backtrace.rs: -------------------------------------------------------------------------------- 1 | extern crate backtrace; 2 | 3 | use backtrace::Backtrace; 4 | 5 | fn main() { 6 | println!("{:?}", Backtrace::new()); 7 | } 8 | -------------------------------------------------------------------------------- /lib/backtrace/src/backtrace/noop.rs: -------------------------------------------------------------------------------- 1 | //! Empty implementation of unwinding used when no other implementation is 2 | //! appropriate. 3 | 4 | use core::ffi::c_void; 5 | 6 | #[inline(always)] 7 | pub fn trace(_cb: &mut FnMut(&super::Frame) -> bool) {} 8 | 9 | #[derive(Clone)] 10 | pub struct Frame; 11 | 12 | impl Frame { 13 | pub fn ip(&self) -> *mut c_void { 14 | 0 as *mut _ 15 | } 16 | 17 | pub fn symbol_address(&self) -> *mut c_void { 18 | 0 as *mut _ 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/backtrace/tests/accuracy/auxiliary.rs: -------------------------------------------------------------------------------- 1 | #[inline(never)] 2 | pub fn callback(f: F) 3 | where 4 | F: FnOnce((&'static str, u32)), 5 | { 6 | f((file!(), line!())) 7 | } 8 | 9 | #[inline(always)] 10 | #[cfg_attr(feature = "coresymbolication", inline(never))] 11 | pub fn callback_inlined(f: F) 12 | where 13 | F: FnOnce((&'static str, u32)), 14 | { 15 | f((file!(), line!())) 16 | } 17 | -------------------------------------------------------------------------------- /lib/cfg-if/tests/xcrate.rs: -------------------------------------------------------------------------------- 1 | cfg_if::cfg_if! { 2 | if #[cfg(foo)] { 3 | fn works() -> bool { false } 4 | } else if #[cfg(test)] { 5 | fn works() -> bool { true } 6 | } else { 7 | fn works() -> bool { false } 8 | } 9 | } 10 | 11 | #[test] 12 | fn smoke() { 13 | assert!(works()); 14 | } 15 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/aarch64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-aarch64-linux-gnu libc6-dev-arm64-cross \ 6 | qemu-user-static 7 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ 8 | CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER=qemu-aarch64-static \ 9 | QEMU_LD_PREFIX=/usr/aarch64-linux-gnu \ 10 | RUST_TEST_THREADS=1 11 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/arm-unknown-linux-gnueabi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-linux-gnueabi libc6-dev-armel-cross qemu-user-static 6 | ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-linux-gnueabi-gcc \ 7 | CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_RUNNER=qemu-arm-static \ 8 | QEMU_LD_PREFIX=/usr/arm-linux-gnueabi \ 9 | RUST_TEST_THREADS=1 10 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user-static 6 | ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ 7 | CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER=qemu-arm-static \ 8 | QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf \ 9 | RUST_TEST_THREADS=1 10 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user-static 6 | ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ 7 | CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER=qemu-arm-static \ 8 | QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf \ 9 | RUST_TEST_THREADS=1 10 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/i586-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc-multilib libc6-dev ca-certificates 5 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/i686-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc-multilib libc6-dev ca-certificates 5 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/thumbv6m-none-eabi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-none-eabi \ 6 | libnewlib-arm-none-eabi 7 | ENV XARGO=1 8 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/thumbv7em-none-eabi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-none-eabi \ 6 | libnewlib-arm-none-eabi 7 | ENV XARGO=1 8 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/thumbv7em-none-eabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-none-eabi \ 6 | libnewlib-arm-none-eabi 7 | ENV XARGO=1 8 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/thumbv7m-none-eabi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates \ 5 | gcc-arm-none-eabi \ 6 | libnewlib-arm-none-eabi 7 | ENV XARGO=1 8 | -------------------------------------------------------------------------------- /lib/compiler-builtins/ci/docker/x86_64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates 5 | -------------------------------------------------------------------------------- /lib/compiler-builtins/crates/panic-handler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "panic-handler" 3 | version = "0.1.0" 4 | authors = ["Alex Crichton "] 5 | 6 | [dependencies] 7 | -------------------------------------------------------------------------------- /lib/compiler-builtins/crates/panic-handler/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Hack of a crate until rust-lang/rust#51647 is fixed 2 | 3 | #![feature(no_core)] 4 | #![no_core] 5 | 6 | extern crate core; 7 | 8 | #[panic_handler] 9 | fn panic(_: &core::panic::PanicInfo) -> ! { 10 | loop {} 11 | } 12 | -------------------------------------------------------------------------------- /lib/compiler-builtins/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | int loop(int n) { 3 | int value = n * n; 4 | printf("%d ^2 = %d\n", n, value); 5 | return loop(n + 1); 6 | } 7 | 8 | int main() { 9 | loop(0); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /lib/compiler-builtins/testcrate/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | -------------------------------------------------------------------------------- /lib/getopts/README.md: -------------------------------------------------------------------------------- 1 | getopts 2 | === 3 | 4 | A Rust library for option parsing for CLI utilities. 5 | 6 | [Documentation](https://docs.rs/getopts) 7 | 8 | ## Usage 9 | 10 | Add this to your `Cargo.toml`: 11 | 12 | ```toml 13 | [dependencies] 14 | getopts = "0.2" 15 | ``` 16 | -------------------------------------------------------------------------------- /lib/getopts/tests/smoke.rs: -------------------------------------------------------------------------------- 1 | extern crate getopts; 2 | 3 | use std::env; 4 | 5 | #[test] 6 | fn main() { 7 | getopts::Options::new().parse(env::args()).unwrap(); 8 | } 9 | -------------------------------------------------------------------------------- /lib/hashbrown/bors.toml: -------------------------------------------------------------------------------- 1 | status = [ 2 | "continuous-integration/travis-ci/push", 3 | ] 4 | -------------------------------------------------------------------------------- /lib/hashbrown/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rerun-if-changed=build.rs"); 3 | let nightly = std::env::var_os("CARGO_FEATURE_NIGHTLY").is_some(); 4 | let has_stable_alloc = || autocfg::new().probe_rustc_version(1, 36); 5 | 6 | if nightly || has_stable_alloc() { 7 | autocfg::emit("has_extern_crate_alloc") 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/hashbrown/ci/miri.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -ex 4 | 5 | export CARGO_NET_RETRY=5 6 | export CARGO_NET_TIMEOUT=10 7 | 8 | MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) 9 | echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" 10 | rustup default "$MIRI_NIGHTLY" 11 | 12 | rustup component add miri 13 | cargo miri setup 14 | 15 | cargo miri test 16 | -------------------------------------------------------------------------------- /lib/hashbrown/clippy.toml: -------------------------------------------------------------------------------- 1 | doc-valid-idents = [ "CppCon", "SwissTable", "SipHash", "HashDoS" ] 2 | -------------------------------------------------------------------------------- /lib/hashbrown/src/external_trait_impls/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "rayon")] 2 | pub(crate) mod rayon; 3 | #[cfg(feature = "serde")] 4 | mod serde; 5 | -------------------------------------------------------------------------------- /lib/hashbrown/src/external_trait_impls/rayon/mod.rs: -------------------------------------------------------------------------------- 1 | mod helpers; 2 | pub(crate) mod map; 3 | pub(crate) mod raw; 4 | pub(crate) mod set; 5 | -------------------------------------------------------------------------------- /lib/liballoc/benches/btree/mod.rs: -------------------------------------------------------------------------------- 1 | mod map; 2 | mod set; 3 | -------------------------------------------------------------------------------- /lib/liballoc/benches/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(map_first_last)] 2 | #![feature(repr_simd)] 3 | #![feature(test)] 4 | 5 | extern crate test; 6 | 7 | mod btree; 8 | mod linked_list; 9 | mod slice; 10 | mod str; 11 | mod string; 12 | mod vec; 13 | mod vec_deque; 14 | -------------------------------------------------------------------------------- /lib/liballoc/prelude/mod.rs: -------------------------------------------------------------------------------- 1 | //! The alloc Prelude 2 | //! 3 | //! The purpose of this module is to alleviate imports of commonly-used 4 | //! items of the `alloc` crate by adding a glob import to the top of modules: 5 | //! 6 | //! ``` 7 | //! # #![allow(unused_imports)] 8 | //! #![feature(alloc_prelude)] 9 | //! extern crate alloc; 10 | //! use alloc::prelude::v1::*; 11 | //! ``` 12 | 13 | #![unstable(feature = "alloc_prelude", issue = "58935")] 14 | 15 | pub mod v1; 16 | -------------------------------------------------------------------------------- /lib/liballoc/tests/fmt.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | #[test] 4 | fn test_format() { 5 | let s = fmt::format(format_args!("Hello, {}!", "world")); 6 | assert_eq!(s, "Hello, world!"); 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc libc6-dev ca-certificates \ 4 | gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user 5 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ 6 | CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \ 7 | PATH=$PATH:/rust/bin 8 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc libc6-dev ca-certificates \ 4 | gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user 5 | ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ 6 | CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ 7 | PATH=$PATH:/rust/bin 8 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | RUN apt-get update 3 | RUN apt-get install -y --no-install-recommends \ 4 | gcc-multilib libc6-dev ca-certificates 5 | ENV PATH=$PATH:/rust/bin 6 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/i686-unknown-linux-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | 3 | RUN dpkg --add-architecture i386 4 | RUN apt-get update 5 | RUN apt-get install -y --no-install-recommends \ 6 | gcc-multilib make libc6-dev git curl ca-certificates libc6:i386 7 | 8 | COPY install-musl.sh / 9 | RUN sh /install-musl.sh i686 10 | 11 | ENV PATH=$PATH:/musl-i686/bin:/rust/bin \ 12 | CC_i686_unknown_linux_musl=musl-gcc 13 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | me=$1 6 | shift 7 | dir=$(dirname $me) 8 | file=$(basename $me) 9 | 10 | if echo $file | grep -q wasm; then 11 | exit 0 # FIXME(rust-lang/cargo#4750) 12 | fi 13 | 14 | cd $dir 15 | exec node $file "$@" 16 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/wasm32-wasi/clang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | exec /usr/bin/clang --target=wasm32-wasi --sysroot /wasi-libc/sysroot "$@" 3 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/x86_64-rumprun-netbsd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mato/rumprun-toolchain-hw-x86_64 2 | USER root 3 | RUN apt-get update 4 | RUN apt-get install -y --no-install-recommends \ 5 | qemu 6 | ENV PATH=$PATH:/rust/bin \ 7 | CARGO_TARGET_X86_64_RUMPRUN_NETBSD_RUNNER=/tmp/runtest 8 | 9 | ADD docker/x86_64-rumprun-netbsd/runtest.rs /tmp/ 10 | ENTRYPOINT ["sh", "-c", "rustc /tmp/runtest.rs -o /tmp/runtest && exec \"$@\"", "--"] 11 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | RUN apt-get update 3 | RUN apt-get install -y --no-install-recommends \ 4 | gcc libc6-dev ca-certificates linux-headers-generic 5 | 6 | RUN apt search linux-headers 7 | RUN ls /usr/src 8 | 9 | ENV PATH=$PATH:/rust/bin 10 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | RUN apt-get update 3 | RUN apt-get install -y --no-install-recommends \ 4 | gcc-multilib libc6-dev ca-certificates 5 | ENV PATH=$PATH:/rust/bin 6 | -------------------------------------------------------------------------------- /lib/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.10 2 | 3 | RUN apt-get update 4 | RUN apt-get install -y --no-install-recommends \ 5 | gcc make libc6-dev git curl ca-certificates 6 | 7 | COPY install-musl.sh / 8 | RUN sh /install-musl.sh x86_64 9 | 10 | ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin 11 | -------------------------------------------------------------------------------- /lib/libc/ci/style.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -ex 4 | 5 | rustc ci/style.rs && ./style src 6 | 7 | if rustup component add rustfmt-preview ; then 8 | command -v rustfmt 9 | rustfmt -V 10 | cargo fmt --all -- --check 11 | fi 12 | 13 | if shellcheck --version ; then 14 | shellcheck -e SC2103 ci/*.sh 15 | else 16 | echo "shellcheck not found" 17 | exit 1 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /lib/libc/ci/sysinfo_guard.patch: -------------------------------------------------------------------------------- 1 | @@ -2,7 +2,9 @@ 2 | #ifndef _LINUX_KERNEL_H 3 | #define _LINUX_KERNEL_H 4 | 5 | +#ifdef __GLIBC__ 6 | #include 7 | +#endif 8 | 9 | /* 10 | * 'kernel.h' contains some often-used function prototypes etc 11 | -------------------------------------------------------------------------------- /lib/libc/libc-test/src/errqueue.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // SO_EE_OFFENDER is defined as a macro in linux/errqueue.h. This file wraps 5 | // that macro in a function so we can test the reimplementation in this package 6 | // is equivalent. 7 | 8 | struct sockaddr *so_ee_offender(struct sock_extended_err *ee) { 9 | return SO_EE_OFFENDER(ee); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/linux_elf.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, unused, deprecated)] 2 | 3 | extern crate libc; 4 | use libc::*; 5 | 6 | #[cfg(target_os = "linux")] 7 | include!(concat!(env!("OUT_DIR"), "/linux_elf.rs")); 8 | 9 | #[cfg(not(target_os = "linux"))] 10 | fn main() { 11 | println!("PASSED 0 tests"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/linux_fcntl.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, unused, deprecated)] 2 | 3 | extern crate libc; 4 | use libc::*; 5 | 6 | #[cfg(any(target_os = "linux", target_os = "android"))] 7 | include!(concat!(env!("OUT_DIR"), "/linux_fcntl.rs")); 8 | 9 | #[cfg(not(any(target_os = "linux", target_os = "android")))] 10 | fn main() { 11 | println!("PASSED 0 tests"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/linux_ipv6.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, unused, deprecated)] 2 | 3 | extern crate libc; 4 | use libc::*; 5 | 6 | #[cfg(target_os = "linux")] 7 | include!(concat!(env!("OUT_DIR"), "/linux_ipv6.rs")); 8 | 9 | #[cfg(not(target_os = "linux"))] 10 | fn main() { 11 | println!("PASSED 0 tests"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/linux_strerror_r.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, unused, deprecated)] 2 | 3 | extern crate libc; 4 | use libc::*; 5 | 6 | #[cfg(any(target_os = "linux", target_os = "android"))] 7 | include!(concat!(env!("OUT_DIR"), "/linux_strerror_r.rs")); 8 | 9 | #[cfg(not(any(target_os = "linux", target_os = "android")))] 10 | fn main() { 11 | println!("PASSED 0 tests"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/linux_termios.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, unused, deprecated)] 2 | 3 | extern crate libc; 4 | use libc::*; 5 | 6 | #[cfg(any(target_os = "linux", target_os = "android"))] 7 | include!(concat!(env!("OUT_DIR"), "/linux_termios.rs")); 8 | 9 | #[cfg(not(any(target_os = "linux", target_os = "android")))] 10 | fn main() { 11 | println!("PASSED 0 tests"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/libc-test/test/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(bad_style, improper_ctypes, deprecated)] 2 | extern crate libc; 3 | 4 | use libc::*; 5 | 6 | include!(concat!(env!("OUT_DIR"), "/main.rs")); 7 | -------------------------------------------------------------------------------- /lib/libc/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 79 2 | comment_width = 79 3 | error_on_line_overflow = true -------------------------------------------------------------------------------- /lib/libc/src/cloudabi/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type wchar_t = u32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/cloudabi/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = u32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/cloudabi/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i32; 3 | pub type c_ulong = u32; 4 | pub type wchar_t = i32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/cloudabi/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type c_long = i64; 3 | pub type c_ulong = u64; 4 | pub type wchar_t = i32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/hermit/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | -------------------------------------------------------------------------------- /lib/libc/src/hermit/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | -------------------------------------------------------------------------------- /lib/libc/src/unix/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | #[repr(align(4))] 3 | pub struct in6_addr { 4 | pub s6_addr: [u8; 16], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/apple/b32/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/apple/b64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs: -------------------------------------------------------------------------------- 1 | // DragonFlyBSD's __error function is declared with "static inline", so it must 2 | // be implemented in the libc crate, as a pointer to a static thread_local. 3 | f! { 4 | pub fn __error() -> *mut ::c_int { 5 | &mut errno 6 | } 7 | } 8 | 9 | extern "C" { 10 | #[thread_local] 11 | pub static mut errno: ::c_int; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | #[doc(hidden)] 8 | pub const _ALIGNBYTES: usize = 0xf; 9 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | pub type __cpu_simple_lock_nv_t = ::c_uchar; 5 | 6 | // should be pub(crate), but that requires Rust 1.18.0 7 | cfg_if! { 8 | if #[cfg(libc_const_size_of)] { 9 | #[doc(hidden)] 10 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 11 | } else { 12 | #[doc(hidden)] 13 | pub const _ALIGNBYTES: usize = 4 - 1; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = u8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 8 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i64; 2 | pub type c_ulong = u64; 3 | pub type c_char = i8; 4 | 5 | #[doc(hidden)] 6 | pub const _ALIGNBYTES: usize = 0xf; 7 | 8 | pub const _MAX_PAGE_SHIFT: u32 = 13; 9 | -------------------------------------------------------------------------------- /lib/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type c_char = i8; 4 | 5 | // should be pub(crate), but that requires Rust 1.18.0 6 | cfg_if! { 7 | if #[cfg(libc_const_size_of)] { 8 | #[doc(hidden)] 9 | pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; 10 | } else { 11 | #[doc(hidden)] 12 | pub const _ALIGNBYTES: usize = 4 - 1; 13 | } 14 | } 15 | 16 | pub const _MAX_PAGE_SHIFT: u32 = 12; 17 | -------------------------------------------------------------------------------- /lib/libc/src/unix/haiku/b32.rs: -------------------------------------------------------------------------------- 1 | pub type c_long = i32; 2 | pub type c_ulong = u32; 3 | pub type time_t = i32; 4 | -------------------------------------------------------------------------------- /lib/libc/src/unix/haiku/b64.rs: -------------------------------------------------------------------------------- 1 | pub type c_ulong = u64; 2 | pub type c_long = i64; 3 | pub type time_t = i64; 4 | -------------------------------------------------------------------------------- /lib/libc/src/unix/hermit/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | -------------------------------------------------------------------------------- /lib/libc/src/unix/hermit/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/android/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/android/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/android/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 2] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [i64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 6] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [i64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/gnu/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: (i64, i64) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f32; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(8))] 4 | pub struct max_align_t { 5 | priv_: [f64; 3] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f32; 8] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs: -------------------------------------------------------------------------------- 1 | s_no_extra_traits! { 2 | #[allow(missing_debug_implementations)] 3 | #[repr(align(16))] 4 | pub struct max_align_t { 5 | priv_: [f64; 4] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | pub struct in6_addr { 3 | pub s6_addr: [u8; 16], 4 | __align: [u32; 0], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/arm/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/arm/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/mips/mips32/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | #[cfg(target_pointer_width = "32")] 9 | __size: [::c_char; 16], 10 | #[cfg(target_pointer_width = "64")] 11 | __size: [::c_char; 32], 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/mips/mips32/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | #[cfg(target_pointer_width = "32")] 5 | __size: [::c_char; 16], 6 | #[cfg(target_pointer_width = "64")] 7 | __size: [::c_char; 32], 8 | __align: [::c_long; 0], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/mips/mips64/align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | #[cfg_attr(target_pointer_width = "32", 4 | repr(align(4)))] 5 | #[cfg_attr(target_pointer_width = "64", 6 | repr(align(8)))] 7 | pub struct sem_t { 8 | __size: [::c_char; 32], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/mips/mips64/no_align.rs: -------------------------------------------------------------------------------- 1 | s! { 2 | // FIXME this is actually a union 3 | pub struct sem_t { 4 | __size: [::c_char; 32], 5 | __align: [::c_long; 0], 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/libc/src/unix/uclibc/x86_64/other.rs: -------------------------------------------------------------------------------- 1 | // Thestyle checker discourages the use of #[cfg], so this has to go into a 2 | // separate module 3 | pub type pthread_t = ::c_ulong; 4 | 5 | pub const PTHREAD_STACK_MIN: usize = 16384; 6 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/aarch64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/arm.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/powerpc.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/powerpc64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = u8; 2 | pub type wchar_t = u32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/x86.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i32; 4 | pub type c_ulong = u32; 5 | -------------------------------------------------------------------------------- /lib/libc/src/vxworks/x86_64.rs: -------------------------------------------------------------------------------- 1 | pub type c_char = i8; 2 | pub type wchar_t = i32; 3 | pub type c_long = i64; 4 | pub type c_ulong = u64; 5 | -------------------------------------------------------------------------------- /lib/libc/tests/const_fn.rs: -------------------------------------------------------------------------------- 1 | #![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty 2 | 3 | #[cfg(target_os = "linux")] 4 | const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; 5 | //^ if CMSG_SPACE is not const, this will fail to compile 6 | -------------------------------------------------------------------------------- /lib/libcore/benches/any.rs: -------------------------------------------------------------------------------- 1 | use core::any::*; 2 | use test::{black_box, Bencher}; 3 | 4 | #[bench] 5 | fn bench_downcast_ref(b: &mut Bencher) { 6 | b.iter(|| { 7 | let mut x = 0; 8 | let mut y = &mut x as &mut dyn Any; 9 | black_box(&mut y); 10 | black_box(y.downcast_ref::() == Some(&0)); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /lib/libcore/benches/char/mod.rs: -------------------------------------------------------------------------------- 1 | mod methods; 2 | -------------------------------------------------------------------------------- /lib/libcore/benches/hash/mod.rs: -------------------------------------------------------------------------------- 1 | mod sip; 2 | -------------------------------------------------------------------------------- /lib/libcore/benches/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(flt2dec)] 2 | #![feature(test)] 3 | 4 | extern crate test; 5 | 6 | mod any; 7 | mod ascii; 8 | mod char; 9 | mod fmt; 10 | mod hash; 11 | mod iter; 12 | mod num; 13 | mod ops; 14 | mod pattern; 15 | mod slice; 16 | -------------------------------------------------------------------------------- /lib/libcore/benches/ops.rs: -------------------------------------------------------------------------------- 1 | use core::ops::*; 2 | use test::Bencher; 3 | 4 | // Overhead of dtors 5 | 6 | struct HasDtor { 7 | _x: isize, 8 | } 9 | 10 | impl Drop for HasDtor { 11 | fn drop(&mut self) {} 12 | } 13 | 14 | #[bench] 15 | fn alloc_obj_with_dtor(b: &mut Bencher) { 16 | b.iter(|| { 17 | HasDtor { _x: 10 }; 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /lib/libcore/crucible/mod.rs: -------------------------------------------------------------------------------- 1 | //! Contains Crucible intrinsics that are needed within `libcore`. These get reexported from 2 | //! `libcrucible` so users have a more consistent API. 3 | #[unstable(feature = "crucible_intrinsics", issue = "none")] 4 | pub mod any; 5 | 6 | #[unstable(feature = "crucible_intrinsics", issue = "none")] 7 | pub mod ptr; 8 | -------------------------------------------------------------------------------- /lib/libcore/crucible/ptr.rs: -------------------------------------------------------------------------------- 1 | //! Crucible pointer intrinsics used within libcore. 2 | 3 | /// Pointer-to-usize comparison. Unlike `ptr as usize == val`, this works on fat pointers and 4 | /// valid pointers too (pointers not created via integer-to-pointer casts). 5 | #[unstable(feature = "crucible_intrinsics", issue = "none")] 6 | pub fn compare_usize(ptr: *const T, val: usize) -> bool { 7 | unimplemented!("ptr::compare_usize") 8 | } 9 | -------------------------------------------------------------------------------- /lib/libcore/num/i128.rs: -------------------------------------------------------------------------------- 1 | //! The 128-bit signed integer type. 2 | //! 3 | //! *[See also the `i128` primitive type](../../std/primitive.i128.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "i128", since = "1.26.0")] 9 | 10 | int_module! { i128, #[stable(feature = "i128", since="1.26.0")] } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/i16.rs: -------------------------------------------------------------------------------- 1 | //! The 16-bit signed integer type. 2 | //! 3 | //! *[See also the `i16` primitive type](../../std/primitive.i16.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { i16 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/i32.rs: -------------------------------------------------------------------------------- 1 | //! The 32-bit signed integer type. 2 | //! 3 | //! *[See also the `i32` primitive type](../../std/primitive.i32.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { i32 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/i64.rs: -------------------------------------------------------------------------------- 1 | //! The 64-bit signed integer type. 2 | //! 3 | //! *[See also the `i64` primitive type](../../std/primitive.i64.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { i64 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/i8.rs: -------------------------------------------------------------------------------- 1 | //! The 8-bit signed integer type. 2 | //! 3 | //! *[See also the `i8` primitive type](../../std/primitive.i8.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { i8 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/isize.rs: -------------------------------------------------------------------------------- 1 | //! The pointer-sized signed integer type. 2 | //! 3 | //! *[See also the `isize` primitive type](../../std/primitive.isize.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { isize } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/u128.rs: -------------------------------------------------------------------------------- 1 | //! The 128-bit unsigned integer type. 2 | //! 3 | //! *[See also the `u128` primitive type](../../std/primitive.u128.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "i128", since = "1.26.0")] 9 | int_module! { u128, #[stable(feature = "i128", since="1.26.0")] } 10 | -------------------------------------------------------------------------------- /lib/libcore/num/u16.rs: -------------------------------------------------------------------------------- 1 | //! The 16-bit unsigned integer type. 2 | //! 3 | //! *[See also the `u16` primitive type](../../std/primitive.u16.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { u16 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/u32.rs: -------------------------------------------------------------------------------- 1 | //! The 32-bit unsigned integer type. 2 | //! 3 | //! *[See also the `u32` primitive type](../../std/primitive.u32.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { u32 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/u64.rs: -------------------------------------------------------------------------------- 1 | //! The 64-bit unsigned integer type. 2 | //! 3 | //! *[See also the `u64` primitive type](../../std/primitive.u64.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { u64 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/u8.rs: -------------------------------------------------------------------------------- 1 | //! The 8-bit unsigned integer type. 2 | //! 3 | //! *[See also the `u8` primitive type](../../std/primitive.u8.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { u8 } 11 | -------------------------------------------------------------------------------- /lib/libcore/num/usize.rs: -------------------------------------------------------------------------------- 1 | //! The pointer-sized unsigned integer type. 2 | //! 3 | //! *[See also the `usize` primitive type](../../std/primitive.usize.html).* 4 | //! 5 | //! Although using these constants won’t cause compilation warnings, 6 | //! new code should use the associated constants directly on the primitive type. 7 | 8 | #![stable(feature = "rust1", since = "1.0.0")] 9 | 10 | int_module! { usize } 11 | -------------------------------------------------------------------------------- /lib/libcore/prelude/mod.rs: -------------------------------------------------------------------------------- 1 | //! The libcore prelude 2 | 3 | #![stable(feature = "core_prelude", since = "1.4.0")] 4 | 5 | pub mod v1; 6 | -------------------------------------------------------------------------------- /lib/libcore/sync/mod.rs: -------------------------------------------------------------------------------- 1 | //! Synchronization primitives 2 | 3 | #![stable(feature = "rust1", since = "1.0.0")] 4 | 5 | pub mod atomic; 6 | -------------------------------------------------------------------------------- /lib/libcore/task/mod.rs: -------------------------------------------------------------------------------- 1 | #![stable(feature = "futures_api", since = "1.36.0")] 2 | 3 | //! Types and Traits for working with asynchronous tasks. 4 | 5 | mod poll; 6 | #[stable(feature = "futures_api", since = "1.36.0")] 7 | pub use self::poll::Poll; 8 | 9 | mod wake; 10 | #[stable(feature = "futures_api", since = "1.36.0")] 11 | pub use self::wake::{Context, RawWaker, RawWakerVTable, Waker}; 12 | -------------------------------------------------------------------------------- /lib/libcore/tests/alloc.rs: -------------------------------------------------------------------------------- 1 | use core::alloc::Layout; 2 | use core::ptr::NonNull; 3 | 4 | #[test] 5 | fn const_unchecked_layout() { 6 | const SIZE: usize = 0x2000; 7 | const ALIGN: usize = 0x1000; 8 | const LAYOUT: Layout = unsafe { Layout::from_size_align_unchecked(SIZE, ALIGN) }; 9 | const DANGLING: NonNull = LAYOUT.dangling(); 10 | assert_eq!(LAYOUT.size(), SIZE); 11 | assert_eq!(LAYOUT.align(), ALIGN); 12 | assert_eq!(Some(DANGLING), NonNull::new(ALIGN as *mut u8)); 13 | } 14 | -------------------------------------------------------------------------------- /lib/libcore/tests/bool.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn test_bool_to_option() { 3 | assert_eq!(false.then_some(0), None); 4 | assert_eq!(true.then_some(0), Some(0)); 5 | assert_eq!(false.then(|| 0), None); 6 | assert_eq!(true.then(|| 0), Some(0)); 7 | } 8 | -------------------------------------------------------------------------------- /lib/libcore/tests/clone.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn test_borrowed_clone() { 3 | let x = 5; 4 | let y: &i32 = &x; 5 | let z: &i32 = (&y).clone(); 6 | assert_eq!(*z, 5); 7 | } 8 | 9 | #[test] 10 | fn test_clone_from() { 11 | let a = box 5; 12 | let mut b = box 10; 13 | b.clone_from(&a); 14 | assert_eq!(*b, 5); 15 | } 16 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/i16.rs: -------------------------------------------------------------------------------- 1 | int_module!(i16, i16); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/i32.rs: -------------------------------------------------------------------------------- 1 | int_module!(i32, i32); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/i64.rs: -------------------------------------------------------------------------------- 1 | int_module!(i64, i64); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/i8.rs: -------------------------------------------------------------------------------- 1 | int_module!(i8, i8); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/u16.rs: -------------------------------------------------------------------------------- 1 | uint_module!(u16, u16); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/u32.rs: -------------------------------------------------------------------------------- 1 | uint_module!(u32, u32); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/u64.rs: -------------------------------------------------------------------------------- 1 | uint_module!(u64, u64); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/num/u8.rs: -------------------------------------------------------------------------------- 1 | uint_module!(u8, u8); 2 | -------------------------------------------------------------------------------- /lib/libcore/tests/str.rs: -------------------------------------------------------------------------------- 1 | // All `str` tests live in liballoc/tests 2 | -------------------------------------------------------------------------------- /lib/libpanic_abort/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The Rust Project Developers"] 3 | name = "panic_abort" 4 | version = "0.0.0" 5 | edition = "2018" 6 | 7 | [lib] 8 | path = "lib.rs" 9 | test = false 10 | bench = false 11 | doc = false 12 | 13 | [dependencies] 14 | core = { path = "../libcore" } 15 | libc = { version = "0.2", default-features = false } 16 | compiler_builtins = "0.1.0" 17 | -------------------------------------------------------------------------------- /lib/libpanic_unwind/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The Rust Project Developers"] 3 | name = "panic_unwind" 4 | version = "0.0.0" 5 | edition = "2018" 6 | 7 | [lib] 8 | path = "lib.rs" 9 | test = false 10 | bench = false 11 | doc = false 12 | 13 | [dependencies] 14 | alloc = { path = "../liballoc" } 15 | core = { path = "../libcore" } 16 | libc = { version = "0.2", default-features = false } 17 | unwind = { path = "../libunwind" } 18 | compiler_builtins = "0.1.0" 19 | cfg-if = "0.1.8" 20 | -------------------------------------------------------------------------------- /lib/libpanic_unwind/dummy.rs: -------------------------------------------------------------------------------- 1 | //! Unwinding for *wasm32* target. 2 | //! 3 | //! Right now we don't support this, so this is just stubs. 4 | 5 | use alloc::boxed::Box; 6 | use core::any::Any; 7 | use core::intrinsics; 8 | 9 | pub unsafe fn cleanup(_ptr: *mut u8) -> Box { 10 | intrinsics::abort() 11 | } 12 | 13 | pub unsafe fn panic(_data: Box) -> u32 { 14 | intrinsics::abort() 15 | } 16 | -------------------------------------------------------------------------------- /lib/libstd/benches/hash/mod.rs: -------------------------------------------------------------------------------- 1 | mod map; 2 | mod set_ops; 3 | -------------------------------------------------------------------------------- /lib/libstd/benches/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(test)] 2 | 3 | extern crate test; 4 | 5 | mod hash; 6 | -------------------------------------------------------------------------------- /lib/libstd/collections/hash/mod.rs: -------------------------------------------------------------------------------- 1 | //! Unordered containers, implemented as hash-tables 2 | 3 | pub mod map; 4 | pub mod set; 5 | 6 | mod crucible_map; 7 | -------------------------------------------------------------------------------- /lib/libstd/io/prelude.rs: -------------------------------------------------------------------------------- 1 | //! The I/O Prelude 2 | //! 3 | //! The purpose of this module is to alleviate imports of many common I/O traits 4 | //! by adding a glob import to the top of I/O heavy modules: 5 | //! 6 | //! ``` 7 | //! # #![allow(unused_imports)] 8 | //! use std::io::prelude::*; 9 | //! ``` 10 | 11 | #![stable(feature = "rust1", since = "1.0.0")] 12 | 13 | #[stable(feature = "rust1", since = "1.0.0")] 14 | pub use super::{BufRead, Read, Seek, Write}; 15 | -------------------------------------------------------------------------------- /lib/libstd/os/android/mod.rs: -------------------------------------------------------------------------------- 1 | //! Android-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/dragonfly/mod.rs: -------------------------------------------------------------------------------- 1 | //! Dragonfly-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/emscripten/mod.rs: -------------------------------------------------------------------------------- 1 | //! Linux-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/freebsd/mod.rs: -------------------------------------------------------------------------------- 1 | //! FreeBSD-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/fuchsia/mod.rs: -------------------------------------------------------------------------------- 1 | //! Fuchsia-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/haiku/mod.rs: -------------------------------------------------------------------------------- 1 | //! Haiku-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/ios/mod.rs: -------------------------------------------------------------------------------- 1 | //! iOS-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/linux/mod.rs: -------------------------------------------------------------------------------- 1 | //! Linux-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/macos/mod.rs: -------------------------------------------------------------------------------- 1 | //! macOS-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/netbsd/mod.rs: -------------------------------------------------------------------------------- 1 | //! OpenBSD-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/openbsd/mod.rs: -------------------------------------------------------------------------------- 1 | //! OpenBSD-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/float.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `float` type. 2 | 3 | This type will almost always be [`f32`], which is guaranteed to be an [IEEE-754 single-precision float] in Rust. That said, the standard technically only guarantees that it be a floating-point number, and it may have less precision than `f32` or not follow the IEEE-754 standard at all. 4 | 5 | [IEEE-754 single-precision float]: https://en.wikipedia.org/wiki/IEEE_754 6 | [`f32`]: ../../primitive.f32.html 7 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/int.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `signed int` (`int`) type. 2 | 3 | This type will almost always be [`i32`], but may differ on some esoteric systems. The C standard technically only requires that this type be a signed integer that is at least the size of a [`short`]; some systems define it as an [`i16`], for example. 4 | 5 | [`short`]: type.c_short.html 6 | [`i32`]: ../../primitive.i32.html 7 | [`i16`]: ../../primitive.i16.html 8 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/schar.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `signed char` type. 2 | 3 | This type will always be [`i8`], but is included for completeness. It is defined as being a signed integer the same size as a C [`char`]. 4 | 5 | [`char`]: type.c_char.html 6 | [`i8`]: ../../primitive.i8.html 7 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/short.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `signed short` (`short`) type. 2 | 3 | This type will almost always be [`i16`], but may differ on some esoteric systems. The C standard technically only requires that this type be a signed integer with at least 16 bits; some systems may define it as `i32`, for example. 4 | 5 | [`char`]: type.c_char.html 6 | [`i16`]: ../../primitive.i16.html 7 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/uchar.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `unsigned char` type. 2 | 3 | This type will always be [`u8`], but is included for completeness. It is defined as being an unsigned integer the same size as a C [`char`]. 4 | 5 | [`char`]: type.c_char.html 6 | [`u8`]: ../../primitive.u8.html 7 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/uint.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `unsigned int` type. 2 | 3 | This type will almost always be [`u32`], but may differ on some esoteric systems. The C standard technically only requires that this type be an unsigned integer with the same size as an [`int`]; some systems define it as a [`u16`], for example. 4 | 5 | [`int`]: type.c_int.html 6 | [`u32`]: ../../primitive.u32.html 7 | [`u16`]: ../../primitive.u16.html 8 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/ulong.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `unsigned long` type. 2 | 3 | This type will always be [`u32`] or [`u64`]. Most notably, many Linux-based systems assume an `u64`, but Windows assumes `u32`. The C standard technically only requires that this type be an unsigned integer with the size of a [`long`], although in practice, no system would have a `ulong` that is neither a `u32` nor `u64`. 4 | 5 | [`long`]: type.c_long.html 6 | [`u32`]: ../../primitive.u32.html 7 | [`u64`]: ../../primitive.u64.html 8 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/ulonglong.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `unsigned long long` type. 2 | 3 | This type will almost always be [`u64`], but may differ on some systems. The C standard technically only requires that this type be an unsigned integer with the size of a [`long long`], although in practice, no system would have a `long long` that is not a `u64`, as most systems do not have a standardised [`u128`] type. 4 | 5 | [`long long`]: type.c_longlong.html 6 | [`u64`]: ../../primitive.u64.html 7 | [`u128`]: ../../primitive.u128.html 8 | -------------------------------------------------------------------------------- /lib/libstd/os/raw/ushort.md: -------------------------------------------------------------------------------- 1 | Equivalent to C's `unsigned short` type. 2 | 3 | This type will almost always be [`u16`], but may differ on some esoteric systems. The C standard technically only requires that this type be an unsigned integer with the same size as a [`short`]. 4 | 5 | [`short`]: type.c_short.html 6 | [`u16`]: ../../primitive.u16.html 7 | -------------------------------------------------------------------------------- /lib/libstd/os/redox/mod.rs: -------------------------------------------------------------------------------- 1 | //! Redox-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/solaris/mod.rs: -------------------------------------------------------------------------------- 1 | //! Solaris-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/vxworks/mod.rs: -------------------------------------------------------------------------------- 1 | //! VxWorks-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | pub mod fs; 6 | pub mod raw; 7 | -------------------------------------------------------------------------------- /lib/libstd/os/vxworks/raw.rs: -------------------------------------------------------------------------------- 1 | //! VxWorks-specific raw type definitions 2 | #![stable(feature = "metadata_ext", since = "1.1.0")] 3 | 4 | use crate::os::raw::c_ulong; 5 | 6 | #[stable(feature = "pthread_t", since = "1.8.0")] 7 | pub type pthread_t = c_ulong; 8 | -------------------------------------------------------------------------------- /lib/libstd/os/wasi.rs: -------------------------------------------------------------------------------- 1 | //! WASI-specific definitions 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | #[stable(feature = "rust1", since = "1.0.0")] 6 | pub use crate::sys::ext::*; 7 | -------------------------------------------------------------------------------- /lib/libstd/sys/cloudabi/abi/mod.rs: -------------------------------------------------------------------------------- 1 | #[allow(warnings)] 2 | mod cloudabi; 3 | pub use self::cloudabi::*; 4 | -------------------------------------------------------------------------------- /lib/libstd/sys/cloudabi/args.rs: -------------------------------------------------------------------------------- 1 | pub use crate::sys::cloudabi::shims::args::*; 2 | 3 | #[allow(dead_code)] 4 | pub fn init(_: isize, _: *const *const u8) {} 5 | 6 | #[allow(dead_code)] 7 | pub fn cleanup() {} 8 | -------------------------------------------------------------------------------- /lib/libstd/sys/cloudabi/shims/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = "cloudabi"; 3 | pub const OS: &str = "cloudabi"; 4 | pub const DLL_PREFIX: &str = "lib"; 5 | pub const DLL_SUFFIX: &str = ".so"; 6 | pub const DLL_EXTENSION: &str = "so"; 7 | pub const EXE_SUFFIX: &str = ""; 8 | pub const EXE_EXTENSION: &str = ""; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/cloudabi/stack_overflow.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(test, allow(dead_code))] 2 | 3 | pub struct Handler; 4 | 5 | impl Handler { 6 | pub unsafe fn new() -> Handler { 7 | Handler 8 | } 9 | } 10 | 11 | pub unsafe fn init() {} 12 | 13 | pub unsafe fn cleanup() {} 14 | -------------------------------------------------------------------------------- /lib/libstd/sys/crux/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod condvar; 2 | pub mod mutex; 3 | pub mod rwlock; 4 | pub mod time; 5 | -------------------------------------------------------------------------------- /lib/libstd/sys/hermit/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = ""; 3 | pub const OS: &str = "hermit"; 4 | pub const DLL_PREFIX: &str = ""; 5 | pub const DLL_SUFFIX: &str = ""; 6 | pub const DLL_EXTENSION: &str = ""; 7 | pub const EXE_SUFFIX: &str = ""; 8 | pub const EXE_EXTENSION: &str = ""; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/hermit/fast_thread_local.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_thread_local)] 2 | #![unstable(feature = "thread_local_internals", issue = "none")] 3 | 4 | pub use crate::sys_common::thread_local::register_dtor_fallback as register_dtor; 5 | -------------------------------------------------------------------------------- /lib/libstd/sys/hermit/memchr.rs: -------------------------------------------------------------------------------- 1 | pub use core::slice::memchr::{memchr, memrchr}; 2 | -------------------------------------------------------------------------------- /lib/libstd/sys/hermit/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/hermit/stack_overflow.rs: -------------------------------------------------------------------------------- 1 | pub struct Handler; 2 | 3 | impl Handler { 4 | pub unsafe fn new() -> Handler { 5 | Handler 6 | } 7 | } 8 | 9 | #[inline] 10 | pub unsafe fn init() {} 11 | 12 | #[inline] 13 | pub unsafe fn cleanup() {} 14 | -------------------------------------------------------------------------------- /lib/libstd/sys/sgx/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &'static str = ""; 3 | pub const OS: &'static str = ""; 4 | pub const DLL_PREFIX: &'static str = ""; 5 | pub const DLL_SUFFIX: &'static str = ".sgxs"; 6 | pub const DLL_EXTENSION: &'static str = "sgxs"; 7 | pub const EXE_SUFFIX: &'static str = ".sgxs"; 8 | pub const EXE_EXTENSION: &'static str = "sgxs"; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/sgx/ext/mod.rs: -------------------------------------------------------------------------------- 1 | #![unstable(feature = "sgx_platform", issue = "56975")] 2 | 3 | pub mod arch; 4 | pub mod ffi; 5 | pub mod io; 6 | -------------------------------------------------------------------------------- /lib/libstd/sys/sgx/memchr.rs: -------------------------------------------------------------------------------- 1 | pub use core::slice::memchr::{memchr, memrchr}; 2 | -------------------------------------------------------------------------------- /lib/libstd/sys/sgx/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &'static str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/sgx/stack_overflow.rs: -------------------------------------------------------------------------------- 1 | pub struct Handler; 2 | 3 | impl Handler { 4 | pub unsafe fn new() -> Handler { 5 | Handler 6 | } 7 | } 8 | 9 | #[cfg_attr(test, allow(dead_code))] 10 | pub unsafe fn init() {} 11 | 12 | pub unsafe fn cleanup() {} 13 | -------------------------------------------------------------------------------- /lib/libstd/sys/unix/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/unix/process/mod.rs: -------------------------------------------------------------------------------- 1 | pub use self::process_common::{Command, ExitCode, Stdio, StdioPipes}; 2 | pub use self::process_inner::{ExitStatus, Process}; 3 | pub use crate::ffi::OsString as EnvKey; 4 | 5 | mod process_common; 6 | #[cfg(not(target_os = "fuchsia"))] 7 | #[path = "process_unix.rs"] 8 | mod process_inner; 9 | #[cfg(target_os = "fuchsia")] 10 | #[path = "process_fuchsia.rs"] 11 | mod process_inner; 12 | #[cfg(target_os = "fuchsia")] 13 | mod zircon; 14 | -------------------------------------------------------------------------------- /lib/libstd/sys/vxworks/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = "vxworks"; 3 | pub const OS: &str = "vxworks"; 4 | pub const DLL_PREFIX: &str = "lib"; 5 | pub const DLL_SUFFIX: &str = ".so"; 6 | pub const DLL_EXTENSION: &str = "so"; 7 | pub const EXE_SUFFIX: &str = ""; 8 | pub const EXE_EXTENSION: &str = ""; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/vxworks/ext/raw.rs: -------------------------------------------------------------------------------- 1 | #![stable(feature = "raw_ext", since = "1.1.0")] 2 | 3 | #[doc(inline)] 4 | #[stable(feature = "pthread_t", since = "1.8.0")] 5 | pub use crate::sys::platform::raw::pthread_t; 6 | -------------------------------------------------------------------------------- /lib/libstd/sys/vxworks/fast_thread_local.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_thread_local)] 2 | #![unstable(feature = "thread_local_internals", issue = "none")] 3 | 4 | pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { 5 | use crate::sys_common::thread_local::register_dtor_fallback; 6 | register_dtor_fallback(t, dtor); 7 | } 8 | 9 | pub fn requires_move_before_drop() -> bool { 10 | false 11 | } 12 | -------------------------------------------------------------------------------- /lib/libstd/sys/vxworks/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/vxworks/process/mod.rs: -------------------------------------------------------------------------------- 1 | pub use self::process_common::{Command, ExitCode, ExitStatus, Stdio, StdioPipes}; 2 | pub use self::process_inner::Process; 3 | pub use crate::ffi::OsString as EnvKey; 4 | 5 | mod process_common; 6 | #[path = "process_vxworks.rs"] 7 | mod process_inner; 8 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasi/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = ""; 3 | pub const OS: &str = ""; 4 | pub const DLL_PREFIX: &str = ""; 5 | pub const DLL_SUFFIX: &str = ".wasm"; 6 | pub const DLL_EXTENSION: &str = "wasm"; 7 | pub const EXE_SUFFIX: &str = ".wasm"; 8 | pub const EXE_EXTENSION: &str = "wasm"; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasi/ext/ffi.rs: -------------------------------------------------------------------------------- 1 | //! WASI-specific extension to the primitives in the `std::ffi` module 2 | 3 | #![stable(feature = "rust1", since = "1.0.0")] 4 | 5 | #[stable(feature = "rust1", since = "1.0.0")] 6 | pub use crate::sys_common::os_str_bytes::*; 7 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasi/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasm/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = ""; 3 | pub const OS: &str = ""; 4 | pub const DLL_PREFIX: &str = ""; 5 | pub const DLL_SUFFIX: &str = ".wasm"; 6 | pub const DLL_EXTENSION: &str = "wasm"; 7 | pub const EXE_SUFFIX: &str = ".wasm"; 8 | pub const EXE_EXTENSION: &str = "wasm"; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasm/memchr.rs: -------------------------------------------------------------------------------- 1 | pub use core::slice::memchr::{memchr, memrchr}; 2 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasm/path.rs: -------------------------------------------------------------------------------- 1 | use crate::ffi::OsStr; 2 | use crate::path::Prefix; 3 | 4 | #[inline] 5 | pub fn is_sep_byte(b: u8) -> bool { 6 | b == b'/' 7 | } 8 | 9 | #[inline] 10 | pub fn is_verbatim_sep(b: u8) -> bool { 11 | b == b'/' 12 | } 13 | 14 | pub fn parse_prefix(_: &OsStr) -> Option> { 15 | None 16 | } 17 | 18 | pub const MAIN_SEP_STR: &str = "/"; 19 | pub const MAIN_SEP: char = '/'; 20 | -------------------------------------------------------------------------------- /lib/libstd/sys/wasm/stack_overflow.rs: -------------------------------------------------------------------------------- 1 | pub struct Handler; 2 | 3 | impl Handler { 4 | pub unsafe fn new() -> Handler { 5 | Handler 6 | } 7 | } 8 | 9 | pub unsafe fn init() {} 10 | 11 | pub unsafe fn cleanup() {} 12 | -------------------------------------------------------------------------------- /lib/libstd/sys/windows/env.rs: -------------------------------------------------------------------------------- 1 | pub mod os { 2 | pub const FAMILY: &str = "windows"; 3 | pub const OS: &str = "windows"; 4 | pub const DLL_PREFIX: &str = ""; 5 | pub const DLL_SUFFIX: &str = ".dll"; 6 | pub const DLL_EXTENSION: &str = "dll"; 7 | pub const EXE_SUFFIX: &str = ".exe"; 8 | pub const EXE_EXTENSION: &str = "exe"; 9 | } 10 | -------------------------------------------------------------------------------- /lib/libstd/sys/windows/ext/raw.rs: -------------------------------------------------------------------------------- 1 | //! Windows-specific primitives 2 | 3 | #![stable(feature = "raw_ext", since = "1.1.0")] 4 | 5 | use crate::os::raw::c_void; 6 | 7 | #[stable(feature = "raw_ext", since = "1.1.0")] 8 | pub type HANDLE = *mut c_void; 9 | #[cfg(target_pointer_width = "32")] 10 | #[stable(feature = "raw_ext", since = "1.1.0")] 11 | pub type SOCKET = u32; 12 | #[cfg(target_pointer_width = "64")] 13 | #[stable(feature = "raw_ext", since = "1.1.0")] 14 | pub type SOCKET = u64; 15 | -------------------------------------------------------------------------------- /lib/libstd/sys/windows/fast_thread_local.rs: -------------------------------------------------------------------------------- 1 | #![unstable(feature = "thread_local_internals", issue = "none")] 2 | #![cfg(target_thread_local)] 3 | 4 | pub use crate::sys_common::thread_local::register_dtor_fallback as register_dtor; 5 | -------------------------------------------------------------------------------- /lib/libstd/sys/windows/memchr.rs: -------------------------------------------------------------------------------- 1 | // Original implementation taken from rust-memchr. 2 | // Copyright 2015 Andrew Gallant, bluss and Nicolas Koch 3 | 4 | // Fallback memchr is fastest on Windows. 5 | pub use core::slice::memchr::{memchr, memrchr}; 6 | -------------------------------------------------------------------------------- /lib/libstd/sys/windows/stack_overflow_uwp.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(test, allow(dead_code))] 2 | 3 | pub struct Handler; 4 | 5 | impl Handler { 6 | pub fn new() -> Handler { 7 | Handler 8 | } 9 | } 10 | 11 | pub unsafe fn init() {} 12 | 13 | pub unsafe fn cleanup() {} 14 | -------------------------------------------------------------------------------- /lib/libterm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The Rust Project Developers"] 3 | name = "term" 4 | version = "0.0.0" 5 | edition = "2018" 6 | 7 | [lib] 8 | path = "lib.rs" 9 | 10 | [dependencies] 11 | core = { path = "../libcore" } 12 | std = { path = "../libstd" } 13 | -------------------------------------------------------------------------------- /lib/libterm/terminfo/parser/compiled/tests.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | #[test] 4 | fn test_veclens() { 5 | assert_eq!(boolfnames.len(), boolnames.len()); 6 | assert_eq!(numfnames.len(), numnames.len()); 7 | assert_eq!(stringfnames.len(), stringnames.len()); 8 | } 9 | -------------------------------------------------------------------------------- /lib/libtest/helpers/mod.rs: -------------------------------------------------------------------------------- 1 | //! Module with common helpers not directly related to tests 2 | //! but used in `libtest`. 3 | 4 | pub mod concurrency; 5 | pub mod exit_code; 6 | pub mod isatty; 7 | pub mod metrics; 8 | pub mod sink; 9 | -------------------------------------------------------------------------------- /lib/rustc-demangle/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustc-demangle" 3 | version = "0.1.4" 4 | authors = ["Alex Crichton "] 5 | license = "MIT/Apache-2.0" 6 | readme = "README.md" 7 | repository = "https://github.com/alexcrichton/rustc-demangle" 8 | homepage = "https://github.com/alexcrichton/rustc-demangle" 9 | documentation = "http://alexcrichton.com/rustc-demangle" 10 | description = """ 11 | Rust compiler symbol demangling. 12 | """ 13 | -------------------------------------------------------------------------------- /lib/stdarch/.cirrus.yml: -------------------------------------------------------------------------------- 1 | task: 2 | name: x86_64-unknown-freebsd 3 | freebsd_instance: 4 | image: freebsd-12-0-release-amd64 5 | setup_script: 6 | - pkg install -y curl 7 | - curl https://sh.rustup.rs -sSf --output rustup.sh 8 | - sh rustup.sh --default-toolchain nightly -y 9 | - . $HOME/.cargo/env 10 | - rustup default nightly 11 | test_script: 12 | - . $HOME/.cargo/env 13 | - cargo build --all 14 | -------------------------------------------------------------------------------- /lib/stdarch/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | .*.swp 3 | target 4 | tags -------------------------------------------------------------------------------- /lib/stdarch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "crates/stdarch-verify", 4 | "crates/core_arch", 5 | "crates/std_detect", 6 | "examples/" 7 | ] 8 | exclude = [ 9 | "crates/wasm-assert-instr-tests" 10 | ] 11 | 12 | [profile.release] 13 | debug = true 14 | opt-level = 3 15 | incremental = true 16 | 17 | [profile.bench] 18 | debug = 1 19 | opt-level = 3 20 | incremental = true 21 | -------------------------------------------------------------------------------- /lib/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc-multilib \ 4 | libc6-dev \ 5 | file \ 6 | make \ 7 | ca-certificates 8 | -------------------------------------------------------------------------------- /lib/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc-multilib \ 4 | libc6-dev \ 5 | file \ 6 | make \ 7 | ca-certificates 8 | -------------------------------------------------------------------------------- /lib/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | libc6-dev \ 5 | ca-certificates 6 | -------------------------------------------------------------------------------- /lib/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && apt-get install -y --no-install-recommends \ 3 | gcc \ 4 | libc6-dev \ 5 | file \ 6 | make \ 7 | ca-certificates 8 | -------------------------------------------------------------------------------- /lib/stdarch/ci/style.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -ex 4 | 5 | if rustup component add rustfmt-preview ; then 6 | command -v rustfmt 7 | rustfmt -V 8 | cargo fmt --all -- --check 9 | fi 10 | 11 | # if rustup component add clippy-preview ; then 12 | # cargo clippy -V 13 | # cargo clippy --all -- -D clippy::pedantic 14 | # fi 15 | 16 | if shellcheck --version ; then 17 | shellcheck -e SC2103 ci/*.sh 18 | else 19 | echo "shellcheck not found" 20 | exit 1 21 | fi 22 | 23 | -------------------------------------------------------------------------------- /lib/stdarch/crates/assert-instr-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "assert-instr-macro" 3 | version = "0.1.0" 4 | authors = ["Alex Crichton "] 5 | 6 | [lib] 7 | proc-macro = true 8 | test = false 9 | 10 | [dependencies] 11 | proc-macro2 = "1.0" 12 | quote = "1.0" 13 | syn = { version = "1.0", features = ["full"] } 14 | -------------------------------------------------------------------------------- /lib/stdarch/crates/assert-instr-macro/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | println!("cargo:rerun-if-changed=build.rs"); 5 | let opt_level = env::var("OPT_LEVEL") 6 | .ok() 7 | .and_then(|s| s.parse().ok()) 8 | .unwrap_or(0); 9 | let profile = env::var("PROFILE").unwrap_or(String::new()); 10 | if profile == "release" || opt_level >= 2 { 11 | println!("cargo:rustc-cfg=optimized"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rustc-cfg=core_arch_docs"); 3 | } 4 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/rustfmt.toml: -------------------------------------------------------------------------------- 1 | ignore = [ 2 | "src/simd.rs", 3 | ] 4 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/acle/barrier/common.rs: -------------------------------------------------------------------------------- 1 | //! Access types available on all architectures 2 | 3 | /// Full system is the required shareability domain, reads and writes are the 4 | /// required access types 5 | pub struct SY; 6 | 7 | dmb_dsb!(SY); 8 | 9 | impl super::super::sealed::Isb for SY { 10 | #[inline(always)] 11 | unsafe fn __isb(&self) { 12 | super::isb(super::arg::SY) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/acle/registers/aarch32.rs: -------------------------------------------------------------------------------- 1 | /// Application Program Status Register 2 | pub struct APSR; 3 | 4 | // Note (@Lokathor): Because this breaks the use of Rust on the Game Boy 5 | // Advance, this change must be reverted until Rust learns to handle cpu state 6 | // properly. See also: https://github.com/rust-lang/stdarch/issues/702 7 | 8 | //#[cfg(any(not(target_feature = "thumb-state"), target_feature = "v6t2"))] 9 | //rsr!(APSR); 10 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/acle/registers/v7m.rs: -------------------------------------------------------------------------------- 1 | /// Base Priority Mask Register 2 | pub struct BASEPRI; 3 | 4 | rsr!(BASEPRI); 5 | wsr!(BASEPRI); 6 | 7 | /// Base Priority Mask Register (conditional write) 8 | #[allow(non_camel_case_types)] 9 | pub struct BASEPRI_MAX; 10 | 11 | wsr!(BASEPRI_MAX); 12 | 13 | /// Fault Mask Register 14 | pub struct FAULTMASK; 15 | 16 | rsr!(FAULTMASK); 17 | wsr!(FAULTMASK); 18 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/acle/sat.rs: -------------------------------------------------------------------------------- 1 | //! # References: 2 | //! 3 | //! - Section 8.4 "Saturating intrinsics" 4 | //! 5 | //! Intrinsics that could live here: 6 | //! 7 | //! - __ssat 8 | //! - __usat 9 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/mips/mod.rs: -------------------------------------------------------------------------------- 1 | //! MIPS 2 | 3 | mod msa; 4 | pub use self::msa::*; 5 | 6 | #[cfg(test)] 7 | use stdarch_test::assert_instr; 8 | 9 | /// Generates the trap instruction `BREAK` 10 | #[cfg_attr(test, assert_instr(break))] 11 | #[inline] 12 | pub unsafe fn break_() -> ! { 13 | crate::intrinsics::abort() 14 | } 15 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/powerpc/mod.rs: -------------------------------------------------------------------------------- 1 | //! PowerPC intrinsics 2 | 3 | #[cfg(target_feature = "altivec")] 4 | mod altivec; 5 | #[cfg(target_feature = "altivec")] 6 | pub use self::altivec::*; 7 | 8 | mod vsx; 9 | pub use self::vsx::*; 10 | 11 | #[cfg(test)] 12 | use stdarch_test::assert_instr; 13 | 14 | /// Generates the trap instruction `TRAP` 15 | #[cfg_attr(test, assert_instr(trap))] 16 | #[inline] 17 | pub unsafe fn trap() -> ! { 18 | crate::intrinsics::abort() 19 | } 20 | -------------------------------------------------------------------------------- /lib/stdarch/crates/core_arch/src/powerpc64/mod.rs: -------------------------------------------------------------------------------- 1 | //! PowerPC 64 2 | //! 3 | //! The reference is the [64-Bit ELF V2 ABI Specification - Power 4 | //! Architecture]. 5 | //! 6 | //! [64-Bit ELF V2 ABI Specification - Power Architecture]: http://openpowerfoundation.org/wp-content/uploads/resources/leabi/leabi-20170510.pdf 7 | 8 | pub use crate::core_arch::powerpc::*; 9 | -------------------------------------------------------------------------------- /lib/stdarch/crates/simd-test-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simd-test-macro" 3 | version = "0.1.0" 4 | authors = ["Alex Crichton "] 5 | 6 | [lib] 7 | proc-macro = true 8 | test = false 9 | 10 | [dependencies] 11 | proc-macro2 = "1.0" 12 | quote = "1.0" 13 | -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/arch/mips.rs: -------------------------------------------------------------------------------- 1 | //! Run-time feature detection on MIPS. 2 | 3 | features! { 4 | @TARGET: mips; 5 | @MACRO_NAME: is_mips_feature_detected; 6 | @MACRO_ATTRS: 7 | /// Checks if `mips` feature is enabled. 8 | #[unstable(feature = "stdsimd", issue = "27731")] 9 | @FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] msa: "msa"; 10 | /// MIPS SIMD Architecture (MSA) 11 | } 12 | -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/arch/mips64.rs: -------------------------------------------------------------------------------- 1 | //! Run-time feature detection on MIPS64. 2 | 3 | features! { 4 | @TARGET: mips64; 5 | @MACRO_NAME: is_mips64_feature_detected; 6 | @MACRO_ATTRS: 7 | /// Checks if `mips64` feature is enabled. 8 | #[unstable(feature = "stdsimd", issue = "27731")] 9 | @FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] msa: "msa"; 10 | /// MIPS SIMD Architecture (MSA) 11 | } 12 | -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/bit.rs: -------------------------------------------------------------------------------- 1 | //! Bit manipulation utilities. 2 | 3 | /// Tests the `bit` of `x`. 4 | #[allow(dead_code)] 5 | #[inline] 6 | pub(crate) fn test(x: usize, bit: u32) -> bool { 7 | debug_assert!(bit < 32, "bit index out-of-bounds"); 8 | x & (1 << bit) != 0 9 | } 10 | -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/os/other.rs: -------------------------------------------------------------------------------- 1 | //! Other operating systems 2 | 3 | use crate::detect::cache; 4 | 5 | pub(crate) fn detect_features() -> cache::Initializer { 6 | cache::Initializer::default() 7 | } 8 | -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/test_data/linux-rpi3.auxv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GaloisInc/mir-verifier/ff71bd2b4bb58c71c4a93e1726c60b4aef96bcc0/lib/stdarch/crates/std_detect/src/detect/test_data/linux-rpi3.auxv -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/test_data/linux-x64-i7-6850k.auxv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GaloisInc/mir-verifier/ff71bd2b4bb58c71c4a93e1726c60b4aef96bcc0/lib/stdarch/crates/std_detect/src/detect/test_data/linux-x64-i7-6850k.auxv -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GaloisInc/mir-verifier/ff71bd2b4bb58c71c4a93e1726c60b4aef96bcc0/lib/stdarch/crates/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv -------------------------------------------------------------------------------- /lib/stdarch/crates/std_detect/src/mod.rs: -------------------------------------------------------------------------------- 1 | //! `std_detect` 2 | 3 | #[doc(hidden)] // unstable implementation detail 4 | #[unstable(feature = "stdsimd", issue = "27731")] 5 | pub mod detect; 6 | -------------------------------------------------------------------------------- /lib/stdarch/crates/stdarch-verify/.gitattributes: -------------------------------------------------------------------------------- 1 | *.xml binary 2 | -------------------------------------------------------------------------------- /lib/stdarch/crates/stdarch-verify/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stdarch-verify" 3 | version = "0.1.0" 4 | authors = ["Alex Crichton "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | proc-macro2 = "1.0" 9 | quote = "1.0" 10 | syn = { version = "1.0", features = ["full"] } 11 | 12 | [lib] 13 | proc-macro = true 14 | test = false 15 | 16 | [dev-dependencies] 17 | serde = { version = "1.0", features = ['derive'] } 18 | serde-xml-rs = "0.3" 19 | html5ever = "0.23.0" 20 | -------------------------------------------------------------------------------- /lib/stdarch/vendor.yml: -------------------------------------------------------------------------------- 1 | - crates/stdarch-verify/arm-intrinsics.html 2 | - crates/stdarch-verify/x86-intel.xml 3 | -------------------------------------------------------------------------------- /lib/unicode-width/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 2 | or the MIT 4 | license , 5 | at your option. All files in the project carrying such 6 | notice may not be copied, modified, or distributed except 7 | according to those terms. 8 | -------------------------------------------------------------------------------- /stack-ghc-8.4.yaml: -------------------------------------------------------------------------------- 1 | flags: {} 2 | packages: 3 | - deps/crucible/what4 4 | - deps/crucible/crucible 5 | - deps/crucible/crucible-saw 6 | - deps/crucible/crux 7 | - deps/saw-core 8 | - deps/parameterized-utils 9 | - deps/saw-core-aig 10 | - deps/aig 11 | - . 12 | extra-deps: 13 | - panic-0.4.0.0 14 | resolver: lts-12.26 15 | allow-newer: true 16 | -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- 1 | stack-ghc-8.4.yaml -------------------------------------------------------------------------------- /test/conc_eval/.gitignore: -------------------------------------------------------------------------------- 1 | *.mir -------------------------------------------------------------------------------- /test/conc_eval/array/clone.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | pub fn f() { 4 | let x = [1, 2, 3]; 5 | let y = x.clone(); 6 | assert!(x == y); 7 | } 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 10 | -------------------------------------------------------------------------------- /test/conc_eval/array/const.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | mod constants { 3 | pub(crate) const L: [u64;1] = [ 1 ]; 4 | } 5 | 6 | 7 | 8 | const ARG: u64 = 20; 9 | 10 | fn f(_w : u64 ) -> u64 { 11 | constants::L[0] 12 | } 13 | 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u64 { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/array/const_impl.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | // Tests calls to methods defined in const impls. 3 | 4 | pub fn f(x: i32) -> usize { 5 | let arr: [i32; 5] = [x; 5]; 6 | arr.as_ref().len() 7 | } 8 | 9 | pub static ARG: i32 = 1; 10 | 11 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> usize { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/array/iter.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | fn f(_x: u8) -> i32 { 4 | let mut xs : [i32; 3] = [0; 3]; 5 | xs[1] = 1; 6 | xs[2] = 2; 7 | let mut y : i32 = 0; 8 | for x in &xs { 9 | y += x; 10 | } 11 | y 12 | } 13 | 14 | const ARG: u8 = 42; 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/array/mk_and_proj.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u8) -> u8 { 3 | let xs = [x; 4]; 4 | xs[0] 5 | } 6 | 7 | const ARG: u8 = 42; 8 | 9 | #[cfg(with_main)] 10 | pub fn main() { 11 | println!("{:?}", f(ARG)); 12 | } 13 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 14 | -------------------------------------------------------------------------------- /test/conc_eval/box/mut.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg(not(with_main))] extern crate std; 4 | #[cfg(not(with_main))] use std::boxed::Box; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut b = Box::new(123_i32); 9 | assert!(*b == 123); 10 | *b = 456; 11 | assert!(*b == 456); 12 | } 13 | 14 | 15 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 16 | -------------------------------------------------------------------------------- /test/conc_eval/box/mut_ref.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg(not(with_main))] extern crate std; 4 | #[cfg(not(with_main))] use std::boxed::Box; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut b = Box::new(123_i32); 9 | let r = &mut *b; 10 | assert!(*r == 123); 11 | *r = 456; 12 | assert!(*r == 456); 13 | } 14 | 15 | 16 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 17 | -------------------------------------------------------------------------------- /test/conc_eval/box/new.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg(not(with_main))] extern crate std; 4 | #[cfg(not(with_main))] use std::boxed::Box; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let b = Box::new(123_i32); 9 | assert!(*b == 123); 10 | } 11 | 12 | 13 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 14 | -------------------------------------------------------------------------------- /test/conc_eval/box/struct.rs: -------------------------------------------------------------------------------- 1 | #![feature(box_syntax)] 2 | 3 | struct Test(i32); 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() -> i32 { 7 | let x = box Test(1); 8 | x.0 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/box/unsize.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | pub fn f() -> i32 { 3 | let b = Box::new([1, 2, 3]); 4 | let s: Box<[i32]> = b; 5 | s[1] 6 | } 7 | 8 | 9 | pub fn main() { println!("{:?}", f()); } 10 | -------------------------------------------------------------------------------- /test/conc_eval/cell/cell.rs: -------------------------------------------------------------------------------- 1 | use std::cell::Cell; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x = Cell::new(1); 6 | x.set(2); 7 | x.get() 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/cell/ref_cell.rs: -------------------------------------------------------------------------------- 1 | // The `Drop` impl for the `RefMut` never runs, so the ref count is never reset, and the call to 2 | // `borrow` fails. 3 | use std::cell::RefCell; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() -> i32 { 7 | let x = RefCell::new(1); 8 | *x.borrow_mut() = 2; 9 | let val = *x.borrow(); 10 | val 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/clos/conv_fnonce_fn.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn call_it i32>(f: F) -> i32 { 3 | f(1) 4 | } 5 | 6 | pub fn convert_it i32>(f: F) -> i32 { 7 | call_it(f) 8 | } 9 | 10 | pub fn f(x: i32) -> i32 { 11 | convert_it(|y| x + y) 12 | } 13 | 14 | pub static ARG: i32 = 1; 15 | 16 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 17 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 18 | -------------------------------------------------------------------------------- /test/conc_eval/clos/conv_fnonce_fnmut.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn call_it i32>(f: F) -> i32 { 3 | f(1) 4 | } 5 | 6 | pub fn convert_it i32>(f: F) -> i32 { 7 | call_it(f) 8 | } 9 | 10 | pub fn f(x: i32) -> i32 { 11 | convert_it(|y| x + y) 12 | } 13 | 14 | pub static ARG: i32 = 1; 15 | 16 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 17 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 18 | -------------------------------------------------------------------------------- /test/conc_eval/clos/direct_fn.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn call_it i32>(f: F) -> i32 { 3 | f(1) 4 | } 5 | 6 | pub fn f(x: i32) -> i32 { 7 | call_it(|y| x + y) 8 | } 9 | 10 | pub static ARG: i32 = 1; 11 | 12 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 13 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 14 | -------------------------------------------------------------------------------- /test/conc_eval/clos/direct_fnonce.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn call_it i32>(f: F) -> i32 { 3 | f(1) 4 | } 5 | 6 | pub fn f(x: i32) -> i32 { 7 | call_it(|y| x + y) 8 | } 9 | 10 | pub static ARG: i32 = 1; 11 | 12 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 13 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 14 | -------------------------------------------------------------------------------- /test/conc_eval/clos/fn_dyn.rs: -------------------------------------------------------------------------------- 1 | // FAIL: call_once shim (in `dyn Fn` vtable) 2 | #![cfg_attr(not(with_main), no_std)] 3 | fn call_with_one(some_closure: &Fn(i32) -> i32) -> i32 { 4 | some_closure(1) 5 | } 6 | 7 | fn f (y:i32) -> i32 { 8 | 9 | call_with_one(&|x| x + y) 10 | 11 | } 12 | 13 | const ARG :i32 = 2; 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/clos/fn_static.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn call_with_onei32>(some_closure: &F) -> i32 { 3 | 4 | some_closure(1) 5 | 6 | } 7 | 8 | fn f (y:i32) -> i32 { 9 | 10 | call_with_one(&|x| x + y) 11 | 12 | } 13 | 14 | const ARG :i32 = 2; 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/clos/fn_static_poly.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn call_with_oneT>(some_closure: &F, arg:T) -> T { 3 | 4 | some_closure(arg) 5 | 6 | } 7 | 8 | fn f (y:i32) -> i32 { 9 | 10 | call_with_one(&|x| x + y, 1) 11 | 12 | } 13 | 14 | const ARG :i32 = 2; 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/clos/fnonce.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | 4 | fn call_with_one(some_closure: &F) -> bool 5 | where F: Fn(i32) -> bool { 6 | 7 | some_closure(1) 8 | } 9 | 10 | fn f (y:i32) -> bool { 11 | 12 | call_with_one(&|x| x < y) 13 | 14 | } 15 | 16 | const ARG :i32 = 0; 17 | 18 | #[cfg(with_main)] 19 | pub fn main() { 20 | println!("{:?}", f(ARG)); 21 | } 22 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> bool { f(ARG) } 23 | -------------------------------------------------------------------------------- /test/conc_eval/clos/fo.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #![feature(type_ascription)] 4 | 5 | fn f (y:i32) -> i32 { 6 | let z = 12; 7 | let w = 13; 8 | 9 | let g = |x:i32| x + y + z + w; 10 | 11 | g((1 :i32)) 12 | 13 | } 14 | 15 | const ARG :i32 = 3; 16 | 17 | #[cfg(with_main)] 18 | pub fn main() { 19 | println!("{:?}", f(ARG)); 20 | } 21 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 22 | -------------------------------------------------------------------------------- /test/conc_eval/clos/poly.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn h(x :T) -> T { x } 3 | 4 | fn f (x : u32) -> u32 { 5 | h (|y| y + 1) (x) 6 | } 7 | 8 | const ARG :u32 = 2; 9 | 10 | #[cfg(with_main)] 11 | pub fn main() { 12 | println!("{:?}", f(ARG)); 13 | } 14 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 15 | -------------------------------------------------------------------------------- /test/conc_eval/clos/promoted.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | fn k(x : u32) -> u32 { 4 | x + 1 5 | } 6 | 7 | fn app(x : &G, y : u32) -> u32 8 | where G : Fn(u32) -> u32 { 9 | x(y) 10 | } 11 | 12 | 13 | fn f(_: ()) -> u32 { 14 | let d = 32; 15 | app(&k,d) 16 | } 17 | 18 | const ARG: () = (); 19 | 20 | #[cfg(with_main)] 21 | pub fn main() { 22 | println!("{:?}", f(ARG)); 23 | } 24 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 25 | -------------------------------------------------------------------------------- /test/conc_eval/clos/ref_fnmut.rs: -------------------------------------------------------------------------------- 1 | 2 | pub fn call_it i32>(f: F) -> i32 { 3 | let mut f = f; 4 | f(1) 5 | } 6 | 7 | #[cfg_attr(crux, crux_test)] 8 | pub fn f() -> i32 { 9 | let x = 1; 10 | let mut z = 0; 11 | let a = call_it(|y| { z += 1; x + y + z }); 12 | let b = call_it(&mut |y| { z += 1; x + y + z }); 13 | a + b 14 | } 15 | 16 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 17 | -------------------------------------------------------------------------------- /test/conc_eval/clos/unique_borrow.rs: -------------------------------------------------------------------------------- 1 | 2 | fn call_it i32>(mut f: F) -> i32 { 3 | f() + f() 4 | } 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> i32 { 8 | let mut x = 0; 9 | let y: &mut i32 = &mut x; 10 | call_it(|| { 11 | *y += 1; 12 | *y 13 | }) 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | -------------------------------------------------------------------------------- /test/conc_eval/consts/enum_val.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> Option { 3 | // As of nightly-2020-03-22, this struct expression gets constant-folded down to `Scalar(2)`. 4 | // There is now code in mir-json to extract the fields in a form mir-verifier can interpret. 5 | None 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/consts/fn_def.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | fn f() -> i32 { 1 } 4 | fn g() -> i32 { 2 } 5 | 6 | const FN_PTR: fn() -> i32 = f; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", FN_PTR()); 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { FN_PTR() } 13 | -------------------------------------------------------------------------------- /test/conc_eval/consts/struct_unit.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | struct Foo { 3 | x: (), 4 | } 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> Result<(), Foo> { 8 | //None.ok_or(Foo { x: () })?; 9 | //Ok(()) 10 | Err(Foo { x: () }) 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/consts/struct_val.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | struct Foo { 3 | x: bool, 4 | } 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> Foo { 8 | // As of nightly-2020-03-22, this struct expression gets constant-folded down to `Scalar(1)`. 9 | // There is now code in mir-json to extract the fields in a form mir-verifier can interpret. 10 | Foo { x: true } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/enum/arg.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | enum E { 3 | A(u8), 4 | B(i32,i32), 5 | } 6 | 7 | fn f(x: E) -> u8 { 8 | match x { 9 | E::A(n) => n, 10 | E::B(n,m) => 0, 11 | } 12 | } 13 | 14 | const ARG: E = E::B(42,43); 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/enum/cow.rs: -------------------------------------------------------------------------------- 1 | use std::borrow::Cow; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> u8 { 5 | let x: Cow<[u8]> = Cow::Borrowed(b"foo"); 6 | let y: Cow<[u8]> = Cow::Owned(b"bar".to_vec()); 7 | x[0] + y[0] 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/enum/field_order.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | pub enum E { 4 | A(u8, u16), 5 | } 6 | 7 | #[cfg_attr(crux, crux_test)] 8 | pub fn f() { 9 | // If the field ordering used in `buildEnum` is wrong, then this will fail due to type 10 | // mismatches between BVRepr 8 and BVRepr 16. 11 | match E::A(1, 2) { 12 | E::A(x, y) => assert!(x == 1 && y == 2), 13 | } 14 | } 15 | 16 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 17 | -------------------------------------------------------------------------------- /test/conc_eval/enum/match.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | enum E { 3 | A(u8), 4 | B(i32), 5 | } 6 | 7 | fn f(_: ()) -> u8 { 8 | let x = E::A(42); 9 | match x { 10 | E::A(n) => n, 11 | E::B(n) => 0, 12 | } 13 | } 14 | 15 | const ARG: () = (); 16 | 17 | #[cfg(with_main)] 18 | pub fn main() { 19 | println!("{:?}", f(ARG)); 20 | } 21 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 22 | -------------------------------------------------------------------------------- /test/conc_eval/enum/ret.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | #[cfg_attr(with_main, derive(Debug))] 3 | enum E { 4 | A(u8), 5 | B { x: i32 }, 6 | C, 7 | } 8 | 9 | fn f(_: ()) -> (E, E, E) { 10 | (E::A(42), E::B { x: 42 }, E::C) 11 | } 12 | 13 | const ARG: () = (); 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> (E, E, E) { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/fnptr/call.rs: -------------------------------------------------------------------------------- 1 | 2 | fn f(x: i32) -> i32 { 3 | x + 1 4 | } 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> i32 { 8 | let p: fn(i32) -> i32 = f; 9 | p(1) 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/fnptr/custom.rs: -------------------------------------------------------------------------------- 1 | // FAIL: taking address of an overridden function 2 | use core::mem; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let mut x = 1; 7 | let mut y = 2; 8 | let p: fn(&mut i32, &mut i32) = mem::swap; 9 | p(&mut x, &mut y); 10 | x 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/fnptr/field.rs: -------------------------------------------------------------------------------- 1 | 2 | fn test_func(x: i32) -> i32 { 3 | x + 1 4 | } 5 | 6 | struct Test { 7 | f: fn(i32) -> i32, 8 | } 9 | 10 | #[cfg_attr(crux, crux_test)] 11 | fn crux_test() -> i32 { 12 | let f = Test { f: test_func }; 13 | (f.f)(1) 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | -------------------------------------------------------------------------------- /test/conc_eval/fnptr/make.rs: -------------------------------------------------------------------------------- 1 | 2 | fn f(x: i32) -> i32 { 3 | x + 1 4 | } 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> i32 { 8 | let p: fn(i32) -> i32 = f; 9 | 0 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/hash_map/insert_get.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> (i32, i32) { 5 | let mut m = HashMap::new(); 6 | m.insert(1, 11); 7 | m.insert(2, 12); 8 | assert!(m.len() == 2); 9 | assert!(m.get(&3).is_none()); 10 | (*m.get(&1).unwrap(), *m.get(&2).unwrap()) 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/hash_map/insert_iter.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 2] { 5 | let mut m = HashMap::new(); 6 | m.insert(1, 11); 7 | m.insert(2, 12); 8 | assert!(m.iter().count() == 2); 9 | let mut out = [0; 2]; 10 | for (&k, &v) in m.iter() { 11 | out[k as usize - 1] = v; 12 | } 13 | out 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | -------------------------------------------------------------------------------- /test/conc_eval/hash_map/insert_multi.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let mut m = HashMap::new(); 6 | m.insert(1, 11); 7 | m.insert(1, 100); 8 | m.insert(2, 12); 9 | assert!(m.len() == 2); 10 | *m.get(&1).unwrap() 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/hash_map/insert_remove.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let mut m = HashMap::new(); 6 | m.insert(1, 11); 7 | m.insert(2, 12); 8 | m.remove(&1); 9 | assert!(m.len() == 1); 10 | assert!(m.get(&1).is_none()); 11 | *m.get(&2).unwrap() 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/impl/self.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | struct S { 3 | x: u32, 4 | } 5 | 6 | impl S { 7 | fn g(&self) -> u32 { 8 | self.x + 1 9 | } 10 | } 11 | 12 | fn f(_: ()) -> u32 { 13 | let s = S { x: 41 }; 14 | s.g() 15 | } 16 | 17 | const ARG: () = (); 18 | 19 | #[cfg(with_main)] 20 | pub fn main() { 21 | println!("{:?}", f(ARG)); 22 | } 23 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 24 | -------------------------------------------------------------------------------- /test/conc_eval/impl/self_mut.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | struct S { 3 | x: u32, 4 | } 5 | 6 | impl S { 7 | fn g(&mut self) { 8 | self.x += 1; 9 | } 10 | } 11 | 12 | fn f(_: ()) -> u32 { 13 | let mut s = S { x: 41 }; 14 | s.g(); 15 | s.x 16 | } 17 | 18 | const ARG: () = (); 19 | 20 | #[cfg(with_main)] 21 | pub fn main() { 22 | println!("{:?}", f(ARG)); 23 | } 24 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 25 | -------------------------------------------------------------------------------- /test/conc_eval/impl/simple.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | enum S {} 3 | 4 | impl S { 5 | fn g() -> u32 { 6 | 42 7 | } 8 | } 9 | 10 | fn f(_: ()) -> u32 { 11 | S::g() 12 | } 13 | 14 | const ARG: () = (); 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/iter/cloned.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> usize { 4 | let xs = [1, 2, 3]; 5 | 6 | let mut sum = 0; 7 | for x in xs.iter().cloned() { 8 | sum += x; 9 | } 10 | sum 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/iter/for.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f (y : u32) -> u32 { 3 | let mut x = y; 4 | for k in 0 .. 10 { 5 | x = x + k; 6 | } 7 | 8 | return x; 9 | } 10 | 11 | 12 | const ARG :u32 = 2; 13 | 14 | #[cfg(with_main)] 15 | pub fn main() { 16 | println!("{:?}", f(ARG)); 17 | } 18 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 19 | -------------------------------------------------------------------------------- /test/conc_eval/iter/from_fn.rs: -------------------------------------------------------------------------------- 1 | use std::iter; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let mut i = 0; 6 | let sum: i32 = iter::from_fn(|| { 7 | i += 1; 8 | if i < 5 { Some(i) } else { None } 9 | }).sum(); 10 | assert!(sum == 10); 11 | } 12 | 13 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 14 | -------------------------------------------------------------------------------- /test/conc_eval/iter/loop.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f (x : u32) -> u32 { 3 | 4 | let mut k = 0; 5 | loop { 6 | if k == x { 7 | break; 8 | } 9 | k = k+1; 10 | } 11 | return k; 12 | } 13 | 14 | const ARG :u32 = 2; 15 | 16 | #[cfg(with_main)] 17 | pub fn main() { 18 | println!("{:?}", f(ARG)); 19 | } 20 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 21 | -------------------------------------------------------------------------------- /test/conc_eval/iter/peek.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> usize { 4 | let xs = [1, 2, 3]; 5 | 6 | let mut sum = 0; 7 | let mut it = xs.iter().peekable(); 8 | while it.peek().map_or(false, |&&x| x < 3) { 9 | sum += it.next().unwrap(); 10 | } 11 | sum 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/iter/sum.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let arr = [1, 2, 3, 4]; 6 | let sum: usize = arr.iter().cloned().sum(); 7 | assert!(sum == 10); 8 | } 9 | 10 | 11 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 12 | -------------------------------------------------------------------------------- /test/conc_eval/iter/zip.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let arr = [1, 2, 3, 4]; 6 | let arr = &arr[..]; 7 | for (&a, &b) in arr.iter().zip(arr.iter().skip(1)) { 8 | assert!(a < b); 9 | } 10 | } 11 | 12 | 13 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 14 | -------------------------------------------------------------------------------- /test/conc_eval/mem/maybe_uninit.rs: -------------------------------------------------------------------------------- 1 | use std::mem::MaybeUninit; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let mut i = MaybeUninit::uninit(); 6 | unsafe { 7 | *i.as_mut_ptr() = 1; 8 | i.assume_init() 9 | } 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/mem/maybe_uninit_array_cast.rs: -------------------------------------------------------------------------------- 1 | use std::mem::MaybeUninit; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 2] { 5 | let mut i = MaybeUninit::uninit(); 6 | unsafe { 7 | let ptr = i.as_mut_ptr() as *mut i32; 8 | *ptr = 1; 9 | *ptr.add(1) = 2; 10 | i.assume_init() 11 | } 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/num/from_bytes.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | assert!(u16::from_be_bytes([0x12, 0x34]) == 0x1234); 6 | assert!(u16::from_le_bytes([0x12, 0x34]) == 0x3412); 7 | } 8 | 9 | 10 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 11 | -------------------------------------------------------------------------------- /test/conc_eval/prim/add1.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u8) -> u8 { 3 | x + 1 4 | } 5 | 6 | const ARG: u8 = 1; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)) 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/bool.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: bool) -> bool { 3 | x ^ true 4 | } 5 | 6 | const ARG: bool = true; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)) 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> bool { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/char_from_u32.rs: -------------------------------------------------------------------------------- 1 | use std::char; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> char { 5 | unsafe { char::from_u32_unchecked(0x41) } 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/prim/div.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u8) -> u8 { 3 | x / 2 4 | } 5 | 6 | const ARG: u8 = 9; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)) 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/ge.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u32) -> bool { 3 | x >= 2 4 | } 5 | 6 | const ARG: u32 = 2; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)) 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> bool { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/litbstring.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: usize) -> bool { 3 | let s = b"hello"; 4 | s.len() > x 5 | } 6 | 7 | const ARG: usize = 2; 8 | 9 | #[cfg(with_main)] 10 | pub fn main() { 11 | println!("{:?}", f(ARG)) 12 | } 13 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> bool { f(ARG) } 14 | -------------------------------------------------------------------------------- /test/conc_eval/prim/litstring.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: usize) -> bool { 3 | let s = "hello"; 4 | s.len() > x 5 | } 6 | 7 | const ARG: usize = 2; 8 | 9 | #[cfg(with_main)] 10 | pub fn main() { 11 | println!("{:?}", f(ARG)) 12 | } 13 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> bool { f(ARG) } 14 | -------------------------------------------------------------------------------- /test/conc_eval/prim/shift1.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u8) -> u8 { 3 | x << 1u8 4 | } 5 | 6 | const ARG: u8 = 1; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)); 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/shift2.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: u8) -> u8 { 3 | x << 1i32 4 | } 5 | 6 | const ARG: u8 = 1; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)); 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/shift3.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: i64) -> i64 { 3 | x << 63i64 4 | } 5 | 6 | const ARG: i64 = 1; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)); 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i64 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/prim/shift4.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn f(x: i64) -> i64 { 3 | x << 63u8 4 | } 5 | 6 | const ARG: i64 = 1; 7 | 8 | #[cfg(with_main)] 9 | pub fn main() { 10 | println!("{:?}", f(ARG)); 11 | } 12 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i64 { f(ARG) } 13 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/cast_eq.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() { 5 | let p1 = 1 as *const i32; 6 | let p1b = 1 as *const i32; 7 | let p2 = 2 as *const i32; 8 | assert!(p1 == p1b); 9 | assert!(p1 != p2); 10 | assert!(p2 == p2); 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/copy.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 6] { 5 | let a = [1, 2, 3]; 6 | let mut b = [0; 6]; 7 | unsafe { 8 | ptr::copy(&a[0], &mut b[0], 3); 9 | ptr::copy_nonoverlapping(&b[0], &mut b[3], 3); 10 | } 11 | b 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/dangling_eq.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() { 5 | let d = ptr::NonNull::::dangling().as_ptr(); 6 | assert!(d != ptr::null_mut()); 7 | assert!(d == d); 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/is_null.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> (bool, bool) { 5 | let p = &1 as *const i32; 6 | let q = 0 as *const i32; 7 | (p.is_null(), q.is_null()) 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/is_null_slice.rs: -------------------------------------------------------------------------------- 1 | // FAIL: can't unsize null pointers 2 | use std::ptr; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> (bool, bool) { 6 | let p = &[1, 2] as *const [i32; 2] as *const [i32]; 7 | let q = 0 as *const [i32; 2] as *const [i32]; 8 | (p.is_null(), q.is_null()) 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/null_eq.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x = 1; 6 | let px = &x as *const i32; 7 | assert!(px != ptr::null()); 8 | assert!(ptr::null::() == ptr::null()); 9 | assert!(ptr::null_mut::() as *const _ == ptr::null()); 10 | // Note we don't check `px == px`, since that currently returns false under crux-mir. 11 | unsafe { *px } 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/offset.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let arr = [1, 2, 3]; 6 | unsafe { 7 | let p = &arr[0] as *const i32; 8 | let p = p.offset(2); 9 | *p 10 | } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/offset_from.rs: -------------------------------------------------------------------------------- 1 | #![feature(ptr_offset_from)] 2 | use std::ptr; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> isize { 6 | let a = [1, 2, 3]; 7 | unsafe { (&a[0] as *const i32).offset_from(&a[2] as *const _) } 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/offset_mut.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let mut arr = [1, 2, 3]; 6 | unsafe { 7 | let p = &mut arr[0] as *mut i32; 8 | let p = p.offset(2); 9 | *p 10 | } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/read_write.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 3] { 5 | let mut a = [1, 2, 3]; 6 | unsafe { 7 | let p0 = &mut a[0] as *mut _; 8 | let p1 = &mut a[1] as *mut _; 9 | let p2 = &mut a[2] as *mut _; 10 | let x = ptr::read(p0); 11 | ptr::write(p1, x); 12 | ptr::swap(p1, p2); 13 | } 14 | a 15 | } 16 | 17 | pub fn main() { 18 | println!("{:?}", crux_test()); 19 | } 20 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/struct_eq.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | struct Foo { 4 | x: i32, 5 | y: i32, 6 | } 7 | 8 | #[cfg_attr(crux, crux_test)] 9 | fn crux_test() { 10 | let a = Foo { x: 1, y: 1 }; 11 | let b = Foo { x: 1, y: 1 }; 12 | assert!(&a.x as *const _ == &a.x as *const _); 13 | assert!(&a.x as *const _ != &a.y as *const _); 14 | assert!(&a.x as *const _ != &b.x as *const _); 15 | } 16 | 17 | pub fn main() { 18 | println!("{:?}", crux_test()); 19 | } 20 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/unsize_slice.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> (i32, i32) { 5 | let a = [1, 2]; 6 | let slice_ptr = &a as *const [i32]; 7 | let ptr = slice_ptr as *const i32; 8 | unsafe { (*ptr, *ptr.offset(1)) } 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/ptr/valid_eq.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() { 5 | let x = 1; 6 | let y = 2; 7 | assert!(&x as *const _ == &x as *const _); 8 | assert!(&x as *const _ != &y as *const _); 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/refs/fn_ptr.rs: -------------------------------------------------------------------------------- 1 | #![feature(never_type)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x: Result = Ok(1); 6 | match x { 7 | Ok(x) => x, 8 | Err(e) => { 9 | let r = &e; 10 | panic!(); 11 | }, 12 | } 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | -------------------------------------------------------------------------------- /test/conc_eval/refs/fn_ptr_mut.rs: -------------------------------------------------------------------------------- 1 | #![feature(never_type)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x: Result = Ok(1); 6 | match x { 7 | Ok(x) => x, 8 | Err(mut e) => { 9 | let r = &mut e; 10 | panic!(); 11 | }, 12 | } 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | -------------------------------------------------------------------------------- /test/conc_eval/refs/imm_arg.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn f(x: i32) -> i32 { 3 | let rf: &i32 = &x; 4 | *rf 5 | } 6 | 7 | pub static ARG: i32 = 1; 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 10 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 11 | -------------------------------------------------------------------------------- /test/conc_eval/refs/imm_raw.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | unsafe fn g(ptr: *const i32) -> i32 { 4 | *ptr 5 | } 6 | 7 | pub fn f(x: i32) -> i32 { 8 | let x = 123; 9 | unsafe { g(&x as *const i32) } 10 | } 11 | 12 | pub static ARG: i32 = 1; 13 | 14 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 15 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 16 | -------------------------------------------------------------------------------- /test/conc_eval/refs/imm_ref.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn f(x: i32) -> i32 { 3 | let x = 123; 4 | let rf: &i32 = &x; 5 | *rf 6 | } 7 | 8 | pub static ARG: i32 = 1; 9 | 10 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 11 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 12 | -------------------------------------------------------------------------------- /test/conc_eval/refs/mut_arg.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn f(mut x: i32) -> i32 { 3 | let rf: &mut i32 = &mut x; 4 | *rf 5 | } 6 | 7 | pub static ARG: i32 = 1; 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 10 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 11 | -------------------------------------------------------------------------------- /test/conc_eval/refs/mut_nested.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let mut a = 123_i32; 6 | let mut b = &mut a; 7 | let c = &mut b; 8 | assert!(**c == 123); 9 | } 10 | 11 | 12 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 13 | -------------------------------------------------------------------------------- /test/conc_eval/refs/mut_raw.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | unsafe fn g(ptr: *mut i32) -> i32 { 4 | *ptr 5 | } 6 | 7 | pub fn f(x: i32) -> i32 { 8 | let mut x = 123; 9 | unsafe { g(&mut x as *mut i32) } 10 | } 11 | 12 | pub static ARG: i32 = 1; 13 | 14 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 15 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 16 | -------------------------------------------------------------------------------- /test/conc_eval/refs/mut_ref.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | pub fn f(x: i32) -> i32 { 3 | let mut x = x; 4 | let rf: &mut i32 = &mut x; 5 | *rf 6 | } 7 | 8 | pub static ARG: i32 = 1; 9 | 10 | #[cfg(with_main)] pub fn main() { println!("{:?}", f(ARG)); } 11 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> i32 { f(ARG) } 12 | -------------------------------------------------------------------------------- /test/conc_eval/refs/mut_tuple_field.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let mut xy = (1, 2); 6 | let x = &mut xy.0; 7 | let y = &mut xy.1; 8 | *x = 3; 9 | *y = 4; 10 | assert!(xy == (3, 4)); 11 | } 12 | 13 | 14 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 15 | -------------------------------------------------------------------------------- /test/conc_eval/refs/never.rs: -------------------------------------------------------------------------------- 1 | #![feature(never_type)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x: Result = Ok(1); 6 | match x { 7 | Ok(x) => x, 8 | Err(e) => { 9 | let r = &e; 10 | panic!(); 11 | }, 12 | } 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | -------------------------------------------------------------------------------- /test/conc_eval/refs/never_mut.rs: -------------------------------------------------------------------------------- 1 | #![feature(never_type)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let x: Result = Ok(1); 6 | match x { 7 | Ok(x) => x, 8 | Err(mut e) => { 9 | let r = &mut e; 10 | panic!(); 11 | }, 12 | } 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | -------------------------------------------------------------------------------- /test/conc_eval/refs/promoted_imm.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> usize { 4 | let dest: &[u8] = &[]; 5 | dest.len() 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/refs/promoted_mut.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> usize { 4 | let dest: &mut [u8] = &mut []; 5 | dest.len() 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/refs/static_mut.rs: -------------------------------------------------------------------------------- 1 | 2 | static mut X: usize = 1; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> usize { 6 | let mut x = unsafe { &mut X }; 7 | *x += 1; 8 | *x 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/refs/temp.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> i32 { 4 | let r = &&1; 5 | let r2 = *r; 6 | *r2 7 | } 8 | 9 | pub fn main() { 10 | println!("{:?}", crux_test()); 11 | } 12 | -------------------------------------------------------------------------------- /test/conc_eval/slice/eq.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let arr = [1, 2, 3]; 6 | let xs = &arr as &[_]; 7 | let ys = &arr as &[_]; 8 | assert!(xs == ys); 9 | } 10 | 11 | 12 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 13 | -------------------------------------------------------------------------------- /test/conc_eval/slice/iter_mut.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | pub fn f() { 5 | let mut arr = [1, 2, 3]; 6 | let arr: &mut [_] = &mut arr; 7 | let mut sum = 0; 8 | for x in &mut *arr { 9 | *x += 1; 10 | sum += *x; 11 | } 12 | assert!(sum == 9); 13 | assert!(arr == [2, 3, 4]); 14 | } 15 | 16 | 17 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 18 | -------------------------------------------------------------------------------- /test/conc_eval/slice/last.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> i32 { 3 | let arr = [1, 2, 3]; 4 | // `.last` uses `from_end: true` indexing mode. 5 | *arr.last().unwrap() 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/slice/len.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn g(slice:&mut [u16]) -> usize { 3 | slice.len() 4 | } 5 | 6 | fn f(x:u16) -> usize { 7 | let mut buf = [x;5]; 8 | g(&mut buf) 9 | } 10 | 11 | 12 | const ARG: u16 = 1; 13 | 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> usize { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/slice/mk_and_proj.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn g(xs: &[u8]) -> u8 { 3 | xs[0] 4 | } 5 | 6 | fn f(x: u8) -> u8 { 7 | let xs = [x; 4]; 8 | g(&xs) 9 | } 10 | 11 | const ARG: u8 = 42; 12 | 13 | #[cfg(with_main)] 14 | pub fn main() { 15 | println!("{:?}", f(ARG)); 16 | } 17 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 18 | -------------------------------------------------------------------------------- /test/conc_eval/slice/mut.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn g(xs: &mut [u8], v: u8) -> () { 3 | xs[0] = v; 4 | } 5 | 6 | fn f(x: u8) -> u8 { 7 | let mut xs = [0; 4]; 8 | g(&mut xs, x); 9 | xs[0] 10 | } 11 | 12 | const ARG: u8 = 42; 13 | 14 | #[cfg(with_main)] 15 | pub fn main() { 16 | println!("{:?}", f(ARG)); 17 | } 18 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 19 | -------------------------------------------------------------------------------- /test/conc_eval/slice/mut_range.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn g(xs: &mut [u8]) { 3 | xs[0] = xs[0] + 1; 4 | xs[1] = xs[1] + 1; 5 | } 6 | 7 | fn f(x: u8) -> u8 { 8 | let mut xs = [x; 4]; 9 | let y = g(&mut xs[1..]); 10 | xs[1] + xs[2] 11 | } 12 | 13 | const ARG: u8 = 42; 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/statics/promoted_fn.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> i32 { 4 | let r = &&1; 5 | **r 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/statics/promoted_static.rs: -------------------------------------------------------------------------------- 1 | 2 | static X: &&i32 = &&1; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | **X 7 | } 8 | 9 | pub fn main() { 10 | println!("{:?}", crux_test()); 11 | } 12 | -------------------------------------------------------------------------------- /test/conc_eval/stdlib/poly.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | fn h(x :T) -> T { x } 3 | 4 | fn g(x :T) -> T { h (x) } 5 | 6 | fn f (x : u32) -> u32 { 7 | 1 + g (x) 8 | } 9 | 10 | const ARG :u32 = 0; 11 | 12 | #[cfg(with_main)] 13 | pub fn main() { 14 | println!("{:?}", f(ARG)); 15 | } 16 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 17 | -------------------------------------------------------------------------------- /test/conc_eval/str/format.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let s = format!("a{}c", 'β'); 5 | &s == "aβc" 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/str/format_array.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let s = format!("{:?}", [1,2,3,4]); 5 | &s == "[1, 2, 3, 4]" 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/str/format_hex.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let s = format!("a{:x}c", 123); 5 | &s == "a7bc" 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/str/format_int.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let s = format!("a{}c", 123); 5 | &s == "a123c" 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/str/format_struct.rs: -------------------------------------------------------------------------------- 1 | 2 | #[derive(Debug)] 3 | struct MyStruct { 4 | x: u8, 5 | y: u8, 6 | } 7 | 8 | #[cfg_attr(crux, crux_test)] 9 | fn crux_test() -> bool { 10 | let s = format!("{:?}", MyStruct { x: 1, y: 2 }); 11 | &s == "MyStruct { x: 1, y: 2 }" 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/str/string_push.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let mut s = String::new(); 5 | s.push('a'); 6 | s.push('β'); 7 | s.push('c'); 8 | &s == "aβc" 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/str/to_owned.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> bool { 4 | let s = "aβc".to_owned(); 5 | &s == "aβc" 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/struct/arg.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | #[cfg_attr(with_main, derive(Debug))] 3 | struct S { 4 | x: u8, 5 | y: i32, 6 | } 7 | 8 | fn f(s: S) -> u8 { 9 | s.x 10 | } 11 | 12 | const ARG: S = S { x: 42, y: 120 }; 13 | 14 | #[cfg(with_main)] 15 | pub fn main() { 16 | println!("{:?}", f(ARG)); 17 | } 18 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 19 | -------------------------------------------------------------------------------- /test/conc_eval/struct/field_order.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | pub struct S { 4 | x: u8, 5 | y: u16, 6 | } 7 | 8 | #[cfg_attr(crux, crux_test)] 9 | pub fn f() { 10 | // If the field ordering used in `buildStruct` is wrong, then this will fail due to type 11 | // mismatches between BVRepr 8 and BVRepr 16. 12 | let s = S { x: 1, y: 2 }; 13 | assert!(s.x == 1); 14 | assert!(s.y == 2); 15 | } 16 | 17 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 18 | -------------------------------------------------------------------------------- /test/conc_eval/struct/proj.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | #[cfg_attr(with_main, derive(Debug))] 3 | struct S { 4 | x: u8, 5 | y: i32, 6 | } 7 | 8 | fn f(_: ()) -> u8 { 9 | let s = S { x: 42, y: 120 }; 10 | s.x 11 | } 12 | 13 | const ARG: () = (); 14 | 15 | #[cfg(with_main)] 16 | pub fn main() { 17 | println!("{:?}", f(ARG)); 18 | } 19 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u8 { f(ARG) } 20 | -------------------------------------------------------------------------------- /test/conc_eval/struct/ret.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | #[cfg_attr(with_main, derive(Debug))] 3 | struct S { 4 | x: u8, 5 | y: i32, 6 | } 7 | 8 | fn f(_: ()) -> S { 9 | S { x: 42, y: 120 } 10 | } 11 | 12 | const ARG: () = (); 13 | 14 | #[cfg(with_main)] 15 | pub fn main() { 16 | println!("{:?}", f(ARG)); 17 | } 18 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> S { f(ARG) } 19 | -------------------------------------------------------------------------------- /test/conc_eval/struct/tup.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | fn g () -> char { 4 | 'a' 5 | } 6 | 7 | fn h () -> () { 8 | () 9 | } 10 | 11 | fn f (x : i32) -> () { 12 | h (); 13 | } 14 | 15 | const ARG : i32 = 0; 16 | 17 | #[cfg(with_main)] 18 | pub fn main() { 19 | println!("{:?}", f(ARG)); 20 | } 21 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> () { f(ARG) } 22 | -------------------------------------------------------------------------------- /test/conc_eval/sync/arc.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let a = Arc::new(1); 6 | *a 7 | } 8 | 9 | pub fn main() { 10 | println!("{:?}", crux_test()); 11 | } 12 | -------------------------------------------------------------------------------- /test/conc_eval/sync/arc_cell.rs: -------------------------------------------------------------------------------- 1 | use std::cell::Cell; 2 | use std::sync::Arc; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let a = Arc::new(Cell::new(1)); 7 | let b = a.clone(); 8 | a.set(2); 9 | a.get() + b.get() 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/sync/arc_clone.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let a = Arc::new(1); 6 | let b = a.clone(); 7 | *a + *b 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/sync/atomic_add.rs: -------------------------------------------------------------------------------- 1 | use std::sync::atomic::AtomicI32; 2 | use std::sync::atomic::Ordering::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let a = AtomicI32::new(1); 7 | let mut i = 1; 8 | for &ordering in &[Relaxed, Release, Acquire, AcqRel, SeqCst] { 9 | let old = a.fetch_add(1, ordering); 10 | assert!(old == i); 11 | i += 1; 12 | } 13 | a.load(SeqCst) 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | -------------------------------------------------------------------------------- /test/conc_eval/sync/atomic_fence.rs: -------------------------------------------------------------------------------- 1 | use std::sync::atomic::{self, AtomicI32}; 2 | use std::sync::atomic::Ordering::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let a = AtomicI32::new(1); 7 | a.store(2, SeqCst); 8 | atomic::fence(SeqCst); 9 | a.load(SeqCst) 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/sync/atomic_swap.rs: -------------------------------------------------------------------------------- 1 | use std::sync::atomic::AtomicI32; 2 | use std::sync::atomic::Ordering::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> (i32, i32) { 6 | let a = AtomicI32::new(1); 7 | a.store(2, SeqCst); 8 | let x = a.swap(1, SeqCst); 9 | let y = a.load(SeqCst); 10 | (x, y) 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/conc_eval/sync/mutex.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Mutex; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let m = Mutex::new(1); 6 | let x = *m.lock().unwrap(); 7 | x 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/sync/mutex_multi.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Mutex; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let m = Mutex::new(1); 6 | { 7 | let mut g = m.lock().unwrap(); 8 | assert!(m.try_lock().is_err()); 9 | *g += 1; 10 | } 11 | { 12 | let mut g = m.lock().unwrap(); 13 | *g += 1; 14 | } 15 | let x = *m.lock().unwrap(); 16 | x 17 | } 18 | 19 | pub fn main() { 20 | println!("{:?}", crux_test()); 21 | } 22 | -------------------------------------------------------------------------------- /test/conc_eval/sync/rwlock.rs: -------------------------------------------------------------------------------- 1 | use std::sync::RwLock; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> i32 { 5 | let m = RwLock::new(1); 6 | *m.write().unwrap() = 2; 7 | let x = *m.read().unwrap(); 8 | x 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/time/instant.rs: -------------------------------------------------------------------------------- 1 | //! Check that `Instant` can be used without triggering a panic or FFI call. 2 | use std::time::Instant; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() { 6 | let start = Instant::now(); 7 | let dur = start.elapsed(); 8 | let dur2 = Instant::now().duration_since(start); 9 | // There's nothing sensible to return here - any output based on `Instant` will fail to match 10 | // the oracle output. 11 | } 12 | 13 | pub fn main() { println!("{:?}", crux_test()); } 14 | -------------------------------------------------------------------------------- /test/conc_eval/traits/static_self.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | struct S(u32); 3 | 4 | trait T { 5 | fn g(&self) -> u32; 6 | } 7 | 8 | impl T for S { 9 | fn g(&self) -> u32 { self.0 } 10 | } 11 | 12 | fn f(s: S) -> u32 { 13 | s.g() 14 | } 15 | 16 | const ARG: S = S(42); 17 | 18 | #[cfg(with_main)] 19 | pub fn main() { 20 | println!("{:?}", f(ARG)); 21 | } 22 | #[cfg(not(with_main))] #[cfg_attr(crux, crux_test)] fn crux_test() -> u32 { f(ARG) } 23 | -------------------------------------------------------------------------------- /test/conc_eval/tuple/clone.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | pub fn f() { 4 | let x = (1, 2); 5 | let y = x.clone(); 6 | assert!(x == y); 7 | } 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 10 | -------------------------------------------------------------------------------- /test/conc_eval/tuple/clone_from.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | pub fn f() { 3 | let x = (1, 2); 4 | let mut y = (0, 0); 5 | y.clone_from(&x); 6 | assert!(x == y); 7 | } 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 10 | -------------------------------------------------------------------------------- /test/conc_eval/tuple/clone_rec.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | pub fn f() { 4 | let x = (1, (2, (3, 4))); 5 | let y = x.clone(); 6 | assert!(x == y); 7 | } 8 | 9 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 10 | -------------------------------------------------------------------------------- /test/conc_eval/tuple/clone_struct.rs: -------------------------------------------------------------------------------- 1 | 2 | #[derive(Clone, PartialEq, Eq)] 3 | struct S; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let x = (S, S); 8 | let y = x.clone(); 9 | assert!(x == y); 10 | } 11 | 12 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 13 | -------------------------------------------------------------------------------- /test/conc_eval/vec/collect.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> i32 { 3 | let xs = (0..10).collect::>(); 4 | let mut sum = 0; 5 | for x in xs { 6 | sum += x; 7 | } 8 | sum 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/vec/drop.rs: -------------------------------------------------------------------------------- 1 | /// Drop a `Vec` where `T: Drop`. This triggers a call to `drop_in_place::<[T]>`, which uses a 2 | /// few operations that aren't seen in other drop glues. 3 | 4 | struct S(i32); 5 | 6 | impl Drop for S { 7 | fn drop(&mut self) { 8 | // No-op 9 | } 10 | } 11 | 12 | #[cfg_attr(crux, crux_test)] 13 | fn crux_test() { 14 | let v = vec![S(1), S(2), S(3)]; 15 | drop(v); 16 | } 17 | 18 | pub fn main() { 19 | println!("{:?}", crux_test()); 20 | } 21 | -------------------------------------------------------------------------------- /test/conc_eval/vec/extend.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> (i32, i32) { 5 | let mut v = Vec::new(); 6 | v.push(1); 7 | v.push(2); 8 | // `filter` iterators don't implement `TrustedLen`. `TrustedLen` iterators take a different 9 | // code path, which is tested in `extend_trusted_len.rs`. 10 | v.extend([10, 11].iter().cloned().filter(|_| true)); 11 | (v[0], v[2]) 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/vec/extend_trusted_len.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> (i32, i32) { 5 | let mut v = Vec::new(); 6 | v.push(1); 7 | v.push(2); 8 | v.extend([10, 11].iter().cloned()); 9 | (v[0], v[2]) 10 | } 11 | 12 | pub fn main() { 13 | println!("{:?}", crux_test()); 14 | } 15 | -------------------------------------------------------------------------------- /test/conc_eval/vec/from_elem_zero.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> i32 { 3 | // `vec::from_elem` (which backs the `vec![x; N]` macro syntax) special-cases `x == 0` to use 4 | // `alloc_zeroed`. It expects the allocator to initialize the vector to all zeros, and doesn't 5 | // initialize anything itself. 6 | let x: Vec = vec![0; 10]; 7 | x[9] 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/vec/push.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> (i32, i32) { 3 | let mut v = Vec::new(); 4 | v.push(1); 5 | v.push(2); 6 | (v[0], v[1]) 7 | } 8 | 9 | pub fn main() { 10 | println!("{:?}", crux_test()); 11 | } 12 | -------------------------------------------------------------------------------- /test/conc_eval/vec/set_len.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | fn crux_test() -> usize { 3 | let mut v = vec![1, 2, 3]; 4 | unsafe { v.set_len(2); } 5 | (&v as &[i32]).len() 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/conc_eval/vec_deque/pop.rs: -------------------------------------------------------------------------------- 1 | use std::collections::VecDeque; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 5] { 5 | let mut v: VecDeque<_> = vec![1, 2, 3, 4, 5].into(); 6 | [ 7 | v.pop_back().unwrap(), 8 | v.pop_back().unwrap(), 9 | v.pop_back().unwrap(), 10 | v.pop_front().unwrap(), 11 | v.pop_back().unwrap(), 12 | ] 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | -------------------------------------------------------------------------------- /test/conc_eval/vec_deque/push.rs: -------------------------------------------------------------------------------- 1 | use std::collections::VecDeque; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 5] { 5 | let mut v = VecDeque::new(); 6 | v.push_back(1); 7 | v.push_back(2); 8 | v.push_back(3); 9 | v.push_front(4); 10 | v.push_back(5); 11 | [v[0], v[1], v[2], v[3], v[4]] 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | -------------------------------------------------------------------------------- /test/conc_eval/vec_deque/retain.rs: -------------------------------------------------------------------------------- 1 | use std::collections::VecDeque; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 2] { 5 | let mut v: VecDeque<_> = vec![1, 2, 3, 4, 5].into(); 6 | v.retain(|&x| x % 3 == 1); 7 | assert!(v.len() == 2); 8 | [v[0], v[1]] 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/conc_eval/vec_deque/rotate_left.rs: -------------------------------------------------------------------------------- 1 | use std::collections::VecDeque; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 5] { 5 | let mut v: VecDeque<_> = vec![1, 2, 3, 4, 5].into(); 6 | v.rotate_left(2); 7 | [v[0], v[1], v[2], v[3], v[4]] 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/conc_eval/vec_deque/rotate_right.rs: -------------------------------------------------------------------------------- 1 | use std::collections::VecDeque; 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> [i32; 5] { 5 | let mut v: VecDeque<_> = vec![1, 2, 3, 4, 5].into(); 6 | v.rotate_right(2); 7 | [v[0], v[1], v[2], v[3], v[4]] 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/out_of_bounds.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | use crucible::alloc::allocate; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() -> i32 { 7 | unsafe { 8 | let ptr = allocate::(10); 9 | for i in 0..10 { 10 | *ptr.offset(i) = i as i32; 11 | } 12 | *ptr.offset(12) 13 | } 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/uninit_read.good: -------------------------------------------------------------------------------- 1 | test uninit_read/3a1fbbbh::crux_test[0]: FAILED 2 | 3 | failures: 4 | 5 | ---- uninit_read/3a1fbbbh::crux_test[0] counterexamples ---- 6 | Failure for Attempted to read uninitialized vector index 7 | in uninit_read/3a1fbbbh::crux_test[0] at test/symb_eval/alloc/uninit_read.rs:9:9 8 | 9 | [Crux] Goal status: 10 | [Crux] Total: 1 11 | [Crux] Proved: 0 12 | [Crux] Disproved: 1 13 | [Crux] Incomplete: 0 14 | [Crux] Unknown: 0 15 | [Crux] Overall status: Invalid. 16 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/uninit_read.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | use crucible::alloc::allocate; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() -> i32 { 7 | unsafe { 8 | let ptr = allocate::(10); 9 | *ptr.offset(3) 10 | } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/valid_read.good: -------------------------------------------------------------------------------- 1 | test valid_read/3a1fbbbh::crux_test[0]: returned 45, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/zero_length.good: -------------------------------------------------------------------------------- 1 | test zero_length/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/alloc/zero_length.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | use crucible::alloc::allocate; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() { 7 | unsafe { 8 | // Make sure the CustomOp succeeds in creating a pointer to the first element of an empty 9 | // allocation. 10 | let ptr = allocate::(0); 11 | } 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/symb_eval/any/downcast.good: -------------------------------------------------------------------------------- 1 | test downcast/3a1fbbbh::crux_test[0]: returned 1, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/any/downcast.rs: -------------------------------------------------------------------------------- 1 | #![feature(crucible_intrinsics)] 2 | 3 | extern crate crucible; 4 | use crucible::any::Any; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> i32 { 8 | let x: i32 = 1; 9 | let a = Any::new(x); 10 | unsafe { a.downcast::() } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/symb_eval/any/downcast_fail.good: -------------------------------------------------------------------------------- 1 | test downcast_fail/3a1fbbbh::crux_test[0]: FAILED 2 | 3 | failures: 4 | 5 | ---- downcast_fail/3a1fbbbh::crux_test[0] counterexamples ---- 6 | Failure for failed to downcast Any as BVRepr 32 7 | in downcast_fail/3a1fbbbh::crux_test[0] at test/symb_eval/any/downcast_fail.rs:10:14 8 | 9 | [Crux] Goal status: 10 | [Crux] Total: 1 11 | [Crux] Proved: 0 12 | [Crux] Disproved: 1 13 | [Crux] Incomplete: 0 14 | [Crux] Unknown: 0 15 | [Crux] Overall status: Invalid. 16 | -------------------------------------------------------------------------------- /test/symb_eval/any/downcast_fail.rs: -------------------------------------------------------------------------------- 1 | #![feature(crucible_intrinsics)] 2 | 3 | extern crate crucible; 4 | use crucible::any::Any; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | fn crux_test() -> i32 { 8 | let x: () = (); 9 | let a = Any::new(x); 10 | unsafe { a.downcast::() } 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/symb_eval/array/basic.good: -------------------------------------------------------------------------------- 1 | test basic/3a1fbbbh::crux_test[0]: returned 3, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/array/basic.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::array::Array; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let arr = Array::::zeroed(); 7 | let arr = arr.update(0, 0); 8 | let arr = arr.update(1, 1); 9 | let arr = arr.update(2, 2); 10 | arr.lookup(0) + arr.lookup(1) + arr.lookup(2) + arr.lookup(99) 11 | } 12 | 13 | pub fn main() { 14 | println!("{:?}", crux_test()); 15 | } 16 | -------------------------------------------------------------------------------- /test/symb_eval/array/mux_slice.good: -------------------------------------------------------------------------------- 1 | test mux_slice/3a1fbbbh::crux_test[0]: returned Symbolic BV, ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 1 5 | [Crux] Proved: 1 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/array/slice.good: -------------------------------------------------------------------------------- 1 | test slice/3a1fbbbh::crux_test[0]: returned 5, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/array/slice_mut.good: -------------------------------------------------------------------------------- 1 | test slice_mut/3a1fbbbh::crux_test[0]: returned 5, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/arith.good: -------------------------------------------------------------------------------- 1 | test arith/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 11 5 | [Crux] Proved: 11 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/cmp.good: -------------------------------------------------------------------------------- 1 | test cmp/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 2 5 | [Crux] Proved: 2 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/from_to.good: -------------------------------------------------------------------------------- 1 | test from_to/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/from_to.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::bitvector::Bv256; 3 | use crucible::crucible_assert; 4 | 5 | fn test_one(i: u64) { 6 | let bv = Bv256::from(i); 7 | let j: u64 = bv.into(); 8 | crucible_assert!(i == j); 9 | } 10 | 11 | #[cfg_attr(crux, crux_test)] 12 | fn crux_test() { 13 | test_one(0); 14 | test_one(1); 15 | test_one(12345); 16 | } 17 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/leading_zeros.good: -------------------------------------------------------------------------------- 1 | test leading_zeros/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 2 5 | [Crux] Proved: 2 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/literals.good: -------------------------------------------------------------------------------- 1 | test literals/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/literals.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::bitvector::Bv256; 3 | use crucible::crucible_assert; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() { 7 | crucible_assert!(u64::from(Bv256::ZERO) == 0); 8 | crucible_assert!(u64::from(Bv256::ONE) == 1); 9 | } 10 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/overflowing_sub.good: -------------------------------------------------------------------------------- 1 | test overflowing_sub/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 2 5 | [Crux] Proved: 2 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/bitvector/symbolic.good: -------------------------------------------------------------------------------- 1 | test symbolic/3a1fbbbh::crux_test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 1 5 | [Crux] Proved: 1 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/byteorder/read.good: -------------------------------------------------------------------------------- 1 | test read/3a1fbbbh::crux_test[0]: returned 0, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/byteorder/write.good: -------------------------------------------------------------------------------- 1 | test write/3a1fbbbh::crux_test[0]: returned 0, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/extend_bytes.good: -------------------------------------------------------------------------------- 1 | test extend_bytes/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/extend_bytes.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | extern crate bytes; 4 | use bytes::{Bytes, BytesMut, Buf, BufMut}; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut bm = BytesMut::with_capacity(10); 9 | let b = Bytes::from(b"12345" as &[_]); 10 | bm.extend(&b); 11 | } 12 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/new.good: -------------------------------------------------------------------------------- 1 | test new/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/new.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | extern crate bytes; 4 | use bytes::{Bytes, BytesMut, Buf, BufMut}; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut b = BytesMut::new(); 9 | assert!(b.len() == 0); 10 | assert!(b.is_empty()); 11 | assert!(b.freeze().len() == 0); 12 | } 13 | 14 | 15 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 16 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/put.good: -------------------------------------------------------------------------------- 1 | test put/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/put.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | extern crate bytes; 4 | use bytes::{Bytes, BytesMut, Buf, BufMut}; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut b = BytesMut::with_capacity(10); 9 | b.put_u8(1); 10 | b.put_u16_be(0x0203); 11 | assert!(b.len() == 3); 12 | assert!(b[0] == 1); 13 | assert!(b[1] == 2); 14 | assert!(b[2] == 3); 15 | } 16 | 17 | 18 | #[cfg(with_main)] pub fn main() { println!("{:?}", f()); } 19 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/put_overflow.good: -------------------------------------------------------------------------------- 1 | test put_overflow/3a1fbbbh::f[0]: FAILED 2 | 3 | failures: 4 | 5 | ---- put_overflow/3a1fbbbh::f[0] counterexamples ---- 6 | Failure for panicking::begin_panic, called from bytes/3a1fbbbh::{{impl}}[4]::put_slice[0] 7 | in bytes/3a1fbbbh::{{impl}}[4]::put_slice[0] at internal 8 | 9 | [Crux] Goal status: 10 | [Crux] Total: 1 11 | [Crux] Proved: 0 12 | [Crux] Disproved: 1 13 | [Crux] Incomplete: 0 14 | [Crux] Unknown: 0 15 | [Crux] Overall status: Invalid. 16 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/put_overflow.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(with_main), no_std)] 2 | 3 | extern crate bytes; 4 | use bytes::{Bytes, BytesMut, Buf, BufMut}; 5 | 6 | #[cfg_attr(crux, crux_test)] 7 | pub fn f() { 8 | let mut b = BytesMut::with_capacity(0); 9 | b.put_slice(b"1234567-1234567-1234567-1234567-1234567-1234567-"); 10 | } 11 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/split_off.good: -------------------------------------------------------------------------------- 1 | test split_off/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/split_to.good: -------------------------------------------------------------------------------- 1 | test split_to/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/bytes/sym_len.good: -------------------------------------------------------------------------------- 1 | test sym_len/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 40 5 | [Crux] Proved: 40 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/concretize/array.good: -------------------------------------------------------------------------------- 1 | test array/3a1fbbbh::crux_test[0]: returned (1, 2, 3), ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 2 5 | [Crux] Proved: 2 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/concretize/assert_ok.good: -------------------------------------------------------------------------------- 1 | test assert_ok/3a1fbbbh::crux_test[0]: returned 1, ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 4 5 | [Crux] Proved: 4 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/concretize/assert_ok.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> u8 { 6 | let mut x = u8::symbolic("x"); 7 | let mut y = u8::symbolic("y"); 8 | crucible_assume!(x < 100 && y < 100); 9 | crucible_assume!(x + y == 1); 10 | crucible_assert!(x == 0 || x == 1, "{} + {} == {}", x, y, x + y); 11 | concretize(x + y) 12 | } 13 | 14 | pub fn main() { 15 | println!("{:?}", crux_test()); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/symb_eval/concretize/conc.good: -------------------------------------------------------------------------------- 1 | test conc/3a1fbbbh::crux_test[0]: returned (1, 0), ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 1 5 | [Crux] Proved: 1 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/concretize/no_conc.good: -------------------------------------------------------------------------------- 1 | test no_conc/3a1fbbbh::crux_test[0]: returned (Symbolic BV, Symbolic BV), ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 3 5 | [Crux] Proved: 3 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/crux/fail_return.rs: -------------------------------------------------------------------------------- 1 | 2 | extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn fail1() -> u8 { 7 | let x = u8::symbolic("x"); 8 | crucible_assert!(x + 1 > x); 9 | x 10 | } 11 | 12 | #[cfg_attr(crux, crux_test)] 13 | fn fail2() -> u8 { 14 | let x = u8::symbolic("x"); 15 | crucible_assert!(x + 1 > x); 16 | 123 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/symb_eval/crypto/bytes2.good: -------------------------------------------------------------------------------- 1 | test bytes2/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 11 5 | [Crux] Proved: 11 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/crypto/double.good: -------------------------------------------------------------------------------- 1 | test double/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 1 5 | [Crux] Proved: 1 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/crypto/double.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | extern crate crucible; 3 | use crucible::*; 4 | 5 | // ---------------------------------------------------------------------- 6 | 7 | 8 | fn double_ref(x : u32) -> u32 { 9 | return x * 2; 10 | } 11 | 12 | fn double_imp(x : u32) -> u32 { 13 | return x << 1; 14 | } 15 | 16 | 17 | #[cfg_attr(crux, crux_test)] 18 | pub fn f () { 19 | let a0 = crucible_u32("a0"); 20 | crucible_assert!(double_ref(a0) == double_imp(a0)); 21 | } 22 | -------------------------------------------------------------------------------- /test/symb_eval/crypto/ffs.good: -------------------------------------------------------------------------------- 1 | test ffs/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 5 5 | [Crux] Proved: 5 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/enum/mux.good: -------------------------------------------------------------------------------- 1 | test mux/3a1fbbbh::test[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 3 5 | [Crux] Proved: 3 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/enum/mux.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | 3 | struct S { 4 | val: u8, 5 | } 6 | 7 | fn f(x: bool) -> Option { 8 | if x { Some(S { val: 1 }) } else { None } 9 | } 10 | 11 | #[cfg_attr(crux, crux_test)] 12 | fn test() { 13 | let x = crucible::crucible_u8("x") != 0; 14 | let y = f(x); 15 | if x { y.unwrap(); } 16 | } 17 | -------------------------------------------------------------------------------- /test/symb_eval/fnptr/mux.good: -------------------------------------------------------------------------------- 1 | test mux/3a1fbbbh::crux_test[0]: returned 2, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/io/vec_cursor_read.good: -------------------------------------------------------------------------------- 1 | test vec_cursor_read/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/io/vec_cursor_read.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | extern crate std; 4 | use std::io::{Read, Write, Cursor}; 5 | use std::vec::Vec; 6 | 7 | #[cfg_attr(crux, crux_test)] 8 | pub fn f() { 9 | let mut buf = Vec::new(); 10 | buf.write(&[1, 2, 3]); 11 | 12 | let mut curs = Cursor::new(buf); 13 | let mut rbuf = [0; 2]; 14 | curs.read(&mut rbuf).unwrap(); 15 | crucible_assert!(rbuf[0] == 1); 16 | crucible_assert!(rbuf[1] == 2); 17 | } 18 | -------------------------------------------------------------------------------- /test/symb_eval/io/vec_write.good: -------------------------------------------------------------------------------- 1 | test vec_write/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/io/vec_write.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | extern crate std; 4 | use std::io::Write; 5 | use std::vec::Vec; 6 | 7 | #[cfg_attr(crux, crux_test)] 8 | pub fn f() { 9 | let mut buf = Vec::new(); 10 | buf.write(&[1, 2, 3]); 11 | 12 | crucible_assert!(buf.len() == 3); 13 | crucible_assert!(buf[0] == 1); 14 | crucible_assert!(buf[1] == 2); 15 | crucible_assert!(buf[2] == 3); 16 | } 17 | -------------------------------------------------------------------------------- /test/symb_eval/mux/array.good: -------------------------------------------------------------------------------- 1 | test array/3a1fbbbh::crux_test[0]: returned Symbolic BV, ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 9 5 | [Crux] Proved: 9 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/mux/array.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::array::Array; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | fn crux_test() -> i32 { 7 | let arr1 = [1]; 8 | let arr2 = [2, 2]; 9 | 10 | let c = bool::symbolic("c"); 11 | let s = if c { &arr2 as &[_] } else { &arr1 as &[_] }; 12 | let i = if c { 1 } else { 0 }; 13 | crucible_assert!(s[i] == 1 || s[i] == 2); 14 | s[i] 15 | } 16 | 17 | pub fn main() { 18 | println!("{:?}", crux_test()); 19 | } 20 | -------------------------------------------------------------------------------- /test/symb_eval/mux/array_mut.good: -------------------------------------------------------------------------------- 1 | test array_mut/3a1fbbbh::crux_test[0]: returned Symbolic BV, ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 3 5 | [Crux] Proved: 3 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/num/checked_add.good: -------------------------------------------------------------------------------- 1 | test checked_add/3a1fbbbh::crux_test[0]: FAILED 2 | 3 | failures: 4 | 5 | ---- checked_add/3a1fbbbh::crux_test[0] counterexamples ---- 6 | Failure for attempt to add with overflow 7 | in checked_add/3a1fbbbh::crux_test[0] at test/symb_eval/num/checked_add.rs:5:5 8 | 9 | [Crux] Goal status: 10 | [Crux] Total: 1 11 | [Crux] Proved: 0 12 | [Crux] Disproved: 1 13 | [Crux] Incomplete: 0 14 | [Crux] Unknown: 0 15 | [Crux] Overall status: Invalid. 16 | -------------------------------------------------------------------------------- /test/symb_eval/num/checked_add.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | fn crux_test() -> u8 { 4 | let x = 200; 5 | 100 + x 6 | } 7 | 8 | pub fn main() { 9 | println!("{:?}", crux_test()); 10 | } 11 | -------------------------------------------------------------------------------- /test/symb_eval/num/checked_mul.good: -------------------------------------------------------------------------------- 1 | test checked_mul/3a1fbbbh::crux_test[0]: returned 44, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/num/checked_mul.rs: -------------------------------------------------------------------------------- 1 | // FIXME: currently passes, but should fail 2 | 3 | #[cfg_attr(crux, crux_test)] 4 | fn crux_test() -> u8 { 5 | let x = 3; 6 | 100 * x 7 | } 8 | 9 | pub fn main() { 10 | println!("{:?}", crux_test()); 11 | } 12 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/bad_symb1.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> u8 { 6 | let s = if bool::symbolic("cond") { "a" } else { "b" }; 7 | let x = u8::symbolic(s); 8 | x 9 | } 10 | 11 | pub fn main() { 12 | println!("{:?}", crux_test()); 13 | } 14 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/bad_symb2.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> u8 { 6 | let x = u8::symbolic("\0:., /"); 7 | x 8 | } 9 | 10 | pub fn main() { 11 | println!("{:?}", crux_test()); 12 | } 13 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override1.good: -------------------------------------------------------------------------------- 1 | test override1/3a1fbbbh::f[0]: Hello, I'm an override 2 | returned 2, ok 3 | 4 | [Crux] All goals discharged through internal simplification. 5 | [Crux] Overall status: Valid. 6 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override1.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() -> u8 { 7 | let x: u8 = 1; 8 | // This call should be replaced by the test override 9 | x + one() 10 | } 11 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override2.good: -------------------------------------------------------------------------------- 1 | test override2/3a1fbbbh::f[0]: FAILED 2 | 3 | failures: 4 | 5 | ---- override2/3a1fbbbh::f[0] counterexamples ---- 6 | Failure for MIR assertion at test/symb_eval/overrides/override2.rs:9:5: 7 | foo.wrapping_add(1) == foo 8 | in override2/3a1fbbbh::f[0] at ./lib/crucible/lib.rs:34:41 9 | 10 | [Crux] Goal status: 11 | [Crux] Total: 1 12 | [Crux] Proved: 0 13 | [Crux] Disproved: 1 14 | [Crux] Incomplete: 0 15 | [Crux] Unknown: 0 16 | [Crux] Overall status: Invalid. 17 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override2.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | // This call should be replaced by the test override 8 | let foo = crucible_i8("foo"); 9 | crucible_assert!(foo.wrapping_add(1) == foo); 10 | } 11 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override3.good: -------------------------------------------------------------------------------- 1 | test override3/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 1 5 | [Crux] Proved: 1 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override3.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | // This call should be replaced by the test override 8 | let foo = crucible_i8("x"); 9 | crucible_assert!(foo.wrapping_add(1) != foo); 10 | } 11 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override4.good: -------------------------------------------------------------------------------- 1 | test override4/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 2 5 | [Crux] Proved: 2 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override4.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | // This call should be replaced by the test override 8 | let foo = crucible_i8("x"); 9 | crucible_assume!(foo == 4); 10 | crucible_assert!(foo + 1 == 5); 11 | } 12 | -------------------------------------------------------------------------------- /test/symb_eval/overrides/override5.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::*; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | // This call should be replaced by the test override 8 | let foo = crucible_u64("foo"); 9 | crucible_assume!(foo != 0); 10 | crucible_assert!(foo.wrapping_add(1) != 0); 11 | } 12 | -------------------------------------------------------------------------------- /test/symb_eval/refs/mux_init_imm.good: -------------------------------------------------------------------------------- 1 | test mux_init_imm/3a1fbbbh::crux_test[0]: returned Symbolic BV, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/refs/mux_init_imm.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let mut result = 0; 7 | let one = 1; 8 | if bool::symbolic("cond") { 9 | let r = &one; 10 | let r2 = &r; 11 | result = **r2; 12 | } 13 | result 14 | } 15 | 16 | pub fn main() { 17 | println!("{:?}", crux_test()); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/symb_eval/refs/mux_init_mut.good: -------------------------------------------------------------------------------- 1 | test mux_init_mut/3a1fbbbh::crux_test[0]: returned Symbolic BV, ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/refs/mux_init_mut.rs: -------------------------------------------------------------------------------- 1 | extern crate crucible; 2 | use crucible::*; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | fn crux_test() -> i32 { 6 | let mut result = 0; 7 | if bool::symbolic("cond") { 8 | let mut r = &mut result; 9 | let r2 = &mut r; 10 | **r2 = 1; 11 | } 12 | result 13 | } 14 | 15 | pub fn main() { 16 | println!("{:?}", crux_test()); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/symb_eval/scalar/test1.good: -------------------------------------------------------------------------------- 1 | test test1/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] Goal status: 4 | [Crux] Total: 94 5 | [Crux] Proved: 94 6 | [Crux] Disproved: 0 7 | [Crux] Incomplete: 0 8 | [Crux] Unknown: 0 9 | [Crux] Overall status: Valid. 10 | -------------------------------------------------------------------------------- /test/symb_eval/vec/clone.good: -------------------------------------------------------------------------------- 1 | test clone/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vec/clone.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | pub fn f() { 4 | let v = vec![1, 2, 3]; 5 | let w = v.clone(); 6 | assert!(v == w); 7 | } 8 | -------------------------------------------------------------------------------- /test/symb_eval/vec/into_iter.good: -------------------------------------------------------------------------------- 1 | test into_iter/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vec/into_iter.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(crux, crux_test)] 2 | pub fn f() { 3 | let v = vec![1, 2, 3]; 4 | let mut it = v.into_iter(); 5 | assert!(it.next() == Some(1)); 6 | assert!(it.next() == Some(2)); 7 | assert!(it.next() == Some(3)); 8 | assert!(it.next() == None); 9 | } 10 | -------------------------------------------------------------------------------- /test/symb_eval/vec/macro.good: -------------------------------------------------------------------------------- 1 | test macro/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vec/macro.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg_attr(crux, crux_test)] 3 | pub fn f() { 4 | let v = vec![1, 2, 3]; 5 | assert!(v.len() == 3); 6 | assert!(v[0] == 1); 7 | assert!(v[1] == 2); 8 | assert!(v[2] == 3); 9 | } 10 | -------------------------------------------------------------------------------- /test/symb_eval/vec/sort_by_key.good: -------------------------------------------------------------------------------- 1 | test sort_by_key/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vec/sort_by_key.rs: -------------------------------------------------------------------------------- 1 | 2 | #[macro_use] extern crate crucible; 3 | 4 | #[cfg_attr(crux, crux_test)] 5 | pub fn f() { 6 | let mut v = vec![1_i32, 3, 2]; 7 | v.sort_by_key(|&x| -x); 8 | crucible_assert!(&v as &[_] == &[3, 2, 1]); 9 | } 10 | -------------------------------------------------------------------------------- /test/symb_eval/vector/as_mut_slice.good: -------------------------------------------------------------------------------- 1 | test as_mut_slice/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/as_mut_slice.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let mut v = Vector::::new().push(12).push(34); 8 | crucible_assert!(v.len() == 2); 9 | let s = v.as_mut_slice(); 10 | crucible_assert!(s.len() == 2); 11 | crucible_assert!(s[0] == 12); 12 | crucible_assert!(s[1] == 34); 13 | } 14 | -------------------------------------------------------------------------------- /test/symb_eval/vector/as_slice.good: -------------------------------------------------------------------------------- 1 | test as_slice/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/as_slice.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let v = Vector::::new().push(12).push(34); 8 | crucible_assert!(v.len() == 2); 9 | let s = v.as_slice(); 10 | crucible_assert!(s.len() == 2); 11 | crucible_assert!(s[0] == 12); 12 | crucible_assert!(s[1] == 34); 13 | } 14 | -------------------------------------------------------------------------------- /test/symb_eval/vector/concat.good: -------------------------------------------------------------------------------- 1 | test concat/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/copy_from_slice.good: -------------------------------------------------------------------------------- 1 | test copy_from_slice/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/copy_from_slice.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let v = Vector::::copy_from_slice(&[1, 2, 3, 4]); 8 | crucible_assert!(v.len() == 4); 9 | crucible_assert!(v.as_slice()[0] == 1); 10 | crucible_assert!(v.as_slice()[1] == 2); 11 | crucible_assert!(v.as_slice()[2] == 3); 12 | crucible_assert!(v.as_slice()[3] == 4); 13 | } 14 | -------------------------------------------------------------------------------- /test/symb_eval/vector/mut.good: -------------------------------------------------------------------------------- 1 | test mut/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/mut.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let mut v = Vector::::new().push(12).push(34); 8 | { 9 | let s = v.as_mut_slice(); 10 | s[0] = 99; 11 | } 12 | { 13 | let s = v.as_slice(); 14 | crucible_assert!(s[0] == 99); 15 | crucible_assert!(s[1] == 34); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/symb_eval/vector/new.good: -------------------------------------------------------------------------------- 1 | test new/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/new.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let v = Vector::::new(); 8 | crucible_assert!(v.len() == 0); 9 | } 10 | -------------------------------------------------------------------------------- /test/symb_eval/vector/pop.good: -------------------------------------------------------------------------------- 1 | test pop/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/push.good: -------------------------------------------------------------------------------- 1 | test push/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/push.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let v = Vector::::new(); 8 | crucible_assert!(v.len() == 0); 9 | let v = v.push(12); 10 | crucible_assert!(v.len() == 1); 11 | let v = v.push(34); 12 | crucible_assert!(v.len() == 2); 13 | } 14 | -------------------------------------------------------------------------------- /test/symb_eval/vector/replicate.good: -------------------------------------------------------------------------------- 1 | test replicate/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | -------------------------------------------------------------------------------- /test/symb_eval/vector/replicate.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #[macro_use] extern crate crucible; 3 | use crucible::vector::Vector; 4 | 5 | #[cfg_attr(crux, crux_test)] 6 | pub fn f() { 7 | let v = Vector::::replicate(123, 4); 8 | crucible_assert!(v.len() == 4); 9 | for i in 0 .. 4 { 10 | crucible_assert!(v.as_slice()[i] == 123); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/symb_eval/vector/split_at.good: -------------------------------------------------------------------------------- 1 | test split_at/3a1fbbbh::f[0]: ok 2 | 3 | [Crux] All goals discharged through internal simplification. 4 | [Crux] Overall status: Valid. 5 | --------------------------------------------------------------------------------