Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports and cleanups #675

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --exclude no-std-examples --all-targets
- run: cargo test --workspace --all-targets
- run: cargo test --workspace --doc
- run: cargo run --bin rune -- check --recursive --experimental scripts
- run: cargo run --bin rune -- test --recursive --experimental scripts
Expand Down
7 changes: 1 addition & 6 deletions crates/rune-alloc/src/btree/map/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@ use core::sync::atomic::{AtomicUsize, Ordering::SeqCst};
use rust_alloc::boxed::Box;
use rust_alloc::rc::Rc;

use std::cmp::Ordering;
use std::iter;
use std::mem;
use std::ops::Bound::{self, Excluded, Included, Unbounded};
use std::ops::RangeBounds;
use std::ops::Bound::{Excluded, Included, Unbounded};
use std::panic::{catch_unwind, AssertUnwindSafe};

use rust_alloc::vec;

use crate::clone::TryClone;
use crate::string::{String, TryToString};
use crate::testing::crash_test::{CrashTestDummy, Panic};
use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
use crate::testing::rng::DeterministicRng;
use crate::vec::Vec;

use super::Entry::{Occupied, Vacant};
use super::*;

macro_rules! assert_matches {
Expand Down
3 changes: 0 additions & 3 deletions crates/rune-alloc/src/btree/set/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#![allow(clippy::redundant_closure)]
#![allow(clippy::useless_vec)]

use core::cmp::Ordering;
use core::fmt;
use core::hash::{Hash, Hasher};
use core::ops::Bound::{Excluded, Included};

use rust_alloc::format;
Expand Down
5 changes: 2 additions & 3 deletions crates/rune-alloc/src/hashbrown/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3165,7 +3165,7 @@ impl<T: TryClone, A: Allocator + Clone> RawTable<T, A> {
// cloned so far.
let mut guard = guard((0, &mut *self), |(index, self_)| {
if T::NEEDS_DROP {
for i in 0..=*index {
for i in 0..*index {
if self_.is_bucket_full(i) {
self_.bucket(i).drop();
}
Expand All @@ -3179,7 +3179,7 @@ impl<T: TryClone, A: Allocator + Clone> RawTable<T, A> {
to.write(from.as_ref().try_clone()?);

// Update the index in case we need to unwind.
guard.0 = index;
guard.0 = index + 1;
}

// Successfully cloned all items, no need to clean up.
Expand Down Expand Up @@ -4041,7 +4041,6 @@ mod test_map {
use super::*;

use crate::alloc::into_ok;
use crate::alloc::Global;
use core::convert::Infallible;

fn rehash_in_place<T>(
Expand Down
1 change: 0 additions & 1 deletion crates/rune-alloc/src/ptr/unique.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::convert::From;
use core::fmt;
use core::marker::PhantomData;

Expand Down
1 change: 0 additions & 1 deletion crates/rune-alloc/src/slice/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod macros;

use core::fmt;
use core::iter::FusedIterator;
use core::marker::{Send, Sized, Sync};
use core::slice::{from_raw_parts, from_raw_parts_mut};

use crate::alloc::SizedTypeProperties;
Expand Down