summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2024-06-18 12:13:49 +0100
committerAlex Orlenko <zxteam@protonmail.com>2024-06-18 16:09:08 +0100
commit884a025b521e4b110a6bd733c65a658c5a9e43d2 (patch)
tree51e755241ebfd352c7a10c67dfcc54d2e6a52c94
parentc23fa5aa6ccb84146a96a0cdfbdf9117c35d9657 (diff)
downloadmlua-884a025b521e4b110a6bd733c65a658c5a9e43d2.zip
Fix some clippy warnings
-rw-r--r--Cargo.toml5
-rw-r--r--mlua-sys/Cargo.toml3
-rw-r--r--mlua-sys/src/lib.rs19
-rw-r--r--src/chunk.rs2
-rw-r--r--src/lib.rs2
-rw-r--r--src/stdlib.rs1
6 files changed, 22 insertions, 10 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7a826fc..a2f1c01 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,7 +45,7 @@ unstable = []
[dependencies]
mlua_derive = { version = "=0.9.3", optional = true, path = "mlua_derive" }
-bstr = { version = "1.0", features = ["std"], default_features = false }
+bstr = { version = "1.0", features = ["std"], default-features = false }
once_cell = { version = "1.0" }
num-traits = { version = "0.2.14" }
rustc-hash = "2.0"
@@ -79,6 +79,9 @@ criterion = { version = "0.5", features = ["async_tokio"] }
rustyline = "14.0"
tokio = { version = "1.0", features = ["full"] }
+[lints.rust]
+unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
+
[[bench]]
name = "benchmark"
harness = false
diff --git a/mlua-sys/Cargo.toml b/mlua-sys/Cargo.toml
index 4d68e65..8dc99c1 100644
--- a/mlua-sys/Cargo.toml
+++ b/mlua-sys/Cargo.toml
@@ -41,3 +41,6 @@ pkg-config = "0.3.17"
lua-src = { version = ">= 546.0.2, < 546.1.0", optional = true }
luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true }
luau0-src = { version = "0.10.0", optional = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] }
diff --git a/mlua-sys/src/lib.rs b/mlua-sys/src/lib.rs
index 48225e2..0e73ea7 100644
--- a/mlua-sys/src/lib.rs
+++ b/mlua-sys/src/lib.rs
@@ -39,20 +39,25 @@ pub const LUA_MAX_UPVALUES: c_int = 200;
#[doc(hidden)]
pub const LUA_TRACEBACK_STACK: c_int = 11;
+// Copied from https://github.com/rust-lang/rust/blob/master/library/std/src/sys/pal/common/alloc.rs
// The minimum alignment guaranteed by the architecture. This value is used to
// add fast paths for low alignment values.
-// Copied from https://github.com/rust-lang/rust/blob/master/library/std/src/sys/common/alloc.rs
#[cfg(any(
target_arch = "x86",
target_arch = "arm",
+ target_arch = "m68k",
+ target_arch = "csky",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "sparc",
- target_arch = "asmjs",
target_arch = "wasm32",
target_arch = "hexagon",
- all(target_arch = "riscv32", not(target_os = "espidf")),
+ all(
+ target_arch = "riscv32",
+ not(any(target_os = "espidf", target_os = "zkvm"))
+ ),
all(target_arch = "xtensa", not(target_os = "espidf")),
))]
#[doc(hidden)]
@@ -60,18 +65,20 @@ pub const SYS_MIN_ALIGN: usize = 8;
#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
+ target_arch = "arm64ec",
+ target_arch = "loongarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "riscv64",
target_arch = "wasm64",
- target_arch = "loongarch64",
))]
#[doc(hidden)]
pub const SYS_MIN_ALIGN: usize = 16;
-// The allocator on the esp-idf platform guarentees 4 byte alignment.
+// The allocator on the esp-idf and zkvm platforms guarantee 4 byte alignment.
#[cfg(any(
- all(target_arch = "riscv32", target_os = "espidf"),
+ all(target_arch = "riscv32", any(target_os = "espidf", target_os = "zkvm")),
all(target_arch = "xtensa", target_os = "espidf"),
))]
#[doc(hidden)]
diff --git a/src/chunk.rs b/src/chunk.rs
index 3114365..b3b1a7c 100644
--- a/src/chunk.rs
+++ b/src/chunk.rs
@@ -341,7 +341,7 @@ impl<'lua, 'a> Chunk<'lua, 'a> {
///
/// This is equivalent to calling the chunk function with no arguments and no return values.
pub fn exec(self) -> Result<()> {
- self.call(())?;
+ self.call::<_, ()>(())?;
Ok(())
}
diff --git a/src/lib.rs b/src/lib.rs
index 5489a69..9345f5f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -73,7 +73,7 @@
// Deny warnings inside doc tests / examples. When this isn't present, rustdoc doesn't show *any*
// warnings at all.
-#![doc(test(attr(deny(warnings))))]
+#![doc(test(attr(warn(warnings))))] // FIXME: Remove this when rust-lang/rust#123748 is fixed
#![cfg_attr(docsrs, feature(doc_cfg))]
#[macro_use]
diff --git a/src/stdlib.rs b/src/stdlib.rs
index 88e50cf..e3630d4 100644
--- a/src/stdlib.rs
+++ b/src/stdlib.rs
@@ -1,5 +1,4 @@
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign};
-use std::u32;
/// Flags describing the set of lua standard libraries to load.
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]