Skip to content

Commit 884d4b1

Browse files
committed
Fix some clippy warnings
1 parent aebdd2a commit 884d4b1

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ unstable = []
4545

4646
[dependencies]
4747
mlua_derive = { version = "=0.9.3", optional = true, path = "mlua_derive" }
48-
bstr = { version = "1.0", features = ["std"], default_features = false }
48+
bstr = { version = "1.0", features = ["std"], default-features = false }
4949
once_cell = { version = "1.0" }
5050
num-traits = { version = "0.2.14" }
5151
rustc-hash = "2.0"
@@ -79,6 +79,9 @@ criterion = { version = "0.5", features = ["async_tokio"] }
7979
rustyline = "14.0"
8080
tokio = { version = "1.0", features = ["full"] }
8181

82+
[lints.rust]
83+
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
84+
8285
[[bench]]
8386
name = "benchmark"
8487
harness = false

mlua-sys/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ pkg-config = "0.3.17"
4141
lua-src = { version = ">= 546.0.2, < 546.1.0", optional = true }
4242
luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true }
4343
luau0-src = { version = "0.10.0", optional = true }
44+
45+
[lints.rust]
46+
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] }

mlua-sys/src/lib.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,46 @@ pub const LUA_MAX_UPVALUES: c_int = 200;
3939
#[doc(hidden)]
4040
pub const LUA_TRACEBACK_STACK: c_int = 11;
4141

42+
// Copied from https://github.com/rust-lang/rust/blob/master/library/std/src/sys/pal/common/alloc.rs
4243
// The minimum alignment guaranteed by the architecture. This value is used to
4344
// add fast paths for low alignment values.
44-
// Copied from https://github.com/rust-lang/rust/blob/master/library/std/src/sys/common/alloc.rs
4545
#[cfg(any(
4646
target_arch = "x86",
4747
target_arch = "arm",
48+
target_arch = "m68k",
49+
target_arch = "csky",
4850
target_arch = "mips",
51+
target_arch = "mips32r6",
4952
target_arch = "powerpc",
5053
target_arch = "powerpc64",
5154
target_arch = "sparc",
52-
target_arch = "asmjs",
5355
target_arch = "wasm32",
5456
target_arch = "hexagon",
55-
all(target_arch = "riscv32", not(target_os = "espidf")),
57+
all(
58+
target_arch = "riscv32",
59+
not(any(target_os = "espidf", target_os = "zkvm"))
60+
),
5661
all(target_arch = "xtensa", not(target_os = "espidf")),
5762
))]
5863
#[doc(hidden)]
5964
pub const SYS_MIN_ALIGN: usize = 8;
6065
#[cfg(any(
6166
target_arch = "x86_64",
6267
target_arch = "aarch64",
68+
target_arch = "arm64ec",
69+
target_arch = "loongarch64",
6370
target_arch = "mips64",
71+
target_arch = "mips64r6",
6472
target_arch = "s390x",
6573
target_arch = "sparc64",
6674
target_arch = "riscv64",
6775
target_arch = "wasm64",
68-
target_arch = "loongarch64",
6976
))]
7077
#[doc(hidden)]
7178
pub const SYS_MIN_ALIGN: usize = 16;
72-
// The allocator on the esp-idf platform guarentees 4 byte alignment.
79+
// The allocator on the esp-idf and zkvm platforms guarantee 4 byte alignment.
7380
#[cfg(any(
74-
all(target_arch = "riscv32", target_os = "espidf"),
81+
all(target_arch = "riscv32", any(target_os = "espidf", target_os = "zkvm")),
7582
all(target_arch = "xtensa", target_os = "espidf"),
7683
))]
7784
#[doc(hidden)]

src/chunk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'lua, 'a> Chunk<'lua, 'a> {
341341
///
342342
/// This is equivalent to calling the chunk function with no arguments and no return values.
343343
pub fn exec(self) -> Result<()> {
344-
self.call(())?;
344+
self.call::<_, ()>(())?;
345345
Ok(())
346346
}
347347

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
7474
// Deny warnings inside doc tests / examples. When this isn't present, rustdoc doesn't show *any*
7575
// warnings at all.
76-
#![doc(test(attr(deny(warnings))))]
76+
#![doc(test(attr(warn(warnings))))] // FIXME: Remove this when rust-lang/rust#123748 is fixed
7777
#![cfg_attr(docsrs, feature(doc_cfg))]
7878

7979
#[macro_use]

src/stdlib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign};
2-
use std::u32;
32

43
/// Flags describing the set of lua standard libraries to load.
54
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]

0 commit comments

Comments
 (0)