Skip to content

[pointer] Group imports at the top of the file #2407

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

Merged
merged 1 commit into from
Feb 28, 2025
Merged
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
15 changes: 9 additions & 6 deletions src/pointer/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
// This file may not be copied, modified, or distributed except according to
// those terms.

use core::{marker::PhantomData, ptr::NonNull};
use core::{
fmt::{Debug, Formatter},
marker::PhantomData,
ptr::NonNull,
};

use super::{inner::PtrInner, invariant::*};
use crate::{CastType, KnownLayout};
use crate::{
util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance},
AlignmentError, CastError, CastType, KnownLayout, SizeError, TryFromBytes, ValidityError,
};

/// Module used to gate access to [`Ptr`]'s fields.
mod def {
Expand Down Expand Up @@ -131,7 +138,6 @@ pub use def::Ptr;
/// External trait implementations on [`Ptr`].
mod _external {
use super::*;
use core::fmt::{Debug, Formatter};

/// SAFETY: Shared pointers are safely `Copy`. `Ptr`'s other invariants
/// (besides aliasing) are unaffected by the number of references that exist
Expand Down Expand Up @@ -172,7 +178,6 @@ mod _external {
/// Methods for converting to and from `Ptr` and Rust's safe reference types.
mod _conversions {
use super::*;
use crate::util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance};

/// `&'a T` → `Ptr<'a, T>`
impl<'a, T> Ptr<'a, T, (Shared, Aligned, Valid)>
Expand Down Expand Up @@ -518,7 +523,6 @@ mod _conversions {
/// State transitions between invariants.
mod _transitions {
use super::*;
use crate::{AlignmentError, TryFromBytes, ValidityError};

impl<'a, T, I> Ptr<'a, T, I>
where
Expand Down Expand Up @@ -829,7 +833,6 @@ mod _transitions {
/// Casts of the referent type.
mod _casts {
use super::*;
use crate::{CastError, SizeError};

impl<'a, T, I> Ptr<'a, T, I>
where
Expand Down
Loading