Skip to content

Commit

Permalink
Merge pull request #455 from reitermarkus/fix-ci
Browse files Browse the repository at this point in the history
Fix CI.
  • Loading branch information
Dirbaio committed Feb 25, 2024
2 parents c593fa5 + 7bb2f71 commit f3aa0df
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 165 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ stable_deref_trait = { version = "1", default-features = false }

[dev-dependencies]
ufmt = "0.2"
static_assertions = "1.1.0"

[package.metadata.docs.rs]
features = ["ufmt", "serde", "defmt-03", "mpmc_large", "portable-atomic-critical-section"]
Expand Down
24 changes: 0 additions & 24 deletions cfail/ui/not-send.rs

This file was deleted.

123 changes: 0 additions & 123 deletions cfail/ui/not-send.stderr

This file was deleted.

8 changes: 6 additions & 2 deletions src/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,13 @@ where

#[cfg(test)]
mod tests {
use std::vec::Vec;
use static_assertions::assert_not_impl_any;

use crate::binary_heap::{BinaryHeap, Max, Min};
use super::{BinaryHeap, Max, Min};

// Ensure a `BinaryHeap` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(BinaryHeap<*const (), Max, 4>: Send);
assert_not_impl_any!(BinaryHeap<*const (), Min, 4>: Send);

#[test]
fn static_new() {
Expand Down
7 changes: 6 additions & 1 deletion src/deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,12 @@ where

#[cfg(test)]
mod tests {
use crate::Deque;
use static_assertions::assert_not_impl_any;

use super::Deque;

// Ensure a `Deque` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(Deque<*const (), 4>: Send);

#[test]
fn static_new() {
Expand Down
8 changes: 7 additions & 1 deletion src/histbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,16 @@ impl<'a, T, const N: usize> Iterator for OldestOrdered<'a, T, N> {

#[cfg(test)]
mod tests {
use crate::HistoryBuffer;
use core::fmt::Debug;
use core::sync::atomic::{AtomicUsize, Ordering};

use static_assertions::assert_not_impl_any;

use super::HistoryBuffer;

// Ensure a `HistoryBuffer` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(HistoryBuffer<*const (), 4>: Send);

#[test]
fn new() {
let x: HistoryBuffer<u8, 4> = HistoryBuffer::new_with(1);
Expand Down
12 changes: 9 additions & 3 deletions src/indexmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use core::{
borrow::Borrow,
fmt,
hash::{BuildHasher, Hash},
iter::FromIterator,
mem,
num::NonZeroU32,
ops, slice,
Expand Down Expand Up @@ -1263,10 +1262,17 @@ where

#[cfg(test)]
mod tests {
use crate::{indexmap::Entry, FnvIndexMap};

use core::mem;

use static_assertions::assert_not_impl_any;

use super::{BuildHasherDefault, Entry, FnvIndexMap, IndexMap};

// Ensure a `IndexMap` containing `!Send` keys stays `!Send` itself.
assert_not_impl_any!(IndexMap<*const (), (), BuildHasherDefault<()>, 4>: Send);
// Ensure a `IndexMap` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(IndexMap<(), *const (), BuildHasherDefault<()>, 4>: Send);

#[test]
fn size() {
const CAP: usize = 4;
Expand Down
15 changes: 13 additions & 2 deletions src/indexset.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use crate::indexmap::{self, IndexMap};
use core::{
borrow::Borrow,
fmt,
hash::{BuildHasher, Hash},
iter::FromIterator,
};

use hash32::{BuildHasherDefault, FnvHasher};

use crate::indexmap::{self, IndexMap};

/// An [`IndexSet`] using the default FNV hasher.
///
/// A list of all Methods and Traits available for `FnvIndexSet` can be found in
Expand Down Expand Up @@ -660,3 +661,13 @@ where
}
}
}

#[cfg(test)]
mod tests {
use static_assertions::assert_not_impl_any;

use super::{BuildHasherDefault, IndexSet};

// Ensure a `IndexSet` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(IndexSet<*const (), BuildHasherDefault<()>, 4>: Send);
}
12 changes: 10 additions & 2 deletions src/linear_map.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use core::{borrow::Borrow, fmt, mem, ops, slice};

use crate::Vec;
use core::{borrow::Borrow, fmt, iter::FromIterator, mem, ops, slice};

/// A fixed capacity map/dictionary that performs lookups via linear search.
///
Expand Down Expand Up @@ -492,7 +493,14 @@ where

#[cfg(test)]
mod test {
use crate::LinearMap;
use static_assertions::assert_not_impl_any;

use super::LinearMap;

// Ensure a `LinearMap` containing `!Send` keys stays `!Send` itself.
assert_not_impl_any!(LinearMap<*const (), (), 4>: Send);
// Ensure a `LinearMap` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(LinearMap<(), *const (), 4>: Send);

#[test]
fn static_new() {
Expand Down
7 changes: 6 additions & 1 deletion src/mpmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,12 @@ unsafe fn enqueue<T>(

#[cfg(test)]
mod tests {
use super::Q2;
use static_assertions::assert_not_impl_any;

use super::{MpMcQueue, Q2};

// Ensure a `MpMcQueue` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(MpMcQueue<*const (), 4>: Send);

#[test]
fn sanity() {
Expand Down
5 changes: 5 additions & 0 deletions src/sorted_linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,13 @@ where

#[cfg(test)]
mod tests {
use static_assertions::assert_not_impl_any;

use super::*;

// Ensure a `SortedLinkedList` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(SortedLinkedList<*const (), LinkedIndexU8, (), 4>: Send);

#[test]
fn const_new() {
static mut _V1: SortedLinkedList<u32, LinkedIndexU8, Max, 100> = SortedLinkedList::new_u8();
Expand Down
13 changes: 12 additions & 1 deletion src/spsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,18 @@ impl<'a, T, const N: usize> Producer<'a, T, N> {
mod tests {
use std::hash::{Hash, Hasher};

use crate::spsc::Queue;
use super::{Consumer, Producer, Queue};

use static_assertions::assert_not_impl_any;

// Ensure a `Queue` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(Queue<*const (), 4>: Send);

// Ensure a `Producer` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(Producer<*const (), 4>: Send);

// Ensure a `Consumer` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(Consumer<*const (), 4>: Send);

#[test]
fn full() {
Expand Down
1 change: 0 additions & 1 deletion src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ impl_try_from_num!(u64, 20);
#[cfg(test)]
mod tests {
use crate::{String, Vec};
use core::convert::TryFrom;

#[test]
fn static_new() {
Expand Down
12 changes: 8 additions & 4 deletions src/vec.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use core::{
cmp::Ordering,
fmt, hash,
iter::FromIterator,
mem,
fmt, hash, mem,
mem::{ManuallyDrop, MaybeUninit},
ops, ptr, slice,
};
Expand Down Expand Up @@ -2080,9 +2078,15 @@ where

#[cfg(test)]
mod tests {
use crate::Vec;
use core::fmt::Write;

use static_assertions::assert_not_impl_any;

use crate::Vec;

// Ensure a `Vec` containing `!Send` values stays `!Send` itself.
assert_not_impl_any!(Vec<*const (), 4>: Send);

#[test]
fn static_new() {
static mut _V: Vec<i32, 4> = Vec::new();
Expand Down

0 comments on commit f3aa0df

Please sign in to comment.