|
6 | 6 | // This file may not be copied, modified, or distributed except according to |
7 | 7 | // those terms. |
8 | 8 |
|
9 | | -use core::{marker::PhantomData, ptr::NonNull}; |
| 9 | +use core::{ |
| 10 | + fmt::{Debug, Formatter}, |
| 11 | + marker::PhantomData, |
| 12 | + ptr::NonNull, |
| 13 | +}; |
10 | 14 |
|
11 | 15 | use super::{inner::PtrInner, invariant::*}; |
12 | | -use crate::{CastType, KnownLayout}; |
| 16 | +use crate::{ |
| 17 | + util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance}, |
| 18 | + AlignmentError, CastError, CastType, KnownLayout, SizeError, TryFromBytes, ValidityError, |
| 19 | +}; |
13 | 20 |
|
14 | 21 | /// Module used to gate access to [`Ptr`]'s fields. |
15 | 22 | mod def { |
@@ -131,7 +138,6 @@ pub use def::Ptr; |
131 | 138 | /// External trait implementations on [`Ptr`]. |
132 | 139 | mod _external { |
133 | 140 | use super::*; |
134 | | - use core::fmt::{Debug, Formatter}; |
135 | 141 |
|
136 | 142 | /// SAFETY: Shared pointers are safely `Copy`. `Ptr`'s other invariants |
137 | 143 | /// (besides aliasing) are unaffected by the number of references that exist |
@@ -172,7 +178,6 @@ mod _external { |
172 | 178 | /// Methods for converting to and from `Ptr` and Rust's safe reference types. |
173 | 179 | mod _conversions { |
174 | 180 | use super::*; |
175 | | - use crate::util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance}; |
176 | 181 |
|
177 | 182 | /// `&'a T` → `Ptr<'a, T>` |
178 | 183 | impl<'a, T> Ptr<'a, T, (Shared, Aligned, Valid)> |
@@ -518,7 +523,6 @@ mod _conversions { |
518 | 523 | /// State transitions between invariants. |
519 | 524 | mod _transitions { |
520 | 525 | use super::*; |
521 | | - use crate::{AlignmentError, TryFromBytes, ValidityError}; |
522 | 526 |
|
523 | 527 | impl<'a, T, I> Ptr<'a, T, I> |
524 | 528 | where |
@@ -829,7 +833,6 @@ mod _transitions { |
829 | 833 | /// Casts of the referent type. |
830 | 834 | mod _casts { |
831 | 835 | use super::*; |
832 | | - use crate::{CastError, SizeError}; |
833 | 836 |
|
834 | 837 | impl<'a, T, I> Ptr<'a, T, I> |
835 | 838 | where |
|
0 commit comments