Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Oct 17, 2023
1 parent 1bebc62 commit dbc7fb5
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 24 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
- riscv64gc-unknown-linux-gnu
- wasm32-unknown-unknown
- wasm32-unknown-emscripten
- wasm32-wasi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -102,7 +101,7 @@ jobs:
run: |
cargo install cross
cross build --target ${{ matrix.target }}
if: matrix.target != 'wasm32-unknown-unknown'
if: matrix.target != 'wasm32-wasi'
- name: cargo build --target ${{ matrix.target }}
run: |
rustup target add ${{ matrix.target }}
Expand Down Expand Up @@ -198,7 +197,7 @@ jobs:
run: rustup update $nightly && rustup default $nightly
- name: Install rust-src
run: rustup component add rust-src
- name: ASAN / LSAN / TSAN
- name: LSAN
run: ci/sanitizer.sh

miri:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ getrandom = { version = "0.2", features = ["js"] }
[features]
default = ["std"]
std = ["rand", "rand/std", "rand/std_rng"]
# nightly = ["rand/nightly"]
nightly = ["rand/nightly"]

[dependencies]
hashbrown = { version = "0.14", optional = true }
Expand Down
10 changes: 1 addition & 9 deletions ci/sanitizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ set -ex

export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0"

# Run address sanitizer with cargo-hack
RUSTFLAGS="-Z sanitizer=address" \
cargo test --lib

# Run leak sanitizer with cargo-hack
# Run leak sanitizer
RUSTFLAGS="-Z sanitizer=leak" \
cargo test --lib

# Run thread sanitizer with cargo-hack
RUSTFLAGS="-Z sanitizer=thread" \
cargo -Zbuild-std test --lib
8 changes: 5 additions & 3 deletions src/lfu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
//!
//! This module contains LFU based caches, [`WTinyLFUCache`], [`TinyLFU`] and [`SampledLFU`].
//!
pub mod sampled;
pub mod tinylfu;
mod wtinylfu;
mod sampled;
pub use sampled::SampledLFU;
mod tinylfu;
pub use tinylfu::TinyLFU;

mod wtinylfu;
pub use wtinylfu::{WTinyLFUCache, WTinyLFUCacheBuilder};

use crate::{DefaultHashBuilder, KeyRef};
Expand Down
2 changes: 1 addition & 1 deletion src/lfu/tinylfu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl<K: Hash + Eq, KH: KeyHasher<K>> TinyLFU<K, KH> {
keys.iter().for_each(|k| self.increment(k))
}

/// increment multiple hashed keys, for details, please see [`increment_hash`].
/// increment multiple hashed keys, for details, please see [`increment_keys`].
///
/// [`increment_hashed_key`]: struct.TinyLFU.method.increment_hashed_key.html
pub fn increment_hashed_keys(&mut self, khs: &[u64]) {
Expand Down
2 changes: 1 addition & 1 deletion src/lfu/tinylfu/bloom.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This mod implements a Simple Bloom Filter.
//!
//! This file is a mechanical translation of the reference Golang code, available at https://github.com/dgraph-io/ristretto/blob/master/z/bbloom.go
//! This file is a mechanical translation of the reference Golang code, available at [here](https://github.com/dgraph-io/ristretto/blob/master/z/bbloom.go)
//!
//! I claim no additional copyright over the original implementation.
use alloc::vec;
Expand Down
2 changes: 1 addition & 1 deletion src/lfu/tinylfu/sketch/count_min_row.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This mod implements Count Min Row.
//!
//! This file is a mechanical translation of the reference Golang code, available at https://github.com/dgryski/go-tinylfu/blob/master/cm4.go
//! This file is a mechanical translation of the reference Golang code, available at [here](https://github.com/dgryski/go-tinylfu/blob/master/cm4.go)
//!
//! I claim no additional copyright over the original implementation.
use alloc::fmt::format;
Expand Down
2 changes: 1 addition & 1 deletion src/lfu/tinylfu/sketch/count_min_sketch_core.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This mod implements Count-Min sketch with 4-bit counters.
//!
//! This file is a mechanical translation of the reference Golang code, available at https://github.com/dgryski/go-tinylfu/blob/master/cm4.go
//! This file is a mechanical translation of the reference Golang code, available at [here](https://github.com/dgryski/go-tinylfu/blob/master/cm4.go)
//!
//! I claim no additional copyright over the original implementation.
use crate::lfu::tinylfu::error::TinyLFUError;
Expand Down
2 changes: 1 addition & 1 deletion src/lfu/tinylfu/sketch/count_min_sketch_std.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This mod implements Count-Min sketch with 4-bit counters.
//!
//! This file is a mechanical translation of the reference Golang code, available at https://github.com/dgraph-io/ristretto/blob/master/sketch.go
//! This file is a mechanical translation of the reference Golang code, available at [here](https://github.com/dgraph-io/ristretto/blob/master/sketch.go)
//!
//! I claim no additional copyright over the original implementation.
use std::time::{SystemTime, UNIX_EPOCH};
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//! - [ ] `0.4`: Add ttl feature to support
//!
//! ## Related
//! If you want a high-performance thread-safe modern cache, please see https://crates.io/crates/stretto
//! If you want a high-performance thread-safe modern cache, please see [stretto](https://crates.io/crates/stretto)
//!
//! ## Acknowledgments
//! - The implementation of `RawLRU` is highly inspired by
Expand Down Expand Up @@ -88,7 +88,7 @@
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]
// #![cfg_attr(feature = "nightly", feature(negative_impls, auto_traits))]
#![cfg_attr(feature = "nightly", feature(negative_impls, auto_traits))]
#![deny(missing_docs)]
#![allow(clippy::blocks_in_if_conditions)]

Expand Down
2 changes: 1 addition & 1 deletion src/lru/segmented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<K: Hash + Eq, V> SegmentedCache<K, V> {
}

impl<K: Hash + Eq, V, FH: BuildHasher, RH: BuildHasher> SegmentedCache<K, V, FH, RH> {
/// Create a [`AdaptiveCache`] from [`SegmentedCacheBuilder`].
/// Create a [`SegmentedCache`] from [`SegmentedCacheBuilder`].
///
/// # Example
/// ```rust
Expand Down

0 comments on commit dbc7fb5

Please sign in to comment.