Skip to content

Commit 5787ab4

Browse files
authored
Fix compiler and clippy warnings (#105)
Signed-off-by: Michael Rieder <[email protected]>
1 parent f260a80 commit 5787ab4

File tree

4 files changed

+14
-20
lines changed

4 files changed

+14
-20
lines changed

jemalloc-sys/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ is-it-maintained-issue-resolution = { repository = "tikv/jemallocator" }
2626
is-it-maintained-open-issues = { repository = "tikv/jemallocator" }
2727
maintenance = { status = "actively-developed" }
2828

29+
[lints.rust]
30+
unexpected_cfgs = { level = "allow", check-cfg = [
31+
'cfg(jemallocator_docs)',
32+
'cfg(prefixed)',
33+
] }
34+
2935
[dependencies]
3036
libc = { version = "^0.2.8", default-features = false }
3137

jemalloc-sys/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ extern "C" {
387387
/// The behavior is _undefined_ if:
388388
///
389389
/// * `size` is not in range `[req_size, alloc_size]`, where `req_size` is
390-
/// the size requested when performing the allocation, and `alloc_size` is
391-
/// the allocation size returned by [`nallocx`], [`sallocx`], or
392-
/// [`xallocx`],
390+
/// the size requested when performing the allocation, and `alloc_size` is
391+
/// the allocation size returned by [`nallocx`], [`sallocx`], or
392+
/// [`xallocx`],
393393
/// * `ptr` does not match a pointer earlier returned by the memory
394394
/// allocation functions of this crate, or
395395
/// * `ptr` is null, or
@@ -453,8 +453,8 @@ extern "C" {
453453
/// Returns `0` on success, otherwise returns:
454454
///
455455
/// * `EINVAL`: if `newp` is not null, and `newlen` is too large or too
456-
/// small. Alternatively, `*oldlenp` is too large or too small; in this case
457-
/// as much data as possible are read despite the error.
456+
/// small. Alternatively, `*oldlenp` is too large or too small; in this case
457+
/// as much data as possible are read despite the error.
458458
///
459459
/// * `ENOENT`: `name` or mib specifies an unknown/invalid value.
460460
///
@@ -463,7 +463,7 @@ extern "C" {
463463
/// * `EAGAIN`: A memory allocation failure occurred.
464464
///
465465
/// * `EFAULT`: An interface with side effects failed in some way not
466-
/// directly related to `mallctl` read/write processing.
466+
/// directly related to `mallctl` read/write processing.
467467
///
468468
/// [jemalloc_mallctl]: http://jemalloc.net/jemalloc.3.html#mallctl_namespace
469469
#[cfg_attr(prefixed, link_name = "_rjem_mallctl")]

jemallocator/benches/roundtrip.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,13 @@ use tikv_jemalloc_sys::MALLOCX_ALIGN;
1818
static A: Jemalloc = Jemalloc;
1919

2020
// FIXME: replace with jemallocator::layout_to_flags
21-
#[cfg(all(any(
22-
target_arch = "arm",
23-
target_arch = "mips",
24-
target_arch = "mipsel",
25-
target_arch = "powerpc"
26-
)))]
21+
#[cfg(all(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc")))]
2722
const MIN_ALIGN: usize = 8;
2823
#[cfg(all(any(
2924
target_arch = "x86",
3025
target_arch = "x86_64",
3126
target_arch = "aarch64",
3227
target_arch = "powerpc64",
33-
target_arch = "powerpc64le",
3428
target_arch = "loongarch64",
3529
target_arch = "mips64",
3630
target_arch = "riscv64",

jemallocator/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,13 @@ use libc::{c_int, c_void};
4242
// _Alignof(max_align_t), the malloc-APIs return memory whose alignment is
4343
// either the requested size if its a power-of-two, or the next smaller
4444
// power-of-two.
45-
#[cfg(any(
46-
target_arch = "arm",
47-
target_arch = "mips",
48-
target_arch = "mipsel",
49-
target_arch = "powerpc"
50-
))]
45+
#[cfg(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc"))]
5146
const ALIGNOF_MAX_ALIGN_T: usize = 8;
5247
#[cfg(any(
5348
target_arch = "x86",
5449
target_arch = "x86_64",
5550
target_arch = "aarch64",
5651
target_arch = "powerpc64",
57-
target_arch = "powerpc64le",
5852
target_arch = "loongarch64",
5953
target_arch = "mips64",
6054
target_arch = "riscv64",

0 commit comments

Comments
 (0)