From 7f21a8343a4130f4a02660f15b6d985a0e5d8029 Mon Sep 17 00:00:00 2001 From: wtfsck Date: Fri, 16 Aug 2024 20:28:32 +0200 Subject: [PATCH 1/2] Disable rustfmt `#[cfg]` warnings. The `#[cfg]` is there because we can't add `#[rustfmt::skip]` to expressions. --- src/rust/iced-x86/src/block_enc/instr/mod.rs | 1 + src/rust/iced-x86/src/code.rs | 4 ++++ src/rust/iced-x86/src/encoder/instruction_fmt.rs | 1 + src/rust/iced-x86/src/encoder/op_code_fmt.rs | 2 ++ src/rust/iced-x86/src/encoder/tests/mod.rs | 1 + src/rust/iced-x86/src/formatter/fmt_utils.rs | 1 + src/rust/iced-x86/src/instruction.rs | 3 +++ 7 files changed, 13 insertions(+) diff --git a/src/rust/iced-x86/src/block_enc/instr/mod.rs b/src/rust/iced-x86/src/block_enc/instr/mod.rs index ea8d5035c..c5b449ccb 100644 --- a/src/rust/iced-x86/src/block_enc/instr/mod.rs +++ b/src/rust/iced-x86/src/block_enc/instr/mod.rs @@ -130,6 +130,7 @@ impl InstrUtils { format!("{} : 0x{:X}", error_message, instruction.ip()) } + #[allow(unexpected_cfgs)] pub(super) fn create(block_encoder: &mut BlockEncInt, base: &mut InstrBase, instruction: &Instruction) -> Box { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match instruction.code() { diff --git a/src/rust/iced-x86/src/code.rs b/src/rust/iced-x86/src/code.rs index e8cc5f97d..1f9c3b84a 100644 --- a/src/rust/iced-x86/src/code.rs +++ b/src/rust/iced-x86/src/code.rs @@ -44853,6 +44853,7 @@ impl Code { #[must_use] #[inline] #[allow(clippy::match_like_matches_macro)] + #[allow(unexpected_cfgs)] pub const fn is_string_instruction(self) -> bool { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self { @@ -45083,6 +45084,7 @@ impl Code { impl Code { #[must_use] #[allow(clippy::match_like_matches_macro)] + #[allow(unexpected_cfgs)] pub(crate) const fn ignores_segment(self) -> bool { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self { @@ -45108,6 +45110,7 @@ impl Code { #[must_use] #[inline] #[allow(clippy::match_like_matches_macro)] + #[allow(unexpected_cfgs)] pub(crate) const fn ignores_index(self) -> bool { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self { @@ -45123,6 +45126,7 @@ impl Code { #[must_use] #[inline] + #[allow(unexpected_cfgs)] pub(crate) const fn is_tile_stride_index(self) -> bool { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self { diff --git a/src/rust/iced-x86/src/encoder/instruction_fmt.rs b/src/rust/iced-x86/src/encoder/instruction_fmt.rs index 091570523..6cefaf5e2 100644 --- a/src/rust/iced-x86/src/encoder/instruction_fmt.rs +++ b/src/rust/iced-x86/src/encoder/instruction_fmt.rs @@ -282,6 +282,7 @@ impl<'a, 'b> InstructionFormatter<'a, 'b> { } } + #[allow(unexpected_cfgs)] pub(super) fn format(&mut self) -> String { if !self.op_code.is_instruction() { match self.op_code.code() { diff --git a/src/rust/iced-x86/src/encoder/op_code_fmt.rs b/src/rust/iced-x86/src/encoder/op_code_fmt.rs index 8b2b2dc14..cf6b9a76f 100644 --- a/src/rust/iced-x86/src/encoder/op_code_fmt.rs +++ b/src/rust/iced-x86/src/encoder/op_code_fmt.rs @@ -141,6 +141,7 @@ impl<'a, 'b> OpCodeFormatter<'a, 'b> { EncodingKind::EVEX | EncodingKind::XOP | EncodingKind::D3NOW | EncodingKind::MVEX => return true, } + #[allow(unexpected_cfgs)] for &op_kind in self.op_code.op_kinds() { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match op_kind { @@ -205,6 +206,7 @@ impl<'a, 'b> OpCodeFormatter<'a, 'b> { false } + #[allow(unexpected_cfgs)] fn has_vsib(&self) -> bool { for &op_kind in self.op_code.op_kinds() { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] diff --git a/src/rust/iced-x86/src/encoder/tests/mod.rs b/src/rust/iced-x86/src/encoder/tests/mod.rs index f9d2dc5e0..3fb358a79 100644 --- a/src/rust/iced-x86/src/encoder/tests/mod.rs +++ b/src/rust/iced-x86/src/encoder/tests/mod.rs @@ -287,6 +287,7 @@ fn encode_invalid_code_value_is_an_error() { } #[test] +#[allow(unexpected_cfgs)] fn displsize_eq_1_uses_long_form_if_it_does_not_fit_in_1_byte() { const RIP: u64 = 0; diff --git a/src/rust/iced-x86/src/formatter/fmt_utils.rs b/src/rust/iced-x86/src/formatter/fmt_utils.rs index b84309191..7968245a0 100644 --- a/src/rust/iced-x86/src/formatter/fmt_utils.rs +++ b/src/rust/iced-x86/src/formatter/fmt_utils.rs @@ -71,6 +71,7 @@ pub(super) fn is_call(kind: FormatterFlowControl) -> bool { } #[must_use] +#[allow(unexpected_cfgs)] pub(super) fn get_flow_control(instruction: &Instruction) -> FormatterFlowControl { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match instruction.code() { diff --git a/src/rust/iced-x86/src/instruction.rs b/src/rust/iced-x86/src/instruction.rs index 0c0a61294..4384d3eba 100644 --- a/src/rust/iced-x86/src/instruction.rs +++ b/src/rust/iced-x86/src/instruction.rs @@ -2447,6 +2447,7 @@ impl Instruction { #[must_use] #[allow(clippy::missing_inline_in_public_items)] #[allow(clippy::match_single_binding)] + #[allow(unexpected_cfgs)] pub const fn vsib(&self) -> Option { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] match self.code() { @@ -2829,6 +2830,7 @@ impl Instruction { /// ``` #[must_use] #[allow(clippy::missing_inline_in_public_items)] + #[allow(unexpected_cfgs)] pub fn stack_pointer_increment(&self) -> i32 { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] #[allow(clippy::match_single_binding)] @@ -2948,6 +2950,7 @@ impl Instruction { /// ``` #[must_use] #[allow(clippy::missing_inline_in_public_items)] + #[allow(unexpected_cfgs)] pub fn fpu_stack_increment_info(&self) -> FpuStackIncrementInfo { #[cfg_attr(feature = "cargo-fmt", rustfmt::skip)] #[allow(clippy::match_single_binding)] From 728079fe8a5c92f92f0e5b6d3c9f8067d02e1393 Mon Sep 17 00:00:00 2001 From: wtfsck Date: Fri, 16 Aug 2024 20:32:30 +0200 Subject: [PATCH 2/2] Bump Java deps Closes #596 Closes #597 Closes #598 --- src/java/iced-x86/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/iced-x86/pom.xml b/src/java/iced-x86/pom.xml index 3c0844a94..6d8021faf 100644 --- a/src/java/iced-x86/pom.xml +++ b/src/java/iced-x86/pom.xml @@ -47,13 +47,13 @@ org.junit.jupiter junit-jupiter-engine - 5.10.3 + 5.11.0 test org.junit.jupiter junit-jupiter-params - 5.10.3 + 5.11.0 test @@ -151,7 +151,7 @@ maven-gpg-plugin - 3.2.4 + 3.2.5 sign-artifacts