Skip to content

Commit

Permalink
Merge pull request #6 from HadrienG2/fix-nightly-lints
Browse files Browse the repository at this point in the history
Fix lints on nightly
  • Loading branch information
HadrienG2 committed Feb 27, 2024
2 parents bfeec42 + 370d33c commit c0a9830
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/boxed.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Implementation of Pessimize for alloc::boxed

use crate::{assume_accessed, assume_globals_accessed, BorrowPessimize, Pessimize, PessimizeCast};
#[cfg(not(any(feature = "std", test)))]
use std_alloc::boxed::Box;

// NOTE: Can't use pessimize_cast! because making it support ?Sized is too hard
Expand Down Expand Up @@ -57,7 +58,6 @@ where

#[cfg(test)]
mod tests {
use super::*;
use crate::tests::{test_unoptimized_value_type, test_value_type};

// --- Boxed value ---
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ pub(crate) mod tests {
use std::simd::{LaneCount, Simd, SimdElement, SupportedLaneCount};
use std::{
fmt::Debug,
marker::Unpin,
time::{Duration, Instant},
};

Expand Down
1 change: 0 additions & 1 deletion src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use crate::{assume_accessed, BorrowPessimize, Pessimize, PessimizeCast};
use core::{
marker::Unpin,
ops::{Deref, DerefMut},
pin::Pin,
};
Expand Down
8 changes: 3 additions & 5 deletions src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,10 @@ pessimize_references!((&'a T, as_ref, reborrow), (&'a mut T, as_mut, reborrow_mu
#[cfg(test)]
pub(crate) mod tests {
use super::*;
use crate::{
assume_accessed, assume_accessed_imut, assume_read, consume, hide,
tests::assert_unoptimized,
};
use crate::{assume_accessed_imut, assume_read, consume, hide, tests::assert_unoptimized};
use std::{
borrow::{Borrow, BorrowMut},
fmt::Debug,
marker::Unpin,
ops::Deref,
pin::Pin,
};
Expand Down Expand Up @@ -650,6 +646,7 @@ pub(crate) mod tests {
fn as_const_ptr(&self) -> *const Self::Target;

// Like as_const_ptr, but translating back is not UB
#[allow(unused)]
fn to_const_ptr(self) -> *const Self::Target {
self.as_const_ptr()
}
Expand All @@ -668,6 +665,7 @@ pub(crate) mod tests {
// obtained in the same scope or a parent scope, and stop using the
// *const T as soon as the original pointer is back..
//
#[allow(unused)]
unsafe fn from_const_ptr(ptr: *const Self::Target) -> Self;

// Abstraction of &**self
Expand Down
2 changes: 1 addition & 1 deletion src/string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Implementations of Pessimize for alloc::string

use crate::pessimize_collections;
#[cfg(not(any(feature = "std", test)))]
use std_alloc::{string::String, vec::Vec};

// String is basically a Vec<u8> with an UTF-8 validity invariant
Expand All @@ -21,7 +22,6 @@ pessimize_collections!(

#[cfg(test)]
mod tests {
use super::*;
use crate::tests::{test_unoptimized_value_type, test_value_type};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::pessimize_collections;
use core::mem::ManuallyDrop;
#[cfg(not(any(feature = "std", test)))]
use std_alloc::vec::Vec;

// Vec<T> is basically a thin NonNull<T>, a length and a capacity
Expand All @@ -27,7 +28,6 @@ pessimize_collections!(

#[cfg(test)]
mod tests {
use super::*;
use crate::tests::{test_unoptimized_value_type, test_value_type};

#[test]
Expand Down

0 comments on commit c0a9830

Please sign in to comment.