diff --git a/README.md b/README.md index 2d7b33c..ba6a853 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ cat tests/test_reduced.c ```sh # Ubuntu 20.04 -sudo apt install -y make cmake python3 csmith libcsmith-dev creduce +sudo apt install -y build-essential clang make cmake python3 csmith libcsmith-dev creduce ``` ### Run diff --git a/rust-toolchain b/rust-toolchain index 373aea9..bb120e8 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.57.0 +1.59.0 diff --git a/src/asm/write_asm.rs b/src/asm/write_asm.rs index c64b6b8..4b61735 100644 --- a/src/asm/write_asm.rs +++ b/src/asm/write_asm.rs @@ -272,8 +272,7 @@ impl WriteString for RType { "w" } else { "l" - } - .to_string(), + }, if *is_signed { "" } else { "u" }, float_data_size.write_string() ) @@ -292,8 +291,7 @@ impl WriteString for RType { "w" } else { "l" - } - .to_string(), + }, if *is_signed { "" } else { "u" } ) } diff --git a/src/ir/dtype.rs b/src/ir/dtype.rs index 948ffab..a83861d 100644 --- a/src/ir/dtype.rs +++ b/src/ir/dtype.rs @@ -881,6 +881,7 @@ impl Dtype { } } + #[must_use] pub fn set_const(self, is_const: bool) -> Self { match self { Self::Unit { .. } => Self::Unit { is_const }, @@ -998,6 +999,7 @@ impl Dtype { } } + #[must_use] pub fn set_signed(self, is_signed: bool) -> Self { match self { Self::Int { diff --git a/src/ir/interp.rs b/src/ir/interp.rs index 1d1bfeb..078166d 100644 --- a/src/ir/interp.rs +++ b/src/ir/interp.rs @@ -1037,12 +1037,11 @@ impl Byte { let padding = std::cmp::max(inner_size, inner_align) - inner_size; values .iter() - .map(|v| { + .flat_map(|v| { let mut result = Self::value_to_bytes(v, structs); result.extend(iter::repeat(Byte::Undef).take(padding)); result }) - .flatten() .collect() } Value::Struct { name, fields } => { diff --git a/src/ir/mod.rs b/src/ir/mod.rs index 38e2d43..8a1872f 100644 --- a/src/ir/mod.rs +++ b/src/ir/mod.rs @@ -740,6 +740,7 @@ impl Constant { matches!(self, Self::Undef { .. }) } + #[must_use] pub fn typecast(self, target_dtype: Dtype) -> Self { if self.dtype() == target_dtype { return self; diff --git a/src/ir/write_ir.rs b/src/ir/write_ir.rs index 09226d7..454d075 100644 --- a/src/ir/write_ir.rs +++ b/src/ir/write_ir.rs @@ -28,7 +28,7 @@ impl WriteLine for TranslationUnit { } else { "%anon" }, - f.deref().to_string() + f.deref() ) }) .collect::>()