diff --git a/build/build-rust b/build/build-rust index fefdefa2a..694cb08f4 100755 --- a/build/build-rust +++ b/build/build-rust @@ -26,7 +26,7 @@ cov_out_rust_tmp=$cov_out_rust/tmp cov_out_rust_merged=$cov_out_rust/merged # Minimum supported Rust version -msrv="1.60.0" +msrv="1.63.0" new_func() { echo @@ -195,7 +195,7 @@ cargo_test_cov() { cov_test_dir=$1 shift if [ "$gen_cov" = "y" ]; then - test_exe=$(cargo test --color always --no-run --message-format=json "$@" | grep -- '"name":"iced-x86"' | tail -1 | sed -e 's/.*"executable":"\([^"]\+\)".*/\1/') + test_exe=$(cargo test --color always --no-run --message-format=json "$@" | grep -- 'iced/src/rust/iced-x86' | tail -1 | sed -e 's/.*"executable":"\([^"]\+\)".*/\1/') if [ ! -x "$test_exe" ]; then echo "Couldn't get the test executable name, got '$test_exe'" echo "json output:" diff --git a/build/ci-install-rust.sh b/build/ci-install-rust.sh index da43d3fb3..fae614604 100644 --- a/build/ci-install-rust.sh +++ b/build/ci-install-rust.sh @@ -16,7 +16,7 @@ if [[ "$OSTYPE" = "darwin"* ]]; then fi # It fails on Windows so disable auto self update -rustup toolchain install 1.60.0 --no-self-update +rustup toolchain install 1.63.0 --no-self-update rustup target add wasm32-unknown-unknown rustup update --no-self-update diff --git a/src/csharp/Intel/Generator/Enums/Rust/RustEnumsGenerator.cs b/src/csharp/Intel/Generator/Enums/Rust/RustEnumsGenerator.cs index 41e9ab954..4dfbff4e4 100644 --- a/src/csharp/Intel/Generator/Enums/Rust/RustEnumsGenerator.cs +++ b/src/csharp/Intel/Generator/Enums/Rust/RustEnumsGenerator.cs @@ -396,7 +396,7 @@ static bool IsNormalEnum(EnumType enumType) { } writer.WriteLine("}"); writer.WriteLine($"assert!(<{enumTypeName} as TryFrom<{tryFromType}>>::try_from({icedConstValue}{castToFromType}).is_err());"); - writer.WriteLine($"assert!(<{enumTypeName} as TryFrom<{tryFromType}>>::try_from(core::{tryFromType}::MAX).is_err());"); + writer.WriteLine($"assert!(<{enumTypeName} as TryFrom<{tryFromType}>>::try_from({tryFromType}::MAX).is_err());"); } writer.WriteLine("}"); } diff --git a/src/java/iced-x86/pom.xml b/src/java/iced-x86/pom.xml index 4f572b32c..aa9919c20 100644 --- a/src/java/iced-x86/pom.xml +++ b/src/java/iced-x86/pom.xml @@ -62,7 +62,7 @@ maven-clean-plugin - 3.3.2 + 3.4.0 maven-resources-plugin @@ -82,11 +82,11 @@ maven-surefire-plugin - 3.2.5 + 3.3.0 maven-jar-plugin - 3.4.1 + 3.4.2 @@ -114,7 +114,7 @@ maven-project-info-reports-plugin - 3.5.0 + 3.6.1 maven-source-plugin diff --git a/src/rust/iced-x86-fzgt/Cargo.toml b/src/rust/iced-x86-fzgt/Cargo.toml index cdf49df6c..ca0a81b1a 100644 --- a/src/rust/iced-x86-fzgt/Cargo.toml +++ b/src/rust/iced-x86-fzgt/Cargo.toml @@ -5,7 +5,7 @@ license = "MIT" description = "Test FuzzerGen output" edition = "2021" publish = false -rust-version = "1.60.0" +rust-version = "1.63.0" [dependencies.iced-x86] path = "../iced-x86" diff --git a/src/rust/iced-x86-js/Cargo.toml b/src/rust/iced-x86-js/Cargo.toml index dc04b072d..f27155c04 100644 --- a/src/rust/iced-x86-js/Cargo.toml +++ b/src/rust/iced-x86-js/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["disassembler", "javascript", "assembler", "x86", "amd64"] categories = ["wasm", "development-tools::debugging", "encoding", "hardware-support"] edition = "2021" publish = false -rust-version = "1.60.0" +rust-version = "1.63.0" [lib] # Adding "rlib" increases the wasm file size, so ... don't do it diff --git a/src/rust/iced-x86-js/README.md b/src/rust/iced-x86-js/README.md index fc467525e..df597d6c4 100644 --- a/src/rust/iced-x86-js/README.md +++ b/src/rust/iced-x86-js/README.md @@ -1,4 +1,4 @@ -iced-x86 JavaScript bindings (Rust -> WebAssembly) [![npm](https://img.shields.io/npm/v/iced-x86.svg)](https://www.npmjs.com/package/iced-x86) [![GitHub builds](https://github.com/icedland/iced/workflows/GitHub%20CI/badge.svg)](https://github.com/icedland/iced/actions) ![Minimum rustc version](https://img.shields.io/badge/rustc-1.60.0+-blue.svg) ![License](https://img.shields.io/crates/l/iced-x86.svg) +iced-x86 JavaScript bindings (Rust -> WebAssembly) [![npm](https://img.shields.io/npm/v/iced-x86.svg)](https://www.npmjs.com/package/iced-x86) [![GitHub builds](https://github.com/icedland/iced/workflows/GitHub%20CI/badge.svg)](https://github.com/icedland/iced/actions) ![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-blue.svg) ![License](https://img.shields.io/crates/l/iced-x86.svg) iced-x86 is a blazing fast and correct x86 (16/32/64-bit) disassembler for JavaScript (WebAssembly). diff --git a/src/rust/iced-x86-lua/Cargo.toml b/src/rust/iced-x86-lua/Cargo.toml index fbfa98d02..875d3ad05 100644 --- a/src/rust/iced-x86-lua/Cargo.toml +++ b/src/rust/iced-x86-lua/Cargo.toml @@ -3,7 +3,7 @@ name = "iced-x86-lua" version = "1.21.0" edition = "2021" publish = false -rust-version = "1.60.0" +rust-version = "1.63.0" [lib] name = "iced_x86" diff --git a/src/rust/iced-x86-py/Cargo.toml b/src/rust/iced-x86-py/Cargo.toml index 8a00dbe8d..859d214a9 100644 --- a/src/rust/iced-x86-py/Cargo.toml +++ b/src/rust/iced-x86-py/Cargo.toml @@ -3,7 +3,7 @@ name = "iced-x86-py" version = "1.21.0" edition = "2021" publish = false -rust-version = "1.60.0" +rust-version = "1.63.0" [lib] name = "_iced_x86_py" @@ -13,7 +13,7 @@ crate-type = ["cdylib"] bincode = "1.3.3" [dependencies.pyo3] -version = "0.21.0" +version = "0.22.0" default-features = false features = ["macros", "extension-module", "abi3-py38"] diff --git a/src/rust/iced-x86-py/build-wheels.sh b/src/rust/iced-x86-py/build-wheels.sh index ab03ca84f..4a45b778c 100755 --- a/src/rust/iced-x86-py/build-wheels.sh +++ b/src/rust/iced-x86-py/build-wheels.sh @@ -16,7 +16,7 @@ while [ "$#" -gt 0 ]; do done # Build with minimum supported Rust version since later versions require a later GLIBC -msrv="1.60.0" +msrv="1.63.0" curl https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain=$msrv export PATH="$HOME/.cargo/bin:$PATH" diff --git a/src/rust/iced-x86-py/src/instruction.rs b/src/rust/iced-x86-py/src/instruction.rs index 5a7d99c3a..80cb337f7 100644 --- a/src/rust/iced-x86-py/src/instruction.rs +++ b/src/rust/iced-x86-py/src/instruction.rs @@ -173,13 +173,13 @@ impl Instruction { /// Args: /// state (Any): unpickled state #[pyo3(text_signature = "($self, state)")] - fn __setstate__(&mut self, py: Python<'_>, state: PyObject) -> PyResult<()> { - match state.extract::<&PyBytes>(py) { + fn __setstate__(&mut self, state: &Bound<'_, PyAny>) -> PyResult<()> { + match state.downcast::() { Ok(s) => { self.instr = deserialize(s.as_bytes()).map_err(to_value_error)?; Ok(()) } - Err(e) => Err(e), + Err(e) => Err(to_value_error(e)), } } diff --git a/src/rust/iced-x86/Cargo.toml b/src/rust/iced-x86/Cargo.toml index 1422ef42e..b30ca6d27 100644 --- a/src/rust/iced-x86/Cargo.toml +++ b/src/rust/iced-x86/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["disassembler", "assembler", "x86", "amd64", "x86_64"] categories = ["no-std", "development-tools::debugging", "encoding", "hardware-support", "wasm"] # Don't include the tests when uploading to crates.io exclude = ["/src/**/test/", "/src/**/tests/", "/src/**/test_utils/"] -rust-version = "1.60.0" +rust-version = "1.63.0" # These features are documented in README.md / lib.rs [features] diff --git a/src/rust/iced-x86/README.md b/src/rust/iced-x86/README.md index 661c09b1c..40d386886 100644 --- a/src/rust/iced-x86/README.md +++ b/src/rust/iced-x86/README.md @@ -1,7 +1,7 @@ iced-x86 [![Latest version](https://img.shields.io/crates/v/iced-x86.svg)](https://crates.io/crates/iced-x86) [![Documentation](https://docs.rs/iced-x86/badge.svg)](https://docs.rs/iced-x86) -[![Minimum rustc version](https://img.shields.io/badge/rustc-1.60.0+-blue.svg)](#minimum-supported-rustc-version) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-blue.svg)](#minimum-supported-rustc-version) ![License](https://img.shields.io/crates/l/iced-x86.svg) iced-x86 is a blazing fast and correct x86 (16/32/64-bit) instruction decoder, disassembler and assembler written in Rust. @@ -16,7 +16,7 @@ iced-x86 is a blazing fast and correct x86 (16/32/64-bit) instruction decoder, d - 👍 The encoder can be used to re-encode decoded instructions at any address - 👍 API to get instruction info, eg. read/written registers, memory and rflags bits; CPUID feature flag, control flow info, etc - 👍 Supports `#![no_std]` and `WebAssembly` -- 👍 Supports `rustc` `1.60.0` or later +- 👍 Supports `rustc` `1.63.0` or later - 👍 Few dependencies (`lazy_static`) - 👍 License: MIT @@ -1280,7 +1280,7 @@ Output: ## Minimum supported `rustc` version -iced-x86 supports `rustc` `1.60.0` or later. +iced-x86 supports `rustc` `1.63.0` or later. This is checked in CI builds where the minimum supported version and the latest stable version are used to build the source code and run tests. Bumping the minimum supported version of `rustc` is considered a minor breaking change. The minor version of iced-x86 will be incremented. diff --git a/src/rust/iced-x86/src/block_enc/enums.rs b/src/rust/iced-x86/src/block_enc/enums.rs index 56de68ae4..c21d5d671 100644 --- a/src/rust/iced-x86/src/block_enc/enums.rs +++ b/src/rust/iced-x86/src/block_enc/enums.rs @@ -85,7 +85,7 @@ fn test_relockind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::RELOC_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/code.rs b/src/rust/iced-x86/src/code.rs index 8809ae9e6..e8cc5f97d 100644 --- a/src/rust/iced-x86/src/code.rs +++ b/src/rust/iced-x86/src/code.rs @@ -44476,7 +44476,7 @@ fn test_code_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CODE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/decoder.rs b/src/rust/iced-x86/src/decoder.rs index 21a8b2a67..6d9f2a107 100644 --- a/src/rust/iced-x86/src/decoder.rs +++ b/src/rust/iced-x86/src/decoder.rs @@ -261,7 +261,7 @@ fn test_decodererror_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::DECODER_ERROR_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -426,18 +426,14 @@ impl StateFlags { // It could fit in a `u8` but then it wouldn't be cleared at the same time as the other fields since the // compiler would move other `u32` fields above it to align the fields. #[repr(u32)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Default, Debug, Copy, Clone, Eq, PartialEq)] enum DecoderMandatoryPrefix { + #[default] PNP = 0, P66 = 1, PF3 = 2, PF2 = 3, } -impl Default for DecoderMandatoryPrefix { - fn default() -> Self { - DecoderMandatoryPrefix::PNP - } -} #[derive(Default)] #[allow(dead_code)] diff --git a/src/rust/iced-x86/src/encoder/enums.rs b/src/rust/iced-x86/src/encoder/enums.rs index aebfb6774..a905da349 100644 --- a/src/rust/iced-x86/src/encoder/enums.rs +++ b/src/rust/iced-x86/src/encoder/enums.rs @@ -738,7 +738,7 @@ fn test_repprefixkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::REP_PREFIX_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/enums.rs b/src/rust/iced-x86/src/enums.rs index 34e8bcdc4..d4d952afa 100644 --- a/src/rust/iced-x86/src/enums.rs +++ b/src/rust/iced-x86/src/enums.rs @@ -94,7 +94,7 @@ fn test_codesize_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CODE_SIZE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -239,7 +239,7 @@ fn test_roundingcontrol_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::ROUNDING_CONTROL_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -526,7 +526,7 @@ fn test_opkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::OP_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -757,7 +757,7 @@ fn test_encodingkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::ENCODING_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(any(feature = "decoder", feature = "encoder", feature = "instr_info", feature = "op_code_info"))] @@ -956,7 +956,7 @@ fn test_tupletype_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::TUPLE_TYPE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(any(feature = "decoder", feature = "encoder", feature = "op_code_info"))] @@ -1128,7 +1128,7 @@ fn test_flowcontrol_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::FLOW_CONTROL_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "instr_info")] @@ -1605,7 +1605,7 @@ fn test_opcodeoperandkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::OP_CODE_OPERAND_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(all(feature = "encoder", feature = "op_code_info"))] @@ -1756,7 +1756,7 @@ fn test_mvexehbit_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MVEX_EHBIT_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "mvex")] @@ -2471,7 +2471,7 @@ fn test_cpuidfeature_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CPUID_FEATURE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "instr_info")] @@ -2677,7 +2677,7 @@ fn test_opaccess_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::OP_ACCESS_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "instr_info")] @@ -2869,7 +2869,7 @@ fn test_conditioncode_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CONDITION_CODE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "instr_info")] @@ -3024,7 +3024,7 @@ fn test_mandatoryprefix_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MANDATORY_PREFIX_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(all(feature = "encoder", feature = "op_code_info"))] @@ -3192,7 +3192,7 @@ fn test_opcodetablekind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::OP_CODE_TABLE_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(all(feature = "encoder", feature = "op_code_info"))] @@ -3333,7 +3333,7 @@ fn test_instrscale_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(4).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -3513,7 +3513,7 @@ fn test_mvexconvfn_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MVEX_CONV_FN_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "mvex")] @@ -3706,7 +3706,7 @@ fn test_mvexregmemconv_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MVEX_REG_MEM_CONV_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "mvex")] @@ -3890,7 +3890,7 @@ fn test_mvextupletypelutkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MVEX_TUPLE_TYPE_LUT_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[cfg(feature = "mvex")] diff --git a/src/rust/iced-x86/src/formatter/enums.rs b/src/rust/iced-x86/src/formatter/enums.rs index 0a66392e1..8192d48f1 100644 --- a/src/rust/iced-x86/src/formatter/enums.rs +++ b/src/rust/iced-x86/src/formatter/enums.rs @@ -94,7 +94,7 @@ fn test_numberbase_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::NUMBER_BASE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -278,7 +278,7 @@ fn test_prefixkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::PREFIX_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -427,7 +427,7 @@ fn test_decoratorkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::DECORATOR_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -575,7 +575,7 @@ fn test_numberkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::NUMBER_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -753,7 +753,7 @@ fn test_cc_b_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_B_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -893,7 +893,7 @@ fn test_cc_ae_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_AE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1030,7 +1030,7 @@ fn test_cc_e_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_E_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1167,7 +1167,7 @@ fn test_cc_ne_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_NE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1304,7 +1304,7 @@ fn test_cc_be_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_BE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1441,7 +1441,7 @@ fn test_cc_a_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_A_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1578,7 +1578,7 @@ fn test_cc_p_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_P_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1715,7 +1715,7 @@ fn test_cc_np_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_NP_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1852,7 +1852,7 @@ fn test_cc_l_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_L_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -1989,7 +1989,7 @@ fn test_cc_ge_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_GE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -2126,7 +2126,7 @@ fn test_cc_le_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_LE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -2263,7 +2263,7 @@ fn test_cc_g_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::CC_G_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/formatter/enums_shared.rs b/src/rust/iced-x86/src/formatter/enums_shared.rs index bd4b9c2ad..7106cbe7a 100644 --- a/src/rust/iced-x86/src/formatter/enums_shared.rs +++ b/src/rust/iced-x86/src/formatter/enums_shared.rs @@ -147,7 +147,7 @@ fn test_formattertextkind_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::FORMATTER_TEXT_KIND_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] @@ -378,7 +378,7 @@ fn test_memorysizeoptions_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/formatter/fast.rs b/src/rust/iced-x86/src/formatter/fast.rs index 30be5e24f..a4d13eeb0 100644 --- a/src/rust/iced-x86/src/formatter/fast.rs +++ b/src/rust/iced-x86/src/formatter/fast.rs @@ -345,24 +345,24 @@ macro_rules! format_memory_else_block { let c = if $addr_size == 8 { if $displ < 0 { $displ = $displ.wrapping_neg(); - '-' + b'-' } else { - '+' + b'+' } } else if $addr_size == 4 { if ($displ as i32) < 0 { $displ = ($displ as i32).wrapping_neg() as u32 as i64; - '-' + b'-' } else { - '+' + b'+' } } else { debug_assert_eq!($addr_size, 2); if ($displ as i16) < 0 { $displ = ($displ as i16).wrapping_neg() as u16 as i64; - '-' + b'-' } else { - '+' + b'+' } }; write_fast_ascii_char!($dst, $dst_next_p, c, true); @@ -431,9 +431,9 @@ macro_rules! format_memory_code { || show_segment_prefix_bool(Register::None, $instruction, SpecializedFormatter::::SHOW_USELESS_PREFIXES))) { call_format_register!($slf, $dst, $dst_next_p, $seg_reg); - write_fast_ascii_char_lit!($dst, $dst_next_p, ':', true); + write_fast_ascii_char_lit!($dst, $dst_next_p, b':', true); } - write_fast_ascii_char_lit!($dst, $dst_next_p, '[', true); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'[', true); let mut need_plus = if base_reg != Register::None { call_format_register!($slf, $dst, $dst_next_p, base_reg); @@ -444,7 +444,7 @@ macro_rules! format_memory_code { if $index_reg != Register::None { if need_plus { - write_fast_ascii_char_lit!($dst, $dst_next_p, '+', true); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'+', true); } need_plus = true; @@ -466,10 +466,10 @@ macro_rules! format_memory_code { None } { if need_plus { - let c = if (symbol.flags & SymbolFlags::SIGNED) != 0 { '-' } else { '+' }; + let c = if (symbol.flags & SymbolFlags::SIGNED) != 0 { b'-' } else { b'+' }; write_fast_ascii_char!($dst, $dst_next_p, c, true); } else if (symbol.flags & SymbolFlags::SIGNED) != 0 { - write_fast_ascii_char_lit!($dst, $dst_next_p, '-', true); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'-', true); } call_write_symbol2!($slf, $dst, $dst_next_p, abs_addr, symbol, false); @@ -482,7 +482,7 @@ macro_rules! format_memory_code { format_memory_else_block!($slf, $dst, $dst_next_p, need_plus, displ_size, displ, addr_size); } - write_fast_ascii_char_lit!($dst, $dst_next_p, ']', true); + write_fast_ascii_char_lit!($dst, $dst_next_p, b']', true); } }; } @@ -893,7 +893,7 @@ impl SpecializedFormatter::show_segment_prefix(instruction, op_count) { let prefix_seg = unsafe { mem::transmute((Register::ES as u32 + prefix_seg) as RegisterUnderlyingType) }; call_format_register!(self, dst, dst_next_p, prefix_seg); - write_fast_ascii_char_lit!(dst, dst_next_p, ' ', true); + write_fast_ascii_char_lit!(dst, dst_next_p, b' ', true); } let mut has_xacquire_xrelease = false; @@ -971,7 +971,7 @@ impl SpecializedFormatter 0 { - write_fast_ascii_char_lit!(dst, dst_next_p, ' ', true); + write_fast_ascii_char_lit!(dst, dst_next_p, b' ', true); #[cfg(feature = "mvex")] let mvex_rm_operand = { @@ -1061,16 +1061,16 @@ impl SpecializedFormatter SpecializedFormatter SpecializedFormatter SpecializedFormatter 9 { - write_fast_ascii_char_lit!($dst, $dst_next_p, '0', false); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'0', false); } let hex_table = if $uppercase_hex { b"0123456789ABCDEF" } else { b"0123456789abcdef" }; // SAFETY: 0<=$value<=0xF and hex_table.len() == 0x10 let c = unsafe { *hex_table.get_unchecked($value as usize) }; write_fast_ascii_char!($dst, $dst_next_p, c, false); - write_fast_ascii_char_lit!($dst, $dst_next_p, 'h', false); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'h', false); $dst_next_p } @@ -1620,12 +1620,12 @@ impl SpecializedFormatter 0x9F { - write_fast_ascii_char_lit!($dst, $dst_next_p, '0', false); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'0', false); } let lower_or_value = if $uppercase_hex { 0 } else { 0x2020_2020 }; write_fast_hex2_rw_4bytes!($dst, $dst_next_p, $value, lower_or_value, false); - write_fast_ascii_char_lit!($dst, $dst_next_p, 'h', false); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'h', false); $dst_next_p } @@ -1639,7 +1639,7 @@ impl SpecializedFormatter> (rshift - 4)) & 0xF) > 9 { - write_fast_ascii_char_lit!($dst, $dst_next_p, '0', false); + write_fast_ascii_char_lit!($dst, $dst_next_p, b'0', false); } // If odd number of hex digits @@ -1670,7 +1670,7 @@ impl SpecializedFormatter SpecializedFormatter SpecializedFormatter SpecializedFormatter Self { // `index`/`count` are `u8` - const _: () = assert!(IcedConstants::MAX_OP_COUNT <= core::u8::MAX as usize); + const _: () = assert!(IcedConstants::MAX_OP_COUNT <= u8::MAX as usize); OpKindIterator { count: instruction.op_count() as u8, index: 0, diff --git a/src/rust/iced-x86/src/instruction_create.rs b/src/rust/iced-x86/src/instruction_create.rs index a76c91638..e8754511d 100644 --- a/src/rust/iced-x86/src/instruction_create.rs +++ b/src/rust/iced-x86/src/instruction_create.rs @@ -28,7 +28,6 @@ mod private { use self::private::{With1, With2, With3, With4, With5}; use crate::instruction_internal; use crate::{Code, IcedError, Instruction, MemoryOperand, OpKind, Register, RepPrefixKind}; -use core::{u16, u32, u64}; impl Instruction { fn init_memory_operand(instruction: &mut Instruction, memory: &MemoryOperand) { diff --git a/src/rust/iced-x86/src/lib.rs b/src/rust/iced-x86/src/lib.rs index ed8566559..2325b5ff5 100644 --- a/src/rust/iced-x86/src/lib.rs +++ b/src/rust/iced-x86/src/lib.rs @@ -33,6 +33,7 @@ #![allow(clippy::implied_bounds_in_impls)] #![allow(clippy::manual_range_contains)] #![allow(clippy::match_ref_pats)] +#![allow(clippy::missing_transmute_annotations)] // TODO: enable again #![allow(clippy::needless_late_init)] #![allow(clippy::ptr_eq)] #![allow(clippy::redundant_closure)] // Clippy is buggy diff --git a/src/rust/iced-x86/src/memory_size.rs b/src/rust/iced-x86/src/memory_size.rs index faa531460..af2e15526 100644 --- a/src/rust/iced-x86/src/memory_size.rs +++ b/src/rust/iced-x86/src/memory_size.rs @@ -945,7 +945,7 @@ fn test_memorysize_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MEMORY_SIZE_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/mnemonic.rs b/src/rust/iced-x86/src/mnemonic.rs index 131a1a5ae..6b3f52a8f 100644 --- a/src/rust/iced-x86/src/mnemonic.rs +++ b/src/rust/iced-x86/src/mnemonic.rs @@ -3873,7 +3873,7 @@ fn test_mnemonic_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::MNEMONIC_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/iced-x86/src/register.rs b/src/rust/iced-x86/src/register.rs index b3df24284..439f6c257 100644 --- a/src/rust/iced-x86/src/register.rs +++ b/src/rust/iced-x86/src/register.rs @@ -1535,7 +1535,7 @@ fn test_register_try_from_usize() { assert_eq!(converted, value); } assert!(>::try_from(IcedConstants::REGISTER_ENUM_COUNT).is_err()); - assert!(>::try_from(core::usize::MAX).is_err()); + assert!(>::try_from(usize::MAX).is_err()); } #[cfg(feature = "serde")] #[rustfmt::skip] diff --git a/src/rust/loona/Cargo.toml b/src/rust/loona/Cargo.toml index 30c3d2ef8..44d593feb 100644 --- a/src/rust/loona/Cargo.toml +++ b/src/rust/loona/Cargo.toml @@ -5,7 +5,7 @@ name = "loona" version = "0.1.0" edition = "2021" publish = false -rust-version = "1.60.0" +rust-version = "1.63.0" [features] default = []