From aacb6a49d71d3a40cdb469f31a512df6f415129e Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 4 Apr 2021 23:55:20 -0500 Subject: [PATCH] Rust: Switch from nightly to stable --- .github/workflows/main.yml | 7 +++---- .github/workflows/release.yml | 7 +++---- Makefile | 14 +++++++------- src/rust/cpu/string.rs | 6 ++++-- src/rust/lib.rs | 3 --- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ce6015c..26240c57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,10 +22,9 @@ jobs: key: ${{ runner.os }}-rustup - name: rustup run: | - rustup toolchain install nightly - rustup default nightly - rustup target add wasm32-unknown-unknown --toolchain nightly - rustup component add rustfmt-preview --toolchain nightly + rustup toolchain install stable + rustup target add wasm32-unknown-unknown + rustup component add rustfmt - name: apt install run: sudo apt update -qq; sudo apt install nasm gdb qemu-system-x86 libc6-dev-i386 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74b31555..a09c2166 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,10 +19,9 @@ jobs: key: ${{ runner.os }}-rustup - name: rustup run: | - rustup toolchain install nightly - rustup default nightly - rustup target add wasm32-unknown-unknown --toolchain nightly - rustup component add rustfmt-preview --toolchain nightly + rustup toolchain install stable + rustup target add wasm32-unknown-unknown + rustup component add rustfmt - name: Build v86 run: make build/libv86.js build/v86.wasm build/v86-fallback.wasm diff --git a/Makefile b/Makefile index 0360f6c6..b2d27934 100644 --- a/Makefile +++ b/Makefile @@ -169,30 +169,30 @@ src/rust/gen/analyzer0f.rs: $(ANALYZER_DEPENDENCIES) build/v86.wasm: $(RUST_FILES) build/softfloat.o build/zstddeclib.o Cargo.toml mkdir -p build/ -ls -lh build/v86.wasm - cargo +nightly rustc --release $(CARGO_FLAGS) + cargo rustc --release $(CARGO_FLAGS) mv build/wasm32-unknown-unknown/release/v86.wasm build/v86.wasm ls -lh build/v86.wasm build/v86-debug.wasm: $(RUST_FILES) build/softfloat.o build/zstddeclib.o Cargo.toml mkdir -p build/ -ls -lh build/v86-debug.wasm - cargo +nightly rustc $(CARGO_FLAGS) + cargo rustc $(CARGO_FLAGS) mv build/wasm32-unknown-unknown/debug/v86.wasm build/v86-debug.wasm ls -lh build/v86-debug.wasm build/v86-fallback.wasm: $(RUST_FILES) build/softfloat.o build/zstddeclib.o Cargo.toml mkdir -p build/ - cargo +nightly rustc --release $(CARGO_FLAGS_SAFE) + cargo rustc --release $(CARGO_FLAGS_SAFE) mv build/wasm32-unknown-unknown/release/v86.wasm build/v86-fallback.wasm || true debug-with-profiler: $(RUST_FILES) build/softfloat.o build/zstddeclib.o Cargo.toml mkdir -p build/ - cargo +nightly rustc --features profiler $(CARGO_FLAGS) + cargo rustc --features profiler $(CARGO_FLAGS) mv build/wasm32-unknown-unknown/debug/v86.wasm build/v86-debug.wasm || true with-profiler: $(RUST_FILES) build/softfloat.o build/zstddeclib.o Cargo.toml mkdir -p build/ - cargo +nightly rustc --release --features profiler $(CARGO_FLAGS) + cargo rustc --release --features profiler $(CARGO_FLAGS) mv build/wasm32-unknown-unknown/release/v86.wasm build/v86.wasm || true build/softfloat.o: lib/softfloat/softfloat.c @@ -296,7 +296,7 @@ devices-test: all-debug ./tests/devices/virtio_9p.js rust-test: $(RUST_FILES) - env RUSTFLAGS="-D warnings" RUST_BACKTRACE=full RUST_TEST_THREADS=1 cargo +nightly test -- --nocapture + env RUSTFLAGS="-D warnings" RUST_BACKTRACE=full RUST_TEST_THREADS=1 cargo test -- --nocapture ./tests/rust/verify-wasmgen-dummy-output.js rust-test-intensive: @@ -315,7 +315,7 @@ jshint: jshint --config=./.jshint.json src tests gen lib rustfmt: $(RUST_FILES) - cargo +nightly fmt --all -- --check + cargo fmt --all -- --check build/capstone-x86.min.js: mkdir -p build diff --git a/src/rust/cpu/string.rs b/src/rust/cpu/string.rs index e9e23d61..7ce165da 100644 --- a/src/rust/cpu/string.rs +++ b/src/rust/cpu/string.rs @@ -403,8 +403,10 @@ unsafe fn string_instruction( let finished = match rep { Rep::Z | Rep::NZ => { let rep_cmp = match (rep, instruction) { - (Rep::Z, Instruction::Scas | Instruction::Cmps) => src_val == dst_val, - (Rep::NZ, Instruction::Scas | Instruction::Cmps) => src_val != dst_val, + (Rep::Z, Instruction::Cmps) => src_val == dst_val, + (Rep::Z, Instruction::Scas) => src_val == dst_val, + (Rep::NZ, Instruction::Cmps) => src_val != dst_val, + (Rep::NZ, Instruction::Scas) => src_val != dst_val, _ => true, }; count -= 1; diff --git a/src/rust/lib.rs b/src/rust/lib.rs index 6d53b7c8..ebd3b89a 100644 --- a/src/rust/lib.rs +++ b/src/rust/lib.rs @@ -1,6 +1,3 @@ -#![feature(const_fn)] -#![feature(extern_types)] -#![feature(or_patterns)] #![allow(const_item_mutation)] #[macro_use]